Alchemy
Loading...
Searching...
No Matches

mind_read.c File Reference

Mind Read: scanline waves, shifting colours and flowing particles. More...

Go to the source code of this file.

Data Structures

struct  WaveFxWork
 Work slot 22 of the wave effect, 0x298 bytes (RunSceneTransitionEffect). More...

Macros

#define MIND_READ_GREY   RGB(28, 28, 28)

Functions

void RunSceneTransitionEffect (s32 x, s32 y)
 Starts the wave effect of caster sourceId on target targetId: fades the palettes toward a hue that shifts with the frame counter, and starts its per-frame update (FieldFx_UpdateMindReadWave) after 8 frames.
void BattleFx_FinishSceneAndReleaseHeapBlock (void)
 Stops the wave effect: restores the caster's colours and the palettes and releases the effect's work.
void FieldFx_UpdateMindReadWave (void)
 Scheduler callback of the wave effect: once its delay has run out, writes the next page of scanline offsets (a sine wave of 4 pixels either way), steps the colour fade and the hue, keeps the caster's colours lit, and every 60 frames sends three particles (object 281) from the target to the caster, with sound 130.
void BattleFx_ArmBg0HBlankDma (void)
 Scheduler callback: restarts the HBlank DMA that writes BG0's horizontal scroll for each scanline from the wave's shown page.
void BattleFx_AdvanceHueCycle (void)
 Moves the wave's hue on 4 degrees and works out its colour, each channel 4 to 11.
void FieldFx_ComputeHueChannels (s32 hue, s32 *r, s32 *g, s32 *b)
 Works out red, green and blue (0 to 31 each, 16.16) for a hue in degrees (16.16).
s32 BattleFx_HueChannelRamp (s32 angle, s32 low, s32 high)
 One colour channel's strength at a hue angle: rising from 0 to 60 degrees, high from 60 to 180, falling from 180 to 240, low elsewhere.
s32 Fixed_Remainder (s32 value, s32 divisor)
 The 16.16 remainder of value divided by divisor (0 for a zero divisor).
void BattleFx_SetCallbackWhenTargetUnset (union FieldObject *fieldObject)
 Per-frame update: once the object has arrived (no destination left), runs the script for untargeted objects.
void Ui_FillBank15PaletteGrey (void)
 Turns colours 1 and 3 to 12 of BG palette 15 grey and starts the BG0 scanline scroll (BattleFx_ArmBg0HBlankDma).
void Ui_SetBank15PaletteAndClearRenderMode (void)
 Stops the BG0 scanline scroll and restores BG palette 15.

Detailed Description

Mind Read: scanline waves, shifting colours and flowing particles.

Part of psynergy_effects.c, compiled only through it.

Definition in file mind_read.c.

Macro Definition Documentation

◆ MIND_READ_GREY

#define MIND_READ_GREY   RGB(28, 28, 28)

Definition at line 141 of file mind_read.c.

Referenced by Ui_FillBank15PaletteGrey().

Function Documentation

◆ RunSceneTransitionEffect()

void RunSceneTransitionEffect ( s32 x,
s32 y )

Starts the wave effect of caster sourceId on target targetId: fades the palettes toward a hue that shifts with the frame counter, and starts its per-frame update (FieldFx_UpdateMindReadWave) after 8 frames.

Abilities: Mind Read (field kind 2).

Definition at line 27 of file mind_read.c.

Referenced by BattleFx_DispatchRequestKind(), BattleFx_Run(), Djinn_ResolvePendingEvent(), Event_PullJillFromRiver(), and RunSceneTransitionEffect().

◆ BattleFx_FinishSceneAndReleaseHeapBlock()

void BattleFx_FinishSceneAndReleaseHeapBlock ( void )

Stops the wave effect: restores the caster's colours and the palettes and releases the effect's work.

Definition at line 47 of file mind_read.c.

Referenced by BattleFx_ClearChildValueOnMismatch(), BattleFx_FinishSceneAndReleaseHeapBlock(), and Djinn_ResolvePendingEvent().

◆ FieldFx_UpdateMindReadWave()

void FieldFx_UpdateMindReadWave ( void )

Scheduler callback of the wave effect: once its delay has run out, writes the next page of scanline offsets (a sine wave of 4 pixels either way), steps the colour fade and the hue, keeps the caster's colours lit, and every 60 frames sends three particles (object 281) from the target to the caster, with sound 130.

Definition at line 65 of file mind_read.c.

Referenced by BattleFx_FinishSceneAndReleaseHeapBlock(), Djinn_ResolvePendingEvent(), FieldFx_UpdateMindReadWave(), and RunSceneTransitionEffect().

◆ BattleFx_ArmBg0HBlankDma()

void BattleFx_ArmBg0HBlankDma ( void )

Scheduler callback: restarts the HBlank DMA that writes BG0's horizontal scroll for each scanline from the wave's shown page.

Definition at line 145 of file mind_read.c.

Referenced by BattleFx_ArmBg0HBlankDma(), Djinn_ResolvePendingEvent(), Ui_FillBank15PaletteGrey(), and Ui_SetBank15PaletteAndClearRenderMode().

◆ BattleFx_AdvanceHueCycle()

void BattleFx_AdvanceHueCycle ( void )

Moves the wave's hue on 4 degrees and works out its colour, each channel 4 to 11.

Definition at line 161 of file mind_read.c.

Referenced by BattleFx_AdvanceHueCycle(), Djinn_ResolvePendingEvent(), FieldFx_UpdateMindReadWave(), and RunSceneTransitionEffect().

◆ FieldFx_ComputeHueChannels()

void FieldFx_ComputeHueChannels ( s32 hue,
s32 * r,
s32 * g,
s32 * b )

Works out red, green and blue (0 to 31 each, 16.16) for a hue in degrees (16.16).

Definition at line 197 of file mind_read.c.

Referenced by BattleFx_AdvanceHueCycle(), Djinn_ResolvePendingEvent(), and FieldFx_ComputeHueChannels().

◆ BattleFx_HueChannelRamp()

s32 BattleFx_HueChannelRamp ( s32 angle,
s32 low,
s32 high )

One colour channel's strength at a hue angle: rising from 0 to 60 degrees, high from 60 to 180, falling from 180 to 240, low elsewhere.

Definition at line 205 of file mind_read.c.

Referenced by BattleFx_HueChannelRamp(), Djinn_ResolvePendingEvent(), and FieldFx_ComputeHueChannels().

◆ Fixed_Remainder()

s32 Fixed_Remainder ( s32 value,
s32 divisor )

The 16.16 remainder of value divided by divisor (0 for a zero divisor).

Definition at line 217 of file mind_read.c.

Referenced by BattleFx_HueChannelRamp(), Djinn_ResolvePendingEvent(), and Fixed_Remainder().

◆ BattleFx_SetCallbackWhenTargetUnset()

void BattleFx_SetCallbackWhenTargetUnset ( union FieldObject * fieldObject)

Per-frame update: once the object has arrived (no destination left), runs the script for untargeted objects.

Definition at line 231 of file mind_read.c.

Referenced by BattleFx_SetCallbackWhenTargetUnset(), Djinn_ResolvePendingEvent(), and FieldFx_UpdateMindReadWave().

◆ Ui_FillBank15PaletteGrey()

void Ui_FillBank15PaletteGrey ( void )

Turns colours 1 and 3 to 12 of BG palette 15 grey and starts the BG0 scanline scroll (BattleFx_ArmBg0HBlankDma).

Definition at line 249 of file mind_read.c.

Referenced by Djinn_ResolvePendingEvent(), RunSceneTransitionEffect(), and Ui_FillBank15PaletteGrey().

◆ Ui_SetBank15PaletteAndClearRenderMode()

void Ui_SetBank15PaletteAndClearRenderMode ( void )