Touched
Resident ASMAGICIAN
- 625
- Posts
- 10
- Years
- Age 123
- Seen Feb 1, 2018
While working on Megas, I started writing a list of all the animation commands. While I still don't understand exactly what many of them do, I have compiled an accurate list of all the commands and the arguments they take. This should be enough information to get a basic animation script decompiler working, and therefore allowing research into what moves use which commands. This will help in understanding each commands functionality.
The table of commands are at 083ADF5C in FireRed, 08525E98 in Emerald and 083ADF3C in LeafGreen (Lost Heart).
There are 0x2F commands in all versions.
Each command seems to be responsible for advancing the cursor itself.
This allows commands to wait and re-execute themselves (like wait animation). This also seems to make the nops cmd6 and cmd7 broken, as they just return without adjusting the cursor.
All addresses referenced in the document below are for FireRed.
Next steps should be thinking of names for each command, and then building a basic decompiler/compiler.
The table of commands are at 083ADF5C in FireRed, 08525E98 in Emerald and 083ADF3C in LeafGreen (Lost Heart).
There are 0x2F commands in all versions.
Each command seems to be responsible for advancing the cursor itself.
This allows commands to wait and re-execute themselves (like wait animation). This also seems to make the nops cmd6 and cmd7 broken, as they just return without adjusting the cursor.
All addresses referenced in the document below are for FireRed.
Code:
00: Load Graphics
short: graphics
01: Unload graphics
short: graphics
02: Load Template
long: template - Pointer to the template to load
byte: ?
byte: argc - Argument Count
short * argc: argv - Vardiac Arguments - copied to
ma02_t0_02037F02
03: Launch Task
long: funcptr (void(*)(u8)) - Task to call
byte: pri - Task Priority
byte: argc - Argument Count
short * argc: argv - Variadic Arguments for function - copied
to ma02_t0_02037F02
04: Countdown (Pause)
byte: time/frames
05: Wait Animaion
Void
06: Nop (might break; doesn't advance the cursor)
Void
07: Nop (might break; doesn't advance the cursor)
Void
08: End
Void
09: Play Sound
short: Sound to play
0A: ???
byte: ???
0B: Clear bitfield except visiblity
byte: Target
0C: Set BLDCNT and BLDALPHA
BLDCNT = 0x3F40
short: BLDALPHA
0D: Reset blends
Void
0E: Call (Doesn't have a call stack. Can only call and return once)
long: pointer to target
0F: Return
Void
10: Set ma02_t0_02037F02
byte: Index in ma02_t0_02037F02
short: Value
11: If byte_2037F16
long: location to jump to if byte_2037F16 & 1
12: Conditional If
byte: condition
long: location to jump to if byte_2037F16 == cond
13: Goto
long: pointer
14: Load Background
byte: bg id
15: Load battle screen elements - I guess it resets
Void
16: Wait for battle screen elements
wait for is_battle_screen_elements_loader_running == 2
Void
17: Wait for battle screen elements
wait for is_battle_screen_elements_loader_running = 0
18: Load background
byte bg index
19: Audio Play and Stuff
short: sound
byte: I don't even know
1A: ???
byte: ???
1B: ??? - Audio Related. Adds a task
short: sound
byte: ???
byte: ???
byte: ???
byte: ???
1C: ??? - Adds a task
short: ???
byte: ???
byte: ???
byte: ???
1D: ??? - Task sub_8074028
short: ???
byte: ???
byte: ???
1E: Set BLDCNT
short: BLDCNT
1F: Start a sub task
long: pointer - task
byte: argc
short * argc: Variadic Arguments
20: Wait for something (audio related)
Void
21: Check ma02_t0_02037F02
byte: index in ma02_t0_02037F02
short: value to check
long: pointer - jumps here if ma02_t0_02037F02[index] == short
22: Conditional form of cmd0b?
byte: Target
23: Similar to cmd22
byte: Target
24: Nop Skip 4
long: Skip
25: Set background for attacker/defender
byte: bg if defender
byte: bg if attacker
short: nothing
26: Launch task c3_08073CEC (audio related)
short: Song to play
byte: priv[0], priv[4] and second arg to audio_play_and_stuff
byte: priv[1]
byte: priv[2]
byte: priv[3]
27: Similar to cmd26 but runs through some functions first
short: song to play
byte: ???
byte: ???
byte: ???
byte: ???
28: LCD bg operations for each side something
byte: Side
29: LCD bg operations above, except unconditional
Void
2A: Similar to cmd28
byte: Side
2B: Make side invisible
byte: side
2C: Make side visible
byte: side
2D: Visibility something
byte: side
2E: Something with oam attrs
byte: side
2F: Stop music
Void
Last edited: