From c04b230721bf6507a4ed65b80a29392ce309365d Mon Sep 17 00:00:00 2001 From: Karkat Date: Fri, 3 Nov 2017 20:40:45 -0400 Subject: [PATCH] pre v27 fixes added dungeon exit hook added 2nd option for compass mode (always on) fixed compass mode to stop drawing outside dungeons --- compasses.asm | 9 ++++++--- events.asm | 8 ++++++++ hooks.asm | 9 ++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/compasses.asm b/compasses.asm index df2ae2e..c96b9e8 100644 --- a/compasses.asm +++ b/compasses.asm @@ -3,13 +3,16 @@ ;-------------------------------------------------------------------------------- !GOAL_COUNTER = "$7EF460" DrawDungeonCompassCounts: - LDA.l CompassMode : AND.w #$00FF : BNE + : RTL : + ; Item Counts LDA $1B : AND.w #$00FF : BNE + : RTL : + ; Skip if outdoors LDA $040C : CMP.w #$00FF : BNE + : RTL : + ; Skip if not in a dungeon + LDA.l CompassMode : AND.w #$00FF : BNE + : RTL : + ; Item Counts PHX LDX $040C ; Load dungeon ID to X - LDA $7EF364 : AND .item_masks, X ; Load compass values to A, mask with dungeon item masks - BNE + : BRL .done : + ; skip if we don't have compass + + CMP.w #$0002 : BEQ ++ ; if CompassMode==2, we don't check for the compass + LDA $7EF364 : AND .item_masks, X ; Load compass values to A, mask with dungeon item masks + BNE + : BRL .done : + ; skip if we don't have compass + ++ LDA $040C CMP.w #$0000 : BNE + ; Sewer Passage diff --git a/events.asm b/events.asm index 9ccbd5a..9962b6d 100644 --- a/events.asm +++ b/events.asm @@ -26,6 +26,14 @@ OnDungeonEntrance: STA $7EC172 ; thing we wrote over RTL ;-------------------------------------------------------------------------------- +OnDungeonExit: + STA $040C : STZ $04AC ; thing we wrote over + + PHA : PHP + JSL.l HUD_RebuildLong + PLP : PLA +RTL +;-------------------------------------------------------------------------------- !RNG_ITEM_LOCK_IN = "$7F5090" OnFileLoad: LDA !FRESH_FILE_MARKER : BNE + diff --git a/hooks.asm b/hooks.asm index 5ac504c..6d9ad45 100644 --- a/hooks.asm +++ b/hooks.asm @@ -29,6 +29,13 @@ org $02D8C7 ; <- 158C7 - Bank02.asm : 10981 (STA $7EC172) JSL.l OnDungeonEntrance ;-------------------------------------------------------------------------------- +;================================================================================ +; Dungeon Exit Hook +;-------------------------------------------------------------------------------- +org $02E21B ; <- 1621B - Bank02.asm : 11211 (STA $040C) +JSL.l OnDungeonExit : NOP #2 +;-------------------------------------------------------------------------------- + ;================================================================================ ; Hash Key Display ;-------------------------------------------------------------------------------- @@ -888,7 +895,7 @@ JSL.l RNG_Trinexx ;-------------------------------------------------------------------------------- org $0DFC77 ; <- 6FC77 - headsup_display.asm : 845 NOP #$2D ; #45 -org $0DFC77 ; <- 6FC77 +org $0DFC77 ; <- 6FC77 - yes these are both the correct address - kkat JSL.l OnDrawHud BRA $27