aboutsummaryrefslogtreecommitdiffstats
path: root/home/hidden_objects.asm
diff options
context:
space:
mode:
Diffstat (limited to 'home/hidden_objects.asm')
-rw-r--r--home/hidden_objects.asm35
1 files changed, 35 insertions, 0 deletions
diff --git a/home/hidden_objects.asm b/home/hidden_objects.asm
new file mode 100644
index 00000000..40c49c3e
--- /dev/null
+++ b/home/hidden_objects.asm
@@ -0,0 +1,35 @@
+UpdateCinnabarGymGateTileBlocks::
+ farcall UpdateCinnabarGymGateTileBlocks_
+ ret
+
+CheckForHiddenObjectOrBookshelfOrCardKeyDoor::
+ ldh a, [hLoadedROMBank]
+ push af
+ ldh a, [hJoyHeld]
+ bit 0, a ; A button
+ jr z, .nothingFound
+; A button is pressed
+ callbs CheckForHiddenObject
+ ldh a, [hDidntFindAnyHiddenObject]
+ and a
+ jr nz, .hiddenObjectNotFound
+ 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
+ jr z, .done
+.nothingFound
+ ld a, $ff
+.done
+ ldh [hItemAlreadyFound], a
+ pop af
+ call BankswitchCommon
+ ret