diff --git a/FUNC_LABELS.md b/FUNC_LABELS.md index f2a6504..c89b741 100644 --- a/FUNC_LABELS.md +++ b/FUNC_LABELS.md @@ -57,8 +57,16 @@ Renames are **byte-neutral** (`make compare` must stay OK after every batch). | `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 | +| `Func_6fa5` | `01:6fa5` | `TakePrizesForKnockedOutPokemon` | body: CountKnockedOutPokemon + TurnDuelistTakePrizes + "Took all the Prizes"; caller HandleBetweenTurnKnockOuts | 2026-06-06 | +| `Func_6986` | `01:6986` | `TriggerPlayedEnergyCardEffect` | runs played card's PKMN_POWER_TRIGGER effect; callers PlayEnergyCard / OppAction_PlayEnergyCard | 2026-06-06 | +| `Func_1bb4` | `00:1bb4` | `RedrawDuelSceneAndPrintFailedEffect` | DrawDuelMainScene/HUDs + PrintFailedEffectText; caller HandleConfusionDamageToSelf | 2026-06-06 | +| `Func_12c36a` | `4b:436a` | `AdvanceToNextSpriteAnimFrame` | inc frame index + GetFramesetData; caller DecrementSpriteAnimFrameDuration | 2026-06-06 | +| `Func_fc094` | `7e:40ec` | `ExecuteNextSFXCommand` | tcg1 exact match; SFX command dispatcher | 2026-06-06 | +| `Func_fc094_2` | `7f:40ec` | `ExecuteNextSFX2Command` | bank-$7f SFX2 copy of the above | 2026-06-06 | ## Progress +- 2026-06-06: 13 named. 1,196 remaining. Latest batch (6) used the dynamic call graph + (cg.txt from a duel session) + tcg1 as a semantic reference for the duel-engine funcs. - 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 diff --git a/src/audio/sfx1.asm b/src/audio/sfx1.asm index d557dac..a138936 100644 --- a/src/audio/sfx1.asm +++ b/src/audio/sfx1.asm @@ -140,7 +140,7 @@ SFX_Update: ld a, [hli] ld h, [hl] ld l, a - call Func_fc094 + call ExecuteNextSFXCommand .asm_fc08d inc c ld a, c @@ -148,7 +148,7 @@ SFX_Update: jr nz, .asm_fc06c ret -Func_fc094: +ExecuteNextSFXCommand: ld a, [hl] and $f0 swap a @@ -186,7 +186,7 @@ SFX_CommandTable: dw SFX_end SFX_unused: - jp Func_fc094 + jp ExecuteNextSFXCommand SFX_frequency: ld d, a @@ -260,7 +260,7 @@ SFX_envelope: ld l, a ld [hl], e pop hl - jp Func_fc094 + jp ExecuteNextSFXCommand SFX_duty: swap a @@ -274,7 +274,7 @@ SFX_duty: ld l, a ld [hl], e pop hl - jp Func_fc094 + jp ExecuteNextSFXCommand SFX_loop: ld hl, wde43 @@ -291,7 +291,7 @@ SFX_loop: ld [hl], a ld l, e ld h, d - jp Func_fc094 + jp ExecuteNextSFXCommand SFX_endloop: ld hl, wde3f @@ -307,10 +307,10 @@ SFX_endloop: ld h, [hl] ld l, a pop de - jp Func_fc094 + jp ExecuteNextSFXCommand .asm_fc162 pop hl - jp Func_fc094 + jp ExecuteNextSFXCommand SFX_pitch_offset: ld hl, wde2f @@ -320,7 +320,7 @@ SFX_pitch_offset: pop hl ld a, [hli] ld [de], a - jp Func_fc094 + jp ExecuteNextSFXCommand SFX_wait: ld a, c @@ -465,7 +465,7 @@ SFX_wave: ldh [rAUD3ENA], a ld b, $0 pop hl - jp Func_fc094 + jp ExecuteNextSFXCommand SFX_pan: pop hl @@ -489,13 +489,13 @@ SFX_pan: ld [hl], a pop bc pop hl - jp Func_fc094 + jp ExecuteNextSFXCommand SFX_sweep: pop hl ld a, [hli] ldh [rAUD1SWEEP], a - jp Func_fc094 + jp ExecuteNextSFXCommand SFX_end: ld e, c diff --git a/src/audio/sfx2.asm b/src/audio/sfx2.asm index 52b5d3a..de71886 100644 --- a/src/audio/sfx2.asm +++ b/src/audio/sfx2.asm @@ -140,7 +140,7 @@ SFX2_Update: ld a, [hli] ld h, [hl] ld l, a - call Func_fc094_2 + call ExecuteNextSFX2Command .asm_fc08d inc c ld a, c @@ -148,7 +148,7 @@ SFX2_Update: jr nz, .asm_fc06c ret -Func_fc094_2: +ExecuteNextSFX2Command: ld a, [hl] and $f0 swap a @@ -186,7 +186,7 @@ SFX2_CommandTable: dw SFX2_end SFX2_unused: - jp Func_fc094_2 + jp ExecuteNextSFX2Command SFX2_frequency: ld d, a @@ -260,7 +260,7 @@ SFX2_envelope: ld l, a ld [hl], e pop hl - jp Func_fc094_2 + jp ExecuteNextSFX2Command SFX2_duty: swap a @@ -274,7 +274,7 @@ SFX2_duty: ld l, a ld [hl], e pop hl - jp Func_fc094_2 + jp ExecuteNextSFX2Command SFX2_loop: ld hl, wde43 @@ -291,7 +291,7 @@ SFX2_loop: ld [hl], a ld l, e ld h, d - jp Func_fc094_2 + jp ExecuteNextSFX2Command SFX2_endloop: ld hl, wde3f @@ -307,10 +307,10 @@ SFX2_endloop: ld h, [hl] ld l, a pop de - jp Func_fc094_2 + jp ExecuteNextSFX2Command .asm_fc162 pop hl - jp Func_fc094_2 + jp ExecuteNextSFX2Command SFX2_pitch_offset: ld hl, wde2f @@ -320,7 +320,7 @@ SFX2_pitch_offset: pop hl ld a, [hli] ld [de], a - jp Func_fc094_2 + jp ExecuteNextSFX2Command SFX2_wait: ld a, c @@ -465,7 +465,7 @@ SFX2_wave: ldh [rAUD3ENA], a ld b, $0 pop hl - jp Func_fc094_2 + jp ExecuteNextSFX2Command SFX2_pan: pop hl @@ -489,13 +489,13 @@ SFX2_pan: ld [hl], a pop bc pop hl - jp Func_fc094_2 + jp ExecuteNextSFX2Command SFX2_sweep: pop hl ld a, [hli] ldh [rAUD1SWEEP], a - jp Func_fc094_2 + jp ExecuteNextSFX2Command SFX2_end: ld e, c diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index 3883593..f53b796 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -694,7 +694,7 @@ PlayEnergyCard: ld a, OPPACTION_PLAY_ENERGY call SetOppAction_SerialSendDuelData farcall PrintAttachedEnergyToPokemon - call Func_6986 + call TriggerPlayedEnergyCardEffect jp DuelMainInterface .rain_dance_active @@ -6032,7 +6032,7 @@ HandleBetweenTurnKnockOuts: ret .Func_6ef6: - call Func_6fa5 + call TakePrizesForKnockedOutPokemon ld hl, wDuelFinishParam rl [hl] ret @@ -6142,7 +6142,9 @@ ReplaceKnockedOutPokemon: ldh [hTempPlayAreaLocation_ff9d], a jr .replace_pokemon -Func_6fa5: +; has the (swapped-to) turn duelist take prizes for the just-knocked-out Pokemon; +; prints "Took all the Prizes" and returns carry if that claimed their last prize +TakePrizesForKnockedOutPokemon: call CountKnockedOutPokemon ret nc ; at least one Pokemon knocked out @@ -6725,7 +6727,8 @@ LoadNonPokemonCardEffectCommands: ld [wcd15], a ret -Func_6986: +; runs the just-played energy card's on-play (PKMN_POWER_TRIGGER) effect command, if it has one +TriggerPlayedEnergyCardEffect: ldh a, [hTempCardIndex_ff98] ldh [hDuelActionCardIndex], a call LoadNonPokemonCardEffectCommands diff --git a/src/engine/bank09.asm b/src/engine/bank09.asm index 4ec6a63..1e7732b 100644 --- a/src/engine/bank09.asm +++ b/src/engine/bank09.asm @@ -583,7 +583,7 @@ OppAction_PlayEnergyCard: ld a, TRUE ld [wAlreadyPlayedEnergy], a bank1call DrawDuelMainScene - bank1call Func_6986 + bank1call TriggerPlayedEnergyCardEffect ret OppAction_EvolvePokemonCard: diff --git a/src/engine/bank4b.asm b/src/engine/bank4b.asm index 2c6df01..b753ccb 100644 --- a/src/engine/bank4b.asm +++ b/src/engine/bank4b.asm @@ -622,7 +622,7 @@ DecrementSpriteAnimFrameDuration: ld [wCurSpriteAnimFrameDuration], a and a ret nz - call Func_12c36a + call AdvanceToNextSpriteAnimFrame ret Func_12c35c: @@ -633,7 +633,8 @@ Func_12c35c: ret nz ld a, -1 ld [wCurSpriteAnimFrameIndex], a -Func_12c36a: +; advance the current sprite animation to its next frame and reload that frame's data +AdvanceToNextSpriteAnimFrame: ld a, [wCurSpriteAnimFrameIndex] inc a ld [wCurSpriteAnimFrameIndex], a diff --git a/src/home/duel.asm b/src/home/duel.asm index be368ec..cf4def3 100644 --- a/src/home/duel.asm +++ b/src/home/duel.asm @@ -1458,7 +1458,7 @@ Func_17fb: ld [wNoDamageOrEffect], a bank1call ProcessEffectsTriggeredByTakingDamage bank1call ApplyStatusConditionQueue - call Func_1bb4 + call RedrawDuelSceneAndPrintFailedEffect bank1call UpdateArenaCardLastTurnDamage bank1call HandleDestinyBondAndBetweenTurnKnockOuts or a @@ -1496,7 +1496,7 @@ HandleConfusionDamageToSelf:: pop hl ld a, l call DealConfusionDamageToSelf - call Func_1bb4 + call RedrawDuelSceneAndPrintFailedEffect bank1call HandleDestinyBondAndBetweenTurnKnockOuts bank1call ClearNonTurnTemporaryDuelvars or a @@ -2061,7 +2061,8 @@ DealDamageToPlayAreaPokemon_GotPlayAreaLocation:: pop hl ret -Func_1bb4: +; redraws the duel scene + HUDs and prints the arena Pokemon's "failed effect" text +RedrawDuelSceneAndPrintFailedEffect: call FinishQueuedAnimations bank1call DrawDuelMainScene bank1call DrawDuelHUDs