Some byte designation corrections + formatting

This commit is contained in:
codemann8
2024-04-09 15:51:05 -05:00
committed by aerinon
parent 0339e09b5d
commit d75c72f85d
24 changed files with 244 additions and 240 deletions

View File

@@ -201,35 +201,37 @@ MirrorBonk:
; Goal: use $20 and $22 to decide to force a bonk
; if we want to bonk branch to .forceBonk
; otherwise fall through to .normal
PHX : PHP
PHB : PHK : PLB
LDA.b OverworldIndex : AND.b #$40 : BEQ .endLoop ;World we're in? branch if we are in LW we don't want bonks
REP #$30
LDX.w #$0000
.loop
LDA.l .bonkRectanglesTable, X ;Load X1
CMP.b LinkPosX : !BGE ++
;IF X > X1
LDA.l .bonkRectanglesTable+2, X ; Load X2
CMP.b LinkPosX : !BLT ++
;IF X < X2
LDA.l .bonkRectanglesTable+4, X ;Load Y1
CMP.b LinkPosY : !BGE ++
;IF Y > Y1
LDA.l .bonkRectanglesTable+6, X ; Load Y2
CMP.b LinkPosY : !BLT ++
;IF Y < Y2
;Bonk Here
PLB : PLP : PLX
BRA .forceBonk
++
TXA : !ADD.w #$0008 : CMP.w #.tableEnd-.bonkRectanglesTable : BEQ .endLoop
TAX
BRA .loop
.endbonkRectanglesTable
PHX : PHP
PHB : PHK : PLB
LDA.b OverworldIndex : AND.b #$40 : BEQ .endLoop ;World we're in? branch if we are in LW we don't want bonks
REP #$30
LDX.w #$0000
.loop
LDA.l .bonkRectanglesTable, X ;Load X1
CMP.b LinkPosX : !BGE ++
;IF X > X1
LDA.l .bonkRectanglesTable+2, X ; Load X2
CMP.b LinkPosX : !BLT ++
;IF X < X2
LDA.l .bonkRectanglesTable+4, X ;Load Y1
CMP.b LinkPosY : !BGE ++
;IF Y > Y1
LDA.l .bonkRectanglesTable+6, X ; Load Y2
CMP.b LinkPosY : !BLT ++
;IF Y < Y2
;Bonk Here
PLB : PLP : PLX
BRA .forceBonk
++
TXA : !ADD.w #$0008 : CMP.w #.tableEnd-.bonkRectanglesTable : BEQ .endLoop
TAX
BRA .loop
.endbonkRectanglesTable
.endLoop
PLB : PLP : PLX
.normal
;Not forcing a bonk, so the vanilla bonk detection run.
LDA.b Scrap0C : ORA.b Scrap0E