From: Lukas Krickl Date: Thu, 24 Apr 2025 03:54:19 +0000 (+0200) Subject: cells: wip debugging cell out of bounds write X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=57a1a4067db565c3fa041af38e1a2104a1316651;p=gbrg%2F.git cells: wip debugging cell out of bounds write --- diff --git a/src/cells.s b/src/cells.s index 2946925..0af0c3a 100644 --- a/src/cells.s +++ b/src/cells.s @@ -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 diff --git a/src/macros.inc b/src/macros.inc index 728eeac..b618c74 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -84,10 +84,15 @@ ; $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