diff options
| author | Rangi <35663410+Rangi42@users.noreply.github.com> | 2026-01-07 22:05:37 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-07 22:05:37 -0500 |
| commit | 0e49aef88ef94b9d3e80d89e4eb718e9425045df (patch) | |
| tree | c63433287b9e2aceda14ff977cc06875cd0735d3 /home/hidden_events.asm | |
| parent | Use macros to enforce "missable/hide/show object" constraints, and rename the... (diff) | |
| download | pokeyellow-0e49aef88ef94b9d3e80d89e4eb718e9425045df.tar.gz pokeyellow-0e49aef88ef94b9d3e80d89e4eb718e9425045df.tar.xz pokeyellow-0e49aef88ef94b9d3e80d89e4eb718e9425045df.zip | |
Use macros to enforce "hidden object" constraints, and rename them to "hidden events" (#559)
Diffstat (limited to 'home/hidden_events.asm')
| -rw-r--r-- | home/hidden_events.asm | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/home/hidden_events.asm b/home/hidden_events.asm new file mode 100644 index 00000000..5acc95d9 --- /dev/null +++ b/home/hidden_events.asm @@ -0,0 +1,39 @@ +UpdateCinnabarGymGateTileBlocks:: + farjp UpdateCinnabarGymGateTileBlocks_ + +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) + ld [rROMB], a + ldh [hLoadedROMBank], a + call CheckForHiddenEvent + ldh a, [hDidntFindAnyHiddenEvent] + and a + jr nz, .hiddenEventNotFound + ld a, [wHiddenEventFunctionRomBank] + ld [rROMB], a + ldh [hLoadedROMBank], a + ld de, .returnAddress + push de + jp hl +.returnAddress + xor a + jr .done +.hiddenEventNotFound + farcall PrintBookshelfText + ldh a, [hInteractedWithBookshelf] + and a + jr z, .done +.nothingFound + ld a, $ff +.done + ldh [hItemAlreadyFound], a + pop af + ld [rROMB], a + ldh [hLoadedROMBank], a + ret |
