summaryrefslogtreecommitdiff
path: root/home/hidden_objects.asm
diff options
context:
space:
mode:
Diffstat (limited to 'home/hidden_objects.asm')
-rw-r--r--home/hidden_objects.asm24
1 files changed, 10 insertions, 14 deletions
diff --git a/home/hidden_objects.asm b/home/hidden_objects.asm
index eccf1c8f..40c49c3e 100644
--- a/home/hidden_objects.asm
+++ b/home/hidden_objects.asm
@@ -1,5 +1,6 @@
UpdateCinnabarGymGateTileBlocks::
- farjp UpdateCinnabarGymGateTileBlocks_
+ farcall UpdateCinnabarGymGateTileBlocks_
+ ret
CheckForHiddenObjectOrBookshelfOrCardKeyDoor::
ldh a, [hLoadedROMBank]
@@ -8,23 +9,19 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor::
bit 0, a ; A button
jr z, .nothingFound
; A button is pressed
- ld a, BANK(CheckForHiddenObject)
- ld [MBC1RomBank], a
- ldh [hLoadedROMBank], a
- call CheckForHiddenObject
+ callbs CheckForHiddenObject
ldh a, [hDidntFindAnyHiddenObject]
and a
jr nz, .hiddenObjectNotFound
- ld a, [wHiddenObjectFunctionRomBank]
- ld [MBC1RomBank], a
- ldh [hLoadedROMBank], a
- ld de, .returnAddress
- push de
- jp hl
-.returnAddress
xor a
+ ldh [hItemAlreadyFound], a
+ ld a, [wHiddenObjectFunctionRomBank]
+ call BankswitchCommon
+ call JumpToAddress
+ ldh a, [hItemAlreadyFound]
jr .done
.hiddenObjectNotFound
+ predef GetTileAndCoordsInFrontOfPlayer
farcall PrintBookshelfText
ldh a, [hFFDB]
and a
@@ -34,6 +31,5 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor::
.done
ldh [hItemAlreadyFound], a
pop af
- ld [MBC1RomBank], a
- ldh [hLoadedROMBank], a
+ call BankswitchCommon
ret