From 501699e401fe0559e9bb8a5d5f3e5991b24b3b4b Mon Sep 17 00:00:00 2001 From: spannerisms <32842036+spannerisms@users.noreply.github.com> Date: Sat, 18 Sep 2021 08:04:38 -0400 Subject: [PATCH 1/6] oops --- events.asm | 13 +++++++++++-- hooks.asm | 13 ------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/events.asm b/events.asm index 535ff56..7999bee 100644 --- a/events.asm +++ b/events.asm @@ -190,8 +190,17 @@ RTL ;-------------------------------------------------------------------------------- OnLinkDamagedFromPit: JSL.l OHKOTimer - LDA.b #$14 : STA $11 ; thing we wrote over -RTL + + LDA.l AllowAccidentalMajorGlitch + BEQ ++ +-- LDA.b #$14 : STA $11 ; thing we wrote over + + RTL + +++ LDA.b $10 : CMP.b #$12 : BNE -- + + STZ.b $11 + RTL ;-------------------------------------------------------------------------------- OnLinkDamagedFromPitOutdoors: JML.l OHKOTimer ; make sure this is last diff --git a/hooks.asm b/hooks.asm index aed4914..af2bfcf 100755 --- a/hooks.asm +++ b/hooks.asm @@ -2726,19 +2726,6 @@ org $0AEEF2 org $008BE5 ; hijack stripes for boss GFX transfer JSL DoDungeonMapBossIcon -;================================================================================ -; Fix quadrant glitch -org $07A879 - JSR SwordSpinQuadrantFix - -org $07F877 ; free rom -SwordSpinQuadrantFix: - LDA.l AllowAccidentalMajorGlitch - BEQ ++ - JMP.w $07E8D9 ; HandleIndoorCameraAndDoors - -++ RTS - ;================================================================================ org $01C4B8 : JSL FixJingleGlitch From 319aba5e4d752c3da5c8dfb9958c92b4c15d6de7 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 5 Oct 2021 14:15:38 -0600 Subject: [PATCH 2/6] EG disarmament on mirror --- drhooks.asm | 5 +++++ normal.asm | 5 +++-- overrides.asm | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drhooks.asm b/drhooks.asm index 86ae1ff..1d3b485 100644 --- a/drhooks.asm +++ b/drhooks.asm @@ -125,6 +125,11 @@ org $07a955 ; <- Bank07.asm : around 6564 (JP is a bit different) (STZ $05FC : S jsl BlockEraseFix nop #2 +org $02A0A8 +Mirror_SaveRoomData: +org $07A95B ; < bank_07.asm ; #_07A95B: JSL Mirror_SaveRoomData +jsl EGFixOnMirror + org $02b82a jsl FixShopCode diff --git a/normal.asm b/normal.asm index aabb24d..3bdf962 100644 --- a/normal.asm +++ b/normal.asm @@ -73,8 +73,9 @@ TrapDoorFixer: rts Cleanup: - stz $047a - inc $11 + lda.l DRFlags : and #$10 : beq + + stz $047a + + inc $11 lda $ef rts diff --git a/overrides.asm b/overrides.asm index a041ae3..91029a8 100644 --- a/overrides.asm +++ b/overrides.asm @@ -47,6 +47,12 @@ MirrorCheckOverride: rtl + lda.l DRScroll : rtl +EGFixOnMirror: + lda.l DRFlags : and #$10 : beq + + stz $047a + + jsl Mirror_SaveRoomData + rtl + BlockEraseFix: lda $7ef353 : and #$02 : beq + stz $05fc : stz $05fd From 7819e800512a1a97ceaebcf0b66c0d748630522f Mon Sep 17 00:00:00 2001 From: codemann8 Date: Thu, 21 Oct 2021 22:18:23 -0500 Subject: [PATCH 3/6] Fixed portal to match grass in Inverted --- invertedmaps.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invertedmaps.asm b/invertedmaps.asm index 683b87d..382e4e9 100644 --- a/invertedmaps.asm +++ b/invertedmaps.asm @@ -861,7 +861,7 @@ RTS map051: { -LDA #$0034 : STA $22A8 +LDA #$037D : STA $22A8 RTS } From 4e67ebd9590a6e30a7f7027f4024c30edf45f941 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Fri, 22 Oct 2021 00:21:22 -0500 Subject: [PATCH 4/6] Make Smith deletion on S+Q dependent of a new flag --- darkworldspawn.asm | 23 +++++++++++++++++------ tables.asm | 4 ++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/darkworldspawn.asm b/darkworldspawn.asm index 0a7ccf4..aefa8ba 100644 --- a/darkworldspawn.asm +++ b/darkworldspawn.asm @@ -18,6 +18,14 @@ DoWorldFix: LDA #$00 .noMirror STA $7EF3CA ; set flag to light world + LDA.l SmithDeleteOnSave : BEQ .transform + LDA $7EF3CC + CMP #$07 : BEQ .clear ; clear frog + CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications + BRA .done + .clear + LDA.b #$00 : STA $7EF3CC : BRA .done ; clear follower + .transform LDA $7EF3CC : CMP #$07 : BNE .done : INC : STA $7EF3CC ; convert frog to dwarf .done RTL @@ -52,12 +60,15 @@ DoWorldFix_Inverted: .noMirror .aga1Alive LDA #$40 : STA $7EF3CA ; set flag to dark world - LDA $7EF3CC - CMP #$07 : BEQ .clear ; clear frog - CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications - BRA .done - .clear - LDA.b #$00 : STA $7EF3CC ; clear follower + LDA.l SmithDeleteOnSave : BEQ .transform + LDA $7EF3CC + CMP #$07 : BEQ .clear ; clear frog + CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications + BRA .done + .clear + LDA.b #$00 : STA $7EF3CC : BRA .done ; clear follower + .transform + LDA $7EF3CC : CMP #$07 : BNE .done : INC : STA $7EF3CC ; convert frog to dwarf .done RTL ;-------------------------------------------------------------------------------- diff --git a/tables.asm b/tables.asm index 6766a58..73d2801 100644 --- a/tables.asm +++ b/tables.asm @@ -259,6 +259,10 @@ CrystalPendantFlags_2: ;Pendant: $00 ;Crystal: $40 ;-------------------------------------------------------------------------------- +org $30805D ; PC 0x18005D +SmithDeleteOnSave: +db #$00 ; #$00 = Off (default) - #$01 = On (frog/smith gets deleted on S+Q) +;-------------------------------------------------------------------------------- org $30805E ; PC 0x18005E - Number of crystals required to enter GT NumberOfCrystalsRequiredForTower: db #$07 ; #$07 = 7 Crystals From 86212c8d25b06d642fc83ce4cac99d3748225677 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 27 Oct 2021 01:09:53 -0500 Subject: [PATCH 5/6] Adding cross-world behavior for Whirlpool Shuffle --- owrando.asm | 63 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/owrando.asm b/owrando.asm index a739ca9..cb123f9 100644 --- a/owrando.asm +++ b/owrando.asm @@ -12,6 +12,10 @@ dw 0 org $02a999 jsl OWEdgeTransition : nop #4 ;LDA $02A4E3,X : ORA $7EF3CA +; whirlpool shuffle cross world change +org $02b3bd +jsl OWWhirlpoolUpdate ;JSL $02EA6C + ; flute menu cancel org $0ab7af ;LDA $F2 : ORA $F0 : AND #$C0 jml OWFluteCancel2 : nop @@ -121,6 +125,14 @@ OWWorldCheck16: plx : and.w #$00ff : rtl } +OWWhirlpoolUpdate: +{ + jsl $02ea6c ; what we wrote over + lda.l OWFlags : and #$01 : beq + + ldx $8a : jsr OWWorldUpdate + + rtl +} + OWFluteCancel: { lda.l OWFlags+1 : and #$01 : bne + @@ -338,32 +350,39 @@ OWNewDestination: sep #$30 : lda OWOppSlotOffset,y : !add $04 : asl : and #$7f : sta $700 ; crossed OW shuffle - LDA.l OWMode+1 : AND.b #!FLAG_OW_CROSSED : beq .return - ldx $05 : lda.l OWTileWorldAssoc,x : cmp.l $7ef3ca : beq .return - sta.l $7ef3ca ; change world - lda #$38 : sta $012f ; play sfx - #$3b is an alternative - - ; toggle bunny mode - + lda $7ef357 : bne .nobunny - lda.l InvertedMode : bne .inverted - lda $7ef3ca : and.b #$40 : bra + - .inverted lda $7ef3ca : and.b #$40 : eor #$40 - + cmp #$40 : bne .nobunny - ; turn into bunny - lda $5d : cmp #$04 : beq + ; if swimming, continue - lda #$17 : sta $5d - + lda #$01 : sta $02e0 : sta $56 - bra .return - - .nobunny - lda $5d : cmp #$17 : bne + ; retain current state unless bunny - stz $5d - + stz $02e0 : stz $56 + lda.l OWMode+1 : and.b #!FLAG_OW_CROSSED : beq .return + ldx $05 : jsr OWWorldUpdate .return lda $05 : sta $8a rep #$30 : rts } +OWWorldUpdate: ; x = owid of destination screen +{ + lda.l OWTileWorldAssoc,x : cmp.l $7ef3ca : beq .return + sta.l $7ef3ca ; change world + lda #$38 : sta $012f ; play sfx - #$3b is an alternative + + ; toggle bunny mode + + lda $7ef357 : bne .nobunny + lda.l InvertedMode : bne .inverted + lda $7ef3ca : and.b #$40 : bra + + .inverted lda $7ef3ca : and.b #$40 : eor #$40 + + cmp #$40 : bne .nobunny + ; turn into bunny + lda $5d : cmp #$04 : beq + ; if swimming, continue + lda #$17 : sta $5d + + lda #$01 : sta $02e0 : sta $56 + bra .return + + .nobunny + lda $5d : cmp #$17 : bne + ; retain current state unless bunny + stz $5d + + stz $02e0 : stz $56 + + .return + rts +} ;Data org $aaa000 @@ -523,7 +542,7 @@ OWNorthEdges: ; Min Max Width Mid OW Slot/OWID VRAM *FREE* Dest Index dw $00a0, $00a0, $0000, $00a0, $0000, $0000, $0000, $0040 ;Lost Woods dw $0458, $0540, $00e8, $04cc, $0a0a, $0000, $0000, $0000 -dw $0f70, $0f90, $0020, $0f80, $0f0f, $0000, $0000, $0041 +dw $0f38, $0f60, $0028, $0f4c, $0f0f, $0000, $0000, $0041 dw $0058, $0058, $0000, $0058, $1010, $0000, $0000, $0001 dw $0178, $0178, $0000, $0178, $1010, $0000, $0000, $0002 dw $0388, $0388, $0000, $0388, $1111, $0000, $0000, $0003 From 2e9f4c5abb534c637ca178dc577714bf1f5dc3f8 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Thu, 28 Oct 2021 21:40:51 -0500 Subject: [PATCH 6/6] Fixed issue with whirlpools not changing world in Crossed OW --- owrando.asm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/owrando.asm b/owrando.asm index cb123f9..a36a972 100644 --- a/owrando.asm +++ b/owrando.asm @@ -128,9 +128,11 @@ OWWorldCheck16: OWWhirlpoolUpdate: { jsl $02ea6c ; what we wrote over - lda.l OWFlags : and #$01 : beq + - ldx $8a : jsr OWWorldUpdate - + rtl + lda.l OWFlags : and #$01 : bne + + lda.l OWMode+1 : and #$02 : beq .return + + ldx $8a : jsr OWWorldUpdate + .return + rtl } OWFluteCancel: