From 00ad0119b1e24e5283edf45f37018f5ff2663a46 Mon Sep 17 00:00:00 2001 From: jojobear13 Date: Thu, 18 Jan 2024 11:31:38 -0600 Subject: [PATCH] improved fix for border block glitch --- home/overworld.asm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/home/overworld.asm b/home/overworld.asm index 93c77f74..2216869b 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -2082,17 +2082,12 @@ LoadMapHeader:: ld a, [wCurMap] call SwitchToMapRomBank ld a, [wCurMapTileset] - ld b, a + bit 7, a res 7, a ld [wCurMapTileset], a ldh [hPreviousTileset], a - bit 7, b - - ;replace the conditional return with a nop in order to always load the map header data... - ;...even when selecting CONTINUE from the main menu -; ret nz - nop - +; ret nz ;comment this out so that the header data always loads + push af ;preserve the bit check for later to tell if CONTINUE is being selected ld hl, MapHeaderPointers ld a, [wCurMap] sla a @@ -2150,7 +2145,7 @@ LoadMapHeader:: ld [wObjectDataPointerTemp], a ld a, [hli] ld [wObjectDataPointerTemp + 1], a - push hl +; push hl ; save hl before going to the warp/sign/sprite data (this value is saved for seemingly no purpose) ld a, [wObjectDataPointerTemp] ld l, a ld a, [wObjectDataPointerTemp + 1] @@ -2158,6 +2153,9 @@ LoadMapHeader:: ld de, wMapBackgroundTile ld a, [hli] ld [de], a + pop af ;we're done if loading from the CONTINUE option of the main menu + ret nz + nop ;padding .loadWarpData ld a, [hli] ld [wNumberOfWarps], a @@ -2330,7 +2328,7 @@ LoadMapHeader:: .finishUp predef LoadTilesetHeader callfar LoadWildData - pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose) +; pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose) ld a, [wCurMapHeight] ; map height in 4x4 tile blocks add a ; double it ld [wCurrentMapHeight2], a ; store map height in 2x2 tile blocks