Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_blitter.c

The canvas blitter builder: loading and building ARM blitters from blitter_template.s and blitter_fragments.c. More…

Included by battle_effect.c.

Macros

NameDescription
#defineBLITTER_BYTES 436The most bytes a built blitter takes.
#defineCOPY8_WORDS 16The run fragments' lengths in words: eight pixels copied, eight copied where not 0, and four kept where brighter or added, each laid twice.
#defineTRANSPARENT8_WORDS 25
#defineMAX4_WORDS 16
#defineCOLOR_WORDS 14
#defineBRANCH_FIELD (site, target)An ARM branch's 24-bit word offset from site to target.
#definePUT (word)Writing a blitter at dest: a word; words copied from a fragment, by CPU or DMA, once or twice; a branch to target; or the branch at site aimed here.
#defineCOPY_FROM (from, n)
#defineCOPY (n)
#defineCOPY_LONG (n)
#defineCOPY_DMA (from, n)
#defineCOPY_TWICE (from, n)
#definePUT_BRANCH (target)
#definePATCH (site)

Functions

NameDescription
Sint32btEffectLoadBlitter (Sint32 slot, Sint32 modeAndFlags)btEffectBuildBlitter(slot, 7, 7, flags, mode) for a 128 by 128 canvas, with the flags and the mode packed into one word: mode << 4 | flags.
Sint32btEffectBuildBlitter (Sint32 slot, Sint32 widthShift, Sint32 heightShift, Sint32 flags, Uint32 mode)Writes a drawing function for the canvas into heap slot slot, built from the template BlitterTemplate for one clip, mirroring and blend mode.

Description

The canvas blitter builder: loading and building ARM blitters from blitter_template.s and blitter_fragments.c. Part of battle_effect.c.

Macros in detail

BLITTER_BYTES

#define BLITTER_BYTES 436

The most bytes a built blitter takes.

Referenced by btEffectBuildBlitter().

Definition at line 19 of file battle_effect_blitter.c.

COPY8_WORDS

#define COPY8_WORDS 16

The run fragments' lengths in words: eight pixels copied, eight copied where not 0, and four kept where brighter or added, each laid twice.

Referenced by btEffectBuildBlitter().

Definition at line 22 of file battle_effect_blitter.c.

TRANSPARENT8_WORDS

#define TRANSPARENT8_WORDS 25

Referenced by btEffectBuildBlitter().

Definition at line 23 of file battle_effect_blitter.c.

MAX4_WORDS

#define MAX4_WORDS 16

Referenced by btEffectBuildBlitter().

Definition at line 24 of file battle_effect_blitter.c.

COLOR_WORDS

#define COLOR_WORDS 14

Referenced by btEffectBuildBlitter().

Definition at line 25 of file battle_effect_blitter.c.

BRANCH_FIELD

#define BRANCH_FIELD(site, target)

An ARM branch's 24-bit word offset from site to target.

Definition at line 28 of file battle_effect_blitter.c.

PUT

#define PUT(word)

Writing a blitter at dest: a word; words copied from a fragment, by CPU or DMA, once or twice; a branch to target; or the branch at site aimed here.

Referenced by btEffectBuildBlitter().

Definition at line 33 of file battle_effect_blitter.c.

COPY_FROM

#define COPY_FROM(from, n)

Referenced by btEffectBuildBlitter().

Definition at line 38 of file battle_effect_blitter.c.

COPY

#define COPY(n)

Referenced by btEffectBuildBlitter().

Definition at line 41 of file battle_effect_blitter.c.

COPY_LONG

#define COPY_LONG(n)

Referenced by btEffectBuildBlitter().

Definition at line 47 of file battle_effect_blitter.c.

COPY_DMA

#define COPY_DMA(from, n)

Referenced by btEffectBuildBlitter().

Definition at line 54 of file battle_effect_blitter.c.

COPY_TWICE

#define COPY_TWICE(from, n)

Referenced by btEffectBuildBlitter().

Definition at line 57 of file battle_effect_blitter.c.

PUT_BRANCH

#define PUT_BRANCH(target)

Referenced by btEffectBuildBlitter().

Definition at line 66 of file battle_effect_blitter.c.

PATCH

#define PATCH(site)

Referenced by btEffectBuildBlitter().

Definition at line 69 of file battle_effect_blitter.c.

Functions in detail

btEffectLoadBlitter

Sint32 btEffectLoadBlitter(Sint32 slot, Sint32 modeAndFlags)

btEffectBuildBlitter(slot, 7, 7, flags, mode) for a 128 by 128 canvas, with the flags and the mode packed into one word: mode << 4 | flags.

References btEffectBuildBlitter() and Sint32.

Definition at line 6 of file battle_effect_blitter.c.

btEffectBuildBlitter

Sint32 btEffectBuildBlitter(Sint32 slot, Sint32 widthShift, Sint32 heightShift, Sint32 flags, Uint32 mode)

Writes a drawing function for the canvas into heap slot slot, built from the template BlitterTemplate for one clip, mirroring and blend mode.

References BattleEffectAdditiveForward(), BattleEffectAdditiveReverse(), BattleEffectColorForward(), BattleEffectColorReverse(), BattleEffectCopy8Forward(), BattleEffectCopy8Reverse(), BattleEffectCopyForward(), BattleEffectCopyReverse(), BattleEffectMask(), BattleEffectMax4Forward(), BattleEffectMax4Reverse(), BattleEffectMaxForward(), BattleEffectMaxReverse(), BattleEffectTransparent8Forward(), BattleEffectTransparent8Reverse(), BattleEffectTransparentForward(), BattleEffectTransparentReverse(), BlitterImmediatePowers, BlitterTemplate, Sint32, syDMAXCopy() and syHeapSlotAllocate().

Referenced by btEffectLoadBlitter(), btEffectRunCloudSwirl(), btEffectRunHaures(), btEffectRunMeteorBlow(), btEffectRunStarfieldFall() and btEffectRunStatBoost().

Definition at line 77 of file battle_effect_blitter.c.