mapgen: Fixed crash caused by relative address absolute jump
authorLukas Krickl <lukas@krickl.dev>
Thu, 28 Aug 2025 04:17:10 +0000 (06:17 +0200)
committerLukas Krickl <lukas@krickl.dev>
Thu, 28 Aug 2025 04:17:10 +0000 (06:17 +0200)
I have no idea how this did not crash every time.

src/mapgen.s
src/sys.s

index 3748826bd7373923acb9c6944ecb83d49e13d8e0..1c6fe7719337a719e33baba79ae3dac6c673d7c9 100644 (file)
@@ -631,8 +631,8 @@ mapgen_select_player_spawn:
                ld a, h
                or a, l
                pop bc
-               jp nz, @try_placement_again REL
 
+               jp nz, @try_placement_again
        ; otherwise write position
        ld hl, player_unit
        ld de, act_pos_y
index 8b89195c75acc919d5dda5c73ab9f984387c065f..3d1972d49bd6a52d70c1a4cb56a195cef7ce8384 100644 (file)
--- a/src/sys.s
+++ b/src/sys.s
@@ -29,6 +29,7 @@ enableinterrupts:
   ; disables interrupts
   ; writes 0 to IE 
   ; leaves shadow_ie as is
+disableinterrupts:
 disableinterrutpts:
   ld a, 0
   ld [IE], a