From 1cbcd1d5ff58056302c29c0c41c6c1dc64698382 Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Fri, 25 Aug 2023 01:38:32 -0400 Subject: [PATCH 1/8] Sprite fixes --- bookofmudora.asm | 10 +++++++++- custompalettes.asm | 2 +- events.asm | 36 ++++++++++++++++++++---------------- itemdatatables.asm | 6 +++--- newitems.asm | 22 ++++++++++++++++------ shopkeeper.asm | 23 ++++++++++++----------- utilities.asm | 36 ++++++++++++++++++++++++++++-------- 7 files changed, 89 insertions(+), 46 deletions(-) diff --git a/bookofmudora.asm b/bookofmudora.asm index 4f7d0c6..55c048a 100644 --- a/bookofmudora.asm +++ b/bookofmudora.asm @@ -30,9 +30,17 @@ LoadBonkItemGFX: LoadBonkItemGFX_inner: LDA.b #$00 : STA.l RedrawFlag JSR LoadBonkItem + JSL.l ResolveLootIDLong STA.w SpriteItemType, X STA.w SpriteID, X JSL.l PrepDynamicTile + PHA : PHX + LDA.w SpriteID,X : TAX + LDA.l SpriteProperties_standing_width,X : BNE + + LDA.b #$00 : STA.l SpriteOAM ; Move narrow items back to the left + LDA.b #$00 : STA.l SpriteOAM+8 ; + + + PLX : PLA RTL ;-------------------------------------------------------------------------------- DrawBonkItemGFX: @@ -42,7 +50,7 @@ DrawBonkItemGFX: BRA .done ; don't draw on the init frame .skipInit - JSR LoadBonkItem + LDA.w SpriteID,X JSL.l DrawDynamicTileNoShadow .done diff --git a/custompalettes.asm b/custompalettes.asm index 17a9cc4..cbe705a 100644 --- a/custompalettes.asm +++ b/custompalettes.asm @@ -10,7 +10,7 @@ dw $0000, $7FFF, $27FF, $5E2D, $7FFF, $1CE7, $7A10, $64A5 .red_shield dw $0000, $7FFF, $27FF, $5E2D, $4F5F, $1CE7, $2E9C, $14B6 .mirror_shield -dw $0000, $7FFF, $27FF, $5E2D, $7399, $1CE7, $02F9, $0233 +dw $0000, $7E4E, $6F44, $1CF5, $7399, $1CE7, $02F9, $0233 .crystal dw $7FFF, $7FFF, $0000, $5907, $6E0E, $0000, $7FBB, $7672 .off_black diff --git a/events.asm b/events.asm index 2978ea7..15ae511 100644 --- a/events.asm +++ b/events.asm @@ -236,6 +236,7 @@ PostItemGet: RTL ;-------------------------------------------------------------------------------- PostItemAnimation: + PHB LDA.b #$00 : STA.l BusyItem ; mark item as finished LDA.l TextBoxDefer : BEQ + STZ.w TextID : STZ.w TextID+1 ; reset decompression buffer @@ -247,29 +248,32 @@ PostItemAnimation: JSL.l IncrementChestTurnCounter + REP #$20 + PEA.w $7E00 + PLB : PLB LDA.w TransparencyFlag : BNE .SP05 - LDA.l PalettesCustom_off_black+$00 : STA.l PaletteBuffer+$0170 - LDA.l PalettesCustom_off_black+$02 : STA.l PaletteBuffer+$0172 - LDA.l PalettesCustom_off_black+$04 : STA.l PaletteBuffer+$0174 - LDA.l PalettesCustom_off_black+$06 : STA.l PaletteBuffer+$0176 - LDA.l PalettesCustom_off_black+$08 : STA.l PaletteBuffer+$0178 - LDA.l PalettesCustom_off_black+$0A : STA.l PaletteBuffer+$017A - LDA.l PalettesCustom_off_black+$0C : STA.l PaletteBuffer+$017C - LDA.l PalettesCustom_off_black+$0E : STA.l PaletteBuffer+$017E + LDA.l PalettesCustom_off_black+$00 : STA.w PaletteBuffer+$0170 : STA.w PaletteBufferAux+$0170 + LDA.l PalettesCustom_off_black+$02 : STA.w PaletteBuffer+$0172 : STA.w PaletteBufferAux+$0172 + STA.w PaletteBuffer+$0174 : STA.w PaletteBufferAux+$0174 + STA.w PaletteBuffer+$0176 : STA.w PaletteBufferAux+$0176 + STA.w PaletteBuffer+$0178 : STA.w PaletteBufferAux+$0178 + STA.w PaletteBuffer+$017A : STA.w PaletteBufferAux+$017A + STA.w PaletteBuffer+$017C : STA.w PaletteBufferAux+$017C + STA.w PaletteBuffer+$017E : STA.w PaletteBufferAux+$017E BRA .done .SP05 - LDA.l PalettesCustom_off_black+$00 : STA.l PaletteBuffer+$01B0 - LDA.l PalettesCustom_off_black+$02 : STA.l PaletteBuffer+$01B2 - LDA.l PalettesCustom_off_black+$04 : STA.l PaletteBuffer+$01B4 - LDA.l PalettesCustom_off_black+$06 : STA.l PaletteBuffer+$01B6 - LDA.l PalettesCustom_off_black+$08 : STA.l PaletteBuffer+$01B8 - LDA.l PalettesCustom_off_black+$0A : STA.l PaletteBuffer+$01BA - LDA.l PalettesCustom_off_black+$0C : STA.l PaletteBuffer+$01BC - LDA.l PalettesCustom_off_black+$0E : STA.l PaletteBuffer+$01BE + LDA.l PalettesCustom_off_black+$00 : STA.w PaletteBuffer+$01B0 : STA.w PaletteBufferAux+$01B0 + LDA.l PalettesCustom_off_black+$02 : STA.w PaletteBuffer+$01B2 : STA.w PaletteBufferAux+$01B2 + STA.w PaletteBuffer+$01B4 : STA.w PaletteBufferAux+$01B4 + STA.w PaletteBuffer+$01B6 : STA.w PaletteBufferAux+$01B6 + STA.w PaletteBuffer+$01B8 : STA.w PaletteBufferAux+$01B8 + STA.w PaletteBuffer+$01BA : STA.w PaletteBufferAux+$01BA + STA.w PaletteBuffer+$01BC : STA.w PaletteBufferAux+$01BC + STA.w PaletteBuffer+$01BE : STA.w PaletteBufferAux+$01BE .done INC.b NMICGRAM SEP #$20 STZ.w ItemReceiptMethod : LDA.w AncillaGet, X ; thing we wrote over to get here + PLB RTL ;-------------------------------------------------------------------------------- diff --git a/itemdatatables.asm b/itemdatatables.asm index 743def2..faa81a2 100644 --- a/itemdatatables.asm +++ b/itemdatatables.asm @@ -183,9 +183,9 @@ endmacro %ReceiptProps($2B, -4, 0, $1E, $F35C, $FF, skip, bottles) ; 2B - Full bottle (red) %ReceiptProps($2C, -4, 0, $1E, $F35C, $FF, skip, bottles) ; 2C - Full bottle (green) %ReceiptProps($2D, -4, 0, $1E, $F35C, $FF, skip, bottles) ; 2D - Full bottle (blue) -%ReceiptProps($2E, -4, 0, $1E, $F36D, $FF, skip, bottles) ; 2E - Potion refill (red) -%ReceiptProps($2F, -4, 0, $1E, $F36E, $FF, skip, bottles) ; 2F - Potion refill (green) -%ReceiptProps($30, -4, 0, $1E, $F36E, $FF, skip, bottles) ; 30 - Potion refill (blue) +%ReceiptProps($2E, -4, 0, $1E, $F36D, $FF, skip, skip) ; 2E - Potion refill (red) +%ReceiptProps($2F, -4, 0, $1E, $F36E, $FF, skip, skip) ; 2F - Potion refill (green) +%ReceiptProps($30, -4, 0, $1E, $F36E, $FF, skip, skip) ; 30 - Potion refill (blue) %ReceiptProps($31, -4, 0, $30, $F375, $FF, skip, skip) ; 31 - 10 bombs %ReceiptProps($32, -4, 0, $22, $F366, $FF, dungeon_bigkey, skip) ; 32 - Big key %ReceiptProps($33, -4, 0, $21, $F368, $FF, dungeon_map, skip) ; 33 - Map diff --git a/newitems.asm b/newitems.asm index 1c77e86..9f31197 100644 --- a/newitems.asm +++ b/newitems.asm @@ -626,7 +626,12 @@ ItemBehavior: .pendant SEP #$20 - LDA.l PendantCounter : INC : STA.l PendantCounter + LSR + SEC : SBC.b #$37 + TAX + LDA.w PendantMasks,X : AND.l PendantsField : BNE + + LDA.l PendantCounter : INC : STA.l PendantCounter + + RTS .dungeon_crystal @@ -645,9 +650,12 @@ ItemBehavior: DEX BPL - SEP #$20 - ORA.l CrystalsField : STA.l CrystalsField - LDA.l CrystalCounter : INC : STA.l CrystalCounter - + TAX + AND.l CrystalsField : BNE + + TXA + ORA.l CrystalsField : STA.l CrystalsField + LDA.l CrystalCounter : INC : STA.l CrystalCounter + + .done RTS @@ -657,7 +665,7 @@ ResolveReceipt: JSL.l PreItemGet LDA.w ItemReceiptID .get_item - JSR.w AttemptItemSubstitution + JSL.l AttemptItemSubstitution JSR.w HandleBowTracking JSR.w ResolveLootID .have_item @@ -1013,7 +1021,7 @@ AttemptItemSubstitution: BRA - .exit PLA : PLX -RTS +RTL ;-------------------------------------------------------------------------------- CountBottles: PHX @@ -1121,3 +1129,5 @@ dw $0004 ; EP dw $0002 ; HC dw $0000 ; Sewers +PendantMasks: +db $04, 01, 02 diff --git a/shopkeeper.asm b/shopkeeper.asm index b6cdd25..a609ade 100644 --- a/shopkeeper.asm +++ b/shopkeeper.asm @@ -129,17 +129,17 @@ SpritePrep_ShopKeeper: ++ PLY : +++ - PHX : PHY - PHX : TYX : LDA.l ShopInventory, X : PLX - SEP #$10 - JSL.l ResolveLootIDLong - TAY - REP #$30 - LDA.b 1,s : TAX : LDA.l .tile_offsets, X : TAX - JSR.w SetupTileTransfer - PLY : PLX - INY #4 - + PHX : PHY + PHX : TYX : LDA.l ShopInventory, X : PLX + SEP #$10 + JSL.l AttemptItemSubstitution + JSL.l ResolveLootIDLong + TAY + REP #$30 + LDA.b 1,s : TAX : LDA.l .tile_offsets, X : TAX + JSR.w SetupTileTransfer + PLY : PLX + INY #4 .next INX #8 JMP - @@ -561,6 +561,7 @@ Shopkeeper_DrawNextItem: PLY LDA.l ShopInventory, X ; get item id + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.b Scrap0D CMP.b #$2E : BNE + : BRA .potion diff --git a/utilities.asm b/utilities.asm index 380baa4..e4ce4ff 100644 --- a/utilities.asm +++ b/utilities.asm @@ -6,7 +6,7 @@ ; out: A - Sprite GFX ID ;-------------------------------------------------------------------------------- GetSpriteID: - JSR.w AttemptItemSubstitution + JSL.l AttemptItemSubstitution JSR.w ResolveLootID CMP.b #$6D : BEQ .server_F0 ; Server Request F0 CMP.b #$6E : BEQ .server_F1 ; Server Request F1 @@ -32,7 +32,7 @@ RTL ; out: A - Palette ;-------------------------------------------------------------------------------- GetSpritePalette: - JSR AttemptItemSubstitution + JSL.l AttemptItemSubstitution JSR.w ResolveLootID .resolved TAX @@ -359,23 +359,43 @@ LoadItemPalette: ; Out: A - Sprite palette index PHX : PHY : PHB LDA.b #PalettesVanillaBank>>16 : STA.b Scrap0C - LDA.b #$7E - PHA : PLB + PEA $7E00 + PLB : PLB REP #$30 TXA : ASL : TAX LDA.l SpriteProperties_palette_addr,X : STA.b Scrap0A LDY.w #$000E - LDA.w TransparencyFlag : BNE .SP05 + LDA.l FadeTimer : BNE .aux + LDA.w TransparencyFlag : BNE .SP05 + - + LDA.b [Scrap0A], Y + STA.w PaletteBuffer+$0170,Y + DEY #2 + BPL - + LDA.w #$0003 + BRA .done + .SP05 - - LDA.b [Scrap0A], Y : STA.w PaletteBuffer+$0170,Y + LDA.b [Scrap0A], Y + STA.w PaletteBuffer+$01B0,Y + DEY #2 + BPL - + LDA.w #$0005 + BRA .done + .aux + LDA.w TransparencyFlag : BNE .SP05_aux + - + LDA.b [Scrap0A], Y + STA.w PaletteBufferAux+$0170,Y DEY #2 BPL - LDA.w #$0003 BRA .done - .SP05 + .SP05_aux - - LDA.b [Scrap0A], Y : STA.w PaletteBuffer+$01B0,Y + LDA.b [Scrap0A], Y + STA.w PaletteBufferAux+$01B0,Y DEY #2 BPL - LDA.w #$0005 From 3f5455b6474a8ae45f8ad0388fc7f91dba067932 Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Fri, 25 Aug 2023 09:48:29 -0400 Subject: [PATCH 2/8] Fix key palettes Fix HUD item counter when releasing bee --- hooks.asm | 16 ++++++---------- itemdatatables.asm | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/hooks.asm b/hooks.asm index 23a5406..7c33c18 100644 --- a/hooks.asm +++ b/hooks.asm @@ -1408,19 +1408,15 @@ MVN $A17E org $8DFB1F : JSL CheckHUDSilverArrows org $8DFB29 : BRA UpdateHUDBuffer_update_item_check_arrows ;-------------------------------------------------------------------------------- -org $8DF1AB -JSR.w RebuildHUD_update -org $8DDFC8 -JSR.w RebuildHUD_update +org $8DF1AB : JSR.w RebuildHUD_update +org $8DDFC8 : JSR.w RebuildHUD_update org $8DDB88 ; Don't rebuild HUD twice on icon refresh NOP #3 ; Not sure why this is here ;-------------------------------------------------------------------------------- -org $87A205 -JSL.l RebuildHUD_update_long -org $8AEF62 -JSL.l RebuildHUD_update_long -org $87A1CF -JSL.l RebuildHUD_update_long +org $87A205 : JSL.l RebuildHUD_update_long +org $8AEF62 : JSL.l RebuildHUD_update_long +org $87A1CF : JSL.l RebuildHUD_update_long +org $87A235 : JSL.l RebuildHUD_update_long ;-------------------------------------------------------------------------------- org $8DFFE1 RebuildHUD_update_long: diff --git a/itemdatatables.asm b/itemdatatables.asm index faa81a2..97496f7 100644 --- a/itemdatatables.asm +++ b/itemdatatables.asm @@ -576,22 +576,22 @@ endmacro %SpriteProps($9D, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 9D - Big key of Eastern Palace %SpriteProps($9E, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 9E - Big key of Hyrule Castle %SpriteProps($9F, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 9F - Big key of Sewers -%SpriteProps($A0, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A0 - Small key of Sewers -%SpriteProps($A1, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A1 - Small key of Hyrule Castle -%SpriteProps($A2, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A2 - Small key of Eastern Palace -%SpriteProps($A3, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A3 - Small key of Desert Palace -%SpriteProps($A4, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A4 - Small key of Agahnim's Tower -%SpriteProps($A5, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A5 - Small key of Swamp Palace -%SpriteProps($A6, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A6 - Small key of Dark Palace -%SpriteProps($A7, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A7 - Small key of Misery Mire -%SpriteProps($A8, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A8 - Small key of Skull Woods -%SpriteProps($A9, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A9 - Small key of Ice Palace -%SpriteProps($AA, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AA - Small key of Tower of Hera -%SpriteProps($AB, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AB - Small key of Thieves' Town -%SpriteProps($AC, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AC - Small key of Turtle Rock -%SpriteProps($AD, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AD - Small key of Ganon's Tower -%SpriteProps($AE, 2, 2, $04, $04, $0000) ; AE - Reserved -%SpriteProps($AF, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AF - Generic small key +%SpriteProps($A0, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A0 - Small key of Sewers +%SpriteProps($A1, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A1 - Small key of Hyrule Castle +%SpriteProps($A2, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A2 - Small key of Eastern Palace +%SpriteProps($A3, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A3 - Small key of Desert Palace +%SpriteProps($A4, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A4 - Small key of Agahnim's Tower +%SpriteProps($A5, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A5 - Small key of Swamp Palace +%SpriteProps($A6, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A6 - Small key of Dark Palace +%SpriteProps($A7, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A7 - Small key of Misery Mire +%SpriteProps($A8, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A8 - Small key of Skull Woods +%SpriteProps($A9, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A9 - Small key of Ice Palace +%SpriteProps($AA, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; AA - Small key of Tower of Hera +%SpriteProps($AB, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; AB - Small key of Thieves' Town +%SpriteProps($AC, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; AC - Small key of Turtle Rock +%SpriteProps($AD, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; AD - Small key of Ganon's Tower +%SpriteProps($AE, 2, 2, $02, $02, $0000) ; AE - Reserved +%SpriteProps($AF, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; AF - Generic small key %SpriteProps($B0, 2, 2, $80, $80, PalettesCustom_crystal) ; B0 - Crystal 6 %SpriteProps($B1, 2, 2, $80, $80, PalettesCustom_crystal) ; B1 - Crystal 1 %SpriteProps($B2, 2, 2, $80, $80, PalettesCustom_crystal) ; B2 - Crystal 5 From 5ac2f8c537855b36a3ff5d0e14318894fee95fe6 Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Fri, 25 Aug 2023 12:29:52 -0400 Subject: [PATCH 3/8] Fix GFX transfer, use stack Fix HUD arrow icon after buying shop arrow --- framehook.asm | 12 ++++++++---- itemdatatables.asm | 2 +- newitems.asm | 5 ++++- ram.asm | 12 +++++++----- shopkeeper.asm | 28 +++++++++++----------------- 5 files changed, 31 insertions(+), 28 deletions(-) diff --git a/framehook.asm b/framehook.asm index 6f5b374..d52c636 100644 --- a/framehook.asm +++ b/framehook.asm @@ -44,10 +44,12 @@ TransferItemGFX: ; Only used for shops now but could be used for anything. We should look at how door rando does this ; and try to unify one approach. REP #$30 - LDX.w ItemQueuePtr : BEQ .done + LDX.w ItemStackPtr : BEQ .done + TXA : BIT #$0040 : BNE .fail ; Crash if we have more than 16 queued (should never happen.) + DEX #2 - - LDA.w ItemGFXQueue,X : STA.w ItemGFXPtr - LDA.w ItemTargetQueue,X : STA.w ItemGFXTarget + LDA.l ItemGFXStack,X : STA.w ItemGFXPtr + LDA.l ItemTargetStack,X : STA.w ItemGFXTarget PHX JSL.l TransferItemToVRAM REP #$10 @@ -55,7 +57,9 @@ TransferItemGFX: DEX #2 BPL - - STZ.w ItemQueuePtr + STZ.w ItemStackPtr .done SEP #$30 RTS + .fail + BRK #$00 diff --git a/itemdatatables.asm b/itemdatatables.asm index 97496f7..f2eba04 100644 --- a/itemdatatables.asm +++ b/itemdatatables.asm @@ -1032,7 +1032,7 @@ ItemReceiptGraphicsOffsets: dw $05A0 ; 4D - Arrow capacity (70) dw $01A0 ; 4E - 1/2 magic dw $01E0 ; 4F - 1/4 magic - dw $0 ; 50 - Safe master sword + dw $00E0 ; 50 - Safe master sword dw $0420 ; 51 - Bomb capacity (+5) dw $0460 ; 52 - Bomb capacity (+10) dw $0520 ; 53 - Arrow capacity (+5) diff --git a/newitems.asm b/newitems.asm index 9f31197..6fe11d5 100644 --- a/newitems.asm +++ b/newitems.asm @@ -434,7 +434,10 @@ ItemBehavior: RTS .single_arrow - INC.w UpdateHUD + LDA.l ArrowMode : BEQ + + LDA.l CurrentArrows : INC : STA.l CurrentArrows ; Should be sole write to this address + INC.w UpdateHUD ; in retro/rupee bow mode. + + RTS .rupoor diff --git a/ram.asm b/ram.asm index 3a09259..bd89cbf 100644 --- a/ram.asm +++ b/ram.asm @@ -190,10 +190,10 @@ MessageJunk = $7E0223 ; Zeroed but never used (?) ; ShopPurchaseFlag = $7E0224 ; $01 = Shop purchase item receipt. ;CoolScratch = $7E0224 ; 0x5C bytes of free ram -ItemQueuePtr = $7E0226 ; Pointer into Item GFX and VRAM target queues. Word length. +ItemStackPtr = $7E0226 ; Pointer into Item GFX and VRAM target queues. Word length. + ; If not zero, pointer should always be left pointing at the + ; next available slot in the stack during the frame. SpriteID = $7E0230 ; 0x0A bytes. Receipt ID for main loop sprite we're handling. -ItemGFXQueue = $7E0230 ; Pointers to decompressed item tiles deferred to NMI loading. $10 bytes -ItemTargetQueue = $7E0240 ; Pointers to VRAM targets for ItemGFXQueue. $10 bytes AncillaVelocityZ = $7E0294 ; 0x0A bytes AncillaZCoord = $7E029E ; 0x0A bytes ; @@ -476,7 +476,10 @@ HUDArrowCount = $7EC760 ; HUDKeyDigits = $7EC764 ; ; BigRAM = $7EC900 ; Big buffer of free ram (0x1F00) -TotalItemCountTiles = $7ECB00 ; Cached total item count tiles for HUD. Four words high to low. +ItemGFXStack = $7ECB00 ; Pointers to source of decompressed item tiles deferred to NMI loading. +ItemGFXSBankStack = $7ECB20 ; Source bank byte for above. +ItemTargetStack = $7ECB40 ; Pointers to VRAM targets for ItemGFXStack. +TotalItemCountTiles = $7ECF00 ; Cached total item count tiles for HUD. Four words high to low. ;================================================================================ ; Bank 7F @@ -485,7 +488,6 @@ DecompressionBuffer = $7F0000 ; Decompression Buffer. $2000 bytes. DecompBuffer2 = $7F4000 ; Another buffer - base $7F5000 RedrawFlag: skip 1 ; skip 2 ; Unused diff --git a/shopkeeper.asm b/shopkeeper.asm index a609ade..049cd7c 100644 --- a/shopkeeper.asm +++ b/shopkeeper.asm @@ -105,8 +105,8 @@ SpritePrep_ShopKeeper: LDX.w #$0000 LDY.w #$0000 - - TYA : CMP.l ShopCapacity : !BLT ++ : JMP .stop : ++ - LDA.l ShopContentsTable+1, X : CMP.b #$FF : BNE ++ : JMP .stop : ++ + TYA : CMP.l ShopCapacity : !BLT ++ : JMP .done : ++ + LDA.l ShopContentsTable+1, X : CMP.b #$FF : BNE ++ : JMP .done : ++ LDA.l ShopContentsTable, X : CMP.l ShopId : BEQ ++ : JMP .next : ++ LDA.l ShopContentsTable+1, X : PHX : TYX : STA.l ShopInventory, X : PLX @@ -143,15 +143,9 @@ SpritePrep_ShopKeeper: .next INX #8 JMP - - .stop - REP #$20 - LDA.w ItemQueuePtr - DEC #2 - AND.w #$00E - STA.w ItemQueuePtr - SEP #$20 - + .done + SEP #$20 LDA.l ShopType : BIT.b #$20 : BEQ .notTakeAll ; Take-all .takeAll @@ -199,19 +193,19 @@ SetupTileTransfer: TXA : LSR #2 CLC : ADC.w #!FREE_TILE_ALT .store_target - LDX.w ItemQueuePtr - STA.w ItemTargetQueue,X + LDX.w ItemStackPtr + STA.l ItemTargetStack,X TYA : ASL : TAX LDA.l StandingItemGraphicsOffsets,X - LDX.w ItemQueuePtr - STA.w ItemGFXQueue,X + LDX.w ItemStackPtr + STA.l ItemGFXStack,X TXA INC #2 - AND.w #$000E - STA.w ItemQueuePtr - TDC + STA.l ItemStackPtr + + LDA.w #$0000 REP #$10 ; set 16-bit index registers SEP #$20 RTS From 90ffa8bd233b2bd66f92936e3fda5dd75fe810df Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Fri, 25 Aug 2023 21:11:48 -0400 Subject: [PATCH 4/8] Fix cave state item cutscene flag with boss hearts Add item substitutions --- bookofmudora.asm | 2 ++ dungeondrops.asm | 7 +++++++ heartpieces.asm | 3 +++ inventory.asm | 2 ++ npcitems.asm | 2 ++ tables.asm | 1 - tablets.asm | 1 + 7 files changed, 17 insertions(+), 1 deletion(-) diff --git a/bookofmudora.asm b/bookofmudora.asm index 55c048a..5f48936 100644 --- a/bookofmudora.asm +++ b/bookofmudora.asm @@ -3,6 +3,7 @@ ;-------------------------------------------------------------------------------- LoadLibraryItemGFX: %GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues) + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID, X JSL.l PrepDynamicTile_loot_resolved @@ -30,6 +31,7 @@ LoadBonkItemGFX: LoadBonkItemGFX_inner: LDA.b #$00 : STA.l RedrawFlag JSR LoadBonkItem + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteItemType, X STA.w SpriteID, X diff --git a/dungeondrops.asm b/dungeondrops.asm index 6a364e8..6abf178 100644 --- a/dungeondrops.asm +++ b/dungeondrops.asm @@ -3,6 +3,7 @@ ;-------------------------------------------------------------------------------- SpawnDungeonPrize: PHX : PHB + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w ItemReceiptID TAX @@ -61,6 +62,7 @@ RTS PrepPrizeTile: PHA : PHX : PHY LDA.w AncillaGet, X + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID,X JSL.l TransferItemReceiptToBuffer_using_ReceiptID @@ -69,6 +71,7 @@ RTL SetItemPose: PHA + LDA.w DungeonID : BMI .one_handed LDA.w RoomItemsTaken : BIT.b #$80 : BNE + .one_handed PLA @@ -97,6 +100,7 @@ SetCutsceneFlag: ; Out: c - Cutscene flag $02 if set, $01 if unset. PHX LDY.b #$01 ; wrote over + LDA.w DungeonID : BMI .no_cutscene LDA.w RoomItemsTaken : BIT #$80 : BNE .dungeon_prize .no_cutscene PLX @@ -112,6 +116,7 @@ RTL AnimatePrizeCutscene: LDA.w ItemReceiptMethod : CMP.b #$03 : BNE + JSR.w CrystalOrPendantBehavior : BCC + + LDA.w DungeonID : BMI + LDA.w RoomItemsTaken : BIT #$80 : BEQ + SEC RTL @@ -148,7 +153,9 @@ RTL MaybeKeepLootID: PHA + LDA.w DungeonID : BMI .no_prize LDA.w RoomItemsTaken : BIT #$80 : BNE .prize + .no_prize STZ.w ItemReceiptID STZ.w ItemReceiptPose PLA diff --git a/heartpieces.asm b/heartpieces.asm index a236318..7243aa2 100644 --- a/heartpieces.asm +++ b/heartpieces.asm @@ -4,6 +4,7 @@ HeartPieceGet: PHX : PHY JSL.l LoadHeartPieceRoomValue + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong TAY JSL.l MaybeMarkDigSpotCollected @@ -112,6 +113,7 @@ HeartPieceSpritePrep: LDA.b #$00 : STA.l RedrawFlag JSL.l LoadHeartPieceRoomValue + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID, X JSL.l PrepDynamicTile_loot_resolved @@ -125,6 +127,7 @@ HeartContainerSpritePrep: LDA.b #$00 : STA.l RedrawFlag JSL.l LoadHeartContainerRoomValue ; load item type + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID, X JSL.l PrepDynamicTile_loot_resolved diff --git a/inventory.asm b/inventory.asm index 9246d65..9f8b93f 100644 --- a/inventory.asm +++ b/inventory.asm @@ -520,6 +520,7 @@ LoadPowder: PHX JSL.l Sprite_SpawnDynamically ; thing we wrote over %GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID, Y TYX @@ -572,6 +573,7 @@ LoadMushroom: LDA.b #$00 : STA.l RedrawFlag %GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) + JSL.l AttemptItemSubstitution JSR.w ResolveLootID STA.w SpriteID,X JSL.l PrepDynamicTile diff --git a/npcitems.asm b/npcitems.asm index f633cca..3206fe5 100644 --- a/npcitems.asm +++ b/npcitems.asm @@ -175,6 +175,7 @@ RTL ;-------------------------------------------------------------------------------- LoadZoraKingItemGFX: LDA.l $9DE1C3 ; location randomizer writes zora item to + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID,Y TYX @@ -190,6 +191,7 @@ JumpToSplashItemTarget: ;-------------------------------------------------------------------------------- LoadCatfishItemGFX: LDA.l $9DE185 ; location randomizer writes catfish item to + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong STA.w SpriteID, Y TYX diff --git a/tables.asm b/tables.asm index 17ad2f6..10fbf31 100644 --- a/tables.asm +++ b/tables.asm @@ -87,7 +87,6 @@ SmithItemMode: db $01 ; #$00 = Classic Tempering Process - #$01 = Quick Item Get (default) SmithItem: db $02 ; #$02 = Tempered Sword (default) - org $86B55C ; PC 0x3355C ; sprite_smithy_bros.asm : 634 SmithSword: db $02 ; #$02 = Tempered Sword (default) diff --git a/tablets.asm b/tablets.asm index 07a45e6..3ab31d5 100644 --- a/tablets.asm +++ b/tablets.asm @@ -30,6 +30,7 @@ RTS ;-------------------------------------------------------------------------------- SpawnTabletItem: JSL.l LoadOutdoorValue + JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong PHA LDA.b #$EB : STA.l MiniGameTime From 77e269ff31e5e6b5f1f37a1775cfd03c77d6331c Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Sat, 26 Aug 2023 01:42:31 -0400 Subject: [PATCH 5/8] Ridiculous game --- utilities.asm | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/utilities.asm b/utilities.asm index e4ce4ff..53952f9 100644 --- a/utilities.asm +++ b/utilities.asm @@ -366,23 +366,27 @@ LoadItemPalette: TXA : ASL : TAX LDA.l SpriteProperties_palette_addr,X : STA.b Scrap0A LDY.w #$000E - LDA.l FadeTimer : BNE .aux - LDA.w TransparencyFlag : BNE .SP05 - - - LDA.b [Scrap0A], Y - STA.w PaletteBuffer+$0170,Y - DEY #2 - BPL - - LDA.w #$0003 - BRA .done - .SP05 + LDA.w RoomIndex : CMP.w #$008C : BEQ .aux + LDA.w TransparencyFlag : BNE .SP05 - LDA.b [Scrap0A], Y - STA.w PaletteBuffer+$01B0,Y + STA.w PaletteBuffer+$0170,Y DEY #2 BPL - - LDA.w #$0005 + LDA.w #$0003 BRA .done + .SP05 + - + LDA.b [Scrap0A], Y + STA.w PaletteBuffer+$01B0,Y + DEY #2 + BPL - + LDA.w #$0005 + .done + SEP #$30 + PLB : PLY : PLX + INC.b NMICGRAM +RTL .aux LDA.w TransparencyFlag : BNE .SP05_aux - @@ -399,11 +403,7 @@ LoadItemPalette: DEY #2 BPL - LDA.w #$0005 - .done - SEP #$30 - PLB : PLY : PLX - INC.b NMICGRAM -RTL + BRA .done TransferVRAMStripes: JSL.l TransferNewNameStripes From 7e513c469663a6ac05d417d709dea3766e33e690 Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Sat, 26 Aug 2023 14:30:39 -0400 Subject: [PATCH 6/8] More sprite fixes --- bookofmudora.asm | 3 +-- goalitem.asm | 7 +++---- itemdatatables.asm | 2 +- utilities.asm | 16 ++++++++-------- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/bookofmudora.asm b/bookofmudora.asm index 5f48936..21f79a3 100644 --- a/bookofmudora.asm +++ b/bookofmudora.asm @@ -39,8 +39,7 @@ LoadBonkItemGFX_inner: PHA : PHX LDA.w SpriteID,X : TAX LDA.l SpriteProperties_standing_width,X : BNE + - LDA.b #$00 : STA.l SpriteOAM ; Move narrow items back to the left - LDA.b #$00 : STA.l SpriteOAM+8 ; + LDA.b #$00 : STA.l SpriteOAM : STA.l SpriteOAM+8 + PLX : PLA RTL diff --git a/goalitem.asm b/goalitem.asm index 8a97dde..9d9afb4 100644 --- a/goalitem.asm +++ b/goalitem.asm @@ -195,10 +195,9 @@ KillGanon: CMP.b #$06 : BNE .exit .light_speed - LDA.l OverworldEventDataWRAM+$5B : ORA.b #$20 : STA.l OverworldEventDataWRAM+$5B ; pyramid hole - LDA.b #$08 : STA.l RoomDataWRAM[$00].high ; kill ganon - LDA.b #$02 : STA.l MoonPearlEquipment ; pearl but invisible in menu - + REP #$20 + LDA.w #$0019 : STA.b GameMode + SEP #$20 .exit RTL diff --git a/itemdatatables.asm b/itemdatatables.asm index f2eba04..2416e3c 100644 --- a/itemdatatables.asm +++ b/itemdatatables.asm @@ -416,7 +416,7 @@ macro SpriteProps(id, chest_width, standing_width, chest_pal, standing_pal, addr pullpc endmacro -%SpriteProps($00, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 00 - Fighter sword & Shield +%SpriteProps($00, 0, 2, $05, $02, PalettesVanilla_blue_ice+$0E) ; 00 - Fighter sword & Shield %SpriteProps($01, 0, 2, $05, $05, PalettesCustom_master_sword) ; 01 - Master sword %SpriteProps($02, 0, 2, $05, $01, PalettesCustom_tempered_sword) ; 02 - Tempered sword %SpriteProps($03, 0, 2, $05, $04, PalettesCustom_golden_sword) ; 03 - Golden sword diff --git a/utilities.asm b/utilities.asm index 53952f9..cc4e286 100644 --- a/utilities.asm +++ b/utilities.asm @@ -69,6 +69,10 @@ RTL ;-------------------------------------------------------------------------------- 20/847B LoadDynamicTileOAMTable: PHP + REP #$20 + LDA.w #$0000 : STA.l SpriteOAM : STA.l SpriteOAM+2 + LDA.w #$0200 : STA.l SpriteOAM+6 + SEP #$20 LDA.b #$24 : STA.l SpriteOAM+4 LDA.w SpriteID,X @@ -76,27 +80,23 @@ LoadDynamicTileOAMTable: STA.l SpriteOAM+5 : STA.l SpriteOAM+13 PHX LDA.l SpriteProperties_standing_width,X : BEQ .narrow - REP #$20 - LDA.w #$0000 : STA.l SpriteOAM : STA.l SpriteOAM+2 - LDA.w #$0200 : STA.l SpriteOAM+6 BRA .done .narrow REP #$20 - LDA.w #$0004 : STA.l SpriteOAM - LDA.w #$0000 : STA.l SpriteOAM+2 - LDA.w #$0200 : STA.l SpriteOAM+6 - LDA.w #$0400 : STA.l SpriteOAM+7 : STA.l SpriteOAM+14 + LDA.w #$0000 : STA.l SpriteOAM+14 LDA.w #$0800 : STA.l SpriteOAM+9 LDA.w #$3400 : STA.l SpriteOAM+11 + SEP #$20 + LDA.b #$04 : STA.l SpriteOAM + .done TXA PLX PLP RTS - ;-------------------------------------------------------------------------------- ; DrawDynamicTile ; in: A - Loot ID From 05a79ad2d9bc4ed5bae98b9e2d263c196c150d04 Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Sat, 26 Aug 2023 20:29:38 -0400 Subject: [PATCH 7/8] Fix Ped/GT open modes Fix key colors --- goalitem.asm | 10 ++++++---- init.asm | 2 +- itemdatatables.asm | 32 ++++++++++++++++---------------- tables.asm | 24 ++++++++++++++---------- 4 files changed, 37 insertions(+), 31 deletions(-) diff --git a/goalitem.asm b/goalitem.asm index 9d9afb4..dc0c7af 100644 --- a/goalitem.asm +++ b/goalitem.asm @@ -142,10 +142,8 @@ CheckEnoughCrystalsForGanon: RTL ;-------------------------------------------------------------------------------- CheckTowerOpen: - REP #$30 LDA.l GanonsTowerOpenMode : ASL : TAX JSR.w (.tower_open_modes,X) - SEP #$30 RTL .tower_open_modes dw .vanilla @@ -153,13 +151,15 @@ RTL .vanilla LDA.l CrystalsField - AND.w #$007F : CMP.w #$007F + 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 ;--------------------------------------------------------------------------------------------------- @@ -266,7 +266,9 @@ RTL RTS .arbitrary_cmp + REP #$30 LDA.l PedPullAddress : TAX - LDA.l $7E000,X + LDA.l $7E0000,X CMP.l PedPullTarget + SEP #$30 RTS diff --git a/init.asm b/init.asm index 59fadbc..bada0c8 100644 --- a/init.asm +++ b/init.asm @@ -48,7 +48,7 @@ Init_Primary: LDA.l OneMindTimerInit : STA.l OneMindTimerRAM SEP #$30 - LDA.b #$01 : STA.w MEMSEL ; enable fastrom access on upper banks + LDA.l RomSpeed : STA.w MEMSEL ; enable fastrom access on upper banks STA.l OneMindId LDA.b #$10 : STA.b PlayerSpriteBank ; set default player sprite bank diff --git a/itemdatatables.asm b/itemdatatables.asm index 2416e3c..1f36c99 100644 --- a/itemdatatables.asm +++ b/itemdatatables.asm @@ -452,7 +452,7 @@ endmacro %SpriteProps($21, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 21 - Net %SpriteProps($22, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 22 - Blue mail %SpriteProps($23, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 23 - Red mail -%SpriteProps($24, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; 24 - Small key +%SpriteProps($24, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; 24 - Small key %SpriteProps($25, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 25 - Compass %SpriteProps($26, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 26 - Heart container from 4/4 %SpriteProps($27, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 27 - Bomb @@ -576,22 +576,22 @@ endmacro %SpriteProps($9D, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 9D - Big key of Eastern Palace %SpriteProps($9E, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 9E - Big key of Hyrule Castle %SpriteProps($9F, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 9F - Big key of Sewers -%SpriteProps($A0, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A0 - Small key of Sewers -%SpriteProps($A1, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A1 - Small key of Hyrule Castle -%SpriteProps($A2, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A2 - Small key of Eastern Palace -%SpriteProps($A3, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A3 - Small key of Desert Palace -%SpriteProps($A4, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A4 - Small key of Agahnim's Tower -%SpriteProps($A5, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A5 - Small key of Swamp Palace -%SpriteProps($A6, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A6 - Small key of Dark Palace -%SpriteProps($A7, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A7 - Small key of Misery Mire -%SpriteProps($A8, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A8 - Small key of Skull Woods -%SpriteProps($A9, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; A9 - Small key of Ice Palace -%SpriteProps($AA, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; AA - Small key of Tower of Hera -%SpriteProps($AB, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; AB - Small key of Thieves' Town -%SpriteProps($AC, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; AC - Small key of Turtle Rock -%SpriteProps($AD, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; AD - Small key of Ganon's Tower +%SpriteProps($A0, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A0 - Small key of Sewers +%SpriteProps($A1, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A1 - Small key of Hyrule Castle +%SpriteProps($A2, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A2 - Small key of Eastern Palace +%SpriteProps($A3, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A3 - Small key of Desert Palace +%SpriteProps($A4, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A4 - Small key of Agahnim's Tower +%SpriteProps($A5, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A5 - Small key of Swamp Palace +%SpriteProps($A6, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A6 - Small key of Dark Palace +%SpriteProps($A7, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A7 - Small key of Misery Mire +%SpriteProps($A8, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A8 - Small key of Skull Woods +%SpriteProps($A9, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; A9 - Small key of Ice Palace +%SpriteProps($AA, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AA - Small key of Tower of Hera +%SpriteProps($AB, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AB - Small key of Thieves' Town +%SpriteProps($AC, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AC - Small key of Turtle Rock +%SpriteProps($AD, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AD - Small key of Ganon's Tower %SpriteProps($AE, 2, 2, $02, $02, $0000) ; AE - Reserved -%SpriteProps($AF, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; AF - Generic small key +%SpriteProps($AF, 0, 0, $04, $04, PalettesVanilla_blue_ice+$0E) ; AF - Generic small key %SpriteProps($B0, 2, 2, $80, $80, PalettesCustom_crystal) ; B0 - Crystal 6 %SpriteProps($B1, 2, 2, $80, $80, PalettesCustom_crystal) ; B1 - Crystal 1 %SpriteProps($B2, 2, 2, $80, $80, PalettesCustom_crystal) ; B2 - Crystal 5 diff --git a/tables.asm b/tables.asm index 10fbf31..2b27a87 100644 --- a/tables.asm +++ b/tables.asm @@ -642,17 +642,17 @@ org $81C6FC ; PC 0xC6FC - Bank01.asm:10344 - (db $00, $00, $01, $02, $00, $06, $ DungeonPrizeReceiptID: db $00 ; Sewers db $00 ; Hyrule Castle - db $01 ; Eastern Palace - db $02 ; Desert Palace + db $37 ; Eastern Palace + db $38 ; Desert Palace db $00 ; Agahnim's Tower - db $06 ; Swamp Palace - db $06 ; Palace of Darkness + db $20 ; Swamp Palace + db $20 ; Palace of Darkness db $20 ; Misery Mire db $20 ; Skull Woods - db $06 ; Ice Palace - db $03 ; Tower of Hera - db $06 ; Thieves' Town - db $06 ; Turtle Rock + db $20 ; Ice Palace + db $39 ; Tower of Hera + db $20 ; Thieves' Town + db $20 ; Turtle Rock ;Ether/Nothing: $00 ;Green Pendant: $01 ;Blue Pendant: $02 @@ -2599,10 +2599,14 @@ dw #$0C00 ; Blue dw #$1800 ; Green dw #$0800 ; Yellow -org $B0F032 +org $B0F032 ; PC 0x187032 +RomSpeed: +db $01 ; $01 = FastROM (default | $00 = SlowROM) + +org $B0F033 ; PC 0x187033 ;-------------------------------------------------------------------------------- -; 0x187032 - 187FFF (unused) +; 0x187033 - 187FFF (unused) ;-------------------------------------------------------------------------------- From 52d26165377dc3fb6cba56834779601a9e804018 Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Sat, 26 Aug 2023 23:24:34 -0400 Subject: [PATCH 8/8] RomSpeed option --- hooks.asm | 6 ++---- init.asm | 3 ++- tables.asm | 2 +- vanillalabels.asm | 2 ++ 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hooks.asm b/hooks.asm index 7c33c18..c4a45b2 100644 --- a/hooks.asm +++ b/hooks.asm @@ -59,10 +59,8 @@ org $00FFEA : dw NMIBounce org $00FFEE : dw IRQBounce org $8098AB - -NMIBounce: JML $8080C9 -IRQBounce: JML $8082D8 - +NMIBounce: JML.l $8080C9 +IRQBounce: JML.l $8082D8 warnpc $8098C0 ;================================================================================ diff --git a/init.asm b/init.asm index bada0c8..fee19f9 100644 --- a/init.asm +++ b/init.asm @@ -49,10 +49,11 @@ Init_Primary: SEP #$30 LDA.l RomSpeed : STA.w MEMSEL ; enable fastrom access on upper banks - STA.l OneMindId + LDA.b #$01 : STA.l OneMindId LDA.b #$10 : STA.b PlayerSpriteBank ; set default player sprite bank LDA.b #$81 : STA.w NMITIMEN ; thing we wrote over, turn on NMI & gamepad + LDA.b #(ReturnFromInit>>16)|$80 : PHA : PLB JML ReturnFromInit diff --git a/tables.asm b/tables.asm index 2b27a87..a7dfdd4 100644 --- a/tables.asm +++ b/tables.asm @@ -2601,7 +2601,7 @@ dw #$0800 ; Yellow org $B0F032 ; PC 0x187032 RomSpeed: -db $01 ; $01 = FastROM (default | $00 = SlowROM) +db $01 ; $01 = FastROM (default) | $00 = SlowROM org $B0F033 ; PC 0x187033 diff --git a/vanillalabels.asm b/vanillalabels.asm index 9943358..295e813 100644 --- a/vanillalabels.asm +++ b/vanillalabels.asm @@ -164,6 +164,8 @@ RenderText_DecompressAndDrawSingle = $8EF4FB DecompressFontGFX = $8EF572 CopyDecompressedCharToTransferBuffer = $8EF5BC CopyDecompressedToFullBuffer = $8EF6A8 +Trinexx_FinalPhase = $9DADB5 +Trinexx_PreFinalPhase = $9DB0D2 ;=================================================================================================== ; Palettes