diff options
Diffstat (limited to 'home/hidden_events.asm')
| -rw-r--r-- | home/hidden_events.asm | 37 |
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 |
