diff options
author | dannye <33dannye@gmail.com> | 2020-11-04 00:06:44 -0600 |
---|---|---|
committer | dannye <33dannye@gmail.com> | 2020-11-04 00:06:44 -0600 |
commit | 5647ca687b92954dcf37a6ea6bfbc9a341c32de4 (patch) | |
tree | dde1937a1bfdb3a835f4155e1c2eb8f1aaf86f63 /home/hidden_objects.asm | |
parent | 53fcd05aa24693093d8af1dc8ec4fedd3957decc (diff) |
Sync with pokered
Diffstat (limited to 'home/hidden_objects.asm')
-rw-r--r-- | home/hidden_objects.asm | 35 |
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 |