Monochrome graphics library fixed

Post Reply
Well known member
Posts: 1534
Joined: Mon Jul 16, 2007 7:39 pm

Monochrome graphics library fixed

Post by stefano »

The latest improvements introduced a little bit of regression, now mostly fixed.

The basic monochrome function base is now available for all the targets featuring the TMS9918 VDP.
The MSX and SVI targets can reduce the program size and get extra features specifying the "-lmsxbios" or "-lsvibios" library options.

The text mode environment is still slightly target specific, if in trouble please consider to use the ANSI VT library (e.g. -clib=ansi).

If you enjoyed the past example programs I suggest to try the new graphics/hawk.c one, it features a nice trick with bksave()/bkrestore() to animate big pictures in a partially portable way.
Posts: 83
Joined: Sun Sep 09, 2018 5:44 pm

Post by tschak909 »

Cool, thanks, this will definitely help with the platoterm ports to both of the systems.
New member
Posts: 4
Joined: Wed Jul 03, 2019 2:07 am

Post by balloon »

I tried it. It works well.

Code: Select all

#include <graphics.h>
#include <math.h>
#include <stdio.h>

void main() {
  int x, y;

  for (x=0; x<=getmaxx(); x+=2) {
    plot(x, getmaxy() / 2);

  for (x=0; x<=getmaxx(); x++) {
    y = (int)((getmaxy() / 2) * (1.0 - sin(M_PI * 2.0 * x / getmaxx())));
    if (x==0){
      plot(x, y);
    } else {
      drawto(x, y);

  while (getk() < 1){}

Code: Select all

zcc +msx -lm -lndos -lmsxbios -create-app -subtype=disk -bn sin sin.c
Post Reply