Merge pull request #156 from Catobat/HeraBoss

Fix Tower of Hera boss music bug and witch item bug
This commit is contained in:
Lexi Rose
2022-01-20 02:33:27 -06:00
committed by GitHub
5 changed files with 35 additions and 3 deletions

View File

@@ -344,6 +344,7 @@ warnpc $B08000
;$3F reserved for internal debugging ;$3F reserved for internal debugging
;================================================================================ ;================================================================================
;RAM ;RAM
;$7E021B[0x1]: Used by race game instead of $0ABF to avoid witch item conflict
;$7EC900[0x1F00]: BIGRAM buffer ;$7EC900[0x1F00]: BIGRAM buffer
;$7EF000[0x500]: SRAM mirror First 0x500 bytes of SRAM ;$7EF000[0x500]: SRAM mirror First 0x500 bytes of SRAM
;$7F5000[0x800]: Rando's main free ram region ;$7F5000[0x800]: Rando's main free ram region

View File

@@ -214,3 +214,10 @@ FixJingleGlitch:
.exit .exit
RTL RTL
;--------------------------------------------------------------------------------
SetOverworldTransitionFlags:
LDA #$01
STA $0ABF ; used by witch
STA $021B ; used by race game
RTL

View File

@@ -1858,12 +1858,12 @@ NOP #8
;JSL.l OnLoadMap ;JSL.l OnLoadMap
;================================================================================ ;================================================================================
org $028B8F ; <- 10B8F - Bank02.asm:2236 (LDA $7EF374 : LSR A : BCS BRANCH_BETA) org $028B8F ; <- 10B8F - Bank02.asm:2236 (LDA $7EF374 : LSR A : BCS BRANCH_BETA)
LDA $7EF00F : BNE + : NOP JSL CheckHeraBossDefeated : BNE + : NOP
LDX.b #$F1 : STX $012C LDX.b #$F1 : STX $012C
+ +
;================================================================================ ;================================================================================
org $029090 ; <- 11090 - Bank02.asm:3099 (LDA $7EF374 : LSR A : BCS BRANCH_GAMMA) org $029090 ; <- 11090 - Bank02.asm:3099 (LDA $7EF374 : LSR A : BCS BRANCH_GAMMA)
LDA $7EF00F : BNE + : NOP JSL CheckHeraBossDefeated : BNE + : NOP
STX $012C ; DON'T MOVE THIS FORWARD OR MADNESS AWAITS STX $012C ; DON'T MOVE THIS FORWARD OR MADNESS AWAITS
+ +
;================================================================================ ;================================================================================
@@ -2525,6 +2525,22 @@ JSL ParadoxCaveGfxFix
NOP NOP
;================================================================================ ;================================================================================
;================================================================================
; Resolve conflict between race game and witch item
;--------------------------------------------------------------------------------
; Change race game to use $021B instead of $0ABF for detecting cheating
org $0DCB9D ; STZ.w $0ABF
STZ $021B
org $0DCBFE ; LDA.w $0ABF
LDA $021B
org $02BFE0 ; LDA.b #$01 : STA.w $0ABF
JSL SetOverworldTransitionFlags
NOP
; For mirroring, the new flag is set in IncrementOWMirror in stats.asm
;================================================================================
;================================================================================ ;================================================================================
; Player Sprite Fixes ; Player Sprite Fixes
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -283,3 +283,10 @@ Overworld_MosaicDarkWorldChecks:
.done .done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; Check if the boss in ToH has been defeated (16-bit accumulator)
CheckHeraBossDefeated:
LDA $7EF00F : AND #$00FF
RTL
;--------------------------------------------------------------------------------

View File

@@ -428,6 +428,7 @@ IncrementMagicUseCounterOne:
!OW_MIRROR_COUNTER = "$7EF43A" !OW_MIRROR_COUNTER = "$7EF43A"
IncrementOWMirror: IncrementOWMirror:
PHA PHA
LDA #$08 : STA $021B ; fail race game
LDA !LOCK_STATS : BNE + LDA !LOCK_STATS : BNE +
LDA $7EF3CA : BEQ + ; only do this for DW->LW LDA $7EF3CA : BEQ + ; only do this for DW->LW
LDA !OW_MIRROR_COUNTER : INC : STA !OW_MIRROR_COUNTER LDA !OW_MIRROR_COUNTER : INC : STA !OW_MIRROR_COUNTER