From 57a1a4067db565c3fa041af38e1a2104a1316651 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Thu, 24 Apr 2025 05:54:19 +0200 Subject: [PATCH] cells: wip debugging cell out of bounds write --- src/cells.s | 4 ++++ src/macros.inc | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) 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 -- 2.30.2