This program will produce VT/ANSI compatible ESCAPE sequences to test the emulation engine.
#include "stdio.h" main() { int x; /* Set default text attributes (white on black) */ printf ("%c[m",27); /* Clear screen in non-ANSI mode*/ printf ("%c",12); /* A stupid CSI escape code test (normally no use uses CSI) */ printf ("If you can read this, CSI is not working.\n"); printf ("%c2J",155); printf ("If this is the first thing you can read, CSI is OK.\n"); /* Set Graphic Rendition test */ printf ("%c[1mBold Text\n",27); printf ("%c[2mDim text\n",27); printf ("%c[4mUnderlined Text\n",27); printf ("%c[24mUn-underlined text\n",27); printf ("%c[7mReverse Text\n",27); printf ("%c[27mUn-reverse text\n",27); for (x=37; x>29; x--) { printf ("%c[%umFore text color %u.\n",27,x,x); } for (x=40; x<48; x++) { printf ("%c[%umBack text color %u.\n",27,x,x); } /* Restore default text attributes */ printf ("%c[m",27); /* Cursor Position test "Draw" an X */ for (x=0; x<11; x++) { printf ("%c[%u;%uH*\n",27,10+x,25+x); printf ("%c[%u;%uH*\n",27,20-x,25+x); } }
Compile it with the following command:
zcc +zx -clib=ansi -lndos -create-app -o ansitest ansitest.c
It will make a file named “ansitest.tap”, producing the following output:
Compile it with the following command:
zcc +mz -clib=ansi -create-app -o ansitest ansitest.c
It will make a file named “ansitest.m12”, producing the following output:
Compile it with the following command:
zcc +bee -create-app -clib=ansi -o ansitest ansitest.c
It will make the file “ANSITEST.BEE”. The display will be intialized to 80×25 columns:
Compile it with the following command:
zcc +cpc -clib=ansi -lndos -create-app -o ansitest ansitest.c
It will make a file named “ansitest.cpc” and a pure binary version (ansitest.bin).
To show all the text colors, the program can be run in video mode 0:
Compile it with the following command:
zcc +abc80 -clib=ansi -create-app -oansitest ansitest.c
It will make a file named “ansitest.bac”, containing a BASIC loader with the machine code program stored in DATA lines.
Compile it with the following command:
zcc +vg5k -subtype=wav -clib=ansi -create-app ansitest.c
It will make a .K7 file and its related .WAV file.
To run it, just CLOAD it on your VG-5000 and run with “CALL 20480”.
Compile it with the following command:
zcc +z9001 -clib=ansi -create-app ansitest.c
It will make a .tap file.
Compile it with the following command:
zcc +c128 -clib=ansi ansitest.c
Convert it to a disk compatible format, and put it in a disk image with the c1541 tool (from the VICE emulator package):
bin3000 a.bin z80mc c1541 loader.d64 c1541 #8> write z80mc Writing file `Z80MC' as `Z80MC' to unit 8. c1541 #8> exit
Use the Z80RUN loader to run it in z80mode; the following output is generated:
This is a different version of the same example code for tiny, monochrome displays. It is meant for the LCD based devices.
#include "stdio.h" main() { int x; /* A stupid CSI escape code test (normally no use uses CSI) */ printf ("If you can read this, CSI is not working.\n"); printf ("%c2J",155); printf ("If this is the first thing you can read, CSI is OK.\n"); /* Cursor Position test "Draw" an X */ for (x=0; x<5; x++) { printf ("%c[%u;%uH*\n",27,1+x,21+x); printf ("%c[%u;%uH*\n",27,5-x,21+x); } /* Set Graphic Rendition test */ printf ("%c[1mBold Text\n",27); printf ("%c[2mDim text\n",27); printf ("%c[4mUnderlined Text\n",27); printf ("%c[24mUn-underlined text\n",27); printf ("%c[7mReverse Text\n",27); printf ("%c[27mUn-reverse text\n",27); /* Restore default text attributes */ printf ("%c[m",27); }
Compile it with the following command:
zcc +ti82 -clib=ansi -create-app -oansitest ansitest.c
It will create a file named “ansitest.82p”; the following picture shows its output when run in the “CRASH” shell:
Compile it with the following command:
zcc +ti83 -clib=ansi -create-app -oansitest ansitest.c
It will create a file named “ansitest.83p”; the following picture shows its output when run in the “ION” shell:
Compile it with the following command:
zcc +ti8x -clib=ansi -create-app -oansitest ansitest.c
It will create a file named “ansitest.8xp”; the following picture shows its output when run in the “ION” shell:
Compile it with the following command:
zcc +ti85 -clib=ansi -create-app -oansitest ansitest.c
It will create a file named “ansitest.85s”; the following picture shows its output when run in the “RIGEL” shell:
Compile it with the following command:
zcc +ti86 -clib=ansi -create-app -oansitest -startup=10 ansitest.c
It will create a file named “ansitest.86p”; the following picture shows its output when run with the command “asm(ansitest)”: