Skip to Content
The Alchemy Project

include/system/globals.h

The system library's variables, as SGL keeps its system variables and work areas: each group's variables in IWRAM, EWRAM and ROM. More…

Included by actor_update_arm.c, world_map_lines.c, battle_camera.h, field.h, field_state.h, menu.h, shop.h, mul_fx.h, system.h, menu_list.h and window.h.

Functions

NameDescription
extern void (*UserFunction )(void)A function for the next VBlank alone: the handler clears it, then calls it.

Variables

NameDescription
extern volatile Uint8EventsRunningThe event group.
extern Uint8EventsInitialized1 once the event table is set up
extern EVENTEventBuf []The event table, run in priority order by each pass.
extern BG_SCROLLBgScrollWork []BG0 to BG3's scroll offsets, which the VBlank handler copies to REG_BG0HOFS to REG_BG3VOFS in the VBlank after sySynch() sets TickRenderPending.
extern INTERRUPT_HANDLERIrqHandlers [IRQ_COUNT]The irq group.
extern const Uint32DefaultIrqHandlers [IRQ_COUNT]The handlers installed at power-on, copied into IrqHandlers.
extern Uint8syIWRAMIRQMain []The interrupt dispatcher at the start of the IWRAM-resident code, whose other functions are reached at fixed offsets from it (the iwram_call group in system/definitions.h).
extern const Uint32IwramIrqModeWordAn instruction inside the dispatcher (orr r3, r3, #0x92), whose value btDMAStopDMA3 runs as a function.
extern const Uint8IwramResidentRom []Where the IWRAM-resident code lies in ROM (ld_script.ld), 5,120 bytes copied to syIWRAMIRQMain at power-on.
extern void *IrqVectorThe BIOS's interrupt vector, pointed at syIWRAMIRQMain at power-on.
extern void *HeapSlots [64]The heap group.
extern Uint32MapGridMetatileBuffer []The heap_slots group.
extern Uint8DecodeBuffer []16 KB of EWRAM at 0x0201c000.
extern Uint8ActorSpriteSlots []16 KB of EWRAM at 0x02018000, where the battle's actor sprite buffers start, 16 KB a slot; the map's metatiles fill it while a map is loaded.
extern Uint8EwramHeap []The heap_release group.
extern Uint8IwramHeap []The IWRAM heap's space, from 0x03002000 up to RamIWRAMHeapEnd.
extern Uint8OamMatrixCountThe affine group.
extern OAM_MATRIXOamMatrices []This tick's 32 matrices, copied into OAM with the sprites.
extern void *OamDepthLists []The 256 depth slots' list heads that every drawn sprite is linked into (syOAMAddSpriteAtDepth); syOAMResetTick empties them each tick.
extern const Uint8syDecompressByteLZArm []The decompress group.
extern Uint8syDecompressByteLZCodeSize []syDecompressByteLZArm: how much syDecompressByteLZ allocates for it.
extern const Uint8syDecompressTaggedLZArm []The tagged LZ decoder (a first byte of 0 for the general form, 1 for the palette form), run by syDecompressTaggedLZ from a heap copy.
extern Uint8syDecompressTaggedLZCodeSize []syDecompressTaggedLZArm, which syDecompressTaggedLZ copies to the heap.
extern const Uint8syDecompressMoveToFrontLZCommands []The move-to-front LZ decoder's ARM entry: it returns 4 unless the stream's first byte is 2, the move-to-front tag.
extern Uint8DecompressMoveToFrontLzCommandsCodeSize []syDecompressMoveToFrontLZCommands through its command loop, which syDecompressMoveToFrontLZ copies to the heap.
extern const Uint8syDecompressHalfwordLZ []The halfword LZ decoder that syDecompressHalfwords runs from its stack.
extern Uint8syDecompressHalfwordsCodeSize []syDecompressHalfwordLZ, copied onto the stack by syDecompressHalfwords.
extern Uint8DecodeFillByteThe colour index fdRenderDecodePicture paints every pixel of a layer drawn with SPRITE_COLOR_FILL; the sprite viewer sets it to 3.
extern Uint8syColorBufferBrightenCodeSize []The canvas fades' ARM functions and their sizes: each syColorBuffer... function in system/system_decompress.c copies its ARM code onto its own stack and runs it there.
extern Uint8syColorBufferBrightenPartialCodeSize []syColorBufferBrightenPartialArm, for syColorBufferBrightenPartial.
extern Uint8syColorBufferDarkenCodeSize []syColorBufferDarkenArm, for syColorBufferDarken.
extern Uint8syColorBufferDarkenPartialCodeSize []syColorBufferDarkenPartialArm, for syColorBufferDarkenPartial.
extern Uint8syColorBufferHalveCodeSize []syColorBufferHalveArm, for syColorBufferHalve.
extern Uint8syColorBufferHalveNonzeroCodeSize []syColorBufferHalveNonzeroArm, for syColorBufferHalveNonzero.
extern Uint8syColorBufferScaleNonzeroThreeQuartersCodeSize []syColorBufferScaleNonzeroThreeQuartersArm, for syColorBufferScaleNonzeroThreeQuarters.
extern Uint8syColorBufferScaleThreeQuartersCodeSize []syColorBufferScaleThreeQuartersArm, for syColorBufferScaleThreeQuarters.
extern const Uint8syColorBufferBrightenArm []Raises each pixel step by an amount, capped at 63, after backing the buffer up.
extern const Uint8syColorBufferBrightenPartialArm []Brightens as syColorBufferBrightenArm, writing back only groups of four pixels not all at 63 already.
extern const Uint8syColorBufferDarkenArm []Lowers each pixel step by an amount, stopping at 0, after backing the buffer up.
extern const Uint8syColorBufferDarkenPartialArm []Darkens as syColorBufferDarkenArm, writing back only groups of four pixels not all 0 already.
extern const Uint8syColorBufferHalveArm []Halves each pixel step; the battle effect canvas's transfers use it.
extern const Uint8syColorBufferHalveNonzeroArm []Halves each pixel step, skipping all-zero groups; Lucky Wheels' canvas uses it.
extern const Uint8syColorBufferScaleNonzeroThreeQuartersArm []Scales each pixel step to three quarters, skipping all-zero groups.
extern const Uint8syColorBufferScaleThreeQuartersArm []Scales each pixel step to three quarters.
extern const SYSTEM_STUB_TABLEStubsSystemThe stub group.
extern const Uint8StubsResource []The resource module's stub, listed in the resource directory as both ResourceStubs and ResourceStubsAlternate.
extern Uint8TickRenderPendingThe tick group.
extern volatile Uint8CpuLoadDisplayEnabledDebug: sySynch() measures the CPU load into CpuLoadPeak when set.
extern Uint8OamCopyEnabledThe VBlank handler copies the OAM list only while it is set; scenes clear it to keep their own sprites on screen.
extern Uint16TickFramesFrames since sySynch() last started a tick: 1 when the tick took one.
extern volatile Uint16LastTickFramesTickFrames as the last tick left it; the text typing paces itself by it.
extern volatile Uint16VBlankDoneBit 0 is set by the VBlank handler; sySynch() clears it and halts until it is set again. volatile: the VBlank handler sets it while sySynch() halts on it.
extern Uint32CpuLoadTimerTicks CpuLoadPeak is still held.
extern Uint32CpuLoadPeakThe highest CPU load in the last 30 ticks: the scanline the tick's work ended on, plus 256 for each VBlank it overran.
extern volatile Uint32TickCountTicks sySynch() has finished. volatile: the VBlank pass reads it (fdWorldMapApplyAffinePage picks the world map's affine page by it) while sySynch() counts it.
extern Uint32FrameCountCounted up by every VBlank.
extern volatile Uint8SleepDisabledNonzero: sySynch() counts no idle time and ignores sleep requests.
extern volatile Uint8IdleSleepEnabledSleep after three idle minutes.
extern volatile Uint8SleepRequested1: sleep this tick; more: count down to it. volatile: sySynch() counts it down and reads it each tick.
extern volatile Uint8DebugModeDebug builds: Start+Select pauses the tick loop. volatile: fdActorUpdatePlayerControl and fdEngineRun each read it again after an earlier test.
extern Uint8DebugPausedThe debug pause is on.
extern Uint8ResetRequestedSet by the keypad interrupt; sySynch() performs the soft reset.
extern volatile Uint16IdleTicksTicks since a key was last held. volatile: sySynch() counts it and reads it each tick.
extern volatile Uint16SleepComboTicksTicks L and R have been held together; three seconds request sleep. volatile: sySynch() counts it and reads it each tick.
extern Uint32CartridgeResetMarkerWritten by the soft reset just before it restarts the cartridge, and cleared by syInit; nothing else reads it.
extern Sint32BuildStampWork []The build stamp syCopyBuildStamp copies to IWRAM at power-on: twelve digits and a zero word, at the bottom of the tick-wait stack.
extern Uint32PlayTimeTicksThe play time clock, in ticks.
extern Uint32SavedStackSizeBytes of the caller's stack sySynch() has copied into SavedStack, or 0.
extern Uint8SavedStack []The caller's stack below the tick-wait stack top, while sySynch() runs.
extern volatile Uint32PerDataThe input group.
extern volatile Uint32PerPushKeys that went down this tick.
extern volatile Uint32PerRepeatPressed keys, repeating while held: after 19 ticks, then every 6.
extern volatile Uint32PerRepeatDirectedPerRepeat with at most one D-pad direction.
extern volatile Uint32PerDirectionThe D-pad direction the repeat last settled on: when a second direction is added, PerRepeatDirected drops this one and keeps the new one.
extern Uint32PerPushLatchKept by the tick loop and the key repeat.
extern Uint32PerDataLastPerData when the tick loop last read it.
extern Uint32PerDataAtVBlankPerData at the previous VBlank.
extern Sint32PerRepeatTimerTicks until the held keys repeat; -1 makes them repeat at once.
extern Uint8ScreenFadeToWhiteThe screen_fade group.
extern volatile Uint8ScreenFadeFramesThe running fade's length in frames, 0 when no fade is running. volatile: the VBlank handler's syScreenFadeUpdate clears it when the fade ends, while syScreenFadeWait waits on it.
extern volatile Uint8ScreenFadeFramesLeftFrames until the running fade reaches its target. volatile: the VBlank handler's syScreenFadeUpdate counts it down.
extern Uint16ScreenFadeLayersThe BLDCNT first-target layers the screen fade covers (the low six bits).
extern Uint8ScreenFadeStartLevelThe brightness the running fade started from, 0 to 16.
extern volatile Uint8ScreenFadeTargetLevelThe brightness the running fade ends at, 0 to 16. volatile: syScreenFadeStart sets it for the VBlank handler's syScreenFadeUpdate.
extern IO_WRITE_QUEUEIoWriteQueueWorkThe io_write_queue group.
extern Uint8syIWRAMMulFXReturnIp []The iwram_call group.
extern Uint8syIWRAMWordsClear []The IWRAM function that clears a run of words, which the OAM build calls by its address.
extern const Uint16MathSinQuarter [256]The math_table group.
extern const Uint16MathTwoPiSteps [8]Unused: floor(i * 2π) for i from 0 to 7; nothing reads it.
extern const Sint32MathQuadrantSin [4]Unused: the sine at 0, 90, 180 and 270 degrees, in 16.16; nothing reads it.
extern const Uint16MathTanTable [258]Tangents scaled by 256: index i is about tan(i * 45 / 128 degrees), so index 128 is tan(45 degrees); the last entries before 90 degrees run high.
extern MATRIXCurrentMatrixThe matrix group.
extern Sint32MatrixStackDepthMatrices saved by syPushMatrix, 0 or 1: the save area holds one.
extern Uint8 *MatrixStackTopWhere syPushMatrix saves CurrentMatrix next: the save area in heap slot HEAP_SLOT_MATRIX_STACK, or just past it while a matrix is saved.
extern const Uint32RelocatedInnerProduct []syMatrixBuildLookAt's ARM dot product, seven words it copies onto its stack to run.
extern const Uint8StringHexDigits []The number_text group.
extern const Sint32StringPowersOfTen [9]Place values for decimal display, 10^9 down to 10, which syStringFormatDecimal divides by; the ones digit is what remains.
extern Uint8NumberBuffer []The number text buffer: syStringFormatHex writes eight digits and syStringFormatDecimal eleven characters, right-aligned, each with a terminator.
extern PROJECTIONProjectionWorkThe projection group.
extern Sint16TitleSendOptionEnabledThe save group.
extern const Uint8BupSignature []The bupdata group.
extern const Uint8BupHeaderTemplate [8]The sector header's first eight bytes: the signature, then a part id byte each writer replaces.
extern const Uint32LinkTestWordUnused: a word and two strings for a link test, which nothing reads.
extern const Uint8LinkTestDataA []
extern const Uint8LinkTestDataB []
extern SERIAL_TRANSFER_STATESerialTransferThe serial group.
extern SERIAL_STATESerialStateWork
extern Uint16SerialExchangeActiveSet from sySerialInit while the consoles exchange packets every tick.
extern Sint32SerialSendSourceWhat the send in progress sends from, 0 when none is running.
extern volatile Uint16SerialSendSizeThe bytes the send in progress has left to send. volatile: sySerialStartSend sets it while sySerialStepBlockTransfer, which the VBlank handler runs, counts it down.
extern Sint32SerialReceiveDestinationWhere the receive in progress writes, 0 when none is running.
extern volatile Uint16SerialReceivedSizeThe bytes the receive in progress has taken so far. volatile: sySerialStepBlockTransfer, which the VBlank handler runs, counts it up while the link code outside the interrupt polls it.
extern SERIAL_TRANSFER_STATESerialPeerPayloads [4]
extern volatile Uint8SerialBlockNumberThe number of the block being sent or received, from 0 at each transfer. volatile: sySerialStartSend and sySerialStartReceive reset it while sySerialStepBlockTransfer, which the VBlank handler runs, steps it.
extern Uint8LinkExchangeStateCleared as the link starts and as the Battle Arena trades parties; nothing reads it.
extern volatile Uint16LinkStatusWorkLink status, updated by the VBlank exchange handler. volatile: the VBlank handler writes it while sySerialWaitForStatusMask and the link screens poll it.
extern Uint8VramCacheBlockOwners [VRAM_BLOCK_COUNT]The vram_cache group.
extern VRAM_CACHE_ENTRYVramCacheEntries []The cache entries by number: the slot a sprite or loaded picture holds.
extern Uint32ScanlineAngleThe world map camera's yaw, in 1/65536 turns, the scanline parameters were built for; fdWorldMapUpdateAffineLines rebuilds them when it changes.
extern Uint32ScanlinePitchThe world map camera's pitch the scanline parameters were built for.

Description

The system library's variables, as SGL keeps its system variables and work areas: each group's variables in IWRAM, EWRAM and ROM. system.h includes it; a file built by another compiler can include it with system/definitions.h.

Functions in detail

UserFunction

extern void (*UserFunction)(void)

A function for the next VBlank alone: the handler clears it, then calls it.

Referenced by fdWorldMapLoadAreaGraphics(), fdWorldMapLoadDefaultMetatilesAndUpdateBlock(), fdWorldMapStartStillImage() and syVBlankHandler().

Definition at line 189 of file globals.h.

Variables in detail

EventsRunning

extern volatile Uint8 EventsRunning

The event group. Events, their priorities and the event runner's state. 1 while sySynch() runs the tick pass's events (EVENT_PASS_TICK).

Referenced by btObjectSpawnObjectsForList(), syInitEvent(), sySetEvent() and sySynch().

Definition at line 16 of file globals.h.

EventsInitialized

extern Uint8 EventsInitialized

1 once the event table is set up

Referenced by syExecuteEvent() and syInitEvent().

Definition at line 17 of file globals.h.

EventBuf

extern EVENT EventBuf[]

The event table, run in priority order by each pass.

Referenced by syCloseEvent(), syExecuteEvent(), syFindEvent(), syInitEvent(), syResumeEvent(), syResumeOverlayEvents(), sySetEvent(), sySetEventFlags(), sySortEvents(), sySuspendEvent() and sySuspendOverlayEvents().

Definition at line 20 of file globals.h.

BgScrollWork

extern BG_SCROLL BgScrollWork[]

BG0 to BG3's scroll offsets, which the VBlank handler copies to REG_BG0HOFS to REG_BG3VOFS in the VBlank after sySynch() sets TickRenderPending.

Referenced by btCameraSetRange(), btCameraShake(), btEffectAdvanceScrollOnInterval(), btEffectEndCanvasLayer(), btEffectOpenCanvasLayer(), btEffectRunAtalanta(), btEffectRunAttackSlash(), btEffectRunBoreas(), btEffectRunCriticalHit(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectSetupBlendedDisplay(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btTransitionAdvanceOpening(), btTransitionRun(), fdLineScrollBuildPage(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMapGridUpdateLayerScroll(), fdWorldMapInitPerspective(), mnBattleCommandRowRun(), mnCreditsScrollBackgrounds(), mnTitleLoadIntroBackgrounds(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), mnTitleUpdateIntroSprites(), scCrossboneIsleSteppingStonesJitterBackgroundScroll(), scCrossboneIsleSteppingStonesPrepareWaterScroll(), scFileScreenLoadBackground(), scKolimaForestFloodgateCaptureNewLevelScroll(), scKolimaForestFloodgateChangeRiverLines(), scTitleLoadBackground() and syVBlankHandler().

Definition at line 24 of file globals.h.

IrqHandlers

extern INTERRUPT_HANDLER IrqHandlers[IRQ_COUNT]

The irq group. The hardware's interrupt sources and the interrupt handler table. The handler the IWRAM dispatcher calls for each interrupt source.

Referenced by syBupInitState(), syInstallIWRAMAndIRQs() and syIntFunction().

Definition at line 28 of file globals.h.

DefaultIrqHandlers

extern const Uint32 DefaultIrqHandlers[IRQ_COUNT]

The handlers installed at power-on, copied into IrqHandlers.

Referenced by syInstallIWRAMAndIRQs().

Definition at line 31 of file globals.h.

syIWRAMIRQMain

extern Uint8 syIWRAMIRQMain[]

The interrupt dispatcher at the start of the IWRAM-resident code, whose other functions are reached at fixed offsets from it (the iwram_call group in system/definitions.h).

Referenced by syInstallIWRAMAndIRQs().

Definition at line 36 of file globals.h.

IwramIrqModeWord

extern const Uint32 IwramIrqModeWord

An instruction inside the dispatcher (orr r3, r3, #0x92), whose value btDMAStopDMA3 runs as a function.

Referenced by btDMAStopDMA3().

Definition at line 39 of file globals.h.

IwramResidentRom

extern const Uint8 IwramResidentRom[]

Where the IWRAM-resident code lies in ROM (ld_script.ld), 5,120 bytes copied to syIWRAMIRQMain at power-on.

Referenced by syInstallIWRAMAndIRQs().

Definition at line 42 of file globals.h.

IrqVector

extern void *IrqVector

The BIOS's interrupt vector, pointed at syIWRAMIRQMain at power-on.

Referenced by syInstallIWRAMAndIRQs().

Definition at line 44 of file globals.h.

HeapSlots

extern void *HeapSlots[64]

The heap group. The heap's slots and HEAP_STATE. The heap's 64 words in IWRAM, seen as HEAP_STATE.

Referenced by btCameraSetCommandView(), btCameraUpdate(), btEffectRunAtalanta(), btEffectRunBladeRain(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunImpactBurst(), btEffectRunJudgment(), btEffectRunNeptune(), btEffectRunProcne(), btEffectRunTitanBlade(), btEffectRunUndeadSword(), btEffectSetupBlendedDisplay(), btElementGlowInitStarField(), btElementGlowPlay(), btElementGlowUpdateStarField(), btElementGlowUploadStarField(), btTransitionAdvanceOpening(), fdLuckyWheelsRun(), fdSpriteComposePicture(), fdTileMapDrawRowsFromRam(), fdWorldMapInitPerspective(), fdWorldMapUpdateView(), mnCreditsLoadBackground(), mnIconDecode(), mnIconDecompress(), mnMessageDecodeRaw(), scFuchinFallsCaveEndRevealLighting(), scFuchinFallsCaveGroundMaskFollowsLeader(), scFuchinFallsCaveGroundMaskStopsFollowing(), syHeapAllocate(), syHeapAllocateEWRAM(), syHeapGetRemainingEWRAM(), syHeapGetRemainingIWRAM(), syHeapInit(), syHeapSlotAllocate(), syHeapSlotAllocateEWRAM() and syVBlankHandler().

Definition at line 48 of file globals.h.

MapGridMetatileBuffer

extern Uint32 MapGridMetatileBuffer[]

The heap_slots group. The heap slots of HeapSlots, read through their own names.

EWRAM buffers The map's metatiles at 0x02010000, 128 by 128 words (MAP_GRID_METATILE): 64 KB, so while a map is loaded they run on through ActorSpriteSlots and DecodeBuffer.

Referenced by fdLZPackPackData(), fdMapGridGetMetatileBehaviorAt(), fdMapGridGetMetatileHighFlags(), fdMapGridGetTerrainKindAt(), fdMapScreenInit(), fdMapScreenRelease(), fdMapScreenShow(), fdPsynergyCheckCloakTile(), fdTileMapConvertBuffer(), fdTileMapDecodeStagedBuffer(), fdTileMapNumberPlaceholderMetatileTiles(), fdUpdateWalking(), fdWorldMapLoadAreaGraphics(), fdWorldMapLoadDefaultMetatilesAndUpdateBlock(), fdWorldMapPresentStillImage(), fdWorldMapStartStillImage(), scKolimaForestFloodgateCheckLogFits(), scKolimaForestFloodgateMarkLogMetatiles(), scMapGridFillCollisionRectangle() and sySerialTestRun().

Definition at line 56 of file globals.h.

DecodeBuffer

extern Uint8 DecodeBuffer[]

16 KB of EWRAM at 0x0201c000.

Referenced by fdTileMapDrawRowsFromRam() and fdWorldMapStartStillImage().

Definition at line 58 of file globals.h.

ActorSpriteSlots

extern Uint8 ActorSpriteSlots[]

16 KB of EWRAM at 0x02018000, where the battle's actor sprite buffers start, 16 KB a slot; the map's metatiles fill it while a map is loaded.

Referenced by btRun() and scBattleArenaEnterBattle().

Definition at line 61 of file globals.h.

EwramHeap

extern Uint8 EwramHeap[]

The heap_release group. Releasing heap blocks, and the two pools' space. The EWRAM heap's space, 32 KB from 0x02030000.

Referenced by syHeapInit().

Definition at line 65 of file globals.h.

IwramHeap

extern Uint8 IwramHeap[]

The IWRAM heap's space, from 0x03002000 up to RamIWRAMHeapEnd.

Referenced by syHeapInit().

Definition at line 67 of file globals.h.

OamMatrixCount

extern Uint8 OamMatrixCount

The affine group. Sprite rotation and scale, and the affine matrices handed out each tick. Matrices handed out this tick (syOAMMatrixAllocateFromTransform), up to 32; syOAMResetTick sets it back to 0 after each VBlank.

Referenced by syOAMMatrixAllocateFromTransform() and syOAMResetTick().

Definition at line 73 of file globals.h.

OamMatrices

extern OAM_MATRIX OamMatrices[]

This tick's 32 matrices, copied into OAM with the sprites.

Referenced by syOAMMatrixAllocateFromTransform().

Definition at line 75 of file globals.h.

OamDepthLists

extern void *OamDepthLists[]

The 256 depth slots' list heads that every drawn sprite is linked into (syOAMAddSpriteAtDepth); syOAMResetTick empties them each tick.

Referenced by syOAMAddSpriteAtDepth() and syOAMResetTick().

Definition at line 78 of file globals.h.

syDecompressByteLZArm

extern const Uint8 syDecompressByteLZArm[]

The decompress group. The decoders and canvas fades that the system library runs from RAM copies (system/system_decompress.c), and their sizes.

Each is handwritten ARM code that the game never runs where it lies: its loader copies it to the heap or the stack first and calls the copy, so it is declared as an array of bytes. A symbol ending in CodeSize is the length in bytes of the code the loader copies: not an object, but an address the linker sets equal to the length (in the function's assembly file, or ld_script.ld where the end is the next function), so the loader reads it by casting it to a number. The byte-oriented LZ decoder, run by syDecompressByteLZ from a heap copy.

Definition at line 91 of file globals.h.

syDecompressByteLZCodeSize

extern Uint8 syDecompressByteLZCodeSize[]

syDecompressByteLZArm: how much syDecompressByteLZ allocates for it.

Definition at line 93 of file globals.h.

syDecompressTaggedLZArm

extern const Uint8 syDecompressTaggedLZArm[]

The tagged LZ decoder (a first byte of 0 for the general form, 1 for the palette form), run by syDecompressTaggedLZ from a heap copy.

Definition at line 96 of file globals.h.

syDecompressTaggedLZCodeSize

extern Uint8 syDecompressTaggedLZCodeSize[]

syDecompressTaggedLZArm, which syDecompressTaggedLZ copies to the heap.

Definition at line 98 of file globals.h.

syDecompressMoveToFrontLZCommands

extern const Uint8 syDecompressMoveToFrontLZCommands[]

The move-to-front LZ decoder's ARM entry: it returns 4 unless the stream's first byte is 2, the move-to-front tag.

Definition at line 101 of file globals.h.

DecompressMoveToFrontLzCommandsCodeSize

extern Uint8 DecompressMoveToFrontLzCommandsCodeSize[]

syDecompressMoveToFrontLZCommands through its command loop, which syDecompressMoveToFrontLZ copies to the heap.

Definition at line 104 of file globals.h.

syDecompressHalfwordLZ

extern const Uint8 syDecompressHalfwordLZ[]

The halfword LZ decoder that syDecompressHalfwords runs from its stack.

Referenced by syDecompressHalfwords().

Definition at line 106 of file globals.h.

syDecompressHalfwordsCodeSize

extern Uint8 syDecompressHalfwordsCodeSize[]

syDecompressHalfwordLZ, copied onto the stack by syDecompressHalfwords.

Referenced by syDecompressHalfwords().

Definition at line 108 of file globals.h.

DecodeFillByte

extern Uint8 DecodeFillByte

The colour index fdRenderDecodePicture paints every pixel of a layer drawn with SPRITE_COLOR_FILL; the sprite viewer sets it to 3.

Referenced by fdSpriteViewerRun().

Definition at line 111 of file globals.h.

syColorBufferBrightenCodeSize

extern Uint8 syColorBufferBrightenCodeSize[]

The canvas fades' ARM functions and their sizes: each syColorBuffer... function in system/system_decompress.c copies its ARM code onto its own stack and runs it there. syColorBufferBrightenArm, for syColorBufferBrighten.

Definition at line 116 of file globals.h.

syColorBufferBrightenPartialCodeSize

extern Uint8 syColorBufferBrightenPartialCodeSize[]

syColorBufferBrightenPartialArm, for syColorBufferBrightenPartial.

Definition at line 118 of file globals.h.

syColorBufferDarkenCodeSize

extern Uint8 syColorBufferDarkenCodeSize[]

syColorBufferDarkenArm, for syColorBufferDarken.

Definition at line 120 of file globals.h.

syColorBufferDarkenPartialCodeSize

extern Uint8 syColorBufferDarkenPartialCodeSize[]

syColorBufferDarkenPartialArm, for syColorBufferDarkenPartial.

Definition at line 122 of file globals.h.

syColorBufferHalveCodeSize

extern Uint8 syColorBufferHalveCodeSize[]

syColorBufferHalveArm, for syColorBufferHalve.

Definition at line 124 of file globals.h.

syColorBufferHalveNonzeroCodeSize

extern Uint8 syColorBufferHalveNonzeroCodeSize[]

syColorBufferHalveNonzeroArm, for syColorBufferHalveNonzero.

Definition at line 126 of file globals.h.

syColorBufferScaleNonzeroThreeQuartersCodeSize

extern Uint8 syColorBufferScaleNonzeroThreeQuartersCodeSize[]

syColorBufferScaleNonzeroThreeQuartersArm, for syColorBufferScaleNonzeroThreeQuarters.

Definition at line 129 of file globals.h.

syColorBufferScaleThreeQuartersCodeSize

extern Uint8 syColorBufferScaleThreeQuartersCodeSize[]

syColorBufferScaleThreeQuartersArm, for syColorBufferScaleThreeQuarters.

Definition at line 131 of file globals.h.

syColorBufferBrightenArm

extern const Uint8 syColorBufferBrightenArm[]

Raises each pixel step by an amount, capped at 63, after backing the buffer up.

Definition at line 134 of file globals.h.

syColorBufferBrightenPartialArm

extern const Uint8 syColorBufferBrightenPartialArm[]

Brightens as syColorBufferBrightenArm, writing back only groups of four pixels not all at 63 already.

Definition at line 137 of file globals.h.

syColorBufferDarkenArm

extern const Uint8 syColorBufferDarkenArm[]

Lowers each pixel step by an amount, stopping at 0, after backing the buffer up.

Definition at line 140 of file globals.h.

syColorBufferDarkenPartialArm

extern const Uint8 syColorBufferDarkenPartialArm[]

Darkens as syColorBufferDarkenArm, writing back only groups of four pixels not all 0 already.

Definition at line 143 of file globals.h.

syColorBufferHalveArm

extern const Uint8 syColorBufferHalveArm[]

Halves each pixel step; the battle effect canvas's transfers use it.

Definition at line 145 of file globals.h.

syColorBufferHalveNonzeroArm

extern const Uint8 syColorBufferHalveNonzeroArm[]

Halves each pixel step, skipping all-zero groups; Lucky Wheels' canvas uses it.

Definition at line 148 of file globals.h.

syColorBufferScaleNonzeroThreeQuartersArm

extern const Uint8 syColorBufferScaleNonzeroThreeQuartersArm[]

Scales each pixel step to three quarters, skipping all-zero groups.

Definition at line 150 of file globals.h.

syColorBufferScaleThreeQuartersArm

extern const Uint8 syColorBufferScaleThreeQuartersArm[]

Scales each pixel step to three quarters.

Definition at line 152 of file globals.h.

StubsSystem

extern const SYSTEM_STUB_TABLE StubsSystem

The stub group. The stub tables the system library's folder holds. The system library's stub table (system/stubs.s), through which the world map reaches its arctangent, sine and cosine.

Referenced by fdWorldMapUpdateAffineLines().

Definition at line 157 of file globals.h.

StubsResource

extern const Uint8 StubsResource[]

The resource module's stub, listed in the resource directory as both ResourceStubs and ResourceStubsAlternate.

Referenced by fdSpriteViewerRun().

Definition at line 160 of file globals.h.

TickRenderPending

extern Uint8 TickRenderPending

The tick group. The tick loop's globals: the frames a tick takes, the CPU load display and the VBlank flags. Set by sySynch() once it has built a tick's OAM list; the VBlank handler then copies the list, the BG scroll and the queued register writes, and clears it.

Referenced by sySynch() and syVBlankHandler().

Definition at line 166 of file globals.h.

CpuLoadDisplayEnabled

extern volatile Uint8 CpuLoadDisplayEnabled

Debug: sySynch() measures the CPU load into CpuLoadPeak when set.

Referenced by btRun(), mnCreditsRun(), mnTitleShowTitleScreen(), syInit() and sySynch().

Definition at line 168 of file globals.h.

OamCopyEnabled

extern Uint8 OamCopyEnabled

The VBlank handler copies the OAM list only while it is set; scenes clear it to keep their own sprites on screen.

Referenced by fdLuckyDiceRun(), fdLuckyWheelsRun(), mnCreditsRun(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen(), scInit(), syInit() and syVBlankHandler().

Definition at line 171 of file globals.h.

TickFrames

extern Uint16 TickFrames

Frames since sySynch() last started a tick: 1 when the tick took one.

Referenced by sySynch() and syVBlankHandler().

Definition at line 173 of file globals.h.

LastTickFrames

extern volatile Uint16 LastTickFrames

TickFrames as the last tick left it; the text typing paces itself by it.

Referenced by mnMessageType() and sySynch().

Definition at line 175 of file globals.h.

VBlankDone

extern volatile Uint16 VBlankDone

Bit 0 is set by the VBlank handler; sySynch() clears it and halts until it is set again. volatile: the VBlank handler sets it while sySynch() halts on it.

Referenced by syVBlankHandler().

Definition at line 178 of file globals.h.

CpuLoadTimer

extern Uint32 CpuLoadTimer

Ticks CpuLoadPeak is still held.

Referenced by sySynch().

Definition at line 179 of file globals.h.

CpuLoadPeak

extern Uint32 CpuLoadPeak

The highest CPU load in the last 30 ticks: the scanline the tick's work ended on, plus 256 for each VBlank it overran.

Referenced by sySynch().

Definition at line 182 of file globals.h.

TickCount

extern volatile Uint32 TickCount

Ticks sySynch() has finished. volatile: the VBlank pass reads it (fdWorldMapApplyAffinePage picks the world map's affine page by it) while sySynch() counts it.

Referenced by btMessageWaitForAdvance(), btMessageWaitForAdvanceAt(), btPaletteUpdatePulseBrightness(), btPlaybackRun(), fdActorCycleSpriteColors(), fdActorSetLayersColorMode(), fdActorUpdateBlink(), fdEffectBlinkAvoidCaster(), fdEffectCycleActorAndSpawnArcs(), fdEffectFlickerActorAndSpawnArcs(), fdEffectRunSparkEmitter(), fdEffectUpdateSparkles(), fdMapScreenUpdateMarkers(), fdMotesUpdate(), fdPaletteEditorRun(), fdPsynergyFadeToCastColor(), fdPsynergyStartMindReadWave(), fdPsynergySteerLiftedTarget(), fdPsynergySteerPushedTarget(), fdRetreatUpdateSpark(), fdScreenTransitionUpdateFromCenter(), fdScreenTransitionUpdateScanlineTable(), fdWorldMapApplyAffinePage(), fdWorldMapInitPerspective(), fdWorldMapStartStillImage(), fdWorldMapUpdateAffineLines(), fdWorldMapUpdateView(), mnBattleCommandRowRun(), mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnBattleStatusScreenRun(), mnBattleSummonMenuRun(), mnBattleTargetRunSelection(), mnEquipmentMenuUpdateCompatibilityIndicators(), mnIconMenuDrawIcons(), mnItemMenuRunList(), mnPageArrowsDraw(), mnTitleShowCamelotLogo(), scAltinBeastSpewWater(), scAltinPeakFlickerStatue(), scAltinPeakSpawnDebris(), scAltinPeakSpawnSpit(), scColossoDrawGauge(), scCottageRoomsASpawnSleepZ(), scCottageRoomsBCycleColorsAndSpawnRings(), scCottageRoomsBFlashWhiteAndSpawnRings(), scCrossboneIsleSteppingStonesSpawnDragonFire(), scCrossboneIsleSteppingStonesSpawnMeltParticle(), scCrossboneIsleSteppingStonesSpawnUnusedLeaderParticle() and 90 more.

Definition at line 186 of file globals.h.

FrameCount

extern Uint32 FrameCount

Counted up by every VBlank.

Referenced by btPlaybackRun(), fdEffectPulseActorScale(), fdEffectUpdateMarsSpark(), fdEffectUpdateRadialSpread(), fdSpriteViewerLayOutRing(), mnCreditsScrollBackgrounds(), mnCreditsUpdateTextSprites(), mnFileListUpdateGlow(), mnNameEntryEditMemberName(), mnSelectionMenuDraw(), mnSelectionMenuDrawArrow(), mnTitleBob(), mnWindowSpritePulse(), mnWindowSpriteUpdateAll(), scAltmillerCaveUpdateWallFragment(), scSanctumChooseRestartOption() and syVBlankHandler().

Definition at line 187 of file globals.h.

SleepDisabled

extern volatile Uint8 SleepDisabled

Nonzero: sySynch() counts no idle time and ignores sleep requests.

Referenced by mnSettingsMenuRun(), scInit(), syInit() and sySynch().

Definition at line 192 of file globals.h.

IdleSleepEnabled

extern volatile Uint8 IdleSleepEnabled

Sleep after three idle minutes.

Referenced by gmMainRoutineStateInitDefaults(), mnCreditsRun(), mnSaveBuildFileSummary(), mnSaveChooseAndLoadFile(), mnSettingsMenuRun(), scInit() and sySynch().

Definition at line 194 of file globals.h.

SleepRequested

extern volatile Uint8 SleepRequested

1: sleep this tick; more: count down to it. volatile: sySynch() counts it down and reads it each tick.

Referenced by mnPauseMenuRun() and sySynch().

Definition at line 197 of file globals.h.

DebugMode

extern volatile Uint8 DebugMode

Debug builds: Start+Select pauses the tick loop. volatile: fdActorUpdatePlayerControl and fdEngineRun each read it again after an earlier test.

Referenced by btActionRunBuild(), fdActorMoveOnWorldMap(), fdActorUpdatePlayerControl(), fdEngineRun(), fdScriptUpdateDebugSkip(), fdSpriteViewerRun(), gmBuildStampGetTime(), gmMainRoutineRun(), mnBattleCollectPartyCommands(), mnPauseMenuChoose(), mnPauseMenuOpen(), scInit(), scWorldMapUpdateAreaContacts(), syInit() and sySynch().

Definition at line 201 of file globals.h.

DebugPaused

extern Uint8 DebugPaused

The debug pause is on.

Referenced by fdLuckyWheelsUpdate(), mnTitleUpdateIntroSprites() and sySynch().

Definition at line 202 of file globals.h.

ResetRequested

extern Uint8 ResetRequested

Set by the keypad interrupt; sySynch() performs the soft reset.

Referenced by syInputHandleKeyInterrupt() and sySynch().

Definition at line 204 of file globals.h.

IdleTicks

extern volatile Uint16 IdleTicks

Ticks since a key was last held. volatile: sySynch() counts it and reads it each tick.

Referenced by gmMainRoutineStateInitDefaults(), mnSaveChooseAndLoadFile() and sySynch().

Definition at line 207 of file globals.h.

SleepComboTicks

extern volatile Uint16 SleepComboTicks

Ticks L and R have been held together; three seconds request sleep. volatile: sySynch() counts it and reads it each tick.

Referenced by sySynch().

Definition at line 210 of file globals.h.

CartridgeResetMarker

extern Uint32 CartridgeResetMarker

Written by the soft reset just before it restarts the cartridge, and cleared by syInit; nothing else reads it.

Referenced by syHeapGetRemainingIWRAM(), syInit() and sySoftReset().

Definition at line 213 of file globals.h.

BuildStampWork

extern Sint32 BuildStampWork[]

The build stamp syCopyBuildStamp copies to IWRAM at power-on: twelve digits and a zero word, at the bottom of the tick-wait stack.

Referenced by syCopyBuildStamp() and sySoundTestRun().

Definition at line 216 of file globals.h.

PlayTimeTicks

extern Uint32 PlayTimeTicks

The play time clock, in ticks.

Referenced by gmMainRoutineStateInitDefaults(), mnSaveBuildFileSummary(), mnSaveChooseAndLoadFile() and sySynch().

Definition at line 217 of file globals.h.

SavedStackSize

extern Uint32 SavedStackSize

Bytes of the caller's stack sySynch() has copied into SavedStack, or 0.

Referenced by sySynch().

Definition at line 219 of file globals.h.

SavedStack

extern Uint8 SavedStack[]

The caller's stack below the tick-wait stack top, while sySynch() runs.

Referenced by sySynch().

Definition at line 221 of file globals.h.

PerData

extern volatile Uint32 PerData

The input group. The keypad state the VBlank interrupt keeps.

The VBlank handler reads the keypad into these metatiles, and syInputUpdateKeyRepeatAndDirection turns them into repeats after each tick (system/system_frame.c). The first three are volatile because the VBlank handler sets them while the code it interrupts reads them; the next two the key repeat rebuilds and reads each tick. Keys down now.

Referenced by btActionRunBuild(), btAdjustDebugValue(), btDebugBattleRunMenu(), btEffectReadKeysForEnemyTarget(), btMessageWaitForAdvance(), btPlaybackRun(), dbMenuTestBrowseMessageRange(), fdActorMoveByKeys(), fdActorMoveOnWorldMap(), fdActorUpdatePlayerControl(), fdEngineRun(), fdInputGetDpadAngle(), fdLuckyDiceRun(), fdLuckyWheelsUpdate(), fdMapScreenUpdateMarkers(), fdPaletteEditorRun(), fdPsynergySteerLiftedTarget(), fdPsynergySteerPushedTarget(), fdRunPushMetatile(), fdScriptShowMessageAndWait(), fdSpriteViewerLayOutRing(), fdSpriteViewerRun(), fdWorldMapZoomOutWhileLHeld(), mnBattleCollectPartyCommands(), mnBattleDjinnMenuRun(), mnDebugSceneSelectRun(), mnDjinnMenuSelectDjinn(), mnItemMenuRunMemberSelection(), mnMessageType(), mnPsynergyMenuRunList(), mnSaveScanFileSummaries(), mnTextCheckPauseSkipped(), scActorSteerByPad(), scBabiPalaceWakeAfterFinals(), scColosseumAzartMatchRollLogEastWest(), scColosseumNavampaMatchRollLongLog(), scColosseumSatrageMatchRideLog(), scFileScreenCheckButtonCodes(), scInit(), scLeaderSlideOnIce(), scMercuryLighthouseHopAcrossPool(), scTretTreeBranchExchangeInputPacket(), syInputUpdateKeyRepeatAndDirection(), sySerialTestRun(), sySynch() and syVBlankHandler().

Definition at line 230 of file globals.h.

PerPush

extern volatile Uint32 PerPush

Keys that went down this tick.

Referenced by btAdjustDebugValue(), btMessageWaitForAdvance(), btMessageWaitForAdvanceAt(), dbIncreaseItemAndLevelRunLevelEditor(), dbIncreaseItemAndLevelSelectAbility(), dbIncreaseItemAndLevelSelectItem(), dbMenuTestSelectItem(), fdCheckConfiguredKeys(), fdPsynergySteerLiftedTarget(), fdPsynergySteerPushedTarget(), fdScriptAskYesNoWithActorAnimation(), fdScriptShowTwoMessagesAndWait(), fdScriptUpdateDebugSkip(), fdSpriteViewerRun(), mnBattleCommandRowRun(), mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnBattleRefuseFlee(), mnBattleStatusScreenRun(), mnBattleSummonMenuRun(), mnBattleTargetRunSelection(), mnDebugFlagEditorHandleInput(), mnDebugSelectShortcuts(), mnDjinnMenuRunPreview(), mnDjinnMenuSelectDjinn(), mnDjinnMenuShowHelp(), mnDjinnMenuShowMemberStatus(), mnDjinnShowJoinedMessage(), mnFileListSelectFile(), mnIconMenuRun(), mnItemMenuChooseCommand(), mnItemMenuConfirmDrop(), mnItemMenuConfirmEquip(), mnItemMenuRunList(), mnItemMenuRunMemberSelection(), mnItemMenuSelectGiveQuantity(), mnItemMenuSelectTarget(), mnItemMenuShowDetails(), mnItemMenuShowMessage(), mnItemPickerRun(), mnItemPickerSelectItem(), mnNameEntryEditMemberName(), mnPartyMemberChooserChooseMember(), mnPartyShowJoinedMessage(), mnPartyShowPairJoinedMessage(), mnPauseMenuChoose(), mnPsynergyMenuRunList(), mnPsynergyMenuSelectMember(), mnPsynergyMenuSelectTarget() and 29 more.

Definition at line 232 of file globals.h.

PerRepeat

extern volatile Uint32 PerRepeat

Pressed keys, repeating while held: after 19 ticks, then every 6.

Referenced by btAdjustDebugValue(), btDebugBattleRunMenu(), btDebugBattleViewMessages(), btEffectRunAtalanta(), btEffectRunBoreas(), btEffectRunCybele(), btEffectRunDragonFire(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunNereid(), btEffectRunProcne(), btEffectRunRamses(), btEffectRunStarfieldFall(), btEffectRunThor(), dbIncreaseItemAndLevelSelectAbility(), dbIncreaseItemAndLevelSelectItem(), dbMenuTestSelectItem(), fdActorMoveOnWorldMap(), fdLuckyDiceRun(), fdMapScreenShow(), fdPaletteEditorRun(), fdSpriteViewerRun(), mnBattleCommandRowRun(), mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnBattleStatusScreenRun(), mnBattleSummonMenuRun(), mnBattleTargetRunSelection(), mnColossoMenuChoose(), mnDebugBrowserIcons(), mnDebugBrowserPortraits(), mnDebugFlagEditorHandleInput(), mnDebugSceneSelectHandleRowInput(), mnDebugSelectShortcuts(), mnDjinnMenuRunPreview(), mnDjinnMenuSelectDjinn(), mnDjinnMenuShowHelp(), mnDjinnMenuShowMemberStatus(), mnFileListSelectFile(), mnIconMenuRun(), mnItemMenuChooseCommand(), mnItemMenuConfirmDrop(), mnItemMenuConfirmEquip(), mnItemMenuRunList(), mnItemMenuRunMemberSelection(), mnItemMenuSelectGiveQuantity(), mnItemMenuSelectTarget(), mnItemMenuShowDetails() and 30 more.

Definition at line 234 of file globals.h.

PerRepeatDirected

extern volatile Uint32 PerRepeatDirected

PerRepeat with at most one D-pad direction.

Referenced by syInputUpdateKeyRepeatAndDirection().

Definition at line 236 of file globals.h.

PerDirection

extern volatile Uint32 PerDirection

The D-pad direction the repeat last settled on: when a second direction is added, PerRepeatDirected drops this one and keeps the new one. KEYS_HORIZONTAL, both left and right, stands for none.

Referenced by syInputUpdateKeyRepeatAndDirection().

Definition at line 240 of file globals.h.

PerPushLatch

extern Uint32 PerPushLatch

Kept by the tick loop and the key repeat.

Presses since a reader last cleared it.

Referenced by btPlaybackRun(), mnDjinnMenuSelectDjinn(), mnMessageType(), mnTextCheckTextDismissed() and syVBlankHandler().

Definition at line 243 of file globals.h.

PerDataLast

extern Uint32 PerDataLast

PerData when the tick loop last read it.

Referenced by syInputUpdateKeyRepeatAndDirection().

Definition at line 245 of file globals.h.

PerDataAtVBlank

extern Uint32 PerDataAtVBlank

PerData at the previous VBlank.

Referenced by syVBlankHandler().

Definition at line 247 of file globals.h.

PerRepeatTimer

extern Sint32 PerRepeatTimer

Ticks until the held keys repeat; -1 makes them repeat at once.

Referenced by syInputResetKeyRepeat(), syInputUpdateKeyRepeatAndDirection() and syVBlankHandler().

Definition at line 250 of file globals.h.

ScreenFadeToWhite

extern Uint8 ScreenFadeToWhite

The screen_fade group. The brightness fade of the whole screen that the VBlank handler steps (system/system_screen_fade.c). Which way the screen fade goes: 0 towards black, 1 towards white.

Referenced by syScreenFadeStart() and syScreenFadeUpdate().

Definition at line 255 of file globals.h.

ScreenFadeFrames

extern volatile Uint8 ScreenFadeFrames

The running fade's length in frames, 0 when no fade is running. volatile: the VBlank handler's syScreenFadeUpdate clears it when the fade ends, while syScreenFadeWait waits on it.

Referenced by syScreenFadeStart(), syScreenFadeUpdate() and syScreenFadeWait().

Definition at line 259 of file globals.h.

ScreenFadeFramesLeft

extern volatile Uint8 ScreenFadeFramesLeft

Frames until the running fade reaches its target. volatile: the VBlank handler's syScreenFadeUpdate counts it down.

Referenced by syScreenFadeStart() and syScreenFadeUpdate().

Definition at line 262 of file globals.h.

ScreenFadeLayers

extern Uint16 ScreenFadeLayers

The BLDCNT first-target layers the screen fade covers (the low six bits).

Referenced by syScreenFadeStart() and syScreenFadeUpdate().

Definition at line 264 of file globals.h.

ScreenFadeStartLevel

extern Uint8 ScreenFadeStartLevel

The brightness the running fade started from, 0 to 16.

Referenced by syScreenFadeStart() and syScreenFadeUpdate().

Definition at line 266 of file globals.h.

ScreenFadeTargetLevel

extern volatile Uint8 ScreenFadeTargetLevel

The brightness the running fade ends at, 0 to 16. volatile: syScreenFadeStart sets it for the VBlank handler's syScreenFadeUpdate.

Referenced by syScreenFadeStart() and syScreenFadeUpdate().

Definition at line 269 of file globals.h.

IoWriteQueueWork

extern IO_WRITE_QUEUE IoWriteQueueWork

The io_write_queue group. The register write queue that VBlank carries out after each finished tick. IO_WRITE_QUEUE_PUSH and the writers declared beside syIOWriteQueueStore16 (system.h), which store, set bits or clear bits in a register 8, 16 or 32 bits wide, fill it, and syIOWriteQueueFlushPending empties it at VBlank.

Referenced by syInit() and syIOWriteQueueFlushPending().

Definition at line 276 of file globals.h.

syIWRAMMulFXReturnIp

extern Uint8 syIWRAMMulFXReturnIp[]

The iwram_call group. The IWRAM call layer: the functions the game keeps resident in IWRAM, each at its fixed address, and one typed inline per function that every call goes through. syMulFX's function in IWRAM, which returns through ip.

Definition at line 282 of file globals.h.

syIWRAMWordsClear

extern Uint8 syIWRAMWordsClear[]

The IWRAM function that clears a run of words, which the OAM build calls by its address.

Referenced by syOAMResetTick().

Definition at line 285 of file globals.h.

CurrentMatrix

extern MATRIX CurrentMatrix

The matrix group. The 3D transform and its stack. The current 3D transform. syMultiMatrix multiplies the matrix it is given into it.

Referenced by btEffectRunAtalanta(), syGetMatrix(), syInitMatrix(), syLoadMatrix(), syLookAtLoad(), syPopMatrix(), syPushMatrix() and syUnitMatrixCurrentInline().

Definition at line 296 of file globals.h.

MatrixStackDepth

extern Sint32 MatrixStackDepth

Matrices saved by syPushMatrix, 0 or 1: the save area holds one.

Referenced by syInitMatrix(), syPopMatrix() and syPushMatrix().

Definition at line 299 of file globals.h.

MatrixStackTop

extern Uint8 *MatrixStackTop

Where syPushMatrix saves CurrentMatrix next: the save area in heap slot HEAP_SLOT_MATRIX_STACK, or just past it while a matrix is saved.

Referenced by syInitMatrix(), syPopMatrix() and syPushMatrix().

Definition at line 302 of file globals.h.

RelocatedInnerProduct

extern const Uint32 RelocatedInnerProduct[]

syMatrixBuildLookAt's ARM dot product, seven words it copies onto its stack to run.

Referenced by syMatrixBuildLookAt().

Definition at line 305 of file globals.h.

NumberBuffer

extern Uint8 NumberBuffer[]

The number text buffer: syStringFormatHex writes eight digits and syStringFormatDecimal eleven characters, right-aligned, each with a terminator.

Referenced by mnStringFormatNumberToHalfwords(), syStringFormatDecimal() and syStringFormatHex().

Definition at line 314 of file globals.h.

ProjectionWork

extern PROJECTION ProjectionWork

The projection group. The 3D projection. The current 3D projection: syPerspective and sySetScreenDist write its focal length and depth range, and the battle and its battle effects set its centre directly.

Referenced by btCameraSetCommandView(), btCameraSetView(), btCameraSetViewAtDepth(), btCameraShake(), btEffectEndCanvasLayer(), btEffectRunAtalanta(), btEffectRunBoreas(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunProcne(), btEffectRunStarfieldFall(), btEffectRunThor(), btEffectSetupBlendedDisplay(), fdCameraResetViewDefaults(), fdWorldMapBuildScanlineTable(), fdWorldMapInitPerspective(), fdWorldMapUpdateAffineLines(), fdWorldMapUpdateView(), syConvert3Dto2D(), syPerspective() and sySetScreenDist().

Definition at line 319 of file globals.h.

TitleSendOptionEnabled

extern Sint16 TitleSendOptionEnabled

The save group. Nonzero offers Send on the File Screen: mnSaveScanFileSummaries sets it when a file has its send flag set and R and Left are held.

Referenced by mnFileListSelectAction() and mnSaveScanFileSummaries().

Definition at line 324 of file globals.h.

SerialTransfer

extern SERIAL_TRANSFER_STATE SerialTransfer

The serial group. The link cable's runtime: serial packets, registers and transfer state. This console's block transfer state, sent to the partners each VBlank.

Referenced by btClearSerialTransferPayload(), btLinkBattleSyncTurn(), btLinkBattleWaitSync(), mnBattleCollectPartyCommands(), scBattleArenaEnterBattle(), scBattleArenaWriteSlotValue(), scInit(), sySerialResetTransferState(), sySerialStartReceive(), sySerialStartSend(), sySerialStepBlockTransfer() and syVBlankHandler().

Definition at line 338 of file globals.h.

SerialStateWork

extern SERIAL_STATE SerialStateWork

Referenced by sySerialAddErrorFlag(), sySerialCollectReceivedPayloads(), sySerialDisableTransfer(), sySerialEnableTransferTimer(), sySerialExchangePayloads(), sySerialGetLinkStatus(), sySerialHandleTransferInterrupt(), sySerialInit(), sySerialPollAndTransfer(), sySerialPollStatus(), sySerialPrepareSendPacket(), sySerialStartClocking() and sySynch().

Definition at line 339 of file globals.h.

SerialExchangeActive

extern Uint16 SerialExchangeActive

Set from sySerialInit while the consoles exchange packets every tick.

Referenced by sySerialInit(), sySerialRemoveIRQHandlers(), sySynch() and syVBlankHandler().

Definition at line 341 of file globals.h.

SerialSendSource

extern Sint32 SerialSendSource

What the send in progress sends from, 0 when none is running.

Referenced by scInit(), sySerialGetActiveTransfers(), sySerialInit(), sySerialResetTransferState(), sySerialStartSend(), sySerialStepBlockTransfer() and sySerialWaitForTransfers().

Definition at line 343 of file globals.h.

SerialSendSize

extern volatile Uint16 SerialSendSize

The bytes the send in progress has left to send. volatile: sySerialStartSend sets it while sySerialStepBlockTransfer, which the VBlank handler runs, counts it down.

Referenced by sySerialInit(), sySerialResetTransferState(), sySerialStartSend() and sySerialStepBlockTransfer().

Definition at line 347 of file globals.h.

SerialReceiveDestination

extern Sint32 SerialReceiveDestination

Where the receive in progress writes, 0 when none is running.

Referenced by sySerialGetActiveTransfers(), sySerialInit(), sySerialResetTransferState(), sySerialStartReceive(), sySerialStepBlockTransfer(), sySerialTestRun() and sySerialWaitForTransfers().

Definition at line 349 of file globals.h.

SerialReceivedSize

extern volatile Uint16 SerialReceivedSize

The bytes the receive in progress has taken so far. volatile: sySerialStepBlockTransfer, which the VBlank handler runs, counts it up while the link code outside the interrupt polls it.

Referenced by btAppendLinkedActions(), scBattleArenaReceivePartyRecords(), sySerialInit(), sySerialResetTransferState(), sySerialStartReceive() and sySerialStepBlockTransfer().

Definition at line 353 of file globals.h.

SerialPeerPayloads

extern SERIAL_TRANSFER_STATE SerialPeerPayloads[4]

Referenced by btLinkBattleSyncTurn(), btLinkBattleWaitSync(), mnBattleCollectPartyCommands(), mnBattleMenuUpdate(), scBattleArenaPeerSlotMatches(), scBattleArenaWatchOpponent(), scInit(), sySerialStepBlockTransfer() and syVBlankHandler().

Definition at line 354 of file globals.h.

SerialBlockNumber

extern volatile Uint8 SerialBlockNumber

The number of the block being sent or received, from 0 at each transfer. volatile: sySerialStartSend and sySerialStartReceive reset it while sySerialStepBlockTransfer, which the VBlank handler runs, steps it.

Referenced by sySerialStartReceive(), sySerialStartSend() and sySerialStepBlockTransfer().

Definition at line 358 of file globals.h.

LinkExchangeState

extern Uint8 LinkExchangeState

Cleared as the link starts and as the Battle Arena trades parties; nothing reads it.

Referenced by scBattleArenaExchangePartyRecords() and sySerialInit().

Definition at line 361 of file globals.h.

LinkStatusWork

extern volatile Uint16 LinkStatusWork

Link status, updated by the VBlank exchange handler. volatile: the VBlank handler writes it while sySerialWaitForStatusMask and the link screens poll it.

Referenced by btAppendLinkedActions(), btCameraUpdate(), btLinkBattleSyncTurn(), btLinkBattleWaitSync(), btRun(), mnBattleCollectPartyCommands(), scBattleArenaPeerSlotMatches(), scBattleArenaReceivePartyRecords(), scBattleArenaSendPartyRecords(), scInit(), sySerialStepBlockTransfer(), sySerialWaitForStatusMask() and syVBlankHandler().

Definition at line 365 of file globals.h.

VramCacheBlockOwners

extern Uint8 VramCacheBlockOwners[VRAM_BLOCK_COUNT]

The vram_cache group. The sprite VRAM block cache and its owners. The cache entry that owns each block, or VRAM_BLOCK_OWNER_FREE.

Referenced by fdActorUpdatePlayerControl(), fdEngineRun(), syVRAMCacheAllocateBlocks(), syVRAMCacheFreeBlocks(), syVRAMCacheGetLongestFreeRun(), syVRAMCacheReset() and void().

Definition at line 369 of file globals.h.

VramCacheEntries

extern VRAM_CACHE_ENTRY VramCacheEntries[]

The cache entries by number: the slot a sprite or loaded picture holds.

Referenced by btPlaybackRun(), fdEffectSpawnDescendingArcParticles(), fdEffectSpawnScaledArcActors(), fdGroundMaskDrawMarks(), fdMapScreenInit(), fdMapScreenUpdateMarkers(), fdSpriteCreate(), fdSpriteDissolveStep(), mnBattleStatusScreenRun(), mnIconMenuDrawIcons(), scColossoDrawGauge(), scColossoUpdateLettering(), scColossoUpdatePointer(), scCottageRoomsBSpawnRingPair(), scHeatGaugeDraw(), scLemurianShipCloseCurtains(), scSolSanctumEruptionRaiseGoldenRings(), scSpawnGoldenRing(), scSpawnPsynergyRings(), scTitleUpdateSpriteReveal(), scValePlazaSpawnEffectPair(), syVRAMCacheAllocateBlocks(), syVRAMCacheFindFreeEntry(), syVRAMCacheFreeEntry(), syVRAMCacheLoad(), syVRAMCacheReleaseVRAM(), syVRAMCacheReload() and syVRAMCacheReset().

Definition at line 372 of file globals.h.

ScanlineAngle

extern Uint32 ScanlineAngle

The world map camera's yaw, in 1/65536 turns, the scanline parameters were built for; fdWorldMapUpdateAffineLines rebuilds them when it changes.

Referenced by fdWorldMapInitPerspective(), fdWorldMapUpdateAffineLines() and fdWorldMapUpdateView().

Definition at line 376 of file globals.h.

ScanlinePitch

extern Uint32 ScanlinePitch

The world map camera's pitch the scanline parameters were built for.

Referenced by fdWorldMapInitPerspective(), fdWorldMapStepZoom() and fdWorldMapUpdateView().

Definition at line 379 of file globals.h.

On this page

FunctionsVariablesDescriptionFunctions in detailUserFunctionVariables in detailEventsRunningEventsInitializedEventBufBgScrollWorkIrqHandlersDefaultIrqHandlerssyIWRAMIRQMainIwramIrqModeWordIwramResidentRomIrqVectorHeapSlotsMapGridMetatileBufferDecodeBufferActorSpriteSlotsEwramHeapIwramHeapOamMatrixCountOamMatricesOamDepthListssyDecompressByteLZArmsyDecompressByteLZCodeSizesyDecompressTaggedLZArmsyDecompressTaggedLZCodeSizesyDecompressMoveToFrontLZCommandsDecompressMoveToFrontLzCommandsCodeSizesyDecompressHalfwordLZsyDecompressHalfwordsCodeSizeDecodeFillBytesyColorBufferBrightenCodeSizesyColorBufferBrightenPartialCodeSizesyColorBufferDarkenCodeSizesyColorBufferDarkenPartialCodeSizesyColorBufferHalveCodeSizesyColorBufferHalveNonzeroCodeSizesyColorBufferScaleNonzeroThreeQuartersCodeSizesyColorBufferScaleThreeQuartersCodeSizesyColorBufferBrightenArmsyColorBufferBrightenPartialArmsyColorBufferDarkenArmsyColorBufferDarkenPartialArmsyColorBufferHalveArmsyColorBufferHalveNonzeroArmsyColorBufferScaleNonzeroThreeQuartersArmsyColorBufferScaleThreeQuartersArmStubsSystemStubsResourceTickRenderPendingCpuLoadDisplayEnabledOamCopyEnabledTickFramesLastTickFramesVBlankDoneCpuLoadTimerCpuLoadPeakTickCountFrameCountSleepDisabledIdleSleepEnabledSleepRequestedDebugModeDebugPausedResetRequestedIdleTicksSleepComboTicksCartridgeResetMarkerBuildStampWorkPlayTimeTicksSavedStackSizeSavedStackPerDataPerPushPerRepeatPerRepeatDirectedPerDirectionPerPushLatchPerDataLastPerDataAtVBlankPerRepeatTimerScreenFadeToWhiteScreenFadeFramesScreenFadeFramesLeftScreenFadeLayersScreenFadeStartLevelScreenFadeTargetLevelIoWriteQueueWorksyIWRAMMulFXReturnIpsyIWRAMWordsClearCurrentMatrixMatrixStackDepthMatrixStackTopRelocatedInnerProductNumberBufferProjectionWorkTitleSendOptionEnabledSerialTransferSerialStateWorkSerialExchangeActiveSerialSendSourceSerialSendSizeSerialReceiveDestinationSerialReceivedSizeSerialPeerPayloadsSerialBlockNumberLinkExchangeStateLinkStatusWorkVramCacheBlockOwnersVramCacheEntriesScanlineAngleScanlinePitch