diff options
Diffstat (limited to 'mkportstats.c')
-rw-r--r-- | mkportstats.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/mkportstats.c b/mkportstats.c index d4358cc..1287c6c 100644 --- a/mkportstats.c +++ b/mkportstats.c @@ -2,6 +2,15 @@ #include <stdio.h> #include <peekpoke.h> +#define FILENAME "H:PORTSTAT.DAT" + +/* 0-based. Set to 1 because we don't include the top + row (all spaces anyway) */ +#define TOPLINE 1 + +/* Used to be 15, taipan.c now draws the horizontal line itself */ +#define LINES 14 + void port_stats() { cursor(0); clrscr(); @@ -42,14 +51,27 @@ void port_stats() { cputsxy(29, 11, "Ship Status"); cputsxy(0, 14, "Cash: "); cputsxy(20, 14, "Bank: "); + gotoxy(0, 17); +} + +void finish(void) { + printf("You can exit the emulator now.\n"); + while(1) + ; } int main(void) { - char *screenmem = PEEK(88)+256*PEEK(89); - FILE *f = fopen("H:PORTSTAT.DAT", "wb"); + char *screenmem = (char *) (PEEK(88)+256*PEEK(89)); + FILE *f = fopen(FILENAME, "wb"); + if(!f) { + printf("\nCan't create " FILENAME "\n"); + printf("Is the H: device configured?\n"); + finish(); + } port_stats(); - fwrite(screenmem + 40, 40, 15, f); + fwrite(screenmem + (40 * TOPLINE), 40, LINES, f); fclose(f); - cgetc(); + printf("\n" FILENAME " written\n"); + finish(); return 0; } |