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 color_scale_kernel.c, blitter_color_fragments.c, blitter_fragments.c, world_map_lines.c, leftover_modulation_helpers.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_THUMB_CALL_ARCTAN (angle, xValue, yValue, slot) | Calls a stub table slot in Thumb through fdMatrixCallInThumb, with its target in ip, and leaves the low half of what it returns in angle. |
#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_REWRITE_READING_ZERO (value) | The statement after Megiddo's corona model takes its kind: it emits nothing, but takes a zero in a register and gives value back as if it were new, so the texture's address is set up before the model is moved from r0. |
#define | ASM_REWRITE_PAIR (counter, pointer) | The statement before Garoh's night path ripple loop: it emits nothing, but gives counter and pointer back as if they were new and reads pointer, so the loop's first test of the counter stays in. |
#define | ASM_NOTHING () | The statement that ends a sprite's set-up, a menu sprite's or a battle effect's: it emits nothing, the compiler counts four bytes for it when it places the next literal pool, and nothing is scheduled across it. |
Variables
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, one writes out an and and one calls a Thumb function from ARM code; 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:BiosStop,syDMAXCopy,syCopyWordsandsyUnitMatrix- system/
mul_fx.h:syMulFXArm - src/system/
system_internal.h:syMatrixStoreUnit(the system library's own unit matrix),syUnitMatrixCurrentInlineandsyCartJump
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 btColorBufferScaleArm(), MusicTrackClearModulationStateLeftover(), MusicTrackReadCommandByteLeftover(), syCopyWords(), syDMAXCopy(), syMatrixBuildLookAt() 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_THUMB_CALL_ARCTAN
#define ASM_THUMB_CALL_ARCTAN(angle, xValue, yValue, slot)
Calls a stub table slot in Thumb through fdMatrixCallInThumb, with its target
in ip, and leaves the low half of what it returns in angle.
FAKEMATCH(asm): x pinned to r0 by an asm register name.
FAKEMATCH(asm): y pinned to r1 by an asm register name.
Referenced by fdWorldMapUpdateAffineLines().
Definition at line 45 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.
Referenced by MusicTrackClearModulationStateLeftover().
Definition at line 68 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.
Referenced by MusicTrackReadCommandByteLeftover().
Definition at line 76 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 83 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, 192 of 1580 instructions * differ in tla-en.
Referenced by btEffectRunStarfieldFall().
Definition at line 90 of file asm.h.
ASM_REWRITE_READING_ZERO
#define ASM_REWRITE_READING_ZERO(value)
The statement after Megiddo's corona model takes its kind: it emits nothing,
but takes a zero in a register and gives value back as if it were new, so
the texture's address is set up before the model is moved from r0.
FAKEMATCH(barrier): an empty asm that rewrites value and reads a * zero.
Referenced by btEffectRunMegiddo().
Definition at line 99 of file asm.h.
ASM_REWRITE_PAIR
#define ASM_REWRITE_PAIR(counter, pointer)
The statement before Garoh's night path ripple loop: it emits nothing, but
gives counter and pointer back as if they were new and reads pointer,
so the loop's first test of the counter stays in.
FAKEMATCH(barrier): an empty asm that rewrites counter and pointer * and reads pointer.
Referenced by scGarohWavePathLayer().
Definition at line 107 of file asm.h.
ASM_NOTHING
#define ASM_NOTHING()
The statement that ends a sprite's set-up, a menu sprite's or a battle effect's: it emits nothing, the compiler counts four bytes for it when it places the next literal pool, and nothing is scheduled across it.
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, and Daedalus's missile sprite needs the same statement; as no * asm.
Referenced by btEffectRunDaedalus() and mnBattleCollectPartyCommands().
Definition at line 115 of file asm.h.
Variables in detail
yValue
register Sint32 y __asm__("r1")
References Sint32.
Definition at line 49 of file asm.h.
result
register Sint32 result __asm__("r0")
References Sint32.
Referenced by btAppendLinkedActions(), btAutoBattleShowDefend(), btBuildUnitActions(), btCameraSetCommandView(), btDjinnRecoveryCountDownSide(), btEffectPosProjectPoint(), btEnemySpriteLoadIntoSlots(), btFormationSelectLevelMatchedCandidate(), btObjectGetAnchor(), btRun(), btSpriteIsSmall(), btStagingDispatchAction(), btStagingRunItem(), btUnitGetWeaponSprite(), fdActorCheckBlocked(), fdActorFindBySprite(), fdActorGetCueMetatileAheadOfCurrent(), fdActorGetSpriteById(), fdActorScriptEnd(), fdCameraWorldToScreen(), fdCheckConfiguredKeys(), fdClimbUp(), fdEngineRun(), fdEntrancePlayArrival(), fdExamineMetatile(), fdLeaderCanPushObjectAhead(), fdLeaderPushObjectAhead(), fdPartyApplyPoisonDamage(), fdPartyInventoryGiveItem(), fdPsynergyParch(), fdRopeFindNodeNear(), fdRopeLayCoil(), fdRopeLayTied(), fdRunPushMetatile(), fdRunRaisedCue(), fdScriptAskYesNoAndShowResponse(), fdSelectPsynergyTarget(), fdTalkToActor(), fdTerrainGetBendSumDiagonalHeight(), fdTightropeFindNodeNear(), fdTightropeLay(), fdTightropeLayCoil(), fdTryJumpForward(), fdUseItem(), fdWorldMapGetCollision(), fdWorldMapStartZoom(), gmClassDetermine(), gmInventoryCheckDiscard(), gmInventoryCheckUnequip(), gmInventoryRemove() and 137 more.
Definition at line 51 of file asm.h.