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 world_map_lines.c, field_state.h, world_map_affine.h, mul_fx.h and system.h.

Functions

NameDescription
extern void (*UserFunction )(void)Called once by the next VBlank, which clears it first; the world map sets it to show its next picture.

Variables

NameDescription
extern volatile Uint8EventsRunningThe event group.
extern Uint8EventsInitialized1 once the event table is set up
extern EVENTEventBuf [EVENT_COUNT]The event table, run in priority order by each pass of sySynch().
extern INTERRUPT_HANDLERIrqHandlers [IRQ_COUNT]The irq group.
extern const INTERRUPT_HANDLERDefaultIrqHandlers [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).
extern const Uint8IwramResidentRom []Where the IWRAM-resident code lies in ROM (ld_script.ld): 4 KB of it is copied to syIWRAMIRQMain at power-on.
extern void *IrqVectorThe BIOS's interrupt vector, pointed at syIWRAMIRQMain at power-on.
extern Uint8ActorSpriteSlots []The heap_slots group.
extern Uint16LinkPeerSignatures [][12]24 bytes a peer: where a link battle reads its partner's signature.
extern Uint8OamMatrixCountThe affine group.
extern OAM_MATRIXOamMatrices []This tick's 32 matrices, copied into OAM with the sprites.
extern BG_SCROLLBgScrollWork []The bg_scroll group.
extern const Uint32RelocatedInnerProduct []The decompress group.
extern const Uint8syDecompressTaggedLZArmCode []The tagged LZ decoder in ARM, run by syDecompressTaggedLZ from a heap copy.
extern Uint8syDecompressTaggedLZCodeSize []The size of syDecompressTaggedLZArmCode, which syDecompressTaggedLZ copies to the heap.
extern const Uint8syDecompressMoveToFrontLZCommandsCode []The move-to-front LZ decoder's command loop, run by syDecompressMoveToFrontLZ from a heap copy.
extern Uint8DecompressMoveToFrontLzCommandsCodeSize []The size of syDecompressMoveToFrontLZCommandsCode, which syDecompressMoveToFrontLZ copies to the heap (ld_script.ld).
extern const Uint8ResourceDecodeByteLzCode []The byte LZ decoder, run by syDecompressByteLZ from a heap copy.
extern Uint8ResourceDecodeByteLzCodeSize []The size of ResourceDecodeByteLzCode, which syDecompressByteLZ copies to the heap.
extern Uint8DecodeFillByteThe colour index fdRenderDecodePicture paints every pixel of a layer drawn with SPRITE_COLOR_FILL; the sprite viewer sets it to 3.
extern const SYSTEM_STUB_TABLEStubsSystemThe stub group.
extern Uint16CreditsGreyColors []The flash group.
extern Sint32BuildStampWork []The tick group.
extern Uint8OamCopyEnabledThe VBlank handler copies the OAM list only while it is set; scenes clear it to keep their own sprites on screen.
extern Uint8TickRenderPendingSet 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.
extern Uint8CpuLoadDisplayEnabledDebug: sySynch() measures the CPU load into CpuLoadPeak when set.
extern Uint16TickFramesFrames since sySynch() last started a tick: 1 when the tick took one.
extern Uint16LastTickFramesTickFrames as the last tick left it; the text typing paces itself by 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 Uint8SleepDisabledNonzero: sySynch() counts no idle time and ignores sleep requests.
extern volatile Uint8IdleSleepEnabledSleep after three idle minutes.
extern volatile Uint16IdleTicksTicks since a key was last held.
extern volatile Uint8SleepRequested1: sleep this tick; more: count down to it.
extern Uint8DebugModeDebug builds: Start+Select pauses the tick loop.
extern Uint8DebugPausedthe debug pause is on
extern Uint8ResetRequestedSet by the keypad interrupt; sySynch() performs the soft reset.
extern Uint32CartridgeResetMarkerWritten by the soft reset just before it restarts the cartridge, and cleared by syInit; nothing else reads it.
extern Uint32TickCountTicks sySynch() has finished.
extern Uint32PlayTimeTicksthe play time clock, in ticks
extern Uint32FrameCountcounted up by every VBlank
extern volatile Uint16VBlankDonevolatile: the VBlank handler sets it while syWaitForVBlankInterrupt waits on it, so it is no device.
extern Uint8EwramHeap []The heap_release group.
extern Uint8IwramHeap []The IWRAM heap's space, from 0x03001300 up to RamIwramHeapEnd.
extern INPUT_STATEPerWorkThe input group.
extern IO_WRITE_QUEUEIoWriteQueueWorkThe io_write_queue group.
extern const Uint16MathTanTable [258]The math_table group.
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 OAM_USAGEOamUsageWorkThe oam group.
extern PROJECTIONProjectionWorkThe projection group.
extern Sint32BattleRandomSeedThe random group.
extern Uint8MapGridMetatileBuffer []The ram_buffer group.
extern Uint8MapShapeGrid []The map's shape grid, a byte a metatile, which fdMapGridLoadMap decodes from the map header's shapes and the field's actor metatiles read.
extern Uint32MetatileTiles []The layout's metatile tiles, 32 KB of EWRAM at 0x02020000: each metatile's tiles 8 bytes, its top two tile entries, then its bottom two.
extern Sint8SceneLocalState []A scene's own state in EWRAM, which each scene lays out as it needs.
extern Uint8SceneStateWork []120 more bytes of a scene's own state in EWRAM, which a scene that keeps one lays out under a name of its own.
extern MAIN_ROUTINE_STATEMainRoutineStateWorkThe game's state (MAIN_ROUTINE_STATE).
extern Uint8PartyDjinnRecovery []MainRoutineStateWork from its summonMask on, under a label of its own: the party's DJINN_RECOVERY_TABLE, which gmDjinnGetRecoveryTable returns.
extern Uint8GameFlagBytes []The game flags, 4096 bits in 512 bytes, saved with the game: flag n is bit n & 7 of byte GAME_FLAG_BYTE(n).
extern Uint8InventorySnapshot []The party's inventories, shortcuts and order as gmInventorySnapshotSave puts them aside for the Trial Road, with spare room after them.
extern Uint8RareItemStock []How many of each rare item the shops may still sell, 0 to 99, by counter number (ITEM_COUNTER_COUNT of them; ItemRareItemCounters, gmRareItemStockAdjust).
extern Uint8BgTileBuffer []32 KB of EWRAM holding background tiles, such as the world map's char blocks 2 and 3.
extern Uint8MapGridShapes []The map's shape table, 16 KB of EWRAM: 4-byte entries that a map metatile's shape indexes.
extern Uint8DecodeBuffer []16 KB of EWRAM that pictures and tiles are decoded into before they are copied on.
extern Uint8MapGridAnimationTiles []The tileset animations' tiles, 16 KB of EWRAM.
extern Uint8MapScene []The map's scene data in EWRAM, loaded from its resource: its entrance stream, then from the halfword offsets after it its edits and its bounds.
extern Uint8MapSceneEditsOffset []The scene data's halfword offset of its edits, from MapScene.
extern Uint8MapSceneBoundsOffset []The scene data's halfword offset of its bounds, from MapScene.
extern Uint8MapScenePoints []The scene data's points table, in EWRAM at 0x0202e008.
extern Uint8TitleIntroLogoTileBuffer []Where each of The Lost Age's pictures is unpacked before it is copied into sprite tiles.
extern Uint8EffectScratch []The battle effects' blocks in the map metatile buffer, which they borrow while no map is loaded.
extern Uint8SeracMeshEnd []Nirvana's mesh's end, after 112 faces.
extern Uint16FloraPetalTiles []Inside EffectScratch: FLORA_PETAL_WORK from its second tile number on, read at its fixed place.
extern Uint16FloraSpritePalettes []Inside EffectScratch: FLORA_PETAL_WORK.palette, the object palette as it fades.
extern Uint8HauresMoundStrip []In the map metatile buffer: Haures's mound's faces, eight bytes a quad.
extern Uint8HauresMoundStripEnd []The face after Haures's mound's last, which ends the strip.
extern Uint8HauresMoundShades []In the map metatile buffer: each of Haures's mound corners' shade.
extern Uint8IrisTileBuffer []In the map metatile buffer: the tiles Iris draws its sprites from.
extern WORLD_MAP_STATEWorldMapStateWorkThe world map's and the map screen's state in EWRAM.
extern WORLD_MAP_CHOICEMapScreenChoiceThe destination last chosen on the world map (WORLD_MAP_CHOICE).
extern Uint32ScanlineAngleThe world map camera's yaw, in 1/65536 turns, the scanline parameters were built for; the vertex update rebuilds them when it changes.
extern Uint32ScanlinePitchThe world map camera's pitch the scanline parameters were built for.
extern Sint16MapScreenFirstListOnlyNever set (EWRAM, zero from boot).
extern Sint32MapScreenGlideTargetXWhere the map screen's cursor glides to on its own, 16.16; 0 when it does not.
extern Sint32MapScreenGlideTargetYAs MapScreenGlideTargetX, the second coordinate.
extern Sint16MapScreenZoomedNonzero while the map screen is zoomed in.
extern Sint16MapScreenNameRedrawPending []Set while the place name waits to be drawn again.
extern Sint16MapScreenNameRedrawDelay []Ticks before the place name is drawn again.
extern WORLD_MAP_MARKERMapScreenCursorMarkerThe map screen's cursor marker.
extern FIXED *MapScreenCursorThe world map cursor's position (x, then y, 16.16 pixels).
extern Sint32MapScreenCursorStartXWhere the cursor goes back to when Start is let go: the place R or L last stepped to, 16.16 pixels.
extern Sint32MapScreenCursorStartYAs MapScreenCursorStartX.
extern Sint32MapScreenScrollXThe map screen's scroll as Select toggles the zoom, 16.16 pixels.
extern Sint32MapScreenScrollYAs MapScreenScrollX.
extern Sint16CreditsPendingSlidesThe credits' state in EWRAM.
extern struct DISPLAY_SCROLL_OBJECT *DisplayScrollObjectsThe credits' sprite buffer, copied to OAM each tick: the border strips' sprites, then the text's.
extern Sint16DisplayScrollBusy0 while the credits text scrolls; once a line stops it, the line's stop (1 at a page mark, which A or B releases), then counted up each tick after the end (CREDITS_TICKS_AFTER_END).
extern Sint16DisplayScrollLastPositionDisplayScrollPosition when the credits last drew a line.
extern Uint16DisplayScrollPositionHow far the credits text has scrolled, in pixels: one every four frames, faster while B is held.
extern Sint16EndingImageBlockWhich character block the image is in.
extern Sint16EndingImageFadeFramesFrames of the fade-in, to 64.
extern Uint32EndingImageMapScrollThe tilemap's scroll, 16.16 pixels.
extern volatile Sint32EndingImageScrollThe scroll, 16.16 pixels.
extern Sint16EndingImageTargetRowThe row a scene asks for (mnEndingImageSetTargetRow); Row moves toward it.
extern Sint16EndingImageRowThe row the scroll is heading for.
extern Sint16EndingImageSpeedThe most rows a tick moves.
extern Uint8 *EndingImageMapThe image's map.
extern void *EndingImageStripsThe 24 sprites of the image's border strips.
extern Sint16TitleBattleOptionEnabledThe File Screen's options in EWRAM.
extern Sint16TitleUpdateOptionEnabledNonzero offers Update on the File Screen, when a file has a party whose summary is not marked reunited (mnSaveScanFileSummaries).
extern Sint16BupSlotThe save group.
extern Sint16AnyFileCleared1 when a save file on the cartridge holds a cleared game, as the save screen finds on loading the summaries; a new game keeps it in MainRoutineStateWork.clearedFileAtStart.
extern Uint8BupBuffer []The buffer a save file is built in and written from, in two halves; its summary's 16-byte header lies just before it.
extern const Uint8BupSignature []The bupdata group.
extern const Uint8BupHeaderTemplate [8]The sector header's first eight bytes, with no terminator: the signature, then a byte in the part id's place that the writer overwrites.
extern const Uint32LinkTestWordUnused: nothing in the game reads it.
extern const Uint8LinkTestDataA []Unused: two test messages left beside the link code; nothing sends them.
extern const Uint8LinkTestDataB []
extern void *OverlayArea []The scene group.
extern SERIAL_TRANSFER_STATESerialTransferThe serial group.
extern SERIAL_STATESerialStateWorkThe link cable's runtime state, which sySerialInit clears.
extern Uint16SerialExchangeActiveNonzero while the VBlank handler exchanges packets with the partner each tick; sySerialInit sets it.
extern Sint32SerialSendSourceThe data a block send reads from, 0 when none is under way (sySerialStartSend).
extern volatile Uint16SerialSendSizeBytes of the block send still to go: sySerialStartSend sets it and sySerialStepBlockTransfer, which the VBlank handler runs, counts it down.
extern Sint32SerialReceiveDestinationWhere a block receive writes, 0 when none is under way (sySerialStartReceive).
extern volatile Uint16SerialReceivedSizeBytes of the block receive taken so far: sySerialStepBlockTransfer, which the VBlank handler runs, counts it up while the link code polls it.
extern SERIAL_TRANSFER_STATESerialPeerPayloads [4]Each console's SERIAL_TRANSFER_STATE as last received, 24 bytes each.
extern volatile Uint8SerialBlockNumberThe block this console sends or expects next (SERIAL_BLOCK_NUMBER_MASK): sySerialStartSend and sySerialStartReceive reset it and sySerialStepBlockTransfer, which the VBlank handler runs, steps it.
extern Uint8LinkExchangeStateCleared by sySerialInit and by scLinkLobbyExchangePartyRecords; nothing reads it.
extern volatile Uint16LinkStatusWorkLink status, written by the VBlank exchange handler while sySerialWaitForStatusMask and the link screens poll it.
extern Uint8ScreenFadeToWhiteThe screen_fade group.
extern volatile Uint8ScreenFadeFramesvolatile: syScreenFadeUpdate, which the VBlank handler runs, clears it at the fade's end while syScreenFadeWait waits on it, so it is no device. the fade's length in frames, 0 when idle
extern volatile Uint8ScreenFadeFramesLeftvolatile: the fade starts set it for syScreenFadeUpdate, which the VBlank handler runs and which counts it down, so it is no device.
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 Uint8ScreenFadeTargetLevelvolatile: syScreenFadeStart sets it for syScreenFadeUpdate, which the VBlank handler runs, so it is no device. the brightness the fade ends at
extern Uint8 *SoundInfoPointerThe sound group.
extern struct MusicPlayerInfoMPlayInfoBGMPlays music; SOUND_FADE_OUT_BGM fades it and a jingle silences it until it ends.
extern struct MusicPlayerInfoMPlayInfoActionSEPlays the field's and the battle's action sounds (MUSIC_PLAYER_ACTION_SE); SOUND_FADE_OUT_ACTION_SE fades it.
extern struct MusicPlayerInfoMPlayInfoSE5One of the sound effects' shared players (MUSIC_PLAYER_SE5); both fades, SOUND_FADE_OUT_ACTION_SE and SOUND_FADE_OUT_EXIT_SE, fade it.
extern struct MusicPlayerInfoMPlayInfoJinglePlays jingles; the music returns once it stops.
extern Uint8MixerPcmBuffer []The mixer's PCM output: SoundDriverEnterVBlankUpdate hands it to IwramSoundMixEntry, and sySoundSetFixedSampleFrequency clears it and points DMA 1 at its start (the right speaker) and DMA 2 at its second half (the left).
extern Uint8IwramSoundMixWorkspace []The sound mixer's workspace at the top of IWRAM; the IWRAM heap ends where it starts (syHeapGetRemainingIWRAM).
extern Sint32SoundMixerClippedSet by the resident mixer whenever it clips a sample: when a sum overflows, its render loop saturates the pair of samples and stores the clip mask (0x80008000) here.
extern volatile struct SoundVBlankStateSoundVBlankStateWorkvolatile: the VBlank handler and the tick wait share it.
extern Uint16CurrentBgmThe music playing, which sySoundPlay sets from each music id it starts.
extern Uint8SoundFlags []One bit for each sound id, set once the sound has played (sySoundFlagSet); the link lobby offers only the tunes heard.
extern Uint16MusicPlayerLastSound []The sound effect from SOUND_SE_FIRST up each player last started, by player (MUSIC_PLAYER_COUNT of them); SOUND_FADE_OUT_ACTION_SE and SOUND_FADE_OUT_EXIT_SE clear the entries they fade.
extern Uint8BgmFadeRequestedNonzero once SOUND_FADE_OUT_BGM has started the music's fade; further fade requests are ignored until the next music clears it.
extern Uint16BgmVolumeThe music's volume, 8.8 fixed point (BGM_UNITY_SCALE is full), ramped toward BgmVolumeTarget by BgmVolumeStep each VBlank.
extern Uint16BgmVolumeTargetThe volume BgmVolume ramps toward.
extern Uint16BgmVolumeStepHow far BgmVolume moves each VBlank (BGM_DEFAULT_RAMP_STEP).
extern Uint8BgmRestoreDelayFrames after a jingle starts before the music waits for its end; held at 1 until the jingle's player stops, then 0.
extern Uint16BgmTempoPitchTargetThe tempo and pitch BgmTempoPitch ramps toward.
extern Uint16BgmTempoPitchThe music's combined tempo and pitch, 8.8 fixed point (BGM_UNITY_SCALE is the song's own), ramped toward BgmTempoPitchTarget by BgmTempoPitchStep each VBlank.
extern Uint16BgmTempoPitchStepHow far BgmTempoPitch moves each VBlank.
extern Uint8SoundCommandMaskSet by sySoundUpdateCommandMask; nothing reads it.
extern Uint8SoundUnreadByteAn EWRAM byte sySoundInit clears and nothing reads.
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.

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)

Called once by the next VBlank, which clears it first; the world map sets it to show its next picture.

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

Definition at line 219 of file globals.h.

Variables in detail

EventsRunning

extern volatile Uint8 EventsRunning

The event group. Events, their priorities and the event table, with room for 24 events. 1 while sySynch() runs the tick pass's events (EVENT_PASS_TICK).

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

Definition at line 22 of file globals.h.

EventsInitialized

extern Uint8 EventsInitialized

1 once the event table is set up

Referenced by syCountEventsInPass(), syExecuteEvent(), syInitEvent() and syRunPassBeforeTickEvents().

Definition at line 23 of file globals.h.

EventBuf

extern EVENT EventBuf[EVENT_COUNT]

The event table, run in priority order by each pass of sySynch().

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

Definition at line 26 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).

Referenced by syInstallIWRAMAndIRQs().

Definition at line 38 of file globals.h.

IwramResidentRom

extern const Uint8 IwramResidentRom[]

Where the IWRAM-resident code lies in ROM (ld_script.ld): 4 KB of it is copied to syIWRAMIRQMain at power-on.

Referenced by syInstallIWRAMAndIRQs().

Definition at line 41 of file globals.h.

IrqVector

extern void *IrqVector

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

Definition at line 43 of file globals.h.

ActorSpriteSlots

extern Uint8 ActorSpriteSlots[]

The heap_slots group. Two EWRAM buffers the battle engine shares with the field engine and the link screens. 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 btEnemySpriteLoadIntoSlots(), btMotionCallBeast(), btRun() and fdSpriteViewerRun().

Definition at line 49 of file globals.h.

LinkPeerSignatures

extern Uint16 LinkPeerSignatures[][12]

24 bytes a peer: where a link battle reads its partner's signature.

Referenced by btLinkBattleSyncTurn(), mnBattleCollectPartyCommands(), mnBattleMenuUpdateEachTick(), scClearReceiveByLink(), scLinkLobbyPeerSlotMatches(), scLinkLobbyPollPeerReady() and scTrialRoadMoveRival().

Definition at line 52 of file globals.h.

OamMatrixCount

extern Uint8 OamMatrixCount

The affine group. Sprite rotation and scaling: a sprite's transform and the OAM matrices this tick hands out for it. Matrices handed out this tick (syOAMMatrixAllocateFromTransform), up to 32; syOAMResetTick sets it back to 0 after each VBlank.

Referenced by syAffineMatrixBuild(), syOAMMatrixAllocateFromTransform() and syOAMResetTick().

Definition at line 58 of file globals.h.

OamMatrices

extern OAM_MATRIX OamMatrices[]

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

Referenced by syAffineMatrixBuild() and syOAMMatrixAllocateFromTransform().

Definition at line 60 of file globals.h.

BgScrollWork

extern BG_SCROLL BgScrollWork[]

The bg_scroll group. The four backgrounds' scroll offsets, written to the hardware each VBlank. 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 btCameraApplyVerticalShake(), btCameraSetRange(), btCameraShake(), btEffectAdvanceScrollOnInterval(), btEffectEndCanvasLayer(), btEffectOpenCanvasLayer(), btEffectRunAtalanta(), btEffectRunAttackSlash(), btEffectRunAzul(), btEffectRunBackgroundFadeIn(), btEffectRunBoreas(), btEffectRunCanvasBurst(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCloudSwirl(), btEffectRunCriticalHit(), btEffectRunCruelRuin(), btEffectRunDaedalus(), btEffectRunEclipse(), btEffectRunFlora(), btEffectRunFormChange(), btEffectRunGatheringLights(), btEffectRunGeode(), btEffectRunHaures(), btEffectRunIris(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunMegiddo(), btEffectRunMeteorBlow(), btEffectRunNeptune(), btEffectRunOdyssey(), btEffectRunRisingDragonEnemy(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectRunUlysses(), btEffectRunZagan(), btEffectSetupBlendedDisplay(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer(), btEffectStartElementStreaks(), btIrisChangeBackdrop(), btIrisDrawSplash(), btTransitionAdvanceOpening(), btTransitionRun(), fdLineScrollBuildPage(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdMapGridUpdateLayerScroll(), fdMapScreenDraw(), fdMapScreenShow() and 30 more.

Definition at line 66 of file globals.h.

RelocatedInnerProduct

extern const Uint32 RelocatedInnerProduct[]

The decompress group. The decoders and other ARM code the system library copies to RAM to run (RAM_CODE_LOAD). Such a function is declared as an array of bytes, and a symbol ending in CodeSize is the length of the copy: no object, but an address the linker sets equal to the length, which the loader reads by casting it to a number. syMatrixBuildLookAt's dot product, a Thumb entry and its ARM code: eight words it copies onto its stack to run.

Referenced by syMatrixBuildLookAt().

Definition at line 74 of file globals.h.

syDecompressTaggedLZArmCode

extern const Uint8 syDecompressTaggedLZArmCode[]

The tagged LZ decoder in ARM, run by syDecompressTaggedLZ from a heap copy.

Referenced by syDecompressTaggedLZ().

Definition at line 76 of file globals.h.

syDecompressTaggedLZCodeSize

extern Uint8 syDecompressTaggedLZCodeSize[]

The size of syDecompressTaggedLZArmCode, which syDecompressTaggedLZ copies to the heap.

Referenced by syDecompressTaggedLZ().

Definition at line 79 of file globals.h.

syDecompressMoveToFrontLZCommandsCode

extern const Uint8 syDecompressMoveToFrontLZCommandsCode[]

The move-to-front LZ decoder's command loop, run by syDecompressMoveToFrontLZ from a heap copy.

Referenced by syDecompressMoveToFrontLZ().

Definition at line 82 of file globals.h.

DecompressMoveToFrontLzCommandsCodeSize

extern Uint8 DecompressMoveToFrontLzCommandsCodeSize[]

The size of syDecompressMoveToFrontLZCommandsCode, which syDecompressMoveToFrontLZ copies to the heap (ld_script.ld).

Referenced by syDecompressMoveToFrontLZ().

Definition at line 85 of file globals.h.

ResourceDecodeByteLzCode

extern const Uint8 ResourceDecodeByteLzCode[]

The byte LZ decoder, run by syDecompressByteLZ from a heap copy.

Referenced by syDecompressByteLZ().

Definition at line 87 of file globals.h.

ResourceDecodeByteLzCodeSize

extern Uint8 ResourceDecodeByteLzCodeSize[]

The size of ResourceDecodeByteLzCode, which syDecompressByteLZ copies to the heap.

Referenced by syDecompressByteLZ().

Definition at line 90 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(), scInit() and scJupiterLighthouseFlickerBeam().

Definition at line 93 of file globals.h.

StubsSystem

extern const SYSTEM_STUB_TABLE StubsSystem

The stub group. The system module's stub table. The stub table of the system library's functions, which the world map's tilt reads for its arctangent.

Referenced by fdWorldMapUpdateAffineLines().

Definition at line 97 of file globals.h.

CreditsGreyColors

extern Uint16 CreditsGreyColors[]

The flash group. The SDK's flash library keeps its state in EWRAM (sdk/flash.h, sdk/flash_data.h); one of its metatiles has a name here too. The metatiles of the SDK's flash library from WaitForFlashWriteWork on, under a label of their own: the credits build a backdrop's grey colours there while no flash operation runs (mnCreditsLoadBackground).

Referenced by mnCreditsLoadBackground().

Definition at line 104 of file globals.h.

BuildStampWork

extern Sint32 BuildStampWork[]

The tick group. The tick loop's globals: the frames a tick takes, the CPU load display and the VBlank flags, which sySynch() (system/system_frame.c) and the VBlank handler share. 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 111 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(), fdSuperLuckyDiceRun(), gmMainRoutineRun(), mnCreditsRun(), mnTitleIntroRun(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), scInit(), syInit() and sySynch().

Definition at line 114 of file globals.h.

TickRenderPending

extern Uint8 TickRenderPending

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 117 of file globals.h.

CpuLoadDisplayEnabled

extern Uint8 CpuLoadDisplayEnabled

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

Referenced by btRun(), fdPsynergyEndRing(), fdPsynergyRing(), mnCreditsRun(), mnEndingImageStart(), mnTitleIntroRun(), scJupiterLighthouseFlashSky(), syInit() and sySynch().

Definition at line 119 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 121 of file globals.h.

LastTickFrames

extern Uint16 LastTickFrames

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

Referenced by btPlaybackRun(), mnMessageType() and sySynch().

Definition at line 123 of file globals.h.

CpuLoadTimer

extern Uint32 CpuLoadTimer

ticks CpuLoadPeak is still held

Referenced by sySynch().

Definition at line 124 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 128 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 130 of file globals.h.

IdleSleepEnabled

extern volatile Uint8 IdleSleepEnabled

Sleep after three idle minutes.

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

Definition at line 132 of file globals.h.

IdleTicks

extern volatile Uint16 IdleTicks

Ticks since a key was last held.

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

Definition at line 134 of file globals.h.

SleepRequested

extern volatile Uint8 SleepRequested

1: sleep this tick; more: count down to it.

Referenced by mnPauseMenuRun() and sySynch().

Definition at line 136 of file globals.h.

DebugMode

extern Uint8 DebugMode

Debug builds: Start+Select pauses the tick loop.

Referenced by btActionRunBuild(), fdActorFlyOnWorldMap(), fdActorMoveAsSand(), fdActorMoveAsSandOnWorldMap(), fdActorMoveByKeys(), fdActorMoveOnWorldMap(), fdActorSailOnMap(), fdActorSailOnWorldMap(), fdActorUpdateHoverControl(), fdActorUpdatePlayerControl(), fdActorUpdateWalkingControl(), fdEngineRun(), fdScriptUpdateDebugSkip(), fdSpriteViewerRun(), gmBuildStampGetTime(), gmMainRoutineRun(), mnBattleCollectPartyCommands(), mnPauseMenuChoose(), mnPauseMenuOpen(), scInit(), syInit() and sySynch().

Definition at line 138 of file globals.h.

DebugPaused

extern Uint8 DebugPaused

the debug pause is on

Referenced by fdLuckyWheelsUpdate() and sySynch().

Definition at line 139 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 141 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 syInit().

Definition at line 144 of file globals.h.

TickCount

extern Uint32 TickCount

Ticks sySynch() has finished.

Referenced by btGeyserDraw(), btMessageWaitForAdvance(), btMessageWaitForAdvanceAt(), btPlaybackRun(), fdActorBlink(), fdActorCycleSpriteColors(), fdActorFlyOnWorldMap(), fdActorMoveAsSand(), fdActorSetLayersColorMode(), fdActorUpdateBlink(), fdBlazeUpdateSpray(), fdEffectCycleActorAndSpawnArcs(), fdEffectFlickerActorAndSpawnArcs(), fdEffectRunSparkEmitter(), fdEffectUpdateFrostGlint(), fdEffectUpdateSparkles(), fdHangingVineSwing(), fdHoverGlowUpdate(), fdMapScreenUpdateMarkers(), fdMotesUpdate(), fdPaletteEditorRun(), fdPsynergyFadeToCastColor(), fdPsynergyStartMindReadWave(), fdPsynergySteerLiftedTarget(), fdPsynergySteerPushedTarget(), fdRetreatUpdateSpark(), fdRisingParticlesUpdate(), fdScreenTransitionUpdateFromCenter(), fdScreenTransitionUpdateScanlineTable(), fdSummonTabletPlayRunes(), fdWhirlwindCarryLeader(), fdWorldMapApplyAffinePage(), fdWorldMapInitPerspective(), fdWorldMapStartStillImage(), fdWorldMapUpdateAffineLines(), fdWorldMapUpdateRegionTint(), fdWorldMapUpdateView(), mnBattleCommandRowRun(), mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattlePsynergyMenuRun(), mnBattleStatusDrawPageArrows(), mnBattleStatusScreenRun(), mnBattleSummonMenuRun(), mnBattleTargetRunSelection(), mnEquipmentMenuUpdateCompatibilityIndicators(), mnIconMenuDrawIcons(), mnItemMenuRunList(), mnPageArrowsDraw(), mnTitleRunScrollStep() and 131 more.

Definition at line 146 of file globals.h.

PlayTimeTicks

extern Uint32 PlayTimeTicks

the play time clock, in ticks

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

Definition at line 147 of file globals.h.

VBlankDone

extern volatile Uint16 VBlankDone

volatile: the VBlank handler sets it while syWaitForVBlankInterrupt waits on it, so it is no device. Bit 0 is set by the VBlank handler; syWaitForVBlankInterrupt clears it and halts until it is set again.

Referenced by syVBlankHandler() and syWaitForVBlankInterrupt().

Definition at line 155 of file globals.h.

EwramHeap

extern Uint8 EwramHeap[]

The heap_release group. The heap's allocators and releases (system/system_heap.c). The EWRAM heap's space, 32 KB from 0x02030000.

Referenced by syHeapInit().

Definition at line 159 of file globals.h.

IwramHeap

extern Uint8 IwramHeap[]

The IWRAM heap's space, from 0x03001300 up to RamIwramHeapEnd.

Referenced by syHeapInit().

Definition at line 161 of file globals.h.

PerWork

extern INPUT_STATE PerWork

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

Referenced by btActionRunBuild(), btAdjustDebugValue(), btCameraAdjustByShoulderKeys(), btDebugBattleRunMenu(), btEffectReadKeysForEnemyTarget(), btEffectRunAtalanta(), btEffectRunAzul(), btEffectRunBackgroundFadeIn(), btEffectRunBoreas(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCloudSwirl(), btEffectRunCoatlicue(), btEffectRunCruelRuin(), btEffectRunCybele(), btEffectRunDaedalus(), btEffectRunDragonFire(), btEffectRunEclipse(), btEffectRunFlora(), btEffectRunHaures(), btEffectRunIris(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunMegaera(), btEffectRunMegiddo(), btEffectRunMeteorBlow(), btEffectRunMoloch(), btEffectRunNeptune(), btEffectRunNereid(), btEffectRunNereidCopy(), btEffectRunProcne(), btEffectRunRamses(), btEffectRunStarfieldFall(), btEffectRunThor(), btEffectRunUlysses(), btEffectRunZagan(), btMessageWaitForAdvance(), btMessageWaitForAdvanceAt(), btPlaybackRun(), dbIncreaseItemAndLevelRunLevelEditor(), dbIncreaseItemAndLevelSelectItem(), dbPsynergyTestBrowseMessageRange(), dbShopTestBrowseMessageRange(), dbShopTestRunLevelEditor(), dbShopTestSelectItem(), fdActorCrossRope(), fdActorCrossTightrope(), fdActorFlyOnWorldMap(), fdActorMoveAsSand(), fdActorMoveAsSandOnWorldMap() and 152 more.

Definition at line 164 of file globals.h.

IoWriteQueueWork

extern IO_WRITE_QUEUE IoWriteQueueWork

The io_write_queue group. The I/O write queue: register writes held until VBlank. IO_WRITE_QUEUE_PUSH and the store, set-bits and clear-bits writers (syIOWriteQueueStore16 and the rest in system.h) fill it, and syIOWriteQueueFlushPending empties it at VBlank.

Referenced by scSettlementsCycleWaterColors(), syInit() and syIOWriteQueueFlushPending().

Definition at line 170 of file globals.h.

CurrentMatrix

extern MATRIX CurrentMatrix

The matrix group. The current 3D matrix, its one-deep stack, and the unit matrix. The current 3D transform. syMultiMatrix multiplies the matrix it is given into it.

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

Definition at line 179 of file globals.h.

MatrixStackDepth

extern Sint32 MatrixStackDepth

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

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

Definition at line 182 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(), syMatrixRewindStack(), syPopMatrix() and syPushMatrix().

Definition at line 185 of file globals.h.

OamUsageWork

extern OAM_USAGE OamUsageWork

The oam group. The tick's OAM list. The OAM entries the tick's list holds and the most it may; sySynch() empties it each tick.

Referenced by syInit(), sySynch() and syVBlankHandler().

Definition at line 189 of file globals.h.

ProjectionWork

extern PROJECTION ProjectionWork

The projection group. The 3D projection the battle engine and the field engine draw with (syPerspective, syConvert3Dto2D). The projection the battle engine and the field engine draw with (IWRAM).

Referenced by btCameraApplyVerticalShake(), btCameraSetCommandView(), btCameraSetView(), btCameraSetViewAtDepth(), btCameraShake(), btEffectEndCanvasLayer(), btEffectRunAtalanta(), btEffectRunBoreas(), btEffectRunCatastrophe(), btEffectRunCharon(), btEffectRunCoatlicue(), btEffectRunCruelRuin(), btEffectRunCrystal(), btEffectRunDaedalus(), btEffectRunDjinniCharge(), btEffectRunDjinniSign(), btEffectRunEclipse(), btEffectRunFlora(), btEffectRunFormChange(), btEffectRunGaspFamily(), btEffectRunHaures(), btEffectRunIris(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunMegiddo(), btEffectRunMeteorBlow(), btEffectRunNeptune(), btEffectRunProcne(), btEffectRunRisingDragonEnemy(), btEffectRunSabreDance(), btEffectRunSerac(), btEffectRunStarfieldFall(), btEffectRunThor(), btEffectRunTumblingQuads(), btEffectRunTwistingColumn(), btEffectRunUlysses(), btEffectRunWindFunnel(), btEffectRunZagan(), btEffectSetupBlendedDisplay(), btIrisChangeBackdrop(), btIrisRestoreBattle(), fdCameraResetViewDefaults(), fdSuperLuckyDiceResetViewDefaults(), fdWorldMapBuildScanlineTable(), fdWorldMapInitPerspective(), fdWorldMapUpdateAffineLines(), fdWorldMapUpdateView(), syConvert3Dto2D(), syPerspective() and sySetScreenDist().

Definition at line 194 of file globals.h.

BattleRandomSeed

extern Sint32 BattleRandomSeed

The random group. The battle engine's own random numbers. gmBattleRandom's seed, apart from syRandom's so the battle's rolls repeat on both consoles of a link battle: it starts at 0 there, and each turn the parent (link side 0) copies RandWork into it and sends it to the child.

Referenced by gmBattleRandom().

Definition at line 200 of file globals.h.

MapShapeGrid

extern Uint8 MapShapeGrid[]

The map's shape grid, a byte a metatile, which fdMapGridLoadMap decodes from the map header's shapes and the field's actor metatiles read.

Referenced by fdActorLiftTargetBlock(), fdActorPlaceBlocks(), fdFlagBlockApplyFlags(), fdMapCopyMetatileAttributeRect(), fdMapCopyRawMetatilesRect(), fdMapGridCheckCollision(), fdMapGridCheckCollisionAbove(), fdMapGridCheckCollisionAt(), fdMapGridGetTerrainHeight(), fdMapGridGetTerrainHeightAbove(), fdMapGridGetTerrainKind(), fdMapGridGetTerrainKindAt(), fdMapGridGetTerrainKindOrBumpAt(), fdMapGridLoadMap(), fdMapGridSetMetatileHeight(), fdMapLoadMetatilesAndShapes(), scCrumblingPillarPlace(), scCrumblingPillarPlaceWithStandIn(), scMagmaRockInsideRestoreCrumblingPillars(), scMagmaRockInsideRestorePillars(), scMagmaRockRestoreCrumblingPillars(), scTaopoSwampFocusMapOn(), scTrialRoadCopyMetatilesBackward(), scYampiDesertStepOffStakeTops() and scYampiDesertStepOntoStakeTops().

Definition at line 210 of file globals.h.

MetatileTiles

extern Uint32 MetatileTiles[]

The layout's metatile tiles, 32 KB of EWRAM at 0x02020000: each metatile's tiles 8 bytes, its top two tile entries, then its bottom two. fdMapGridLoadMap decodes them in.

Referenced by fdTileMapDecodeStagedBuffer(), fdWorldMapGetBattleEnvironment(), fdWorldMapGetBlockMetatileBehavior() and scWorldMapLeaveShip().

Definition at line 215 of file globals.h.

SceneLocalState

extern Sint8 SceneLocalState[]

A scene's own state in EWRAM, which each scene lays out as it needs.

Referenced by fdDjinnJoinParty(), fdRequestDjinnBattle(), fdScriptSpawnActorTable(), gmMainRoutineStateInitDefaults(), gmPartyAddIsaacsParty() and mnSaveBuildFileSummary().

Definition at line 222 of file globals.h.

MainRoutineStateWork

extern MAIN_ROUTINE_STATE MainRoutineStateWork

The game's state (MAIN_ROUTINE_STATE).

Referenced by btAbilityApplyToTarget(), btAwardSpoils(), btDebugBattleRunMenu(), btFleeCheckSuccess(), btPartyPrepareMembers(), btPartyPrepareReserveOwners(), btPartySwapInReserves(), btRun(), btSpoilsClear(), dbIncreaseItemAndLevelRunLevelEditor(), dbIncreaseItemAndLevelShowName(), dbPsynergyTest2RaiseStatue(), dbPsynergyTestFightMadPlant(), dbPsynergyTestGiveTreasureTestStock(), dbPsynergyTestRaiseStatue(), dbPsynergyTestShowRings(), dbShopTestGiveEquipmentTestStock(), dbShopTestRaiseStatue(), dbShopTestRunLevelEditor(), dbShopTestTalkToSunshinesWife(), EFFECT_SPAWN, fdActorFlyOnWorldMap(), fdActorGetCueMetatileAheadOfCurrent(), fdActorLaunchFromLeader(), fdActorMoveOnWorldMap(), fdActorPlaceBlocks(), fdActorResetForLeader(), fdActorSailOnMap(), fdActorSailOnWorldMap(), fdActorSetMovementType(), fdActorSetOthersPaused(), fdActorStartMovementModeScript(), fdActorTakeLeaderLayer(), fdActorUpdateHoverControl(), fdActorUpdatePlayerControl(), fdActorUpdateWalkingControl(), fdAvoidUpdateRingBackHalf(), fdAvoidUpdateRingFrontHalf(), fdBattleBackgroundGetSelected(), fdBattleBackgroundSelectForEnvironment(), fdBattleBackgroundSelectForMap(), fdCheckConfiguredKeys(), fdChooseMusic(), fdClimbDown(), fdClimbUp(), fdDjinnJoinParty(), fdDjinnResolvePending(), fdDjinnRestoreActorAfterBattle(), fdDjinnRunBattleStartHop(), fdDjinnRunJupiterJoinEffect() and 1117 more.

Definition at line 228 of file globals.h.

PartyDjinnRecovery

extern Uint8 PartyDjinnRecovery[]

MainRoutineStateWork from its summonMask on, under a label of its own: the party's DJINN_RECOVERY_TABLE, which gmDjinnGetRecoveryTable returns. Lucky Wheels reads its won prizes 320 bytes in (REEL_SAVE).

Referenced by fdLuckyWheelsRun() and fdLuckyWheelsUpdate().

Definition at line 232 of file globals.h.

GameFlagBytes

extern Uint8 GameFlagBytes[]

The game flags, 4096 bits in 512 bytes, saved with the game: flag n is bit n & 7 of byte GAME_FLAG_BYTE(n).

Referenced by gmMainRoutineStateInitDefaults(), mnSaveBuildFileSummary(), scClearEnterPassword(), scClearReceiveByLink(), syGameFlagClear(), syGameFlagDecrementByte(), syGameFlagGet(), syGameFlagGetByte(), syGameFlagGetNibble(), syGameFlagIncrementByte(), syGameFlagSet(), syGameFlagSetByte(), syGameFlagSetNibble() and syGameFlagToggle().

Definition at line 235 of file globals.h.

InventorySnapshot

extern Uint8 InventorySnapshot[]

The party's inventories, shortcuts and order as gmInventorySnapshotSave puts them aside for the Trial Road, with spare room after them.

Referenced by gmInventorySnapshotRestore() and gmInventorySnapshotSave().

Definition at line 238 of file globals.h.

RareItemStock

extern Uint8 RareItemStock[]

How many of each rare item the shops may still sell, 0 to 99, by counter number (ITEM_COUNTER_COUNT of them; ItemRareItemCounters, gmRareItemStockAdjust).

Referenced by gmRareItemStockAdjust().

Definition at line 242 of file globals.h.

BgTileBuffer

extern Uint8 BgTileBuffer[]

32 KB of EWRAM holding background tiles, such as the world map's char blocks 2 and 3.

Referenced by fdWorldMapEndStillImage(), fdWorldMapLoadAreaGraphics(), fdWorldMapPreloadCurrentTileBlock() and fdWorldMapStartStillImage().

Definition at line 246 of file globals.h.

MapGridShapes

extern Uint8 MapGridShapes[]

The map's shape table, 16 KB of EWRAM: 4-byte entries that a map metatile's shape indexes.

Referenced by fdMapShapeFindOrAdd(), fdWorldMapPreloadCurrentTileBlock(), scApojiiIslandsAddMetatileMarkers(), scAquaRockInsideAddSpouts() and scGabombaStatueDrawCogMetatiles().

Definition at line 249 of file globals.h.

DecodeBuffer

extern Uint8 DecodeBuffer[]

16 KB of EWRAM that pictures and tiles are decoded into before they are copied on.

Referenced by fdTileMapDrawRowsFromRam() and fdWorldMapStartStillImage().

Definition at line 252 of file globals.h.

MapGridAnimationTiles

extern Uint8 MapGridAnimationTiles[]

The tileset animations' tiles, 16 KB of EWRAM.

Referenced by fdMapGridLoadMap(), fdWorldMapLoadAreaGraphics(), fdWorldMapLoadGraphics() and fdWorldMapPreloadCurrentTileBlock().

Definition at line 254 of file globals.h.

MapScene

extern Uint8 MapScene[]

The map's scene data in EWRAM, loaded from its resource: its entrance stream, then from the halfword offsets after it its edits and its bounds.

Referenced by fdMapApplyFlagEdits(), fdMapApplySetFlagEdits(), fdPlaceAtEntrance() and fdWorldMapInitPerspective().

Definition at line 257 of file globals.h.

MapSceneEditsOffset

extern Uint8 MapSceneEditsOffset[]

The scene data's halfword offset of its edits, from MapScene.

Referenced by fdMapApplyFlagEdits() and fdMapApplySetFlagEdits().

Definition at line 259 of file globals.h.

MapSceneBoundsOffset

extern Uint8 MapSceneBoundsOffset[]

The scene data's halfword offset of its bounds, from MapScene.

Referenced by fdPlaceAtEntrance().

Definition at line 261 of file globals.h.

MapScenePoints

extern Uint8 MapScenePoints[]

The scene data's points table, in EWRAM at 0x0202e008.

Definition at line 263 of file globals.h.

TitleIntroLogoTileBuffer

extern Uint8 TitleIntroLogoTileBuffer[]

Where each of The Lost Age's pictures is unpacked before it is copied into sprite tiles.

Definition at line 267 of file globals.h.

EffectScratch

extern Uint8 EffectScratch[]

The battle effects' blocks in the map metatile buffer, which they borrow while no map is loaded. The map metatile buffer from its second 16 KB on, which some effects borrow as scratch: no map is loaded during a battle.

Referenced by btEffectRunFlora() and btEffectRunLiquifier().

Definition at line 272 of file globals.h.

SeracMeshEnd

extern Uint8 SeracMeshEnd[]

Nirvana's mesh's end, after 112 faces.

Referenced by btEffectRunSerac().

Definition at line 274 of file globals.h.

FloraPetalTiles

extern Uint16 FloraPetalTiles[]

Inside EffectScratch: FLORA_PETAL_WORK from its second tile number on, read at its fixed place.

Definition at line 277 of file globals.h.

FloraSpritePalettes

extern Uint16 FloraSpritePalettes[]

Inside EffectScratch: FLORA_PETAL_WORK.palette, the object palette as it fades.

Referenced by btEffectRunFlora().

Definition at line 280 of file globals.h.

HauresMoundStrip

extern Uint8 HauresMoundStrip[]

In the map metatile buffer: Haures's mound's faces, eight bytes a quad.

Referenced by btEffectRunHaures().

Definition at line 282 of file globals.h.

HauresMoundStripEnd

extern Uint8 HauresMoundStripEnd[]

The face after Haures's mound's last, which ends the strip.

Referenced by btEffectRunHaures().

Definition at line 284 of file globals.h.

HauresMoundShades

extern Uint8 HauresMoundShades[]

In the map metatile buffer: each of Haures's mound corners' shade.

Referenced by btEffectRunHaures().

Definition at line 286 of file globals.h.

IrisTileBuffer

extern Uint8 IrisTileBuffer[]

In the map metatile buffer: the tiles Iris draws its sprites from.

Referenced by btEffectRunIris().

Definition at line 288 of file globals.h.

WorldMapStateWork

extern WORLD_MAP_STATE WorldMapStateWork

The world map's and the map screen's state in EWRAM. The map screen's state while it is open.

Referenced by fdMapScreenDraw(), fdMapScreenRelease(), fdMapScreenShow(), fdWorldMapLoadAreaGraphics(), fdWorldMapLoadGraphics() and fdWorldMapPreloadCurrentTileBlock().

Definition at line 292 of file globals.h.

MapScreenChoice

extern WORLD_MAP_CHOICE MapScreenChoice

The destination last chosen on the world map (WORLD_MAP_CHOICE).

Referenced by fdMapScreenShow().

Definition at line 294 of file globals.h.

ScanlineAngle

extern Uint32 ScanlineAngle

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

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

Definition at line 297 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 299 of file globals.h.

MapScreenFirstListOnly

extern Sint16 MapScreenFirstListOnly

Never set (EWRAM, zero from boot). Set, the map screen would list only the places before the first end of the place table, not the second list from entry 128 on, and show each place's second marker (the high nibble of its value).

Open question (no evidence in reach): what the switch was for; no edition, debug room or other code writes it, so the game never shows it set.

Referenced by fdMapScreenUpdateMarkers() and fdWorldMapPlaceGetMarker().

Definition at line 305 of file globals.h.

MapScreenGlideTargetX

extern Sint32 MapScreenGlideTargetX

Where the map screen's cursor glides to on its own, 16.16; 0 when it does not.

Referenced by fdMapScreenShow() and fdMapScreenUpdateMarkers().

Definition at line 308 of file globals.h.

MapScreenGlideTargetY

extern Sint32 MapScreenGlideTargetY

As MapScreenGlideTargetX, the second coordinate.

Referenced by fdMapScreenShow() and fdMapScreenUpdateMarkers().

Definition at line 310 of file globals.h.

MapScreenZoomed

extern Sint16 MapScreenZoomed

Nonzero while the map screen is zoomed in.

Referenced by fdMapScreenDrawRow(), fdMapScreenShow(), fdMapScreenUpdateMarkers() and fdMapScreenUpdateScroll().

Definition at line 312 of file globals.h.

MapScreenNameRedrawPending

extern Sint16 MapScreenNameRedrawPending[]

Set while the place name waits to be drawn again.

Referenced by fdMapScreenUpdateMarkers().

Definition at line 314 of file globals.h.

MapScreenNameRedrawDelay

extern Sint16 MapScreenNameRedrawDelay[]

Ticks before the place name is drawn again.

Referenced by fdMapScreenUpdateMarkers().

Definition at line 316 of file globals.h.

MapScreenCursorMarker

extern WORLD_MAP_MARKER MapScreenCursorMarker

The map screen's cursor marker.

Referenced by fdMapScreenUpdateMarkers().

Definition at line 318 of file globals.h.

MapScreenCursor

extern FIXED *MapScreenCursor

The world map cursor's position (x, then y, 16.16 pixels).

Referenced by fdMapScreenUpdateScroll().

Definition at line 320 of file globals.h.

MapScreenCursorStartX

extern Sint32 MapScreenCursorStartX

Where the cursor goes back to when Start is let go: the place R or L last stepped to, 16.16 pixels.

Referenced by fdMapScreenShow().

Definition at line 323 of file globals.h.

MapScreenCursorStartY

extern Sint32 MapScreenCursorStartY

As MapScreenCursorStartX.

Referenced by fdMapScreenShow().

Definition at line 325 of file globals.h.

MapScreenScrollX

extern Sint32 MapScreenScrollX

The map screen's scroll as Select toggles the zoom, 16.16 pixels.

Referenced by fdMapScreenShow().

Definition at line 327 of file globals.h.

MapScreenScrollY

extern Sint32 MapScreenScrollY

As MapScreenScrollX.

Referenced by fdMapScreenShow().

Definition at line 329 of file globals.h.

CreditsPendingSlides

extern Sint16 CreditsPendingSlides

The credits' state in EWRAM. Slides the crawl has released for the slideshow to show next; the slideshow waits while there are none.

Referenced by mnCreditsRun() and mnCreditsUpdateCrawlSprites().

Definition at line 333 of file globals.h.

DisplayScrollObjects

extern struct DISPLAY_SCROLL_OBJECT *DisplayScrollObjects

The credits' sprite buffer, copied to OAM each tick: the border strips' sprites, then the text's.

Referenced by mnCreditsInitCrawlSprites(), mnCreditsInitTextSpritesAtPage(), mnCreditsStopTextSprites(), mnCreditsUpdateCrawlSprites() and mnCreditsUpdateTextSprites().

Definition at line 336 of file globals.h.

DisplayScrollBusy

extern Sint16 DisplayScrollBusy

0 while the credits text scrolls; once a line stops it, the line's stop (1 at a page mark, which A or B releases), then counted up each tick after the end (CREDITS_TICKS_AFTER_END).

Referenced by mnCreditsDrawEnteringCrawlLine(), mnCreditsDrawEnteringLine(), mnCreditsInitCrawlSprites(), mnCreditsInitTextSpritesAtPage(), mnCreditsRun() and mnCreditsUpdateCrawlSprites().

Definition at line 340 of file globals.h.

DisplayScrollLastPosition

extern Sint16 DisplayScrollLastPosition

DisplayScrollPosition when the credits last drew a line.

Referenced by mnCreditsDrawEnteringCrawlLine(), mnCreditsDrawEnteringLine(), mnCreditsInitCrawlSprites() and mnCreditsInitTextSpritesAtPage().

Definition at line 342 of file globals.h.

DisplayScrollPosition

extern Uint16 DisplayScrollPosition

How far the credits text has scrolled, in pixels: one every four frames, faster while B is held.

Referenced by mnCreditsDrawEnteringCrawlLine(), mnCreditsDrawEnteringLine(), mnCreditsInitCrawlSprites(), mnCreditsInitTextSpritesAtPage(), mnCreditsUpdateCrawlSprites() and mnCreditsUpdateTextSprites().

Definition at line 345 of file globals.h.

EndingImageBlock

extern Sint16 EndingImageBlock

Which character block the image is in.

Referenced by mnEndingImageScroll(), mnEndingImageShow() and mnEndingImageStart().

Definition at line 351 of file globals.h.

EndingImageFadeFrames

extern Sint16 EndingImageFadeFrames

Frames of the fade-in, to 64.

Referenced by mnEndingImageScroll() and mnEndingImageShow().

Definition at line 353 of file globals.h.

EndingImageMapScroll

extern Uint32 EndingImageMapScroll

The tilemap's scroll, 16.16 pixels.

Referenced by CopyScrollMap(), mnEndingImageCopyMap(), mnEndingImageScroll() and mnEndingImageStart().

Definition at line 355 of file globals.h.

EndingImageScroll

extern volatile Sint32 EndingImageScroll

The scroll, 16.16 pixels.

Referenced by CopyScrollMap(), mnEndingImageCopyMap(), mnEndingImageScroll(), mnEndingImageStart() and mnEndingImageWaitForScroll().

Definition at line 357 of file globals.h.

EndingImageTargetRow

extern Sint16 EndingImageTargetRow

The row a scene asks for (mnEndingImageSetTargetRow); Row moves toward it.

Referenced by CopyScrollMap(), mnEndingImageCopyMap(), mnEndingImageScroll(), mnEndingImageSetTargetRow() and mnEndingImageStart().

Definition at line 359 of file globals.h.

EndingImageRow

extern Sint16 EndingImageRow

The row the scroll is heading for.

Referenced by CopyScrollMap(), mnEndingImageCopyMap(), mnEndingImageScroll(), mnEndingImageStart() and mnEndingImageWaitForScroll().

Definition at line 361 of file globals.h.

EndingImageSpeed

extern Sint16 EndingImageSpeed

The most rows a tick moves.

Referenced by mnEndingImageScroll() and mnEndingImageStart().

Definition at line 363 of file globals.h.

EndingImageMap

extern Uint8 *EndingImageMap

The image's map.

Referenced by mnEndingImageScroll(), mnEndingImageShow() and mnEndingImageStart().

Definition at line 365 of file globals.h.

EndingImageStrips

extern void *EndingImageStrips

The 24 sprites of the image's border strips.

Referenced by mnEndingImageDrawStrips(), mnEndingImageInitStrips() and mnEndingImageLowerTopStrip().

Definition at line 367 of file globals.h.

TitleBattleOptionEnabled

extern Sint16 TitleBattleOptionEnabled

The File Screen's options in EWRAM. Nonzero offers Battle on the File Screen, when a file has any game flag counted in its summary (mnSaveScanFileSummaries).

Referenced by mnFileListSelectAction() and mnSaveScanFileSummaries().

Definition at line 372 of file globals.h.

TitleUpdateOptionEnabled

extern Sint16 TitleUpdateOptionEnabled

Nonzero offers Update on the File Screen, when a file has a party whose summary is not marked reunited (mnSaveScanFileSummaries).

Referenced by mnFileListSelectAction() and mnSaveScanFileSummaries().

Definition at line 375 of file globals.h.

BupSlot

extern Sint16 BupSlot

The save group. The save in flash: its sectors, parts and summaries, and the save's state. The current save file, or -1 for none (a new game).

Referenced by gmMainRoutineStateInitDefaults(), mnSaveChooseAndLoadFile(), mnSaveToChosenFile(), mnSaveToFile() and mnSaveWriteLinkTallies().

Definition at line 379 of file globals.h.

AnyFileCleared

extern Sint16 AnyFileCleared

1 when a save file on the cartridge holds a cleared game, as the save screen finds on loading the summaries; a new game keeps it in MainRoutineStateWork.clearedFileAtStart.

Referenced by gmMainRoutineStateInitDefaults(), mnSaveScanFileSummaries(), scInit() and scLinkLobbyTakeSongRequest().

Definition at line 383 of file globals.h.

BupBuffer

extern Uint8 BupBuffer[]

The buffer a save file is built in and written from, in two halves; its summary's 16-byte header lies just before it.

Referenced by mnSaveBuildFileSummary(), mnSaveChooseAndLoadFile(), mnSaveCopyFile(), mnSaveToChosenFile(), mnSaveToFile(), mnSaveWriteFile() and mnSaveWriteLinkTallies().

Definition at line 386 of file globals.h.

OverlayArea

extern void *OverlayArea[]

The scene group. The running scene's overlay area, a field position, and the area name a scene and entrance show. The running scene's overlay, loaded into this EWRAM at each scene change; its code opens with its entry table.

Referenced by gmLoadOverlay() and gmTakeExit().

Definition at line 400 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, exchanged with the partner's each VBlank (sySerialExchangePayloads).

Referenced by btClearSerialTransferPayload(), btLinkBattleSyncTurn(), btLinkBattleWaitSync(), mnBattleCollectPartyCommands(), scClearReceiveByLink(), scInit(), scLinkLobbyEnterBattle(), scLinkLobbyPollPeerReady(), scLinkLobbyWriteSlotValue(), scLobbyResetTransferState(), syLinkBattleResetTransferState(), sySerialStartReceive(), sySerialStartSend(), sySerialStepBlockTransfer() and syVBlankHandler().

Definition at line 405 of file globals.h.

SerialStateWork

extern SERIAL_STATE SerialStateWork

The link cable's runtime state, which sySerialInit clears.

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

Definition at line 407 of file globals.h.

SerialExchangeActive

extern Uint16 SerialExchangeActive

Nonzero while the VBlank handler exchanges packets with the partner each tick; sySerialInit sets it.

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

Definition at line 410 of file globals.h.

SerialSendSource

extern Sint32 SerialSendSource

The data a block send reads from, 0 when none is under way (sySerialStartSend).

Referenced by scLobbyResetTransferState(), syLinkBattleResetTransferState(), sySerialGetActiveTransfers(), sySerialInit(), sySerialStartSend(), sySerialStepBlockTransfer(), sySerialWaitForSend() and sySerialWaitForTransfers().

Definition at line 413 of file globals.h.

SerialSendSize

extern volatile Uint16 SerialSendSize

Bytes of the block send still to go: sySerialStartSend sets it and sySerialStepBlockTransfer, which the VBlank handler runs, counts it down.

Referenced by scLobbyResetTransferState(), syLinkBattleResetTransferState(), sySerialInit(), sySerialStartSend() and sySerialStepBlockTransfer().

Definition at line 416 of file globals.h.

SerialReceiveDestination

extern Sint32 SerialReceiveDestination

Where a block receive writes, 0 when none is under way (sySerialStartReceive).

Referenced by scClearReceiveByLink(), scLobbyResetTransferState(), syLinkBattleResetTransferState(), sySerialGetActiveTransfers(), sySerialInit(), sySerialStartReceive(), sySerialStepBlockTransfer(), sySerialTestRun(), sySerialWaitForReceive() and sySerialWaitForTransfers().

Definition at line 419 of file globals.h.

SerialReceivedSize

extern volatile Uint16 SerialReceivedSize

Bytes of the block receive taken so far: sySerialStepBlockTransfer, which the VBlank handler runs, counts it up while the link code polls it.

Referenced by btAppendLinkedActions(), scClearReceiveByLink(), scLinkLobbyReceivePartyRecords(), scLobbyResetTransferState(), syLinkBattleResetTransferState(), sySerialInit(), sySerialStartReceive() and sySerialStepBlockTransfer().

Definition at line 422 of file globals.h.

SerialPeerPayloads

extern SERIAL_TRANSFER_STATE SerialPeerPayloads[4]

Each console's SERIAL_TRANSFER_STATE as last received, 24 bytes each.

Referenced by btLinkBattleWaitSync(), sySerialStepBlockTransfer() and syVBlankHandler().

Definition at line 424 of file globals.h.

SerialBlockNumber

extern volatile Uint8 SerialBlockNumber

The block this console sends or expects next (SERIAL_BLOCK_NUMBER_MASK): sySerialStartSend and sySerialStartReceive reset it and sySerialStepBlockTransfer, which the VBlank handler runs, steps it.

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

Definition at line 428 of file globals.h.

LinkExchangeState

extern Uint8 LinkExchangeState

Cleared by sySerialInit and by scLinkLobbyExchangePartyRecords; nothing reads it.

Referenced by scLinkLobbyExchangePartyRecords() and sySerialInit().

Definition at line 431 of file globals.h.

LinkStatusWork

extern volatile Uint16 LinkStatusWork

Link status, written by the VBlank exchange handler while sySerialWaitForStatusMask and the link screens poll it.

Referenced by btAppendLinkedActions(), btCameraUpdate(), btLinkBattleSyncTurn(), btLinkBattleWaitSync(), btRun(), mnBattleCollectPartyCommands(), scClearReceiveByLink(), scLinkLobbyPeerSlotMatches(), scLinkLobbyReceivePartyRecords(), scLinkLobbySendPartyRecords(), scTrialRoadMoveRival(), sySerialStepBlockTransfer(), sySerialWaitForStatusMask() and syVBlankHandler().

Definition at line 434 of file globals.h.

ScreenFadeToWhite

extern Uint8 ScreenFadeToWhite

The screen_fade group. The screen fade's state, which syScreenFadeUpdate steps from the VBlank handler. Which way the screen fade goes: 0 towards black, 1 towards white.

Referenced by syScreenFadeFromBlack(), syScreenFadeFromWhite(), syScreenFadeStart(), syScreenFadeToBlack(), syScreenFadeToWhite() and syScreenFadeUpdate().

Definition at line 439 of file globals.h.

ScreenFadeFrames

extern volatile Uint8 ScreenFadeFrames

volatile: syScreenFadeUpdate, which the VBlank handler runs, clears it at the fade's end while syScreenFadeWait waits on it, so it is no device. the fade's length in frames, 0 when idle

Referenced by syScreenFadeFromBlack(), syScreenFadeFromWhite(), syScreenFadeStart(), syScreenFadeToBlack(), syScreenFadeToWhite(), syScreenFadeUpdate(), syScreenFadeWait() and syVBlankHandler().

Definition at line 443 of file globals.h.

ScreenFadeFramesLeft

extern volatile Uint8 ScreenFadeFramesLeft

volatile: the fade starts set it for syScreenFadeUpdate, which the VBlank handler runs and which counts it down, so it is no device. Frames until the running fade reaches its target.

Referenced by syScreenFadeFromBlack(), syScreenFadeFromWhite(), syScreenFadeStart(), syScreenFadeToBlack(), syScreenFadeToWhite() and syScreenFadeUpdate().

Definition at line 447 of file globals.h.

ScreenFadeLayers

extern Uint16 ScreenFadeLayers

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

Referenced by syScreenFadeFromBlack(), syScreenFadeFromWhite(), syScreenFadeStart(), syScreenFadeToBlack(), syScreenFadeToWhite() and syScreenFadeUpdate().

Definition at line 449 of file globals.h.

ScreenFadeStartLevel

extern Uint8 ScreenFadeStartLevel

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

Referenced by syScreenFadeFromBlack(), syScreenFadeFromWhite(), syScreenFadeStart(), syScreenFadeToBlack(), syScreenFadeToWhite() and syScreenFadeUpdate().

Definition at line 451 of file globals.h.

ScreenFadeTargetLevel

extern volatile Uint8 ScreenFadeTargetLevel

volatile: syScreenFadeStart sets it for syScreenFadeUpdate, which the VBlank handler runs, so it is no device. the brightness the fade ends at

Referenced by syScreenFadeFromBlack(), syScreenFadeFromWhite(), syScreenFadeStart(), syScreenFadeToBlack(), syScreenFadeToWhite() and syScreenFadeUpdate().

Definition at line 454 of file globals.h.

SoundInfoPointer

extern Uint8 *SoundInfoPointer

The sound group. The game's sound state in EWRAM and IWRAM; the sound driver's own work is declared in sdk/sound_driver.h. The sound driver's state as the tick wait runs it, as bytes rather than through struct SoundInfo: that struct's transferCountdown is volatile, so through it the tick wait would read the countdown twice, to test it and again to count it down, where the game reads it once for both. Where the sound driver finds its state (SOUND_INFO_PTR): a pointer to SoundInfoWork, whose bytes the tick wait reads.

Referenced by syVBlankHandler() and syWaitForVBlankInterrupt().

Definition at line 464 of file globals.h.

MPlayInfoBGM

extern struct MusicPlayerInfo MPlayInfoBGM

Plays music; SOUND_FADE_OUT_BGM fades it and a jingle silences it until it ends.

Referenced by sySoundPlay(), sySoundSetBGMPitch(), sySoundSetBGMTempo(), sySoundSetBGMVolume() and sySoundUpdateBGMRamps().

Definition at line 467 of file globals.h.

MPlayInfoActionSE

extern struct MusicPlayerInfo MPlayInfoActionSE

Plays the field's and the battle's action sounds (MUSIC_PLAYER_ACTION_SE); SOUND_FADE_OUT_ACTION_SE fades it.

Referenced by sySoundPlay().

Definition at line 470 of file globals.h.

MPlayInfoSE5

extern struct MusicPlayerInfo MPlayInfoSE5

One of the sound effects' shared players (MUSIC_PLAYER_SE5); both fades, SOUND_FADE_OUT_ACTION_SE and SOUND_FADE_OUT_EXIT_SE, fade it.

Referenced by sySoundPlay().

Definition at line 473 of file globals.h.

MPlayInfoJingle

extern struct MusicPlayerInfo MPlayInfoJingle

Plays jingles; the music returns once it stops.

Referenced by sySoundUpdateBGMRamps().

Definition at line 475 of file globals.h.

MixerPcmBuffer

extern Uint8 MixerPcmBuffer[]

The mixer's PCM output: SoundDriverEnterVBlankUpdate hands it to IwramSoundMixEntry, and sySoundSetFixedSampleFrequency clears it and points DMA 1 at its start (the right speaker) and DMA 2 at its second half (the left).

Referenced by sySoundSetFixedSampleFrequency().

Definition at line 480 of file globals.h.

IwramSoundMixWorkspace

extern Uint8 IwramSoundMixWorkspace[]

The sound mixer's workspace at the top of IWRAM; the IWRAM heap ends where it starts (syHeapGetRemainingIWRAM).

Referenced by syHeapGetRemainingIWRAM().

Definition at line 483 of file globals.h.

SoundMixerClipped

extern Sint32 SoundMixerClipped

Set by the resident mixer whenever it clips a sample: when a sum overflows, its render loop saturates the pair of samples and stores the clip mask (0x80008000) here. Only the sound test reads it.

Referenced by sySoundTestRun().

Definition at line 487 of file globals.h.

SoundVBlankStateWork

extern volatile struct SoundVBlankState SoundVBlankStateWork

volatile: the VBlank handler and the tick wait share it. Who runs the sound update this tick: the tick wait or the VBlank handler.

Referenced by sySoundPlay(), sySoundTestRun(), syVBlankHandler() and syWaitForVBlankInterrupt().

Definition at line 490 of file globals.h.

CurrentBgm

extern Uint16 CurrentBgm

The music playing, which sySoundPlay sets from each music id it starts.

Referenced by sySoundGetCurrentBGM(), sySoundInit() and sySoundPlay().

Definition at line 492 of file globals.h.

SoundFlags

extern Uint8 SoundFlags[]

One bit for each sound id, set once the sound has played (sySoundFlagSet); the link lobby offers only the tunes heard.

Referenced by sySoundFlagClear(), sySoundFlagSet() and sySoundFlagTest().

Definition at line 495 of file globals.h.

MusicPlayerLastSound

extern Uint16 MusicPlayerLastSound[]

The sound effect from SOUND_SE_FIRST up each player last started, by player (MUSIC_PLAYER_COUNT of them); SOUND_FADE_OUT_ACTION_SE and SOUND_FADE_OUT_EXIT_SE clear the entries they fade.

Referenced by sySoundInit() and sySoundPlay().

Definition at line 499 of file globals.h.

BgmFadeRequested

extern Uint8 BgmFadeRequested

Nonzero once SOUND_FADE_OUT_BGM has started the music's fade; further fade requests are ignored until the next music clears it.

Referenced by sySoundInit() and sySoundPlay().

Definition at line 502 of file globals.h.

BgmVolume

extern Uint16 BgmVolume

The music's volume, 8.8 fixed point (BGM_UNITY_SCALE is full), ramped toward BgmVolumeTarget by BgmVolumeStep each VBlank.

Referenced by sySoundInit(), sySoundPlay(), sySoundSetBGMVolume() and sySoundUpdateBGMRamps().

Definition at line 505 of file globals.h.

BgmVolumeTarget

extern Uint16 BgmVolumeTarget

The volume BgmVolume ramps toward.

Referenced by sySoundInit(), sySoundPlay(), sySoundSetBGMVolume(), sySoundSetBGMVolumeTarget() and sySoundUpdateBGMRamps().

Definition at line 507 of file globals.h.

BgmVolumeStep

extern Uint16 BgmVolumeStep

How far BgmVolume moves each VBlank (BGM_DEFAULT_RAMP_STEP).

Referenced by sySoundInit(), sySoundPlay(), sySoundSetBGMVolumeTarget() and sySoundUpdateBGMRamps().

Definition at line 509 of file globals.h.

BgmRestoreDelay

extern Uint8 BgmRestoreDelay

Frames after a jingle starts before the music waits for its end; held at 1 until the jingle's player stops, then 0.

Referenced by sySoundGetBGMRestoreDelay(), sySoundInit(), sySoundPlay(), sySoundUpdateBGMRamps() and sySoundWaitForBGMRestore().

Definition at line 512 of file globals.h.

BgmTempoPitchTarget

extern Uint16 BgmTempoPitchTarget

The tempo and pitch BgmTempoPitch ramps toward.

Referenced by sySoundInit(), sySoundSetBGMTempoPitchTarget() and sySoundUpdateBGMRamps().

Definition at line 514 of file globals.h.

BgmTempoPitch

extern Uint16 BgmTempoPitch

The music's combined tempo and pitch, 8.8 fixed point (BGM_UNITY_SCALE is the song's own), ramped toward BgmTempoPitchTarget by BgmTempoPitchStep each VBlank.

Referenced by sySoundInit() and sySoundUpdateBGMRamps().

Definition at line 518 of file globals.h.

BgmTempoPitchStep

extern Uint16 BgmTempoPitchStep

How far BgmTempoPitch moves each VBlank.

Referenced by sySoundInit(), sySoundSetBGMTempoPitchTarget() and sySoundUpdateBGMRamps().

Definition at line 520 of file globals.h.

SoundCommandMask

extern Uint8 SoundCommandMask

Set by sySoundUpdateCommandMask; nothing reads it.

Referenced by sySoundInit() and sySoundUpdateCommandMask().

Definition at line 522 of file globals.h.

SoundUnreadByte

extern Uint8 SoundUnreadByte

An EWRAM byte sySoundInit clears and nothing reads.

Referenced by sySoundInit().

Definition at line 524 of file globals.h.

VramCacheBlockOwners

extern Uint8 VramCacheBlockOwners[VRAM_BLOCK_COUNT]

The vram_cache group. The VRAM cache's entries and the blocks they own. The cache entry that owns each block, or VRAM_BLOCK_OWNER_FREE.

Referenced by fdActorSailOnMap(), fdEngineRun(), fdResourceTableCountFreeBlocks(), syVRAMCacheAllocateBlocks(), syVRAMCacheCountFreeBlocks(), syVRAMCacheFreeBlocks(), syVRAMCacheGetLongestFreeRun() and syVRAMCacheReset().

Definition at line 528 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 btEffectRunAtalanta(), btEffectRunCharon(), btEffectRunDaedalus(), btEffectRunHaures(), btEffectRunIris(), btEffectRunNeptune(), btEffectSpriteCreateWithTiles(), btGeyserDraw(), btPlaybackRun(), dbPsynergyTestStartRings(), fdActorSailOnMap(), fdAvoidDropRing(), fdBattleEffectSpawnScaledArcObjects(), fdBlankOverlayDrawMarks(), fdEffectSpriteInitWithFadeOverlay(), fdEffectSpriteInitWithFadeOverlayBlended(), fdFadeOverlayDrawMarks(), fdHangingVineDraw(), fdMapScreenInit(), fdMapScreenUpdateMarkers(), fdRopeDraw(), fdSpriteCreate(), fdSpriteDissolveStep(), fdTightropeDraw(), mnBattleStatusScreenRun(), mnIconLoadSlots(), mnIconMenuDrawIcons(), mnItemIconGridLoadItems(), mnWindowSpriteCreate(), scAirsRockInsidePoundStake(), scAirsRockInsideStepOntoStake(), scAnkohlRuinsDrawSand(), scApojiiIslandsDrawMetatileMarkers(), scAquaRockDrawFallingBubbles(), scAquaRockDrawRisingBubbles(), scAquaRockInsideDrawPillars(), scAquaRockInsideDrawSplashes(), scContigoStartSparkle(), scCrackedTileUpdate(), scGabombaStatueDrawClock(), scGabombaStatueDrawRaisedBlocks(), scGaugeUpdate(), scLightSpritesDraw(), scMarsLighthouseAerieStartRisingRings(), scMarsLighthouseEntranceDrawHoleMask(), scShamanVillageUpdateLettering(), scStaffCreditSpawnGrowingPair(), scTitleUpdateSpriteReveal(), scTrialRoadDrawFountains(), scTrialRoadDrawRaceMap() and 8 more.

Definition at line 530 of file globals.h.

On this page

FunctionsVariablesDescriptionFunctions in detailUserFunctionVariables in detailEventsRunningEventsInitializedEventBufsyIWRAMIRQMainIwramResidentRomIrqVectorActorSpriteSlotsLinkPeerSignaturesOamMatrixCountOamMatricesBgScrollWorkRelocatedInnerProductsyDecompressTaggedLZArmCodesyDecompressTaggedLZCodeSizesyDecompressMoveToFrontLZCommandsCodeDecompressMoveToFrontLzCommandsCodeSizeResourceDecodeByteLzCodeResourceDecodeByteLzCodeSizeDecodeFillByteStubsSystemCreditsGreyColorsBuildStampWorkOamCopyEnabledTickRenderPendingCpuLoadDisplayEnabledTickFramesLastTickFramesCpuLoadTimerCpuLoadPeakSleepDisabledIdleSleepEnabledIdleTicksSleepRequestedDebugModeDebugPausedResetRequestedCartridgeResetMarkerTickCountPlayTimeTicksVBlankDoneEwramHeapIwramHeapPerWorkIoWriteQueueWorkCurrentMatrixMatrixStackDepthMatrixStackTopOamUsageWorkProjectionWorkBattleRandomSeedMapShapeGridMetatileTilesSceneLocalStateMainRoutineStateWorkPartyDjinnRecoveryGameFlagBytesInventorySnapshotRareItemStockBgTileBufferMapGridShapesDecodeBufferMapGridAnimationTilesMapSceneMapSceneEditsOffsetMapSceneBoundsOffsetMapScenePointsTitleIntroLogoTileBufferEffectScratchSeracMeshEndFloraPetalTilesFloraSpritePalettesHauresMoundStripHauresMoundStripEndHauresMoundShadesIrisTileBufferWorldMapStateWorkMapScreenChoiceScanlineAngleScanlinePitchMapScreenFirstListOnlyMapScreenGlideTargetXMapScreenGlideTargetYMapScreenZoomedMapScreenNameRedrawPendingMapScreenNameRedrawDelayMapScreenCursorMarkerMapScreenCursorMapScreenCursorStartXMapScreenCursorStartYMapScreenScrollXMapScreenScrollYCreditsPendingSlidesDisplayScrollObjectsDisplayScrollBusyDisplayScrollLastPositionDisplayScrollPositionEndingImageBlockEndingImageFadeFramesEndingImageMapScrollEndingImageScrollEndingImageTargetRowEndingImageRowEndingImageSpeedEndingImageMapEndingImageStripsTitleBattleOptionEnabledTitleUpdateOptionEnabledBupSlotAnyFileClearedBupBufferOverlayAreaSerialTransferSerialStateWorkSerialExchangeActiveSerialSendSourceSerialSendSizeSerialReceiveDestinationSerialReceivedSizeSerialPeerPayloadsSerialBlockNumberLinkExchangeStateLinkStatusWorkScreenFadeToWhiteScreenFadeFramesScreenFadeFramesLeftScreenFadeLayersScreenFadeStartLevelScreenFadeTargetLevelSoundInfoPointerMPlayInfoBGMMPlayInfoActionSEMPlayInfoSE5MPlayInfoJingleMixerPcmBufferIwramSoundMixWorkspaceSoundMixerClippedSoundVBlankStateWorkCurrentBgmSoundFlagsMusicPlayerLastSoundBgmFadeRequestedBgmVolumeBgmVolumeTargetBgmVolumeStepBgmRestoreDelayBgmTempoPitchTargetBgmTempoPitchBgmTempoPitchStepSoundCommandMaskSoundUnreadByteVramCacheBlockOwnersVramCacheEntries