Replace more labels

Removed mask from rupeelimit.asm as total item counter is now a 16-bit
value
Commented out CountBits in utilities.asm in previous commit as I've
allocated a counter byte in SRAM
This commit is contained in:
cassidy
2021-12-06 00:46:05 -05:00
parent c29de40484
commit c1e4ca0053
4 changed files with 25 additions and 52 deletions

View File

@@ -1,46 +1,22 @@
;================================================================================ ;================================================================================
; Frame Hook ; Frame Hook
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; $7EF42Ew[2] - loop frame counter (low)
!LOOP_FRAMES_LOW = "$7EF42E"
;--------------------------------------------------------------------------------
; $7EF430w[2] - loop frame counter (high)
!LOOP_FRAMES_HIGH = "$7EF430"
;--------------------------------------------------------------------------------
; $7EF43Ew[2] - nmi frame counter (low)
!NMI_FRAMES_LOW = "$7EF43E"
;--------------------------------------------------------------------------------
; $7EF440w[2] - nmi frame counter (high)
!NMI_FRAMES_HIGH = "$7EF440"
;--------------------------------------------------------------------------------
; $7EF444w[2] - item menu frame counter (low)
!ITEM_FRAMES_LOW = "$7EF444"
;--------------------------------------------------------------------------------
; $7EF446w[2] - item menu frame counter (high)
!ITEM_FRAMES_HIGH = "$7EF446"
;--------------------------------------------------------------------------------
!LOCK_STATS = "$7EF443"
FrameHookAction: FrameHookAction:
JSL $0080B5 ; Module_MainRouting JSL $0080B5 ; Module_MainRouting
JSL CheckMusicLoadRequest JSL CheckMusicLoadRequest
PHP : REP #$30 : PHA PHP : REP #$30 : PHA
SEP #$20 SEP #$20
;LDA EnableSRAMTrace : AND.l TournamentSeedInverse : BEQ +
; LDA $1A : BNE ++ : JSL.l WriteStatusPreview : ++ ; write every 256 frames
;+
LDA !LOCK_STATS : BNE ++ LDA StatsLocked : BNE ++
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA !LOOP_FRAMES_LOW : INC : STA !LOOP_FRAMES_LOW : BNE + LDA LoopFrames : INC : STA LoopFrames : BNE +
LDA !LOOP_FRAMES_HIGH : INC : STA !LOOP_FRAMES_HIGH LDA LoopFrames+2 : INC : STA LoopFrames+2
+ +
LDA $10 : CMP.w #$010E : BNE + ; move this to nmi hook? LDA $10 : CMP.w #$010E : BNE + ; move this to nmi hook?
LDA !ITEM_FRAMES_LOW : INC : STA !ITEM_FRAMES_LOW : BNE + LDA MenuFrames : INC : STA MenuFrames : BNE +
LDA !ITEM_FRAMES_HIGH : INC : STA !ITEM_FRAMES_HIGH LDA MenuFrames+2 : INC : STA MenuFrames+2
+ +
;SEP #$20 ; set 8-bit accumulator ?? check this
++ ++
REP #$30 : PLA : PLP REP #$30 : PLA : PLP
RTL RTL
@@ -48,9 +24,9 @@ RTL
NMIHookAction: NMIHookAction:
PHA : PHX : PHY : PHD ; thing we wrote over, push stuff PHA : PHX : PHY : PHD ; thing we wrote over, push stuff
LDA !LOCK_STATS : AND.w #$00FF : BNE ++ LDA StatsLocked : AND.w #$00FF : BNE ++
LDA !NMI_FRAMES_LOW : INC : STA !NMI_FRAMES_LOW : BNE + LDA NMIFrames : INC : STA NMIFrames : BNE +
LDA !NMI_FRAMES_HIGH : INC : STA !NMI_FRAMES_HIGH LDA NMIFrames+2 : INC : STA NMIFrames+2
+ +
++ ++
@@ -80,4 +56,4 @@ PostNMIHookAction:
LDA $13 : STA $2100 ; thing we wrote over, turn screen back on LDA $13 : STA $2100 ; thing we wrote over, turn screen back on
JML.l PostNMIHookReturn JML.l PostNMIHookReturn
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -5,9 +5,7 @@ Draw4DigitRupees:
LDA $1B : AND.w #$00FF : BEQ .outdoors ; skip if outdoors LDA $1B : AND.w #$00FF : BEQ .outdoors ; skip if outdoors
.indoors .indoors
LDA $A0 : BNE .normal ; skip except for ganon's room LDA $A0 : BNE .normal ; skip except for ganon's room
;LDA #$246E : STA $7EC712 LDA TotalItemCounter
;LDA #$246F : STA $7EC714
LDA $7EF423 : AND #$00FF
BRA .print BRA .print
.outdoors .outdoors
.normal .normal

View File

@@ -2,19 +2,19 @@
; Randomize Tablets ; Randomize Tablets
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
ItemSet_EtherTablet: ItemSet_EtherTablet:
PHA : LDA !NPC_FLAGS_2 : ORA.b #$01 : STA !NPC_FLAGS_2 : PLA PHA : LDA NpcFlags+1 : ORA.b #$01 : STA NpcFlags+1 : PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
ItemSet_BombosTablet: ItemSet_BombosTablet:
PHA : LDA !NPC_FLAGS_2 : ORA.b #$02 : STA !NPC_FLAGS_2 : PLA PHA : LDA NpcFlags+1 : ORA.b #$02 : STA NpcFlags+1 : PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
ItemCheck_EtherTablet: ItemCheck_EtherTablet:
LDA !NPC_FLAGS_2 : AND.b #$01 LDA NpcFlags+1 : AND.b #$01
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
ItemCheck_BombosTablet: ItemCheck_BombosTablet:
LDA !NPC_FLAGS_2 : AND.b #$02 LDA NpcFlags+1 : AND.b #$02
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SetTabletItem: SetTabletItem:
@@ -132,4 +132,4 @@ DrawNarrowDroppedObject:
PLY PLY
.large_sprite .large_sprite
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -1,8 +1,6 @@
;================================================================================ ;================================================================================
; Utility Functions ; Utility Functions
;================================================================================ ;================================================================================
!PROGRESSIVE_SHIELD = "$7EF416" ; ss-- ----
;--------------------------------------------------------------------------------
; GetSpriteTile ; GetSpriteTile
; in: A - Loot ID ; in: A - Loot ID
; out: A - Sprite GFX ID ; out: A - Sprite GFX ID
@@ -60,7 +58,7 @@ RTL
+ +
LDA.b #$04 : RTL LDA.b #$04 : RTL
++ CMP.b #$FE : BNE ++ ; Progressive Sword ++ CMP.b #$FE : BNE ++ ; Progressive Sword
LDA SwordEquipment LDA HighestSword
CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JMP GetSpriteID JMP GetSpriteID
@@ -74,7 +72,7 @@ RTL
LDA.b #$46 : RTL LDA.b #$46 : RTL
+ +
++ : CMP.b #$FF : BNE ++ ; Progressive Shield ++ : CMP.b #$FF : BNE ++ ; Progressive Shield
LDA !PROGRESSIVE_SHIELD : AND #$C0 : LSR #6 LDA HighestShield
CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit
LDA.l ProgressiveShieldReplacement LDA.l ProgressiveShieldReplacement
JMP GetSpriteID JMP GetSpriteID
@@ -183,7 +181,7 @@ GetSpritePalette:
RTL RTL
.specialHandling .specialHandling
CMP.b #$FD : BNE ++ ; Progressive Sword CMP.b #$FD : BNE ++ ; Progressive Sword
LDA SwordEquipment LDA HighestSword
CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JMP GetSpritePalette JMP GetSpritePalette
@@ -196,7 +194,7 @@ RTL
+ ; Everything Else + ; Everything Else
LDA.b #$08 : RTL LDA.b #$08 : RTL
++ : CMP.b #$FE : BNE ++ ; Progressive Shield ++ : CMP.b #$FE : BNE ++ ; Progressive Shield
LDA !PROGRESSIVE_SHIELD : AND #$C0 : LSR #6 LDA HighestShield
CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit
LDA.l ProgressiveShieldReplacement LDA.l ProgressiveShieldReplacement
JMP GetSpritePalette JMP GetSpritePalette
@@ -207,7 +205,8 @@ RTL
+ ; Everything Else + ; Everything Else
LDA.b #$08 : RTL LDA.b #$08 : RTL
++ : CMP.b #$FF : BNE ++ ; Progressive Armor ++ : CMP.b #$FF : BNE ++ ; Progressive Armor
LDA ArmorEquipment : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit LDA HighestMail
CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit
LDA.l ProgressiveArmorReplacement LDA.l ProgressiveArmorReplacement
JMP GetSpritePalette JMP GetSpritePalette
+ : CMP.b #$00 : BNE + ; Green Tunic + : CMP.b #$00 : BNE + ; Green Tunic
@@ -307,19 +306,19 @@ IsNarrowSprite:
+ : JMP .continue + : JMP .continue
.notBottle .notBottle
CMP.b #$5E : BNE ++ ; Progressive Sword CMP.b #$5E : BNE ++ ; Progressive Sword
LDA SwordEquipment : CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit LDA HighestSword : CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement LDA.l ProgressiveSwordReplacement
JSL.l IsNarrowSprite JSL.l IsNarrowSprite
JMP .done JMP .done
+ : JMP .continue + : JMP .continue
++ CMP.b #$5F : BNE ++ ; Progressive Shield ++ CMP.b #$5F : BNE ++ ; Progressive Shield
LDA !PROGRESSIVE_SHIELD : AND #$C0 : BNE + : SEC : JMP .done ; No Shield LDA HighestShield : BNE + : JMP .done ; No Shield
+ : LSR #6 : CMP.l ProgressiveShieldLimit : !BLT .continue + : CMP.l ProgressiveShieldLimit : !BLT .continue
LDA.l ProgressiveShieldReplacement LDA.l ProgressiveShieldReplacement
JSL.l IsNarrowSprite JSL.l IsNarrowSprite
JMP .done JMP .done
++ CMP.b #$60 : BNE ++ ; Progressive Armor ++ CMP.b #$60 : BNE ++ ; Progressive Armor
LDA ArmorEquipment : CMP.l ProgressiveArmorLimit : !BLT .continue LDA HighestMail : CMP.l ProgressiveArmorLimit : !BLT .continue
LDA.l ProgressiveArmorReplacement LDA.l ProgressiveArmorReplacement
JSL.l IsNarrowSprite JSL.l IsNarrowSprite
JMP .done JMP .done