From 5470b41f4659b7e207a0c54495ac42ed49c71b33 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Thu, 8 Jul 2021 15:30:36 -0700 Subject: [PATCH 01/25] Fix drawing C/P indicator - no longer show icon for sewer, HC, AT, or GT - no longer show junk in map shuffle for dungeons without the map --- newhud.asm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/newhud.asm b/newhud.asm index 35c562f..884d967 100644 --- a/newhud.asm +++ b/newhud.asm @@ -145,9 +145,10 @@ SEP #$30 SEP #$20 LDA.b $1B : BEQ .noprize - - - LDX.w $040C : BMI .noprize + LDX.w $040C + CPX #$1A : !BGE .noprize + CPX #$04 : !BLT .noprize + CPX #$08 : BEQ .noprize REP #$20 @@ -156,9 +157,10 @@ SEP #$30 LDA.l $7EF368 AND.l DungeonItemMasks,X - BEQ .doneprize + BEQ .noprize .drawprize + TXA : LSR : TAX LDA.l CrystalPendantFlags_2, X AND.w #$0040 : BNE .is_crystal From 3944dadcab4902056d80a051fe8bc8690c264870 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Thu, 8 Jul 2021 18:25:04 -0700 Subject: [PATCH 02/25] Change default for locked aga tower to no longer be inverted --- tables.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables.asm b/tables.asm index 3400732..d5a6a32 100644 --- a/tables.asm +++ b/tables.asm @@ -837,7 +837,7 @@ db #$08 ; #$08 = 1 Heart (default) - #$02 = 1/4 Heart ;================================================================================ org $308169 ; PC 0x180169 AgahnimDoorStyle: -db #$02 ; #00 = Never Locked - #$01 = Locked During Escape (default) - #$02 = Locked Without 7 Crystals +db #$01 ; #00 = Never Locked - #$01 = Locked During Escape (default) - #$02 = Locked Without 7 Crystals ;================================================================================ org $30816A ; PC 0x18016A FreeItemText: From e7d4f09871384e40587e7fbe2143c7e1123fc9cc Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Sat, 10 Jul 2021 11:27:34 -0700 Subject: [PATCH 03/25] Fix junk graphic appearing during GAME OVER screen --- newhud.asm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/newhud.asm b/newhud.asm index 884d967..a8d0e3c 100644 --- a/newhud.asm +++ b/newhud.asm @@ -150,6 +150,8 @@ SEP #$30 CPX #$04 : !BLT .noprize CPX #$08 : BEQ .noprize + LDA $10 : CMP #$12 : BEQ .noprize + REP #$20 LDA.l MapMode From 12bc26bd5af9ba69f5f580a8b9ebd00b9936ac08 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Sun, 11 Jul 2021 02:14:01 -0700 Subject: [PATCH 04/25] Fix extra space in credits --- stats/creditsnew.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stats/creditsnew.asm b/stats/creditsnew.asm index dae6d8b..a7c8adf 100644 --- a/stats/creditsnew.asm +++ b/stats/creditsnew.asm @@ -419,7 +419,7 @@ CreditsLineBlank: %blankline() -%bigcredits("AERINON COMPILING") +%bigcredits("AERINON COMPILING") %blankline() %blankline() From a2547e9810dabe09fcec3e93b2db7e837fde9825 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Fri, 16 Jul 2021 15:29:01 -0700 Subject: [PATCH 05/25] Minor credits fixes --- stats/creditsnew.asm | 2 ++ stats/main.asm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/stats/creditsnew.asm b/stats/creditsnew.asm index dae6d8b..88167f8 100644 --- a/stats/creditsnew.asm +++ b/stats/creditsnew.asm @@ -1,11 +1,13 @@ ;=================================================================================================== ; LEAVE THIS HERE FOR PHP WRITES ;=================================================================================================== +table "creditscharmapbighi.txt" YourSpriteCreditsHi: db 2 db 55 db " " ; $238002 +table "creditscharmapbiglo.txt" YourSpriteCreditsLo: db 2 db 55 diff --git a/stats/main.asm b/stats/main.asm index 314de0e..975eb3b 100755 --- a/stats/main.asm +++ b/stats/main.asm @@ -218,7 +218,7 @@ endmacro !ColonOffset = $83 !PeriodOffset = $80 -!BlankTile = $883D +!BlankTile = #$883D RenderCreditsStatCounter: PHB From f0a00aea0dae3f6f696e29721909b3bdfef3c70b Mon Sep 17 00:00:00 2001 From: spannerisms <32842036+spannerisms@users.noreply.github.com> Date: Sat, 17 Jul 2021 05:46:02 -0400 Subject: [PATCH 06/25] fix --- entrances.asm | 14 +++++++++++++- hooks.asm | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/entrances.asm b/entrances.asm index 2b2f171..35db47e 100644 --- a/entrances.asm +++ b/entrances.asm @@ -24,11 +24,12 @@ LockAgahnimDoors: LDA $7EF2C3 : AND.w #$0020 : BNE .unlock ; Check if GT overlay is already on or not LDA $0308 : AND.w #$0080 : BEQ ++ ;If we are holding an item + + .locked LDA #$0001 : RTL ;Keep the door locked ++ SEP #$30 JSL $099B6F ;Add tower break seal - LDA $7EF2C3 : ORA #$20 : STA $7EF2C3 ; activate GT overlay REP #$30 LDA #$0001 ;Prevent door from opening that frame otherwise it glitchy RTL @@ -39,6 +40,17 @@ LockAgahnimDoors: LDA.w #$0000 ; fallback to never locked RTL +;--------------------------------------------------------------------------------- +FlagAgahnimDoor: + LDA.l InvertedMode : BEQ .vanilla + + LDA $7EF2C3 : ORA #$20 : STA $7EF2C3 ; activate GT overlay + +.vanilla + LDA.b #$28 : STA.b $72 + RTL + + ;-------------------------------------------------------------------------------- LockAgahnimDoorsCore: LDA $22 : CMP.w #1992 : !BLT + ; door too far left, skip diff --git a/hooks.asm b/hooks.asm index 4c70433..5f1636a 100755 --- a/hooks.asm +++ b/hooks.asm @@ -1026,6 +1026,9 @@ JSL.l InitializeBottles ;================================================================================ ; Agahnim Doors Fix ;-------------------------------------------------------------------------------- +org $099BBA +JSL FlagAgahnimDoor + org $1BBC94 ; <- DBC94 - Bank1B.asm : 201 (LDA $7EF3C5 : AND.w #$000F : CMP.w #$0003 : BCS BRANCH_EPSILON) JSL.l LockAgahnimDoors : BNE Overworld_Entrance_BRANCH_EPSILON : NOP #6 From df66369f1744dd3717a589bb454ebab7d517695d Mon Sep 17 00:00:00 2001 From: spannerisms <32842036+spannerisms@users.noreply.github.com> Date: Thu, 29 Jul 2021 09:43:08 -0400 Subject: [PATCH 07/25] hopefully fix that text bug --- events.asm | 2 +- stats.asm | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/events.asm b/events.asm index e843d2a..e284140 100644 --- a/events.asm +++ b/events.asm @@ -50,7 +50,7 @@ RTL ;-------------------------------------------------------------------------------- OnQuit: JSL.l PodEGFix - + LDA.b #$00 : STA $7F5035 ; bandaid patch bug with mirroring away from text LDA.b #$10 : STA $1C ; thing we wrote over RTL ;-------------------------------------------------------------------------------- diff --git a/stats.asm b/stats.asm index e73dd80..40df03a 100644 --- a/stats.asm +++ b/stats.asm @@ -438,6 +438,7 @@ JMP StatTransitionCounter !UW_MIRROR_COUNTER = "$7EF43B" IncrementUWMirror: PHA + LDA.b #$00 : STA $7F5035 ; bandaid patch bug with mirroring away from text LDA !LOCK_STATS : BNE + LDA $040C : CMP #$FF : BEQ + ; skip if we're in a cave or house LDA !UW_MIRROR_COUNTER : INC : STA !UW_MIRROR_COUNTER From 187c2aa4a26604253f37435b5eee7771fa1682df Mon Sep 17 00:00:00 2001 From: spannerisms <32842036+spannerisms@users.noreply.github.com> Date: Thu, 29 Jul 2021 09:44:21 -0400 Subject: [PATCH 08/25] always fix --- bugfixes.asm | 5 ++--- events.asm | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bugfixes.asm b/bugfixes.asm index 1ca6cb6..0d5117f 100644 --- a/bugfixes.asm +++ b/bugfixes.asm @@ -127,10 +127,9 @@ RTS ;-------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------- -;Fix for PoD causing accidental Exploration Glitch -PodEGFix: +;Fix for SQ jumping causing accidental Exploration Glitch +SQEGFix: LDA Bugfix_PodEG : BNE .done - LDA $040C : CMP.b #$0C : BNE .done ;check if we are in PoD STZ $047A ;disarm exploration glitch .done RTL diff --git a/events.asm b/events.asm index e284140..b5947ce 100644 --- a/events.asm +++ b/events.asm @@ -36,7 +36,7 @@ RTL OnDungeonExit: PHA : PHP SEP #$20 ; set 8-bit accumulator - JSL.l PodEGFix + JSL.l SQEGFix PLP : PLA STA $040C : STZ $04AC ; thing we wrote over @@ -49,7 +49,7 @@ OnDungeonExit: RTL ;-------------------------------------------------------------------------------- OnQuit: - JSL.l PodEGFix + JSL.l SQEGFix LDA.b #$00 : STA $7F5035 ; bandaid patch bug with mirroring away from text LDA.b #$10 : STA $1C ; thing we wrote over RTL From fd490cab9a98532b33b40b61f88ae6849c706dae Mon Sep 17 00:00:00 2001 From: cassidy Date: Mon, 2 Aug 2021 21:06:13 -0400 Subject: [PATCH 09/25] 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 10/25] 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 230b15a294ce9dae456d049f263fe9c6bc789f83 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Mon, 9 Aug 2021 15:28:02 -0700 Subject: [PATCH 11/25] Fix OHKO mode --- events.asm | 1 + hooks.asm | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/events.asm b/events.asm index b5947ce..535ff56 100644 --- a/events.asm +++ b/events.asm @@ -176,6 +176,7 @@ OnInitFileSelect: RTL ;-------------------------------------------------------------------------------- OnLinkDamaged: + JSL.l IncrementDamageTakenCounter_Arb JSL.l FlipperKill JML.l OHKOTimer diff --git a/hooks.asm b/hooks.asm index e85afc1..e046e8d 100755 --- a/hooks.asm +++ b/hooks.asm @@ -2705,8 +2705,6 @@ JSL FastTextScroll : NOP org $01FFEE : JSL IncrementDamageTakenCounter_Eight ; overworld pit org $079506 : JSL IncrementDamageTakenCounter_Eight ; underworld pit -org $0780C6 : JSL IncrementDamageTakenCounter_Arb - org $07B0B1 : JSL IncrementMagicUseCounter ;================================================================================ 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 12/25] 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 13/25] 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 14/25] 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 15/25] 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 16/25] 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 17/25] 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 18/25] 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 19/25] 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 20/25] 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 ;-------- 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 21/25] 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 c503e3eb6125ab27214363796284da46ed9cd1d1 Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 21 Oct 2021 14:05:59 -0600 Subject: [PATCH 22/25] Overworld Map Refactor --- LTTP_RND_GeneralBugfixes.asm | 1 + hooks.asm | 67 ++++---- menu/overworldmap.asm | 303 +++++++++++++++++++++++++++++++++++ newhud.asm | 2 +- pendantcrystalhud.asm | 76 --------- tables.asm | 35 ++-- 6 files changed, 360 insertions(+), 124 deletions(-) create mode 100644 menu/overworldmap.asm diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 5341811..586527a 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -237,6 +237,7 @@ incsrc contrib.asm org $A38000 incsrc stats/main.asm +incsrc menu/overworldmap.asm ; overwrites some code in bank 0A incsrc doorrando.asm ; bank 27 likely A7 in the future ;bank 28/A8 for keydropshuffle incsrc enemizer/main.asm ; this is originally in bank 36, but is currently in migratory status in bank 37 diff --git a/hooks.asm b/hooks.asm index 414336c..961609d 100755 --- a/hooks.asm +++ b/hooks.asm @@ -1822,13 +1822,13 @@ LDA CrystalPendantFlags_2, X ;NOP #10 ;CLC ;================================================================================ -org $0AC5BB ; < 545BB - Bank0A.asm:1856 - (LDA $7EF3C7 : CMP.b #$03 : BNE .fail) -JSL.l OverworldMap_CheckObject : RTS -org $0AC5D8 ; < 545D8 - Bank0A.asm:1885 - (LDA $7EF3C7 : CMP.b #$07 : BNE OverworldMap_CheckPendant_fail) -JSL.l OverworldMap_CheckObject : RTS +;org $0AC5BB ; < 545BB - Bank0A.asm:1856 - (LDA $7EF3C7 : CMP.b #$03 : BNE .fail) +;JSL.l OverworldMap_CheckObject : RTS +;org $0AC5D8 ; < 545D8 - Bank0A.asm:1885 - (LDA $7EF3C7 : CMP.b #$07 : BNE OverworldMap_CheckPendant_fail) +;JSL.l OverworldMap_CheckObject : RTS ;================================================================================ org $0AC53e ; <- 5453E - Bank0A.asm:1771 - (LDA $0AC50D, X : STA $0D) -JSL.l GetCrystalNumber +LDA.l CrystalNumberTable, X ;================================================================================ ; EVERY INSTANCE OF STA $7EF3C7 IN THE ENTIRE CODEBASE org $029D51 ; <- 11D51 @@ -1864,34 +1864,35 @@ JSL.l GetMapMode org $0AC01A ; <- 5401A JSL.l GetMapMode -org $0AC037 ; <- 54037 -JSL.l GetMapMode -org $0AC079 ; <- 54079 -JSL.l GetMapMode -org $0AC0B8 ; <- 540B8 x -JSL.l GetMapMode -org $0AC0F8 ; <- 540F8 -JSL.l GetMapMode -org $0AC137 ; <- 54137 -JSL.l GetMapMode -org $0AC179 ; <- 54179 -JSL.l GetMapMode -org $0AC1B3 ; <- 541B3 -JSL.l GetMapMode -org $0AC1F5 ; <- 541F5 -JSL.l GetMapMode -org $0AC22F ; <- 5422F -JSL.l GetMapMode -org $0AC271 ; <- 54271 -JSL.l GetMapMode -org $0AC2AB ; <- 542AB -JSL.l GetMapMode -org $0AC2ED ; <- 542ED -JSL.l GetMapMode -org $0AC327 ; <- 54327 -JSL.l GetMapMode -org $0AC369 ; <- 54369 -JSL.l GetMapMode +;Overwritten +;org $0AC037 ; <- 54037 +;JSL.l GetMapMode +;org $0AC079 ; <- 54079 +;JSL.l GetMapMode +;org $0AC0B8 ; <- 540B8 x +;JSL.l GetMapMode +;org $0AC0F8 ; <- 540F8 +;JSL.l GetMapMode +;org $0AC137 ; <- 54137 +;JSL.l GetMapMode +;org $0AC179 ; <- 54179 +;JSL.l GetMapMode +;org $0AC1B3 ; <- 541B3 +;JSL.l GetMapMode +;org $0AC1F5 ; <- 541F5 +;JSL.l GetMapMode +;org $0AC22F ; <- 5422F +;JSL.l GetMapMode +;org $0AC271 ; <- 54271 +;JSL.l GetMapMode +;org $0AC2AB ; <- 542AB +;JSL.l GetMapMode +;org $0AC2ED ; <- 542ED +;JSL.l GetMapMode +;org $0AC327 ; <- 54327 +;JSL.l GetMapMode +;org $0AC369 ; <- 54369 +;JSL.l GetMapMode org $0DC849 ; <- 6C849 JSL.l GetMapMode diff --git a/menu/overworldmap.asm b/menu/overworldmap.asm new file mode 100644 index 0000000..67612af --- /dev/null +++ b/menu/overworldmap.asm @@ -0,0 +1,303 @@ +; adding support for up to 13 markers +!MC_FLAG = "$7F5420" +!INVENTORY_MAP = "$7EF368" +!INVENTORY_COMPASS = "$7EF364" +!MAP_OVERLAY = "$7EF414" ; [2] + +; tables +org $0ABDF6 +WorldMapIcon_posx_vanilla: +dw $0F31 ; prize1 +dw $08D0 ; prize2 +dw $0108 +dw $0F40 + +dw $0082 +dw $0F11 +dw $01D0 +dw $0100 + +dw $0CA0 +dw $0759 +dw $FF00 +dw $FF00 + +dw $FF00 +dw $FFFF ; reserved - not used +dw $FFFF +dw $FFFF + +org $0ABE16 +WorldMapIcon_posy_vanilla: +dw $0620 ; prize1 +dw $0080 ; prize2 +dw $0D70 +dw $0620 + +dw $00B0 +dw $0103 +dw $0780 +dw $0CA0 + +dw $0DA0 +dw $0ED0 +dw $FF00 +dw $FF00 + +dw $FF00 +dw $FFFF ; reserved - not used +dw $FFFF +dw $FFFF + +org $0ABE36 +WorldMapIcon_posx_located: +dw $FF00 ; prize1 +dw $FF00 ; prize2 +dw $FF00 +dw $FF00 + +dw $FF00 +dw $FF00 +dw $FF00 +dw $FF00 + +dw $FF00 +dw $FF00 +dw $FF00 +dw $FF00 + +dw $FF00 +dw $FFFF ; reserved - not used +dw $FFFF +dw $FFFF + +org $0ABE56 +WorldMapIcon_posy_located: +dw $FF00 ; prize1 +dw $FF00 ; prize2 +dw $FF00 +dw $FF00 + +dw $FF00 +dw $FF00 +dw $FF00 +dw $FF00 + +dw $FF00 +dw $FF00 +dw $FF00 +dw $FF00 + +dw $FF00 +dw $FFFF ; reserved - not used +dw $FFFF +dw $FFFF + +org $0ABE76 +WorldMapIcon_tile: +db $38, $62 ; green pendant +db $32, $60 ; red pendant +db $34, $60 ; blue pendant +db $34, $64 ; crystal + +db $34, $64 ; crystal +db $34, $64 ; crystal +db $34, $64 ; crystal +db $34, $64 ; crystal + +db $34, $64 ; crystal +db $34, $64 ; crystal +db $32, $66 ; skull looking thing +db $00, $00 ; red x + +db $00, $00 ; red x +db $00, $00 ; unused red x's +db $00, $00 +db $00, $00 + +org $0ABE96 +CompassExists: +; dw $37FC ; todo: convert to two bytes with masks? so much extra code... +; eastern hera desert pod skull trock thieves mire ice swamp gt at escape +db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $00, $00, $00, $00, $00 + +; 0 = light world, 1 = dark world +org $0ABEA6 +WorldCompassMask: +db $00, $00, $00, $01, $01, $01, $01, $01, $01, $01, $01, $00, $00, $00, $00, $00 + +; eastern desert hera pod skull trock thieves mire ice swamp gt at escape x1 x2 x3 + +; refs +org $0AC59B +WorldMapIcon_AdjustCoordinate: +org $0AC3B1 +WorldMap_CalculateOAMCoordinates: +org $0AC52E +WorldMap_HandleSpriteBlink: +org $0ABF70 +WorldMap_RedXChars: + +org $0AC02B +DrawPrizesOverride: +LDX.b #$FF +.loopStart + INX : PHX + JSR OverworldMap_CheckForPrize + BCC + : JMP .skip_draw : + + + TXA : ASL A : TAX + LDA.l !MC_FLAG + AND #$01 : BNE + + LDA.l WorldMapIcon_posx_vanilla+1, X : STA.l $7EC10B + LDA.l WorldMapIcon_posx_vanilla, X : STA.l $7EC10A + LDA.l WorldMapIcon_posy_vanilla+1, X : STA.l $7EC109 + LDA.l WorldMapIcon_posy_vanilla, X : STA.l $7EC108 + BRA .adjustment + + LDA.l WorldMapIcon_posx_located+1, X : STA.l $7EC10B + LDA.l WorldMapIcon_posx_located, X : STA.l $7EC10A + LDA.l WorldMapIcon_posy_located+1, X : STA.l $7EC109 + LDA.l WorldMapIcon_posy_located, X : STA.l $7EC108 + .adjustment + LDA.l WorldMapIcon_tile+1, X : BEQ .dont_adjust + CMP.b #$64 : BEQ .is_crystal + LDA.b $1A : AND.b #$10 : BNE .skip_draw + .is_crystal + JSR WorldMapIcon_AdjustCoordinate + .dont_adjust + JSR WorldMap_CalculateOAMCoordinates + BCC .skip_draw + PLX : PHX : TXA : ASL A : TAX + LDA.l WorldMapIcon_tile+1, X : BEQ .is_red_x + LDA.l !MC_FLAG : CMP.b #$01 : BEQ .is_red_x + LDA.l WorldMapIcon_tile+1, X : STA.b $0D + LDA.l WorldMapIcon_tile, X : STA.b $0C + LDA.b #$02 : BRA .continue + .is_red_x + LDA.b $1A : LSR #3 : AND.b #$03 : TAX + LDA.l WorldMap_RedXChars,X : STA.b $0D + LDA.b #$32 : STA.b $0C : LDA.b #$00 + .continue + STA.b $0B + PLX : PHX + JSR WorldMap_HandleSpriteBlink + .skip_draw + ; end of loop + PLX : CPX #12 : BCS + : JMP .loopStart : + + + PLA : STA.l $7EC10B + PLA : STA.l $7EC10A + PLA : STA.l $7EC109 + PLA : STA.l $7EC108 + RTS + + +; X - the index of the prize marker +OverworldMap_CheckForPrize: +PHX + LDA #$00 : STA.l !MC_FLAG + JSR OverworldMap_CheckForCompass + BCC + + LDA.l !MC_FLAG : ORA #$01 : STA.l !MC_FLAG + LDA $7EF3CA : AND #$40 : BNE ++ ; is the compass position on LW or DW? + LDA.l WorldCompassMask, X : BEQ + : JMP .fail + ++ LDA.l WorldCompassMask, X : BNE + : JMP .fail + + JSR OverworldMap_CheckForMap + BCC + + LDA.l !MC_FLAG : ORA #$02 : STA.l !MC_FLAG + + + LDA.l !MC_FLAG : BEQ .fail + CMP #$02 : BNE .checkIfObtained + LDA $7EF3CA : AND #$40 : BNE + + CPX #3 : BCS .fail : BRA .checkIfObtained + + CPX #10 : BCS .fail + CPX #3 : BCC .fail + + .checkIfObtained + LDA.l MC_DungeonIdsForPrize, X + BPL +++ : CLC : BRA .done : +++ ; non-prize flags + + TAX : LDA.l CrystalPendantFlags_2, X : BEQ .checkPendant + AND.b #$40 : BNE .checkCrystal + LDA.l CrystalPendantFlags_2, X : AND.b #$01 : BNE .checkAga1 + LDA.l CrystalPendantFlags_2, X : AND.b #$02 : BNE .checkAga2 + + ; see if hyrule castle has been completely cleared + LDA.l CompassTotal, X : SEC : SBC $7EF4BF, X : BEQ .fail + CLC : BRA .done + + .checkPendant + LDA $7EF374 : AND.l CrystalPendantFlags, X : BNE .fail + CLC : BRA .done + + .checkCrystal + LDA $7EF37A : AND.l CrystalPendantFlags, X : BNE .fail + CLC : BRA .done + + .checkAga1 + LDA $7EF3C5 : CMP #$03 : BEQ .fail + CLC : BRA .done + + .checkAga2 + LDA $7EF2DB : AND #$20 : BNE .fail + CLC : BRA .done + + .fail + SEC +.done +PLX +RTS + +;LDA $7EF3CA : AND #$40 : BNE + ; is the compass position on LW or DW? +; LDA.l WorldCompassMask, X : BNE .unset : BRA .continue +; + LDA.l WorldCompassMask, X : BEQ .unset + +; X - which compass in question +; CLC - should not move indicator +; SEC - yep indicator can move +OverworldMap_CheckForCompass: + LDA.l CompassMode : AND #$80 : BEQ .unset ; should I check for compass logic + LDA.l CompassMode : AND #$40 : BEQ .set ; compasses aren't shuffled + LDA.l CompassExists, X : BEQ .set ; compass doesn't exits + PHX + LDA.l MC_SRAM_Offsets, X : TAX ; put compass offset into X + LDA !INVENTORY_COMPASS, X : ORA !MAP_OVERLAY, X + PLX + AND.l MC_Masks, X : BNE .set ; is the compass obtained +.unset +CLC +RTS +.set +SEC +RTS + +; map - which map in question +; CLC - should not show exact prize +; SEC - yep should show exact prize +OverworldMap_CheckForMap: + LDA.l MapMode : BEQ .set ; obtaining map doesn't change anything + LDA $7EF3CA : AND #$40 : BNE + ; not really sure on this check + LDA !INVENTORY_MAP : ORA !MAP_OVERLAY : AND.b #$01 : BNE .set : BRA .continue + + LDA !INVENTORY_MAP : ORA !MAP_OVERLAY : AND.b #$02 : BNE .set +.continue + PHX + LDA.l MC_SRAM_Offsets, X : TAX ; put map offset into X + LDA !INVENTORY_MAP, X : ORA !MAP_OVERLAY, X + PLX + AND.l MC_Masks, X : BNE .set ; is the map obtained? +.unset +CLC +RTS +.set +SEC +RTS + +; eastern desert hera pod skull trock thieves mire ice swamp gt at escape +MC_DungeonIdsForPrize: +db $02, $0A, $03, $06, $08, $0C, $0B, $07, $09, $05, $00, $04, $01 +MC_SRAM_Offsets: +db $01, $00, $01, $01, $00, $00, $00, $01, $00, $01, $00, $01, $01 +MC_Masks: +; EP TH DP PD SK TR TT MM +db $20, $20, $10, $02, $80, $08, $10, $01, $40, $04, $04, $08, $40 + diff --git a/newhud.asm b/newhud.asm index 9c36f2d..40f0c11 100644 --- a/newhud.asm +++ b/newhud.asm @@ -98,7 +98,7 @@ SEP #$30 ; Draw Dungeon Compass Counts ;================================================================================ REP #$20 - LDA.l CompassMode : AND #$00FF : BEQ + ; skip if CompassMode is 0. + LDA.l CompassMode : AND #$003F : BEQ + ; skip if CompassMode is 0. JSL.l DrawDungeonCompassCounts ; compasses.asm + diff --git a/pendantcrystalhud.asm b/pendantcrystalhud.asm index 256b395..3b11aaa 100644 --- a/pendantcrystalhud.asm +++ b/pendantcrystalhud.asm @@ -42,82 +42,6 @@ RTL LDA.b #$FF ; don't show keys RTL ;================================================================================ -GetCrystalNumber: - PHX - TXA : ASL : TAX - LDA $7EF3CA : EOR.b #$40 : BNE + - INX - + - LDA.l CrystalNumberTable-16, X - PLX -RTL -;================================================================================ -!INVENTORY_MAP = "$7EF368" -!MAP_OVERLAY = "$7EF414" ; [2] -OverworldMap_CheckObject: - PHX - ;CPX.b #$01 : BNE + : JMP ++ : + : JMP .fail - LDA $7EF3CA : AND.b #$40 : BNE + - ;LW Map - LDA.l MapMode : BEQ +++ - LDA !INVENTORY_MAP : ORA !MAP_OVERLAY : AND.b #$01 : BNE +++ - PHX - LDA.l .lw_map_offsets, X : TAX ; put map offset into X - LDA !INVENTORY_MAP, X : ORA !MAP_OVERLAY, X - PLX - AND.l .lw_map_masks, X : BNE +++ - JMP .fail - +++ - LDA.l .lw_offsets, X - BPL +++ : CLC : BRA .done : +++ ; don't display master sword - TAX : BRA ++ - + - ;DW Map - LDA.l MapMode : BEQ +++ - LDA !INVENTORY_MAP : ORA !MAP_OVERLAY : AND.b #$02 : BNE +++ - PHX - LDA.l .dw_map_offsets, X : TAX ; put map offset into X - LDA.l !INVENTORY_MAP, X : ORA !MAP_OVERLAY, X - PLX - AND.l .dw_map_masks, X : BNE +++ - JMP .fail - +++ - LDA.l .dw_offsets, X - TAX : BRA ++ - SEC - PLX -RTL -++ - LDA.l CrystalPendantFlags_2, X - AND.b #$40 : BNE .checkCrystal - - .checkPendant - LDA $7EF374 : AND.l CrystalPendantFlags, X : BNE .fail - CLC : BRA .done - - .checkCrystal - LDA $7EF37A : AND.l CrystalPendantFlags, X : BNE .fail - CLC : BRA .done - - .fail - SEC - .done - PLX -RTL -.lw_offsets -db $02, $0A, $03, $FF -.dw_offsets -db $06, $08, $0C, $0B, $07, $09, $05 -.lw_map_offsets -db $01, $00, $01 -; pod skull trock thieves mire ice swamp -.dw_map_offsets -db $01, $00, $00, $00, $01, $00, $01 -.lw_map_masks -db $20, $20, $10, $00 -.dw_map_masks -db $02, $80, $08, $10, $01, $40, $04 -;================================================================================ SetLWDWMap: PHP SEP #$20 ; set 8-bit accumulator diff --git a/tables.asm b/tables.asm index 8ccb5fb..cab1dda 100644 --- a/tables.asm +++ b/tables.asm @@ -139,6 +139,8 @@ MapMode: db #$00 ; #$00 = Always On (default) - #$01 = Require Map Item CompassMode: db #$00 ; #$00 = Off (default) - #$01 = Display Dungeon Count w/Compass - #$02 = Display Dungeon Count Always + ; #$8x = Moves prize indicator to a special position if bit on + ; #$4x = Compasses are shuffled and must be obtained to show position if bit on ;-------------------------------------------------------------------------------- org $30803D ; PC 0x18003D PersistentFloodgate: @@ -240,13 +242,13 @@ org $30804F ; PC 0x18004F ByrnaInvulnerability: db #$01 ; #$00 = Off - #$01 = On (default) ;-------------------------------------------------------------------------------- -org $308050 ; PC 0x180050 - 0x18005C +org $308050 ; PC 0x180050 - 0x18005D CrystalPendantFlags_2: - db $00 ; Sewers - db $00 ; Hyrule Castle + db $02 ; Ganons Tower - because 5D is not available right now - sewers doesn't get one + db $04 ; Hyrule Castle db $00 ; Eastern Palace db $00 ; Desert Palace - db $00 ; Agahnim's Tower + db $01 ; Agahnim's Tower db $40 ; Swamp Palace db $40 ; Palace of Darkness db $40 ; Misery Mire @@ -258,6 +260,9 @@ CrystalPendantFlags_2: db $40 ; Turtle Rock ;Pendant: $00 ;Crystal: $40 +;Aga1: $01 +;Aga2: $02 +;HC special check $04 ;-------------------------------------------------------------------------------- org $30805E ; PC 0x18005E - Number of crystals required to enter GT NumberOfCrystalsRequiredForTower: @@ -288,20 +293,20 @@ dl #$000000 ;-------------------------------------------------------------------------------- org $308070 ; PC 0x180070 - 0x18007F CrystalNumberTable: -db $00 ; +db $69 ; Eastern +db $69 ; Hera +db $69 ; Desert +db $7F ; Darkness +db $6C ; Skull +db $7C ; TRock +db $6D ; Thieves +db $6F ; Mire +db $6E ; Ice db $79 ; Swamp db $00 ; -db $6E ; Ice db $00 ; -db $6F ; Mire db $00 ; -db $6D ; Thieves -db $69 ; Desert -db $7C ; TRock -db $69 ; Hera -db $6C ; Skull -db $69 ; Eastern -db $7F ; Darkness +db $00 ; db $00 ; db $00 ; @@ -1555,6 +1560,8 @@ dw #9999 ; Rupee Limit ; $7F5400 - $7F540F - MSU Block ; $7F5410 - $7F56FF - Unused +; $7F5420 - MapCompass flag - used during Overworld Map processing +; $7F5421 - $7F56FF - Unused ; $7F5700 - $7F57FF - Dialog Buffer ; From f95bce282b2c42acb04e64b1bcf95d8b964a3df3 Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 21 Oct 2021 16:15:34 -0600 Subject: [PATCH 23/25] Removed some comment cruft --- menu/overworldmap.asm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/menu/overworldmap.asm b/menu/overworldmap.asm index 67612af..9bd111a 100644 --- a/menu/overworldmap.asm +++ b/menu/overworldmap.asm @@ -248,10 +248,6 @@ PHX PLX RTS -;LDA $7EF3CA : AND #$40 : BNE + ; is the compass position on LW or DW? -; LDA.l WorldCompassMask, X : BNE .unset : BRA .continue -; + LDA.l WorldCompassMask, X : BEQ .unset - ; X - which compass in question ; CLC - should not move indicator ; SEC - yep indicator can move From 620c672fe1745cb56f80dd7e663098a26873ed58 Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 21 Oct 2021 16:18:51 -0600 Subject: [PATCH 24/25] Turn off Terrorpin AI fix by default - can be a post-gen option --- tables.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables.asm b/tables.asm index 99d4143..e158516 100644 --- a/tables.asm +++ b/tables.asm @@ -1879,7 +1879,7 @@ db #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, org $30E37D ; PC 0x18637D Enable_TerrorPin_AI_Fix: -db #$01 +db #$00 ;Shop slot count as check org $30E560 ; PC 0x18650 From 6757e35dcaef710f6d46f8d2b0ae4ffe1b0db142 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 2 Nov 2021 15:24:21 -0600 Subject: [PATCH 25/25] 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