Stats: Track chest turns

This commit is contained in:
Bonta
2021-06-22 02:31:52 +02:00
parent 14844400b3
commit cc12372627
3 changed files with 18 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ db #$20, #$19, #$08, #$31 ; year/month/day
!SRAM_SINK = "$7EF41E" ; <- change this (conflicts with Programmable item 3)
;$7EF418 - Goal Item Counter
;$7EF419 - Service Sequence
;$7EF420 - $7EF466 - Stat Tracking Bank 1 (overlaps with RNG Item Flags)
;$7EF420 - $7EF468 - Stat Tracking Bank 1 (overlaps with RNG Item Flags)
;$7EF450 - $7EF45F - RNG Item (Single) Flags
;$7EF4A0 - $7EF4A7 - Service Request Block
!FRESH_FILE_MARKER = "$7EF4F0" ; zero if fresh file

View File

@@ -234,6 +234,11 @@ PostItemAnimation:
LDA.b #$00 : STA $7F509F
+
LDA.w $02E9 : CMP.b #$01 : BNE +
LDA.b $2F : BEQ +
JSL.l IncrementChestTurnCounter
+
STZ $02E9 : LDA $0C5E, X ; thing we wrote over to get here
RTL
;--------------------------------------------------------------------------------

View File

@@ -1,7 +1,7 @@
;================================================================================
; Stat Tracking
;================================================================================
; $7EF420 - $7EF466 - Stat Tracking
; $7EF420 - $7EF468 - Stat Tracking
;--------------------------------------------------------------------------------
; $7EF420 - bonk counter
;--------------------------------------------------------------------------------
@@ -137,6 +137,8 @@
;--------------------------------------------------------------------------------
; $7EF466w[2] - mirror timestamp (high)
;--------------------------------------------------------------------------------
; $7EF468 - chest turn counter
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
!LOCK_STATS = "$7EF443"
@@ -324,6 +326,15 @@ IncrementFairyRevivalCounter:
PLA
RTL
;--------------------------------------------------------------------------------
!CHESTTURN_COUNTER = "$7EF468"
IncrementChestTurnCounter:
PHA
LDA !LOCK_STATS : BNE +
LDA !CHESTTURN_COUNTER : INC : STA !CHESTTURN_COUNTER
+
PLA
RTL
;--------------------------------------------------------------------------------
!CHEST_COUNTER = "$7EF442"
IncrementChestCounter:
LDA.b #$01 : STA $02E9 ; thing we wrote over