frame.h
games/tbs/include/frame.h on GitHub
Globals
gFrameRenderPending
extern u8 gFrameRenderPending
Set by WaitFrames once it has built a frame's OAM list; the VBlank handler then copies the list, the BG scroll and the queued register writes, and clears it.
Used by System_VBlankHandler, WaitFrames.
gOamCopyEnabled
extern u8 gOamCopyEnabled
The VBlank handler copies the OAM list only while it is set; scenes clear it to keep their own sprites on screen.
Used by DisplayScroll_RunSlideshow, LuckyDice_Run, ReelGame_Run, System_Initialize, System_VBlankHandler, Title_ShowAnimatedSplash, Title_ShowIntro, Title_ShowSplashScreen, TolbiSpring_Initialize.
gLagFrameCount
extern u16 gLagFrameCount
VBlanks since WaitFrames last started a frame: 1 when the frame took one.
Used by System_VBlankHandler, WaitFrames.
gCpuLoadTimer
extern u32 gCpuLoadTimer
Frames gCpuLoadPeak is still held.
Used by WaitFrames.
gCpuLoadPeak
extern u32 gCpuLoadPeak
The highest CPU load in the last 30 frames: the scanline the frame's work ended on, plus 256 for each frame it overran.
Used by WaitFrames.
gFrameTick
extern u32 gFrameTick
Counted up by every VBlank.
Used by AltmillerCave_UpdateWallFragment, BattleEffect_UpdatePhasedRadialParticle, BattleEvent_Playback, BattleFx_SetObjectAlternatingWords, BattleFx_UpdateRadialSpread, DisplayScroll_StepPositionEveryFourFrames, DisplayScroll_UpdateObjects, Map_BuildProbeRing, NameEntry_EditOwnerName, PaletteGlow_UpdateSine, RenderOutput_BobPair, SelectionScreen_Draw, SelectionScreen_DrawArrow, System_VBlankHandler, UiWork_AnimateSpriteSlots, Ui_ApplyTableScaleToObject.
gDebugMode
extern u8 gDebugMode
Debug builds: Start+Select pauses the frame loop.
Used by Battle_CollectPartyCommands, Event_UpdateDebugSkip, FieldObject_UpdatePlayerControl, Field_RunScene, Game_ResetForNewGame, Menu_RunWorkspaceSelectionLoop, Object_MoveOnWorldMap, SaveMenu_Run, SystemMenu_Open, System_Initialize, Ui_RunIconMonitor, WaitFrames, WorldMap_UpdateLocationContacts.
gDebugPaused
extern u8 gDebugPaused
The debug pause is on.
Used by ReelGame_RunFrame, Title_UpdateIntroSprites, WaitFrames.
gResetRequested
extern u8 gResetRequested
Set by the keypad interrupt; WaitFrames performs the soft reset.
Used by Input_HandleKeyInterrupt, WaitFrames.
gCartridgeResetMarker
extern u32 gCartridgeResetMarker
Written by the soft reset just before it restarts the cartridge, and cleared by System_Initialize; nothing else reads it.
Used by Runtime_GetRemainingIwram, System_Initialize, System_SoftReset.
gPlayTimeFrames
extern u32 gPlayTimeFrames
The play time clock, in frames.
Used by SaveState_BuildSummaryHeader, SaveState_LoadRecordIntoWork, WaitFrames.
gSavedStackSize
extern u32 gSavedStackSize
Bytes of the caller's stack WaitFrames has copied into gSavedStack, or 0.
Used by WaitFrames.
gSavedStack
extern u8 gSavedStack[]
The caller's stack below the frame-wait stack top, while WaitFrames runs.
Used by WaitFrames.
Also, globals without a comment: gCpuLoadDisplayEnabled, gLagFramesShown, gVBlankDone, gFrameCount, gSleepDisabled, gIdleSleepEnabled, gSleepRequested, gIdleFrames, gSleepComboFrames.
Declarations
gVBlankHook
extern void (*gVBlankHook)(void)
Run once by the next VBlank handler, which clears it first.