From 4bcc76e83b5172b56355fc5b1a9f1e51e18dec97 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 31 Oct 2021 20:56:27 -0500 Subject: [PATCH 1/6] Play Sanc music on arrival in Sanc in Standard --- music.asm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/music.asm b/music.asm index 0d8a1dc..025e1dd 100644 --- a/music.asm +++ b/music.asm @@ -193,10 +193,11 @@ Overworld_MosaicDarkWorldChecks: ; ; On entry, A=16bit XY=8bit, A & X safe to mod, Y unknown Underworld_DoorDown_Entry: - LDA.l DRMode : TAX : LDA $A0 : CPX #0 : BNE .done + LDA.l $7EF3C5 : TAX : CPX #2 : !BLT .vanilla + LDA.l DRMode : BNE .done .vanilla ; thing we wrote over - CMP.w #$0012 : BNE + + LDA $A0 : CMP.w #$0012 : BNE + LDX.b #$14 ; value for Sanc music BRA .done + CMP.w #$0002 : BNE .done From dd57b4be7983d7a91611a0766217af9043163d16 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Mon, 1 Nov 2021 02:09:05 -0500 Subject: [PATCH 2/6] Preserve Sanc music change in Standard --- drhooks.asm | 6 +++--- music.asm | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drhooks.asm b/drhooks.asm index 1d3b485..a271577 100644 --- a/drhooks.asm +++ b/drhooks.asm @@ -186,9 +186,9 @@ Main_ShowTextMessage: ; Conditionally disable UW music changes in Door Rando org $028ADB ; <- Bank02.asm:2088-2095 (LDX.b #$14 : LDA $A0 ...) -JSL.l Underworld_DoorDown_Entry : CPX #$10 -db $B0, $21 ; BCS $028B04 -BRA + : NOP #6 : + +JSL.l Underworld_DoorDown_Entry : CPX #$FF +BEQ + : db $80, $1C ; BRA $028B04 +NOP #6 : + org $02C3F2 ; <- Bank02.asm:10521 Unused call Underworld_DoorDown_Call: diff --git a/music.asm b/music.asm index 025e1dd..02436ba 100644 --- a/music.asm +++ b/music.asm @@ -193,14 +193,15 @@ Overworld_MosaicDarkWorldChecks: ; ; On entry, A=16bit XY=8bit, A & X safe to mod, Y unknown Underworld_DoorDown_Entry: - LDA.l $7EF3C5 : TAX : CPX #2 : !BLT .vanilla + LDX #$FF ; some junk value to be used later to determine if the below lines will change the track + LDA.l $7EF3C5 : AND.w #$00FF : CMP.w #2 : !BLT .vanilla LDA.l DRMode : BNE .done .vanilla ; thing we wrote over LDA $A0 : CMP.w #$0012 : BNE + LDX.b #$14 ; value for Sanc music BRA .done - + CMP.w #$0002 : BNE .done + + LDA $A2 : CMP.w #$0012 : BNE .done LDX.b #$10 ; value for Hyrule Castle music .done RTL From ff6a553a0debf5b00ab3029cde8979144e5e1cb1 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Mon, 1 Nov 2021 10:59:37 -0500 Subject: [PATCH 3/6] Fake flipper autokill reversal --- events.asm | 2 +- flipperkill.asm | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ hooks.asm | 13 ++++++++-- 3 files changed, 79 insertions(+), 3 deletions(-) diff --git a/events.asm b/events.asm index 913818f..cad6942 100644 --- a/events.asm +++ b/events.asm @@ -185,7 +185,7 @@ RTL ;-------------------------------------------------------------------------------- OnLinkDamaged: JSL.l IncrementDamageTakenCounter_Arb - JSL.l FlipperKill + ;JSL.l FlipperKill JML.l OHKOTimer ;-------------------------------------------------------------------------------- diff --git a/flipperkill.asm b/flipperkill.asm index ac782c2..6f8c420 100644 --- a/flipperkill.asm +++ b/flipperkill.asm @@ -68,3 +68,70 @@ MysteryWaterFunction: ; *$3AE54 ALTERNATE ENTRY POINT STZ $0360 RTL ;-------------------------------------------------------------------------------- + + +;=================================================================================================== +; More elegant solution +;=================================================================================================== + +protectff: + LDA.l AllowAccidentalMajorGlitch + BEQ .yes_protect + + RTL + +.yes_protect + REP #$30 + + LDA.b $20 + AND.w #$1E00 + ASL + ASL + ASL + STA.b $06 + + LDA.b $22 + AND.w #$1E00 + ORA.b $06 + + XBA + LSR + TAX + + SEP #$30 + + ; Remove dark world bit + ; in game table that converts coordinates to actual screen ID + ; special case for other areas + LDA.b $8A + BMI .special_overworld + + AND.b #$3F + CMP.l $02A4E3,X + BEQ ++ + +.protect + LDA.b #$15 + STA.b $5D + + STZ.b $2E + STZ.b $67 + + LDA.b #$02 + STA.b $2F + + STZ.w $0112 + STZ.w $02E4 + STZ.w $0FFC + +++ RTL + +.special_overworld + CMP.l .spow,X + BNE .protect + + RTL + +.spow + db $80, $81, $81, $FF, $FF, $FF, $FF, $FF + db $FF, $81, $81, $FF, $FF, $FF, $FF, $FF \ No newline at end of file diff --git a/hooks.asm b/hooks.asm index 11950d5..7155833 100755 --- a/hooks.asm +++ b/hooks.asm @@ -2319,8 +2319,17 @@ JSL.l OnLinkDamagedFromPit org $01FFE7 ; <- FFE7 - Bank01.asm:16375 (LDA $7EF36D) JSL.l OnLinkDamagedFromPitOutdoors ;-------------------------------------------------------------------------------- -org $078F27 ; <- 38F27 -JSL.l FlipperReset +org $02B468 +dw FakeFlipperProtection + +org $02FFC7 +FakeFlipperProtection: + JSR.w $029485 + JSL protectff + RTS +;-------------------------------------------------------------------------------- +;org $078F27 ; <- 38F27 +;JSL.l FlipperReset ;-------------------------------------------------------------------------------- org $09F40B ; <- 4F40B - module_death.asm:222 (LDX.b #$00) JSL.l IgnoreFairyCheck From 6757e35dcaef710f6d46f8d2b0ae4ffe1b0db142 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 2 Nov 2021 15:24:21 -0600 Subject: [PATCH 4/6] Straight Stair fixes --- doorrando.asm | 1 + doortables.asm | 2 ++ normal.asm | 15 ++++++++++----- scroll.asm | 6 +++++- 4 files changed, 18 insertions(+), 6 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/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/normal.asm b/normal.asm index 3bdf962..13323d8 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 ++ @@ -338,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: 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 582abf3d32d0af73d5a9272f4ff4648e956a4b21 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 2 Nov 2021 17:17:37 -0500 Subject: [PATCH 5/6] Fixed boss music --- music.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/music.asm b/music.asm index 02436ba..3b1b120 100644 --- a/music.asm +++ b/music.asm @@ -204,5 +204,5 @@ Underworld_DoorDown_Entry: + LDA $A2 : CMP.w #$0012 : BNE .done LDX.b #$10 ; value for Hyrule Castle music .done - RTL + LDA $A0 : RTL ;-------------------------------------------------------------------------------- From 7d80b8087a95d9127ac67af3292cbbf1bf9a1ee2 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 7 Nov 2021 16:24:45 -0600 Subject: [PATCH 6/6] Allow normal Link speed with Old Man if not in his cave or on WDM --- owrando.asm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/owrando.asm b/owrando.asm index a36a972..86a6586 100644 --- a/owrando.asm +++ b/owrando.asm @@ -35,6 +35,10 @@ db #$b0 ; BCS to replace BEQ org $06907f ; < 3107f - sprite_prep.asm:2170 (LDA $7EF3CA) lda $8a : and.b #$40 +; override Link speed with Old Man following +org $09a32e ; < bank_09.asm:7457 (LDA.b #$0C : STA.b $5E) +jsl OWOldManSpeed + ; Dark Bonk Rocks Rain Sequence Guards (allowing Tile Swap on Dark Bonk Rocks) ;org $09c957 ; <- 4c957 ;dw #$cb5f ; matches value on Central Bonk Rocks screen @@ -160,6 +164,22 @@ OWSmithAccept: clc : rtl + sec : rtl } +OWOldManSpeed: +{ + lda $1b : beq .outdoors + lda $a0 : and #$fe : cmp #$f0 : beq .vanilla ; if in cave where you find Old Man + bra .normalspeed + .outdoors + lda $8a : cmp #$03 : beq .vanilla ; if on WDM screen + + .normalspeed + lda $5e : cmp #$0c : rtl + stz $5e : rtl + + .vanilla + lda #$0c : sta $5e ; what we wrote over + rtl +} org $aa9000 OWEdgeTransition: