Alchemy

blitter.c

The blitter builder, BattleFx_BuildBlitter.

games/tbs/src/effect/parts/blitter.c on GitHub

The blitter builder, BattleFx_BuildBlitter. Part of effect.c, the battle effect object, compiled only through it. The folder README describes the routine it writes, block by block, under "Blitters"; the fragments' registers and modes are described at the top of battle_effect_composite.s.

Functions, without a comment: BattleFx_BuildBlitter.

Macros

BRANCH_FIELD

#define BRANCH_FIELD(site, target)

The 24-bit displacement field of an ARM branch at site to target: in words, counted from the branch plus 8 bytes, as the processor reads two words ahead.

Line 13

BLITTER_PARTIAL_RUN

#define BLITTER_PARTIAL_RUN(mode, flags)

The words of a partial run, one pixel at a time: the mode's one-pixel fragment, read forwards or, mirrored across, backwards. Each walk writes a leading and a trailing run.

Line 19

BLITTER_WALK

#define BLITTER_WALK()

The template walk itself, written once. BattleFx_BuildBlitter expands it twice under two definitions of PUT, COPY, COPY_FROM, COPY_TWICE, PUT_BRANCH, MARK and PATCH: first to count the words, then to write them. It uses the caller's templateWords, flags, mode, widthShift, heightShift, and the branch sites emptyRowsBranch, emptyColumnsBranch, rowLoop, skipBranch, partialRun and fullCellLoop.

Used by BattleFx_BuildBlitter.

Line 58

On this page