From 0ab84dd41eabd424420530efa36ac6147379706c Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 31 Dec 2015 03:00:46 -0500 Subject: faster screen updates, requires git cc65 --- mkportstats.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 mkportstats.c (limited to 'mkportstats.c') diff --git a/mkportstats.c b/mkportstats.c new file mode 100644 index 0000000..0d4d374 --- /dev/null +++ b/mkportstats.c @@ -0,0 +1,55 @@ +#include +#include +#include + +void port_stats() { + cursor(0); + clrscr(); + chlinexy(1, 1, 26); + chlinexy(1, 7, 26); + chlinexy(1, 13, 26); + cvlinexy(0, 2, 5); + cvlinexy(27, 2, 5); + cvlinexy(0, 8, 5); + cvlinexy(27, 8, 5); + chlinexy(0, 15, 40); + + cputcxy(0, 1, 17); // upper left corner + cputcxy(0, 7, 1); // |- + cputcxy(0, 13, 26); // lower left corner + + cputcxy(27, 1, 5); // upper right corner + cputcxy(27, 7, 4); // -| + cputcxy(27, 13, 3); // lower right corner + + cputsxy(1, 2, "Hong Kong Warehouse"); + cputsxy(4, 3, "Opium In use"); + cputsxy(4, 4, "Silk "); + cputsxy(4, 5, "Arms Vacant"); + cputsxy(4, 6, "General "); + cputsxy(1, 8, "Hold "); + cputsxy(16, 8, "Guns "); + + cputsxy(4, 9, "Opium "); + cputsxy(4, 10, "Silk "); + cputsxy(4, 11, "Arms "); + cputsxy(4, 12, "General "); + cputsxy(32, 2, "Date"); + cputsxy(29, 3, "15 "); + + cputsxy(30, 5, "Location"); + cputsxy(32, 8, "Debt"); + cputsxy(29, 11, "Ship Status"); + cputsxy(0, 14, "Cash: "); + cputsxy(20, 14, "Bank: "); +} + +int main(void) { + char *screenmem = PEEK(88)+256*PEEK(89); + FILE *f = fopen("H:PORTSTAT.DAT", "wb"); + port_stats(); + fwrite(screenmem, 40, 16, f); + fclose(f); + cgetc(); + return 0; +} -- cgit v1.2.3