From 2ed9de827bfe8e7ae280df270295dcd53886dd44 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 7 Sep 2025 10:46:51 -0500 Subject: [PATCH 01/42] Some follower fixes to support Zelda in TT Prison --- follower.asm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/follower.asm b/follower.asm index 7b4631a..56d6b25 100644 --- a/follower.asm +++ b/follower.asm @@ -160,18 +160,23 @@ MaybeSetZeldaCheckpoint: AND.w #$7FFF : TAX ; what we wrote over SEP #$20 LDA.l ProgressFlags : AND.b #$04 : BNE .return ; zelda rescued - LDA.l StartingEntrance : CMP.b #$04 : BEQ .return ; throne room checkpoint set + LDA.l StartingEntrance : CMP.b #$02 : BEQ .return ; cell checkpoint set + CMP.b #$04 : BEQ .return ; throne room checkpoint set LDA.l FollowerIndicator : CMP.b #$01 : BNE .return ; zelda following LDA.b RoomIndex : CMP.b #$80 : BNE + ;zelda cell LDA.l Follower_Zelda : CMP.b #$01 : BNE .return - JSL Dungeon_SaveRoomQuadrantData BRA .set_checkpoint + CMP.b #$45 : BNE .return ; maiden cell CPX.w #$0964 : BNE .return ; top big lock LDA.l Follower_Maiden : CMP.b #$01 : BNE .return .set_checkpoint LDA.b #$02 : STA.l StartingEntrance - JSL SaveDeathCount + PHX + SEP #$10 + JSL SaveDeathCount + JSL Dungeon_SaveRoomQuadrantData + REP #$10 + PLX .return REP #$30 RTL @@ -383,6 +388,9 @@ SetAndLoadFollower: JSL DetermineFollower_skip_stored : CMP.b #$01 : BNE + LDA.b #$02 : STA.l StartingEntrance JSL SaveDeathCount + PHX + JSL Dungeon_SaveRoomQuadrantData + PLX + CMP.b #$09 : BNE + LDA.b #$40 : STA.w $02CD : STZ.w $02CE ; locksmith timed message + From 912df0be148f923b1a8d2d3072519e0d006289bc Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 7 Sep 2025 10:43:26 -0500 Subject: [PATCH 02/42] Re-fixed old man spawn on pyramid issue --- darkworldspawn.asm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/darkworldspawn.asm b/darkworldspawn.asm index 1ed404d..5bc796f 100644 --- a/darkworldspawn.asm +++ b/darkworldspawn.asm @@ -118,8 +118,9 @@ RTL GetCurrentWorldForLoad: LDA.l FollowerTravelAllowed : CMP.b #$02 : BEQ .default LDA.l FollowerIndicator : CMP.b #$04 : BNE .default - LDA.l OldManRetrievalWorld - RTL + LDA.l InvertedMode : BEQ + + LDA.b #$40 + + RTL .default LDA.l CurrentWorld RTL From c3616f2d65efd0e7e4e922f7b01fcd6c7890790e Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 21 Sep 2025 13:38:02 -0500 Subject: [PATCH 03/42] Fixed issue with Duck overwriting GT cutscene gfx --- goalitem.asm | 1 + ram.asm | 2 ++ 2 files changed, 3 insertions(+) diff --git a/goalitem.asm b/goalitem.asm index b52f757..1484dc2 100644 --- a/goalitem.asm +++ b/goalitem.asm @@ -113,6 +113,7 @@ CheckGanonVulnerability: GTCutscene_TransferGfx: PHA REP #$20 + STZ.w DuckPose LDA.l GanonsTowerOpenGfx : BEQ .original_crystal PHX LDX.w ItemStackPtr : STA.l ItemGFXStack,X diff --git a/ram.asm b/ram.asm index b814b71..b1ea3b5 100644 --- a/ram.asm +++ b/ram.asm @@ -348,6 +348,8 @@ TransparencyFlag = $7E0ABD ; Flags transparency effects e.g. in Thieves T ; OWTransitionFlag = $7E0ABF ; Used for certain transitions like smith, witch, etc. ; +DuckPose = $7E0AF4 ; Used for duck gfx (2 bytes), zero value stops duck drawing in gfx slot + ; ItemGFXPtr = $7E0AFA ; Pointer for item receipt graphics transfers ; $0000 - no transfer, do nothing ; bit 7 reset - offset into ROM table From a8b1fc989e1a6d9b89bd1813dfa4345eaa51eea2 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 21 Sep 2025 13:40:51 -0500 Subject: [PATCH 04/42] Fixed pogdor (frogdor at PoD entrance) with Kiki following while exiting at PoD --- follower.asm | 10 ++++++++++ ram.asm | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/follower.asm b/follower.asm index 56d6b25..c7a42b8 100644 --- a/follower.asm +++ b/follower.asm @@ -79,6 +79,8 @@ org $9EE495 JSL Kiki_FollowCheck : BRA + : NOP #12 : + org $9EE4AF JSL Kiki_BecomeFollower : NOP #2 +org $9EE4F7 +JSL Kiki_FixTeleportOnExit org $89A1B2 JSL Kiki_DontScareTheMonke : NOP #3 @@ -834,6 +836,14 @@ Kiki_BecomeFollower: LDA.b #$0A : STA.l FollowerIndicator RTL +Kiki_FixTeleportOnExit: + REP #$30 + LDA.b LinkPosX : STA.w LinkPosXCache + LDA.b LinkPosY : STA.w LinkPosYCache + SEP #$30 + LDA.b #$19 : LDY.b #$01 ; what we wrote over +RTL + ; on return it checks BEQ and if non-zero, kiki get spook Kiki_DontScareTheMonke: LDA.b LinkJumping : BEQ .return diff --git a/ram.asm b/ram.asm index b1ea3b5..5150610 100644 --- a/ram.asm +++ b/ram.asm @@ -441,7 +441,8 @@ SpriteSubPixelZ = $7E0F90 ; CurrentSpriteSlot = $7E0FA0 ; Holds the current sprite/ancilla's index ; FreezeSprites = $7E0FC1 ; "Seems to freeze sprites" - ; +LinkPosXCache = $7E0FC2 ; Cache of Link's coordinates +LinkPosYCache = $7E0FC4 ; - Done at the beginning of Link_Main every frame GfxChrHalfSlotVerify = $7E0FC6 ; Mirrors $0AAA, set to >= $03 when VRAM has temp graphics loaded PrizePackIndexes = $7E0FC7 ; $07 bytes. One for each prize pack. ; From dfc182a2d55af7311b4a94c1289a80eceecaa8db Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 14 Oct 2025 02:50:07 -0500 Subject: [PATCH 05/42] New fix for pot drops when at sprite limit --- enemizer/hooks/bushes_hooks.asm | 6 +++- keydrop/standing_items.asm | 54 +++++++++++++++++++++++++++++++-- ram.asm | 8 +++++ vanillalabels.asm | 1 + 4 files changed, 66 insertions(+), 3 deletions(-) diff --git a/enemizer/hooks/bushes_hooks.asm b/enemizer/hooks/bushes_hooks.asm index e610bbb..a9e860b 100644 --- a/enemizer/hooks/bushes_hooks.asm +++ b/enemizer/hooks/bushes_hooks.asm @@ -2,7 +2,11 @@ ; New bush mob randomization ;-------------------------------------------------------------------------------- org $868279 -NOP #$0A +BRA + +MaybeSkipTerrainDebris: +JSL MaybeSkipTerrainDebris_long : RTS ; sticking this here, no other free space in bank 06 +NOP #3 ++ JSL sprite_bush_spawn NOP ; we keep the branch ;-------------------------------------------------------------------------------- diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index ef090b9..881f0e7 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -1,4 +1,7 @@ ; hooks +org $81DB19 + JSL MaybeSkipSmashTerrain : BCS $81DB11 + org $81E6B0 JSL RevealPotItem RTS @@ -39,6 +42,9 @@ org $86d180 org $86d18d ; <- 3518D - sprite_absorbable.asm : 274 (LDA $7EF36F : INC A : STA $7EF36F) JSL KeyGet +org $86E24A + JSR MaybeSkipTerrainDebris + org $86f9f3 ; bank06.asm : 6732 (JSL SpritePrep_LoadProperties) JSL LoadProperties_PreserveCertainProps @@ -46,6 +52,11 @@ org $86828A Sprite_SpawnSecret_SpriteSpawnDynamically: JSL CheckSprite_Spawn +org $87B114 + JSL MaybeUnableToLiftPotSfx + NOP #4 + db $30 ; BMI + org $87B169 JSL PreventPotSpawn : NOP @@ -773,7 +784,6 @@ CheckSprite_Spawn: RTL .check LDA.b Scrap0D : CMP.b #$08 : BNE + - LDA.w LinkDashing : BNE .error LDX.b #$0F ; loop looking for a Sprite with state 0A (carried by the player) @@ -784,7 +794,9 @@ RTL LDA.b #$00 : STZ.w SpriteAITable, X LDA.b #$E4 : JSL Sprite_SpawnDynamically BMI .error - LDA.b #$40 : TSB.w AButtonAct : RTL + LDA.w UseY1 : AND.b #$02 : BNE ++ + LDA.b #$40 : TSB.w AButtonAct + ++ RTL .error LDA.b #$3C ; SFX2_3C - error beep @@ -803,6 +815,44 @@ PreventPotSpawn2: LDA.b #$01 : TSB.b LinkStrafe ; what we wrote over + RTL +MaybeSkipTerrainDebris_long: + STZ.w SecretId ; what we wrote over + LDA.w SpriteTypeTable, X : CMP.b #$EC + BEQ .return + PLA : PLA : PLA : PLA : PLA + LDA.b #Sprite_ScheduleForBreakage_exit>>16 : PHA + PEA.w Sprite_ScheduleForBreakage_exit-1 +.return +RTL + +MaybeSkipSmashTerrain: + STY.w ManipIndex : LDA.w ManipTileMapX, Y ; what we wrote over + PHA + SEP #$30 + LDX.b #$0F + - LDA.w SpriteAITable, X : BEQ .continue + DEX + BPL - + .skip + PLA : PLA + LDA.b #$3C : STA.w SFX2 ; error beep + SEC + RTL + .continue + REP #$30 + PLA + CLC +RTL + +MaybeUnableToLiftPotSfx: + - LDA.w SpriteAITable,X : BEQ .return + DEX + BPL - + LDA.b #$3C : STA.w SFX2 ; error beep + LDA.b #$FF +.return +RTL + CheckIfPotIsSpecial: TXA ; give index to A so we can do a CMP.l CMP.l $018550 ; see if our current index is that of object 230 diff --git a/ram.asm b/ram.asm index 5150610..7c5d919 100644 --- a/ram.asm +++ b/ram.asm @@ -272,6 +272,8 @@ DungeonID = $7E040C ; High byte mostly unused but sometimes read. ; TransitionDirection = $7E0418 ; OW: 0=N 1=S 2=W 3=E UW: 0=S 1=N 2=E 3=W ; +ManipIndex = $7E042C ; Index of manipulable tile. Word length. + ; TrapDoorFlag = $7E0468 ; Flag that is set when trap doors are down. 2 bytes ; LayerAdjustment = $7E047A ; Flags layer adjustments. Arms EG. @@ -285,6 +287,8 @@ OWEntranceCutscene = $7E04C6 ; ; HeartBeepTimer = $7E04CA ; ; +ManipTileMapX = $7E0540 ; Tilemap X position of manipulable tile. $10 x 2 bytes + ; CameraTargetN = $7E0610 ; Camera scroll target for directions NSEW CameraTargetS = $7E0612 ; CameraTargetW = $7E0614 ; @@ -367,6 +371,7 @@ EnemyStunTimer = $7E0B58 ; Auto-decrementing timer for stunned enemies. ; BowDryFire = $7E0B9A ; If set, arrows are deleted immediately ; +SecretId = $7E0B9C ; Controls the secret spawned from bushes, pots, rocks, etc. SaveFileIndex = $7E0B9D ; ; SpriteAncillaInteract = $7E0BA0 ; If nonzero, ancillae do not interact with the sprite. $10 bytes. @@ -871,6 +876,7 @@ endmacro %assertRAM(OverworldIndexMirror, $7E040A) %assertRAM(DungeonID, $7E040C) %assertRAM(TransitionDirection, $7E0418) +%assertRAM(ManipIndex, $7E042C) %assertRAM(TrapDoorFlag, $7E0468) %assertRAM(LayerAdjustment, $7E047A) %assertRAM(RoomIndexMirror, $7E048E) @@ -878,6 +884,7 @@ endmacro %assertRAM(Map16ChangeIndex, $7E04AC) %assertRAM(OWEntranceCutscene, $7E04C6) %assertRAM(HeartBeepTimer, $7E04CA) +%assertRAM(ManipTileMapX, $7E0540) %assertRAM(CameraTargetN, $7E0610) %assertRAM(CameraTargetS, $7E0612) %assertRAM(CameraTargetW, $7E0614) @@ -928,6 +935,7 @@ endmacro %assertRAM(OverlordYHigh, $7E0B20) %assertRAM(EnemyStunTimer, $7E0B58) %assertRAM(BowDryFire, $7E0B9A) +%assertRAM(SecretId, $7E0B9C) %assertRAM(SaveFileIndex, $7E0B9D) %assertRAM(SpriteAncillaInteract, $7E0BA0) %assertRAM(AncillaVelocityY, $7E0C22) diff --git a/vanillalabels.asm b/vanillalabels.asm index fb40811..b842fff 100644 --- a/vanillalabels.asm +++ b/vanillalabels.asm @@ -201,6 +201,7 @@ Sprite_BagOfPowder = $85F644 MagicShopAssistant_Main = $85F893 Sprite_SpawnSecret_SetCoords = $8682A5 Chicken_SpawnAvengerChicken = $86A7DB +Sprite_ScheduleForBreakage_exit = $86E273 Link_PerformRead = $87B4DB Link_PerformOpenChest_no_replacement = $87B59F Link_CheckNewAPress = $87B5A9 From a9ef09e2d08108d9121d751c1cad33a6653a1387 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sat, 18 Oct 2025 02:26:42 -0500 Subject: [PATCH 06/42] Fixed Ganon silvers hint for free-standing items --- bookofmudora.asm | 4 ++-- heartpieces.asm | 24 +++--------------------- inventory.asm | 2 +- keydrop/standing_items.asm | 6 +++--- npcitems.asm | 2 +- shopkeeper.asm | 1 - 6 files changed, 10 insertions(+), 29 deletions(-) diff --git a/bookofmudora.asm b/bookofmudora.asm index 7ae84e6..b1c8ddd 100644 --- a/bookofmudora.asm +++ b/bookofmudora.asm @@ -16,7 +16,7 @@ DrawLibraryItemGFX: RTL ;-------------------------------------------------------------------------------- SetLibraryItem: - LDY.w SprItemReceipt, X + LDY.w SprSourceItemId, X JSL ItemSet_Library ; contains thing we wrote over RTL ;-------------------------------------------------------------------------------- @@ -52,7 +52,7 @@ RTL ;-------------------------------------------------------------------------------- GiveBonkItem: LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID - LDA.w SprItemReceipt, X + LDA.w SprSourceItemId, X JSR AbsorbKeyCheck : BCC .notKey PHY : LDY.b #$24 : JSL AddInventory : PLY ; do inventory processing for a small key LDA.l CurrentSmallKeys : INC A : STA.l CurrentSmallKeys diff --git a/heartpieces.asm b/heartpieces.asm index 4e2fe59..58ad5af 100644 --- a/heartpieces.asm +++ b/heartpieces.asm @@ -4,19 +4,10 @@ HeartPieceGet: PHX : PHY LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID - LDY.w SprItemReceipt, X : BNE + - LDA.w SprSourceItemId, X : BNE ++ - JSL LoadHeartPieceRoomValue - STA.w SprSourceItemId, X - ++ - JSL AttemptItemSubstitution - JSL ResolveLootIDLong - STA.w SprItemReceipt, X - TAY - + + LDY.w SprSourceItemId, X JSL MaybeMarkDigSpotCollected .skipLoad - LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID + LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID CPY.b #$26 : BNE .not_heart ; don't add a 1/4 heart if it's not a heart piece CMP.b #$00 : BNE .not_heart LDA.l HeartPieceQuarter : INC A : AND.b #$03 : STA.l HeartPieceQuarter @@ -32,16 +23,7 @@ RTL HeartContainerGet: PHX : PHY JSL IncrementBossSword - LDY.w SprItemReceipt, X : BNE + - LDA.w SprSourceItemId, X : BNE ++ - JSL LoadHeartContainerRoomValue - STA.w SprSourceItemId, X - ++ - JSL AttemptItemSubstitution - JSL ResolveLootIDLong - STA.w SprItemReceipt, X - TAY - + + LDY.w SprSourceItemId, X BRA HeartPieceGet_skipLoad ;-------------------------------------------------------------------------------- DrawHeartPieceGFX: diff --git a/inventory.asm b/inventory.asm index 003dfe2..97de1a5 100644 --- a/inventory.asm +++ b/inventory.asm @@ -646,7 +646,7 @@ RTL ; CollectPowder: ;-------------------------------------------------------------------------------- CollectPowder: - LDY.w SprItemReceipt, X ; Retrieve stored item type + LDY.w SprSourceItemId, X ; Retrieve stored item type BNE + ; if for any reason the item value is 0 reload it, just in case %GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index 881f0e7..a511bbb 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -682,7 +682,7 @@ KeyGet: PHA LDA.l StandingItemsOn : BNE + PLA : RTL - + LDY.w SprItemReceipt, X + + LDY.w SprSourceItemId, X LDA.w SprItemIndex, X : STA.w SpawnedItemIndex LDA.w SprItemFlags, X : STA.w SpawnedItemFlag STY.b Scrap00 @@ -704,7 +704,7 @@ KeyGet: .skip PLX .receive JSL Player_HaltDashAttackLong - TYA : JSL AttemptItemSubstitution : JSL ResolveLootIDLong : TAY + TYA : JSL AttemptItemSubstitution : TAY JSL Link_ReceiveItem PLA : DEC : RTL @@ -712,7 +712,7 @@ KeyTable: db $A0, $A0, $A2, $A3, $A4, $A5, $A6, $A7, $A8, $A9, $AA, $AB, $AC, $AD BigKeyGet: - LDY.w SprItemReceipt, X + LDY.w SprSourceItemId, X CPY.b #$32 : BNE + STZ.w ItemReceiptMethod : LDY.b #$32 ; what we wrote over PHX : JSL Link_ReceiveItem : PLX ; what we wrote over diff --git a/npcitems.asm b/npcitems.asm index d2c6501..449769d 100644 --- a/npcitems.asm +++ b/npcitems.asm @@ -138,7 +138,7 @@ RTL ItemSet_Mushroom: PHA LDA.l NpcFlags+1 : ORA.b #$10 : STA.l NpcFlags+1 - LDY.w SprItemReceipt, X ; Retrieve stored item type + LDY.w SprSourceItemId, X ; Retrieve stored item type BNE + ; if for any reason the item value is 0 reload it, just in case %GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) : TAY diff --git a/shopkeeper.asm b/shopkeeper.asm index da95e0e..3183eec 100644 --- a/shopkeeper.asm +++ b/shopkeeper.asm @@ -466,7 +466,6 @@ Shopkeeper_BuyItem: PLX LDA.l ShopInventory, X JSL AttemptItemSubstitution - JSL ResolveLootIDLong TAY : JSL Link_ReceiveItem LDA.l ShopInventory+3, X : INC : STA.l ShopInventory+3, X LDA.b #$00 : STA.l ShopEnableCount From 2ffcb1c3bd8542dbd6c1207958c8278731555e31 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 29 Oct 2025 00:08:16 -0500 Subject: [PATCH 07/42] Implemented Custom Goal Framework --- dialog.asm | 8 +- elder.asm | 20 ++- events.asm | 4 +- goalitem.asm | 380 ++++++++++++++++++++++++++++++-------------------- tables.asm | 113 ++++++++++----- utilities.asm | 17 +++ 6 files changed, 339 insertions(+), 203 deletions(-) diff --git a/dialog.asm b/dialog.asm index 5cc89a2..4a38b70 100644 --- a/dialog.asm +++ b/dialog.asm @@ -265,7 +265,7 @@ RTL RTL ;-------------------------------------------------------------------------------- DialogGanon1: - JSL CheckGanonVulnerability + LDA.b #$01 : JSL CheckConditionPass REP #$20 LDA.w #$018C BCC + @@ -284,7 +284,7 @@ RTL ; s = silver arrow bow ; p = 2nd progressive bow DialogGanon2: - JSL CheckGanonVulnerability + LDA.b #$01 : JSL CheckConditionPass REP #$20 BCS + @@ -372,8 +372,8 @@ RTL ;--------------------------------------------------------------------------------------------------- AgahnimAsksAboutPed: - LDA.l GanonVulnerableMode - CMP.b #$06 : BNE .vanilla + ; seems light_speed option to change some aga text is unused for now + BRA .vanilla LDA.l OverworldEventDataWRAM+$80 ; check ped flag AND.b #$40 diff --git a/elder.asm b/elder.asm index d464ece..fa5a838 100644 --- a/elder.asm +++ b/elder.asm @@ -39,32 +39,30 @@ RTL Elder_Code: { - REP #$20 - LDA.l GoalItemRequirement : BEQ .despawn - LDA.l GanonVulnerableMode : AND.w #$00FF : CMP.w #$0005 : BEQ .despawn - LDA.l TurnInGoalItems : AND.w #$00FF : BNE + + TXY : LDX.b #$06 + REP #$30 + LDA.l GoalConditionTable, X + TAX : LDA.l $B00000, X + SEP #$30 + TYX + CMP.b #$00 : BEQ .despawn ; no goal, despawn + LDA.l TurnInGoalItems : BNE + .despawn - SEP #$20 STZ.w SpriteAITable, X ; despawn self RTS + - SEP #$20 LDA.b GameSubMode BNE .done LDA.b #$96 LDY.b #$01 JSL Sprite_ShowSolicitedMessageIfPlayerFacing_PreserveMessage : BCC .dont_show - REP #$20 - LDA.l GoalCounter - CMP.l GoalItemRequirement : !BLT + - SEP #$20 + LDA.b #$03 : JSL CheckConditionPass : BCC + JSL ActivateTriforceCutscene + .dont_show .done - SEP #$20 LDA.b FrameCounter : LSR #5 : AND.b #$01 : STA.w SpriteGFXControl, X RTS } diff --git a/events.asm b/events.asm index 6247a7a..e288cc5 100644 --- a/events.asm +++ b/events.asm @@ -107,8 +107,8 @@ RTL ;-------------------------------------------------------------------------------- OnAga1Defeated: STA.l ProgressIndicator ; vanilla game state stuff we overwrote - LDA.l GanonVulnerableMode - CMP.b #$06 : BNE + + ; seems light_speed option to auto triforce room is unused for now + BRA + .light_speed REP #$20 LDA.w #$0019 : STA.b GameMode diff --git a/goalitem.asm b/goalitem.asm index 1484dc2..8c7a100 100644 --- a/goalitem.asm +++ b/goalitem.asm @@ -1,6 +1,6 @@ GoalItemGanonCheck: LDA.w SpriteTypeTable, X : CMP.b #$D6 : BNE .success ; skip if not ganon - JSL CheckGanonVulnerability + LDA.b #$01 : JSL CheckConditionPass BCS .success .fail @@ -11,104 +11,162 @@ RTL LDA.b OAMOffsetY : CMP.b #$80 ; thing we wrote over RTL ;-------------------------------------------------------------------------------- -;Carry clear = ganon invincible -;Carry set = ganon vulnerable -CheckGanonVulnerability: - PHX - LDA.l GanonVulnerableMode - ASL - TAX +; Input A = Type of condition check +; Carry clear = failed check +; Carry set = successful check +CheckConditionPass: + PHX : PHY + PHB + LDY.b #GoalConditionTable>>16 : PHY : PLB : STY.b Scrap02 + REP #$20 + ASL : TAY + LDA.w GoalConditionTable, Y : STA.b Scrap00 + PHK : PLB + SEP #$20 + LDY.b #$00 + - LDA.b [Scrap00], Y : CMP.b #$FF : BEQ .exit + INY : ROL : TAX + JSR (.conditions, X) : BCC .exit : BRA - - ; Carry - ; 0 - invulnerable - ; 1 - vulnerable - JSR (.goals, X) +.exit + PLB : PLY : PLX +RTL - PLX - RTL - - -.goals - dw .vulnerable - dw .invulnerable - dw .all_dungeons - dw .crystals_and_aga +; Y = index after condition code +; Carry = Set if using default target value +.conditions + dw .always_fail + dw .pendants dw .crystals + dw .pendant_bosses + dw .crystal_bosses + dw .bosses + dw .agahnim_defeated + dw .agahnim2_defeated dw .goal_item - dw .light_speed - dw .crystals_and_bosses - dw .bosses_only - dw .all_dungeons_no_agahnim - dw .all_items - dw .completionist + dw .collection_rate + dw .custom_goal + dw .bingo + dw .success + dw .success + dw .success + dw .success -; 00 = always vulnerable -.vulnerable +.agahnim2_defeated + LDA.l RoomDataWRAM[$0D].high : AND.b #$08 : BEQ .fail +.bingo ; not implemented yet .success - SEC - RTS - -; 01 = always invulnerable -.invulnerable + SEC : RTS +.always_fail .fail - CLC - RTS - -; 02 = All dungeons -.all_dungeons - LDA.l ProgressIndicator : CMP.b #$03 : BCC .fail ; require post-aga world state - -; 09 = All dungeons except agahnim -.all_dungeons_no_agahnim - LDA.l PendantsField : AND.b #$07 : CMP.b #$07 : BNE .fail ; require all pendants - LDA.l CrystalsField : AND.b #$7F : CMP.b #$7F : BNE .fail ; require all crystals - LDA.l RoomDataWRAM[$0D].high : AND.b #$08 : BEQ .fail ; require aga2 defeated (pyramid hole open) - BRA .success - -; 03 = crystals and aga 2 -.crystals_and_aga - LDA.l RoomDataWRAM[$0D].high : AND.b #$08 : BEQ .fail ; check aga2 first then bleed in - -; 04 = crystals only + CLC : RTS +.pendants + PHP + LDA.l PendantCounter : PLP : BCC + + CMP.b #$03 : RTS .crystals - JSL CheckEnoughCrystalsForGanon - RTS - -; 05 = require goal item + PHP + LDA.l CrystalCounter : PLP : BCC + + CMP.b #$07 : RTS +.pendant_bosses + PHP + LDA.b #$07 : STA.b Scrap03 : STZ.b Scrap04 + JSR CheckForBossesDefeated : PLP : BCC + + CMP.b #$03 : RTS +.crystal_bosses + PHP + LDA.b #$40 : STA.b Scrap03 : STZ.b Scrap04 + JSR CheckForBossesDefeated : PLP : BCC + + CMP.b #$07 : RTS +.bosses + PHP + LDA.b #$47 : STA.b Scrap03 : STZ.b Scrap04 + JSR CheckForBossesDefeated : PLP : BCC + + CMP.b #$10 : RTS + + CMP.b [Scrap00], Y : INY : RTS +.agahnim_defeated + LDA.l ProgressIndicator : CMP.b #$03 : RTS .goal_item - REP #$20 - LDA.l GoalCounter : CMP.l GoalItemRequirement - SEP #$20 + REP #$20 + LDA.l GoalCounter : BCC + + CMP.l GoalItemRequirement : BRA ++ +.collection_rate + REP #$20 + LDA.l TotalItemCounter : BCC + + CMP.l TotalItemCount : BRA ++ + + CMP.b [Scrap00], Y : INY : INY : ++ + SEP #$20 RTS +.custom_goal + LDA.b [Scrap00], Y : INY ; options + PHA : AND.b #$07 : ASL : TAX : PLA + ;JMP CheckConditionPassCustom + ; flows into next function, do not insert code after without uncommenting above -; 06 = light speed -.light_speed - BRA .fail +; -------------------------------------------------------------------------------- +; Input A = Options value, see GoalConditionTable for format +; Input X = Condition check type index +; Input Y = Index after Options byte +CheckConditionPassCustom: + PHX : PHA : BIT.b #$08 : PHP + REP #$30 + LDA.b [Scrap00], Y : INY : INY ; address + PLP : REP #$30 : BEQ .byte +.word + TAX + SEP #$20 + PLA + AND.b #$10 + REP #$20 + BNE + + LDA.l $7E0000, X : BRA ++ + + + LDA.l $7F0000, X : ++ + SEP #$10 + PLX + REP #$10 + JSR (.comparisons, X) + INY + SEP #$30 + RTS +.byte + TAX + SEP #$20 + PLA + AND.b #$10 : BNE + + LDA.l $7E0000, X : BRA ++ + + + LDA.l $7F0000, X : ++ + SEP #$10 + PLX + JMP (.comparisons, X) -; 07 = Crystals and bosses -.crystals_and_bosses - JSL CheckEnoughCrystalsForGanon ; check crystals first then bleed in to next - BCC .fail - -; 08 = Crystal bosses but no crystals -.bosses_only - JMP CheckForCrystalBossesDefeated - -; 09 = 100% item collection rate -.all_items - REP #$20 - LDA.l TotalItemCounter : CMP.l TotalItemCount - SEP #$20 - RTS - -; 0A = 100% item collection rate and all dungeons -.completionist - REP #$20 - LDA.l TotalItemCounter : CMP.l TotalItemCount - SEP #$20 - BCC .fail - BRA .all_dungeons +.comparisons + dw .minimum + dw .exact + dw .bitfield_nonzero + dw .bitfield_match + dw .count_bits + dw .fail + dw .fail + dw .fail +.pass + INY : SEC : RTS +.count_bits + JSL CountBits +.minimum + CMP.b [Scrap00], Y : INY + RTS +.bitfield_match + AND.b [Scrap00], Y +.exact + CMP.b [Scrap00], Y : BEQ .pass + INY : CLC : RTS +.bitfield_nonzero + AND.b [Scrap00], Y : BNE .pass +.fail + INY : CLC : RTS ;-------------------------------------------------------------------------------- GTCutscene_TransferGfx: PHA @@ -203,47 +261,83 @@ GTCutscene_ActivateSparkle_SelectCrystal: RTL ;-------------------------------------------------------------------------------- GTCutscene_NumberOfCrystals: + PHX : PHY : PHP REP #$20 - LDA.l GanonsTowerOpenAddress : CMP.w #CrystalCounter : BEQ + - LDA.w #$0001 : BRA .done - + LDA.l GanonsTowerOpenTarget - .done + LDA.l GanonsTowerOpenGfx+2 : BEQ .not_multiple_gfx + LDX.b #$04 + - LDA.l GanonsTowerOpenGfx, X : BEQ + + INX : INX : CPX.b #$0E : BCC - + + + TXA : LSR + JMP .done +.not_multiple_gfx + LDX.b #$00 : LDA.l GoalConditionTable, X + TXY : STY.b Scrap00 + REP #$10 SEP #$20 + TAX + - LDA.l $B00000, X : CMP.b #$FF : BEQ .use_y + ROL : PHP : CMP.b #$10 : BCS .not_8bit_compare + ; uses 8-bit targets + CMP.b #$04 : BNE .not_crystal_goal ; crystal goal + PLP : BCC + + LDY.b #$07 : BRA .use_y + .not_crystal_goal + CMP.b #$02 : BNE .not_pendant_goal ; pendant goal + PLP : BCC + + LDY.b #$03 : BRA .use_y + + + INX : LDA.l $B00000, X : TAY : BRA .use_y + .not_pendant_goal + PLP : INX : BCS + + INX + + + BRA - + .not_8bit_compare + CMP.b #$14 : BCS .custom_goal + ; uses 16-bit targets + PLP : INX : BCS + + INX : INX + + + BRA - + .custom_goal + BNE .unknown + PLP + INC.b Scrap00 + INX : LDA.l $B00000, X : BIT.b #$08 : PHP + INX : INX : INX : AND.b #$03 : BEQ .use_custom_target + INY + INX : PLP : BEQ + + INX + + + BRA - + .use_custom_target + PLP : BEQ .8bit_target + ; 16-bit target + REP #$20 + LDA.l $B00000, X : CMP.w #$0008 : SEP #$20 : INX : BRA + + .8bit_target + LDA.l $B00000, X : CMP.b #$08 : + : BCC + + INY : INX : BRA - + + + PHY : ADC.b 1,S : PLY : TAY + INX : JMP - + .unknown ; unknown condition, exit with safe value + PLP : INY +.use_y + TYA : CMP.b #$08 : BCC .done + LDA.b Scrap00 +.done + PLP : PLY : PLX RTS ;-------------------------------------------------------------------------------- -CheckEnoughCrystalsForGanon: - REP #$20 - LDA.l CrystalCounter - CMP.l GanonVulnerableTarget - SEP #$20 -RTL -;-------------------------------------------------------------------------------- CheckTowerOpen: - LDA.l GanonsTowerOpenMode : ASL : TAX - JSR (.tower_open_modes,X) -RTL - .tower_open_modes - dw .vanilla - dw .arbitrary_cmp - - .vanilla - LDA.l CrystalsField - AND.b #$7F : CMP.b #$7F - RTS - - .arbitrary_cmp - REP #$30 - LDA.l GanonsTowerOpenAddress : TAX - LDA.l $7E0000,X - CMP.l GanonsTowerOpenTarget - SEP #$30 - RTS - + LDA.b #$00 : JML CheckConditionPass ;--------------------------------------------------------------------------------------------------- CheckAgaForPed: REP #$20 - LDA.l GanonVulnerableMode - CMP.w #$0006 : BNE .vanilla + ; seems light_speed option to force blue balls is unused for now + BRA .vanilla .light_speed SEP #$20 @@ -264,7 +358,7 @@ CheckAgaForPed: RTL ;--------------------------------------------------------------------------------------------------- -CheckForCrystalBossesDefeated: +CheckForBossesDefeated: PHB : PHX : PHY LDA.b #CrystalPendantFlags_2>>16 @@ -273,13 +367,13 @@ CheckForCrystalBossesDefeated: REP #$30 ; count of number of bosses killed - STZ.b Scrap00 + STZ.b Scrap04 LDY.w #10 .next_check LDA.w CrystalPendantFlags_2+2,Y - BIT.w #$0040 + BIT.w Scrap03 BEQ ++ TYA @@ -293,7 +387,7 @@ CheckForCrystalBossesDefeated: AND.w #$0800 BEQ ++ - INC.b Scrap00 + INC.b Scrap04 ++ DEY BPL .next_check @@ -301,36 +395,22 @@ CheckForCrystalBossesDefeated: SEP #$30 PLY : PLX : PLB - LDA.b Scrap00 : CMP.l GanonVulnerableTarget - + LDA.b Scrap04 RTS ;--------------------------------------------------------------------------------------------------- CheckPedestalPull: ; Out: c - Successful ped pull if set, do nothing if unset. - PHX - LDA.l PedCheckMode : ASL : TAX - JSR (.pedestal_modes,X) - PLX + LDA.b #$02 : JSL CheckConditionPass : BCS .return + PHX : PHP + LDA.b GameMode : CMP.b #$0E : BEQ + + REP #$30 + LDX.w #$0004 : LDA.l GoalConditionTable, X : TAX + LDA.l $B00000, X : CMP.w #$FF81 : BEQ + + SEP #$30 + LDA.b #$97 : LDY.b #$01 + JSL Sprite_ShowMessageUnconditional + + + PLP : PLX +.return RTL - - .pedestal_modes - dw .vanilla - dw .arbitrary_cmp - - .vanilla - LDA.l PendantsField - AND.b #$07 : CMP.b #$07 : BNE ..nopull - SEC - RTS - ..nopull - CLC - RTS - - .arbitrary_cmp - REP #$30 - LDA.l PedPullAddress : TAX - LDA.l $7E0000,X - CMP.l PedPullTarget - SEP #$30 - RTS diff --git a/tables.asm b/tables.asm index e29bbfe..40af715 100644 --- a/tables.asm +++ b/tables.asm @@ -892,43 +892,84 @@ org $B08196 ; PC 0x180196-0x180197 TotalItemCount: ; Total item count for HUD. Only counts items that use "item get" animation. dw $00D8 ; 216 -org $B08198 ; PC 0x180198-0x1801A9 -GanonsTowerOpenAddress: ; 0x180198-0x180199 -dw CrystalCounter ; Target address for GT open check -GanonsTowerOpenTarget: ; 0x18019A-0x18019B -dw $0007 ; Target amount for GT open modes to compare -GanonsTowerOpenMode: ; 0x18019C-0x18019D -dw $0001 ; $00 = Vanilla | $01 = Compare target with address -PedPullAddress: ; 0x18019E-0x18019F -dw PendantCounter ; Target address for ped pull check -PedPullTarget: ; 0x1801A0-0x1801A1 -dw $0003 ; Target amount for ped pull modes to check -PedCheckMode: ; 0x1801A2-0x1801A3 -dw $0000 ; $00 = vanilla | $01 = Compare address to target value -GanonVulnerableAddress: ; 0x1801A4-0x1801A5 -dw CrystalCounter ; Target address for ped pull check -GanonVulnerableTarget: ; 0x1801A6-0x1801A7 -dw $0007 ; Target amount for Ganon vulnerability modes to compare -GanonVulnerableMode: ; 0x1801A8-0x1801A9 -dw $0000 ; #$00 = Off (default) - ; #$01 = On - ; #$02 = Require All Dungeons - ; #$03 = Require "GanonVulnerableTarget" Crystals and Aga2 - ; #$04 = Require "GanonVulnerableTarget" Crystals - ; #$05 = Require "GoalItemRequirement" Goal Items - ; #$06 = Light Speed - ; #$07 = Require All Crystals and Crystal Bosses - ; #$08 = Require All Crystal Bosses only - ; #$09 = Require All Dungeons No Agahnim - ; #$0A = Require 100% Item Collection - ; #$0B = Require 100% Item Collection and All Dungeons -GanonsTowerOpenGfx: ; 0x1801AA-0x1801AB -dw $0000 ; Gfx used for GT open animation, similar to StandingItemGraphicsOffsets -GanonsTowerOpenPalette: ; 0x1801AC -db $00 ; Palette for GanonsTowerOpenGfx -;VHPP CCC O +org $B08198 ; PC 0x180198-0x1801D7 (variable tables, $FF terminated) +GoalConditionTable: + dw GanonsTowerOpen + dw GanonVulnerable + dw PedPull + dw MurahdahlaComplete + +GanonsTowerOpen: + db $82 ; Crystal Count >= Default 7 + db $FF +GanonVulnerable: + db $82 ; Crystal Count >= Default 7 + db $07 ; Agahnim 2 defeated + db $FF +PedPull: + db $81 ; Pendant Count >= Default 3 + db $FF +MurahdahlaComplete: + db $88 ; Triforce Pieces >= Default Goal + db $FF +; These are lists of conditions to check for various goals, +; each terminated by #$FF. +; First byte is condition type, with most significant bit +; indicating the default value should be used, else the +; following byte/s indicate the custom target value. +; ----------------------------------------------------------- +; Condition Types: +; #$00 = Always Invulnerable +; #$01 = Require Pendants - Default is 3 +; #$02 = Require Crystals - Default is 7 +; #$03 = Require Pendant Bosses - Default is 3 +; #$04 = Require Crystal Bosses - Default is 7 +; #$05 = Require Prize Bosses - Default is 10 +; #$06 = Require Agahnim 1 +; #$07 = Require Agahnim 2 +; #$08 = Require Goal Items (ie. Triforce Pieces) - Default is value at GoalItemRequirement +; #$09 = Require Item Collection - Default is Max Collection Rate +; #$0A = Require Custom Goal +; ----------------------------------------------------------- +; For Custom Goal, one byte indicates the bitfield options, +; followed by two bytes for the target address, followed +; by one or two bytes for the custom target value. +; Options bitfield: +; ---b accc +; b - bank flag - 0 = $7E - 1 = $7F +; a - addressing mode - 0 = 8-bit - 1 = 16-bit +; c - comparison mode +; 0 = minimum (>=) +; 1 = exact (==) +; 2 = bitfield any +; 3 = bitfield match +; 4 = count bits set in bitfield +; 5-7 = reserved ;-------------------------------------------------------------------------------- -; 0x1801AD - 0x1801FF (unused) +org $B081D8 ; PC 0x1801D8 - 0x1801FE +GanonsTowerOpenGfx: ; 0x1801D8-0x1801E5 +dw $0000 ; Gfx used for GT open animation, similar to StandingItemGraphicsOffsets +dw $0000, $0000, $0000, $0000, $0000, $0000 +GanonsTowerOpenPalette: ; 0x1801E6-0x1801EC +db $00 ; Palette for GanonsTowerOpenGfx +db $00, $00, $00, $00, $00, $00 +; VHPP CCCO (VertFlip, HorizFlip, Priority, ColorPalette, OAM Sheet) +PedPullGfx: ; 0x1801ED-0x1801F2 +dw $0000 ; Gfx used for ped pull animation, similar to StandingItemGraphicsOffsets +dw $0000, $0000 +PedPullPalette: ; 0x1801F3-0x1801F5 +db $00 ; Palette for PedPullGfx +db $00, $00 +; VHPP CCCO (VertFlip, HorizFlip, Priority, ColorPalette, OAM Sheet) +MurahdahlaGfx: ; 0x1801F6-0x1801FB +dw $0000 ; Gfx used for ped pull animation, similar to StandingItemGraphicsOffsets +dw $0000, $0000 +MurahdahlaPalette: ; 0x1801FC-0x1801FE +db $00 ; Palette for MurahdahlaGfx +db $00, $00 +; VHPP CCCO (VertFlip, HorizFlip, Priority, ColorPalette, OAM Sheet) +;-------------------------------------------------------------------------------- +; 0x1801FF (unused) ;================================================================================ org $B08200 ; PC 0x180200 - 0x18020B RedClockAmount: diff --git a/utilities.asm b/utilities.asm index 5a1414a..7e4b71f 100644 --- a/utilities.asm +++ b/utilities.asm @@ -520,3 +520,20 @@ AuxPaletteCheck: REP #$30 PLX RTS + +CountBits: +; In: A - value to count bits set in +; Out: A - number of bits set +; Flexible to use with 8 or 16-bit mode + PHX : TAX + PHY : PHP + SEP #$20 + LDA.b 1,S : BIT.b #$20 : BNE + + PLP : TXA : LDX.w #$000F : LDY.w #$0000 + BRA ++ + + PLP : TXA : LDX.b #$07 : LDY.b #$00 + ++ - LSR : BCC + + INY + + DEX : BPL - + TYA : PLY : PLX +RTL From db62d4c6606704ab2e7cc328cfc480ad356d177b Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 29 Oct 2025 15:01:47 -0500 Subject: [PATCH 08/42] Fixed issue with Locksmith despawning after purple chest turn-in when a follower is stored --- follower.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/follower.asm b/follower.asm index c7a42b8..13e575d 100644 --- a/follower.asm +++ b/follower.asm @@ -932,8 +932,8 @@ Locksmith_BecomeFollower: Locksmith_RespondToAnswer_PostItem: STA.l FollowerIndicator ; what we wrote over LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .no_despawn - LDA.l Follower_Locksmith : CMP.b #$0C : BEQ .despawn LDA.w SpriteAux, X : BNE .no_despawn + LDA.l Follower_Locksmith : CMP.b #$0C : BEQ .despawn JSL DetermineFollowerSpawn_include_stored : BCC .no_despawn .despawn STZ.w SpriteAITable, X From 78fa8b7dd9907784b82803847d538f58de39e681 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Fri, 31 Oct 2025 01:00:56 -0500 Subject: [PATCH 09/42] Fixed Bosses goal condition check --- goalitem.asm | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/goalitem.asm b/goalitem.asm index 8c7a100..6b3e9c0 100644 --- a/goalitem.asm +++ b/goalitem.asm @@ -70,17 +70,17 @@ RTL CMP.b #$07 : RTS .pendant_bosses PHP - LDA.b #$07 : STA.b Scrap03 : STZ.b Scrap04 + LDA.b #$02 JSR CheckForBossesDefeated : PLP : BCC + CMP.b #$03 : RTS .crystal_bosses PHP - LDA.b #$40 : STA.b Scrap03 : STZ.b Scrap04 + LDA.b #$01 JSR CheckForBossesDefeated : PLP : BCC + CMP.b #$07 : RTS .bosses PHP - LDA.b #$47 : STA.b Scrap03 : STZ.b Scrap04 + LDA.b #$00 JSR CheckForBossesDefeated : PLP : BCC + CMP.b #$10 : RTS + CMP.b [Scrap00], Y : INY : RTS @@ -361,41 +361,43 @@ CheckAgaForPed: CheckForBossesDefeated: PHB : PHX : PHY - LDA.b #CrystalPendantFlags_2>>16 + STA.b Scrap04 ; 0 = check all, 1 = check crystals, 2 = check pendants + + LDA.b #CrystalPendantFlags_3>>16 PHA : PLB - REP #$30 + STZ.b Scrap03 ; count of number of bosses killed + STZ.b Scrap05 - ; count of number of bosses killed - STZ.b Scrap04 + REP #$30 LDY.w #10 .next_check - LDA.w CrystalPendantFlags_2+2,Y - BIT.w Scrap03 - BEQ ++ + LDA.w CrystalPendantFlags_3+2,Y : AND.w #$00FF : BEQ .skip + CMP.w #$0008 ; C set = pendant, C clear = crystal + LDA.b Scrap04 : BEQ .proceed + PHP : ROR : BCC + + PLP : BCS .skip : BRA .proceed + + PLP : BCC .skip - TYA - ASL - TAX + .proceed + TYA : ASL : TAX - LDA.l DrawHUDDungeonItems_boss_room_ids-4,X - TAX + LDA.l DungeonMapBossRooms+4,X + ASL : TAX LDA.l RoomDataWRAM.l,X - AND.w #$0800 - BEQ ++ + AND.w #$0800 : BEQ .skip + INC.b Scrap03 - INC.b Scrap04 - -++ DEY - BPL .next_check + .skip + DEY : BPL .next_check SEP #$30 PLY : PLX : PLB - LDA.b Scrap04 + LDA.b Scrap03 RTS ;--------------------------------------------------------------------------------------------------- From 44b014fc656b896c9f02ca343afdf5cd8e26c91e Mon Sep 17 00:00:00 2001 From: aerinon Date: Fri, 31 Oct 2025 10:29:29 -0600 Subject: [PATCH 10/42] fix: fix for pot drops at sprite limit --- enemizer/hooks/bushes_hooks.asm | 6 +++- keydrop/standing_items.asm | 54 ++++++++++++++++++++++++++++++++- ram.asm | 8 +++++ vanillalabels.asm | 1 + 4 files changed, 67 insertions(+), 2 deletions(-) diff --git a/enemizer/hooks/bushes_hooks.asm b/enemizer/hooks/bushes_hooks.asm index e610bbb..a9e860b 100644 --- a/enemizer/hooks/bushes_hooks.asm +++ b/enemizer/hooks/bushes_hooks.asm @@ -2,7 +2,11 @@ ; New bush mob randomization ;-------------------------------------------------------------------------------- org $868279 -NOP #$0A +BRA + +MaybeSkipTerrainDebris: +JSL MaybeSkipTerrainDebris_long : RTS ; sticking this here, no other free space in bank 06 +NOP #3 ++ JSL sprite_bush_spawn NOP ; we keep the branch ;-------------------------------------------------------------------------------- diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index 491a4e8..0ffcfda 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -1,4 +1,7 @@ ; hooks +org $81DB19 + JSL MaybeSkipSmashTerrain : BCS $81DB11 + org $81E6B0 JSL RevealPotItem RTS @@ -43,6 +46,9 @@ org $86d180 org $86d18d ; <- 3518D - sprite_absorbable.asm : 274 (LDA $7EF36F : INC A : STA $7EF36F) JSL KeyGet +org $86E24A + JSR MaybeSkipTerrainDebris + org $86f9f3 ; bank06.asm : 6732 (JSL SpritePrep_LoadProperties) JSL LoadProperties_PreserveCertainProps @@ -50,6 +56,12 @@ org $86828A Sprite_SpawnSecret_SpriteSpawnDynamically: JSL CheckSprite_Spawn +org $87B114 + JSL MaybeUnableToLiftPotSfx + NOP #4 + db $30 ; BMI + + org $87B169 JSL PreventPotSpawn : NOP @@ -757,7 +769,9 @@ RTL LDA.b #$00 : STZ.w SpriteAITable, X LDA.b #$E4 : JSL Sprite_SpawnDynamically BMI .error - LDA.b #$40 : TSB.w AButtonAct : RTL + LDA.w UseY1 : AND.b #$02 : BNE ++ + LDA.b #$40 : TSB.w AButtonAct + ++ RTL .error LDA.b #$3C ; SFX2_3C - error beep @@ -776,6 +790,44 @@ PreventPotSpawn2: LDA.b #$01 : TSB.b LinkStrafe ; what we wrote over + RTL +MaybeSkipTerrainDebris_long: + STZ.w SecretId ; what we wrote over + LDA.w SpriteTypeTable, X : CMP.b #$EC + BEQ .return + PLA : PLA : PLA : PLA : PLA + LDA.b #Sprite_ScheduleForBreakage_exit>>16 : PHA + PEA.w Sprite_ScheduleForBreakage_exit-1 +.return +RTL + +MaybeSkipSmashTerrain: + STY.w ManipIndex : LDA.w ManipTileMapX, Y ; what we wrote over + PHA + SEP #$30 + LDX.b #$0F + - LDA.w SpriteAITable, X : BEQ .continue + DEX + BPL - + .skip + PLA : PLA + LDA.b #$3C : STA.w SFX2 ; error beep + SEC + RTL + .continue + REP #$30 + PLA + CLC +RTL + +MaybeUnableToLiftPotSfx: + - LDA.w SpriteAITable,X : BEQ .return + DEX + BPL - + LDA.b #$3C : STA.w SFX2 ; error beep + LDA.b #$FF +.return +RTL + CheckIfPotIsSpecial: TXA ; give index to A so we can do a CMP.l CMP.l $018550 ; see if our current index is that of object 230 diff --git a/ram.asm b/ram.asm index 0dfa15b..693fe5b 100644 --- a/ram.asm +++ b/ram.asm @@ -263,6 +263,8 @@ DungeonID = $7E040C ; High byte mostly unused but sometimes read. ; TransitionDirection = $7E0418 ; OW: 0=N 1=S 2=W 3=E UW: 0=S 1=N 2=E 3=W ; +ManipIndex = $7E042C ; Index of manipulable tile. Word length. + ; TrapDoorFlag = $7E0468 ; Flag that is set when trap doors are down. 2 bytes ; LayerAdjustment = $7E047A ; Flags layer adjustments. Arms EG. @@ -276,6 +278,8 @@ OWEntranceCutscene = $7E04C6 ; ; HeartBeepTimer = $7E04CA ; ; +ManipTileMapX = $7E0540 ; Tilemap X position of manipulable tile. $10 x 2 bytes + ; CameraTargetN = $7E0610 ; Camera scroll target for directions NSEW CameraTargetS = $7E0612 ; CameraTargetW = $7E0614 ; @@ -344,6 +348,7 @@ EnemyStunTimer = $7E0B58 ; Auto-decrementing timer for stunned enemies. ; BowDryFire = $7E0B9A ; If set, arrows are deleted immediately ; +SecretId = $7E0B9C ; Controls the secret spawned from bushes, pots, rocks, etc. SaveFileIndex = $7E0B9D ; ; SpriteAncillaInteract = $7E0BA0 ; If nonzero, ancillae do not interact with the sprite. $10 bytes. @@ -836,6 +841,7 @@ endmacro %assertRAM(OverworldIndexMirror, $7E040A) %assertRAM(DungeonID, $7E040C) %assertRAM(TransitionDirection, $7E0418) +%assertRAM(ManipIndex, $7E042C) %assertRAM(TrapDoorFlag, $7E0468) %assertRAM(LayerAdjustment, $7E047A) %assertRAM(RoomIndexMirror, $7E048E) @@ -843,6 +849,7 @@ endmacro %assertRAM(Map16ChangeIndex, $7E04AC) %assertRAM(OWEntranceCutscene, $7E04C6) %assertRAM(HeartBeepTimer, $7E04CA) +%assertRAM(ManipTileMapX, $7E0540) %assertRAM(CameraTargetN, $7E0610) %assertRAM(CameraTargetS, $7E0612) %assertRAM(CameraTargetW, $7E0614) @@ -885,6 +892,7 @@ endmacro %assertRAM(OverlordYHigh, $7E0B20) %assertRAM(EnemyStunTimer, $7E0B58) %assertRAM(BowDryFire, $7E0B9A) +%assertRAM(SecretId, $7E0B9C) %assertRAM(SaveFileIndex, $7E0B9D) %assertRAM(SpriteAncillaInteract, $7E0BA0) %assertRAM(AncillaVelocityY, $7E0C22) diff --git a/vanillalabels.asm b/vanillalabels.asm index 1611fef..b2ee2a2 100644 --- a/vanillalabels.asm +++ b/vanillalabels.asm @@ -192,6 +192,7 @@ Sprite_BagOfPowder = $85F644 MagicShopAssistant_Main = $85F893 Sprite_SpawnSecret_SetCoords = $8682A5 Chicken_SpawnAvengerChicken = $86A7DB +Sprite_ScheduleForBreakage_exit = $86E273 Link_PerformRead = $87B4DB Link_PerformOpenChest_no_replacement = $87B59F Link_CheckNewAPress = $87B5A9 From b24e4405978caab945be77298fed43f7fc5d7a97 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 19 Aug 2025 10:10:08 -0500 Subject: [PATCH 11/42] Fix issue with music silence in DR when straight stairs lead to pre-Aga room --- hooks.asm | 4 ++++ music.asm | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/hooks.asm b/hooks.asm index e045cca..5e5c224 100644 --- a/hooks.asm +++ b/hooks.asm @@ -2206,6 +2206,10 @@ dl Overworld_FinishMirrorWarp ;-------------------------------------------------------------------------------- org $8AB949 ; <- Bank0A.asm:270 (Different from US ROM) JSL BirdTravel_LoadTargetAreaMusic : NOP #16 +;-------------------------------------------------------------------------------- +org $8292D9 +BRA + : NOP #4 : + +JSL FixPreAgaMusicFadeOut : db $B0 ; BCS ;================================================================================ ;================================================================================ diff --git a/music.asm b/music.asm index 2b2b91a..be6b1e4 100644 --- a/music.asm +++ b/music.asm @@ -293,3 +293,12 @@ FallingMusicFadeOut: .return RTL ;-------------------------------------------------------------------------------- +FixPreAgaMusicFadeOut: + LDA.l DRMode : TAX : CPX.b #$01 : BCS .exit_no_fade+1 + LDA.b RoomIndex : CMP.w #$0030 : BEQ .exit_and_fade ; what we + CMP.w #$0040 : BEQ .exit_and_fade ; wrote over +.exit_no_fade + SEC : RTL +.exit_and_fade + CLC : RTL +;-------------------------------------------------------------------------------- From fa72adb53d0ba076936d011cce5281c1eda36d41 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 13 Jul 2025 00:27:22 -0500 Subject: [PATCH 12/42] Restore Kodongo AI when in vanilla rooms --- enemizer/kodongo_fixes.asm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/enemizer/kodongo_fixes.asm b/enemizer/kodongo_fixes.asm index b803f94..14041ed 100644 --- a/enemizer/kodongo_fixes.asm +++ b/enemizer/kodongo_fixes.asm @@ -2,8 +2,7 @@ pushpc org $9EC147 JSL NewKodongoCollision -JMP .continue : NOP #2 -.continue +BRA + : NOP #3 : + org $9EC152 Kodongo_SetDirection: @@ -12,8 +11,18 @@ pullpc NewKodongoCollision: LDA.w SpriteMoveDirection, X : INC A : AND.b #$03 : STA.w SpriteMoveDirection, X + JSL Kodongo_InVanillaRoom : BEQ .continue ;If they collide more than 4 times just set direction LDA.w SpriteAuxTable, X : INC A : STA.w SpriteAuxTable, X : CMP.b #$04 : BCC .continue PLA : PLA : PEA.w Kodongo_SetDirection-1 .continue -RTL \ No newline at end of file +RTL + +Kodongo_InVanillaRoom: + LDA.b RoomIndex+1 : BNE .return + LDA.b RoomIndex : CMP.b #$19 : BEQ .return + CMP.b #$27 : BEQ .return + CMP.b #$77 : BEQ .return +.return +RTL +nop #10 \ No newline at end of file From 4d3c2bd7dc755c6d97072d0559b477f1b5aaca11 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Mon, 3 Nov 2025 10:59:08 -0600 Subject: [PATCH 13/42] Added custom gfx for Ped and Murahdahla --- elder.asm | 32 +++++++++++++++++++++++++++++--- tables.asm | 6 +++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/elder.asm b/elder.asm index fa5a838..1883cbb 100644 --- a/elder.asm +++ b/elder.asm @@ -142,19 +142,35 @@ MasterSword_CheckIfPulled: MasterSword_ConditionalActivateCutscene: LDA.w SpriteMovement,X : BNE .specialCutscene + PHX + REP #$30 + LDA.w SprRedrawFlag, X : BNE .doNormalPed + INC.w SprRedrawFlag, X + LDA.l PedPullGfx : BEQ .doNormalPed + LDX.w ItemStackPtr : STA.l ItemGFXStack,X + LDA.w #$BCE0>>1 : STA.l ItemTargetStack,X + TXA : INC #2 : STA.w ItemStackPtr + .doNormalPed + SEP #$30 + PLX JML Sprite_CheckDamageToPlayerSameLayerLong ; what we wrote over .specialCutscene LDA.b #$02 : STA.w ItemReceiptPose ; Link's 2-hands-up pose STA.b LinkLayer ; draw Link on top ; draw Triforce piece in VRAM + LDA.w SprRedrawFlag, X : BNE .skipTransfer + INC.w SprRedrawFlag, X PHX REP #$30 - LDX.w #$006A<<1 - LDA.l StandingItemGraphicsOffsets,X : LDX.w ItemStackPtr : STA.l ItemGFXStack,X + LDA.l MurahdahlaGfx : BNE .submitRequest + LDX.w #$006A<<1 : LDA.l StandingItemGraphicsOffsets,X + .submitRequest + LDX.w ItemStackPtr : STA.l ItemGFXStack,X LDA.w #$9CE0>>1 : STA.l ItemTargetStack,X TXA : INC #2 : STA.w ItemStackPtr SEP #$30 PLX + .skipTransfer PLA : PLA : PLA : JML MasterSword_InPedestal_DoCutscene ; do cutscene MasterSword_ConditionalGrabPose: @@ -171,10 +187,20 @@ RTL MasterSword_SpawnPendantProp_ChangePalette: STA.w SpriteVelocityY,Y : PLX ; what we wrote over LDA.w SpriteMovement,X : BNE .specialCutscene + LDA.l PedPullGfx : BNE .customPedGfx + LDA.l PedPullGfx+1 : BNE .customPedGfx BRA .done + .customPedGfx + LDA.l PedPullPalette : ASL : INC : BRA .setPalette .specialCutscene - LDA.b #$08 : STA.w SpriteOAMProp,Y ; change palette LDA.b #$02 : STA.w SpriteLayer,Y ; change layer + LDA.l MurahdahlaGfx : BNE .customGfx + LDA.l MurahdahlaGfx+1 : BNE .customGfx + LDA.b #$08 : BRA .setPalette + .customGfx + LDA.l MurahdahlaPalette : ASL + .setPalette + STA.w SpriteOAMProp,Y ; change palette .done JML MasterSword_SpawnPendantProp_ChangePalette_return diff --git a/tables.asm b/tables.asm index 40af715..6e1c47b 100644 --- a/tables.asm +++ b/tables.asm @@ -953,21 +953,21 @@ dw $0000, $0000, $0000, $0000, $0000, $0000 GanonsTowerOpenPalette: ; 0x1801E6-0x1801EC db $00 ; Palette for GanonsTowerOpenGfx db $00, $00, $00, $00, $00, $00 -; VHPP CCCO (VertFlip, HorizFlip, Priority, ColorPalette, OAM Sheet) +; -VHPPCCC (VertFlip, HorizFlip, Priority, ColorPalette) PedPullGfx: ; 0x1801ED-0x1801F2 dw $0000 ; Gfx used for ped pull animation, similar to StandingItemGraphicsOffsets dw $0000, $0000 PedPullPalette: ; 0x1801F3-0x1801F5 db $00 ; Palette for PedPullGfx db $00, $00 -; VHPP CCCO (VertFlip, HorizFlip, Priority, ColorPalette, OAM Sheet) +; -VHPPCCC (VertFlip, HorizFlip, Priority, ColorPalette) MurahdahlaGfx: ; 0x1801F6-0x1801FB dw $0000 ; Gfx used for ped pull animation, similar to StandingItemGraphicsOffsets dw $0000, $0000 MurahdahlaPalette: ; 0x1801FC-0x1801FE db $00 ; Palette for MurahdahlaGfx db $00, $00 -; VHPP CCCO (VertFlip, HorizFlip, Priority, ColorPalette, OAM Sheet) +; -VHPPCCCO (VertFlip, HorizFlip, Priority, ColorPalette) ;-------------------------------------------------------------------------------- ; 0x1801FF (unused) ;================================================================================ From 5a802eda7057432d1ceed671eb78a100eda567fa Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sat, 8 Nov 2025 10:29:41 -0600 Subject: [PATCH 14/42] Fixed issue with GT Cutscene freezing --- goalitem.asm | 96 +++++++++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 43 deletions(-) diff --git a/goalitem.asm b/goalitem.asm index 6b3e9c0..15f50b1 100644 --- a/goalitem.asm +++ b/goalitem.asm @@ -260,6 +260,9 @@ GTCutscene_ActivateSparkle_SelectCrystal: PLY RTL ;-------------------------------------------------------------------------------- +; prioritizes: number of gfx used > sum of targets > number of goals +; Scrap00 stores number of goals +; Y sums all goal target values GTCutscene_NumberOfCrystals: PHX : PHY : PHP REP #$20 @@ -275,58 +278,65 @@ GTCutscene_NumberOfCrystals: TXY : STY.b Scrap00 REP #$10 SEP #$20 - TAX - - LDA.l $B00000, X : CMP.b #$FF : BEQ .use_y + TAX + .next + LDA.l $B00000, X : CMP.b #$FF : BNE + : JMP .use_y : + + INC.b Scrap00 ROL : PHP : CMP.b #$10 : BCS .not_8bit_compare + CMP.b #$0C : BEQ .agas_goal + CMP.b #$0E : BEQ .agas_goal ; uses 8-bit targets - CMP.b #$04 : BNE .not_crystal_goal ; crystal goal - PLP : BCC + - LDY.b #$07 : BRA .use_y - .not_crystal_goal - CMP.b #$02 : BNE .not_pendant_goal ; pendant goal - PLP : BCC + - LDY.b #$03 : BRA .use_y - + - INX : LDA.l $B00000, X : TAY : BRA .use_y - .not_pendant_goal - PLP : INX : BCS + + PLP : BCC .use_8bit_target + CMP.b #$04 : BEQ .crystal_goal ; crystal goal + CMP.b #$08 : BEQ .crystal_goal ; crystal bosses goal + CMP.b #$02 : BEQ .pendant_goal ; pendant goal + CMP.b #$06 : BEQ .pendant_goal ; pendant bosses goal + BRA .bosses_goal + .crystal_goal + LDA.b #$07 : INX : BRA .add_to_y + .pendant_goal + LDA.b #$03 : INX : BRA .add_to_y + .bosses_goal + INY : INX : BRA .next ; just increment Y by 1 since default of 10 is already more than max 7 + .agas_goal + PLP : INX : BRA .next + .use_8bit_target + INX : LDA.l $B00000, X : INX + .add_to_y + PHY : CLC : ADC.b 1,S : PLY : TAY : BRA .next + .not_8bit_compare + CMP.b #$14 : BEQ .custom_goal : BCS .unknown + ; triforce hunt/collection rate - uses 16-bit targets + PLP : INX : BCC + + LDA.l $B00000, X : INX : INX : BRA .add_to_y + + INY : BRA .next + .custom_goal + PLP + INX : LDA.l $B00000, X : BIT.b #$08 : PHP + INX : INX : INX : AND.b #$03 : BEQ .use_custom_target + ; comparison method doesn't use a quantity, increment Y by 1 + INY : INX : PLP : BEQ + INX + - BRA - - .not_8bit_compare - CMP.b #$14 : BCS .custom_goal - ; uses 16-bit targets - PLP : INX : BCS + - INX : INX - + - BRA - - .custom_goal - BNE .unknown - PLP - INC.b Scrap00 - INX : LDA.l $B00000, X : BIT.b #$08 : PHP - INX : INX : INX : AND.b #$03 : BEQ .use_custom_target - INY - INX : PLP : BEQ + - INX - + - BRA - - .use_custom_target - PLP : BEQ .8bit_target - ; 16-bit target - REP #$20 - LDA.l $B00000, X : CMP.w #$0008 : SEP #$20 : INX : BRA + - .8bit_target + BRA .next + .use_custom_target + PLP : BEQ ..8bit + ; 16-bit target + REP #$20 + LDA.l $B00000, X : CMP.w #$0008 : SEP #$20 : INX : BRA + + ..8bit LDA.l $B00000, X : CMP.b #$08 : + : BCC + - INY : INX : BRA - + ; target exceeds 7, just increment Y by 1 + INY : INX : JMP .next + - PHY : ADC.b 1,S : PLY : TAY - INX : JMP - + INX : BRA .add_to_y .unknown ; unknown condition, exit with safe value PLP : INY .use_y - TYA : CMP.b #$08 : BCC .done - LDA.b Scrap00 + TYA : BEQ + : CMP.b #$08 : BCC .done + + LDA.b Scrap00 : BEQ .use_one : CMP.b #$08 : BCC .done +.use_one + LDA.b #$01 .done PLP : PLY : PLX RTS From f91e2eb1a2621bd0cbf32830f9abdb80c32455a0 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sat, 8 Nov 2025 11:12:09 -0600 Subject: [PATCH 15/42] Re-fixed purple chest follower dupe --- follower.asm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/follower.asm b/follower.asm index 13e575d..b1386cc 100644 --- a/follower.asm +++ b/follower.asm @@ -932,7 +932,8 @@ Locksmith_BecomeFollower: Locksmith_RespondToAnswer_PostItem: STA.l FollowerIndicator ; what we wrote over LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .no_despawn - LDA.w SpriteAux, X : BNE .no_despawn + LDA.w SpriteAux, X : CMP.b #$0C : BEQ .despawn + CMP.b #$00 : BNE .no_despawn LDA.l Follower_Locksmith : CMP.b #$0C : BEQ .despawn JSL DetermineFollowerSpawn_include_stored : BCC .no_despawn .despawn From 0fdec905d6e117ed8671c312451348dae4cd2ef6 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 12 Nov 2025 02:29:01 -0600 Subject: [PATCH 16/42] Fix to allow VRAM corruption in Blind fight --- maidencrystals.asm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maidencrystals.asm b/maidencrystals.asm index ff01c60..fed155a 100644 --- a/maidencrystals.asm +++ b/maidencrystals.asm @@ -2,6 +2,13 @@ ; Maiden Crystal Fixes ;================================================================================ +pushpc + +org $9ECE25 +STZ.w $1F00 : NOP : NOP ; fix to allow VRAM corruption during Blind fight + +pullpc + ;-------------------------------------------------------------------------------- ; MaidenCrystalScript ;-------------------------------------------------------------------------------- From 7334dd02db6ae7d830662f65458d0f05fecc916c Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 12 Nov 2025 02:29:01 -0600 Subject: [PATCH 17/42] Fix to allow VRAM corruption in Blind fight --- maidencrystals.asm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maidencrystals.asm b/maidencrystals.asm index ff01c60..fed155a 100644 --- a/maidencrystals.asm +++ b/maidencrystals.asm @@ -2,6 +2,13 @@ ; Maiden Crystal Fixes ;================================================================================ +pushpc + +org $9ECE25 +STZ.w $1F00 : NOP : NOP ; fix to allow VRAM corruption during Blind fight + +pullpc + ;-------------------------------------------------------------------------------- ; MaidenCrystalScript ;-------------------------------------------------------------------------------- From b27d7c996b7dfeca397a17ec787168afd9465e68 Mon Sep 17 00:00:00 2001 From: aerinon Date: Fri, 14 Nov 2025 09:06:07 -0700 Subject: [PATCH 18/42] feat: enemy "spies" during enemy drop --- enemizer/hooks.asm | 11 +++++++++- enemizer/underworld_sprites.asm | 38 ++++++++++++++++++++++++++++++++- vanillalabels.asm | 11 ++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/enemizer/hooks.asm b/enemizer/hooks.asm index 189b01e..6899310 100644 --- a/enemizer/hooks.asm +++ b/enemizer/hooks.asm @@ -14,4 +14,13 @@ incsrc hooks/damage_hooks.asm incsrc hooks/overworld_sprite_hooks.asm -incsrc hooks/underworld_sprite_hooks.asm \ No newline at end of file +incsrc hooks/underworld_sprite_hooks.asm + +org $85B8BA +JSL GeldmanDrawOverride + +org $9EAAAC +JSL StalfosKnightDrawOverride + +org $9EB209 +JSL BlobDrawOverride \ No newline at end of file diff --git a/enemizer/underworld_sprites.asm b/enemizer/underworld_sprites.asm index 237137a..7d900b4 100644 --- a/enemizer/underworld_sprites.asm +++ b/enemizer/underworld_sprites.asm @@ -8,4 +8,40 @@ GetSpriteSlot16Bit: LDA.b Scrap03 : AND.w #$00FF ASL A TAY -RTL \ No newline at end of file +RTL + +GeldmanDrawOverride: + PLA : PLA : PLA ; fix the call stack + LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla + + LDA.b #$01 + STA.w $0DC0,X + JML Sprite_4C_Geldman_do_indeed_draw + +.vanilla + JSL Sprite_PrepOAMCoordLong + JML Sprite_4C_Geldman_continue + +StalfosKnightDrawOverride: + LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla + + JSL Sprite_PrepOAMCoordLong + LDA.b #$12 + JML Sprite_DrawShadowLong + +.vanilla + JSL Sprite_PrepOAMCoordLong + JML Sprite_91_StalfosKnight_continue + +BlobDrawOverride: + PLA : PLA : PLA ; fix the call stack + LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla + + LDA.b #$05 + STA.w $0DC0,X + + JML SpriteDraw_Blob_head_popping_out + +.vanilla + JSL Sprite_PrepOAMCoordLong + JML SpriteDraw_Blob_bad_gfx \ No newline at end of file diff --git a/vanillalabels.asm b/vanillalabels.asm index b2ee2a2..e88190d 100644 --- a/vanillalabels.asm +++ b/vanillalabels.asm @@ -76,6 +76,7 @@ Sprite_TransmuteToBomb = $86AD58 Sprite_PrepAndDrawSingleLargeLong = $86DBF8 Sprite_PrepAndDrawSingleSmallLong = $86DC00 Sprite_DrawShadowLong = $86DC5C +Sprite_DrawShadowCustomLong = $86DC64 DashKey_Draw = $86DD40 Sprite_PrepOAMCoordLong = $86E41C Sprite_ApplySpeedTowardsPlayerLong = $86EA18 @@ -232,6 +233,16 @@ CrystalMaiden_KickOutOfDungeon = $9ECF35 GoldBee_Dormant_exit = $9EDE89 GoldBee_SpawnSelf = $9EDE8A +;=================================================================================================== +; Spliced routines (use JML directly since the hook left these methods) +;=================================================================================================== + +Sprite_4C_Geldman_do_indeed_draw = $85B8C0 +Sprite_4C_Geldman_continue = $85B8C3 +Sprite_91_StalfosKnight_continue = $9EAAB5 +SpriteDraw_Blob_bad_gfx = $9EB20D +SpriteDraw_Blob_head_popping_out = $9EB24E + ;=================================================================================================== ; Palettes ;=================================================================================================== From 7f7ffeb5fb57e94e4f3652e840411d9a11e66de5 Mon Sep 17 00:00:00 2001 From: aerinon Date: Fri, 14 Nov 2025 14:37:15 -0700 Subject: [PATCH 19/42] feat: lamp cone bitmask settings --- lampmantlecone.asm | 3 ++- tables.asm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lampmantlecone.asm b/lampmantlecone.asm index b0f00e8..4843547 100644 --- a/lampmantlecone.asm +++ b/lampmantlecone.asm @@ -5,9 +5,10 @@ ;-------------------------------------------------------------------------------- LampCheck: LDA.l LightConeModifier : BNE .lamp + LDA.l LampCone : AND.b #$10 : BEQ .lamp ; always on LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern LDA.w DungeonID : CMP.b #$04 : BCS + ; are we en HC? - LDA.l LampConeSewers : RTL + LDA.l LampCone : RTL + : TDC .lamp RTL diff --git a/tables.asm b/tables.asm index 4e6b825..ba58718 100644 --- a/tables.asm +++ b/tables.asm @@ -110,8 +110,8 @@ RupoorDeduction: dw $000A ; #$0A - Default (10 decimal) ;-------------------------------------------------------------------------------- org $B08038 ; PC 0x180038 -LampConeSewers: -db $01 ; #$00 = Off - #$01 = On (default) +LampCone: +db $01 ; #$00 = Off - #$01 = Sewers only (default) - #$11 = Always On ;-------------------------------------------------------------------------------- org $B08039 ; PC 0x180039 ItemCounterHUD: From d451b531e72fed375802fa67a0b235d16999d863 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 18 Nov 2025 06:09:33 -0600 Subject: [PATCH 20/42] Added default VRAM values for OWR edge data --- owrando.asm | 562 ++++++++++++++++++++++++++-------------------------- 1 file changed, 281 insertions(+), 281 deletions(-) diff --git a/owrando.asm b/owrando.asm index 3c0c022..2e738c6 100644 --- a/owrando.asm +++ b/owrando.asm @@ -1384,291 +1384,291 @@ db $80, $80, $81 org $aaa800 ;PC 152800 OWNorthEdges: ; Min Max Width Mid OW Slot/OWID VRAM Terrain Dest Index -dw $00a0, $00a0, $0000, $00a0, $0000, $0000, $0000, $B040 ;Lost Woods (exit only) -dw $0458, $0540, $00e8, $04cc, $0a0a, $0000, $0000, $0000 -dw $0f38, $0f60, $0028, $0f4c, $0f0f, $0000, $0000, $2041 ;Waterfall (exit only) -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 -dw $0480, $05b0, $0130, $0518, $1212, $0000, $0000, $0004 -dw $0f70, $0f90, $0020, $0f80, $1717, $0000, $0000, $0005 -dw $0078, $0098, $0020, $0088, $1818, $0000, $0000, $0006 ;Kakariko -dw $0138, $0158, $0020, $0148, $1818, $0000, $0000, $0007 -dw $02e8, $0348, $0060, $0318, $1819, $0000, $0000, $0008 -dw $0478, $04d0, $0058, $04a4, $1a1a, $0000, $0000, $0009 -dw $0510, $0538, $0028, $0524, $1a1a, $0000, $0000, $000a -dw $0a48, $0af0, $00a8, $0a9c, $1d1d, $0000, $0000, $000b -dw $0b28, $0b38, $0010, $0b30, $1d1d, $0000, $0001, $000c -dw $0b70, $0ba0, $0030, $0b88, $1d1d, $0000, $0000, $000d -dw $0a40, $0b10, $00d0, $0aa8, $2525, $0000, $0000, $000e -dw $0350, $0390, $0040, $0370, $2929, $0000, $0000, $000f -dw $0670, $06a8, $0038, $068c, $2b2b, $0000, $0000, $0010 -dw $0898, $09b0, $0118, $0924, $2c2c, $0000, $0000, $0011 ;Links House -dw $0a40, $0ba0, $0160, $0af0, $2d2d, $0000, $0000, $0012 -dw $0c70, $0c90, $0020, $0c80, $2e2e, $0000, $0000, $0013 -dw $0f70, $0f80, $0010, $0f78, $2f2f, $0000, $0000, $0014 -dw $0430, $0468, $0038, $044c, $3232, $0000, $0000, $0015 -dw $04d8, $04f8, $0020, $04e8, $3232, $0000, $0000, $0016 -dw $0688, $06b0, $0028, $069c, $3333, $0000, $0000, $0017 -dw $08d0, $08f0, $0020, $08e0, $3434, $0000, $0000, $0018 -dw $0a80, $0b40, $00c0, $0ae0, $3535, $0000, $0000, $0019 -dw $0d38, $0d58, $0020, $0d48, $3536, $0000, $0001, $001a -dw $0d90, $0da0, $0010, $0d98, $3536, $0000, $0000, $001b -dw $06a0, $07b0, $0110, $0728, $3b3b, $0000, $0000, $001c -dw $0830, $09b0, $0180, $08f0, $3c3c, $0000, $0000, $001d -dw $0e78, $0e88, $0010, $0e80, $3f3f, $0000, $0001, $001e -dw $0ee0, $0fc0, $00e0, $0f50, $3f3f, $0000, $0000, $001f -dw $0458, $0540, $00e8, $04cc, $4a4a, $0000, $0000, $0020 -dw $0058, $0058, $0000, $0058, $5050, $0000, $0000, $0021 -dw $0178, $0178, $0000, $0178, $5050, $0000, $0000, $0022 -dw $0388, $0388, $0000, $0388, $5151, $0000, $0000, $0023 -dw $0480, $05b0, $0130, $0518, $5252, $0000, $0000, $0024 -dw $0f70, $0f90, $0020, $0f80, $5757, $0000, $0000, $0025 -dw $0078, $0098, $0020, $0088, $5858, $0000, $0000, $0026 ;Village of Outcasts -dw $0138, $0158, $0020, $0148, $5858, $0000, $0000, $0027 -dw $02e8, $0348, $0060, $0318, $5859, $0000, $0000, $0028 -dw $0478, $04d0, $0058, $04a4, $5a5a, $0000, $0000, $0029 -dw $0510, $0538, $0028, $0524, $5a5a, $0000, $0000, $002a -dw $0a48, $0af0, $00a8, $0a9c, $5d5d, $0000, $0000, $002b -dw $0b28, $0b38, $0010, $0b30, $5d5d, $0000, $0001, $002c -dw $0b70, $0ba0, $0030, $0b88, $5d5d, $0000, $0000, $002d -dw $0a40, $0b10, $00d0, $0aa8, $6565, $0000, $0000, $002e -dw $0350, $0390, $0040, $0370, $6969, $0000, $0000, $002f -dw $0670, $06a8, $0038, $068c, $6b6b, $0000, $0000, $0030 -dw $0898, $09b0, $0118, $0924, $6c6c, $0000, $0000, $0031 -dw $0a40, $0ba0, $0160, $0af0, $6d6d, $0000, $0000, $0032 -dw $0c70, $0c90, $0020, $0c80, $6e6e, $0000, $0000, $0033 -dw $0f70, $0f80, $0010, $0f78, $6f6f, $0000, $0000, $0034 -dw $0430, $0468, $0038, $044c, $7272, $0000, $0000, $0035 -dw $04d8, $04f8, $0020, $04e8, $7272, $0000, $0000, $0036 -dw $0688, $06b0, $0028, $069c, $7373, $0000, $0000, $0037 -dw $08d0, $08f0, $0020, $08e0, $7474, $0000, $0000, $0038 -dw $0a80, $0b40, $00c0, $0ae0, $7575, $0000, $0000, $0039 -dw $0d38, $0d58, $0020, $0d48, $7576, $0000, $0001, $003a -dw $0d90, $0da0, $0010, $0d98, $7576, $0000, $0000, $003b -dw $06a0, $07b0, $0110, $0728, $7b7b, $0000, $0000, $003c -dw $0830, $09b0, $0180, $08f0, $7c7c, $0000, $0000, $003d -dw $0e78, $0e88, $0010, $0e80, $7f7f, $0000, $0001, $003e -dw $0ee0, $0fc0, $00e0, $0f50, $7f7f, $0000, $0000, $003f +dw $00a0, $00a0, $0000, $00a0, $0000, $0284, $0000, $B040 ;Lost Woods (exit only) +dw $0458, $0540, $00e8, $04cc, $0a0a, $180a, $0000, $0000 +dw $0f38, $0f60, $0028, $0f4c, $0f0f, $009a, $0000, $2041 ;Waterfall (exit only) +dw $0058, $0058, $0000, $0058, $1010, $1800, $0000, $0001 +dw $0178, $0178, $0000, $0178, $1010, $181e, $0000, $0002 +dw $0388, $0388, $0000, $0388, $1111, $1820, $0000, $0003 +dw $0480, $05b0, $0130, $0518, $1212, $1812, $0000, $0004 +dw $0f70, $0f90, $0020, $0f80, $1717, $1820, $0000, $0005 +dw $0078, $0098, $0020, $0088, $1818, $1802, $0000, $0006 ;Kakariko +dw $0138, $0158, $0020, $0148, $1818, $181a, $0000, $0007 +dw $02e8, $0348, $0060, $0318, $1819, $1854, $0000, $0008 +dw $0478, $04d0, $0058, $04a4, $1a1a, $1806, $0000, $0009 +dw $0510, $0538, $0028, $0524, $1a1a, $1816, $0000, $000a +dw $0a48, $0af0, $00a8, $0a9c, $1d1d, $1804, $0000, $000b +dw $0b28, $0b38, $0010, $0b30, $1d1d, $1818, $0001, $000c +dw $0b70, $0ba0, $0030, $0b88, $1d1d, $1820, $0000, $000d +dw $0a40, $0b10, $00d0, $0aa8, $2525, $1806, $0000, $000e +dw $0350, $0390, $0040, $0370, $2929, $1820, $0000, $000f +dw $0670, $06a8, $0038, $068c, $2b2b, $1802, $0000, $0010 +dw $0898, $09b0, $0118, $0924, $2c2c, $1814, $0000, $0011 ;Links House +dw $0a40, $0ba0, $0160, $0af0, $2d2d, $180e, $0000, $0012 +dw $0c70, $0c90, $0020, $0c80, $2e2e, $1802, $0000, $0013 +dw $0f70, $0f80, $0010, $0f78, $2f2f, $1820, $0000, $0014 +dw $0430, $0468, $0038, $044c, $3232, $1800, $0000, $0015 +dw $04d8, $04f8, $0020, $04e8, $3232, $180c, $0000, $0016 +dw $0688, $06b0, $0028, $069c, $3333, $1804, $0000, $0017 +dw $08d0, $08f0, $0020, $08e0, $3434, $180e, $0000, $0018 +dw $0a80, $0b40, $00c0, $0ae0, $3535, $180c, $0000, $0019 +dw $0d38, $0d58, $0020, $0d48, $3536, $185a, $0001, $001a +dw $0d90, $0da0, $0010, $0d98, $3536, $1860, $0000, $001b +dw $06a0, $07b0, $0110, $0728, $3b3b, $1816, $0000, $001c +dw $0830, $09b0, $0180, $08f0, $3c3c, $1810, $0000, $001d +dw $0e78, $0e88, $0010, $0e80, $3f3f, $1802, $0001, $001e +dw $0ee0, $0fc0, $00e0, $0f50, $3f3f, $181c, $0000, $001f +dw $0458, $0540, $00e8, $04cc, $4a4a, $180a, $0000, $0020 +dw $0058, $0058, $0000, $0058, $5050, $181e, $0000, $0021 +dw $0178, $0178, $0000, $0178, $5050, $1800, $0000, $0022 +dw $0388, $0388, $0000, $0388, $5151, $1820, $0000, $0023 +dw $0480, $05b0, $0130, $0518, $5252, $1812, $0000, $0024 +dw $0f70, $0f90, $0020, $0f80, $5757, $1820, $0000, $0025 +dw $0078, $0098, $0020, $0088, $5858, $1802, $0000, $0026 ;Village of Outcasts +dw $0138, $0158, $0020, $0148, $5858, $181a, $0000, $0027 +dw $02e8, $0348, $0060, $0318, $5859, $1854, $0000, $0028 +dw $0478, $04d0, $0058, $04a4, $5a5a, $1806, $0000, $0029 +dw $0510, $0538, $0028, $0524, $5a5a, $1816, $0000, $002a +dw $0a48, $0af0, $00a8, $0a9c, $5d5d, $1804, $0000, $002b +dw $0b28, $0b38, $0010, $0b30, $5d5d, $1818, $0001, $002c +dw $0b70, $0ba0, $0030, $0b88, $5d5d, $1820, $0000, $002d +dw $0a40, $0b10, $00d0, $0aa8, $6565, $1806, $0000, $002e +dw $0350, $0390, $0040, $0370, $6969, $1820, $0000, $002f +dw $0670, $06a8, $0038, $068c, $6b6b, $1802, $0000, $0030 +dw $0898, $09b0, $0118, $0924, $6c6c, $1814, $0000, $0031 +dw $0a40, $0ba0, $0160, $0af0, $6d6d, $180e, $0000, $0032 +dw $0c70, $0c90, $0020, $0c80, $6e6e, $1802, $0000, $0033 +dw $0f70, $0f80, $0010, $0f78, $6f6f, $1820, $0000, $0034 +dw $0430, $0468, $0038, $044c, $7272, $1800, $0000, $0035 +dw $04d8, $04f8, $0020, $04e8, $7272, $180c, $0000, $0036 +dw $0688, $06b0, $0028, $069c, $7373, $1804, $0000, $0037 +dw $08d0, $08f0, $0020, $08e0, $7474, $180e, $0000, $0038 +dw $0a80, $0b40, $00c0, $0ae0, $7575, $180c, $0000, $0039 +dw $0d38, $0d58, $0020, $0d48, $7576, $185a, $0001, $003a +dw $0d90, $0da0, $0010, $0d98, $7576, $1860, $0000, $003b +dw $06a0, $07b0, $0110, $0728, $7b7b, $1816, $0000, $003c +dw $0830, $09b0, $0180, $08f0, $7c7c, $1810, $0000, $003d +dw $0e78, $0e88, $0010, $0e80, $7f7f, $1802, $0001, $003e +dw $0ee0, $0fc0, $00e0, $0f50, $7f7f, $181c, $0000, $003f OWSouthEdges: -dw $0458, $0540, $00e8, $04cc, $0202, $0000, $0000, $0001 -dw $0058, $0058, $0000, $0058, $0008, $0000, $0000, $0003 -dw $0178, $0178, $0000, $0178, $0008, $0000, $0000, $0004 -dw $0388, $0388, $0000, $0388, $0009, $0000, $0000, $0005 -dw $0480, $05b0, $0130, $0518, $0a0a, $0000, $0000, $0006 -dw $0f70, $0f90, $0020, $0f80, $0f0f, $0000, $0000, $0007 -dw $0078, $0098, $0020, $0088, $1010, $0000, $0000, $0008 -dw $0138, $0158, $0020, $0148, $1010, $0000, $0000, $0009 -dw $02e8, $0348, $0060, $0318, $1111, $0000, $0000, $000a -dw $0478, $04d0, $0058, $04a4, $1212, $0000, $0000, $000b -dw $0510, $0538, $0028, $0524, $1212, $0000, $0000, $000c -dw $0a48, $0af0, $00a8, $0a9c, $1515, $0000, $0000, $000d -dw $0b28, $0b38, $0010, $0b30, $1515, $0000, $0001, $000e -dw $0b70, $0ba0, $0030, $0b88, $1515, $0000, $0000, $000f -dw $0a40, $0b10, $00d0, $0aa8, $1d1d, $0000, $0000, $0010 -dw $0350, $0390, $0040, $0370, $1821, $0000, $0000, $0011 -dw $0670, $06a8, $0038, $068c, $1b23, $0000, $0000, $0012 -dw $0898, $09b0, $0118, $0924, $1b24, $0000, $0000, $0013 -dw $0a40, $0ba0, $0160, $0af0, $2525, $0000, $0000, $0014 -dw $0c70, $0c90, $0020, $0c80, $1e26, $0000, $0000, $0015 -dw $0f70, $0f80, $0010, $0f78, $1e27, $0000, $0000, $0016 -dw $0430, $0468, $0038, $044c, $2a2a, $0000, $0000, $0017 -dw $04d8, $04f8, $0020, $04e8, $2a2a, $0000, $0000, $0018 -dw $0688, $06b0, $0028, $069c, $2b2b, $0000, $0000, $0019 -dw $08d0, $08f0, $0020, $08e0, $2c2c, $0000, $0000, $001a -dw $0a80, $0b40, $00c0, $0ae0, $2d2d, $0000, $0000, $001b -dw $0d38, $0d58, $0020, $0d48, $2e2e, $0000, $0001, $001c -dw $0d90, $0da0, $0010, $0d98, $2e2e, $0000, $0000, $001d -dw $06a0, $07b0, $0110, $0728, $3333, $0000, $0000, $001e -dw $0830, $09b0, $0180, $08f0, $3434, $0000, $0000, $001f -dw $0e78, $0e88, $0010, $0e80, $3737, $0000, $0001, $0020 -dw $0ee0, $0fc0, $00e0, $0f50, $3737, $0000, $0000, $0021 -dw $0458, $0540, $00e8, $04cc, $4242, $0000, $0000, $0022 -dw $0058, $0058, $0000, $0058, $4048, $0000, $0000, $0023 -dw $0178, $0178, $0000, $0178, $4048, $0000, $0000, $0024 -dw $0388, $0388, $0000, $0388, $4049, $0000, $0000, $0025 -dw $0480, $05b0, $0130, $0518, $4a4a, $0000, $0000, $0026 -dw $0f70, $0f90, $0020, $0f80, $4f4f, $0000, $0000, $0027 -dw $0078, $0098, $0020, $0088, $5050, $0000, $0000, $0028 -dw $0138, $0158, $0020, $0148, $5050, $0000, $0000, $0029 -dw $02e8, $0348, $0060, $0318, $5151, $0000, $0000, $002a -dw $0478, $04d0, $0058, $04a4, $5252, $0000, $0000, $002b -dw $0510, $0538, $0028, $0524, $5252, $0000, $0000, $002c -dw $0a48, $0af0, $00a8, $0a9c, $5555, $0000, $0000, $002d -dw $0b28, $0b38, $0010, $0b30, $5555, $0000, $0001, $002e -dw $0b70, $0ba0, $0030, $0b88, $5555, $0000, $0000, $002f -dw $0a40, $0b10, $00d0, $0aa8, $5d5d, $0000, $0000, $0030 -dw $0350, $0390, $0040, $0370, $5861, $0000, $0000, $0031 -dw $0670, $06a8, $0038, $068c, $5b63, $0000, $0000, $0032 -dw $0898, $09b0, $0118, $0924, $5b64, $0000, $0000, $0033 -dw $0a40, $0ba0, $0160, $0af0, $6565, $0000, $0000, $0034 -dw $0c70, $0c90, $0020, $0c80, $5e66, $0000, $0000, $0035 -dw $0f70, $0f80, $0010, $0f78, $5e67, $0000, $0000, $0036 -dw $0430, $0468, $0038, $044c, $6a6a, $0000, $0000, $0037 -dw $04d8, $04f8, $0020, $04e8, $6a6a, $0000, $0000, $0038 -dw $0688, $06b0, $0028, $069c, $6b6b, $0000, $0000, $0039 -dw $08d0, $08f0, $0020, $08e0, $6c6c, $0000, $0000, $003a -dw $0a80, $0b40, $00c0, $0ae0, $6d6d, $0000, $0000, $003b -dw $0d38, $0d58, $0020, $0d48, $6e6e, $0000, $0001, $003c -dw $0d90, $0da0, $0010, $0d98, $6e6e, $0000, $0000, $003d -dw $06a0, $07b0, $0110, $0728, $7373, $0000, $0000, $003e -dw $0830, $09b0, $0180, $08f0, $7474, $0000, $0000, $003f -dw $0e78, $0e88, $0010, $0e80, $7777, $0000, $0001, $0040 -dw $0ee0, $0fc0, $00e0, $0f50, $7777, $0000, $0000, $0041 +dw $0458, $0540, $00e8, $04cc, $0202, $100a, $0000, $0001 +dw $0058, $0058, $0000, $0058, $0008, $2000, $0000, $0003 +dw $0178, $0178, $0000, $0178, $0008, $2020, $0000, $0004 +dw $0388, $0388, $0000, $0388, $0009, $2060, $0000, $0005 +dw $0480, $05b0, $0130, $0518, $0a0a, $1012, $0000, $0006 +dw $0f70, $0f90, $0020, $0f80, $0f0f, $1020, $0000, $0007 +dw $0078, $0098, $0020, $0088, $1010, $1002, $0000, $0008 +dw $0138, $0158, $0020, $0148, $1010, $101a, $0000, $0009 +dw $02e8, $0348, $0060, $0318, $1111, $1014, $0000, $000a +dw $0478, $04d0, $0058, $04a4, $1212, $1006, $0000, $000b +dw $0510, $0538, $0028, $0524, $1212, $1016, $0000, $000c +dw $0a48, $0af0, $00a8, $0a9c, $1515, $1004, $0000, $000d +dw $0b28, $0b38, $0010, $0b30, $1515, $1018, $0001, $000e +dw $0b70, $0ba0, $0030, $0b88, $1515, $1020, $0000, $000f +dw $0a40, $0b10, $00d0, $0aa8, $1d1d, $1006, $0000, $0010 +dw $0350, $0390, $0040, $0370, $1821, $2060, $0000, $0011 +dw $0670, $06a8, $0038, $068c, $1b23, $2002, $0000, $0012 +dw $0898, $09b0, $0118, $0924, $1b24, $2054, $0000, $0013 +dw $0a40, $0ba0, $0160, $0af0, $2525, $100e, $0000, $0014 +dw $0c70, $0c90, $0020, $0c80, $1e26, $2002, $0000, $0015 +dw $0f70, $0f80, $0010, $0f78, $1e27, $2060, $0000, $0016 +dw $0430, $0468, $0038, $044c, $2a2a, $1000, $0000, $0017 +dw $04d8, $04f8, $0020, $04e8, $2a2a, $100c, $0000, $0018 +dw $0688, $06b0, $0028, $069c, $2b2b, $1004, $0000, $0019 +dw $08d0, $08f0, $0020, $08e0, $2c2c, $100e, $0000, $001a +dw $0a80, $0b40, $00c0, $0ae0, $2d2d, $100c, $0000, $001b +dw $0d38, $0d58, $0020, $0d48, $2e2e, $101a, $0001, $001c +dw $0d90, $0da0, $0010, $0d98, $2e2e, $1020, $0000, $001d +dw $06a0, $07b0, $0110, $0728, $3333, $1016, $0000, $001e +dw $0830, $09b0, $0180, $08f0, $3434, $1010, $0000, $001f +dw $0e78, $0e88, $0010, $0e80, $3737, $1002, $0001, $0020 +dw $0ee0, $0fc0, $00e0, $0f50, $3737, $101c, $0000, $0021 +dw $0458, $0540, $00e8, $04cc, $4242, $100a, $0000, $0022 +dw $0058, $0058, $0000, $0058, $4048, $2000, $0000, $0023 +dw $0178, $0178, $0000, $0178, $4048, $2020, $0000, $0024 +dw $0388, $0388, $0000, $0388, $4049, $2060, $0000, $0025 +dw $0480, $05b0, $0130, $0518, $4a4a, $1012, $0000, $0026 +dw $0f70, $0f90, $0020, $0f80, $4f4f, $1020, $0000, $0027 +dw $0078, $0098, $0020, $0088, $5050, $1002, $0000, $0028 +dw $0138, $0158, $0020, $0148, $5050, $101a, $0000, $0029 +dw $02e8, $0348, $0060, $0318, $5151, $1014, $0000, $002a +dw $0478, $04d0, $0058, $04a4, $5252, $1006, $0000, $002b +dw $0510, $0538, $0028, $0524, $5252, $1016, $0000, $002c +dw $0a48, $0af0, $00a8, $0a9c, $5555, $1004, $0000, $002d +dw $0b28, $0b38, $0010, $0b30, $5555, $1018, $0001, $002e +dw $0b70, $0ba0, $0030, $0b88, $5555, $1020, $0000, $002f +dw $0a40, $0b10, $00d0, $0aa8, $5d5d, $1006, $0000, $0030 +dw $0350, $0390, $0040, $0370, $5861, $2060, $0000, $0031 +dw $0670, $06a8, $0038, $068c, $5b63, $2002, $0000, $0032 +dw $0898, $09b0, $0118, $0924, $5b64, $2054, $0000, $0033 +dw $0a40, $0ba0, $0160, $0af0, $6565, $100e, $0000, $0034 +dw $0c70, $0c90, $0020, $0c80, $5e66, $2002, $0000, $0035 +dw $0f70, $0f80, $0010, $0f78, $5e67, $2060, $0000, $0036 +dw $0430, $0468, $0038, $044c, $6a6a, $1000, $0000, $0037 +dw $04d8, $04f8, $0020, $04e8, $6a6a, $100c, $0000, $0038 +dw $0688, $06b0, $0028, $069c, $6b6b, $1004, $0000, $0039 +dw $08d0, $08f0, $0020, $08e0, $6c6c, $100e, $0000, $003a +dw $0a80, $0b40, $00c0, $0ae0, $6d6d, $100c, $0000, $003b +dw $0d38, $0d58, $0020, $0d48, $6e6e, $101a, $0001, $003c +dw $0d90, $0da0, $0010, $0d98, $6e6e, $1020, $0000, $003d +dw $06a0, $07b0, $0110, $0728, $7373, $1016, $0000, $003e +dw $0830, $09b0, $0180, $08f0, $7474, $1010, $0000, $003f +dw $0e78, $0e88, $0010, $0e80, $7777, $1002, $0001, $0040 +dw $0ee0, $0fc0, $00e0, $0f50, $7777, $101c, $0000, $0041 dw $0080, $0080, $0000, $0080, $8080, $0000, $0000, $0000 ;Pedestal (unused) -dw $0288, $02c0, $0038, $02a4, $8189, $0000, $0000, $0002 ;Zora (unused) +dw $0288, $02c0, $0038, $02a4, $8189, $1782, $0000, $0002 ;Zora (unused) OWWestEdges: -dw $0070, $00a0, $0030, $0088, $0202, $0000, $0000, $0000 -dw $0068, $0078, $0010, $0070, $0505, $0000, $0000, $0001 -dw $0068, $0088, $0020, $0078, $0707, $0000, $0000, $0002 -dw $0318, $0368, $0050, $0340, $050d, $0000, $0000, $0003 -dw $0450, $0488, $0038, $046c, $1212, $0000, $0000, $0004 -dw $0560, $05a0, $0040, $0580, $1212, $0000, $0000, $0005 -dw $0488, $0500, $0078, $04c4, $1313, $0000, $0000, $0006 -dw $0538, $05a8, $0070, $0570, $1313, $0000, $0000, $0007 -dw $0470, $05a8, $0138, $050c, $1414, $0000, $0000, $0008 -dw $0470, $0598, $0128, $0504, $1515, $0000, $0000, $0009 -dw $0480, $0488, $0008, $0484, $1616, $0000, $0001, $000a -dw $04b0, $0510, $0060, $04e0, $1616, $0000, $0000, $000b -dw $0560, $0588, $0028, $0574, $1616, $0000, $0000, $000c -dw $0450, $0458, $0008, $0454, $1717, $0000, $0001, $000d -dw $0480, $04a8, $0028, $0494, $1717, $0000, $0000, $000e -dw $0718, $0738, $0020, $0728, $1b1b, $0000, $0000, $000f -dw $0908, $0948, $0040, $0928, $2222, $0000, $0000, $0010 -dw $0878, $08a8, $0030, $0890, $2525, $0000, $0000, $0011 -dw $0bb8, $0bc8, $0010, $0bc0, $2929, $0000, $0000, $0012 -dw $0b60, $0ba0, $0040, $0b80, $2a2a, $0000, $0000, $0013 -dw $0ab0, $0ad0, $0020, $0ac0, $2c2c, $0000, $0000, $0014 -dw $0af0, $0b40, $0050, $0b18, $2c2c, $0000, $0000, $0015 -dw $0b78, $0ba0, $0028, $0b8c, $2c2c, $0000, $0000, $0016 -dw $0b10, $0b28, $0018, $0b1c, $2d2d, $0000, $0001, $604a ;Stone Bridge (exit only) -dw $0b68, $0b98, $0030, $0b80, $2d2d, $0000, $0000, $0017 -dw $0a68, $0ab8, $0050, $0a90, $2e2e, $0000, $0000, $0018 -dw $0b00, $0b78, $0078, $0b3c, $2e2e, $0000, $0001, $0019 -dw $0c50, $0db8, $0168, $0d04, $3333, $0000, $0000, $001a -dw $0c78, $0ce3, $006b, $0cad, $3434, $0000, $0000, $001b -dw $0ce4, $0d33, $004f, $0d0b, $3434, $0000, $0001, $001c -dw $0d34, $0db8, $0084, $0d76, $3434, $0000, $0000, $001d -dw $0ea8, $0f20, $0078, $0ee4, $3a3a, $0000, $0000, $001e -dw $0f78, $0fa8, $0030, $0f90, $3a3a, $0000, $0000, $001f -dw $0f18, $0f18, $0000, $0f18, $3b3b, $0000, $0000, $0020 -dw $0fc8, $0fc8, $0000, $0fc8, $3b3b, $0000, $0000, $0021 -dw $0e28, $0fb8, $0190, $0ef0, $3c3c, $0000, $0000, $0022 -dw $0f78, $0fb8, $0040, $0f98, $353d, $0000, $0000, $0023 -dw $0f20, $0f40, $0020, $0f30, $3f3f, $0000, $0001, $0024 -dw $0f70, $0fb8, $0048, $0f94, $3f3f, $0000, $0000, $0025 -dw $0070, $00a0, $0030, $0088, $4242, $0000, $0000, $0026 -dw $0068, $0078, $0010, $0070, $4545, $0000, $0000, $0027 -dw $0068, $0088, $0020, $0078, $4747, $0000, $0000, $0028 -dw $0318, $0368, $0050, $0340, $454d, $0000, $0000, $0029 -dw $0450, $0488, $0038, $046c, $5252, $0000, $0000, $002a -dw $0560, $05a0, $0040, $0580, $5252, $0000, $0000, $002b -dw $0488, $0500, $0078, $04c4, $5353, $0000, $0000, $002c -dw $0538, $05a8, $0070, $0570, $5353, $0000, $0000, $002d -dw $0470, $05a8, $0138, $050c, $5454, $0000, $0000, $002e -dw $0470, $0598, $0128, $0504, $5555, $0000, $0000, $002f -dw $0480, $0488, $0008, $0484, $5656, $0000, $0001, $0030 -dw $04b0, $0510, $0060, $04e0, $5656, $0000, $0000, $0031 -dw $0560, $0588, $0028, $0574, $5656, $0000, $0000, $0032 -dw $0450, $0458, $0008, $0454, $5757, $0000, $0001, $0033 -dw $0480, $04a8, $0028, $0494, $5757, $0000, $0000, $0034 -dw $0908, $0948, $0040, $0928, $6262, $0000, $0000, $0035 -dw $0878, $08a8, $0030, $0890, $6565, $0000, $0000, $0036 -dw $0b60, $0b68, $0008, $0b64, $6969, $0000, $0000, $0037 -dw $0bb8, $0bc8, $0010, $0bc0, $6969, $0000, $0000, $0038 -dw $0b60, $0ba0, $0040, $0b80, $6a6a, $0000, $0000, $0039 -dw $0ab0, $0ad0, $0020, $0ac0, $6c6c, $0000, $0000, $003a -dw $0af0, $0b40, $0050, $0b18, $6c6c, $0000, $0000, $003b -dw $0b78, $0ba0, $0028, $0b8c, $6c6c, $0000, $0000, $003c -dw $0b68, $0b98, $0030, $0b80, $6d6d, $0000, $0000, $003d -dw $0a68, $0ab8, $0050, $0a90, $6e6e, $0000, $0000, $003e -dw $0b00, $0b78, $0078, $0b3c, $6e6e, $0000, $0001, $003f -dw $0c50, $0db8, $0168, $0d04, $7373, $0000, $0000, $0040 -dw $0c78, $0ce3, $006b, $0cad, $7474, $0000, $0000, $0041 -dw $0ce4, $0d33, $004f, $0d0b, $7474, $0000, $0001, $0042 -dw $0d34, $0db8, $0084, $0d76, $7474, $0000, $0000, $0043 -dw $0f18, $0f18, $0000, $0f18, $7b7b, $0000, $0000, $0044 -dw $0fc8, $0fc8, $0000, $0fc8, $7b7b, $0000, $0000, $0045 -dw $0e28, $0fb8, $0190, $0ef0, $7c7c, $0000, $0000, $0046 -dw $0f78, $0fb8, $0040, $0f98, $757d, $0000, $0000, $0047 -dw $0f20, $0f40, $0020, $0f30, $7f7f, $0000, $0001, $0048 -dw $0f70, $0fb8, $0048, $0f94, $7f7f, $0000, $0000, $0049 +dw $0070, $00a0, $0030, $0088, $0202, $00e0, $0000, $0000 +dw $0068, $0078, $0010, $0070, $0505, $0060, $0000, $0001 +dw $0068, $0088, $0020, $0078, $0707, $00e0, $0000, $0002 +dw $0318, $0368, $0050, $0340, $050d, $1660, $0000, $0003 +dw $0450, $0488, $0038, $046c, $1212, $00e0, $0000, $0004 +dw $0560, $05a0, $0040, $0580, $1212, $08e0, $0000, $0005 +dw $0488, $0500, $0078, $04c4, $1313, $0360, $0000, $0006 +dw $0538, $05a8, $0070, $0570, $1313, $08e0, $0000, $0007 +dw $0470, $05a8, $0138, $050c, $1414, $04e0, $0000, $0008 +dw $0470, $0598, $0128, $0504, $1515, $04e0, $0000, $0009 +dw $0480, $0488, $0008, $0484, $1616, $01e0, $0001, $000a +dw $04b0, $0510, $0060, $04e0, $1616, $04e0, $0000, $000b +dw $0560, $0588, $0028, $0574, $1616, $08e0, $0000, $000c +dw $0450, $0458, $0008, $0454, $1717, $00e0, $0001, $000d +dw $0480, $04a8, $0028, $0494, $1717, $01e0, $0000, $000e +dw $0718, $0738, $0020, $0728, $1b1b, $06e0, $0000, $000f +dw $0908, $0948, $0040, $0928, $2222, $05e0, $0000, $0010 +dw $0878, $08a8, $0030, $0890, $2525, $01e0, $0000, $0011 +dw $0bb8, $0bc8, $0010, $0bc0, $2929, $0960, $0000, $0012 +dw $0b60, $0ba0, $0040, $0b80, $2a2a, $0960, $0000, $0013 +dw $0ab0, $0ad0, $0020, $0ac0, $2c2c, $0360, $0000, $0014 +dw $0af0, $0b40, $0050, $0b18, $2c2c, $05e0, $0000, $0015 +dw $0b78, $0ba0, $0028, $0b8c, $2c2c, $08a0, $0000, $0016 +dw $0b10, $0b28, $0018, $0b1c, $2d2d, $061c, $0001, $604a ;Stone Bridge (exit only) +dw $0b68, $0b98, $0030, $0b80, $2d2d, $08e0, $0000, $0017 +dw $0a68, $0ab8, $0050, $0a90, $2e2e, $01e0, $0000, $0018 +dw $0b00, $0b78, $0078, $0b3c, $2e2e, $0660, $0001, $0019 +dw $0c50, $0db8, $0168, $0d04, $3333, $05e0, $0000, $001a +dw $0c78, $0ce3, $006b, $0cad, $3434, $02e0, $0000, $001b +dw $0ce4, $0d33, $004f, $0d0b, $3434, $05e0, $0001, $001c +dw $0d34, $0db8, $0084, $0d76, $3434, $08e0, $0000, $001d +dw $0ea8, $0f20, $0078, $0ee4, $3a3a, $03e0, $0000, $001e +dw $0f78, $0fa8, $0030, $0f90, $3a3a, $0860, $0000, $001f +dw $0f18, $0f18, $0000, $0f18, $3b3b, $0660, $0000, $0020 +dw $0fc8, $0fc8, $0000, $0fc8, $3b3b, $08e0, $0000, $0021 +dw $0e28, $0fb8, $0190, $0ef0, $3c3c, $04e0, $0000, $0022 +dw $0f78, $0fb8, $0040, $0f98, $353d, $1860, $0000, $0023 +dw $0f20, $0f40, $0020, $0f30, $3f3f, $05e0, $0001, $0024 +dw $0f70, $0fb8, $0048, $0f94, $3f3f, $0860, $0000, $0025 +dw $0070, $00a0, $0030, $0088, $4242, $00e0, $0000, $0026 +dw $0068, $0078, $0010, $0070, $4545, $0060, $0000, $0027 +dw $0068, $0088, $0020, $0078, $4747, $00e0, $0000, $0028 +dw $0318, $0368, $0050, $0340, $454d, $1660, $0000, $0029 +dw $0450, $0488, $0038, $046c, $5252, $00e0, $0000, $002a +dw $0560, $05a0, $0040, $0580, $5252, $08e0, $0000, $002b +dw $0488, $0500, $0078, $04c4, $5353, $0360, $0000, $002c +dw $0538, $05a8, $0070, $0570, $5353, $08e0, $0000, $002d +dw $0470, $05a8, $0138, $050c, $5454, $04e0, $0000, $002e +dw $0470, $0598, $0128, $0504, $5555, $04e0, $0000, $002f +dw $0480, $0488, $0008, $0484, $5656, $01e0, $0001, $0030 +dw $04b0, $0510, $0060, $04e0, $5656, $04e0, $0000, $0031 +dw $0560, $0588, $0028, $0574, $5656, $08e0, $0000, $0032 +dw $0450, $0458, $0008, $0454, $5757, $00e0, $0001, $0033 +dw $0480, $04a8, $0028, $0494, $5757, $01e0, $0000, $0034 +dw $0908, $0948, $0040, $0928, $6262, $05e0, $0000, $0035 +dw $0878, $08a8, $0030, $0890, $6565, $01e0, $0000, $0036 +dw $0b60, $0b68, $0008, $0b64, $6969, $08e0, $0000, $0037 +dw $0bb8, $0bc8, $0010, $0bc0, $6969, $0960, $0000, $0038 +dw $0b60, $0ba0, $0040, $0b80, $6a6a, $0960, $0000, $0039 +dw $0ab0, $0ad0, $0020, $0ac0, $6c6c, $0360, $0000, $003a +dw $0af0, $0b40, $0050, $0b18, $6c6c, $05e0, $0000, $003b +dw $0b78, $0ba0, $0028, $0b8c, $6c6c, $08a0, $0000, $003c +dw $0b68, $0b98, $0030, $0b80, $6d6d, $08e0, $0000, $003d +dw $0a68, $0ab8, $0050, $0a90, $6e6e, $01e0, $0000, $003e +dw $0b00, $0b78, $0078, $0b3c, $6e6e, $0660, $0001, $003f +dw $0c50, $0db8, $0168, $0d04, $7373, $05e0, $0000, $0040 +dw $0c78, $0ce3, $006b, $0cad, $7474, $02e0, $0000, $0041 +dw $0ce4, $0d33, $004f, $0d0b, $7474, $05e0, $0001, $0042 +dw $0d34, $0db8, $0084, $0d76, $7474, $08e0, $0000, $0043 +dw $0f18, $0f18, $0000, $0f18, $7b7b, $0660, $0000, $0044 +dw $0fc8, $0fc8, $0000, $0fc8, $7b7b, $08e0, $0000, $0045 +dw $0e28, $0fb8, $0190, $0ef0, $7c7c, $04e0, $0000, $0046 +dw $0f78, $0fb8, $0040, $0f98, $757d, $1860, $0000, $0047 +dw $0f20, $0f40, $0020, $0f30, $7f7f, $05e0, $0001, $0048 +dw $0f70, $0fb8, $0048, $0f94, $7f7f, $0860, $0000, $0049 OWEastEdges: -dw $0070, $00a0, $0030, $0088, $0001, $0000, $0000, $0000 -dw $0068, $0078, $0010, $0070, $0304, $0000, $0000, $0001 -dw $0068, $0088, $0020, $0078, $0506, $0000, $0000, $0002 -dw $0318, $0368, $0050, $0340, $030c, $0000, $0000, $0003 -dw $0450, $0488, $0038, $046c, $1111, $0000, $0000, $0004 -dw $0560, $05a0, $0040, $0580, $1111, $0000, $0000, $0005 -dw $0488, $0500, $0078, $04c4, $1212, $0000, $0000, $0006 -dw $0538, $05a8, $0070, $0570, $1212, $0000, $0000, $0007 -dw $0470, $05a8, $0138, $050c, $1313, $0000, $0000, $0008 -dw $0470, $0598, $0128, $0504, $1414, $0000, $0000, $0009 -dw $0480, $0488, $0008, $0484, $1515, $0000, $0001, $000a -dw $04b0, $0510, $0060, $04e0, $1515, $0000, $0000, $000b -dw $0560, $0588, $0028, $0574, $1515, $0000, $0000, $000c -dw $0450, $0458, $0008, $0454, $1616, $0000, $0001, $000d -dw $0480, $04a8, $0028, $0494, $1616, $0000, $0000, $000e -dw $0718, $0738, $0020, $0728, $1a1a, $0000, $0000, $000f -dw $0908, $0948, $0040, $0928, $1821, $0000, $0000, $0010 -dw $0878, $08a8, $0030, $0890, $1b24, $0000, $0000, $0011 -dw $0bb8, $0bc8, $0010, $0bc0, $2828, $0000, $0000, $0012 ;Race Game -dw $0b60, $0ba0, $0040, $0b80, $2929, $0000, $0000, $0013 -dw $0ab0, $0ad0, $0020, $0ac0, $2b2b, $0000, $0000, $0014 -dw $0af0, $0b40, $0050, $0b18, $2b2b, $0000, $0000, $0015 -dw $0b78, $0ba0, $0028, $0b8c, $2b2b, $0000, $0000, $0016 -dw $0b68, $0b98, $0030, $0b80, $2c2c, $0000, $0000, $0018 -dw $0a68, $0ab8, $0050, $0a90, $2d2d, $0000, $0000, $0019 -dw $0b00, $0b78, $0078, $0b3c, $2d2d, $0000, $0001, $001a -dw $0c50, $0db8, $0168, $0d04, $3232, $0000, $0000, $001b -dw $0c78, $0ce3, $006b, $0cad, $3333, $0000, $0000, $001c -dw $0ce4, $0d33, $004f, $0d0b, $3333, $0000, $0001, $001d -dw $0d34, $0db8, $0084, $0d76, $3333, $0000, $0000, $001e -dw $0ea8, $0f20, $0078, $0ee4, $3039, $0000, $0000, $001f -dw $0f78, $0fa8, $0030, $0f90, $3039, $0000, $0000, $0020 -dw $0f18, $0f18, $0000, $0f18, $3a3a, $0000, $0000, $0021 -dw $0fc8, $0fc8, $0000, $0fc8, $3a3a, $0000, $0000, $0022 -dw $0e28, $0fb8, $0190, $0ef0, $3b3b, $0000, $0000, $0023 -dw $0f78, $0fb8, $0040, $0f98, $3c3c, $0000, $0000, $0024 -dw $0f20, $0f40, $0020, $0f30, $353e, $0000, $0001, $0025 -dw $0f70, $0fb8, $0048, $0f94, $353e, $0000, $0000, $0026 -dw $0070, $00a0, $0030, $0088, $4041, $0000, $0000, $0027 ;Skull Woods -dw $0068, $0078, $0010, $0070, $4344, $0000, $0000, $0028 -dw $0068, $0088, $0020, $0078, $4546, $0000, $0000, $0029 -dw $0318, $0368, $0050, $0340, $434c, $0000, $0000, $002a -dw $0450, $0488, $0038, $046c, $5151, $0000, $0000, $002b -dw $0560, $05a0, $0040, $0580, $5151, $0000, $0000, $002c -dw $0488, $0500, $0078, $04c4, $5252, $0000, $0000, $002d -dw $0538, $05a8, $0070, $0570, $5252, $0000, $0000, $002e -dw $0470, $05a8, $0138, $050c, $5353, $0000, $0000, $002f -dw $0470, $0598, $0128, $0504, $5454, $0000, $0000, $0030 -dw $0480, $0488, $0008, $0484, $5555, $0000, $0001, $0031 -dw $04b0, $0510, $0060, $04e0, $5555, $0000, $0000, $0032 -dw $0560, $0588, $0028, $0574, $5555, $0000, $0000, $0033 -dw $0450, $0458, $0008, $0454, $5656, $0000, $0001, $0034 -dw $0480, $04a8, $0028, $0494, $5656, $0000, $0000, $0035 -dw $0908, $0948, $0040, $0928, $5861, $0000, $0000, $0036 -dw $0878, $08a8, $0030, $0890, $5b64, $0000, $0000, $0037 -dw $0b60, $0b68, $0008, $0b64, $6868, $0000, $0000, $0038 ;Dig Game -dw $0bb8, $0bc8, $0010, $0bc0, $6868, $0000, $0000, $0039 -dw $0b60, $0ba0, $0040, $0b80, $6969, $0000, $0000, $003a -dw $0ab0, $0ad0, $0020, $0ac0, $6b6b, $0000, $0000, $003b -dw $0af0, $0b40, $0050, $0b18, $6b6b, $0000, $0000, $003c -dw $0b78, $0ba0, $0028, $0b8c, $6b6b, $0000, $0000, $003d -dw $0b68, $0b98, $0030, $0b80, $6c6c, $0000, $0000, $003e -dw $0a68, $0ab8, $0050, $0a90, $6d6d, $0000, $0000, $003f -dw $0b00, $0b78, $0078, $0b3c, $6d6d, $0000, $0001, $0040 -dw $0c50, $0db8, $0168, $0d04, $7272, $0000, $0000, $0041 -dw $0c78, $0ce3, $006b, $0cad, $7373, $0000, $0000, $0042 -dw $0ce4, $0d33, $004f, $0d0b, $7373, $0000, $0001, $0043 -dw $0d34, $0db8, $0084, $0d76, $7373, $0000, $0000, $0044 -dw $0f18, $0f18, $0000, $0f18, $7a7a, $0000, $0000, $0045 -dw $0fc8, $0fc8, $0000, $0fc8, $7a7a, $0000, $0000, $0046 -dw $0e28, $0fb8, $0190, $0ef0, $7b7b, $0000, $0000, $0047 -dw $0f78, $0fb8, $0040, $0f98, $7c7c, $0000, $0000, $0048 -dw $0f20, $0f40, $0020, $0f30, $757e, $0000, $0001, $0049 -dw $0f70, $0fb8, $0048, $0f94, $757e, $0000, $0000, $004a -dw $0058, $00c0, $0068, $008c, $8080, $0000, $0001, $0017 ;Hobo (unused) +dw $0070, $00a0, $0030, $0088, $0001, $0180, $0000, $0000 +dw $0068, $0078, $0010, $0070, $0304, $0180, $0000, $0001 +dw $0068, $0088, $0020, $0078, $0506, $0180, $0000, $0002 +dw $0318, $0368, $0050, $0340, $030c, $1780, $0000, $0003 +dw $0450, $0488, $0038, $046c, $1111, $00c0, $0000, $0004 +dw $0560, $05a0, $0040, $0580, $1111, $08c0, $0000, $0005 +dw $0488, $0500, $0078, $04c4, $1212, $0340, $0000, $0006 +dw $0538, $05a8, $0070, $0570, $1212, $08c0, $0000, $0007 +dw $0470, $05a8, $0138, $050c, $1313, $04c0, $0000, $0008 +dw $0470, $0598, $0128, $0504, $1414, $04c0, $0000, $0009 +dw $0480, $0488, $0008, $0484, $1515, $01c0, $0001, $000a +dw $04b0, $0510, $0060, $04e0, $1515, $04c0, $0000, $000b +dw $0560, $0588, $0028, $0574, $1515, $08c0, $0000, $000c +dw $0450, $0458, $0008, $0454, $1616, $00c0, $0001, $000d +dw $0480, $04a8, $0028, $0494, $1616, $01c0, $0000, $000e +dw $0718, $0738, $0020, $0728, $1a1a, $06c0, $0000, $000f +dw $0908, $0948, $0040, $0928, $1821, $1680, $0000, $0010 +dw $0878, $08a8, $0030, $0890, $1b24, $1280, $0000, $0011 +dw $0bb8, $0bc8, $0010, $0bc0, $2828, $0940, $0000, $0012 ;Race Game +dw $0b60, $0ba0, $0040, $0b80, $2929, $0940, $0000, $0013 +dw $0ab0, $0ad0, $0020, $0ac0, $2b2b, $0340, $0000, $0014 +dw $0af0, $0b40, $0050, $0b18, $2b2b, $05c0, $0000, $0015 +dw $0b78, $0ba0, $0028, $0b8c, $2b2b, $08c0, $0000, $0016 +dw $0b68, $0b98, $0030, $0b80, $2c2c, $08c0, $0000, $0018 +dw $0a68, $0ab8, $0050, $0a90, $2d2d, $01c0, $0000, $0019 +dw $0b00, $0b78, $0078, $0b3c, $2d2d, $0640, $0001, $001a +dw $0c50, $0db8, $0168, $0d04, $3232, $05c0, $0000, $001b +dw $0c78, $0ce3, $006b, $0cad, $3333, $02c0, $0000, $001c +dw $0ce4, $0d33, $004f, $0d0b, $3333, $05c0, $0001, $001d +dw $0d34, $0db8, $0084, $0d76, $3333, $08c0, $0000, $001e +dw $0ea8, $0f20, $0078, $0ee4, $3039, $1480, $0000, $001f +dw $0f78, $0fa8, $0030, $0f90, $3039, $1980, $0000, $0020 +dw $0f18, $0f18, $0000, $0f18, $3a3a, $0640, $0000, $0021 +dw $0fc8, $0fc8, $0000, $0fc8, $3a3a, $08c0, $0000, $0022 +dw $0e28, $0fb8, $0190, $0ef0, $3b3b, $04c0, $0000, $0023 +dw $0f78, $0fb8, $0040, $0f98, $3c3c, $08c0, $0000, $0024 +dw $0f20, $0f40, $0020, $0f30, $353e, $1680, $0001, $0025 +dw $0f70, $0fb8, $0048, $0f94, $353e, $1880, $0000, $0026 +dw $0070, $00a0, $0030, $0088, $4041, $0180, $0000, $0027 ;Skull Woods +dw $0068, $0078, $0010, $0070, $4344, $0180, $0000, $0028 +dw $0068, $0088, $0020, $0078, $4546, $0180, $0000, $0029 +dw $0318, $0368, $0050, $0340, $434c, $1780, $0000, $002a +dw $0450, $0488, $0038, $046c, $5151, $00c0, $0000, $002b +dw $0560, $05a0, $0040, $0580, $5151, $08c0, $0000, $002c +dw $0488, $0500, $0078, $04c4, $5252, $0340, $0000, $002d +dw $0538, $05a8, $0070, $0570, $5252, $08c0, $0000, $002e +dw $0470, $05a8, $0138, $050c, $5353, $04c0, $0000, $002f +dw $0470, $0598, $0128, $0504, $5454, $04c0, $0000, $0030 +dw $0480, $0488, $0008, $0484, $5555, $01c0, $0001, $0031 +dw $04b0, $0510, $0060, $04e0, $5555, $04c0, $0000, $0032 +dw $0560, $0588, $0028, $0574, $5555, $08c0, $0000, $0033 +dw $0450, $0458, $0008, $0454, $5656, $00c0, $0001, $0034 +dw $0480, $04a8, $0028, $0494, $5656, $01c0, $0000, $0035 +dw $0908, $0948, $0040, $0928, $5861, $1680, $0000, $0036 +dw $0878, $08a8, $0030, $0890, $5b64, $1280, $0000, $0037 +dw $0b60, $0b68, $0008, $0b64, $6868, $08c0, $0000, $0038 ;Dig Game +dw $0bb8, $0bc8, $0010, $0bc0, $6868, $0940, $0000, $0039 +dw $0b60, $0ba0, $0040, $0b80, $6969, $0940, $0000, $003a +dw $0ab0, $0ad0, $0020, $0ac0, $6b6b, $0340, $0000, $003b +dw $0af0, $0b40, $0050, $0b18, $6b6b, $05c0, $0000, $003c +dw $0b78, $0ba0, $0028, $0b8c, $6b6b, $08c0, $0000, $003d +dw $0b68, $0b98, $0030, $0b80, $6c6c, $08c0, $0000, $003e +dw $0a68, $0ab8, $0050, $0a90, $6d6d, $01c0, $0000, $003f +dw $0b00, $0b78, $0078, $0b3c, $6d6d, $0640, $0001, $0040 +dw $0c50, $0db8, $0168, $0d04, $7272, $05c0, $0000, $0041 +dw $0c78, $0ce3, $006b, $0cad, $7373, $02c0, $0000, $0042 +dw $0ce4, $0d33, $004f, $0d0b, $7373, $05c0, $0001, $0043 +dw $0d34, $0db8, $0084, $0d76, $7373, $08c0, $0000, $0044 +dw $0f18, $0f18, $0000, $0f18, $7a7a, $0640, $0000, $0045 +dw $0fc8, $0fc8, $0000, $0fc8, $7a7a, $08c0, $0000, $0046 +dw $0e28, $0fb8, $0190, $0ef0, $7b7b, $04c0, $0000, $0047 +dw $0f78, $0fb8, $0040, $0f98, $7c7c, $08c0, $0000, $0048 +dw $0f20, $0f40, $0020, $0f30, $757e, $1680, $0001, $0049 +dw $0f70, $0fb8, $0048, $0f94, $757e, $1880, $0000, $004a +dw $0058, $00c0, $0068, $008c, $8080, $0020, $0001, $0017 ;Hobo (unused) org $aab9a0 ;PC 1539a0 OWSpecialDestIndex: From 08ecc9b6734d41bb9df33aa6241c124bb0daedd7 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 18 Nov 2025 10:43:16 -0700 Subject: [PATCH 21/42] feat: pot lose coloring upon collection fix: normal lamp cone --- keydrop/standing_items.asm | 57 +++++++++++++++++++++++++++++++++++--- lampmantlecone.asm | 2 +- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index 0ffcfda..406e4c5 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -831,12 +831,61 @@ RTL CheckIfPotIsSpecial: TXA ; give index to A so we can do a CMP.l CMP.l $018550 ; see if our current index is that of object 230 - BEQ .specialpot + BNE .normal_pot - ; Normal pot, so run the vanilla code +.special_pot + PHX + + ; get pot index and cache room ID offset + LDA.b RoomIndex : ASL : STA.b Scrap0E + TAX + + LDA.b $08 + BIT.b $BF : BVC .upper ; if $BF has bit 14 set, it's upper layer + ORA.w #$2000 ; set the lower layer bit ($2000) +.upper + STA.b $90 ; cache tilemap offset + + LDA.l UWPotsPointers,X : TAX + LDY.w #$0000 + +.next_pot + LDA.l UWPotsPointers&$FF0000, X ; read only the bank + CMP.w #$FFFF + BEQ .nothing + AND.w #$3FFF ; mask out the first three bits (used for item indicators and layer) + + CMP.b $90 ; check against the tilemap offset + BEQ .get_flag + + INX #3 + INY #2 + BRA .next_pot + +.get_flag + TYX + + LDA.l BitFieldMasks,X + LDX.b Scrap0E ; get room ID + STA.b Scrap0E + LDA.l RoomPotData,X + + BRA .check_pot + +.nothing + INC ; from FFFF, A is now 0000 so the AND always fails + +.check_pot + LDY.b $08 : PLX + AND.b Scrap0E + BEQ .exit ; zero flag will be set, which is what we want + LDX.w #$0E82 ; the normal pot obj. See RoomDrawObjectData_#obj0E82 + +.normal_pot + ; Normal pot, so run the vanilla code LDA.l CurrentWorld ; check for dark world - .specialpot ; zero flag already set, so gtg -RTL +.exit + RTL SetTheSceneFix: STZ.b $6C diff --git a/lampmantlecone.asm b/lampmantlecone.asm index 4843547..08175f0 100644 --- a/lampmantlecone.asm +++ b/lampmantlecone.asm @@ -5,7 +5,7 @@ ;-------------------------------------------------------------------------------- LampCheck: LDA.l LightConeModifier : BNE .lamp - LDA.l LampCone : AND.b #$10 : BEQ .lamp ; always on + LDA.l LampCone : AND.b #$10 : BNE .lamp ; always on LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern LDA.w DungeonID : CMP.b #$04 : BCS + ; are we en HC? LDA.l LampCone : RTL From fee689e583ebed9d8232d29fb7dd89fa4fa937cb Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 18 Nov 2025 15:19:28 -0700 Subject: [PATCH 22/42] feat: hud shows all keys, instead of chest keys. Dropped Map requirement for key info. --- doorrando/hudadditions.asm | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index d5e8778..6cbd50a 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -69,15 +69,14 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX STY.w HUDCurrentDungeonWorld DRHUD_DrawKeyCounter: - LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished - REP #$20 - LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished + LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished + REP #$20 TXA : LSR : TAX LDA.l GenericKeys : AND.w #$00FF : BNE .total_only - LDA.w DungeonCollectedKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained + LDA.w DungeonKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained LDA.w #!SlashTile : STA.w HUDKeysSlash .total_only - LDA.l ChestKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal + LDA.l TotalKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal DRHUD_Finished: PLB : RTL @@ -141,14 +140,13 @@ DrHudDungeonItemsAdditions: jsr ConvertToDisplay2 : sta.w $1644, y + iny #2 : lda.w #$24f5 : sta.w $1644, y phx : ldx.b Scrap00 - lda.l MapField : and.l DungeonMask, x : beq + ; must have map - plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 - lda.l GenericKeys : bne +++ - lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02 - +++ lda.b Scrap02 - rep #$30 - jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals - bra .skipStack + plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 + lda.l GenericKeys : bne +++ + lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02 + +++ lda.b Scrap02 + rep #$30 + jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals + bra .skipStack + plx .skipStack iny #2 cpx.w #$000d : beq + From 7b93b4b4ebc321e5215f9072e9e6d195e60c90f6 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 18 Nov 2025 23:54:10 -0600 Subject: [PATCH 23/42] Added new gfx for 10/11 keys rather than A/B keys --- doorrando/hudadditions.asm | 4 ++-- menu/drsheetdc.2bppc | Bin 1486 -> 1713 bytes menu/drsheetdc.png | Bin 2602 -> 4351 bytes 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 9f5acab..6149d9d 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -244,13 +244,13 @@ BkStatus: ConvertToDisplay: and.w #$00ff : cmp.w #$000a : !BLT + - !ADD.w #$2553 : rts + !ADD.w #$2519 : rts + !ADD.w #$2490 : rts ConvertToDisplay2: and.w #$00ff : beq ++ cmp.w #$000a : !BLT + - !ADD.w #$2553 : rts ; 2580 with 258A as "A" for non transparent digits + !ADD.w #$2517 : rts ; 2580 with 258A as "A" for non transparent digits + !ADD.w #$2816 : rts ++ lda.w #$2827 : rts ; 0/O for 0 or placeholder digit ;2483 diff --git a/menu/drsheetdc.2bppc b/menu/drsheetdc.2bppc index 7385a9b0ac4d82f321cd60bd7ca58e3678241195..3f1bc71b81557ea64dab2af7924d2f5df3e70250 100644 GIT binary patch literal 1713 zcmX9;3v3i+5T5_v$CW~;tyKvi@ZS}!N+MCzVk*S$T?>r}2o>cKQHfS!L_m4i6{an+DOL2)>ma2G@)1;wgZFNq;FgsDM$X;Iz?HOR^v5eZJP zo`|WKg%sHCz1h9ZwLN?r)F9`5aBPs1R;;rRLw{Ub86S`nVO;T=daxR(-{~BHZXErtm;RoUg%}v;ykv zqu`T{;U2J>Jf1}?i8cYZlFI(=?}jTDG1!OtRj9(eDoqLl0v4{zY4V6K}Xo(+*bP2!UhezRvtd4V3igVxQIL0Z2+%CG2JVuJ)L$c?2> zb)%n&3#B6GBRQI~GSov|l%`9Z@v?wL_Ccvv(P27cpODat6_9E@)O^m+Hd3nzg{SI$eto1gWU}#%s1e)%7pE>t2n$RIJ~pDO-=U zmbWdl%QSe#Ua9*hN3~cxQ|74Dd#Ml3{em-j$%zh4w2sGrG_7kx*DOWiX+qNBwlK{? zX@p3>nO>&{?5!H+>u9n=-cJ>F$bcEPX23%Qq~AjO>6230A0m9vu;vg93)7qsC4&au zYGA(MY}0tvLCGeLGjOv8r)uso;GM+thV>J1PKY44oDMTS&#?BB{FDyX3^TC6uyQF< zK_RNG_x+sqR+y@|1LiSt6-_qjd{gi<9U6ma<>C>YZRan;=`{GNMx7?z+M8wEuO2c?=VudsqYFh>Q6qe}=r;Jd?FiseT|kVHfM^xQ0qIYR$X2Jn3pwcQ;wlkF+YAT-!)KBsn`JbfU z-V*j2ahGtS<_)rq>9yB=@=l@Y(?~X%KKWH99Jkx}6xW_NlD`|=^^op!Zqmi7SWUCO zdb&?Z6{&O?7kJoovP|uy_j1(t*uNX4+~e*5&!0{f2H5gT_-3RZ<12y9x_EE`jtRio z#4x7vMw6*BXn^=9!-bQx%^T7->zMJo`lGl`eL$4PYBM|)tK*zBxCmqi2P@CXGdY-S k)>X{8Y$neezJ#9hTp%!X#H}O76^|)qV*YM;dmN(w0hV9C_W%F@ literal 1486 zcmWlXeNa?Y7{<^2+~p$>#AKp?7BZchY%+^#72~)eOs1AZj(@0=GuccNrhRB^_rl(L zcUhAUbxKiFr$jY{CAswFg0Is5IRuDmglJ4Wza+nTmoyRK<{ zlXE9=>G?aKD6KDDTUK9MLfjI9(Zaj^7yNZC7yM1cY|4yB`>};A}911L@j~bF;&}L*D;T>a# zS%f#kI!2_xQY%8V6+3o|9jAvVJI##TP=4{N9fWow-b0+v$g0uKg_ymF6etzGEps=P zaA}ex$cCm1nRHE?|7uR6vVH4Tvf8d8nQO}~mx*9Gxun2eN8DTLT3%|Ac#{c|t$02H z2?~5Df#+>woHOQmV`GU#8Ch8#lnM*2uL)hTLu%s!Q!$K34SM2QDQz>XBg8sLvNCd? zZs`0v9YHsB0)&I8>5b(PQ!20%iYs{nV|23L z`|;|~@9A$a1Y8N>3kkpN>Xy|Z{D2wjyj%|TUyRSBDLfV5p`Tfg$XN}24LF)kV>%b< zTM20lHP(_wQHWob5q&`RZxJrf;tEcSkejd){|U!;=OOeVg52jP8^x$;gjLF-36nPp$)ks*ESA@h_O|QwR^hmpkplOF%otenm_f)wPY}5o%TiO#e>Yh=TO<>6htrW?)(Z zr(hC1J5N?-z)gxuRopO-+G|wF6oI$|W<9LhS!!&xN=hjDtW`2GTldORjY$tc?!*F` znjc7!5z01GHX<_I3>656&r#m%<7fF4k8;-Wp^_bmg!*gGzbM{j1N!V&6e*FQ$6Q~j z`LsizN9Jt2fW_D@Qq3&~SwvB%;W44OR}5$l zPU52wPKtw%DAr3TvZ)p?*5t)_!9Jv90{g`6llU0}(c3ign*F3ke*#%7^m#Qn9lcJY zCn0}~PoqT|siVjXp>B7p7Q0^~dng)3GjeFx`>Gn@y}T=s)EJA3%KAgIMl^{rr$?n9 zB(+|CPW*Al)o54J`A5s<-=X>)I*)EjNsKLU(@EG7RIapgYH3Hln?1 z%Nku+OBEH)GCh7ukInLlG#B|ZVJpW+dRs)-i}n)TneQVPqnEVUGGEN^6U6!yzh~() z;ok*udylSpUW@m)7k^y0Tuqx2ozHPW=ydp`hm4q~$Cv5y6weIgIJ0zXug~dKoiW|{ cOS72fZ1iQ^P<(yy-ND;~0z%NAP{lU>2ipAbWB>pF diff --git a/menu/drsheetdc.png b/menu/drsheetdc.png index 1597d57639f377b0fdbd045cbf370549d4f2a6b9..12205edf495409e5ab79304127485cbc5356c2dc 100644 GIT binary patch literal 4351 zcmbVQ3pkVg-yfNZ6p^AZQ<*Y5Ic+t}acE9?gdY|`wpa0?d@4D{Yzx)1uzMt>sd-#2KT|4IFU?V4^Dgy$6 zU*f<^@`jrY6`U<2{e&SeRp&?(LQz-}_1fT;9 z4qJ>x{lv0@m>ecMi1|;be{TOT2jbk4NI!l2trj}{rwca6>X0~$?+N)^G}|?t1t44i zHZv@g0$3dq%hXzqhJ~{T1;`v`s4J5h@}p8tKO{rYhI&{CY#)t5Wpdd%e=z_o$s7O= zU9K8@xnw9;G#Y21kHcW#NCO-a`3*{9QfUF@WRfM78Kp^%?x#91&yn4x0FVs)6WDo7-pErZP=Gbn(qB_1k{ zS&v4e;ta@!D1E9w6^=0kFmUl24abtP#&CZF3KC7#H!ws~sXy#3nUt{Q%KosYitPad ziZR*95P+jmNEF;iYyl@5p~!HGArc#a6jSLN=>M>H45f*W7CGd<=2<>)%PoN;(%9l+ zg?~R0dx3-BS0OaW*Dk=3Da+lBhfq^MqTJtLY-Rw5 zOAZAHf#Pia+jc_yGx2Qlp?@v?KP%qoc_nGpzxXC(r<91LQ4sC+95 z;{Vp`>)u}m&=0tHsx2>n&QtNj&xs5$#MGhUdCPluelrLp^Ul_i;L1Dq!KcmT6>iNL z9p!}%V8xPeyR<0qP<`?VOj78_YXfGppIyVcu7*6d-8u&3$U9$>c;qR2UAukpWCN7Id^b( z6(V!>gX*#dopsW%INQVC#(?9q~m|S2cjB@s*kf5ar%q2tt#Iew*Qgs=*U) z)R+QSOTC>klELrghb_&ad5UlXqpy=6Gz#-LiRpY~lGU#GUFp zS-aLdraXvZ2~13P*4686)5LkE`q)|zz~xRMWLnaoK5v-1nnLHHBk!~a>e_le)zjme z!3de13J}3Pnr^bQXM@fd14W##Vck6)@+7W`5u@r4oj)*a?Ax9<5ms>$Q}yf*?NT!A zQhMqTztmO`w$$m{Xx%rQaoSNL0I0SzW`;8T8f{xSqttkz;S zbD%S3mdLNZ`Xn+>?WU}!Je}J8YvaY}SI@n7bX4N-LrUxO|q|#>&{)h6ajJ~@F6iD2KYpPGMVr;X>v?C zwk0wfeN&Ble+Aw8S8JJ^;r$0C3@OqU(cNKdsnJcUnJ!XD5+OBIUcohvxJSOoCoWv4 zWmQX2umLp1Cv0tOy^>b+-qgX^!Y#3l6CC&2x%V~h6Lr3dvQ0Geq4rZ?pO5jo3t_7g z+@d;Pu6d>fLZvl~$zQmw zvbWsb^Q;r7^5Xk8;iK>~o}`m5Eg^~rW=C2l61%zJF;@_sBrCC{I}Y7$tTogV>AUsL zZO?ldlA?n!<)Hw!t>_y3;G2m;JN7t(LL`V5zF1gVA`poAuz9_=*TxGWhtraM6=5;0 zqS>Qqa?6}5tK>aIEH&okDh-qS<9>vIwhW6&mw6yAOET^S()UO9|~wQ1kWnY7oLV>zWB zHmc2U1v}R88q_r(HCqmY$JT7#C%O=(>*t;@@JY?Pd9!D#-sIF2^vpwBsOrayqeK6Yx9&V zpxIniYPxlL`_W73stON1gO5e>qUa7|bJnmv?NlARw z=+pY(FZ^O3uje5jAIT5Ch23)bjOPbi1ZxVHN>#c(v70p{ysIU55OrRc$sU z7ga8$nU=p=RGl{0Fh9eo4-W42dc`MZ5^p#i=LTDNY}sj0oNIHebFOo-Wn6efQ`C;m zCpG6E9%>kCK(0HS>m*Z>VycRc7r;uCw12mX2;^5xPVe}jpe{#RU2*5vQ-dQtF`NRY zh8J^orrZ#H=A;+ed*>wxzF~6zT28~$~EV+P|gk7b6ae~TGjn! zMdowu!hKQkzT0wp-2*234wzbA#kHhGq_keY_%3hX`2vm0!+!=D-30NapQ79{v}Mwx zuQl6`DQ7VQ*7T+~v2?ih`o#{{B*Qh3?ZqE*jwuyXg7-mp4BC$%#`Dul7b4wqD?Vas z|Lk7n;nh9Vi^|(@D0#_zZBG>0&i<~UWn9K(EW&H)Jwv)i0 zB`>hN;3%``B{L#*tj<1wrPt@P+&R#ox?&y2yJ|&vX+HYeyk3loHmb_qcpXU!RFXFp*J!Z${4tKf2o zTAMk7j;ha|+>0X{uH0U%9pSf_VfgUTv?C=VC;y3BaCp1N^ZEmKl!2N=yYV>3?%yT=fh(bi{TosHnc?p zK6OE|Suu?%9cbE_wQzHz=#N!Rjm*9kbHSy2;M#2-bV}p5%&@eHH&4AI<1Y4hVRl6- zCpLIH21HOvx2$mOHM&g^oJHX7(+wlzBSuNiBE0$Tx78i$Cv}@ZC$n34X8Y}VyB0zw zzCeRde@r=g-<@oD>V95;nsa}C`&I7}W4G+tddTz48IfByS5kLlaq5!17DuoyFZ{8J zXpl#b{L)(DIK1(^ua|wS>j{Pas#lSU7mhvjtj`*C&L)V; zPBuHrrpDSPB+c#m*tr;6X*Bn7vZNy>7B78O%C%bo?I9>JWv=EHb`ZB{jv1&7rp?b9 zCT0z9e3?q%Z(pUWGDlv&2w0tT<%tZuHO?Br;UsK{xsRE=4W+(xawl=z=5zIYifhTt zDeIV;mbE%kJg#G;Y>Z@y$yQ2)CQiN1S9#moD-abOEAs&6MW{h?(9sipkAyBvY|hru zQazEhD^%XyxN3XoI|! zY=7p+){8_IU84Pu8ow5~I-1#da)Xq{hO)Kh`Wc7z^sO%JJU(;z z-Ky2IXwQUAg6Zn8l&*Q-&dEJW#hMR}Zt$B@`u$KwOI}-eNqA*Xb)T(AvhVeYO<7uZ zm>)$OIlK2h+*l9(q+j4toY;9xX)I<$k}f3_ptR@YdMeZh!o2pW6=;+%y?3m7zD8Gy zD{+$wayjAQl2Zd)$=g-2p~PC(>5-)6iEdrl^)_yV2WmUqNhTP8g5w2cXt|6|2>sS5 zY>K+|Ag?GoSM{N!HIcAI@k5Q73V5ntCGol;{rH9C7rh=-4O{NJHKnKcVM#^FukP{& zKgVP8bUKN1W!#8@6MmE9S5EWv>3EeJ+vD+JNnR#PXI~DEL6%m)ZkO@+K6B@m|Dv$9 La*K$Adi=c z^zT=the3d*(xC|96Uq0y)%qcWm*e?XS)|TUN^PakSogVBQGbZ&R;IqSC+59ZJeSeh zIMp@Un5}R15Bhx~DzC4lJU-S!M5WdWDVnGA@BS!|J#=u4g7jSDW0HhW5@=1x(R`#% z@Bb4~X|-zLC>8*`yqgfwMgg$;5Uw}$4@$4ErTqO{%FD|eP%@n@2pwvzG_T%b|#B~H;wq0uTG4)@Wl3IoRn0i4v}J2;yME`(1kamLZLdU>Jp z_?RI10FW+xt!vqvYx2BNoA7oeAxD7Z5bskt?(Vf(Pk$iUAb7A#6tEt};5b|R-8o4A zo9Qk6ku-nTvM4xs*=K{`^|Bfe#(wmV=R$eqp4Kcwt+hge>$xUG^!^zHTe2Q>F+fS; zAdipror`2*7UTqyH!X{}SSMFzv=kahnj-`#IFWMQw-&~Sn#XEr@M(=Lk!T~5w#77M;?zVfglocxAyw@Hg+dEh_=SK}%(1opxx(^MaXC>b%Lt&(^KUJ59H zOb9@x`Ni#Fj8QEPw$48+exq@VnE(NIdv-)rF2iPP4v_545H6M@Aa5uq?BB26qfl3pOU0h&i{q6=?8rXBStowtc4v6PkPk)iU z(RD?*Oaf+tqziyh!-!mCSy~slj(|wg;-h6lxYBHW#Dbu~4Q*`R{otJA*rNavDL@2+ zf_a%1t(>PI?x^JxAdZWr0RUZZR2M&AK}o2ewz>Z3s?po-P0{Lju56||x>%YS27UTf zA*U~J4_5l;)|VzTM+@QQBY}c8?|*uw1px%${nJw$zK{R&@*7-^55GP3p(oxq>AKNB z?=y9OqV*eVgSYGDYpK`m&uM&Ko5r6}EQy>R3uJIvrL%|;w``vkfmv~Fj+>U(xP_Om zr53!NX%Qe}xNwZ%^#2>6WtD4T4aO%ISHr-lm5};p2rfJ>?--?(W0t&a%zv3SS`ba6 z_lKwnGZ$XIv|(IUV$HOV->uN>PE9ZMPZ|&ZUmKSO_CwL`UcQ&cz5bc@r3cA{8UHrL z!t8W&tPrO(7je(kOUBer*!R) z^nE7$jPR=jh(|9OrUnq*i1k3~Bl|s8$7Q8s5M(2qymg)=iTq@kSJR+@5F|Ny z)qBX}!;_YG?*=Bf9*)}-?gwI>ym^f1CNQb}Op6v|hdZJ14OD2yFlS@?ucJbVhNWjL zh_y1eltR{yL`(S5wSQUG-W2T}DLIk2!Ger@V|5S0mk;47lY_hGQl$O)n(&X7dS>2f zJPP&zEOaK{9a^48xT4NvTt5`%y~9|&B`izxAi_9H6BeBs3mG#x5v9CI-}4zo-f^C% zywBczA|h>TDi29Y%RSKV7BA4Y#Uj6__1DVRw$etv^S)but$+I7{dV|{H{Vo?KM#{B z!a?}jBhE=?1qnHXPAhMMy0i1f|l5QsZ?)fj_dG0!QpEZVMx zo4+oKRWi)`ou8NW{4&gYv5SSATZQD;KwjP0egX2Ta;;AGuP%;X>x(4l-~G6y@8e=A zarF21Y#T?D79d}X!+&Vs+eRBD`sfj#!Jq><{gv{e@qZile|!COvnDu*x37DJNU!c2 zM^1`I%B=7R>kQxM?|SzaQ5Y-rGtHCq2nno_d=O0Nk_yki7W=m{gB(35`y$RaRX<7k z#wgZ|g+On*^^jIydw}$hxk6t`N-SjZ5R&{GCL zLMxFTAb(^_0R>Yd%D@0XlJOk?@if>9$qSfx(S?v^!L@mfpe5NdJ`W_p@tbWruAF=S z(#6{6(<1K&sRau?Mz{qU=ePQ3g+`<8N5@a#J@mL0VtMMq_!1>R`V({qkee!PFp7}t z0ssPW!3Y40^*eR3FEhb~)y+&fA$Wz0g>ZsR-+$?i9F+0Ezg*m+>G$_-i0vwJrds zK(?;BJmkVKt(Wh*tvL^}A&RxjNX*s|ECg|o7yy>QQFo5X6EIIhdz-pEi-B4IWGPKr zkbmm{Vrr<_S0iYzJD33&yIz6*yYnpGQJ_)x>B5%)B{}~LfH)@FbAciNnp#T1&Zs^0 z(Q`4pd6po%=af zpI;^+{R2e;!6#J`0UQ7T01jnXNoGw=02?X*000O800000007cclK=n!07*qoM6N<$ Ef(YmbwEzGB From d21daccf4cb5ea7c95ed141d604d392517f16f45 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 19 Nov 2025 08:56:12 -0600 Subject: [PATCH 24/42] changed TF item to use its own gfx id --- itemdatatables.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/itemdatatables.asm b/itemdatatables.asm index 75301f7..db404d6 100644 --- a/itemdatatables.asm +++ b/itemdatatables.asm @@ -243,7 +243,7 @@ endmacro %ReceiptProps($67, -4, 0, $FF, $F36A, $FF, skip, skip) ; 67 - %ReceiptProps($68, -4, 0, $FF, $F36A, $FF, skip, skip) ; 68 - %ReceiptProps($69, -4, 0, $FF, $F36A, $FF, skip, skip) ; 69 - -%ReceiptProps($6A, -4, 0, $49, $F36A, $FF, triforce, skip) ; 6A - Triforce +%ReceiptProps($6A, -4, 0, $4A, $F36A, $FF, triforce, skip) ; 6A - Triforce %ReceiptProps($6B, -4, 0, $50, $F36A, $FF, goal_item, skip) ; 6B - Power star %ReceiptProps($6C, -4, 0, $49, $F36A, $FF, goal_item, skip) ; 6C - Triforce Piece %ReceiptProps($6D, -4, 0, $FF, $F36A, $FF, request_F0, skip) ; 6D - Server request item From 70a23191bac587c2bc94a9b4d2f4968b85a218f8 Mon Sep 17 00:00:00 2001 From: aerinon Date: Wed, 19 Nov 2025 16:29:40 -0700 Subject: [PATCH 25/42] fix: bunch of fixes for key counting system --- doorrando/hudadditions.asm | 15 +++++++-- enemizer/underworld_sprites.asm | 2 +- inventory.asm | 3 +- sram.asm | 17 +++++++++- stats.asm | 60 ++++++++++++++++++--------------- 5 files changed, 63 insertions(+), 34 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 6cbd50a..2a1fc96 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -71,9 +71,12 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX DRHUD_DrawKeyCounter: LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished REP #$20 - TXA : LSR : TAX + TXA : LSR : BNE .dungeon_id + INC +.dungeon_id + TAX LDA.l GenericKeys : AND.w #$00FF : BNE .total_only - LDA.w DungeonKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained + LDA.w DungeonAllCollectedKeys-1, X : JSR ConvertToDisplay : STA.w HUDKeysObtained LDA.w #!SlashTile : STA.w HUDKeysSlash .total_only LDA.l TotalKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal @@ -240,7 +243,13 @@ ConvertToDisplay2: ++ lda.w #$2827 : rts ; 0/O for 0 or placeholder digit ;2483 CountAbsorbedKeys: - JML IncrementSmallKeysNoPrimary + CPY.b #$24 : BNE .done + PHA : PHX + LDA.b #$84 : TAX ; pretend this isn't a smallkey, but an absorbed object (small heart) + REP #$10 : JSL CountAllKey : SEP #$10 + PLX : PLA +.done + JML IncrementSmallKeysNoPrimary ;================================================================================ ; 8-bit registers diff --git a/enemizer/underworld_sprites.asm b/enemizer/underworld_sprites.asm index 7d900b4..f931db7 100644 --- a/enemizer/underworld_sprites.asm +++ b/enemizer/underworld_sprites.asm @@ -31,7 +31,7 @@ StalfosKnightDrawOverride: .vanilla JSL Sprite_PrepOAMCoordLong - JML Sprite_91_StalfosKnight_continue + RTL BlobDrawOverride: PLA : PLA : PLA ; fix the call stack diff --git a/inventory.asm b/inventory.asm index e86eebb..61856af 100644 --- a/inventory.asm +++ b/inventory.asm @@ -220,7 +220,8 @@ DungeonIncrement: REP #$10 PHX LDA.w InventoryTable_properties,X : BIT.b #$40 : BEQ + - JSL CountChestKeyLong + CPY.w #$0024 : BEQ + ; keys for this dungeon are done elsewhere + JSL CountAllKey + LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .done SEP #$10 diff --git a/sram.asm b/sram.asm index a77105b..272883b 100644 --- a/sram.asm +++ b/sram.asm @@ -361,7 +361,21 @@ TRCollectedKeys: skip 1 ; | Turtle Rock GTCollectedKeys: skip 1 ; / Ganon's Tower skip 2 ; Reserved for previous table FileMarker: skip 1 ; $FF = Active save file | $00 = Inactive save file -skip 13 ; Unused +DungeonAllCollectedKeys: ; \ Key Counters. Counts all keys for a dungeon. Chests and drops. + ; | Note, this label is not indexed like others due to space. Sewers has no decicated entry. +HCAllCollectedKeys: skip 1 ; | Hyrule Castle +EPAllCollectedKeys: skip 1 ; | Eastern Palace +DPAllCollectedKeys: skip 1 ; | Desert Palace +CTAllCollectedKeys: skip 1 ; | Agahnim's Tower +SPAllCollectedKeys: skip 1 ; | Swamp Palace +PDAllCollectedKeys: skip 1 ; | Palace of Darkness +MMAllCollectedKeys: skip 1 ; | Misery Mire +SWAllCollectedKeys: skip 1 ; | Skull Woods +IPAllCollectedKeys: skip 1 ; | Ice Palace +THAllCollectedKeys: skip 1 ; | Tower of Hera +TTAllCollectedKeys: skip 1 ; | Thieves' Town +TRAllCollectedKeys: skip 1 ; | Turtle Rock +GTAllCollectedKeys: skip 1 ; / Ganon's Tower InverseChecksumWRAM: skip 2 ; Vanilla Inverse Checksum. Don't write unless computing checksum. ;================================================================================ @@ -623,6 +637,7 @@ endmacro %assertSRAM(TRCollectedKeys, $7EF4EC) %assertSRAM(GTCollectedKeys, $7EF4ED) %assertSRAM(FileMarker, $7EF4F0) +%assertSRAM(DungeonAllCollectedKeys, $7EF4F1) ;-------------------------------------------------------------------------------- %assertSRAM(ExtendedSaveDataWRAM, $7F6000) %assertSRAM(ExtendedFileNameWRAM, $7F6000) diff --git a/stats.asm b/stats.asm index 0b6b4eb..04c7bd1 100644 --- a/stats.asm +++ b/stats.asm @@ -115,38 +115,42 @@ DecrementSmallKeys: STA.l CurrentSmallKeys ; thing we wrote over, write small key count JSL UpdateKeys RTL -;-------------------------------------------------------------------------------- -CountChestKeyLong: - PHX : PHP - SEP #$30 - JSR CountChestKey - PLP : PLX -RTL + ;-------------------------------------------------------------------------------- -CountChestKey: - PHA : PHX - LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .done - LDA.l StatsLocked : BNE .done - CPY.b #$24 : BEQ .this_dungeon - TYA - AND.b #$0F : CMP.b #$02 : BCC .hc_sewers - TAX - LDA.l DungeonCollectedKeys,X : INC : STA.l DungeonCollectedKeys,X - BRA .done - .this_dungeon - LDA.w DungeonID : CMP.b #$03 : BCC .hc_sewers - LSR : TAX - LDA.l DungeonCollectedKeys,X : INC : STA.l DungeonCollectedKeys,X - BRA .done +; Expects 16 bit index mode upon entering. 8-bit Acumulator +CountAllKey: + PHP : PHA : PHX + SEP #$10 + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .done + CPY.b #$24 : BEQ .this_dungeon + TYA : AND.b #$0F : CMP.b #$02 : BCC .hc_sewers + BRA .all_dungoens - .hc_sewers - LDA.l SewerCollectedKeys : INC - STA.l SewerCollectedKeys : STA.l HCCollectedKeys +.this_dungeon + LDA.w DungeonID : CMP.b #$03 : BCC .hc_sewers + LSR - .done - PLX : PLA -RTS +.all_dungoens + STA.b Scrap00 : TAX ; store dungeon index in X, $00 + LDA.l DungeonAllCollectedKeys-1, X : INC : STA.l DungeonAllCollectedKeys-1, X + REP #$10 : PLX : PHX ; 16 bit index + LDA.l InventoryTable_properties, X : BIT.b #$40 : BEQ .done + SEP #$10 : LDX.b Scrap00 + LDA.l DungeonCollectedKeys,X : INC : STA.l DungeonCollectedKeys,X + BRA .done + +.hc_sewers + LDA.l HCAllCollectedKeys : INC : STA.l HCAllCollectedKeys + REP #$10 : PLX : PHX ; 16 bit index + LDA.l InventoryTable_properties, X : BIT.b #$40 : BEQ .done + LDA.l SewerCollectedKeys : INC + STA.l SewerCollectedKeys : STA.l HCCollectedKeys + +.done + REP #$10 + PLX : PLA : PLP + RTL ;-------------------------------------------------------------------------------- IncrementAgahnim2Sword: From 5936b08497caf72703e998b6caba883f179dd8f5 Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 20 Nov 2025 10:04:53 -0700 Subject: [PATCH 26/42] fix: skip map check only when maps aren't shuffled --- doorrando/hudadditions.asm | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 2a1fc96..15b756a 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -71,6 +71,9 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX DRHUD_DrawKeyCounter: LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished REP #$20 + LDA.l FreeItemText : BIT.w #$0040 : BEQ .skip_map_check + LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished +.skip_map_check TXA : LSR : BNE .dungeon_id INC .dungeon_id @@ -143,15 +146,19 @@ DrHudDungeonItemsAdditions: jsr ConvertToDisplay2 : sta.w $1644, y + iny #2 : lda.w #$24f5 : sta.w $1644, y phx : ldx.b Scrap00 - plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 - lda.l GenericKeys : bne +++ - lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02 - +++ lda.b Scrap02 - rep #$30 - jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals - bra .skipStack - + plx - .skipStack iny #2 + LDA.l FreeItemText : BIT.w #$0040 : BEQ .skip_map_check + LDA.l MapField : AND.l DungeonMask, x : BEQ .key_info_done ; must have map, if shuffled + .skip_map_check + plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 + lda.l GenericKeys : bne +++ + lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02 + +++ lda.b Scrap02 + rep #$30 + jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals + bra .skipStack + .key_info_done + plx + .skipStack iny #2 cpx.w #$000d : beq + lda.w #$24f5 : sta.w $1644, y + From 00fb9e6c5d826ce899e839213e1e4976a8b2a4d4 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Fri, 21 Nov 2025 09:20:59 -0600 Subject: [PATCH 27/42] Adding compress/decompress script for use with gfx --- menu/compress.py | 135 +++++++++++++++++++++++++++++++++++++++++++++ menu/decompress.py | 112 +++++++++++++++++++++++++++++++++++++ 2 files changed, 247 insertions(+) create mode 100644 menu/compress.py create mode 100644 menu/decompress.py diff --git a/menu/compress.py b/menu/compress.py new file mode 100644 index 0000000..9c3debb --- /dev/null +++ b/menu/compress.py @@ -0,0 +1,135 @@ +import sys +import os + +# Compression function reverse-engineered from ALTTP's decompression routine at $00E7DE +def compress(data): + out = bytearray() + i = 0 + + while i < len(data): + # Check for repeating byte pattern + if i + 1 < len(data) and data[i] == data[i + 1]: + length = 2 + while i + length < len(data) and data[i] == data[i + length] and length < 32: + length += 1 + # Repeating byte: 0x20-0x3F + out.append(0x20 | (length - 1)) + out.append(data[i]) + i += length + continue + + # Check for incremental byte pattern + if i + 2 < len(data) and data[i + 1] == data[i] + 1 and data[i + 2] == data[i] + 2: + length = 3 + while i + length < len(data) and data[i + length] == data[i] + length and length < 32: + length += 1 + # Incremental: 0x60-0x7F + out.append(0x60 | (length - 1)) + out.append(data[i]) + i += length + continue + + # Check for repeating word pattern (alternating two bytes) + if i + 3 < len(data): + # Check if we have an alternating pattern: A B A B... + byte_a = data[i] + byte_b = data[i + 1] + length = 2 + while i + length < len(data) and length < 32: + if length % 2 == 0: + if data[i + length] != byte_a: + break + else: + if data[i + length] != byte_b: + break + length += 1 + + if length >= 4: # Need at least 4 bytes (2 alternations) to make it worthwhile + # Repeating word: 0x40-0x5F + out.append(0x40 | (length - 1)) + out.append(byte_a) + out.append(byte_b) + i += length + continue + + # Check for copy from past (LZ with absolute offset) + best_len = 0 + best_off = 0 + search_start = max(0, i - 65536) # Can reference anywhere in output + for j in range(search_start, i): + length = 0 + while i + length < len(data) and data[j + length] == data[i + length] and length < 1024: + length += 1 + if length >= 2 and length > best_len: + best_len = length + best_off = j # Absolute offset, not relative! + + if best_len >= 2: + # Copy from past: 0x80-0xDF or 0xE0-0xFE (extended) + # Offset is ABSOLUTE position in the output buffer + if best_len <= 32: + # Standard copy: 0x80-0xDF (5 bits for length-1, 16 bits for absolute offset) + out.append(0x80 | ((best_len - 1) & 0x1F)) + out.append(best_off & 0xFF) + out.append((best_off >> 8) & 0xFF) + else: + # Extended copy: 0xE0-0xFE + if best_len > 1024: + best_len = 1024 + # Command byte: 111LLLLL where L is length bits + cmd = 0xE0 | (((best_len - 1) >> 8) & 0x1F) + out.append(cmd) + out.append((best_len - 1) & 0xFF) + out.append(best_off & 0xFF) + out.append((best_off >> 8) & 0xFF) + i += best_len + continue + + # Raw copy (no pattern found) + size = 1 + while size < 32 and i + size < len(data): + # Don't extend raw copy if we find a better pattern ahead + if i + size + 1 < len(data) and data[i + size] == data[i + size + 1]: + break + if i + size + 2 < len(data) and data[i + size + 1] == data[i + size] + 1: + break + # Check LZ + found_lz = False + for j in range(max(0, i + size - 2048), i + size): + if i + size + 1 < len(data) and data[j] == data[i + size] and data[j + 1] == data[i + size + 1]: + found_lz = True + break + if found_lz: + break + size += 1 + + # Raw copy: 0x00-0x1F + out.append(size - 1) + out.extend(data[i:i + size]) + i += size + + # End marker + out.append(0xFF) + return out + +if __name__ == '__main__': + if len(sys.argv) != 3: + print("Usage: python compress.py ") + sys.exit(1) + + input_file_path = sys.argv[1] + output_file_path = sys.argv[2] + + if not os.path.exists(input_file_path): + print(f"Error: Input file not found at {input_file_path}") + sys.exit(1) + + with open(input_file_path, 'rb') as f: + input_data = f.read() + + compressed_data = compress(input_data) + + with open(output_file_path, 'wb') as f: + f.write(compressed_data) + + print(f"Successfully compressed '{input_file_path}' to '{output_file_path}'") diff --git a/menu/decompress.py b/menu/decompress.py new file mode 100644 index 0000000..31e07db --- /dev/null +++ b/menu/decompress.py @@ -0,0 +1,112 @@ +import sys + +def decompress(compressed_data): + out = bytearray() + i = 0 + + while i < len(compressed_data): + cmd = compressed_data[i] + + if cmd == 0xFF: + # End marker + break + + i += 1 + + # Decode based on top 3 bits + top_bits = cmd & 0xE0 + + if cmd < 0xE0: + # Standard commands + length = (cmd & 0x1F) + 1 + + if top_bits == 0x00: + # Raw copy + out.extend(compressed_data[i:i+length]) + i += length + elif top_bits == 0x20: + # Repeating byte + byte_val = compressed_data[i] + out.extend([byte_val] * length) + i += 1 + elif top_bits == 0x40: + # Repeating word - alternates between two bytes + byte_a = compressed_data[i] + byte_b = compressed_data[i+1] + for j in range(length): + if j % 2 == 0: + out.append(byte_a) + else: + out.append(byte_b) + i += 2 + elif top_bits == 0x60: + # Incremental + start_val = compressed_data[i] + for j in range(length): + out.append((start_val + j) & 0xFF) + i += 1 + elif top_bits >= 0x80: + # Copy from past (absolute offset) + offset = compressed_data[i] | (compressed_data[i+1] << 8) + for j in range(length): + out.append(out[offset + j]) + i += 2 + else: + # Extended command (0xE0-0xFE) + # Command type from bits 5-7 (after shifting) + cmd_type = ((cmd << 3) & 0xE0) + # Length from bits 0-1 of command (high) + next byte (low) + length_high = cmd & 0x03 + length_low = compressed_data[i] + length = (length_high << 8) | length_low + length += 1 + i += 1 + + if cmd_type == 0x00: + # Extended raw copy + out.extend(compressed_data[i:i+length]) + i += length + elif cmd_type == 0x20: + # Extended repeating byte + byte_val = compressed_data[i] + out.extend([byte_val] * length) + i += 1 + elif cmd_type == 0x40: + # Extended repeating word - alternates between two bytes + byte_a = compressed_data[i] + byte_b = compressed_data[i+1] + for j in range(length): + if j % 2 == 0: + out.append(byte_a) + else: + out.append(byte_b) + i += 2 + elif cmd_type == 0x60: + # Extended incremental + start_val = compressed_data[i] + for j in range(length): + out.append((start_val + j) & 0xFF) + i += 1 + elif cmd_type >= 0x80: + # Extended copy from past + offset = compressed_data[i] | (compressed_data[i+1] << 8) + for j in range(length): + out.append(out[offset + j]) + i += 2 + + return out + +if __name__ == '__main__': + if len(sys.argv) != 3: + print("Usage: python decompress.py ") + sys.exit(1) + + with open(sys.argv[1], 'rb') as f: + compressed = f.read() + + decompressed = decompress(compressed) + + with open(sys.argv[2], 'wb') as f: + f.write(decompressed) + + print(f"Decompressed {len(compressed)} bytes to {len(decompressed)} bytes") From 2418c1b3226964e704e72a4c4ca9d65f17356747 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sat, 22 Nov 2025 06:52:45 -0600 Subject: [PATCH 28/42] Fix for post-mirror follower sprite gfx --- bugfixes.asm | 14 ++++++++++++-- hooks.asm | 4 +++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bugfixes.asm b/bugfixes.asm index 7a6d59a..e9cb94e 100644 --- a/bugfixes.asm +++ b/bugfixes.asm @@ -180,9 +180,19 @@ LDA.b IndoorsFlag : BNE + + RTL +PostFixMirrorGfxPrep: + LDA.b #$01 : STA.w OWTransitionFlag + JML HandleFollowersAfterMirroring ; what we wrote over + +; warning, this is called on frames after PostFixMirrorGfxPrep but for +; several frames after, so we use OWTransitionFlag to run something once PostFixMirrorGfx: - JSL HandleFollowersAfterMirroring - JML FollowerGfxRedraw + STA.w SubModuleInterface ; what we wrote over + LDA.w OWTransitionFlag : CMP.b #$01 : BNE .done + LDA.b #$08 : STA.w OWTransitionFlag + JML FollowerGfxRedraw +.done + RTL PostFixOAMGfx: JSL FollowerGfxRedraw diff --git a/hooks.asm b/hooks.asm index 253b607..ce4ffd7 100755 --- a/hooks.asm +++ b/hooks.asm @@ -411,7 +411,9 @@ JSL OnLoadDuckMap ; Fix Clobbered Gfx ;-------------------------------------------------------------------------------- org $80DB92 -JSL PostFixMirrorGfx +JSL PostFixMirrorGfxPrep +org $80D911 +JML PostFixMirrorGfx org $80E259 JSL PostFixOAMGfx : NOP From 2fa0bfc4ef8d1e61a998a3d182f79f42ef1ac522 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Mon, 1 Dec 2025 23:45:31 -0600 Subject: [PATCH 29/42] Fixed cucco storm to actually work on first trigger --- cuccostorm.asm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cuccostorm.asm b/cuccostorm.asm index d01f282..c05ad20 100644 --- a/cuccostorm.asm +++ b/cuccostorm.asm @@ -3,6 +3,7 @@ !INERT = $00 !INIT = $08 !ALIVE = $09 +!OAMPROPS = $09 !CUCCO_ENRAGED = $23 CuccoStorm: @@ -12,6 +13,7 @@ CuccoStorm: LDA.b GameMode : CMP.b #$09 : BNE + ; only if outdoors LDA.l LoopFrames : AND.b #$7F : BNE + ; check every 128 frames +.activate - ;==== Find a Cucco @@ -40,7 +42,11 @@ CuccoStorm: PLY CPY.b #$FF : BEQ + ; fail if no slots found LDA.b #!CUCCO : STA.w SpriteTypeTable, Y - LDA.b #!INIT : STA.w SpriteAITable, Y + LDA.b #!ALIVE : STA.w SpriteAITable, Y + PHX + TYX : JSL ResetSpriteProperties + PLX + LDA.b #!OAMPROPS : STA.w SpriteOAMProperties, Y LDA.b LinkPosY : STA.w SpritePosYLow, Y LDA.b LinkPosY+1 : STA.w SpritePosYHigh, Y LDA.b LinkPosX : STA.w SpritePosXLow, Y From 4dd7bac4d6e370a7c5c3f27adc7027d68c233d09 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Mon, 1 Dec 2025 23:45:31 -0600 Subject: [PATCH 30/42] Fixed cucco storm to actually work on first trigger --- cuccostorm.asm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cuccostorm.asm b/cuccostorm.asm index d01f282..0ceba80 100644 --- a/cuccostorm.asm +++ b/cuccostorm.asm @@ -3,6 +3,7 @@ !INERT = $00 !INIT = $08 !ALIVE = $09 +!OAMPROPS = $09 !CUCCO_ENRAGED = $23 CuccoStorm: @@ -12,6 +13,7 @@ CuccoStorm: LDA.b GameMode : CMP.b #$09 : BNE + ; only if outdoors LDA.l LoopFrames : AND.b #$7F : BNE + ; check every 128 frames +.activate - ;==== Find a Cucco @@ -40,7 +42,11 @@ CuccoStorm: PLY CPY.b #$FF : BEQ + ; fail if no slots found LDA.b #!CUCCO : STA.w SpriteTypeTable, Y - LDA.b #!INIT : STA.w SpriteAITable, Y + LDA.b #!ALIVE : STA.w SpriteAITable, Y + PHX + TYX : JSL ResetSpriteProperties + PLX + LDA.b #!OAMPROPS : STA.w SpriteOAMProp, Y LDA.b LinkPosY : STA.w SpritePosYLow, Y LDA.b LinkPosY+1 : STA.w SpritePosYHigh, Y LDA.b LinkPosX : STA.w SpritePosXLow, Y From 68c511d6beb5cc92e94f12406c321568790ab3a5 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 2 Dec 2025 08:26:33 -0700 Subject: [PATCH 31/42] fix: skip map check based on "compass" mode --- doorrando/hudadditions.asm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 15b756a..6941477 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -70,15 +70,16 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX DRHUD_DrawKeyCounter: LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished + LDA.l CompassMode : BIT.w #$03 : BEQ DRHUD_Finished REP #$20 - LDA.l FreeItemText : BIT.w #$0040 : BEQ .skip_map_check + BIT.w #$0002 : BEQ .skip_map_check LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished .skip_map_check TXA : LSR : BNE .dungeon_id INC .dungeon_id TAX - LDA.l GenericKeys : AND.w #$00FF : BNE .total_only + LDA.l GenericKeys : LSR : BCS .total_only LDA.w DungeonAllCollectedKeys-1, X : JSR ConvertToDisplay : STA.w HUDKeysObtained LDA.w #!SlashTile : STA.w HUDKeysSlash .total_only @@ -146,8 +147,8 @@ DrHudDungeonItemsAdditions: jsr ConvertToDisplay2 : sta.w $1644, y + iny #2 : lda.w #$24f5 : sta.w $1644, y phx : ldx.b Scrap00 - LDA.l FreeItemText : BIT.w #$0040 : BEQ .skip_map_check - LDA.l MapField : AND.l DungeonMask, x : BEQ .key_info_done ; must have map, if shuffled + LDA.l CompassMode : BIT.w #$0002 : BEQ .skip_map_check + LDA.l MapField : AND.l DungeonMask, x : BEQ .key_info_done ; must have map .skip_map_check plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 lda.l GenericKeys : bne +++ From 761365927f847a0d5729ba15087bac3d7bb553e2 Mon Sep 17 00:00:00 2001 From: KrisDavie Date: Sat, 29 Nov 2025 15:34:23 +0100 Subject: [PATCH 32/42] Prevent prizes dropping in dungeons where they shouldn't (including cave state) and fix rain state items/tablets. --- dungeondrops.asm | 14 ++++++++++++++ heartpieces.asm | 6 ++++++ tablets.asm | 15 ++++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/dungeondrops.asm b/dungeondrops.asm index 2a7a2ef..68ff32e 100644 --- a/dungeondrops.asm +++ b/dungeondrops.asm @@ -3,6 +3,16 @@ ;-------------------------------------------------------------------------------- SpawnDungeonPrize: PHX : PHB + + PHA + ; Don't spawn prize in Cave state, Hyrule Castle, Escape, Castle Tower, or Ganon's Tower + LDA.w DungeonID : BMI .skip_prize_drop ; Cave state + CMP.b #$00 : BEQ .skip_prize_drop ; Escape + CMP.b #$02 : BEQ .skip_prize_drop ; Hyrule Castle + CMP.b #$1A : BEQ .skip_prize_drop ; Ganon's Tower + CMP.b #$08 : BEQ .skip_prize_drop ; Agahnim's Tower (Castle Tower) + PLA + TAX LDA.b $06,S : STA.b ScrapBuffer72 ; Store current RoomTag index TXA @@ -24,6 +34,10 @@ SpawnDungeonPrize: PLB : PLX RTL +.skip_prize_drop: + PLA : PLB : PLX +RTL + AddDungeonPrizeAncilla: LDY.w ItemReceiptID STZ.w AncillaVelocityY,X diff --git a/heartpieces.asm b/heartpieces.asm index 5509e67..c5f8c08 100644 --- a/heartpieces.asm +++ b/heartpieces.asm @@ -246,6 +246,12 @@ LoadOutdoorValue: PHP REP #$20 ; set 16-bit accumulator LDA.b OverworldIndex + ; Rain state fix: In rain state DW, use LW screen ID for item lookup + BIT.w #$0040 : BEQ + + LDA.l ProgressIndicator : AND.w #$00FF : CMP.w #$0002 + LDA.b OverworldIndex : BCS ++ : AND.w #$00BF + ++ + + CMP.w #$03 : BNE + LDA.b LinkPosX : CMP.w #1890 : !BLT ++ %GetPossiblyEncryptedItem(HeartPiece_Spectacle, HeartPieceOutdoorValues) diff --git a/tablets.asm b/tablets.asm index 50801a0..09bbe13 100644 --- a/tablets.asm +++ b/tablets.asm @@ -19,7 +19,14 @@ RTL ;-------------------------------------------------------------------------------- SetTabletItemFlag: PHA - LDA.b OverworldIndex : CMP.b #$03 : BEQ .ether ; if we're on the map where ether is, we're the ether tablet + ; Rain state fix: convert DW screen ID to LW if in rain state + LDA.b OverworldIndex + BIT.b #$40 : BEQ + + LDA.l ProgressIndicator : CMP.b #$02 + LDA.b OverworldIndex : BCS ++ : AND.b #$BF + ++ + + + CMP.b #$03 : BEQ .ether ; if we're on the map where ether is, we're the ether tablet .bombos JSR ItemSet_BombosTablet : BRA .done .ether @@ -71,6 +78,12 @@ RTL IsMedallion: REP #$20 ; set 16-bit accumulator LDA.b OverworldIndex + ; Rain state fix: In rain state DW, use LW screen ID for tablet lookup + BIT.w #$0040 : BEQ + + LDA.l ProgressIndicator : AND.w #$00FF : CMP.w #$0002 + LDA.b OverworldIndex : BCS ++ : AND.w #$00BF + ++ + + CMP.w #$03 : BNE + ; Death Mountain LDA.b LinkPosX : CMP.w #1890 : !BGE ++ SEC From b583cc58ff99a6776e858840b63e4068ab0d5084 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 2 Dec 2025 11:09:37 -0700 Subject: [PATCH 33/42] fix: not sure what I was thinking - fix branches and width --- doorrando/hudadditions.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 6941477..b43848f 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -70,9 +70,9 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX DRHUD_DrawKeyCounter: LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished - LDA.l CompassMode : BIT.w #$03 : BEQ DRHUD_Finished + LDA.l CompassMode : BIT.b #$03 : BEQ DRHUD_Finished REP #$20 - BIT.w #$0002 : BEQ .skip_map_check + BIT.w #$0002 : BNE .skip_map_check LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished .skip_map_check TXA : LSR : BNE .dungeon_id @@ -147,7 +147,7 @@ DrHudDungeonItemsAdditions: jsr ConvertToDisplay2 : sta.w $1644, y + iny #2 : lda.w #$24f5 : sta.w $1644, y phx : ldx.b Scrap00 - LDA.l CompassMode : BIT.w #$0002 : BEQ .skip_map_check + LDA.l CompassMode : BIT.w #$0002 : BNE .skip_map_check LDA.l MapField : AND.l DungeonMask, x : BEQ .key_info_done ; must have map .skip_map_check plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 From dfe49a11c49d9ab3edd0c99b3c9b2b1cfddf541e Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 3 Dec 2025 10:09:50 -0600 Subject: [PATCH 34/42] Merged in DR v1.5.0 --- doorrando/hudadditions.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 0f076b3..0643d55 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -55,7 +55,7 @@ DRHUD_EnemyDropIndicator: REP #$30 LDA.w EnemyDropIndicator : STA.w HUDMultiIndicator SEP #$20 - LDA.w DungeonID : CMP.b #$1B : BCS DRHUD_Finished + LDA.w DungeonID : CMP.b #$1B : BCC + : JMP DRHUD_Finished : + SEP #$10 : TAX : REP #$10 DRHUD_DrawCurrentDungeonIndicator: ; mX From 4f4f4836477b4f24c33024691ddaa6a46aed27c4 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 3 Dec 2025 10:10:14 -0600 Subject: [PATCH 35/42] Completed Rain State fixes for Bonk Drops --- owrando.asm | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/owrando.asm b/owrando.asm index 2e738c6..fbe6fe9 100644 --- a/owrando.asm +++ b/owrando.asm @@ -613,7 +613,13 @@ OWBonkDrops: LDA.w $0400 : ORA.b 1,S : STA.w $0400 BRA .increment_collection ++ - LDX.b OverworldIndex : LDA.l OverworldEventDataWRAM,X : ORA.b 1,S : STA.l OverworldEventDataWRAM,X + LDA.b OverworldIndex + BIT.b #$40 : BEQ + + LDA.l ProgressIndicator : CMP.b #$02 + LDA.b OverworldIndex : BCS ++ : AND.b #$BF + ++ + + + TAX : LDA.l OverworldEventDataWRAM,X : ORA.b 1,S : STA.l OverworldEventDataWRAM,X .increment_collection REP #$20 @@ -673,13 +679,19 @@ OWBonkDropLookup: { ; loop thru rando bonk table to find match LDA.b OverworldIndex + BIT.b #$40 : BEQ + + LDA.l ProgressIndicator : AND.b #$FF : CMP.b #$02 + LDA.b OverworldIndex : BCS ++ : AND.b #$BF + ++ + + LDX.b #((UWBonkPrizeData-OWBonkPrizeData)-sizeof(OWBonkPrizeTable)) ; 41 bonk items, 6 bytes each - CMP.w OWBonkPrizeData,X : BNE + INX + PHA LDA.w SpritePosXLow,Y : LSR A : LSR A : LSR A : LSR A EOR.w SpritePosYLow,Y : CMP.w OWBonkPrizeData,X : BNE ++ ; X = row + 1 SEC : RTS - ++ DEX : LDA.b OverworldIndex + ++ DEX : PLA + CPX.b #$00 : BNE + CLC : RTS + DEX : DEX : DEX : DEX : DEX : DEX : BRA - @@ -694,7 +706,14 @@ OWBonkDropCollected: LDA.l RoomDataWRAM[$0120].high : AND.b 3,S : BEQ .return ; S = Collected, FlagBitmask, X (row + 2) SEC : RTS + - LDX.b OverworldIndex : LDA.l OverworldEventDataWRAM,X : AND.b 3,S : BEQ .return ; S = Collected, FlagBitmask, X (row + 2) + LDA.b OverworldIndex + BIT.b #$40 : BEQ + + LDA.l ProgressIndicator : CMP.b #$02 + LDA.b OverworldIndex : BCS ++ : AND.b #$BF + ++ + + + TAX + LDA.l OverworldEventDataWRAM,X : AND.b 3,S : BEQ .return ; S = Collected, FlagBitmask, X (row + 2) SEC : RTS .return From 96333b22a25f71530dc3e01e12ed1ca4f2928479 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 3 Dec 2025 10:11:47 -0600 Subject: [PATCH 36/42] Fixed cucco storm to actually work on first trigger --- vanillalabels.asm | 1 + 1 file changed, 1 insertion(+) diff --git a/vanillalabels.asm b/vanillalabels.asm index 801b21a..8ee4842 100644 --- a/vanillalabels.asm +++ b/vanillalabels.asm @@ -137,6 +137,7 @@ InitializeSaveFile = $8CDB3E InitializeSaveFile_build_checksum = $8CDBC0 InitializeSaveFile_checksum_done = $8CDBDB SpritePrep_LoadProperties = $8DB818 +ResetSpriteProperties = $8DB871 GetRandomInt = $8DBA71 OAM_AllocateFromRegionA = $8DBA80 OAM_AllocateFromRegionB = $8DBA84 From 1242198beaa10d48ac36e028c86de99148307ddd Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 3 Dec 2025 10:53:43 -0600 Subject: [PATCH 37/42] Merged in DR v1.5.0 --- enemizer/hooks/moldorm_hooks.asm | 7 ------- enemy_adjustments.asm | 12 ------------ 2 files changed, 19 deletions(-) diff --git a/enemizer/hooks/moldorm_hooks.asm b/enemizer/hooks/moldorm_hooks.asm index e969716..44cf8f7 100644 --- a/enemizer/hooks/moldorm_hooks.asm +++ b/enemizer/hooks/moldorm_hooks.asm @@ -18,10 +18,3 @@ org $9DD88E ;0EDBB2 0EDBB3 ; LDX.b #$01 ;} - -org $85B8BA ; geldman -JSL Sprite_MaybeForceDrawShadow -org $9EAAAC ; stalfos knight -JSL Sprite_MaybeForceDrawShadow -org $9EB209 ; blob -JSL Sprite_MaybeForceDrawShadow diff --git a/enemy_adjustments.asm b/enemy_adjustments.asm index e7b8b10..f126791 100644 --- a/enemy_adjustments.asm +++ b/enemy_adjustments.asm @@ -25,15 +25,3 @@ NewFireBarDamage: RTL .NotSameLayer RTL -;-------------------------------------------------------------------------------- -Sprite_MaybeForceDrawShadow: - JSL Sprite_PrepOAMCoordLong - LDA.l DRFlags+1 : AND.b #$08 : BEQ .return - LDA.b GameMode : CMP.b #$07 : BNE .return - JSL Sprite_DrawShadowLong - ; LDA.w SpriteTypeTable,X : CMP.b #$91 : BNE .return ; stalfos knight - ; ; move shadow down by 8 pixels - ; + LDA.w SpriteOAMProperties,X : AND.b #$1F : ASL #2 : TAY : INY ; get OAM offset - ; LDA.b (OAMPtr),Y : CLC : ADC.b #$08 : STA.b (OAMPtr),Y -.return -RTL From a277fb12ac03b37a866720c9d0497f098782b5b2 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Thu, 4 Dec 2025 12:39:19 -0600 Subject: [PATCH 38/42] Completed Rain State fixes for Bonk Drops --- owrando.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owrando.asm b/owrando.asm index fbe6fe9..b453c5f 100644 --- a/owrando.asm +++ b/owrando.asm @@ -690,7 +690,7 @@ OWBonkDropLookup: PHA LDA.w SpritePosXLow,Y : LSR A : LSR A : LSR A : LSR A EOR.w SpritePosYLow,Y : CMP.w OWBonkPrizeData,X : BNE ++ ; X = row + 1 - SEC : RTS + PLA : SEC : RTS ++ DEX : PLA + CPX.b #$00 : BNE + CLC : RTS From fca7f214bc60511c60b9b817e93b2e925114c9e7 Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 4 Dec 2025 15:37:02 -0700 Subject: [PATCH 39/42] fix: key counts for pot keys and normal absorbed keys --- doorrando/hudadditions.asm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index b43848f..7bb9c89 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -251,12 +251,18 @@ ConvertToDisplay2: ++ lda.w #$2827 : rts ; 0/O for 0 or placeholder digit ;2483 CountAbsorbedKeys: - CPY.b #$24 : BNE .done PHA : PHX - LDA.b #$84 : TAX ; pretend this isn't a smallkey, but an absorbed object (small heart) + LDA.l StandingItemsOn : BEQ .count_it + CPY.b #$24 : BEQ .count_it ; small key for this dungeon + LDA.w DungeonID : LSR : TAX + TYA : CMP.l KeyTable, X : BNE .done +.count_it + STY.b Scrap02 : LDY.b #$24 ; for non-24 items (w/o standing_items a small key is just $C), fake it + LDX.b #$84 ; pretend this isn't a smallkey, but an absorbed object (small heart) REP #$10 : JSL CountAllKey : SEP #$10 - PLX : PLA + LDY.b Scrap02 .done + PLX : PLA JML IncrementSmallKeysNoPrimary ;================================================================================ From 4437194cfe1c0cdd05b457294c67e0f4a9ff5a24 Mon Sep 17 00:00:00 2001 From: aerinon Date: Mon, 8 Dec 2025 16:37:51 -0700 Subject: [PATCH 40/42] fix: key counts again --- doorrando/hudadditions.asm | 2 ++ inventory.asm | 1 - keydrop/standing_items.asm | 1 + ram.asm | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 7bb9c89..ef53fa6 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -253,6 +253,7 @@ ConvertToDisplay2: CountAbsorbedKeys: PHA : PHX LDA.l StandingItemsOn : BEQ .count_it + LDA.w SpawnedItemKeyCounted : BNE .done CPY.b #$24 : BEQ .count_it ; small key for this dungeon LDA.w DungeonID : LSR : TAX TYA : CMP.l KeyTable, X : BNE .done @@ -262,6 +263,7 @@ CountAbsorbedKeys: REP #$10 : JSL CountAllKey : SEP #$10 LDY.b Scrap02 .done + STZ.w SpawnedItemKeyCounted ; reset to zero for next time PLX : PLA JML IncrementSmallKeysNoPrimary diff --git a/inventory.asm b/inventory.asm index 61856af..7438cbb 100644 --- a/inventory.asm +++ b/inventory.asm @@ -220,7 +220,6 @@ DungeonIncrement: REP #$10 PHX LDA.w InventoryTable_properties,X : BIT.b #$40 : BEQ + - CPY.w #$0024 : BEQ + ; keys for this dungeon are done elsewhere JSL CountAllKey + LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .done diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index 406e4c5..ff29efe 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -688,6 +688,7 @@ KeyGet: LDA.b Scrap00 : CMP.l KeyTable, X : BNE + .countIt LDA.l StandingItemCounterMask : AND SpawnedItemFlag : BEQ ++ + STA.w SpawnedItemKeyCounted JSL AddInventory ++ PLX : PLA : RTL + CMP.b #$AF : beq .countIt ; universal key diff --git a/ram.asm b/ram.asm index 693fe5b..c3ca8dd 100644 --- a/ram.asm +++ b/ram.asm @@ -313,6 +313,7 @@ SpawnedItemFlag = $7E0726 ; 0x02 - one for pot, 2 for sprite drop SpawnedItemMWPlayer = $7E0728 ; Player Id for spawned item if Multiworld item 0x02 ; EnemyDropIndicator = $7E072A ; Used by HUD to indicate enemy drops remaining +SpawnedItemKeyCounted = $7E072C ; If set, the spawned item has been counted towards dungeon key total SprDropsItem = $7E0730 ; Array for whether a sprite drops an item 0x16 SprItemReceipt = $7E0740 ; Array for item id for each sprite 0x16 @@ -874,6 +875,7 @@ endmacro %assertRAM(SpawnedItemFlag, $7E0726) %assertRAM(SpawnedItemMWPlayer, $7E0728) %assertRAM(EnemyDropIndicator, $7E072A) +%assertRAM(SpawnedItemKeyCounted, $7E072C) %assertRAM(SprDropsItem, $7E0730) %assertRAM(SprItemReceipt, $7E0740) %assertRAM(SprItemIndex, $7E0750) From 5b7a4c11ede717b88c9d1ad07e402c4d195864e4 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Mon, 8 Dec 2025 20:40:39 -0600 Subject: [PATCH 41/42] Fixed issue with bonk drops not showing sparkles in DW --- owrando.asm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/owrando.asm b/owrando.asm index b453c5f..21319dc 100644 --- a/owrando.asm +++ b/owrando.asm @@ -701,7 +701,6 @@ OWBonkDropLookup: OWBonkDropCollected: { ; check if collected - CLC LDA.b IndoorsFlag : BEQ + LDA.l RoomDataWRAM[$0120].high : AND.b 3,S : BEQ .return ; S = Collected, FlagBitmask, X (row + 2) SEC : RTS @@ -717,7 +716,7 @@ OWBonkDropCollected: SEC : RTS .return - RTS + CLC : RTS } ; A = SprItemReceipt, Y = Sprite Slot Index, X = free/overwritten From ac7f50fc62ba03c6506c9b6511f17f08854d00dc Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 9 Dec 2025 14:43:47 -0700 Subject: [PATCH 42/42] fix: revert to old way --- doorrando/hudadditions.asm | 12 ++++++++---- inventory.asm | 2 +- keydrop/standing_items.asm | 1 - ram.asm | 2 -- stats.asm | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 8 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index ef53fa6..d4cd84f 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -80,10 +80,10 @@ DRHUD_DrawKeyCounter: .dungeon_id TAX LDA.l GenericKeys : LSR : BCS .total_only - LDA.w DungeonAllCollectedKeys-1, X : JSR ConvertToDisplay : STA.w HUDKeysObtained + LDA.w DungeonCollectedKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained LDA.w #!SlashTile : STA.w HUDKeysSlash .total_only - LDA.l TotalKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal + LDA.l ChestKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal DRHUD_Finished: PLB : RTL @@ -251,9 +251,13 @@ ConvertToDisplay2: ++ lda.w #$2827 : rts ; 0/O for 0 or placeholder digit ;2483 CountAbsorbedKeys: + JML IncrementSmallKeysNoPrimary + +; This function apporach doesn't currently work +CountAbsorbedKeysViaCountAllKey: PHA : PHX LDA.l StandingItemsOn : BEQ .count_it - LDA.w SpawnedItemKeyCounted : BNE .done +; LDA.w SpawnedItemKeyCounted : BNE .done ; this was added because pot keys were being double counted when they weren't shuffled CPY.b #$24 : BEQ .count_it ; small key for this dungeon LDA.w DungeonID : LSR : TAX TYA : CMP.l KeyTable, X : BNE .done @@ -263,7 +267,7 @@ CountAbsorbedKeys: REP #$10 : JSL CountAllKey : SEP #$10 LDY.b Scrap02 .done - STZ.w SpawnedItemKeyCounted ; reset to zero for next time +; STZ.w SpawnedItemKeyCounted ; reset to zero for next time PLX : PLA JML IncrementSmallKeysNoPrimary diff --git a/inventory.asm b/inventory.asm index 7438cbb..e86eebb 100644 --- a/inventory.asm +++ b/inventory.asm @@ -220,7 +220,7 @@ DungeonIncrement: REP #$10 PHX LDA.w InventoryTable_properties,X : BIT.b #$40 : BEQ + - JSL CountAllKey + JSL CountChestKeyLong + LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .done SEP #$10 diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index ff29efe..406e4c5 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -688,7 +688,6 @@ KeyGet: LDA.b Scrap00 : CMP.l KeyTable, X : BNE + .countIt LDA.l StandingItemCounterMask : AND SpawnedItemFlag : BEQ ++ - STA.w SpawnedItemKeyCounted JSL AddInventory ++ PLX : PLA : RTL + CMP.b #$AF : beq .countIt ; universal key diff --git a/ram.asm b/ram.asm index c3ca8dd..693fe5b 100644 --- a/ram.asm +++ b/ram.asm @@ -313,7 +313,6 @@ SpawnedItemFlag = $7E0726 ; 0x02 - one for pot, 2 for sprite drop SpawnedItemMWPlayer = $7E0728 ; Player Id for spawned item if Multiworld item 0x02 ; EnemyDropIndicator = $7E072A ; Used by HUD to indicate enemy drops remaining -SpawnedItemKeyCounted = $7E072C ; If set, the spawned item has been counted towards dungeon key total SprDropsItem = $7E0730 ; Array for whether a sprite drops an item 0x16 SprItemReceipt = $7E0740 ; Array for item id for each sprite 0x16 @@ -875,7 +874,6 @@ endmacro %assertRAM(SpawnedItemFlag, $7E0726) %assertRAM(SpawnedItemMWPlayer, $7E0728) %assertRAM(EnemyDropIndicator, $7E072A) -%assertRAM(SpawnedItemKeyCounted, $7E072C) %assertRAM(SprDropsItem, $7E0730) %assertRAM(SprItemReceipt, $7E0740) %assertRAM(SprItemIndex, $7E0750) diff --git a/stats.asm b/stats.asm index 04c7bd1..9fb4425 100644 --- a/stats.asm +++ b/stats.asm @@ -118,7 +118,41 @@ RTL ;-------------------------------------------------------------------------------- +CountChestKeyLong: + PHX : PHP + SEP #$30 + JSR CountChestKey + PLP : PLX + RTL +;-------------------------------------------------------------------------------- + +CountChestKey: + PHA : PHX + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .done + LDA.l StatsLocked : BNE .done + CPY.b #$24 : BEQ .this_dungeon + TYA + AND.b #$0F : CMP.b #$02 : BCC .hc_sewers + TAX + LDA.l DungeonCollectedKeys,X : INC : STA.l DungeonCollectedKeys,X + BRA .done + +.this_dungeon + LDA.w DungeonID : CMP.b #$03 : BCC .hc_sewers + LSR : TAX + LDA.l DungeonCollectedKeys,X : INC : STA.l DungeonCollectedKeys,X + BRA .done + +.hc_sewers + LDA.l SewerCollectedKeys : INC + STA.l SewerCollectedKeys : STA.l HCCollectedKeys + +.done + PLX : PLA + RTS + ; Expects 16 bit index mode upon entering. 8-bit Acumulator +; This approach doesn't currently work - potentially dead code CountAllKey: PHP : PHA : PHX SEP #$10