Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
ff3:ff3us:doc:asm:codes:battle_animation_script [2019/02/12 09:00] 127.0.0.1 external edit |
ff3:ff3us:doc:asm:codes:battle_animation_script [2023/10/10 03:51] (current) c-dude Added warning that animation subroutines cannot point to other subroutines |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Battle Animation Commands ====== | ====== Battle Animation Commands ====== | ||
+ | The first two bytes of an animation script are a header that determines the speed and alignment of the animation. The real script starts after that. | ||
+ | Of this, animation speed is the high nibble of the first byte. Alignment is the highest 3 bits of the second byte. All of the other bits appear to be unused. | ||
+ | After this header, the bytes of the animation script behave as follows: | ||
< | < | ||
$00-$1F | $00-$1F | ||
Line 17: | Line 19: | ||
$0A $D82B white/ | $0A $D82B white/ | ||
$0B $D7E3 Update Esper Pre-Animation Balls Position | $0B $D7E3 Update Esper Pre-Animation Balls Position | ||
- | $0C $D753 | + | $0C $D753 move to first sprite thread position |
$0D $D7C4 | $0D $D7C4 | ||
$0E $D79D | $0E $D79D | ||
Line 23: | Line 25: | ||
$10 $D73E move to target position | $10 $D73E move to target position | ||
$11 $D727 Randomize vector angle | $11 $D727 Randomize vector angle | ||
- | $12 $D734 | + | $12 $D734 init polar movement |
$13 $D6E5 toggle imp graphics for target (imp) | $13 $D6E5 toggle imp graphics for target (imp) | ||
$14 $D6BD make target vanish (vanish) | $14 $D6BD make target vanish (vanish) | ||
Line 35: | Line 37: | ||
$1C $CB6A decrement screen brightness | $1C $CB6A decrement screen brightness | ||
$1D $CB61 transform into magicite | $1D $CB61 transform into magicite | ||
- | $1E $D56B | + | $1E $D56B scroll bg3 for pearl |
- | $1F $D5FC | + | $1F $D5FC init bg3 hdma scroll data for pearl (horizontal) |
- | $20 $D59F | + | $20 $D59F init bg3 hdma scroll data for pearl (vertical) |
$21 $D54E Update Rotating Sprite Layer Priority | $21 $D54E Update Rotating Sprite Layer Priority | ||
$22 $D4F2 pearl wind | $22 $D4F2 pearl wind | ||
Line 67: | Line 69: | ||
$38 $D24D enable high priority bg3 (justice) | $38 $D24D enable high priority bg3 (justice) | ||
$39 xx $D1E6 update blue gradient lines (S. Cross, Carbunkl, Odin/ | $39 xx $D1E6 update blue gradient lines (S. Cross, Carbunkl, Odin/ | ||
- | $3A xx | + | $3A xx |
$3B $D1B0 Set target' | $3B $D1B0 Set target' | ||
$3C $D18A Set target' | $3C $D18A Set target' | ||
Line 86: | Line 88: | ||
$48 $CF8D clear | $48 $CF8D clear | ||
$49 $CF7F ink hit/virite | $49 $CF7F ink hit/virite | ||
- | $4A $CF6A | + | $4A $CF6A disable stepping forward to attack for all characters |
$4B $D2CC update red/yellow gradient lines (megazerk) | $4B $D2CC update red/yellow gradient lines (megazerk) | ||
$4C $CF45 move triangle to thread position | $4C $CF45 move triangle to thread position | ||
$4D $CF1C set vector from triangle to target | $4D $CF1C set vector from triangle to target | ||
- | $4E $CF15 | + | $4E $CF15 clear frame offset |
- | $4F $CEF0 | + | $4F $CEF0 move to attacking character position |
- | $50 $CE9A | + | $50 xx $CE9A |
$51 $CE62 rippler | $51 $CE62 rippler | ||
$52 $CE29 stone | $52 $CE29 stone | ||
Line 113: | Line 115: | ||
$63 xx $D361 move in narrow vertical sine wave with speed xx (evil toot) | $63 xx $D361 move in narrow vertical sine wave with speed xx (evil toot) | ||
$64 $CBE5 purifier/ | $64 $CBE5 purifier/ | ||
- | $65 $CBE0 | + | $65 $CBE0 change rainbow palette |
$66 $CBDB shock wave | $66 $CBDB shock wave | ||
$67 $CBD6 Load Extra Esper Palette (purifier) | $67 $CBD6 Load Extra Esper Palette (purifier) | ||
Line 184: | Line 186: | ||
$99 ----ppp- | $99 ----ppp- | ||
$9A $FC40 Set Thread Facing Direction to Match Attacker | $9A $FC40 Set Thread Facing Direction to Match Attacker | ||
- | $9B | + | $9B xx |
$9C xx $F2A2 | $9C xx $F2A2 | ||
$9D xx $F2F1 | $9D xx $F2F1 | ||
- | $9E | + | $9E xx |
$9F xx $F7CF Animated Loop start (loop count equal to the number of active threads, xx = 0) (autocrossbow) | $9F xx $F7CF Animated Loop start (loop count equal to the number of active threads, xx = 0) (autocrossbow) | ||
$A0 xx yy $FA4B Jump Forward Along Vector (speed xx, code branch yy) | $A0 xx yy $FA4B Jump Forward Along Vector (speed xx, code branch yy) | ||
Line 266: | Line 268: | ||
$BE xx $EA98 Set Screen Mosaic to xx ($2106) | $BE xx $EA98 Set Screen Mosaic to xx ($2106) | ||
$BF xxxx $EA85 Jump to Subroutine $xxxx | $BF xxxx $EA85 Jump to Subroutine $xxxx | ||
+ | NOTE! Animations can only handle one layer of subroutine! | ||
+ | As such, animation subroutines cannot lead to other subroutines, | ||
+ | meaning you can't use them as easy hooks to amend an existing animation! | ||
+ | If you're changing an animation and you need more bytes, | ||
+ | you're going to have to relocate it to another spot in the D0 bank instead. | ||
$C0 $EA76 Return from Subroutine | $C0 $EA76 Return from Subroutine | ||
$C1 xx yy $EA05 xx = vector movement speed ???, yy = number of bytes to branch backwards | $C1 xx yy $EA05 xx = vector movement speed ???, yy = number of bytes to branch backwards | ||
Line 299: | Line 306: | ||
$C8 xx $E7B1 Set attacker modified graphic index | $C8 xx $E7B1 Set attacker modified graphic index | ||
$C9 xx $DAE4 Play sound effect xx ($00 means play default for this animation) | $C9 xx $DAE4 Play sound effect xx ($00 means play default for this animation) | ||
- | $CA | + | $CA xx |
$CB eddddddd | $CB eddddddd | ||
e: 1 = enable, 0 = disable | e: 1 = enable, 0 = disable | ||
Line 341: | Line 348: | ||
| | ||
$D5 ------vh | $D5 ------vh | ||
- | $D6 | + | $D6 xx yy $E6CD scroll background to (xx,yy), typically used to shake the screen |
$D7 xx $E68D Move Fire Dance Sprites | $D7 xx $E68D Move Fire Dance Sprites | ||
$D8 xx yy zz $E5F9 x: x speed, y: y speed, z: ??? | $D8 xx yy zz $E5F9 x: x speed, y: y speed, z: ??? | ||
Line 353: | Line 360: | ||
$E0 xx yy dd rr $E3A0 Modify Triangle | $E0 xx yy dd rr $E3A0 Modify Triangle | ||
$E1 xx $E328 show/hide attacker sprite | $E1 xx $E328 show/hide attacker sprite | ||
- | $E2 $DD8D | + | $E2 |
- | $E3 $DD42 | + | $E3 |
- | $E4 | + | $E4 |
$E5 xx yy zz $E15D yy = number of bytes to branch backwards | $E5 xx yy zz $E15D yy = number of bytes to branch backwards | ||
$E6 xx yy zz $E1B3 yy = number of bytes to branch backwards | $E6 xx yy zz $E1B3 yy = number of bytes to branch backwards | ||
- | $E7 | + | $E7 |
$E8 rr tt $DCDF Move rr,tt in polar coordinates (radius, | $E8 rr tt $DCDF Move rr,tt in polar coordinates (radius, | ||
$E9 xx yy $DC9B Move randomly (0...xx, | $E9 xx yy $DC9B Move randomly (0...xx, | ||
Line 371: | Line 378: | ||
$EF rr tt $DCD9 similar to $E8 | $EF rr tt $DCD9 similar to $E8 | ||
$F0 5 words $DB6C Jump based on current target index (char1, char2, char3, char4, monster) | $F0 5 words $DB6C Jump based on current target index (char1, char2, char3, char4, monster) | ||
- | $F1 xx | + | $F1 m------s |
+ | m = affect monster | ||
+ | s = show sprite | ||
$F2 $F980 Set a trajectory from target center to attacker | $F2 $F980 Set a trajectory from target center to attacker | ||
$F3 5 words $DB64 Jump based on current attacker index (char1, char2, char3, char4, monster) | $F3 5 words $DB64 Jump based on current attacker index (char1, char2, char3, char4, monster) | ||
Line 379: | Line 388: | ||
$F7 xx $DB50 Wait until vertical scanline position xx | $F7 xx $DB50 Wait until vertical scanline position xx | ||
$F8 xxxx yyyy $DB31 Jump to either xxxx or yyyy if magitek mode is enabled | $F8 xxxx yyyy $DB31 Jump to either xxxx or yyyy if magitek mode is enabled | ||
- | $F9 xx yy zz $DAF9 | + | $F9 xx yy zz $DAF9 set attacker magitek armor action to xx |
$FA xxxx $DB23 Jump to $xxxx | $FA xxxx $DB23 Jump to $xxxx | ||
$FB rgbfffff | $FB rgbfffff |