From 5647ca687b92954dcf37a6ea6bfbc9a341c32de4 Mon Sep 17 00:00:00 2001 From: dannye <33dannye@gmail.com> Date: Wed, 4 Nov 2020 00:06:44 -0600 Subject: Sync with pokered --- home/hidden_objects.asm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 home/hidden_objects.asm (limited to 'home/hidden_objects.asm') 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 -- cgit v1.3.1-sl0p