******************************************** LightPhoenix's Spell Animation Guide v0.8 ******************************************** This guide can and should be publically available and dispersed, so long as it is properly attributed. Many thanks to Jorgur, Lenophis, and samurai_goroh for their work, which have proved invaluable in decoding this information. It would not have been possible without them. Notepad++ is recommended, but not required, to view this file. Table of Contents: - Effect Master Table - Color Table - Effect Special Table - Effect Routine Table - Effect Routine Header - Animation Shape Table - Effect Command List - Effect Commands Changelog: v0.8 - Moved Weapon information to separate file - Removed most tables to reference files - General updates to spell animations from assembly analysis - Updated some unknown spell commands based on assembly - Changed some terminology to clarify function - Information on Master Table Byte 4 v0.7 - General updates to spell animations - 62/128 Effect Commands v0.6 - Added Effect Master Table, Effect Routine Table - Added Weapon Information - Removed Effect Master Table text - Renamed sections for clarity v0.5 First Version - Master Table Information - Routine Header Information (Bytes 1 and 2) - 42/128 Special Commands ******************************************** Effect Master Table (D8/38EC) ******************************************** This table contains general information used in playing effects (spells, abilities, etc). Each entry is five bytes long. Byte 1: Effect Sprite Byte 2: Effect Color (see below) Byte 3: Effect Routine (see below) Byte 4: Effect Special (see below) Byte 5: Effect Sound ******************************************** Color Table (D1/A3A0) ******************************************** A series of eight two-byte values indicating color palettes in standard SNES format (xbbbbbgggggrrrrr). Maximum value is 7F, based on the assembly. Used in both Master Tables. ******************************************** Effect Special Byte ******************************************** This byte contains special graphical processing information for use both inside and outside of the effect routines (Meteo red pulsing shadow). It also includes processing for multi-sprite animations; each mote runs the animation routine. Three parts: #3F Indirect call for effects (main workhorse) #40 Unknown #80 Double animation speed (speed up) Each entry below is byte, effect. The table is at C1/B830. Note: Though technically the assembly allows for values up to 3F, there are no functions for 39-3F. There is code where those values would be. SPECIAL NOTE: Changing this byte can crash the game. Use with care. 00: No special processing 01: Ring - Four motes, equidistant (Charm) Burst - Eight motes, equidistant (Summon/Blue) 02: Eight motes, random stagger (White) 03: Four motes, four routines (Berserk) Each mote runs one routine Consecutive Effect Routines (ie 3B, 3C, 3D, 3E) 04: Dragon Sword Anything else will glitch 05: Eight motes, no stagger, short pause (GP Rain) 06: Four motes, four routines, ordered stagger (Allure/Flirt) 07: Eight motes, no stagger, no pause (Slash) 08: See 02 (Flare) 09: Three motes, six routines, ordered stagger (Squirrel) First three routines - move motes right to left Second three routines - creature mask, hit sprites 0A: One mote, two routines (Falcon) First routine - move mote Second routine - hit sprites, target animation 0B: Two motes, four routines, ordered stagger (Wild Boar) 0C: (Unicorn) 0D: (Ice2) 0E: Eight motes, no stagger (Drain/Psych) 0F: (Slow/Slow2) ******************************************** Effect Routine Header ******************************************** Byte 1: Animation Shape (table at C1/B31D) Byte 2: Animation Speed (larger = slower) Byte 3: Animation Shape: This number refers to a lookup table at C1/B31C, and contains two one-byte values; the width and height of the animation, respectively. The maximum value of this field is 3F, based on the assembly (the value gets ANDed with 3F). Can be overridden by the routine; see the special commands below (specifically, C3). Animation Speed: Denotes the speed at which to play the animation. Larger numbers indicate slower animation speeds. Can be overridden by the routine; see the special commands below (specifically, 88). Byte 3: Unknown at this time, called multiple times by assembly. Likely two values, bytes 0-4 and bytes 5-7 (based on assembly). ******************************************** Animation Shape Table (C1/B31C) Byte 1: Width Byte 2: Height ******************************************** 00: 03 03 01: 02 04 02: 07 03 03: 02 02 04: 01 01 05: 06 06 06: 10 0a 07: 05 05 08: 05 06 09: 01 02 0A: 05 03 0B: 01 0a 0C: 0a 0a 0D: 04 0a 0E: 02 0b 0F: 04 04 10: 03 04 11: 03 05 12: 01 0b 13: 06 03 14: 06 05 15: 04 07 16: 04 02 17: 01 03 18: 06 0a 19: 02 03 1A: 04 08 1B: 04 03 1C: 02 01 1D: 05 02 1E: 04 05 1F: 09 01 20: 03 09 21: 02 02 22: 05 04 23: 0b 07 24: 03 01 25: 03 08 26: 0c 07 27: 06 02 28: 08 02 29: 0a 03 2A: 0c 05 2B: 0e 05 2C: 10 05 2D: 08 05 2E: 08 03 2F: 0a 05 30: 09 01 31: 04 08 32: 0c 01 33: 02 0a 34: 0b 0a 35: 02 09 36: 8d 61 37: cf 8d 38: 81 cf 39: 8d a1 3A: cf 8d 3B: c1 cf 3C: 60 60 3D: 00 50 3E: 00 60 3F: 00 50 ******************************************** Effect Command List ******************************************** Note: Parentheses indicate function may be unused. XX/YY indicates the next byte(s) is a parameter (ie 80 0A) FF indicates *preceding* byte(s) MUST be a sprite (ie 01 97) {} indicates variable number of bytes afterward [] indicates presumed function (but see notes) ** indicates to see notes below 80 XX Target Mask 81 XX (Background Effect) 82 XX Shadow Effect 83 XX Animation Color 84 XX Shake Effect 85 XX Wave Effect 86 XX Ripple Effect 87 XX [Box Fill Effect] 88 XX Set Animation Speed 89 XX (Set Mid-Animation Speed) 8A XX (Set Random Animation Speed) 8B XX Offset Animation 8C XX Pixelate Effect 8D (No Function) 8E XX Random Horizontal Offset 8F No Function 90 Palette Shift Left 91 Palette Shift Right 92 Init Burst Effect 93 FF Burst Effect 94 Init Rotating Burst Effect 95 FF Rotating Burst Effect 96 Init Ring Effect 97 FF Ring Effect 98 (Back Four Commands) 99 Life Command (see below) 9A Init Dragon Sword Effect 9B FF Dragon Sword Effect 9C Path Caster to Target 9D ** Animated Linear Move (4f) 9E Path Caster to Target 9F FF Unanimated Sinusoidal Move A0 Init Random Implode A1 FF Linear Implode Inward A2 Low Sprite Priority A3 Clear Sprite Priority A4 Set Sprite Priority A5 Unanimated Ring Effect A6 [Random Sprite Priority] A7 Init Ordered Implode B A8 FF Spiral Implode Inward A9 Path Target to Caster AA FF Simple Animated Linear Move (2f) AB Start Target Dissolve AC ** Animated Linear Move (2f) AD FF Animated Sinusoidal Move (2f) AE XX YY Set Animation Position AF Position Off-screen Right B0 FF Animated Move Left (4f) B1 XX Move Animation Right B2 XX Move Animation Down B3 XX Move Animation Left B4 XX Move Animation Up B5 FF Animated Move Left (2f) B6 Unanimated Move Down-Left B7 Unanimated Move Down-Right B8 FF Animated Move Down-Left (2f) B9 FF Animated Move Up-Left (2f) BA XX [Sets flag - play frame on target?] BB FF [Move left with flag] BC XX (Collapsing Ellipse Effect) BD ** Unanimated Linear Move BE Center Animation on Target BF Init Ordered Implode Effect A C0 Default Animation Offset C1 Save Animation Offset C2 Recall Animation Offset C3 Set Animation Shape C4 (Collapsing Ellipse Effect) C5 XX YY Run Animation Routine C6 Init Ordered Explode C7 FF Linear Explode Outward C8 XX {} Start Unanimated Loop C9 End Unanimated Loop CA XX {} Start Animated Loop CB End Animated Loop CC Init Unanimated Circle CD FF Unanimated Circle Effect CE [Init X-Zone Pull] CF FF [X-Zone Pull Effect] D0 XX [(Unknown fxn)] D1 Set Screen Brightness D2 Toggle Under Target D3 [Meteo Show Damage] D4 XX [Meteo Target Mask] D5 XX [Meteo D4 Wrapper] D6 [Path Caster to Edge] D7 XX Change Wave Amplitude D8 XX Change Ripple Amplitude D9 Position Off-Screen Center Right DA XX [Meteo D4 Wrapper B] DB Init Whirlwind X-Oscillation DC Whirlwind X-Oscillation Effect DD Init Tsunami X-Oscillation DE Tsunami X-Oscillation Effect DF Play Under Target E0 Play Over Target E1 Init Whirlpool X-Oscillation E2 Whirlpool X-Oscillation Effect E3 Init Cave-In X-Oscillation E4 Cave-In X-Oscillation Effect E5 Spawn Sparkles E6 Horizontal Oscillation Effect E7 Init Horizontal Oscillation E8 [WW Path to Target] E9 ** Slow Animated Linear Move (2f) EA XX Summon Move Effect EB XX Summon Bounce Effect EC XX [] ED XX Z-Axis Circle Effect EE XX Mass Target Mask EF XX Random Vertical Oscillation (4f) F0 Cleave Enemies F1 XX Collapsing Ellipse Effect F2 XX Flash Effect F3 XX Toggle Summon Ghosting F4 FF Simple Unanimated Linear Move F5 XX [Specific Effects] F6 XX [Specific Effects] F7 XX [Unknown] F8 [Unknown Summon Thing] F9 XX [Enemy Sprite Control] FA XX YY Move Enemy Box FB XX YY [Possess] FC XX [Pull] FD XX [Demi/Quarter] FE No Function FF End Routine ******************************************** Sinusoidal Function Definitions ******************************************** Imagine a graph of a sine wave. Index = Value at x-axis, but really index of lookup table Amplitude = Peak Amplitude, max value of offset Percentage = Sin*(Index), where * indicates lookup table Offset = Percentage * Amplitude, using standard coordinates Sin8: 8-bit lookup table at CE/F600 Sin16: 16-bit lookup table at CE/F400 ******************************************** Effect Commands ******************************************** 80 Target Mask (XX = Color, caps at #7A) 00 Mask Off 02 Purple 0A Orange 12 Blue 1A Yellow 22 Green 2A Grey 32 Brown 3A Lavender 42 Black (also 4A through 72) 7A Grey 81 Background Effect (XX = Effect) 00: Flash Off (needs to be called at end to repeat) 01: White Flash 02: Palette Loop 03: Dark to Alpha 04: Shadow 05: Shadow (same as #04) 06: None 07: None 82 Shadow Effect (XX = Color) ** Note: Reverse RGB Bits 4-6: 00: Alpha 40: Yellow 10: Turquoise 50: Green 20: Purple 60: Red 30: Blue 70: Black Bits 0-3: 0F: Shadow 83 Animation Color (XX = Color) ** Overrides animation color from master table, see color table for values 84 Shake Effect (XX = Shake Effect) Bit 7: Toggle Effect (on/off) Bit 6: Toggle Enemy Horizontal* Bit 5: Toggle Enemy Vertical Bit 2-4: Shake Amplitude Bit 1: Toggle Background Bit 0: Toggle Enemies * Bit 6 off also turns off background shaking 85 Wave Effect (XX = Wave Effect) Bit 7: Toggle Effect (on/off) Bits 5-6: Wave Speed Bits 2-4: Wave Amplitude (Horizontal Movement) Bit 1: Toggle Background Bit 0: Toggle Enemies * Use D7 to change amplitude during routine 86 Ripple Effect (XX = Ripple Effect) Bit 7: Toggle Effect (on/off) Bits 5-6: Ripple Speed Bits 2-4: Ripple Amplitude (Horizontal Movement) Bit 1: Toggle Background Bit 0: Toggle Enemies * There is always a small ripple, per assembly * Use D8 to change amplitude during routine 87 Box Fill Effect ** Plays proceeding frames at random positions in box (see Aqua Rake) XX = Region 00: Whole Screen 01: Enemy Box 02: Ally Box 03: Center Box A 04: Center Box B 88 Set Animation Speed (XX = Speed) 89 Set Mid-Animation Speed 8A Set Random Animation Speed ** Actually two values: initial speed and frame speed 88 changes both, 89 only changes latter 89 is redundant, not used 8A sets frame speed randomly, usually resulting in a pause 8B Offset Animation (XX = Offset) Bits 5-7: Direction 00: Down-Left 80: Right 20: Down A0: Up-Right 40: Down-Right C0: Up 60: Left F0: Up-Left Bits 0-4: Distance 00: Near, to 1F: Far 8C Pixelate Effect (XX = Parameters) Bits 2-7: Intensity 04: None, to 7C: High Bits 0-1: Target Flags 00: None 01: Enemies 02: Background 03: Both 8D No Function 8F No Function ** Per assembly 8E Circular Animation Width (XX = Width) ** Sets width for future circle anim ** Seems to expand animation stage 90 Palette Shift Left 91 Palette Shift Right ** Use with C8/C9 to loop palette 92 Init Burst Effect 93 Burst Effect ** Creates the burst effect on casting animations (see Blue/Summon) Requires one frame prior to #93 (mote sprite, ie 0C 93) Use Effect Special for full effect 94 Init Rotating Burst Effect 95 Rotating Burst Effect ** Identical to 92/93, but also rotates clockwise (see White/Song) 96 Init Ring Effect 97 Ring Effect ** Identical to 92/93, but ring animation (see Charm) ** Ring rotates counter-clockwise, starts at right 98 Back Four Commands ** Go back four frames if at top of screen (Y-pos = 0) 99 Life Command ** Used in Life/Life2; of limited general use due to assembly Decreases Y-offset until 0 while animating (2f) 9A Init Dragon Sword Effect 9B Dragon Sword Effect ** Moves from UR to LL through enemy, use Special 04 XX = End Frame (four frames, starts with XX - 3) 9C Path Caster to Target 9E Path Caster to Target ** Sets up path for movement (vector pre-calculated) ** 9C is used with linear functions, 9E with sinusoidal Can be interchanged (same assembly call) 9D Animated Linear Move (4f) ** Used with two preceding bytes (ie GG FF 9D) GG: Indicates palette shift (90/91) or no shift (8F) FF: Starting frame to animate 9F Unanimated Sinusoidal Move ** Similar to Unanimated Linear Move (BD), but moves in sine wave A0 Init Random Implode ** Use with A1/A8 XX = Start Frame (Animated, 4f) A1 Linear Implode Inward ** Moves implode motes inward linearly ** Use with A0/BF A2 Low Sprite Priority ** Draws animation sprites under currently displayed sprites (ie, Z = 0; see Leviathan) ** Reset with A3, probably should be called after use ** For more info: see Anomie's Register Doc A3 Clear Sprite Priority ** Resets Z-stack handling of sprites A4 Set Sprite Priority ** Sets the Z-stack position of the sprite XX = Sprite Priority (bit value) 01: High Priority (ie, on top) 80: Low Priority (ie, on bottom; same as A2) A5 Unanimated Ring Effect ** Identical to 97, but no animation A6 [Random Sprite Priority] ** Per assembly, pseudo-random priority A7 Init Ordered Implode B ** Sets up implode effect (Flare/Psych) with ordered mote location ** Motes at 45 degrees, staggered order (1-2-4-6-8-7-5-3) ** Use with A1/A8 XX = Start Frame (Animated, 4f) A8 Spiral Implode Inward ** Moves implode motes inward in spiral ** Use with A0/BF A9 [Center Animation on Target] ** Centers the animation on the target Also runs pathing code AA Simple Animated Linear Move (2f) ** Identical to AC, but without palette shift Uses only one preceding byte AB Start Target Dissolve ** Larger number = slower dissolve XX = Speed AC Animated Linear Move (2f) ** Used with two preceding bytes (ie GG FF 9D) GG: Indicates palette shift (90/91) or no shift (8F) FF: Starting frame to animate AD Animated Sinusoidal Move (2f) ** Similar to AA, but moves in sine wave AE Set Animation Position ** Sets X and Y coordinates of sprite animation; 0,0 is top left corner XX = X-position YY = Y-position AF Position Off-Screen Right ** Sets X-position to #0100 B0 Animated Move Left (4f) ** Decrement X-position while animating B1 Move Animation Right (XX = Distance) B2 Move Animation Down (XX = Distance) B3 Move Animation Left (XX = Distance) B4 Move Animation Up (XX = Distance) B5 Animated Move Left (2f) ** Slightly different code than B0 B6 Unanimated Move Down-Left ** Moves current frame down and to the left ** Ends at left edge of screen (X-Pos = 0) B7 Unanimated Move Down-Right ** Moves current frame down and to the right ** Ends at right edge of screen (X-Pos = 0) B8 Animated Move Down-Left (2f) ** Identical to B6, but with animation B9 Animated Move Up-Left (2f) ** Identical to B8, but up and left BA BB BC Collapsing Ellipse Effect ** Same call as C4 and F1 ** Unused, see F1 BD Unanimated Linear Move ** Used with two preceding bytes (ie GG FF BD) See Ice 2; used with two frames BE Center Animation on Target BF Init Ordered Implode A ** Sets up implode effect (Flare/Psych) with ordered mote location ** Motes at 45 degrees, starting at lower left (225 degrees) XX = Start Frame (Animated, 4f) C0 Default Animation Offset C1 Save Animation Offset C2 Recall Animation Offset ** Use after movement (ie, with 8B) to save location ** C0 uses position of spell animation C3 Set Animation Shape (XX = Index) ** Uses same values as animation shape table C4 (Collapsing Ellipse Effect) ** Same call as BC and F1 ** Unused, see F1 C5 Run Animation Routine YYXX: Routine Index ** Not the address, index at D9/7D42 ** Played after current routine ends C6 Init Ordered Explode ** Sets up explode effect (Flare/Psych) with ordered mote location ** Order (in degrees) - 225, 270, 315, 0, 180, 135, 90, 45 ** Use with C7 XX = Start Frame (Animated, 4f) C7 Linear Explode Outward ** Moves explode motes outwardward linearly ** Use with C6 C8 Start Unanimated Loop C9 End Unanimated Loop ** Repeats commands in loop between C8 XX and C9 XX = Number of loops to run CA Start Animated Loop CB End Animated Loop ** Repeats commands in loop between CA and CB ** Increments frame by 1 each loop ** Will crash game if frame sizes do not match XX = Number of frames YY = Start frame CC Init Unanimated Circle CD Unanimated Circle Effect ** Moves four motes in circle around target (see Slow) ** Unanimated; only uses frame ** CC is not compatible with A0/BF CE Init XZone Pull CF XZone Effect ** CE sets sprite priority ** CF moves enemy, draws top and/or controls priority D0 D1 Set Screen Brightness XX: Brightness Bits 0-3: Brightness (larger is brighter, #1F is full brightness) Bits 4-7: Not used D2 Toggle Behind Target XX: Toggle (Positive = On, Negative = Off) ** If on, plays animation behind target sprite ** See DF/E0, more space effective D3 Meteo Show Damage ** Shows damage for Meteo Also controls randomization in some way D4 Meteo Target Mask ** Runs minor code, then runs #80 XX: Mask Color (for #80) D5 Meteo D4 Wrapper ** Checks flag, runs D4 if set XX: Mask Color (for #80) D6 Move Path Caster to Left Edge ** Similar to 9C/9E, but animation moves to left edge D7 Change Wave Amplitude XX: Amplitude (0 to 7) ** No effect unless used with 85 D8 Change Ripple Amplitude XX: Amplitude (0 to 7) ** No effect unless used with 86 D9 Position Off-Screen Center Right ** X = F0: off-screen right ** Y adjusted to prevent sprite/menu overlap Overlaps enemy as much as possible (see Gale Cut) DA Unused Meteo Target Mask ** Calls D4 DB Init Whirlwind X-Osc Effect DC Whirlwind X-Osc Effect ** Unlike other sinusoidal functions, does not use preceding frame ** Position: Off-screen right, bottom (whirlwind with ESpec = 0E) ** Amplitude (Width): #14, increasing per mote vertically ** Index (Percentage): #00, increasing per mote vertically DD Init Tsunami X-Osc Effect DE Tsunami X-Osc Effect ** Similar to DB/DC, but different parameters ** Position: Off-screen right, centered vertically ** Amplitude: #40, Index: #80 (moving left) DF Play Under Target E0 Play Over Target ** Sets/clears a flag to play animation underneath target ** See D2 for a toggle, but this is more efficient E1 Init Whirlpool X-Osc Effect E2 Whirlpool X-Osc Effect ** Similar to DB/DC, but different parameters ** Position: Enemy box, in square pattern (with ESpec = 1) ** Amplitude: #08, Index: Random E3 Init Cave-In X-Osc Effect E4 Cave-In X-Osc Effect ** Position: Enemy box, off-screen top ** Amplitude: Variable, Index: #00 ** E4 uses offset to bounce slightly left E5 Spawn Sparkles ** Spawns sparkles randomly to lower right of sprite (See WW) Per assembly, within one tile; best with one tile sprites E6 Horizontal Oscillation Effect E7 Init Horizontal Oscillation ** Moves sprite sinusoidally left/right (see Whispering Wind) ** Amplitude: #20, Index: #80, increases with each call to E6 ** Use E6 in loop for movement E8 WW Path to Target ** Moves mote from current position to target position E9 Slow Animated Linear Move (2f) ** Similar to AC, with half move increment ** Goes back two frames (in WW: E5 60 E9) EA Summon Movement Effect ** Affects summon "creature" only Bit 6-7: Movement Direction 00: (Right) 80: Down 40: Left C0: Up Bits 0-5: Movement Speed EB Summon Bounce Effect ** Affects summon "creature" only XX = Amplitude EC [Unknown] XX = Toggle 00: Init Fxn 01: Run Fxn ED Z-Axis Circle Effect ** Needs to be run with four motes (ESpec = 0A) See Hellfire for effect XX = Toggle 00: Init Fxn 01: Run Fxn EE Mass Target Mask ** Plays target mask to all targets XX = Mask Color (see #80) EF Random Vertical Oscillation (4f) ** Vertical oscillation starting from random index Course movement (index incremented by #10) Randomly plays one of four frames XX = Toggle 00: Init Fxn 01: Run Fxn F0 Cleave Enemies ** True Edge effect - separate enemies in third, move horizontally ** If creature not killed, fades in after effect F1 Collapsing Ellipse Effect ** See Diamond Dust ** Same call as BC and C4, but only this one used XX = State 00: Init Fxn (ellipse) 01: Rotate Motes 02: Collapse to Point F2 Flash Effect (XX = Flash Effect) ** Fade to white effect ** Bit 5-7 are mutually exclusive - order: 7, 6, 5 Bit 7: Toggle Effect (on/off) Bit 6: Blink with Colors (random?) Bit 5: Blink to Intensity Bit 0-4: Intensity F3 Toggle Summon Ghosting ** Affects summon "creature" only ** Image effect; see Odin/True Edge XX = Toggle (00: On, 01: Off) F4 Simple Unanimated Linear Move ** Similar to BD, but uses only one preceding byte F5 [Special code] F6 [Special code] ** Assembly contains indirect jump, multitude of functions F7 Unknown ** Used in Exploder, no discernable effect F8 Unknown ** Used in most summons; no apparent effect ** Assembly is odd, always RTS - possibly a legacy fxn? F9 Unknown ** Appears to alter BG/Sprite priority ** Per Anomie's register FAQ, BG tileset FA Move Enemy Box ** Moves all enemies, regardless of target ** Used for enemy jump attack; only meant for lone enemies XX = Direction (0: Up, 1: Down, 2: Right, 3: Left) YY = Speed FB (Possess) FC [Toggle Character Row] (Pull) FD (Unknown, used in Demi/Quarter/L4Q/Falcon, one parameter) ** Assembly: parameter stored in $DBB5, $DBB4++ FE No Function ** Jumps to RTS, like 8D/8F FF End Routine ** Used at the end of routines to signal end