From a1fafb72cd37eeca260e7065fe05b2c3253b5bdc Mon Sep 17 00:00:00 2001 From: Catobat <69204835+Catobat@users.noreply.github.com> Date: Sun, 31 Oct 2021 21:16:09 +0100 Subject: [PATCH 1/3] Keep dungeon tileset after opening the map --- doortables.asm | 2 ++ drhooks.asm | 3 +++ gfx.asm | 10 ++++++++++ 3 files changed, 15 insertions(+) diff --git a/doortables.asm b/doortables.asm index eae1643..90678ca 100644 --- a/doortables.asm +++ b/doortables.asm @@ -681,6 +681,8 @@ db $00,$07,$20,$20,$07,$07,$07,$07,$07,$20,$20,$07,$20,$20,$20,$20 db $07,$07,$02,$02,$02,$02,$07,$07,$07,$20,$20,$07,$20,$20,$20,$07 ;27f300 +DungeonTilesets: +db $04,$04,$05,$12,$04,$08,$07,$0C,$09,$0B,$05,$0A,$0D,$0E,$06,$06 ; ;org $27ff00 diff --git a/drhooks.asm b/drhooks.asm index 1d3b485..f067dad 100644 --- a/drhooks.asm +++ b/drhooks.asm @@ -76,6 +76,9 @@ nop : jsl OverridePaletteHeader org $02817e ; Bank02.asm : 414 (LDA $02811E, X) jsl FixAnimatedTiles +org $0aef43 ; UnderworldMap_RecoverGFX +jsl FixCloseDungeonMap + org $028a06 ; Bank02.asm : 1941 Dungeon_ResetTorchBackgroundAndPlayer JSL FixWallmasterLamp diff --git a/gfx.asm b/gfx.asm index b22fba6..94cb884 100644 --- a/gfx.asm +++ b/gfx.asm @@ -45,6 +45,16 @@ FixAnimatedTiles: + LDA $02802E, X ; what we wrote over RTL +FixCloseDungeonMap: + LDA.l DRMode : CMP #$02 : BNE .vanilla + LDA $040C : BMI .vanilla + LSR : TAX + LDA.l DungeonTilesets,x + RTL + .vanilla + LDA $7EC20E + RTL + FixWallmasterLamp: ORA $0458 STY $1C : STA $1D : RTL ; what we wrote over From 3f34e50a62fd9144a152ab1eec9525dfa59ba2a3 Mon Sep 17 00:00:00 2001 From: Catobat <69204835+Catobat@users.noreply.github.com> Date: Sun, 31 Oct 2021 21:17:18 +0100 Subject: [PATCH 2/3] Improve transition animation from straight stairs --- doorrando.asm | 1 + normal.asm | 10 +++++++--- scroll.asm | 6 +++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/doorrando.asm b/doorrando.asm index 807095c..8cceeba 100644 --- a/doorrando.asm +++ b/doorrando.asm @@ -9,6 +9,7 @@ ; Normal doors use $FE to store the trap door indicator ; Normal doors use $045e to store Y coordinate when transitioning to in-room stairs ; Normal doors use $045f to determine the order in which supertile quadrants are drawn +; Straight stairs use $046d to store X coordinate on animation start ; Spiral doors use $045e to store stair type ; Gfx uses $b1 to for sub-sub-sub-module thing diff --git a/normal.asm b/normal.asm index 3bdf962..5ac2524 100644 --- a/normal.asm +++ b/normal.asm @@ -150,15 +150,14 @@ LoadRoomVert: .notEdge lda $01 : and #$03 : cmp #$03 : bne .normal jsr ScrollToInroomStairs + stz $046d bra .end .normal ldy #$01 : jsr ShiftVariablesMainDir jsr PrepScrollToNormal .scroll - lda $01 : and #$40 : pha + lda $01 : and #$40 : sta $046d jsr ScrollX - pla : beq .end - ldy #$00 : jsr ApplyScroll .end plb ; restore db register rts @@ -291,6 +290,11 @@ StraightStairsAdj: stx $0464 : sty $012e ; what we wrote over lda.l DRMode : beq + lda $045e : bne .toInroom + lda $046d : beq .noScroll + sta $22 + ldy #$00 : jsr ApplyScroll + stz $046d + .noScroll jsr GetTileAttribute : tax lda $11 : cmp #$12 : beq .goingNorth lda $a2 : cmp #$51 : bne ++ diff --git a/scroll.asm b/scroll.asm index f66918c..435b5c9 100644 --- a/scroll.asm +++ b/scroll.asm @@ -168,7 +168,11 @@ ScrollX: ;change the X offset variables pla : sta $00 sep #$30 - lda $04 : sta $22 + lda $04 : ldx $046d : bne .straight + sta $22 : bra + + .straight + sta $046d ; set X position later + + lda $00 : sta $23 : sta $0609 : sta $060d lda $01 : sta $a9 lda $0e : asl : ora $ac : sta $ac From 1e6d79badc1f6b454bd9a067b6d56a50812e0679 Mon Sep 17 00:00:00 2001 From: Catobat <69204835+Catobat@users.noreply.github.com> Date: Sun, 31 Oct 2021 23:16:47 +0100 Subject: [PATCH 3/3] Fix bug with straight stairs and vanilla doors --- normal.asm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/normal.asm b/normal.asm index 5ac2524..13323d8 100644 --- a/normal.asm +++ b/normal.asm @@ -342,9 +342,10 @@ db $d0, $f6, $10, $1a, $f0, $00 StraightStairsFix: { + pha lda.l DRMode : bne + - !add $20 : sta $20 ;what we wrote over - + rtl + pla : !add $20 : sta $20 : rtl ;what we wrote over + + pla : rtl } StraightStairLayerFix: