Alchemy
Loading...
Searching...
No Matches

fxdata.c File Reference

Effect tables: object scripts, curves and lookup tables of the object bank. More...

Go to the source code of this file.

Variables

const u8 gField_TileMessageOffsets [6]
 The message of each searchable tile code from 242 to 247, as an offset from MsgTileChecked and MsgTileResult.
const s16 gBattleFx_TargetRangeByMode [25]
 {field Psynergy kind, range in pixels}, ended by -1; a kind not listed reaches 16 pixels.
const u8 gAnimation_ChildPaletteCycle [8] = {1, 2, 3, 4, 3, 2, 1, 0}
 The palette cycle of Animation_ChildPaletteCycle ((gFrameCount >> 1) & 7).
const s32 gBattleFx_ParticleEmitterScript []
 Grows from half size to full size, a step every 2 frames.
const s32 gBattleFx_RisingPulseScript []
 Pulses twice, then rests, over and over.
const s32 gBattleFx_ParticleScript []
 Rises for 60 frames, then disappears.
const s32 gBattleFx_MarkerParticleScript []
const u8 gDisplayTransition_NoiseWidths [34]
 The width of the bars of window transition mode 0, by progress.
const s8 gDisplayTransition_EdgeOffsets [32]
 The wobble of the circle edge of window transition mode 8.
const u8 gDisplayTransition_DitherTable [64]
 0 to 63 shuffled: the order in which the dissolve sets the pixels.
const u16 gBattlePalette_ChannelCurve [32]
 Colour channel curves (0 to 31, to channels up to 0x7c00).
const u16 gBattlePalette_ChannelCurveLight [32]
const u16 gBattlePalette_ChannelCurveContrast [32]
const struct BattleEffectEntry gBattleFx_DefinitionTable [131]
 Speaker definitions: {sprite, portrait (0xff for none), idle line flags}.
const s32 gObjectMotion_VariantScripts [97]
 Squashes as many times as the variant (1 to 3): variant v starts at word (3 - v) * 32 and runs to the end.
const u8 gObjectGroup_BlinkChildValues [4] = {7, 0, 0, 0}
 A child value by frame ((gFrameCount >> 1) & 3).
const s16 gDisplayScroll_WaveSine [256]
 Sine times 4096, 256 steps to a turn.
const s16 gFieldFx_GroundParticleFrames [80]
 {dx, dy, tile, shape, size} for each of 16 frames.
const struct SparkleFrame gFieldFx_SparkleFrames [32]
 {dy, tile}
const u32 gBattleFx_PulseScales [3] = {0x10000, 0xf851, 16}
 Two scales that alternate ((gFrameTick >> 2) & 1); nothing reads the third word.
const s32 gBattleFx_CommonParticleScript []
 [0] only frees the actor, +1 waits for it to arrive and frees it; +3 is gBattleFx_SourceHoldScript, which follows.
const s32 gBattleFx_SourceHoldScript []
const s32 gBattleFx_FragmentScript []
const u16 gBattleFx_CyclePatternWords [16]
 An angle for each value of the right, left, up and down bits of the +Control Pad; 0xffff for none.
const u8 gBattleFx_QuadrantModes [4] = {3, 1, 2, 1}
const s32 gBattleFx_BurstParticleObjectScript []
 Word +4 is gBattleFx_HeavyImpactScript.
const u8 gUnused_BattleFxBytes [4] = {3, 1, 2, 1}
 The same four bytes as gBattleFx_QuadrantModes; nothing reads them.
const s32 gBattleFx_HeavyImpactScript []
const s32 gBattleFx_ShortEffectScript []
 The three scripts of gEffectScripts.
const s32 gBattleFx_MediumEffectScript []
const s32 gBattleFx_LongEffectScript []
const s8 gBattleFx_RandomChildValues [8] = {0, 0, 1, 2, 3, 4, 5, 6}
const u8 gWorldMap_MarkerBlendCycle [32]
 The brightness of the world map markers ((gFrameCount >> 1) & 31).
const u16 gWorldMap_CursorDirectionAngles [16]
 An angle for each +Control Pad direction (eight of them); 0xffff for none.

Detailed Description

Effect tables: object scripts, curves and lookup tables of the object bank.

Definition in file fxdata.c.

Variable Documentation

◆ gField_TileMessageOffsets

const u8 gField_TileMessageOffsets[6]
Initial value:
= {
2,
3,
13,
8,
30,
31,
}

The message of each searchable tile code from 242 to 247, as an offset from MsgTileChecked and MsgTileResult.

Definition at line 24 of file fxdata.c.

Referenced by Field_SearchTile().

◆ gBattleFx_TargetRangeByMode

const s16 gBattleFx_TargetRangeByMode[25]
Initial value:
= {
3, 16,
6, 16,
7, 16,
11, 16,
12, 16,
2, 32,
1, 32,
14, 32,
5, 32,
9, 32,
4, 48,
13, 48,
-1,
}

{field Psynergy kind, range in pixels}, ended by -1; a kind not listed reaches 16 pixels.

Definition at line 36 of file fxdata.c.

Referenced by Field_GetPsynergyTargetRange().

◆ gAnimation_ChildPaletteCycle

const u8 gAnimation_ChildPaletteCycle[8] = {1, 2, 3, 4, 3, 2, 1, 0}

The palette cycle of Animation_ChildPaletteCycle ((gFrameCount >> 1) & 7).

Definition at line 53 of file fxdata.c.

Referenced by Animation_ApplyChildPalette().

◆ gBattleFx_ParticleEmitterScript

const s32 gBattleFx_ParticleEmitterScript[]
Initial value:
= {
SC_SET(SW_SCALE_X, 0x8000),
SC_SET(SW_SCALE_Y, 0x8000),
SC_WAIT(2),
SC_SET(SW_SCALE_X, 0xc000),
SC_SET(SW_SCALE_Y, 0xc000),
SC_WAIT(2),
SC_SET(SW_SCALE_X, 0xe000),
SC_SET(SW_SCALE_Y, 0xe000),
SC_WAIT(2),
SC_SET(SW_SCALE_X, 0xf000),
SC_SET(SW_SCALE_Y, 0xf000),
SC_WAIT(2),
SC_SET(SW_SCALE_X, 0x10000),
SC_SET(SW_SCALE_Y, 0x10000),
}
#define SC_SET(w, v)
Write a work value.
Definition objcmd.h:37
#define SC_WAIT(n)
Wait n frames.
Definition objcmd.h:16
#define SC_END
Return to the main script.
Definition objcmd.h:32
@ SW_SCALE_Y
Definition objcmd.h:63
@ SW_SCALE_X
Definition objcmd.h:62

Grows from half size to full size, a step every 2 frames.

Definition at line 56 of file fxdata.c.

Referenced by BattleFx_StartRandomParticleEmitter(), and EffectRuntime_RunRisingObjectSequence().

◆ gBattleFx_RisingPulseScript

const s32 gBattleFx_RisingPulseScript[]
Initial value:
= {
SC_WAIT(10),
SC_SET(SW_SCALE_X, 0x16000),
SC_SET(SW_SCALE_Y, 0x16000),
SC_WAIT(2),
SC_SET(SW_SCALE_X, 0x18000),
SC_SET(SW_SCALE_Y, 0x18000),
SC_WAIT(2),
SC_SET(SW_SCALE_X, 0x12000),
SC_SET(SW_SCALE_Y, 0x12000),
SC_WAIT(2),
SC_SET(SW_SCALE_X, 0x10000),
SC_SET(SW_SCALE_Y, 0x10000),
SC_WAIT(2),
SC_SET(SW_SCALE_X, 0x16000),
SC_SET(SW_SCALE_Y, 0x16000),
SC_WAIT(2),
SC_SET(SW_SCALE_X, 0x18000),
SC_SET(SW_SCALE_Y, 0x18000),
SC_WAIT(2),
SC_SET(SW_SCALE_X, 0x12000),
SC_SET(SW_SCALE_Y, 0x12000),
SC_WAIT(2),
SC_SET(SW_SCALE_X, 0x10000),
SC_SET(SW_SCALE_Y, 0x10000),
SC_WAIT(2),
SC_WAIT(50),
}
#define SC_LOOP(n, to)
Repeat up to n times.
Definition objcmd.h:28
#define SC_FOREVER
Definition objcmd.h:14
#define SC_TOP
Script start.
Definition objcmd.h:13

Pulses twice, then rests, over and over.

Definition at line 75 of file fxdata.c.

Referenced by ItemDisplay_RaiseAboveLeader().

◆ gBattleFx_ParticleScript

const s32 gBattleFx_ParticleScript[]
Initial value:
= {
SC_ADD(SW_Y, -0x4000),
SC_WAIT(1),
}
#define SC_FREE
Release.
Definition objcmd.h:43
#define SC_ADD(w, v)
Definition objcmd.h:38
@ SW_Y
Definition objcmd.h:59

Rises for 60 frames, then disappears.

Definition at line 107 of file fxdata.c.

Referenced by BattleFx_StartRandomParticleEmitter(), and Object_InitializeSparkle().

◆ gBattleFx_MarkerParticleScript

const s32 gBattleFx_MarkerParticleScript[]
Initial value:
= {
}
s32 Field_IsRevealActive(struct ScriptInterpreter *interpreter)
Returns 1 while Reveal is active, else 0.
Definition field_fx.c:361
#define SC_CALL(fn)
Definition objcmd.h:50

Definition at line 114 of file fxdata.c.

Referenced by FieldEffect_SpawnNearbyMarkers().

◆ gDisplayTransition_NoiseWidths

const u8 gDisplayTransition_NoiseWidths[34]
Initial value:
= {
0, 1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9, 11, 13,
16, 18, 22, 26, 30, 36, 43, 51, 60, 72, 85, 101, 120, 143, 170, 202, 240,
}

The width of the bars of window transition mode 0, by progress.

Definition at line 120 of file fxdata.c.

Referenced by DisplayTransition_UpdateScanlineTable().

◆ gDisplayTransition_EdgeOffsets

const s8 gDisplayTransition_EdgeOffsets[32]
Initial value:
= {
-4, -3, -3, -3, -2, -2, -1, 0, 0, 0, 1, 2, 2, 3, 3, 3,
4, 3, 3, 3, 2, 2, 1, 0, 0, 0, -1, -2, -2, -3, -3, -3,
}

The wobble of the circle edge of window transition mode 8.

Definition at line 126 of file fxdata.c.

Referenced by DisplayTransition_UpdateScanlineTable().

◆ gDisplayTransition_DitherTable

const u8 gDisplayTransition_DitherTable[64]
Initial value:
= {
0, 12, 35, 3, 29, 39, 6, 7, 50, 59, 4, 11, 18, 40, 46, 31,
16, 42, 47, 51, 20, 23, 43, 32, 8, 52, 17, 41, 54, 15, 63, 24,
58, 5, 2, 26, 36, 61, 9, 34, 56, 27, 10, 48, 53, 30, 28, 22,
62, 45, 19, 60, 57, 49, 25, 55, 38, 14, 44, 13, 33, 37, 1, 21,
}

0 to 63 shuffled: the order in which the dissolve sets the pixels.

Definition at line 132 of file fxdata.c.

Referenced by DisplayTransition_UpdateFrame().

◆ gBattlePalette_ChannelCurve

const u16 gBattlePalette_ChannelCurve[32]
Initial value:
= {
0x0000, 0x020c, 0x042f, 0x066b, 0x08c0, 0x0b2f, 0x0db9, 0x105f,
0x1322, 0x1603, 0x1903, 0x1c22, 0x1f63, 0x22c5, 0x264b, 0x29f4,
0x2dc3, 0x31b9, 0x35d7, 0x3a1d, 0x3e8e, 0x432b, 0x47f6, 0x4cee,
0x5217, 0x5772, 0x5d00, 0x62c3, 0x68bc, 0x6eed, 0x7559, 0x7c00,
}

Colour channel curves (0 to 31, to channels up to 0x7c00).

Definition at line 140 of file fxdata.c.

Referenced by BattleFx_BuildBuffer().

◆ gBattlePalette_ChannelCurveLight

const u16 gBattlePalette_ChannelCurveLight[32]
Initial value:
= {
0x0000, 0x0265, 0x04df, 0x076e, 0x0a14, 0x0cd1, 0x0fa5, 0x1291,
0x1596, 0x18b4, 0x1bec, 0x1f3f, 0x22ac, 0x2636, 0x29dc, 0x2da0,
0x3182, 0x3583, 0x39a3, 0x3de3, 0x4245, 0x46c9, 0x4b70, 0x503a,
0x5529, 0x5a3d, 0x5f78, 0x64da, 0x6a65, 0x7019, 0x75f7, 0x7c00,
}

Definition at line 147 of file fxdata.c.

Referenced by BattleFx_BuildBuffer().

◆ gBattlePalette_ChannelCurveContrast

const u16 gBattlePalette_ChannelCurveContrast[32]
Initial value:
= {
0x0000, 0x0168, 0x02f7, 0x04b1, 0x0699, 0x08b2, 0x0b01, 0x0d8a,
0x1052, 0x135d, 0x16b0, 0x1a52, 0x1e48, 0x2298, 0x274a, 0x2c65,
0x31f0, 0x37f5, 0x3e7c, 0x458e, 0x4d37, 0x5580, 0x5e77, 0x6826,
0x729c, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7c00,
}

Definition at line 154 of file fxdata.c.

Referenced by BattleFx_BuildBuffer().

◆ gBattleFx_DefinitionTable

const struct BattleEffectEntry gBattleFx_DefinitionTable[131]

Speaker definitions: {sprite, portrait (0xff for none), idle line flags}.

BattleFx_FindDefinition searches all 131; the last is the default.

Definition at line 163 of file fxdata.c.

Referenced by BattleFx_FindDefinition().

◆ gObjectMotion_VariantScripts

const s32 gObjectMotion_VariantScripts[97]

Squashes as many times as the variant (1 to 3): variant v starts at word (3 - v) * 32 and runs to the end.

field.h declares it const u8[], and psynergy_effects.c adds (3 - v) << 7 bytes and reads it through an s32 *.

Definition at line 300 of file fxdata.c.

Referenced by ObjectMotion_SetVariantCallback().

◆ gObjectGroup_BlinkChildValues

const u8 gObjectGroup_BlinkChildValues[4] = {7, 0, 0, 0}

A child value by frame ((gFrameCount >> 1) & 3).

Definition at line 344 of file fxdata.c.

Referenced by ObjectGroup_ApplyIndexedChildValue().

◆ gDisplayScroll_WaveSine

const s16 gDisplayScroll_WaveSine[256]

Sine times 4096, 256 steps to a turn.

Definition at line 347 of file fxdata.c.

Referenced by DisplayScroll_BuildAndSwapHBlankPage(), and STATIC_ASSERT().

◆ gFieldFx_GroundParticleFrames

const s16 gFieldFx_GroundParticleFrames[80]
Initial value:
= {
-8, -12, 20, 0, 1,
-8, -12, 20, 0, 1,
-8, -12, 20, 0, 1,
-8, -12, 16, 0, 1,
-8, -12, 16, 0, 1,
-8, -12, 12, 0, 1,
-8, -12, 8, 0, 1,
0, -32, 0, 2, 2,
8, -48, 0, 2, 2,
16, -64, 0, 2, 2,
24, -80, 0, 2, 2,
32, -96, 0, 2, 2,
40, -112, 0, 2, 2,
48, -128, 0, 2, 2,
56, -144, 0, 2, 2,
64, -160, 0, 2, 2,
}

{dx, dy, tile, shape, size} for each of 16 frames.

Definition at line 383 of file fxdata.c.

Referenced by FieldFx_UpdateGroundParticles().

◆ gFieldFx_SparkleFrames

const struct SparkleFrame gFieldFx_SparkleFrames[32]

{dy, tile}

Definition at line 403 of file fxdata.c.

Referenced by FieldEffect_UpdateSparkles().

◆ gBattleFx_PulseScales

const u32 gBattleFx_PulseScales[3] = {0x10000, 0xf851, 16}

Two scales that alternate ((gFrameTick >> 2) & 1); nothing reads the third word.

Definition at line 440 of file fxdata.c.

Referenced by BattleFx_SetObjectAlternatingWords().

◆ gBattleFx_CommonParticleScript

◆ gBattleFx_SourceHoldScript

const s32 gBattleFx_SourceHoldScript[]
Initial value:
= {
SC_WAIT(1),
}
#define SC_FACE_LINK
Face the linked object.
Definition objcmd.h:21

Definition at line 450 of file fxdata.c.

Referenced by BattleFx_SteerLiftedTarget(), and BattleFx_SteerPushedTarget().

◆ gBattleFx_FragmentScript

const s32 gBattleFx_FragmentScript[]
Initial value:
= {
SC_SET(SW_SPEED, 0x1000),
SC_ARG(0),
SC_WAIT(10),
}
#define SC_ARG(v)
Definition objcmd.h:44
@ SW_SPEED
Definition objcmd.h:67

Definition at line 456 of file fxdata.c.

Referenced by BattleFx_StartItemBreak(), BattleFx_SteerLiftedTarget(), SpawnHeavyImpactEffect(), and UpdateRisingParticleBurst().

◆ gBattleFx_CyclePatternWords

const u16 gBattleFx_CyclePatternWords[16]
Initial value:
= {
0xffff, 0x0000, 0x8000, 0xffff,
0xc000, 0xffff, 0xffff, 0xc000,
0x4000, 0xffff, 0xffff, 0x4000,
0xffff, 0x0000, 0x8000, 0xffff,
}

An angle for each value of the right, left, up and down bits of the +Control Pad; 0xffff for none.

Definition at line 466 of file fxdata.c.

Referenced by Input_GetDpadAngle().

◆ gBattleFx_QuadrantModes

const u8 gBattleFx_QuadrantModes[4] = {3, 1, 2, 1}

Definition at line 473 of file fxdata.c.

Referenced by BattleFx_SteerPushedTarget().

◆ gBattleFx_BurstParticleObjectScript

const s32 gBattleFx_BurstParticleObjectScript[]
Initial value:
= {
SC_WAIT(60),
}

Word +4 is gBattleFx_HeavyImpactScript.

Definition at line 476 of file fxdata.c.

Referenced by FieldFx_RunForce(), and FieldFx_RunGrowth().

◆ gUnused_BattleFxBytes

const u8 gUnused_BattleFxBytes[4] = {3, 1, 2, 1}

The same four bytes as gBattleFx_QuadrantModes; nothing reads them.

Definition at line 482 of file fxdata.c.

◆ gBattleFx_HeavyImpactScript

const s32 gBattleFx_HeavyImpactScript[]
Initial value:
= {
}
s32 SpawnHeavyImpactEffect(struct ScriptInterpreter *interpreter)
A heavy impact: places object 0x11b 32 pixels below the source and scatters 12 shards from it.
Definition lift.c:177

Definition at line 484 of file fxdata.c.

◆ gBattleFx_ShortEffectScript

const s32 gBattleFx_ShortEffectScript[]
Initial value:
= {
SC_WAIT(24),
}

The three scripts of gEffectScripts.

Definition at line 491 of file fxdata.c.

◆ gBattleFx_MediumEffectScript

const s32 gBattleFx_MediumEffectScript[]
Initial value:
= {
SC_WAIT(46),
}

Definition at line 496 of file fxdata.c.

◆ gBattleFx_LongEffectScript

const s32 gBattleFx_LongEffectScript[]
Initial value:
= {
SC_WAIT(128),
}

Definition at line 501 of file fxdata.c.

◆ gBattleFx_RandomChildValues

const s8 gBattleFx_RandomChildValues[8] = {0, 0, 1, 2, 3, 4, 5, 6}

Definition at line 506 of file fxdata.c.

Referenced by BattleEffect_SetRandomTableValueOnObject().

◆ gWorldMap_MarkerBlendCycle

const u8 gWorldMap_MarkerBlendCycle[32]
Initial value:
= {
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 15, 15, 14, 12, 10, 9, 9, 8, 9, 9, 10, 12, 14, 14, 15,
}

The brightness of the world map markers ((gFrameCount >> 1) & 31).

Definition at line 509 of file fxdata.c.

Referenced by Map_UpdateWorldMapMarkers().

◆ gWorldMap_CursorDirectionAngles

const u16 gWorldMap_CursorDirectionAngles[16]
Initial value:
= {
0xffff, 0x0000, 0x8000, 0xffff,
0xc000, 0xe000, 0xa000, 0xc000,
0x4000, 0x2000, 0x6000, 0x4000,
0xffff, 0x0000, 0x8000, 0xffff,
}

An angle for each +Control Pad direction (eight of them); 0xffff for none.

Definition at line 515 of file fxdata.c.

Referenced by Map_UpdateWorldMapMarkers().