mirror of
https://github.com/pret/poketcg2.git
synced 2026-09-30 13:07:16 -05:00
Func_* labeling: name the overworld/animation frame-function cluster
Phase 1 pilot on bank 04's xref-referenced cluster. Named the two per-frame "frame functions" and their Set/Unset stack wrappers, using tcg2's existing FrameFunc_* / Set..FrameFunc / Unset..FrameFunc convention and confirming each by callers + named callees: Func_3a39 -> FrameFunc_Overworld (UpdateOWScroll + sprite anims + FadePalettes) Func_1109f -> SetOverworldFrameFunc (pushes it; OverworldLoop / CreditsCmd_InitOW) Func_110a8 -> UnsetOverworldFrameFunc (pops it; CreditsCmd_DeinitOW ...) Func_3a81 -> FrameFunc_AnimationQueue (gated on wActiveScreenAnim) Func_110b9 -> SetAnimationQueueFrameFunc (ResetAnimationQueue) Func_110c2 -> UnsetAnimationQueueFrameFunc (FinishQueuedAnimations) make compare: poketcg2.gbc OK (symbol-only, byte-identical). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -40,3 +40,15 @@ Renames are **byte-neutral** (`make compare` must stay OK after every batch).
|
||||
| Func_ | @bank:addr | new name | evidence | date |
|
||||
|---|---|---|---|---|
|
||||
| `Func_8f10` | `02:4f10` | `InitBoosterPacksAndDeckCounterSaveData` | tcg1 exact match (InitPromotionalCardAndDeckCounterSaveData), adapted to tcg2 SRAM | 2026-06-06 |
|
||||
| `Func_3a39` | `00:3a39` | `FrameFunc_Overworld` | per-frame OW update (UpdateOWScroll + sprite anims + FadePalettes); set by SetOverworldFrameFunc | 2026-06-06 |
|
||||
| `Func_1109f` | `04:509f` | `SetOverworldFrameFunc` | pushes FrameFunc_Overworld; callers OverworldLoop/CreditsCmd_InitOW | 2026-06-06 |
|
||||
| `Func_110a8` | `04:50a8` | `UnsetOverworldFrameFunc` | pops it; callers CreditsCmd_DeinitOW etc. | 2026-06-06 |
|
||||
| `Func_3a81` | `00:3a81` | `FrameFunc_AnimationQueue` | per-frame update during queued screen anims (gated on wActiveScreenAnim) | 2026-06-06 |
|
||||
| `Func_110b9` | `04:50b9` | `SetAnimationQueueFrameFunc` | pushes FrameFunc_AnimationQueue; caller ResetAnimationQueue | 2026-06-06 |
|
||||
| `Func_110c2` | `04:50c2` | `UnsetAnimationQueueFrameFunc` | pops it; caller FinishQueuedAnimations | 2026-06-06 |
|
||||
|
||||
## Progress
|
||||
- 2026-06-06: 7 named (1 tcg1-match + 6 overworld/animation frame-function cluster). 1,202 remaining.
|
||||
Pilot confirmed the xref workflow: callers + named callees + the frame-func convention
|
||||
resolve a cluster cleanly and byte-neutrally. The higher-level transition orchestrators
|
||||
(Func_1022a/10252/102a4/102c4) need their leaf callees named first (bottom-up).
|
||||
|
||||
@@ -99,7 +99,7 @@ StartMenu_ContinueFromDiary:
|
||||
farcall Func_1055e
|
||||
farcall UpdateOWScroll
|
||||
farcall SaveTargetFadePals
|
||||
farcall Func_1109f
|
||||
farcall SetOverworldFrameFunc
|
||||
call DoFrame
|
||||
ld a, OWMODE_CONTINUE_DUEL
|
||||
call ExecuteOWModeScript
|
||||
@@ -1242,7 +1242,7 @@ OverworldLoop::
|
||||
farcall Func_1055e
|
||||
farcall UpdateOWScroll
|
||||
farcall SaveTargetFadePals
|
||||
farcall Func_1109f
|
||||
farcall SetOverworldFrameFunc
|
||||
call DoFrame
|
||||
ld a, FALSE
|
||||
ld b, $00
|
||||
|
||||
@@ -292,7 +292,7 @@ Func_1022a:
|
||||
farcall SetAllOBPaletteFadeConfigsToEnabled
|
||||
farcall StartFadeToWhite
|
||||
farcall WaitPalFading_Bank07
|
||||
call Func_110a8
|
||||
call UnsetOverworldFrameFunc
|
||||
call Func_10ea7
|
||||
call Func_1059f
|
||||
call Func_10d40
|
||||
@@ -317,7 +317,7 @@ Func_10252:
|
||||
call Func_1055e
|
||||
call UpdateOWScroll
|
||||
call EnableLCD
|
||||
call Func_1109f
|
||||
call SetOverworldFrameFunc
|
||||
farcall SetAllBGPaletteFadeConfigsToEnabled
|
||||
farcall SetAllOBPaletteFadeConfigsToEnabled
|
||||
farcall StartFadeFromWhite
|
||||
@@ -3219,14 +3219,14 @@ UnsetFadePalsFrameFunc:
|
||||
call PopFrameFunction
|
||||
ret
|
||||
|
||||
Func_1109f::
|
||||
SetOverworldFrameFunc::
|
||||
push hl
|
||||
ld hl, Func_3a39
|
||||
ld hl, FrameFunc_Overworld
|
||||
call PushFrameFunction
|
||||
pop hl
|
||||
ret
|
||||
|
||||
Func_110a8::
|
||||
UnsetOverworldFrameFunc::
|
||||
call PopFrameFunction
|
||||
ret
|
||||
|
||||
@@ -3241,14 +3241,14 @@ UnsetSpriteAnimationAndFadePalsFrameFunc::
|
||||
call PopFrameFunction
|
||||
ret
|
||||
|
||||
Func_110b9::
|
||||
SetAnimationQueueFrameFunc::
|
||||
push hl
|
||||
ld hl, Func_3a81
|
||||
ld hl, FrameFunc_AnimationQueue
|
||||
call PushFrameFunction
|
||||
pop hl
|
||||
ret
|
||||
|
||||
Func_110c2::
|
||||
UnsetAnimationQueueFrameFunc::
|
||||
call PopFrameFunction
|
||||
ret
|
||||
|
||||
|
||||
@@ -5090,7 +5090,7 @@ Func_1e5a2::
|
||||
|
||||
RunDuelFromSRAM:
|
||||
farcall Stub_10cfe
|
||||
farcall Func_1109f
|
||||
farcall SetOverworldFrameFunc
|
||||
farcall Func_1022a
|
||||
bank1call StartDuelFromSRAM
|
||||
farcall Func_10252
|
||||
|
||||
@@ -8415,7 +8415,7 @@ Func_2fe9a:
|
||||
call .FadeToWhite
|
||||
.exit
|
||||
call WaitPalFading
|
||||
farcall Func_110a8
|
||||
farcall UnsetOverworldFrameFunc
|
||||
ret
|
||||
|
||||
.FadeToWhite:
|
||||
|
||||
@@ -748,7 +748,7 @@ Func_30452:
|
||||
farcall StartPalFadeToBlackOrWhite
|
||||
.wait_fade
|
||||
call WaitPalFading
|
||||
farcall Func_110a8
|
||||
farcall UnsetOverworldFrameFunc
|
||||
ret
|
||||
|
||||
.data
|
||||
@@ -873,7 +873,7 @@ DoGRBlimpMovement_GRIsland:
|
||||
call .FadeOut
|
||||
.finish
|
||||
call WaitPalFading
|
||||
farcall Func_110a8
|
||||
farcall UnsetOverworldFrameFunc
|
||||
ret
|
||||
|
||||
; fades out to white or black
|
||||
|
||||
@@ -1160,7 +1160,7 @@ Func_406d1:
|
||||
farcall StartPalFadeToBlackOrWhite
|
||||
.wait_fade
|
||||
call WaitPalFading
|
||||
farcall Func_110a8
|
||||
farcall UnsetOverworldFrameFunc
|
||||
ret
|
||||
|
||||
TCGIslandLocationPositions:
|
||||
@@ -1264,7 +1264,7 @@ DoGRBlimpMovement_TCGIsland:
|
||||
call .FadeOut
|
||||
.finish
|
||||
call WaitPalFading
|
||||
farcall Func_110a8
|
||||
farcall UnsetOverworldFrameFunc
|
||||
ret
|
||||
|
||||
; fades out to white or black
|
||||
@@ -5626,7 +5626,7 @@ Func_42f86:
|
||||
ld b, $04
|
||||
farcall StartPalFadeToBlackOrWhite
|
||||
call WaitPalFading
|
||||
farcall Func_110a8
|
||||
farcall UnsetOverworldFrameFunc
|
||||
scf
|
||||
ccf
|
||||
ret
|
||||
|
||||
@@ -389,11 +389,11 @@ CreditsCmd_LoadMap:
|
||||
|
||||
CreditsCmd_InitOW:
|
||||
call InitOWObjects
|
||||
call Func_1109f
|
||||
call SetOverworldFrameFunc
|
||||
ret
|
||||
|
||||
CreditsCmd_DeinitOW:
|
||||
call Func_110a8
|
||||
call UnsetOverworldFrameFunc
|
||||
ret
|
||||
|
||||
CreditsCmd_LoadTilemap:
|
||||
|
||||
@@ -556,7 +556,7 @@ WaitForOWObjectAnimation::
|
||||
Func_338f::
|
||||
push af
|
||||
farcall SaveTargetFadePals
|
||||
farcall Func_1109f
|
||||
farcall SetOverworldFrameFunc
|
||||
call DoFrame
|
||||
pop af
|
||||
ld b, $00
|
||||
@@ -567,7 +567,7 @@ Func_33a3::
|
||||
ld b, $00
|
||||
farcall StartPalFadeToBlackOrWhite
|
||||
call WaitPalFading
|
||||
farcall Func_110a8
|
||||
farcall UnsetOverworldFrameFunc
|
||||
ld a, EVENT_EF
|
||||
farcall ZeroOutEventValue
|
||||
ret
|
||||
@@ -1901,7 +1901,9 @@ FrameFunc_FadePals::
|
||||
pop af
|
||||
ret
|
||||
|
||||
Func_3a39::
|
||||
; per-frame overworld update (set as the frame function via SetOverworldFrameFunc):
|
||||
; scrolls the map, updates the OW object / sprite animations, and fades palettes
|
||||
FrameFunc_Overworld::
|
||||
push af
|
||||
push bc
|
||||
push de
|
||||
@@ -1942,7 +1944,9 @@ FrameFunc_SpriteAnimationAndFadePals::
|
||||
pop af
|
||||
ret
|
||||
|
||||
Func_3a81::
|
||||
; per-frame update while queued screen animations play (set via
|
||||
; SetAnimationQueueFrameFunc); only updates sprite anims when none is active
|
||||
FrameFunc_AnimationQueue::
|
||||
push af
|
||||
push bc
|
||||
push de
|
||||
@@ -2292,7 +2296,7 @@ ResetAnimationQueue::
|
||||
push af
|
||||
call FinishQueuedAnimations
|
||||
farcall Func_1dfb9
|
||||
farcall Func_110b9
|
||||
farcall SetAnimationQueueFrameFunc
|
||||
ld a, $01
|
||||
ld [wdc57], a
|
||||
pop af
|
||||
@@ -2303,7 +2307,7 @@ FinishQueuedAnimations::
|
||||
ld a, [wdc57]
|
||||
and a
|
||||
jr z, .asm_3c60
|
||||
farcall Func_110c2
|
||||
farcall UnsetAnimationQueueFrameFunc
|
||||
.asm_3c60
|
||||
xor a
|
||||
ld [wdc57], a
|
||||
|
||||
Reference in New Issue
Block a user