aboutsummaryrefslogtreecommitdiff
path: root/mkportstats.c
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2015-12-31 03:00:46 -0500
committerB. Watson <yalhcru@gmail.com>2015-12-31 03:00:46 -0500
commit0ab84dd41eabd424420530efa36ac6147379706c (patch)
tree186240740abb0dd7b71f7f872e7a261261175340 /mkportstats.c
parente947bd066312e3fcaaad62914126ac9270e79fbf (diff)
downloadtaipan-0ab84dd41eabd424420530efa36ac6147379706c.tar.gz
faster screen updates, requires git cc65
Diffstat (limited to 'mkportstats.c')
-rw-r--r--mkportstats.c55
1 files changed, 55 insertions, 0 deletions
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 <conio.h>
+#include <stdio.h>
+#include <peekpoke.h>
+
+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;
+}