From: Lukas Krickl Date: Sun, 10 Aug 2025 19:34:08 +0000 (+0200) Subject: unit collision test: writes y and x positon to wram as a return value X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=2ef6563a643054ab4a5555f3bbe8703bd07ef234;p=gbrg%2F.git unit collision test: writes y and x positon to wram as a return value --- diff --git a/src/unit.s b/src/unit.s index b25c071..e592847 100644 --- a/src/unit.s +++ b/src/unit.s @@ -349,9 +349,15 @@ unit_handle_inputs: ; returns: ; unit_test_collision_cf_flags: 0 if not collided with a tile ; FLAGS if collided + ; _pox_y/x: set to input acot y and x #macro unit_test_collision ; perform tile collision check push de + ; write y and x pos + ld a, b + ld [unit_test_collision_pos_y], a + ld a, c + ld [unit_test_collision_pos_x], a call unit_get_pos $1 push bc diff --git a/src/wram.s b/src/wram.s index 2ea1298..56cb518 100644 --- a/src/wram.s +++ b/src/wram.s @@ -37,6 +37,8 @@ status_text: .adv 32 ; stores the last collision flag result ; that was performed by a test collision call unit_test_collision_cf_flags: .adv 1 +unit_test_collision_pos_y: .adv 1 +unit_test_collision_pos_x: .adv 1 ; self modifying code ; the vblank interrupt jumps here