If you port an animation between FE 6/7/8, you may find that ported animation lacks sound, so you need to port the sound too. This tutorial focuses on how to get SFX ID. I will show you to find the sound id in the animation of King Zephiel.
I will demonstrate 2 ways to do that. The former is easy, for newbies; the latter is efficient, for veterans. You can get the address of a function here.
Dynamic Analysis
Tool
A debugger. This guide uses NO$GBA.
Step
- Turn off BGM and turn on SFX.
- Set a breakpoint at function m4aSongNumStart.
- Run the battle animation and the game will pause.
The value of r0 is the result: 0x263(611) & 0x267(615)
Static Analysis
Tool
IDA Pro
Step
- Dump the animation script with FEBuilderGBA
C3C #ε£γζ―γι³
C15 #η»ι’ζΊγγ ε°γγ
20 p- kinm_al1_007.png
6 p- kinm_al1_008.png
4 p- kinm_al1_009.png
C3D #FE7:γγ«γ¬γ«ζ»ζγ¨γγ§γ―γ εΉζι³γγ
C3C and C3D are sound commands. - Decompile function playBattleAnimationSFX(805BE7C in FE6)
case 0x3C:
LOWORD(v9) = 611;
if ( !v5 )
LOWORD(v9) = 610;
v11 = 128;
break;
case 0x3D:
LOWORD(v9) = 615;
if ( !v5 )
LOWORD(v9) = 614;
v11 = 128;
break;
the result is 610, 611, 614, 615