Fix for door overruns

Minor graphical fix for sanc door
This commit is contained in:
aerinon
2023-03-01 15:41:36 -07:00
parent 096157e981
commit b9c8984d6d
4 changed files with 6 additions and 28 deletions

View File

@@ -44,6 +44,8 @@ org $8293d1 ; <- 113d1 - Bank02.asm : 3683 (ADD $20 : STA $20 BRANCH_IOTA)
jsl StraightStairsFix : nop jsl StraightStairsFix : nop
org $829396 ; <- 11396 - Bank02.asm : 3641 (LDA $01C322, X) org $829396 ; <- 11396 - Bank02.asm : 3641 (LDA $01C322, X)
jsl StraightStairLayerFix jsl StraightStairLayerFix
org $82c06d ; <- Bank02.asm : 9874 (LDX $0418, CMP.b #$02)
jsl DoorToStraight : nop
org $82c092 ; STA $0020, Y : LDX #$00 org $82c092 ; STA $0020, Y : LDX #$00
jsl DoorToInroom : nop jsl DoorToInroom : nop
org $82c0f8 ; CMP $02C034, X org $82c0f8 ; CMP $02C034, X
@@ -212,9 +214,5 @@ bcs .normal
rts rts
.normal .normal
; fixes an issue with edges -> normal doors (bombable, dashable, keydoor)
org $82C06A
JSL TransitionCalculateLanding_Fix : NOP #2
org $82C157 org $82C157
JSL AlwaysPushThroughFDoors JSL AlwaysPushThroughFDoors

View File

@@ -1,9 +1,7 @@
; defines ; defines
; Ram usage ; Ram usage
EdgeToNormalFlag = $7E1200
HorzEdge: HorzEdge:
LDA.b #$00 : STA.l EdgeToNormalFlag
cpy #$ff : beq + cpy #$ff : beq +
jsr DetectWestEdge : ldy #$02 : bra ++ jsr DetectWestEdge : ldy #$02 : bra ++
+ jsr DetectEastEdge + jsr DetectEastEdge
@@ -18,7 +16,6 @@ HorzEdge:
+ clc : rts + clc : rts
VertEdge: VertEdge:
LDA.b #$00 : STA.l EdgeToNormalFlag
cpy #$ff : beq + cpy #$ff : beq +
jsr DetectNorthEdge : bra ++ jsr DetectNorthEdge : bra ++
+ jsr DetectSouthEdge + jsr DetectSouthEdge
@@ -62,7 +59,6 @@ LoadEdgeRoomVert:
lda $04 : and #$80 : bne .edge lda $04 : and #$80 : bne .edge
lda $04 : sta $01 ; load up flags in $01 lda $04 : sta $01 ; load up flags in $01
and #$03 : cmp #$03 : beq .inroom and #$03 : cmp #$03 : beq .inroom
LDA.b #$01 : STA.l EdgeToNormalFlag
ldy #$01 : jsr ShiftVariablesMainDir ldy #$01 : jsr ShiftVariablesMainDir
jsr PrepScrollToNormal jsr PrepScrollToNormal
bra .scroll bra .scroll
@@ -302,22 +298,6 @@ DetectEastEdge:
ldx #$08 ldx #$08
.end txa : rts .end txa : rts
TransitionCalculateLanding_Fix:
LDA.l EdgeToNormalFlag : BEQ +
LDX.w $0418 : CPX.b #$01 : BNE +
LDA.b $20 : SBC #$08 : STA.b $20
+ PHK : PEA.w .jslrtsreturn-1
PEA.w $02802C
JML CalculateTransitionLanding
.jslrtsreturn
LDX.w $0418 : CPX.b #$01 : BNE .zero ; the LDX is vanilla and needs to always run
LDA.l EdgeToNormalFlag : BEQ +
LDA.b $20 : ADC #$08 : STA.b $20
.zero LDA.b #$00 : STA.l EdgeToNormalFlag
+ JSL DoorToStraight
RTL
AlwaysPushThroughFDoors: AlwaysPushThroughFDoors:
PHA : AND.b #$F0 : CMP.b #$F0 : BNE + PHA : AND.b #$F0 : CMP.b #$F0 : BNE +
PLA : RTL PLA : RTL

View File

@@ -133,6 +133,7 @@ AdjustEscapeDoorGraphics:
STA.l $7E2000+$102,X STA.l $7E2000+$102,X
ORA.w #$4000 ; horizontally flip ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$104,X STA.l $7E2000+$104,X
RTL
.fix_swamp_entrance .fix_swamp_entrance
LDY.w $0460 ; get door index LDY.w $0460 ; get door index

View File

@@ -364,8 +364,7 @@ DoorToStraight:
lda $a0 : cmp #$51 : bne .skip lda $a0 : cmp #$51 : bne .skip
lda #$04 : sta $4e lda #$04 : sta $4e
.skip pla .skip pla
; the ldx $0418 is now taken care of by TransitionCalculateLanding_Fix .end LDX.w $0418 : CMP.b #$02 ; what we wrote over
.end cmp #$02 ;what we wrote over
rtl rtl
} }
@@ -434,8 +433,8 @@ HandleSpecialDoorLanding: {
.noDoor .noDoor
PLA PLA
CMP #$34 : bne + ; inroom stairs CMP.b #$34 : BNE + ; inroom stairs
PHA : LDA #$26 : STA $045E : PLA PHA : LDA.b #$26 : STA.w $045E : PLA
+ +
RTL RTL
} }