include/system/asm.h
The matching devices: the asm statements the C holds for the compiler, not for the program, each a fake match. More…
Included by blitter_color_fragments.c, blitter_fragments.c, system.h and types.h.
Macros
| Name | Description | |
|---|---|---|
#define | ASM_REGISTER (declaration, name) | Keeps a local in the register named. |
#define | ASM_GLOBAL_REGISTER (declaration, name) | Keeps a global in the register named, in every function of the file that declares it: the registers the battle effect blitter's fragments share. |
#define | ASM_AND_LOW_BYTE (result, value) | The and in the four-pixel Max blitter fragments: result takes the low byte of value in the register result is pinned to. |
#define | ASM_READ_PAIR (first, second) | The statement that ends a sound driver command whose registers are pinned, ply_pend's or clear_modM's: it emits nothing, but reads first and second, so the player and the track stay in their registers to the end. |
#define | ASM_READ_TRIPLE (first, second, third) | The statement that ends ld_r3_tp_adr_i_unchecked, the sound driver's command byte reader: it emits nothing, but reads first, second and third, so the player, the track and the byte it gives back in r3 stay in their registers to the end. |
#define | ASM_REWRITE (value) | The statement in the one-pixel Additive blitter fragments after the canvas pixel's load: it emits nothing, but gives value back as if it were new, so the canvas pointer steps at that load and not at the store after it. |
#define | ASM_CLOBBER_R1_R6 (output, input) | The statement in the starfield fall's backdrop loop: it emits nothing, but takes input in a register, leaves output in one with no value set, and destroys r1 and r6, so what lives across it is kept out of those two. |
#define | ASM_NOTHING () | The statement that ends a menu sprite's set-up: it emits nothing, and the compiler counts four bytes for it when it places the next literal pool. |
Description
The matching devices: the asm statements the C holds for the compiler, not for the program, each a fake match. Two keep a variable in a register and one writes out an and; the rest emit nothing and only steer what the compiler keeps where across them.
The asm that is the program is not here. It lives in the function that does the work, in the header that declares it, as SGL's headers have it: we think Camelot kept these as a small library of inline functions mirroring SGL's, Sega's library for the Saturn, on the hardware GBATEK describes. src/system/README.md says what that rests on. That asm is tagged a fake match too, as every asm in the game's C is.
system.h:BiosHaltandBiosStop,syDMAXCopy,syCallReturnIp(syMulFX),syUnitMatrixandsyUnitMatrixCurrentInline- system/
mul_fx.h:syMulFXArm - src/system/
system_internal.h:syStackPointerGetandsyStackPointerSet
Macros in detail
ASM_REGISTER
#define ASM_REGISTER(declaration, name)
Keeps a local in the register named.
FAKEMATCH(asm): a local pinned to a register by an asm register name.
Referenced by syCallReturnIp(), syDMAXCopy() and syUnitMatrixCurrentInline().
Definition at line 24 of file asm.h.
ASM_GLOBAL_REGISTER
#define ASM_GLOBAL_REGISTER(declaration, name)
Keeps a global in the register named, in every function of the file that declares it: the registers the battle effect blitter's fragments share.
FAKEMATCH(asm): a global pinned to a register by an asm register name.
Definition at line 31 of file asm.h.
ASM_AND_LOW_BYTE
#define ASM_AND_LOW_BYTE(result, value)
The and in the four-pixel Max blitter fragments: result takes the low byte
of value in the register result is pinned to. As C, the compiler makes it
in a scratch register and copies it over.
FAKEMATCH(asm): an and of the low byte, written out.
Referenced by BattleEffectMax4Forward() and BattleEffectMax4Reverse().
Definition at line 39 of file asm.h.
ASM_READ_PAIR
#define ASM_READ_PAIR(first, second)
The statement that ends a sound driver command whose registers are pinned,
ply_pend's or clear_modM's: it emits nothing, but reads first and second,
so the player and the track stay in their registers to the end.
FAKEMATCH(barrier): an empty asm that reads first and second.
Definition at line 48 of file asm.h.
ASM_READ_TRIPLE
#define ASM_READ_TRIPLE(first, second, third)
The statement that ends ld_r3_tp_adr_i_unchecked, the sound driver's command
byte reader: it emits nothing, but reads first, second and third, so
the player, the track and the byte it gives back in r3 stay in their
registers to the end.
FAKEMATCH(barrier): an empty asm that reads first, second and third.
Definition at line 56 of file asm.h.
ASM_REWRITE
#define ASM_REWRITE(value)
The statement in the one-pixel Additive blitter fragments after the canvas
pixel's load: it emits nothing, but gives value back as if it were new, so
the canvas pointer steps at that load and not at the store after it.
FAKEMATCH(barrier): an empty asm that rewrites value.
Referenced by BattleEffectAdditiveForward() and BattleEffectAdditiveReverse().
Definition at line 63 of file asm.h.
ASM_CLOBBER_R1_R6
#define ASM_CLOBBER_R1_R6(output, input)
The statement in the starfield fall's backdrop loop: it emits nothing, but
takes input in a register, leaves output in one with no value set, and
destroys r1 and r6, so what lives across it is kept out of those two.
FAKEMATCH(barrier): an empty asm that reads input, sets output * and clobbers r1 and r6; as no asm, 197 of 1532 instructions * differ in tbs-en.
Referenced by btEffectRunStarfieldFall().
Definition at line 70 of file asm.h.
ASM_NOTHING
#define ASM_NOTHING()
The statement that ends a menu sprite's set-up: it emits nothing, and the compiler counts four bytes for it when it places the next literal pool.
FAKEMATCH(barrier): an empty asm; the literal pools after a menu * sprite's two stores sit where the ROM has them only with four bytes * counted that no instruction emits, which nothing else in this compiler * does; as no asm.
Referenced by mnBattleCollectPartyCommands() and mnBattleStatusScreenRun().
Definition at line 78 of file asm.h.