From fd490cab9a98532b33b40b61f88ae6849c706dae Mon Sep 17 00:00:00 2001 From: cassidy Date: Mon, 2 Aug 2021 21:06:13 -0400 Subject: [PATCH 01/11] rngfixes: make enemy drop rng static during the standard escape sequence This only applies between picking up the Uncle item and dropping off zelda, not rain state in general --- hooks.asm | 3 +++ rngfixes.asm | 16 ++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/hooks.asm b/hooks.asm index e85afc1..9084c93 100755 --- a/hooks.asm +++ b/hooks.asm @@ -1491,6 +1491,9 @@ org $1DBAB1 ; <- EBAB1 - sprite_sidenexx.asm : 314 (JSL GetRandomInt : AND.b #$0 JSL.l RNG_Trinexx org $1DBAC3 ; <- EBAC3 - sprite_sidenexx.asm : 323 (JSL GetRandomInt : AND.b #$0F : ADD.b #$0C : STA $02 : STZ $03) JSL.l RNG_Trinexx +;-------------------------------------------------------------------------------- +org $6F9B8 ; <- 379B8 - bank06.asm : 6693 (JSL GetRandomInt : PLY : AND $FA5C, Y : BNE BRANCH_MU) +JSL.l RNG_Enemy_Drops ;================================================================================ ; HUD Changes ;-------------------------------------------------------------------------------- diff --git a/rngfixes.asm b/rngfixes.asm index cf2b7b9..33cddff 100644 --- a/rngfixes.asm +++ b/rngfixes.asm @@ -4,8 +4,7 @@ RigDigRNG: LDA $7FFE01 : CMP.l DiggingGameRNG : !BGE .forceHeart .normalItem - JSL $0DBA71 ; GetRandomInt -RTL + JML GetRandomInt .forceHeart LDA $7FFE00 : BNE .normalItem LDA #$04 @@ -15,7 +14,7 @@ RigChestRNG: JSL.l DecrementChestCounter LDA $04C4 : CMP.l ChestGameRNG : BEQ .forceHeart .normalItem - JSL $0DBA71 ; GetRandomInt + JSL GetRandomInt AND.b #$07 ; restrict values to 0-7 CMP #$07 : BEQ .notHeart JSL.l DecrementItemCounter @@ -29,7 +28,7 @@ RTL JSL.l DecrementItemCounter ;LDA #$00 ; bullshit rupee farming in chest game - JSL $0DBA71 ; GetRandomInt ; spam RNG until we stop getting the prize item + JSL GetRandomInt ; spam RNG until we stop getting the prize item AND.b #$07 ; restrict values to 0-7 CMP #$07 : BNE + ; player got prize item AGAIN LDA.b #$00 ; give them money instead @@ -97,6 +96,11 @@ RNG_Ganon_Extra_Warp: + PLA RTL +RNG_Enemy_Drops: + LDA.l $7EF3C5 : CMP #$01 : BEQ + ; drops are static after uncle pickup & before rescuing zelda + JML GetRandomInt + + + LDA.b #$0F _rng_done: JSL.l GetStaticRNG RTL @@ -142,5 +146,5 @@ dw #$02C0 ; 11 = Agahnim 2 dw #$0300 ; 12 = Agahnim 2 Phantoms dw #$0340 ; 13 = Ganon dw #$0380 ; 14 = Ganon Extra Warp -dw #$03C0 ; 15 = Unused -;-------------------------------------------------------------------------------- \ No newline at end of file +dw #$03C0 ; 15 = Standard Escape Enemy Drops +;-------------------------------------------------------------------------------- From e2e4db82370695c63d877cc20d0c07f18c4dbe02 Mon Sep 17 00:00:00 2001 From: compiling <8335770+compiling@users.noreply.github.com> Date: Sun, 8 Aug 2021 14:13:40 +1000 Subject: [PATCH 02/11] Fix clearing frog/smith in inverted mode --- darkworldspawn.asm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/darkworldspawn.asm b/darkworldspawn.asm index e86344f..2b3696b 100644 --- a/darkworldspawn.asm +++ b/darkworldspawn.asm @@ -53,8 +53,9 @@ DoWorldFix_Inverted: .aga1Alive LDA #$40 : STA $7EF3CA ; set flag to dark world LDA $7EF3CC - CMP #$07 : BNE .done ; clear frog - CMP #$08 : BNE .done ; clear dwarf - consider flute implications + 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 .done From 7057d984e2d2abbb10e80c4990e13737d4ee77e7 Mon Sep 17 00:00:00 2001 From: spannerisms <32842036+spannerisms@users.noreply.github.com> Date: Tue, 10 Aug 2021 09:56:57 -0400 Subject: [PATCH 03/11] fix quadrant glitch hopefully --- hooks.asm | 13 +++++++++++++ tables.asm | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/hooks.asm b/hooks.asm index e85afc1..dc21117 100755 --- a/hooks.asm +++ b/hooks.asm @@ -2724,3 +2724,16 @@ 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 AllowQuadrantGlitch + BEQ ++ + JMP.w $07E8D9 ; HandleIndoorCameraAndDoors + +++ RTS diff --git a/tables.asm b/tables.asm index d5a6a32..a7f04b4 100644 --- a/tables.asm +++ b/tables.asm @@ -1082,8 +1082,15 @@ db $00, $00, $00, $00, $00, $00, $00, $00 org $308350 ; PC 0x180350 ShouldStartatExit: db $00, $00, $00 +;-------------------------------------------------------------------------------- +; $308358 (0x180358) fixes quadrant glitch +; 0x00 - fix +; otherwise dont fix quadrant glitch +org $308358 +AllowQuadrantGlitch: +db $00 ;================================================================================ -; 0x180350 - 0x1814FF (unused) +; 0x180359 - 0x1814FF (unused) ;================================================================================ ; $309500 (0x181500) - $309FFF (0x181FFF) original 0x39C bytes ; Replacement Ending Sequence Text Data From 03c287a98886189501369c79d9106b3580a5c0c2 Mon Sep 17 00:00:00 2001 From: spannerisms <32842036+spannerisms@users.noreply.github.com> Date: Wed, 11 Aug 2021 06:30:52 -0400 Subject: [PATCH 04/11] jingle jangle --- bugfixes.asm | 15 +++++++++++++++ hooks.asm | 9 ++++++++- tables.asm | 6 +++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/bugfixes.asm b/bugfixes.asm index 0d5117f..b5ee34b 100644 --- a/bugfixes.asm +++ b/bugfixes.asm @@ -199,3 +199,18 @@ LDA $1B : BNE + LDA $8C : CMP.b #$97 + RTL + +;-------------------------------------------------------------------------------- +FixJingleGlitch: + LDA.b $11 + BEQ .set_doors + + LDA.l AllowAccidentalMajorGlitch + BEQ .exit + +.set_doors + LDA.b #$05 + STA.b $11 + +.exit + RTL diff --git a/hooks.asm b/hooks.asm index 4ff7432..aed4914 100755 --- a/hooks.asm +++ b/hooks.asm @@ -2733,8 +2733,15 @@ org $07A879 org $07F877 ; free rom SwordSpinQuadrantFix: - LDA.l AllowQuadrantGlitch + LDA.l AllowAccidentalMajorGlitch BEQ ++ JMP.w $07E8D9 ; HandleIndoorCameraAndDoors ++ RTS + +;================================================================================ + +org $01C4B8 : JSL FixJingleGlitch +org $01C536 : JSL FixJingleGlitch +org $01C592 : JSL FixJingleGlitch +org $01C65F : JSL FixJingleGlitch diff --git a/tables.asm b/tables.asm index a7f04b4..d1eb4ec 100644 --- a/tables.asm +++ b/tables.asm @@ -1083,11 +1083,11 @@ org $308350 ; PC 0x180350 ShouldStartatExit: db $00, $00, $00 ;-------------------------------------------------------------------------------- -; $308358 (0x180358) fixes quadrant glitch +; $308358 (0x180358) fixes major glitches ; 0x00 - fix -; otherwise dont fix quadrant glitch +; otherwise dont fix various major glitches org $308358 -AllowQuadrantGlitch: +AllowAccidentalMajorGlitch: db $00 ;================================================================================ ; 0x180359 - 0x1814FF (unused) From bd16b9ff927ac6dce3b59b18b84574482b4898fc Mon Sep 17 00:00:00 2001 From: Thomas Prescott Date: Sat, 21 Aug 2021 07:43:23 -0500 Subject: [PATCH 05/11] Add Pleasure to credits Credit the creator of the website logo --- stats/creditsnew.asm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/stats/creditsnew.asm b/stats/creditsnew.asm index f4b2522..923c687 100644 --- a/stats/creditsnew.asm +++ b/stats/creditsnew.asm @@ -489,6 +489,15 @@ CreditsLineBlank: %blankline() %blankline() +%smallcredits("WEBSITE LOGO", "green") + +%blankline() + +%bigcredits("PLEASURE") + +%blankline() +%blankline() + %smallcredits("SPECIAL THANKS", "red") %blankline() @@ -556,12 +565,6 @@ CreditsLineBlank: %emptyline() %emptyline() %emptyline() -%emptyline() -%emptyline() -%emptyline() -%emptyline() -%emptyline() -%emptyline() ;=================================================================================================== From 48d9a7d4bcbd2a4ae3e9ff6800f590deda2a5aac Mon Sep 17 00:00:00 2001 From: qwertymodo Date: Mon, 23 Aug 2021 11:24:24 -0700 Subject: [PATCH 06/11] Fix SPC un/mute race condition Should fix mothula hardlock, for real this time --- msu.asm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/msu.asm b/msu.asm index 76fb53c..49b5904 100644 --- a/msu.asm +++ b/msu.asm @@ -323,10 +323,8 @@ CheckMusicLoadRequest: .load REP #$10 STZ $4200 - STA !REG_SPC_CONTROL - - : CMP !REG_SPC_CONTROL : BNE - ; Wait until mute/unmute command is ACK'ed - STZ !REG_SPC_CONTROL - - : LDA !REG_SPC_CONTROL : BNE - ; Wait until mute/unmute command is completed + - : STA !REG_SPC_CONTROL : CMP !REG_SPC_CONTROL : BNE - ; Wait until mute/unmute command is ACK'ed + - : STZ !REG_SPC_CONTROL : LDA !REG_SPC_CONTROL : BNE - ; Wait until mute/unmute command is completed LDA.b #$81 : STA $4200 LDA !REG_MUSIC_CONTROL_REQUEST : CMP.b #08 : BEQ .done+3 ; No SFX during warp track From 086230bb8cc230adf8e78555c26884420e76cdc0 Mon Sep 17 00:00:00 2001 From: Catobat <69204835+Catobat@users.noreply.github.com> Date: Sat, 28 Aug 2021 04:01:28 +0200 Subject: [PATCH 07/11] Fix check for wild maps --- newhud.asm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/newhud.asm b/newhud.asm index a8d0e3c..bb1db93 100644 --- a/newhud.asm +++ b/newhud.asm @@ -152,9 +152,8 @@ SEP #$30 LDA $10 : CMP #$12 : BEQ .noprize - REP #$20 - LDA.l MapMode + REP #$20 BEQ .drawprize LDA.l $7EF368 From bbc8228175e023347d0e017925008ebe8bd81a9f Mon Sep 17 00:00:00 2001 From: cassidy Date: Mon, 6 Sep 2021 17:21:48 -0400 Subject: [PATCH 08/11] utilities: Fix shields overflowing with narrow sprites --- utilities.asm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/utilities.asm b/utilities.asm index fa059fa..fad70c6 100644 --- a/utilities.asm +++ b/utilities.asm @@ -324,13 +324,10 @@ IsNarrowSprite: + : BRA .continue ++ : CMP.b #$5F : BNE ++ ; Progressive Shield LDA !PROGRESSIVE_SHIELD : AND #$C0 : BNE + : SEC : BRA .done ; No Shield - LSR #6 : CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit + + : LSR #6 : CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit LDA.l ProgressiveShieldReplacement JSL.l IsNarrowSprite BRA .done - + - ;LDA $7EF35A : BNE + : SEC : BRA .done : +; No Shield - BRA .false ; Everything Else ++ CMP.b #$60 : BNE ++ ; Progressive Armor LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit LDA.l ProgressiveArmorReplacement From 9f1933d8c04598559dadab4e3a6acd9451cb0a0b Mon Sep 17 00:00:00 2001 From: cassidy Date: Mon, 6 Sep 2021 20:16:41 -0400 Subject: [PATCH 09/11] utilities: Progressive Bow overflow narrow sprites --- utilities.asm | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/utilities.asm b/utilities.asm index fad70c6..5e81d75 100644 --- a/utilities.asm +++ b/utilities.asm @@ -314,32 +314,44 @@ IsNarrowSprite: LDA.l BottleLimitReplacement JSL.l IsNarrowSprite JMP .done - + : BRA .continue + + : JMP .continue .notBottle CMP.b #$5E : BNE ++ ; Progressive Sword LDA $7EF359 : CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit LDA.l ProgressiveSwordReplacement JSL.l IsNarrowSprite - BRA .done - + : BRA .continue - ++ : CMP.b #$5F : BNE ++ ; Progressive Shield - LDA !PROGRESSIVE_SHIELD : AND #$C0 : BNE + : SEC : BRA .done ; No Shield - + : LSR #6 : CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit + JMP .done + + : JMP .continue + ++ CMP.b #$5F : BNE ++ ; Progressive Shield + LDA !PROGRESSIVE_SHIELD : AND #$C0 : BNE + : SEC : JMP .done ; No Shield + + : LSR #6 : CMP.l ProgressiveShieldLimit : !BLT .continue LDA.l ProgressiveShieldReplacement JSL.l IsNarrowSprite - BRA .done + JMP .done ++ CMP.b #$60 : BNE ++ ; Progressive Armor - LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit + LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT .continue LDA.l ProgressiveArmorReplacement JSL.l IsNarrowSprite - BRA .done + JMP .done + ++ CMP.b #$62 : BNE ++ ; RNG Item (Single) - JSL.l GetRNGItemSingle : BRA .continue + JSL.l GetRNGItemSingle : JMP .continue ++ CMP.b #$63 : BNE ++ ; RNG Item (Multi) JSL.l GetRNGItemMulti - ++ - + ++ CMP.b #$64 : BEQ .progressivebow ; Progressive Bow + CMP.b #$65 : BNE .continue ; Progressive Bow (alt) + .progressivebow + LDA $7EF38E : BIT #$A0 : BEQ .continue ; No Progressive Bows + LDX.b #$0 ; Bow counter + CMP #$80 : BEQ + ; We have only one of two + CMP #$20 : BEQ + ; progressive bows + INX + + + INX + TXA : CMP.l ProgressiveBowLimit : !BLT .continue + LDA.l ProgressiveBowReplacement + JSL.l IsNarrowSprite + JMP .done .continue ;-------- From c37dcec6eaf86d5c38a959097d50b8e7a58e642f Mon Sep 17 00:00:00 2001 From: cassidy Date: Mon, 6 Sep 2021 20:20:12 -0400 Subject: [PATCH 10/11] utilities: refactor some JSL X : RTL into JMP X --- utilities.asm | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/utilities.asm b/utilities.asm index 5e81d75..6c2aae0 100644 --- a/utilities.asm +++ b/utilities.asm @@ -23,8 +23,7 @@ GetSpriteID: .bottle PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT + PLA : LDA.l BottleLimitReplacement - JSL.l GetSpriteID - RTL + JMP GetSpriteID + PLA : BRA .normal .server_F0 @@ -57,16 +56,14 @@ RTL ++ CMP.b #$FD : BNE ++ ; Progressive Armor LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit LDA.l ProgressiveArmorReplacement - JSL.l GetSpriteID - RTL + JMP GetSpriteID + LDA.b #$04 : RTL ++ CMP.b #$FE : BNE ++ ; Progressive Sword LDA $7EF359 CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit LDA.l ProgressiveSwordReplacement - JSL.l GetSpriteID - RTL + JMP GetSpriteID + : CMP.b #$00 : BNE + ; No Sword LDA.b #$43 : RTL + : CMP.b #$01 : BNE + ; Fighter Sword @@ -80,8 +77,7 @@ RTL LDA !PROGRESSIVE_SHIELD : AND #$C0 : LSR #6 CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit LDA.l ProgressiveShieldReplacement - JSL.l GetSpriteID - RTL + JMP GetSpriteID + : CMP.b #$00 : BNE + ; No Shield LDA.b #$2D : RTL + : CMP.b #$01 : BNE + ; Fighter Shield @@ -92,8 +88,7 @@ RTL LDA $7EF340 : INC : LSR CMP.l ProgressiveBowLimit : !BLT + LDA.l ProgressiveBowReplacement - JSL.l GetSpriteID - RTL + JMP GetSpriteID + : CMP.b #$00 : BNE + ; No Bow LDA.b #$29 : RTL + ; Any Bow @@ -176,8 +171,7 @@ GetSpritePalette: .bottle PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT + PLA : LDA.l BottleLimitReplacement - JSL.l GetSpritePalette - RTL + JMP GetSpritePalette + PLA : .notBottle PHX @@ -192,8 +186,7 @@ RTL LDA $7EF359 CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit LDA.l ProgressiveSwordReplacement - JSL.l GetSpritePalette - RTL + JMP GetSpritePalette + : CMP.b #$00 : BNE + ; No Sword LDA.b #$04 : RTL + : CMP.b #$01 : BNE + ; Fighter Sword @@ -206,8 +199,7 @@ RTL LDA !PROGRESSIVE_SHIELD : AND #$C0 : LSR #6 CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit LDA.l ProgressiveShieldReplacement - JSL.l GetSpritePalette - RTL + JMP GetSpritePalette + : CMP.b #$00 : BNE + ; No Shield LDA.b #$04 : RTL + : CMP.b #$01 : BNE + ; Fighter Shield @@ -217,8 +209,7 @@ RTL ++ : CMP.b #$FF : BNE ++ ; Progressive Armor LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit LDA.l ProgressiveArmorReplacement - JSL.l GetSpritePalette - RTL + JMP GetSpritePalette + : CMP.b #$00 : BNE + ; Green Tunic LDA.b #$04 : RTL + ; Everything Else @@ -232,8 +223,7 @@ RTL LDA $7EF340 : INC : LSR CMP.l ProgressiveBowLimit : !BLT + LDA.l ProgressiveBowReplacement - JSL.l GetSpritePalette - RTL + JMP GetSpritePalette + : CMP.b #$00 : BNE + ; No Bow LDA.b #$08 : RTL + ; Any Bow From aca809862d48ca42d70c51e0b83ff383116920c6 Mon Sep 17 00:00:00 2001 From: cassidy Date: Wed, 8 Sep 2021 01:00:55 -0400 Subject: [PATCH 11/11] utilities: Rewrite prog bow narrow sprite overflow to check sram This uses Bonta's method which is more efficient and reliable when it comes to bow state and potential mixture of progressive, none-progressive, and silver arrows upgrade. --- utilities.asm | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/utilities.asm b/utilities.asm index 6c2aae0..209cf58 100644 --- a/utilities.asm +++ b/utilities.asm @@ -328,20 +328,13 @@ IsNarrowSprite: JSL.l GetRNGItemSingle : JMP .continue ++ CMP.b #$63 : BNE ++ ; RNG Item (Multi) JSL.l GetRNGItemMulti - ++ CMP.b #$64 : BEQ .progressivebow ; Progressive Bow + ++ CMP.b #$64 : BEQ + ; Progressive Bow CMP.b #$65 : BNE .continue ; Progressive Bow (alt) - .progressivebow - LDA $7EF38E : BIT #$A0 : BEQ .continue ; No Progressive Bows - LDX.b #$0 ; Bow counter - CMP #$80 : BEQ + ; We have only one of two - CMP #$20 : BEQ + ; progressive bows - INX - + - INX - TXA : CMP.l ProgressiveBowLimit : !BLT .continue - LDA.l ProgressiveBowReplacement - JSL.l IsNarrowSprite - JMP .done + + : LDA $7EF340 : INC : LSR + CMP.l ProgressiveBowLimit : !BLT + + LDA.l ProgressiveBowReplacement + JSL.l IsNarrowSprite + JMP .done .continue ;--------