cells: wip debugging cell out of bounds write
authorLukas Krickl <lukas@krickl.dev>
Thu, 24 Apr 2025 03:54:19 +0000 (05:54 +0200)
committerLukas Krickl <lukas@krickl.dev>
Thu, 24 Apr 2025 03:54:19 +0000 (05:54 +0200)
src/cells.s
src/macros.inc

index 2946925b6fc4bcb763e5ca50e87f8fda90cbd2eb..0af0c3a2c932df96c3b56368e36e62422e3ae439 100644 (file)
@@ -74,6 +74,10 @@ cell_road_init:
   push bc
   pop hl ; hl = ptr to tile 
   ld a, BUILDING_ROAD_NORTH_SOUTH
+  
+  assert nc, h, 0x80
+  assert c, h, 0xA0
+
   call bg_update_queue_push
   
   ld bc, cell_road_update
index 728eeac2996ec2761750bb8fa6f46c3f85eef6f0..b618c749deedc902d99a58359fec9d71d199968b 100644 (file)
   ;   $2: register to assert
   ;   $2: value to assert 
 #macro assert
-  cp $2, $3
+.beginscope
+  push af
+  ld a, $2
+  cp a, $3
   jr $1, @noassert REL
-  ld b, b
+  BREAK
 @noassert:
+  pop af
+.endscope
 #endmacro