system
games/tbs/include/system on GitHub
callback_scheduler.h
games/tbs/include/system/callback_scheduler.h
Structures
SchedulerTask
struct SchedulerTask
A scheduled task: its routine's address, its order (see SCHEDULER_KEY_) and its flags, where bit 0 keeps it running while overlay tasks are suspended.
| Field | Declared as | |
|---|---|---|
callback | u32 callback | |
state | u16 state | |
mask | u8 mask | |
reserved | u8 reserved |
Used by Scheduler_ResetTaskTable, gSchedulerTaskTable.
Enumerations, without a comment: SchedulerTaskLimits.
Types, without a comment: SchedulerCallback.
Macros
SCHEDULER_KEY_VBLANK
#define SCHEDULER_KEY_VBLANK 0x480
A task's order: the high byte picks the pass that runs it, the low byte ranks it within the pass (higher runs first). An odd high byte means the task is suspended, so no pass matches it.
Used by DisplayScroll_InitObjectTable, DisplayScroll_RunSlideshow, System_VBlankHandler, Title_ShowIntro.
Also, macros without a comment: SCHEDULER_KEY_MAIN_LOOP, TASK_STATE_HIGH.
Globals
gSchedulerReady
extern u8 gSchedulerReady
1 once the task table is set up
Used by Scheduler_ResetTaskTable.
Also, globals without a comment: gSchedulerStatus, gSchedulerTaskTable.
Declarations, without a comment: Scheduler_RunCallbacksByKey, Scheduler_CountCallbacksByKey, Scheduler_RunCallbacksBeforeBoundary.
dma.h
games/tbs/include/system/dma.h
Functions, without a comment: Dma_Set.
Structures
DmaRegisters
struct DmaRegisters
A DMA channel's registers (DMAxSAD, DMAxDAD, DMAxCNT).
| Field | Declared as | |
|---|---|---|
source | u32 source | |
destination | u32 destination | |
control | u32 control | The count in the low half, DMAxCNT_H's flags above it. |
Used by WaitDma.
Macros
DMA3
#define DMA3 ((volatile struct DmaRegisters *)REG_DMA3)
DMA3, the channel the game copies with, as its three registers.
Used by WaitFrames.
Dma_Fill16
#define Dma_Fill16(value, destination, size)
Fills size bytes at destination with the halfword value by DMA3, from
a volatile copy of it on the stack.
Used by Memory_FillHalfwordsDma, UiWindow_FillFromScene.
Dma_Fill32
#define Dma_Fill32(value, destination, size)
Fills size bytes at destination with the word value by DMA3.
Used by AffineEffect_InitializeWork, AltmillerCave_Initialize, BattleEffect_InitializeBuffers, BattleFx_ClearOwnedSlot, BattleFx_InitializeSlots, BattleFx_LoadActionEffectResources, BattleFx_RunAnnihilation, BattleFx_SetupResourcesAndWindow, BattleFx_StartBufferBlend, BattlePresentation_InitializeWorkAndResetState, Colosso_ShowItemIcon, Curtain_Start, DebugText_Clear, DisplayScroll_InitializeHBlankDma, DisplayTransition_AllocateAndClearState, DisplayTransition_FillTilemapAndSolidTile, DisplayTransition_InitializeBattleEffectState, DisplayTransition_InitializeState, EffectSlot_Initialize, FieldEffect_InitSparkles, FieldFx_StartGroundParticles, FieldFx_StartLightning, FieldMotes_Start, FieldObject_Create, Field_PlaceMapMarkers, Field_RunScene, MapAnimation_StartChannels, MercuryLighthouse_RestoreLights, ObjectDispatch_Release, OptionMenu_InitializeWork, PaletteFade_Init, ResourceMetadata_ClearRecord, ResourceObject_Release, RunSceneTransitionEffect, Runtime_InitializeHeap, SaveMenu_SelectSlot, SaveState_InitializeWorkspace, SaveState_InvalidateSlot, SaveState_LoadSummaryRecords, SaveState_WriteRecord and 6 more.
Dma_Fill32Cell
#define Dma_Fill32Cell(cell, value, destination, size)
Dma_Fill32 through the caller's own volatile word cell, so a function that
fills several blocks keeps one word for all of them and forms its address
once; the word also takes the caller's place in the frame
(Map_InitializePerspectiveScene's sp+28, where Dma_Fill32's would be sp+16).
Used by BattleFx_SetupBlendedDisplay, BattleFx_StartFadeOverlay, BattlePres_RunEntryTransition, Battle_RunEncounter, DisplayScroll_InitObjectTable, Graphics_ClearCharacterBlockAndPalette, ObjectSystem_Configure, ObjectSystem_Initialize, Ui_RunIconMonitor.
Cpu_Fill32
#define Cpu_Fill32(value, destination, size)
pret's CpuFill32: repeats one word through the BIOS CpuSet service.
Used by SerialTest_Run.
far_runtime.h
games/tbs/include/system/far_runtime.h
field_effect.h
games/tbs/include/system/field_effect.h
Structures
FieldEffect
struct FieldEffect
A field effect: a small object on the field that moves at its velocity and grows and spins at its rates, run by its script and update hook.
| Field | Declared as | |
|---|---|---|
unk00 | u8 unk00[8] | FieldActor's script pointer, cursor and facing; not named by this view. |
x | s32 x | 16.16 fixed-point pixels |
y | s32 y | 16.16 fixed-point pixels |
z | s32 z | 16.16 fixed-point pixels |
unk14 | u8 unk14[4] | FieldActor's terrainHeight; not named by this view |
scaleX | s32 scaleX | 16.16 fixed point, 0x10000 full size |
scaleY | s32 scaleY | 16.16 fixed point, 0x10000 full size |
unk20 | u8 unk20[3] | FieldActor's radius and terrainId; not named by this view |
priorityFlags | u8 priorityFlags | ActorPriorityFlag bits: the spawner clears ACTOR_PRIORITY_AUTOMATIC when EFFECT_USE_PRIORITY sets the sprite's priority. |
unk24 | u8 unk24[0x0c] | FieldActor's velocityX to velocityZ; effects move by velocity instead. |
scaleRateX | s32 scaleRateX | Added to scaleX each frame by the update hooks, in 16.16 fixed point a frame; zeroed by the spawner. |
scaleRateY | s32 scaleRateY | as scaleRateX, for scaleY |
unk38 | u8 unk38[0x0c] | FieldActor's targetX to targetZ; not named by this view |
velocity | struct Vector3 velocity | Added to x, y and z each frame by the update hooks, in 16.16 fixed-point pixels per frame; FieldActor's bounce, gravity and riseBaseY. |
sprite | struct AnimationObject *sprite | the sprite spin turns |
unk54 | u8 unk54 | FieldActor's spriteStorageKind; not named by this view |
motionFlags | u8 motionFlags | ActorMotionFlag bits; zeroed by the spawner |
unk56 | u8 unk56[3] | FieldActor's unk56; not named by this view |
collisionFlags | u8 collisionFlags | FieldActor's collisionFlags; not named by this view |
unk5a | u8 unk5a[0x0a] | FieldActor's steeringFlags to riseEnabled; not named by this view. |
spin | u16 spin | Added to the sprite's rotation each frame by the update hooks, in 1/65536 turns per frame; Imil's rising effects keep a drift here instead. |
unk66 | u8 unk66[2] | FieldActor's work; not named by this view |
countdown | s32 countdown | Frames until a scene's update hook releases the effect: 20 for Altin Peak's spray, 60 for Imil's rising effects. |
update | void (*update)(union FieldObject *object) | Called each frame while the effect is live: the spawner sets BattleFx_UpdateObjectMotionScaleAndLinkedAngle, or options.update. |
Used by Effect_AdvanceMotion, Effect_InitializeMotion, FieldFx_UpdateParticleMotionAndScale, Fuchin_UpdateDustMotion, ImilFuchinFalls_SpawnDust, SolSanctum_StartFloatingLights.
EffectScripts
struct EffectScripts
The three scripts a scene's own effect spawner picks from by EFFECT_SCRIPT_MASK, wrapped so that the spawner can copy them into its frame whole.
| Field | Declared as | |
|---|---|---|
script | const s32 *script[3] |
Used by GomaCavePillar_SpawnFragment, gGomaCavePillar_FragmentScripts.
EffectOptions
struct EffectOptions
The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET) is set.
| Field | Declared as | |
|---|---|---|
priority | s32 priority | the sprite's priority |
palette | s32 palette | passed to ObjectGroup_SetChildValue |
startScaleX | s32 startScaleX | 16.16 fixed point, 0x10000 full size |
startScaleY | s32 startScaleY | 16.16 fixed point, 0x10000 full size |
targetScaleX | s32 targetScaleX | 16.16 fixed point, 0x10000 full size |
targetScaleY | s32 targetScaleY | 16.16 fixed point, 0x10000 full size |
type | s16 type | the object type to create; 222 without the flag |
script | const s32 *script | the object script, run in mode 1 |
rotation | u16 rotation | 1/65536 turns |
spin | u16 spin | 1/65536 turns per frame |
update | void (*update)(union FieldObject *object) | replaces the update hook |
Used by BabiLighthouse_LandWithParticles, BattleFx_SpawnRadialParticleRing, CollapseFromHeat, CrossboneIslePillarRooms_SpawnFrostParticle, CrossboneIslePillarRooms_SpawnThawParticle, CrossboneIslePillarRooms_SpawnUnusedLeaderParticle, CrossboneIsle_SpawnBlockMovedBurst, Event_HopDownStep, Event_SinkPillarA, Event_SinkPillarB, Event_StepOnEastWallSwitch, Event_StepOnWallSwitch, Event_StepOnWestWallSwitch, GomaCaveEntrance_LeapStump, GomaCaveWaterway_LeapStump, HeatGauge_CountStep, ImilFuchinFalls_BlowCaveMouthDust, ImilFuchinFalls_SpawnDust, Leader_SpraySand, MercuryLighthouseAerie_SaturosAndAlexWarpIn, MercuryLighthouseAerie_SaturosAndAlexWarpOut, MercuryLighthouse_CloseStoneDoor, MercuryLighthouse_OpenFountainWithSpray, MercuryLighthouse_OpenStoneDoor, MercuryLighthouse_StopFountainSpray, MogallForest_SpawnPuffRing, Rubble_SetScaleAndSpin, SceneEffect_SpawnNineRadialEffects, SlideDownDune, SolSanctumElementalStarRoom_AnimateAlexTeleport, SuhallaDesert_ChaseLeader, TretTreeInteriors_RunLandingDustScene, TunnelRuins_SplashDousedPillar, VenusLighthouseAerie_CombineSaturosAndMenardi, VenusLighthouse_AnimateEastTileWave, VenusLighthouse_AnimatePairedTileWaves, VenusLighthouse_AnimateWestTileWave, VenusLighthouse_EmitGateParticles, VenusLighthouse_EmitPassageSparkTrail, VenusLighthouse_EmitRisingParticles and 5 more.
Unions
FieldObject
union FieldObject
An object on the field, read as an actor or as an effect.
| Field | Declared as | |
|---|---|---|
actor | struct FieldActor actor | |
effect | struct FieldEffect effect |
Used by Actor_DrawBehindScenery, AltmillerCave_MatchLeaderPriority, AltmillerCave_PulseLight, BabiLighthouse_LandWithParticles, BabiLighthouse_MatchLeaderPriority, BabiLighthouse_SetupScene, BattleEffect_CleanupSceneObjects, BattleEffect_SetRandomTableValueOnObject, BattleFx_AdvanceAngleWithRamp, BattleFx_AdvanceSpinAngle, BattleFx_CircleAnchor, BattleFx_FlickerObjectAndTick, BattleFx_HalveDistanceToTarget, BattleFx_MoveAfterimageHalfway, BattleFx_ResumeObject, BattleFx_RunSparkEmitter, BattleFx_SetCallbackWhenTargetUnset, BattleFx_SetObjectAlternatingWords, BattleFx_ShrinkObjectScaleUntilHalf, BattleFx_SwayParticle, BattleFx_UpdateDescendingObject, BattleFx_UpdateDescendingOrbitObject, BattleFx_UpdateDescendingParticleNegativeArc, BattleFx_UpdateDescendingParticlePositiveArc, BattleFx_UpdateDriftingFallObject, BattleFx_UpdateItemBreakFragment, BattleFx_UpdateObjectMotionScaleAndLinkedAngle, BattleFx_UpdateOrbitingParticleFade, BattleFx_UpdateOrbitingParticleLeft, BattleFx_UpdateOrbitingParticleMain, BattleFx_UpdateOrbitingParticleRight, BattleFx_UpdatePairedArcSpawner, BattleFx_UpdateShrinkingOrbitObject, BattleFx_WanderAroundAnchor, Beast_Hop, Beast_SpawnSpray, ColossoLogRollingStage_SpawnRandomSceneEffect, ColossoRiver_SpawnRandomEffect, ColossoWall_SpawnRandomSceneEffect, CrossboneIslePillarRooms_FreezePool and 90 more.
Enumerations
EffectSpawnFlags
enum EffectSpawnFlags
| Value | = | |
|---|---|---|
EFFECT_SCRIPT_MASK | 0x0f | Picks one of gEffectScripts; the object's mode is this plus 1. |
EFFECT_USE_PALETTE | 0x10000 | options.palette, as its group child value |
EFFECT_USE_PRIORITY | 0x20000 | options.priority, as the sprite's priority |
EFFECT_SCALE_TO_TARGET | 0x40000 | Grows from the start scale, or full size, to the target scale over the script's repeat count. |
EFFECT_USE_START_SCALE | 0x80000 | options.startScaleX and startScaleY |
EFFECT_USE_TYPE | 0x100000 | options.type, else object type 222 |
EFFECT_USE_SCRIPT | 0x200000 | options.script, run in mode 1 |
EFFECT_USE_ROTATION | 0x400000 | options.rotation, as the sprite's |
EFFECT_USE_SPIN | 0x800000 | options.spin |
EFFECT_USE_UPDATE | 0x1000000 | options.update |
Macros, without a comment: SCRIPT_WAIT, SCRIPT_SET_POSITION, SCRIPT_REPEAT, SCRIPT_DELETE.
Declarations, without a comment: Effect_SpawnResident.
fixed_point_position.h
games/tbs/include/system/fixed_point_position.h
Structures
FixedPointPosition
struct FixedPointPosition
A position in three coordinates, each in 16.16 fixed point.
| Field | Declared as | |
|---|---|---|
x | s32 x | 16.16 fixed point |
y | s32 y | 16.16 fixed point |
z | s32 z | 16.16 fixed point |
Used by BattleFx_RunCastingImpact, BattleFx_UpdateRadialMotion, BattleMotion_ApplyPairMidpoint, BattlePresentation_UpdateCamera, Battle_GetWorkEntryPair, Camera_ConfigureScene, Camera_InitDefaultTransform, FieldFx_RunCatch, Ship_UpdateSwell, Shop_RunPartyMemberIconBurst.
flash.h
games/tbs/include/system/flash.h
Declarations, without a comment: gFlashReadRoutine.
flash_data.h
games/tbs/include/system/flash_data.h
Structures
FlashSector
struct FlashSector
Sector size and count.
| Field | Declared as | |
|---|---|---|
size | s32 size | |
shift | u8 shift | |
count | u16 count | |
top | u16 top |
FlashType
struct FlashType
Flash chip type (the 24-byte record pointed to by gFlash).
| Field | Declared as | |
|---|---|---|
romSize | u32 romSize | |
sector | struct FlashSector sector | |
wait | u16 wait[2] | Low two bits of REG_WAITCNT. |
id | u16 id |
Used by EraseFlashSector, ProgramFlashSectorWithEraseRetry, gFlash.
FlashSetupInfo
struct FlashSetupInfo
Settings for each flash chip model (44 bytes), in flash_setup's field order from flashset.s.
| Field | Declared as | |
|---|---|---|
handlers | u32 handlers[3] | Program, erase all, erase sector. |
wait | FlashWaitProc wait | Wait for programming to finish. |
maxTime | u16 *maxTime | Wait-time table. |
type | struct FlashType type |
Used by EraseAtmelFlashSector, IdentifyFlash, gFlash_ChipAtmel, gFlash_ChipAtmelLayout, gFlash_ChipUnknown, gFlash_Chips.
Types, without a comment: FlashWaitProc.
Macros, without a comment: GUARD_FLASH_DATA_H.
Globals, without a comment: gFlash, gFlash_ChipUnknown, gFlash_ChipAtmel, gFlash_ChipAtmelLayout.
io_reg.h
games/tbs/include/system/io_reg.h
Enumerations
DisplayControl
enum DisplayControl
| Value | = | |
|---|---|---|
DISPCNT_MODE_0 | 0x0000 | four text backgrounds |
DISPCNT_MODE_1 | 0x0001 | BG0 and BG1 text, BG2 affine |
DISPCNT_MODE_2 | 0x0002 | BG2 and BG3 affine |
DISPCNT_OBJ_1D_MAP | 0x0040 | |
DISPCNT_BG0_ON | 0x0100 | |
DISPCNT_BG1_ON | 0x0200 | |
DISPCNT_BG2_ON | 0x0400 | |
DISPCNT_BG3_ON | 0x0800 | |
DISPCNT_OBJ_ON | 0x1000 | |
DISPCNT_WIN0_ON | 0x2000 | |
DISPCNT_WIN1_ON | 0x4000 | |
DISPCNT_OBJWIN_ON | 0x8000 |
Also, enumerations without a comment: KeyMask.
Macros
DISPSTAT_VCOUNT_LINE
#define DISPSTAT_VCOUNT_LINE(line) ((line) << 8)
DISPSTAT's high byte: the line the VCount interrupt fires on (the LYC compare).
Used by Runtime_SetIrqHandler.
BGCNT_WRAP
#define BGCNT_WRAP 0x2000
Affine backgrounds only: wrap around instead of showing the backdrop.
Used by BattleCamera_SetRange, BattleFx_BeginTiledCanvas, BattleFx_RunAtalanta, BattleFx_RunDouse, BattleFx_RunIce, BattleFx_RunJudgment, BattleFx_RunParticleStreams, BattleFx_RunThor, BattleFx_RunTorch.
BGCNT_SIZE
#define BGCNT_SIZE(n) ((n) << 14)
The background's size: for an affine one, 0 to 3 are 128, 256, 512 and 1024 pixels square.
Used by BattleFx_BeginTiledCanvas.
Q_8_8
#define Q_8_8(n) ((s16)((n) * 256))
The BG2/BG3 affine matrix entries are signed 8.8 fixed point: texels stepped per screen pixel. Q_8_8(1) draws the layer at its own size and Q_8_8(0.5) twice as large.
Used by BattleFx_RunAtalanta, BattleFx_RunBind, BattleFx_RunBurstShower, BattleFx_RunCastingImpact, BattleFx_RunCondemn, BattleFx_RunCybele, BattleFx_RunDjinnBeams, BattleFx_RunElementBurst, BattleFx_RunElementPillar, BattleFx_RunGaia, BattleFx_RunGrowingColumns, BattleFx_RunHealingMotes, BattleFx_RunImpactBurst, BattleFx_RunJudgment, BattleFx_RunMirroredWall, BattleFx_RunNeptune, BattleFx_RunParticleStreams, BattleFx_RunQuake, BattleFx_RunRay, BattleFx_RunSpiderWeb, BattleFx_RunStatBoost, BattleFx_RunThor, BattleFx_RunThorn, BattleFx_RunTorch, BattleFx_RunVine, BattleFx_StartElementStreaks, Graphics_ResetBg2Pa, Graphics_SetBg2AffineScaleHalf.
WIN_RANGE
#define WIN_RANGE(start, end) (((start) << 8) | (end))
A REG_WINxH or REG_WINxV value: the window covers start up to, but not including, end.
Used by BattleFx_RunBoreas, BattleFx_RunDouse, BattleFx_RunIce, BattleFx_RunKirin, BattleFx_RunNeptune, BattleFx_RunRamses, BattleFx_StartWindowHBlankDma, BattlePres_RunAttack, BattlePres_RunEntryTransition, LuckyDice_Run, ReelGame_Run, Title_LoadIntroBackgrounds.
BLEND_ALPHA
#define BLEND_ALPHA(top, bottom) ((top) | ((bottom) << 8))
A REG_BLDALPHA value: top and bottom are the two targets' weights, out of 16.
Used by BattleFx_BeginCanvasLayer, BattleFx_ConfigureEffectDisplay, BattleFx_OpenCanvasLayer, BattleFx_RunBladeRain, BattleFx_RunBoreas, BattleFx_RunBurstScene, BattleFx_RunBurstShower, BattleFx_RunCastingImpact, BattleFx_RunCondemn, BattleFx_RunDjinniEntrance, BattleFx_RunDragonCloud, BattleFx_RunElementBurst, BattleFx_RunElementPillar, BattleFx_RunFire, BattleFx_RunFlare, BattleFx_RunFroth, BattleFx_RunGaia, BattleFx_RunGround, BattleFx_RunGrowingColumns, BattleFx_RunHail, BattleFx_RunJudgment, BattleFx_RunJupiter, BattleFx_RunKirin, BattleFx_RunLobbedShells, BattleFx_RunNeptune, BattleFx_RunNereid, BattleFx_RunOrbitingSkulls, BattleFx_RunPaletteParticles, BattleFx_RunParticleStreams, BattleFx_RunPlasma, BattleFx_RunPrism, BattleFx_RunRagnarok, BattleFx_RunShatteringOpening, BattleFx_RunSparkGroups, BattleFx_RunSpiderWeb, BattleFx_RunStreakVolley, BattleFx_RunTargetStrike, BattleFx_RunThor, BattleFx_RunThorn, BattleFx_RunTitanBlade and 26 more.
RGB
#define RGB(r, g, b) (((b) << 10) | ((g) << 5) | (r))
A 15-bit colour from its red, green and blue levels (0 to 31 each), as the palette stores it: blue in the high bits.
Used by BattleFx_RunCybele, BattleFx_RunEruption, BattleFx_RunGaia, BattleFx_RunJudgment, BattleFx_RunMercuryDjinnCapture, BattleFx_RunParticleStreams, BattleFx_RunShatteringOpening, BattleFx_StepPaletteToResource, Debug_RunPaletteEditor, FieldFx_UpdateMindReadWave, Graphics_ConvertBackgroundToBlueRamp, Graphics_UpdatePhasePalette, Palette_BrightenBgEntries, Palette_DarkenSceneStep, Palette_StepTowardResource, ReelGame_Run, RunSceneTransitionEffect, Ui_LoadWindowGraphics, Ui_SetBank15PaletteAndClearRenderMode, WaitFrames.
OBJ_VRAM0
#define OBJ_VRAM0 0x06010000
Sprite tile memory, as pret names it: the 32 KB from 0x06010000.
Used by BattleEvent_Playback, DisplayScroll_DrawLine, DisplayScroll_InitObjectTable, LuckyDice_Run, Map_RenderAnimatedTileFrame, ReelGame_Run, Sprite_ComposeAnimationFrame, Title_LoadIntroBackgrounds, UiText_DrawGlyph, VramCache_Load.
TIMER_INTR_ENABLE
#define TIMER_INTR_ENABLE 0x0040
TMxCNT_H flags, as pret names them.
Used by SerialRuntime_HandleTransferInterrupt, SerialRuntime_PrepareSendPacket.
RCNT_SIO_MODE
#define RCNT_SIO_MODE 0x0000
RCNT's mode: 0 leaves the port to SIOCNT's serial modes; bit 15 alone makes it general-purpose pins.
Used by SerialRuntime_Initialize.
DMA_START_TIMING_DRQ_REPEAT
#define DMA_START_TIMING_DRQ_REPEAT
A DMA control's start timing (bits 12 and 13), cartridge request (bit 11) and repeat (bit 9): the bits cleared before a channel is stopped.
Used by BattleFx_ArmBg0HBlankDma, BattleFx_StartWindowHBlankDma, DisplayScroll_ArmHBlankDma, DisplayScroll_DisarmHBlankDma, DisplayTransition_UpdateFrame, DisplayTransition_UpdateScanlineTable, Dma_Stop, Game_ResetForNewGame, ReelGame_RunFrame, Ripple_Stop, System_Initialize, System_VBlankHandler.
CPU_SET_SRC_FIXED
#define CPU_SET_SRC_FIXED 0x01000000
BIOS CpuSet control flags, above its count.
Used by AudioEngine_Initialize, AudioEngine_SuspendDirectSound, CgbAudio_Initialize.
OAM_SIZE
#define OAM_SIZE 0x400
OAM's size in bytes: 128 sprites of 8 bytes.
Used by DisplayScroll_UpdateObjects, System_VBlankHandler.
KEYCNT_DISARMED
#define KEYCNT_DISARMED 0xc3ff
Requires all ten keys together to prevent the reset chord retriggering it.
Used by Input_HandleKeyInterrupt, Runtime_InstallIwramAndIrqs.
Also, macros without a comment: REG_DISPCNT, REG_DISPSTAT, DISPSTAT_VBLANK_INTR, DISPSTAT_HBLANK_INTR, DISPSTAT_VCOUNT_INTR, REG_VCOUNT, REG_BG1CNT, REG_BG2CNT, REG_BG3CNT, BGCNT_PRIORITY, BGCNT_CHAR_BASE, BGCNT_MOSAIC, BGCNT_256_COLORS, BGCNT_SCREEN_BASE, REG_BG1HOFS, REG_BG1VOFS, REG_BG2HOFS, REG_BG2VOFS, REG_BG3HOFS, REG_BG3VOFS, REG_BG2PA, REG_BG2PB, REG_BG2PC, REG_BG2PD, REG_BG2X, REG_BG2Y, REG_BG3PA, REG_BG3PB, REG_BG3PC, REG_BG3PD, REG_BG3X, REG_BG3Y, REG_WIN0H, REG_WIN1H, REG_WIN0V, REG_WIN1V, REG_WININ, REG_WINOUT, WININ_WIN0_BG0, WININ_WIN0_BG1, WININ_WIN0_BG2, WININ_WIN0_BG3, WININ_WIN0_OBJ, WININ_WIN0_CLR, WININ_WIN0_ALL, WININ_WIN1_BG0, WININ_WIN1_BG1, WININ_WIN1_BG2, WININ_WIN1_BG3, WININ_WIN1_OBJ, WININ_WIN1_CLR, WININ_WIN1_ALL, WINOUT_WIN01_BG0, WINOUT_WIN01_BG1, WINOUT_WIN01_BG2, WINOUT_WIN01_BG3, WINOUT_WIN01_OBJ, WINOUT_WIN01_CLR, WINOUT_WIN01_ALL, WINOUT_WINOBJ_BG0, WINOUT_WINOBJ_BG1, WINOUT_WINOBJ_BG2, WINOUT_WINOBJ_BG3, WINOUT_WINOBJ_OBJ, WINOUT_WINOBJ_CLR, WINOUT_WINOBJ_ALL, REG_MOSAIC, REG_BLDCNT, BLDCNT_TGT1_BG0, BLDCNT_TGT1_BG1, BLDCNT_TGT1_BG2, BLDCNT_TGT1_BG3, BLDCNT_TGT1_OBJ, BLDCNT_TGT1_BD, BLDCNT_TGT1_ALL, BLDCNT_EFFECT_NONE, BLDCNT_EFFECT_BLEND, BLDCNT_EFFECT_LIGHTEN, BLDCNT_EFFECT_DARKEN, BLDCNT_TGT2_BG0, BLDCNT_TGT2_BG1, BLDCNT_TGT2_BG2, BLDCNT_TGT2_BG3, BLDCNT_TGT2_OBJ, BLDCNT_TGT2_BD, BLDCNT_TGT2_ALL, REG_BLDALPHA, REG_BLDY, BG_CANVAS_MAP, REG_BG0HOFS, REG_DMA0, REG_DMA3, PLTT_BACKDROP, BG_PLTT, BG_PLTT_COLOR, OBJ_PLTT, OBJ_PLTT_COLOR, BG_CHAR_BLOCK, BG_SCREEN_BLOCK, TILE_SIZE_4BPP, REG_TM3CNT, REG_TM3CNT_H, TIMER_ENABLE, REG_SIODATA32, REG_SIOCNT, REG_SIOCNT16, REG_SIODATA8, REG_KEYINPUT, REG_KEYCNT, REG_RCNT, SIO_115200_BPS, SIO_START, SIO_32BIT_MODE, SIO_MULTI_MODE, SIO_INTR_ENABLE, RCNT_GPIO_MODE, DMA_DEST_INC, DMA_DEST_DEC, DMA_DEST_FIXED, DMA_DEST_RELOAD, DMA_SRC_INC, DMA_SRC_DEC, DMA_SRC_FIXED, DMA_REPEAT, DMA_16BIT, DMA_32BIT, DMA_DREQ_ON, DMA_START_NOW, DMA_START_VBLANK, DMA_START_HBLANK, DMA_START_SPECIAL, DMA_INTR_ENABLE, DMA_ENABLE, DMA_COPY_WORDS, DMA_COPY_HALFWORDS, DMA_HBLANK_HALFWORD_PER_LINE, DMA_HBLANK_WORD_PER_LINE, CPU_SET_32BIT, OAM, KEYS_MASK, REG_BG0CNT, REG_BG0VOFS, REG_SOUNDCNT_H, SOUND_CGB_MIX_FULL, SOUND_A_MIX_FULL, SOUND_B_MIX_FULL, SOUND_ALL_MIX_FULL, SOUND_A_RIGHT_OUTPUT, SOUND_A_LEFT_OUTPUT, SOUND_A_TIMER_0, SOUND_A_FIFO_RESET, SOUND_B_RIGHT_OUTPUT, SOUND_B_LEFT_OUTPUT, SOUND_B_TIMER_0, SOUND_B_FIFO_RESET, REG_SOUNDBIAS, REG_FIFO_A, REG_FIFO_B, REG_DMA0SAD, REG_DMA0DAD, REG_DMA0CNT, REG_DMA0CNT_H, REG_DMA1SAD, REG_DMA1DAD, REG_DMA1CNT, REG_DMA1CNT_H, REG_DMA2SAD, REG_DMA2DAD, REG_DMA2CNT, REG_DMA2CNT_H, REG_DMA3SAD, REG_DMA3DAD, REG_DMA3CNT, REG_DMA3CNT_H, REG_TM0CNT_L, REG_TM0CNT_H, REG_TM1CNT_L, REG_TM1CNT_H, REG_TM2CNT_L, REG_TM2CNT_H, REG_IE, REG_IF, REG_WAITCNT, REG_IME, KEYCNT_SOFT_RESET, KEYCNT_SHOULDERS_WAKE, KEYCNT_SLEEP_WAKE, WAITCNT_GAME.
io_write_queue.h
games/tbs/include/system/io_write_queue.h
Structures
IoWriteQueue
struct IoWriteQueue
The register writes VBlank carries out once the frame loop has finished a frame; IoWriteQueue_FlushPending empties it.
| Field | Declared as | |
|---|---|---|
count | u16 count | Entries waiting, at most 32. |
pad | u16 pad | |
entries | u32 entries[32][3] | Each entry is the value, the address and the control word, in that order. A control word with a width (IO_WRITE_8 to IO_WRITE_32) is a register write; one without is a DMA, whose three words go to DMA3's source, destination and control registers. |
Used by IoWriteQueue_FlushPending, gIoWriteQueue.
Macros
IO_WRITE_8
#define IO_WRITE_8 (1 << 16)
Writes a byte.
IO_WRITE_16
#define IO_WRITE_16 (2 << 16)
Writes a halfword.
Used by Map_ShowWorldMap, Map_UpdateWorldMapMarkers, Title_ShowIntro.
IO_WRITE_32
#define IO_WRITE_32 (3 << 16)
Writes a word.
IO_WRITE_SET
#define IO_WRITE_SET (4 << 16)
ORs the value into the register instead of storing it.
IO_WRITE_CLEAR
#define IO_WRITE_CLEAR (8 << 16)
Clears the value's bits in the register instead of storing it.
Also, macros without a comment: IO_WRITE_QUEUE_PUSH, IO_WRITE_QUEUE_PUSH_IME.
Globals, without a comment: gIoWriteQueue.
Declarations, without a comment: IoWriteQueue_Store8, IoWriteQueue_Store16, IoWriteQueue_Store32, IoWriteQueue_SetBits8, IoWriteQueue_SetBits16, IoWriteQueue_SetBits32, IoWriteQueue_ClearBits8, IoWriteQueue_ClearBits16, IoWriteQueue_ClearBits32.
iowrite.h
games/tbs/include/system/iowrite.h
Macros
Io_Write16
#define Io_Write16(v, reg)
Writes a value to a 16-bit register or memory location. A statement macro (S2: a layer the whole game uses, 106 sites): the value is built in a word before the address and the store stays where it is written. An inline function with a u32 parameter builds the same value but lets the store move.
Used by AltmillerCave_ApplyFadeBlend, AltmillerCave_RestoreBabiAndInviteParty, BattleFx_StartFadeOverlay, BattleFx_StartWindowHBlankDma, BattlePres_UpdateHBlankScroll, BattlePresentation_WaitForAdvance, BattlePresentation_WaitForPromptAt, DebugText_Clear, DisplayScroll_RunSlideshow, Event_HurryToThePlaza, FieldFx_StartGroundParticles, FieldMotes_Start, Input_HandleKeyInterrupt, LeaveTheShip, LemurianShip_SetupScene, Map_LoadLayeredScene, Map_ShowWorldMap, RaiseTheShip, Runtime_InstallIwramAndIrqs, Scene_RunEntrySetup, SerialRuntime_CollectReceivedPayloads, SerialRuntime_PollAndTransfer, SerialRuntime_PollStatus, SetSail, Ship_UpdateSwell, SolSanctumLunaSolRooms_ShowFloatingEye, System_Initialize, System_SoftReset, TolbiSpring_Initialize, TolbiSpring_RiseAndFadeIn, Ui_LoadWindowGraphics, WaitFrames.
irq.h
games/tbs/include/system/irq.h
Types, without a comment: InterruptHandler.
Macros, without a comment: INTR_FLAG_VBLANK, INTR_FLAG_TIMER3, INTR_FLAG_SERIAL, INTR_FLAG_KEYPAD, INTR_FLAG_GAMEPAK.
Globals
gIrqHandlers
extern InterruptHandler gIrqHandlers[IRQ_COUNT]
The handler the IWRAM dispatcher calls for each interrupt source.
Used by Runtime_InstallIwramAndIrqs, Runtime_SetIrqHandler, SaveState_InitializeWorkspace.
gRuntime_IrqHandlers
extern const u32 gRuntime_IrqHandlers[IRQ_COUNT]
The handlers installed at power-on, copied into gIrqHandlers.
Used by Runtime_InstallIwramAndIrqs.
Also, globals without a comment: IwramIrqMain, IwramIrqModeWord, IwramRuntime_Rom, gIrqVector.
irqlock.h
games/tbs/include/system/irqlock.h
Macros
IME_SAVE
#define IME_SAVE(ime, saved)
Saves the original IME value in saved.
Used by SerialRuntime_Initialize, SerialRuntime_ResetTransferState.
IME_DISABLE
#define IME_DISABLE(ime)
Disables interrupts.
Used by SerialRuntime_Initialize, SerialRuntime_ResetTransferState.
IRQ_LOCK
#define IRQ_LOCK(saved)
Disables interrupts and saves IME in saved; IRQ_UNLOCK restores it.
Used by BattlePresentation_AppendLinkedActions, LinkLobby_InitializeSerial, Runtime_SetIrqHandler, SerialRuntime_BeginReceive, SerialRuntime_BeginSend.
Also, macros without a comment: IME_RESTORE, IRQ_UNLOCK.
mem.h
games/tbs/include/system/mem.h
Functions, without a comment: Runtime_CallAlternatePool.
Globals, without a comment: gEwramHeap, gIwramHeap.
Declarations, without a comment: Runtime_ReleaseHeapBlock, Runtime_BumpFree, MemFree, Runtime_FillFreeHeapWords.
metadata_lookup.h
games/tbs/include/system/metadata_lookup.h
Structures
AnimationMetadata
struct AnimationMetadata
An animation's metadata: the sprite's size, scale and offsets, how its frames are drawn and decoded, its frames and its animation scripts.
| Field | Declared as | |
|---|---|---|
width | u8 width | pixels |
height | u8 height | pixels |
scale | u16 scale | 8.8 fixed point, 0x100 full size |
drawKind | u8 drawKind | |
animationCount | u8 animationCount | |
adjustX | s8 adjustX | pixels |
adjustY | s8 adjustY | pixels |
boxX | u8 boxX | |
boxY | u8 boxY | |
frameCodec | u8 frameCodec | |
frames | void **frames | |
animation | u8 **animation |
Used by AnimationObject_Allocate, AnimationObjects_SelectAnimation, Animation_InitWorkFromMetadata, Animation_InitializeObjects, Animation_SetWorkEntry, FieldFx_UpdateMindReadWave, ResourceMetadata_Register, ResourceMetadata_SumCommandLengths, ResourceObject_Create, ResourceSlot_Load, Resource_GetMetadataRecord, Ui_FillGridColumnFromMetadata, Ui_RunIconMonitor, gCharacter_DescriptorTable.
Declarations, without a comment: Resource_GetMetadataRecordFarFar.
mulq16.h
games/tbs/include/system/mulq16.h
Functions, without a comment: MulQ16.
object_effect.h
games/tbs/include/system/object_effect.h
Structures
FadeOverlayWork
struct FadeOverlayWork
The fade overlay draws one mark on each side of its tracked actor.
| Field | Declared as | |
|---|---|---|
marks | struct AnimationSpritePart marks[2] | The left and right marks: 16-pixel-wide semi-transparent sprites drawn where the ground beside the actor rises above its floor. |
actor | struct FieldActor *actor | the actor tracked; null draws nothing |
Used by BattleFx_StartFadeOverlay, Event_StartRising, Event_StopRising, FadeOverlay_DrawMarks, Fuchin_FollowLeaderWithLight, Fuchin_StopLightFollowingLeader, ImilFuchinFalls_PrepareRoom, Kalay_PrepareTunnel, Kalay_StartTrackingLeader, MercuryLighthouse_UpdateLeaderEffectTarget, TunnelRuins_UpdateTrackedActor, gActorEffectWork.
GroundParticle
struct GroundParticle
One weather particle: OAM attributes followed by its world position.
| Field | Declared as | |
|---|---|---|
unk00 | u8 unk00[4] | Cleared with the attributes; never read by the effects. |
y | u16 y : 8 | The OAM entry's attributes 0 to 2: the start routines write them whole as semi-transparent, size 1, priority 1 and palette 13. @{ Screen pixels. |
affine | u16 affine : 2 | Not named by the effects. |
blendMode | u16 blendMode : 2 | 1, semi-transparent; not named by the effects. |
mosaic | u16 mosaic : 1 | Not named by the effects. |
fullColor | u16 fullColor : 1 | Not named by the effects. |
shape | u16 shape : 2 | From the ground particle frame; motes, sparkles: 0. |
x | u16 x : 9 | Screen pixels. |
affineIndex | u16 affineIndex : 5 | Sparkles: 8 on alternate frames, else 0. |
size | u16 size : 2 | From the ground particle frame; motes, sparkles: 1. |
tile | u16 tile : 10 | The work's tileBase plus the frame's tile. |
priority | u16 priority : 2 | 1. |
palette | u16 palette : 4 | 13; not named by the effects. |
attr3 | u8 attr3[2] | @} OAM attribute 3, cleared with the others. |
posX | s32 posX | World position, in 16.16 pixels. |
posY | s32 posY | The ground's height there. |
posZ | s32 posZ | World position, in 16.16 pixels. |
delay | s32 delay | Motes: height risen; sparkles: phase within a burst. |
timer | u16 timer | Frames left; zero frees the particle. |
Used by FieldEffect_InitSparkles, FieldEffect_UpdateSparkles, FieldFx_StartGroundParticles, FieldFx_UpdateGroundParticles, FieldMotes_Start, FieldMotes_Update.
GroundParticleWork
struct GroundParticleWork
Work slot 29 while ground particles, motes or sparkles run.
| Field | Declared as | |
|---|---|---|
entry | s32 entry | Resource entry holding the effect's tiles. |
tileBase | s32 tileBase | Their first tile in VRAM. |
particles | struct GroundParticle particles[FIELD_WEATHER_PARTICLE_COUNT] | |
unk408 | s32 unk408 | Unused by the weather effects. |
stopped | s32 stopped | Prevent new sparkle bursts while set. |
Used by FieldEffect_InitSparkles, FieldEffect_UpdateSparkles, FieldFx_StartGroundParticles, FieldFx_UpdateGroundParticles, FieldMotes_Start, FieldMotes_Update, SolSanctumEruption_PlayHostageScene, SolSanctumEruption_PlayWiseOneRescue, SolSanctumEruption_StepEmbers, gParticleWork.
Macros, without a comment: FIELD_WEATHER_PARTICLE_COUNT.
Globals, without a comment: gActorEffectWork, gParticleWork.
object_lookup.h
games/tbs/include/system/object_lookup.h
ramcode.h
games/tbs/include/system/ramcode.h
Macros
RamCode_Load
#define RamCode_Load(to, code, bytes)
Allocates a heap copy; release it with MemFree when finished.
Used by Object_RunUpdateAllFromHeap, Render_BuildOamList, Resource_LoadCode, Tilemap_ConvertBuffer, UiText_DrawGlyph, UiText_LookupMessage, UiWindow_FillFromScene.
RamCode_LoadSlot
#define RamCode_LoadSlot(slot, code, bytes)
Allocates a work-slot copy; release it with Runtime_ReleaseHeapBlock.
Used by BattleBackground_Load, Graphics_LoadCharacterBlockAndPalette, ObjectSystem_Configure, ObjectSystem_UpdateCamera, ObjectSystem_UpdateCameraFixed, TileMap_DrawRowsFromRam, UiIcon_Decode, UiText_DecodeMessage.
Also, macros without a comment: GUARD_RAMCODE_H.
runtime_interfaces.h
games/tbs/include/system/runtime_interfaces.h
savedata.h
games/tbs/include/system/savedata.h
Macros, without a comment: GUARD_SAVEDATA_H.
Globals, without a comment: gSave_Signature, gSave_HeaderTemplate, gLink_TestWord, gLink_TestDataA, gLink_TestDataB.
scene.h
games/tbs/include/system/scene.h
Structures, without a comment: Ent, Cam.
Macros, without a comment: FIELD_AT_OFFSET.
serial_runtime.h
games/tbs/include/system/serial_runtime.h
Functions, without a comment: SerialRuntime_AddParentFlag, SerialRuntime_ResetTransferState.
Structures
SerialPacket
struct SerialPacket
A link cable packet: its sequence number, the consoles not yet heard from, its checksum and a 24-byte payload.
| Field | Declared as | |
|---|---|---|
sequence | u8 sequence | SerialRuntime's sequence when the packet was built |
missingMask | u8 missingMask | The consoles heard from before but not this frame (receivedMask ^ currentMask); a receiver complements it once the checksum is good. |
checksum | u16 checksum | The complement of the sum of the packet's first 14 halfwords, taken with this field 0. |
payload | u8 payload[24] | |
reservedTail | u8 reservedTail[4] | past the 14 halfwords sent; never written |
Used by SerialRuntime_PrepareSendPacket.
SerialRuntime
struct SerialRuntime
The link cable's runtime: its mode and phase, the consoles heard from, the send position and the packet buffers the interrupt handler fills.
| Field | Declared as | |
|---|---|---|
mode | u8 mode | SIOCNT's bits 7 and 3 when this console armed timer 3 to clock the transfers: 8 then, else 0; 8 adds 0x80 to the link status. |
phase | u8 phase | 0 looking for the partner, 1 connected |
receivedMask | u8 receivedMask | the consoles heard from since the link began |
currentMask | u8 currentMask | the consoles heard from this frame |
channelFlags | u8 channelFlags[4] | Set by the interrupt for each console and cleared each frame. bits: 1 heard while isParent was set | 0 a packet completed |
transferEnabled | u8 transferEnabled | Nonzero lets a new packet restart timer 3. |
isParent | u8 isParent | SIOCNT's bit 6, copied by each transfer interrupt; nonzero adds 0x1000 to the link status. |
reserved0a | u8 reserved0a | not named by TBS code |
sequence | u8 sequence | The packet sequence number, counted up each frame once connected. |
reserved0c | u8 reserved0c[8] | not named by TBS code |
sendIndex | s32 sendIndex | The halfword of sendBuffer[1] sent next; -1 between packets, when 0xfefe is sent and the two send buffers swap. |
receiveIndex | s32 receiveIndex[2] | Each console's next halfword in its incomingBuffer; -1 after an idle 0xfefe. |
reserved20 | u8 reserved20[8] | not named by TBS code |
sendBuffer | u16 *sendBuffer[2] | The packet being built ([0]) and the packet being sent ([1]). |
incomingBuffer | u16 *incomingBuffer[4] | Each console's packet being received; two are used. |
readyBuffer | u16 *readyBuffer[4] | Each console's last complete packet, swapped in by the interrupt. |
pendingBuffer | u16 *pendingBuffer[4] | The packets the frame code checks and copies, swapped with readyBuffer each frame. |
storage | u8 storage[0x100] | The buffers' memory: two 32-byte send buffers, then 96 bytes a console for its incoming, ready and pending packets. |
Used by SerialRuntime_DisableTransfer, SerialRuntime_EnableTransferTimer, SerialRuntime_HandleTransferInterrupt, SerialRuntime_Initialize, SerialRuntime_PrepareSendPacket, gSerialRuntime.
SerialTransferState
struct SerialTransferState
A console's block transfer state, exchanged with the partner each VBlank: its block sequence, its status and flags, and a 20-byte block.
| Field | Declared as | |
|---|---|---|
active | u8 active | The sequence number of the block in payload; as receiver, the one it expects with bit 7 set to ask for a resend; 1 when a transfer starts. |
status | u8 status | 0x80 sending or 0x81 receiving when started; the receiver counts blocks (status + 1, with bit 7) and sets 0 after the last. |
flags | u8 flags | The receive state: 1 receiving, 2 the last block taken, 0 idle. |
peerFlags | u8 peerFlags | The send state: 1 a block with more to follow, 2 the last block, 0 idle. |
payload | u8 payload[20] | one block of the data sent |
Used by SerialRuntime_BeginReceive, SerialRuntime_BeginSend, SerialRuntime_ResetTransferState, SerialRuntime_StepBlockTransfer, gSerialTransfer.
Unions
SerialDataRegisters
union SerialDataRegisters
The serial data registers read as two words or four halfwords; no TBS code names this union.
| Field | Declared as | |
|---|---|---|
words | u32 words[2] | |
halfwords | u16 halfwords[4] |
Macros, without a comment: SERIAL_RUNTIME.
Globals
gSerialSendSize
extern volatile u16 gSerialSendSize
volatile: tagged where it steers, in SerialRuntime_StepBlockTransfer (tbs runtime.c)
Used by SerialRuntime_BeginSend, SerialRuntime_Initialize, SerialRuntime_ResetTransferState, SerialRuntime_StepBlockTransfer.
gSerialReceivedSize
extern volatile u16 gSerialReceivedSize
volatile: tagged where it steers, in BattleLink_ReceiveActions (tbs battle.c) and LinkLobby_ReceivePartyRecords (tbs lobby.c)
Used by BattlePresentation_AppendLinkedActions, SerialRuntime_BeginReceive, SerialRuntime_Initialize, SerialRuntime_ResetTransferState, SerialRuntime_StepBlockTransfer.
gSerialBlockSequence
extern volatile u8 gSerialBlockSequence
volatile: tagged where it steers, in SerialRuntime_StepBlockTransfer (tbs runtime.c)
Used by SerialRuntime_BeginReceive, SerialRuntime_BeginSend, SerialRuntime_StepBlockTransfer.
Also, globals without a comment: gSerialTransfer, gSerialRuntime, gSerialExchangeActive, gSerialSendSource, gSerialReceiveDest, gSerialPeerPayloads, gLinkExchangeState, gLinkStatus.
system.h
games/tbs/include/system/system.h
Structures, without a comment: S.
Globals, without a comment: gRandomState, gSleepActive, gFlash_ChipAtmel, gFlash_ChipUnknown, gFlash_Handler1, gEraseFlashSector, gFlash_Handler4, gFlash, gFlashSavedIme, gFlashTimeoutFlag, gFlashTimerNum, gNumberTextDecimalEnd, gNumberTextHexEnd, gLink_TimeLabelString, Resource_DirectoryTable, Resource_PatchThumbBranchCodeSize, gResourceSlot_ConversionTables, gUi_WindowPalette, IwramSoundPresetCode, gFlash_Handler0, gAnimationObjects, gDebugTextCursor, gDebugTextEnabled, gFlashNumRemainingBytes, gSaveBuffer, gSaveSlot, IwramCodeRecords, LoadedRuntime_Size, gMath_ArcTanTable, gObject_ShadowTiles, Render_BuildOamListKernel, Resource_ExecuteTransfer, Resource_PatchThumbBranch, gRom_LanguageCode, gRom_UnknownBytes, BattleFx_Max4Reverse, BattleFx_Max4Forward, BattleFx_MaxReverse, BattleFx_MaxForward, BattleFx_ColorReverse, BattleFx_ColorForward, BattleFx_AdditiveReverse, BattleFx_AdditiveForward, BattleFx_Mask, BattleFx_Transparent8Reverse, BattleFx_Transparent8Forward, BattleFx_TransparentReverse, BattleFx_TransparentForward, BattleFx_CopyReverse, BattleFx_CopyForward, gSystem_BasicColorPalette, Tile_CopyStrided, Tile_CopyStridedCodeSize, TransferCommandExecutor_Size.
Declarations, without a comment: System_WaitForFrameInterrupt, Bios_SoundBiasOff, Bios_SoundBiasOn, _call_via_r2, IwramHalt, SoundDriver_EnterMixer.
vector3.h
games/tbs/include/system/vector3.h
Functions, without a comment: Vector3_Coordinates.
Structures
Vector3
struct Vector3
Three coordinates, x, y and z: a position, a velocity or a direction.
| Field | Declared as | |
|---|---|---|
x, y, z, coordinates | union { struct { s32 x; s32 y; s32 z; }; s32 coordinates[3]; ///< x, y and z, as Vector3_Coordinates returns them } | |
x | s32 x | |
y | s32 y | |
z | s32 z |
Used by BattleFx_DrawStreaks, BattleFx_RunAstralBlast, BattleFx_RunBind, BattleFx_RunProcne, BattleFx_RunTriangleStrike, CrossboneIsle_SpawnBlockMovedBurst, Event_DriftEast, Event_DriftNorth, Event_DriftSouth, Event_DriftWest, GomaCaveEntrance_LeapStump, GomaCaveWaterway_LeapStump, GondowanCave_RunSpinningLeap, MogallForest_KillerApeAttacks, MogallForest_SpawnPuffRing, SceneEffect_SpawnNineRadialEffects, TolbiSpring_UpdateTossSimulation, Vector3_Coordinates, VenusLighthouse_StepActorWithDust, gBind_TriangleStrikeVertex, gBind_Vertex, gStars_Points.