src/battle_effect/battle_effect_canvas.c
The canvas layer: opening and closing it, its transfers, the battle background's darkening behind it, the targets' flash timers, and lines. More…
Included by battle_effect.c.
Macros
| Name | Description | |
|---|---|---|
#define | BATTLE_BACKGROUND_PALETTE 6 | The battle background's first BG palette, of the eight its colours take. |
#define | BACKGROUND_RESTORE_STEP 3 | The levels the battle background brightens by each tick as the canvas closes, back to its own colours. |
#define | CANVAS_BG1_SCREEN 31 | BG1's map while it shows the canvas at its own size: the battle's own BG1 map, in screen block 31. |
#define | BG1_MAP_ROW (row) | Row row of BG1's map. |
#define | CANVAS_BG1_BLANK_TILE 255 | The tile, cleared, that BG1 shows around the canvas. |
#define | CANVAS_BG1_FIRST_TILE (BG_CHAR_SIZE / TILE_SIZE_8BPP) | The canvas's first tile counted from BG1's character base: the canvas is character block 1. |
#define | CANVAS_BG1_TOP_ROW 12 | The map row where the canvas starts on BG1, 96 pixels down: the beams scroll BG1 to y 80 to show it from the battle view's top line. |
Functions
| Name | Description | |
|---|---|---|
void | btEffectTransferCanvas (void) | Copies the canvas to VRAM once the effect has finished a tick, then clears, fades, darkens or brightens it as transferMode says. |
void | btEffectTransferFullScreenImage (void) | Copies a full-screen image to VRAM once the effect has finished a tick, as transferMode says. |
void | btEffectApplyWindowBlendRegisters (void) | Writes the window, display and blend registers the effect keeps in its state, all at once. |
void | btEffectApplyBg2Reference (void) | Writes the effect's BG2 reference point to BG2X and BG2Y. |
void | btEffectDarkenBackgroundStep (void) | Darkens the battle background a step each tick while the canvas is open, so the effect stands out. |
void | btEffectClearTintTimers (void) | Clears every target's flash timer. |
void | btEffectCountDownBattlerTints (void) | Counts down each target's flash timer and gives it its own palette back when one runs out. |
void | btEffectStartCanvasLayer (Sint32 bgControl) | Opens the canvas layer over the battle, darkening the battle background behind it. |
void | btEffectOpenCanvasLayer (Sint32 bgControl) | Opens the canvas layer as btEffectStartCanvasLayer does, with the windows off and a half-faded background. |
void | btEffectStartTiledCanvas (Sint32 bgControl) | Opens the canvas layer on a 256-pixel map that wraps: the canvas fills the left half of the map's top rows, and the right half repeats the canvas's first tile. |
void | btEffectEndCanvasLayer (void) | Closes the canvas layer and brings the battle background's colours back. |
void | btEffectHideBg1AndRestoreBackdrop (void) | Hides BG1 and the windows and starts bringing the battle background's colours back. |
void | btEffectSetupCanvasTileMap (void) | Shows the canvas on BG1 instead of BG2, at its own size. |
void | btEffectDrawClippedCanvasLine ( Sint32 x0, Sint32 y0, Sint32 x1, Sint32 y1, Sint32 color) | Draws a line on the canvas, keeping the brighter colour where it crosses what is drawn; the line's ends are clipped to the canvas's rows only. |
Description
The canvas layer: opening and closing it, its transfers, the battle
background's darkening behind it, the targets' flash timers, and lines. Part
of battle_effect.c.
Macros in detail
BATTLE_BACKGROUND_PALETTE
#define BATTLE_BACKGROUND_PALETTE 6
The battle background's first BG palette, of the eight its colours take.
Referenced by btEffectDarkenBackgroundStep() and btEffectRunShatteringOpening().
Definition at line 110 of file battle_effect_canvas.c.
BACKGROUND_RESTORE_STEP
#define BACKGROUND_RESTORE_STEP 3
The levels the battle background brightens by each tick as the canvas closes, back to its own colours.
Referenced by btEffectEndCanvasLayer().
Definition at line 356 of file battle_effect_canvas.c.
CANVAS_BG1_SCREEN
#define CANVAS_BG1_SCREEN 31
BG1's map while it shows the canvas at its own size: the battle's own BG1 map, in screen block 31.
Referenced by btEffectSetupCanvasTileMap().
Definition at line 429 of file battle_effect_canvas.c.
BG1_MAP_ROW
#define BG1_MAP_ROW(row)
Row row of BG1's map.
Referenced by btEffectSetupCanvasTileMap().
Definition at line 431 of file battle_effect_canvas.c.
CANVAS_BG1_BLANK_TILE
#define CANVAS_BG1_BLANK_TILE 255
The tile, cleared, that BG1 shows around the canvas.
Referenced by btEffectSetupCanvasTileMap().
Definition at line 434 of file battle_effect_canvas.c.
CANVAS_BG1_FIRST_TILE
#define CANVAS_BG1_FIRST_TILE (BG_CHAR_SIZE / TILE_SIZE_8BPP)
The canvas's first tile counted from BG1's character base: the canvas is character block 1.
Referenced by btEffectSetupCanvasTileMap().
Definition at line 437 of file battle_effect_canvas.c.
CANVAS_BG1_TOP_ROW
#define CANVAS_BG1_TOP_ROW 12
The map row where the canvas starts on BG1, 96 pixels down: the beams scroll BG1 to y 80 to show it from the battle view's top line.
Referenced by btEffectSetupCanvasTileMap().
Definition at line 440 of file battle_effect_canvas.c.
Functions in detail
btEffectTransferCanvas
void btEffectTransferCanvas(void)
Copies the canvas to VRAM once the effect has finished a tick, then clears,
fades, darkens or brightens it as transferMode says.
References Sint32, state, syColorBufferBrighten(), syColorBufferDarken(), syColorBufferHalve(), syColorBufferScaleThreeQuarters(), syWordsCopy() and syWordsFill().
Referenced by btCastingImpactEndPrelude(), btEffectEndElementStreaks(), btEffectRunAnnihilation(), btEffectRunAstralBlast(), btEffectRunAtalanta(), btEffectRunAttackSlash(), btEffectRunBind(), btEffectRunBoreas(), btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunCriticalHit(), btEffectRunCurse(), btEffectRunCybele(), btEffectRunDeathPlunge(), btEffectRunDjinnBeams(), btEffectRunDjinniEntrance(), btEffectRunDouse(), btEffectRunDragonFire(), btEffectRunElementBurst(), btEffectRunElementPillar(), btEffectRunFire(), btEffectRunFlare(), btEffectRunFlashingStrike(), btEffectRunFlurry(), btEffectRunFrost(), btEffectRunGaia(), btEffectRunGatheringLights(), btEffectRunHaunt(), btEffectRunHealingMotes(), btEffectRunIce(), btEffectRunImpactBurst(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunNereid(), btEffectRunOrbitingSkulls(), btEffectRunProjectileVolley(), btEffectRunRamses(), btEffectRunShatteringOpening(), btEffectRunShiningStar(), btEffectRunSpiderWeb(), btEffectRunStarfieldFall(), btEffectRunStatBoost(), btEffectRunTargetMotes(), btEffectRunTargetStrike(), btEffectRunThor(), btEffectRunThorn(), btEffectRunUndeadSword(), btEffectRunUnusedOrbitingSpirals() and 4 more.
Definition at line 7 of file battle_effect_canvas.c.
btEffectTransferFullScreenImage
void btEffectTransferFullScreenImage(void)
Copies a full-screen image to VRAM once the effect has finished a tick, as
transferMode says.
References Sint32, state, syColorBufferDarken(), syColorBufferHalve(), syColorBufferScaleThreeQuarters(), syWordsCopy() and syWordsFill().
Referenced by btEffectRunStarfieldFall().
Definition at line 65 of file battle_effect_canvas.c.
btEffectApplyWindowBlendRegisters
void btEffectApplyWindowBlendRegisters(void)
Writes the window, display and blend registers the effect keeps in its state, all at once.
References state.
Definition at line 114 of file battle_effect_canvas.c.
btEffectApplyBg2Reference
void btEffectApplyBg2Reference(void)
Writes the effect's BG2 reference point to BG2X and BG2Y.
References state.
Definition at line 130 of file battle_effect_canvas.c.
btEffectDarkenBackgroundStep
void btEffectDarkenBackgroundStep(void)
Darkens the battle background a step each tick while the canvas is open, so the effect stands out.
References btGraphicsScaleRGB555ClampedStub(), Sint32 and state.
Referenced by btCastingImpactEndPrelude(), btEffectEndCanvasLayer(), btEffectEndElementStreaks(), btEffectOpenCanvasLayer(), btEffectRunCriticalHit(), btEffectRunDjinniEntrance() and btEffectStartCanvasLayer().
Definition at line 140 of file battle_effect_canvas.c.
btEffectClearTintTimers
void btEffectClearTintTimers(void)
Clears every target's flash timer.
References state and syWordsClear().
Referenced by btEffectOpenCanvasLayer(), btEffectRunShatteringOpening(), btEffectSetupCanvasTileMap() and btEffectStartCanvasLayer().
Definition at line 159 of file battle_effect_canvas.c.
btEffectCountDownBattlerTints
void btEffectCountDownBattlerTints(void)
Counts down each target's flash timer and gives it its own palette back when one runs out.
References btEffectTintBattler(), Sint32 and state.
Referenced by btEffectRunBurstShower() and btEffectRunIce().
Definition at line 168 of file battle_effect_canvas.c.
btEffectStartCanvasLayer
void btEffectStartCanvasLayer(Sint32 bgControl)
Opens the canvas layer over the battle, darkening the battle background behind it.
References BgScrollWork, btBackgroundSetModeStub(), btCameraSetViewStub(), btEffectClearTintTimers(), btEffectDarkenBackgroundStep(), Sint32, state, sySetEvent(), sySynch() and syWordsClear().
Referenced by btEffectRunAnnihilation(), btEffectRunAstralBlast(), btEffectRunBind(), btEffectRunBolt(), btEffectRunBoreas(), btEffectRunBreak(), btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunDeathPlunge(), btEffectRunDjinnBeams(), btEffectRunDjinnHeal(), btEffectRunDjinniEntrance(), btEffectRunDragonCloud(), btEffectRunDragonFire(), btEffectRunDrain(), btEffectRunElementBurst(), btEffectRunElementPillar(), btEffectRunEruption(), btEffectRunFire(), btEffectRunFlare(), btEffectRunFlashingStrike(), btEffectRunFlurry(), btEffectRunFroth(), btEffectRunGaia(), btEffectRunGatheringLights(), btEffectRunGround(), btEffectRunGrowingColumns(), btEffectRunHail(), btEffectRunHaunt(), btEffectRunHealingMotes(), btEffectRunJupiter(), btEffectRunKirin(), btEffectRunKite(), btEffectRunLobbedShells(), btEffectRunMars(), btEffectRunMercury(), btEffectRunMirroredWall(), btEffectRunMoteFountain(), btEffectRunNeptune(), btEffectRunNereid(), btEffectRunPlanetDiver(), btEffectRunPlasma(), btEffectRunPrism(), btEffectRunProcne(), btEffectRunProjectileVolley(), btEffectRunQuake(), btEffectRunRagnarok(), btEffectRunRamses(), btEffectRunRushingStrike(), btEffectRunShiningStar() and 17 more.
Definition at line 195 of file battle_effect_canvas.c.
btEffectOpenCanvasLayer
void btEffectOpenCanvasLayer(Sint32 bgControl)
Opens the canvas layer as btEffectStartCanvasLayer does, with the windows off
and a half-faded background.
References BgScrollWork, btBackgroundSetModeStub(), btCameraSetViewStub(), btEffectClearTintTimers(), btEffectDarkenBackgroundStep(), Sint32, state, sySetEvent(), sySynch() and syWordsClear().
Definition at line 265 of file battle_effect_canvas.c.
btEffectStartTiledCanvas
void btEffectStartTiledCanvas(Sint32 bgControl)
Opens the canvas layer on a 256-pixel map that wraps: the canvas fills the left half of the map's top rows, and the right half repeats the canvas's first tile.
References btEffectStartCanvasLayer() and Sint32.
Referenced by btEffectOpenAndCloseTiledCanvas(), btEffectRunCastingImpact(), btEffectRunCondemn() and btEffectRunRay().
Definition at line 333 of file battle_effect_canvas.c.
btEffectEndCanvasLayer
void btEffectEndCanvasLayer(void)
Closes the canvas layer and brings the battle background's colours back.
References BgScrollWork, btBackgroundSetModeStub(), btBackgroundSetPaletteLevelStub(), btEffectDarkenBackgroundStep(), ProjectionWork, Sint32, state, syCloseEvent(), sySoundPlayStub(), sySynch() and syWordsClear().
Referenced by btEffectOpenAndCloseTiledCanvas(), btEffectRunAnnihilation(), btEffectRunBind(), btEffectRunBoreas(), btEffectRunCondemn(), btEffectRunCybele(), btEffectRunDjinnBeams(), btEffectRunDragonFire(), btEffectRunElementBurst(), btEffectRunElementPillar(), btEffectRunFire(), btEffectRunFlare(), btEffectRunFlashingStrike(), btEffectRunFlurry(), btEffectRunFrost(), btEffectRunGaia(), btEffectRunGatheringLights(), btEffectRunHaunt(), btEffectRunIce(), btEffectRunKite(), btEffectRunNereid(), btEffectRunSpiderWeb(), btEffectRunStarfieldFall(), btEffectRunStatBoost(), btEffectRunTargetMotes(), btEffectRunTargetStrike(), btEffectRunThor(), btEffectRunUndeadSword(), btEffectRunUnusedOrbitingSpirals(), btEffectRunUnusedTriangleStrike(), btEffectRunVolcano() and btEffectRunWhirlwind().
Definition at line 359 of file battle_effect_canvas.c.
btEffectHideBg1AndRestoreBackdrop
void btEffectHideBg1AndRestoreBackdrop(void)
Hides BG1 and the windows and starts bringing the battle background's colours back.
References btBackgroundSetModeStub(), Sint32, syIOWriteQueueStore16() and sySynch().
Referenced by btEffectRunAttackSlash() and btEffectRunCriticalHit().
Definition at line 409 of file battle_effect_canvas.c.
btEffectSetupCanvasTileMap
void btEffectSetupCanvasTileMap(void)
Shows the canvas on BG1 instead of BG2, at its own size.
References BgScrollWork, btBackgroundSetModeStub(), btEffectClearTintTimers(), Sint32, sySynch(), syWordsClear() and syWordsFill().
Referenced by btEffectRunAttackSlash() and btEffectRunCriticalHit().
Definition at line 443 of file battle_effect_canvas.c.
btEffectDrawClippedCanvasLine
void btEffectDrawClippedCanvasLine( Sint32 x0, Sint32 y0, Sint32 x1, Sint32 y1, Sint32 color)
Draws a line on the canvas, keeping the brighter colour where it crosses what is drawn; the line's ends are clipped to the canvas's rows only.
References Sint32.
Referenced by btEffectDrawStreaks() and btEffectRunNeptune().
Definition at line 505 of file battle_effect_canvas.c.