From bdd665db2447505cd0a8eba3a3b6462ef4ce9e5e Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Tue, 13 Jul 2021 11:02:59 -0700 Subject: [PATCH] move storage of BOMB_LEVEL to make it play nicely with starting equipment --- LTTP_RND_GeneralBugfixes.asm | 6 +++--- darkworldspawn.asm | 2 +- inventory.asm | 2 +- itemdowngrade.asm | 6 +++--- newitems.asm | 4 ++-- special_bombs.asm | 3 +-- swordswap.asm | 2 +- tables.asm | 2 +- zelda.asm | 2 +- 9 files changed, 14 insertions(+), 15 deletions(-) diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 3e9acb8..9677c52 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -36,8 +36,9 @@ db #$20, #$19, #$08, #$31 ; year/month/day ; Rando Specific SRAM assignments !SHOP_PURCHASE_COUNTS = "$7EF302" ;$7EF302 - $7EF33F (temporary home) -!INVENTORY_SWAP = "$7EF38C" ; [w] -!INVENTORY_SWAP_2 = "$7EF38E" ; [w] +!INVENTORY_SWAP = "$7EF38C" +!INVENTORY_SWAP_2 = "$7EF38E" +!BOMB_LEVEL = "$7EF38F" !ITEM_LIMIT_COUNTS = "$7EF390" ; $7EF390 - ???? !NPC_FLAGS = "$7EF410" !NPC_FLAGS_2 = "$7EF411" @@ -58,7 +59,6 @@ db #$20, #$19, #$08, #$31 ; year/month/day ;$7EF420 - $7EF46F - Stat Tracking Bank 1 (overlaps with RNG Item Flags) ;$7EF450 - $7EF45F - RNG Item (Single) Flags ;$7EF4A0 - $7EF4A7 - Service Request Block -!PROGRESSIVE_BOMBS = "$7EF4A8" ;$7EF4AA - $7EF4AD = Stat Tracking Bank 2 !FRESH_FILE_MARKER = "$7EF4F0" ; zero if fresh file ;$700500 - $70050F - Extended File Name diff --git a/darkworldspawn.asm b/darkworldspawn.asm index 86d8c51..2b8bb01 100644 --- a/darkworldspawn.asm +++ b/darkworldspawn.asm @@ -149,7 +149,7 @@ SetEscapeAssist: ++ LDA.l SpecialBombs : BEQ + - LDA.l $7EF4A8 : BEQ + + LDA.l !BOMB_LEVEL : BEQ + LDA #$01 : STA !INFINITE_BOMBS + RTL diff --git a/inventory.asm b/inventory.asm index a915cc3..2210b61 100644 --- a/inventory.asm +++ b/inventory.asm @@ -718,7 +718,7 @@ RTL .incrementBossSword LDA SpecialBombs : BEQ + - LDA $7EF4A8 : BRA ++ + LDA !BOMB_LEVEL : BRA ++ + : LDA $7EF359 ++ BNE + : - diff --git a/itemdowngrade.asm b/itemdowngrade.asm index b0253ca..f4e4aac 100644 --- a/itemdowngrade.asm +++ b/itemdowngrade.asm @@ -76,9 +76,9 @@ JMP .done PHA TYA ; load bomb upgrade item !SUB #$B0 ; convert to bomb level - CMP.l $7EF4A8 : !BGE + ; skip if highest is lower (this is an upgrade) - LDA.l $7EF4A8 : !ADD #$B0 ; convert to item id - TAY : PLA : LDA.l $7EF4A8 ; put bomb level into the thing to write + CMP.l !BOMB_LEVEL : !BGE + ; skip if highest is lower (this is an upgrade) + LDA.l !BOMB_LEVEL : !ADD #$B0 ; convert to item id + TAY : PLA : LDA.l !BOMB_LEVEL ; put bomb level into the thing to write JMP .done + PLA diff --git a/newitems.asm b/newitems.asm index 5ebb29e..7695b9e 100755 --- a/newitems.asm +++ b/newitems.asm @@ -565,7 +565,7 @@ AddReceivedItemExpanded: LDA.b #$0E : STA $02D8 : BRA .done ; Bee in a bottle +++ ++ : CMP.b #$B6 : BNE ++ ; Progressive Bombs - LDA $7EF4A8 + LDA !BOMB_LEVEL CMP.b #$00 : BNE + ; have no Bombs LDA.b #$B1 : STA $02D8 : JMP .done + : CMP.b #$01 : BNE + ; have L-1 Bombs @@ -836,7 +836,7 @@ AddReceivedItemExpanded: dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Free Big Key dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Free Small Key dw $F36A ; Bee Trap - dw $F4A8, $F4A8, $F4A8, $F4A8, $F4A8, $F4A8 ; Bomb Upgrades + dw $F38F, $F38F, $F38F, $F38F, $F38F, $F38F ; Bomb Upgrades dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused diff --git a/special_bombs.asm b/special_bombs.asm index 544bc78..556b817 100644 --- a/special_bombs.asm +++ b/special_bombs.asm @@ -1,6 +1,5 @@ ;-------------------------------------------------------------------------------- !ANCILLA_DAMAGE = "$06EC84" -!BOMB_LEVEL = "$7EF4A8" ; start with X = sprite index, A = ancilla type index ;-------------------------------------------------------------------------------- DamageClassCalc: @@ -262,7 +261,7 @@ DrawSwordInMenu: LDA.w #$F859 : STA $04 RTL .bombSword - LDA $7EF4A8 : AND.w #$00FF : STA $02 + LDA !BOMB_LEVEL : AND.w #$00FF : STA $02 LDA.w #$FC51 : STA $04 RTL ;-------------------------------------------------------------------------------- diff --git a/swordswap.asm b/swordswap.asm index 9bf8271..719f061 100644 --- a/swordswap.asm +++ b/swordswap.asm @@ -135,7 +135,7 @@ CheckTabletSword: LDA.b #$02 : RTL + LDA.l SpecialBombs : BEQ + - LDA $7EF4A8 : CMP #$02 : !BLT + ; check for master bombs + LDA !BOMB_LEVEL : CMP #$02 : !BLT + ; check for master bombs LDA.b #$02 : RTL + LDA $7EF359 ; get actual sword value diff --git a/tables.asm b/tables.asm index 504898e..b0f8c79 100644 --- a/tables.asm +++ b/tables.asm @@ -1632,7 +1632,7 @@ dw $0000, $0000, $0000, $0000, $F800, $0000, $0000, $0000 dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000 dw $0000, $0000 ;-------------------------------------------------------------------------------- -; 0x182355 - 183FFF (unused) +; 0x183055 - 183FFF (unused) ;================================================================================ org $30C000 ; PC 0x184000 - 0x184007 ItemSubstitutionRules: diff --git a/zelda.asm b/zelda.asm index 33a7733..e83064f 100644 --- a/zelda.asm +++ b/zelda.asm @@ -21,7 +21,7 @@ EndRainState: CMP #$10 : BNE + : STA !INFINITE_ARROWS : + LDA.l SpecialBombs : BEQ + - LDA.l $7EF4A8 : BEQ + + LDA.l !BOMB_LEVEL : BEQ + LDA #$01 : STA !INFINITE_BOMBS + LDA.b #$02 : STA $7EF3C5 ; end rain state