aboutsummaryrefslogtreecommitdiffstats
path: root/home/hidden_events.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2026-01-17 22:38:33 -0600
committerdannye <33dannye@gmail.com>2026-01-17 22:38:33 -0600
commitbc2354dd6626ce28bb9561547ed2107cfa56c18e (patch)
tree5902d4c3389253c76b7c3351e0d7dfecb551c28d /home/hidden_events.asm
parentIdentify characters in `_OakSpeechText2B` and `Printer_GetMonStats.IDNo` (#144) (diff)
parentUse macros for `WildMonEncounterSlotChances` (#562) (diff)
downloadpokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.gz
pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.xz
pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'home/hidden_events.asm')
-rw-r--r--home/hidden_events.asm37
1 files changed, 37 insertions, 0 deletions
diff --git a/home/hidden_events.asm b/home/hidden_events.asm
new file mode 100644
index 00000000..ae8ee439
--- /dev/null
+++ b/home/hidden_events.asm
@@ -0,0 +1,37 @@
+UpdateCinnabarGymGateTileBlocks::
+ farcall UpdateCinnabarGymGateTileBlocks_
+ ret
+
+CheckForHiddenEventOrBookshelfOrCardKeyDoor::
+ ldh a, [hLoadedROMBank]
+ push af
+ ldh a, [hJoyHeld]
+ bit B_PAD_A, a
+ jr z, .nothingFound
+; A button is pressed
+ ld a, BANK(CheckForHiddenEvent)
+ call BankswitchCommon
+ call CheckForHiddenEvent
+ ldh a, [hDidntFindAnyHiddenEvent]
+ and a
+ jr nz, .hiddenEventNotFound
+ xor a
+ ldh [hItemAlreadyFound], a
+ ld a, [wHiddenEventFunctionRomBank]
+ call BankswitchCommon
+ call JumpToAddress
+ ldh a, [hItemAlreadyFound]
+ jr .done
+.hiddenEventNotFound
+ predef GetTileAndCoordsInFrontOfPlayer
+ farcall PrintBookshelfText
+ ldh a, [hInteractedWithBookshelf]
+ and a
+ jr z, .done
+.nothingFound
+ ld a, $ff
+.done
+ ldh [hItemAlreadyFound], a
+ pop af
+ call BankswitchCommon
+ ret