Nasty hacks to account for dhgr delay wrt hgr, but the high score display is wrong...
authorNick Downing <nick@ndcode.org>
Mon, 13 Jun 2022 13:50:37 +0000 (23:50 +1000)
committerNick Downing <nick@ndcode.org>
Tue, 14 Jun 2022 07:18:59 +0000 (17:18 +1000)
disasm/Makefile
disasm/shape_compile.py
disasm/star_blazer.asm.patch
emu_65c02/emu_65c02.c

index 2051142..b245233 100644 (file)
@@ -71,7 +71,7 @@ dhgr_pixel_shape_data.inc: pixel.txt shape.txt shape0c.png
 |./shape_compile.py --dhgr --data shape0c.png >$@
        # hack -- wrap shape data around the I/O page at 0xc000 for now
        sed \
--e 's/^shape_b2_text_fuel:/\t.area\tdata1\ndata1_start:\n\n&/' \
+-e 's/^shape_b3_text_empty:/\t.area\tdata1\ndata1_start:\n\n&/' \
 -i $@
 
 pixel_shape_index.inc: pixel.txt shape.txt shape0a.png
index 0c429f9..df96b8d 100755 (executable)
@@ -111,6 +111,24 @@ for line in sys.stdin:
 
   hibit = numpy.zeros((ys,), bool)
   if dhgr:
+    # hack to account for dhgr delay wrt hgr
+    shape1 = numpy.zeros((ys, xs + 4), bool)
+    shape1[:, 3:-1] = shape
+    xs += 4
+    shape = shape1
+    if repeating:
+      shape[:, -2] |= shape[:, 3]
+      shape = shape[:, 4:]
+      xs -= 4
+    elif name[:5] == 'text_': # cannot change the width
+      if not numpy.any(shape[:, :4]):
+        shape = shape[:, 4:]
+      elif not numpy.any(shape[:, -4:]):
+        shape = shape[:, :-4]
+      else:
+        assert False
+      xs -= 4
+
     # compute metrics in original format
     # mimic their single-pixel optimization, but don't otherwise optimize
     width = xs >> 2
@@ -122,7 +140,7 @@ for line in sys.stdin:
       shape[:, 0] |= shape[:, -1]
       shape = shape[:, :-1]
       xs -= 1
-    elif trim < 4 and not numpy.any(shape[:, -trim:]):
+    elif trim < 5 and not numpy.any(shape[:, -trim:]): #4 and not numpy.any(shape[:, -trim:]):
       shape = shape[:, :-trim]
       xs -= trim
     width_bytes = ((xs + 13) // 14) + shiftable # number of DHGR pairs
index 876c0d8..6580423 100644 (file)
@@ -1,5 +1,5 @@
---- star_blazer.asm0   2022-06-13 12:12:34.763863132 +1000
-+++ star_blazer.asm    2022-06-13 12:12:34.767863132 +1000
+--- star_blazer.asm0   2022-06-13 22:29:10.235959486 +1000
++++ star_blazer.asm    2022-06-13 23:42:02.563905402 +1000
 @@ -1,3 +1,8 @@
 +ALIGN = 0
 +DHGR = 1
 -
 +data_end:
 +.if DHGR
-+      .ds     0xf000 - 0xd000 - (. - data1_start)
++      .ds     0xf100 - 0xd000 - (. - data1_start)
 +.else
 +      .ds     0xa800 - 0x4000 - (. - data0_start)
 +.endif
index 017b1c9..6cb59ea 100644 (file)
@@ -190,7 +190,9 @@ struct trace {
   uint8_t max_bitwise;
 } trace[MEM_SIZE][N_TRACE_REGS];
 #endif
+#if 0
 uint8_t start_at_mission = 1;
+#endif
 uint8_t key_waiting;
 uint8_t usleep_lo;
 uint8_t dos_lo;
@@ -558,7 +560,7 @@ uint8_t mem_read(uint16_t addr, bool isDbg) {
     }
 #endif
 
-#if 1 // start at level
+#if 0 // start at level
     if (addr == 0x1726) // opcode fetch
       vrEmu6502SetX(cpu, start_at_mission);
 #endif
@@ -1206,6 +1208,7 @@ int main(int argc, char **argv) {
           SDL_TextInputEvent *e = (SDL_TextInputEvent *)&event;
           int i = e->text[0];
           switch (i) {
+#if 0
           case '1':
           case '2':
           case '3':
@@ -1219,6 +1222,7 @@ int main(int argc, char **argv) {
             // while GAME OVER is displayed, try without it
             //key_waiting = 0x92; // ctrl-r
             break;
+#endif
           case 'b':
           case 'B':
             // full bomb
@@ -1280,7 +1284,7 @@ int main(int argc, char **argv) {
         if (c00x_soft_switches & C00X_SOFT_SWITCH_80VID) {
           // dhgr -- no support for SETDHIRES soft switch yet
           int aux_line = line | 0x10000;
-          int l = 0;
+          int l = 1; // 1 pixel delay, similar to hgr with hi-bit set
           for (int j = 0; j < 40; ++j) {
             int data = mem[aux_line + j];
             for (int k = 0; k < 7; ++k) {