src/system/system_event.c
Events: per-tick and VBlank functions in priority order. More…
Included by system.c.
Typedefs
| Name | Description | |
|---|---|---|
typedef Sint32 (* | EVENT_INT_FUNC )(void); |
Functions
| Name | Description | |
|---|---|---|
void | syInitEvent (void) | Empties the event table: every slot gets no function, priority EVENT_PRIORITY_EMPTY and no flags. |
void | syCopyEventWords (Uint32 *dest, Uint32 *src, Uint32 byteCount) | Unused: copies byteCount bytes a word at a time. |
void | sySortEvents (void) | Bubble-sorts the event table by priority, highest first, so each pass runs its events from the highest priority down; removed events (EVENT_PRIORITY_REMOVED) rise to the front. |
Sint32 | syFindEvent (EVENT_FUNC callback) | Unused: returns the table index of the event running callback, or -1. |
Sint32 | sySetEvent (EVENT_FUNC callback, Sint32 priority) | Adds an event running callback with priority priority, or gives an event already running it the new priority, and re-sorts the table. |
void | syEventNoOperationA (void) | Unused: an empty function. |
void | syEventNoOperationB (void) | Unused: an empty function. |
Sint32 | syCloseEvent (EVENT_FUNC callback) | Removes the event running callback: clears its function and gives it priority EVENT_PRIORITY_REMOVED, which no pass matches. |
Sint32 | sySuspendEvent (EVENT_FUNC callback) | Suspends the event running callback, or every event when callback is null, by setting EVENT_SUSPENDED in its priority's high byte, which then matches neither pass. |
Sint32 | sySuspendOverlayEvents (void) | Suspends every event whose function is in an overlay (EVENT_IN_OVERLAY) unless its EVENT_FLAG_KEEP_RUNNING asks to keep it running, as sySuspendEvent does. |
Sint32 | sySetEventFlags (EVENT_FUNC callback, Uint32 mask) | Stores mask as the flags of the event running callback; EVENT_FLAG_KEEP_RUNNING keeps it running while the overlay events are suspended. |
Sint32 | syResumeEvent (EVENT_FUNC callback) | Resumes the event running callback, or every event when callback is null, by clearing EVENT_SUSPENDED in its priority's high byte. |
Sint32 | syResumeOverlayEvents (void) | Resumes every event whose function is in an overlay, flagged or not. |
void | syExecuteEvent (Sint32 pass) | Runs one pass of the events: every event whose priority's high byte matches pass's (EVENT_PASS_TICK or EVENT_PASS_VBLANK), in table order. |
Description
Events: per-tick and VBlank functions in priority order. Part of system.c.
Typedefs in detail
EVENT_INT_FUNC
typedef Sint32 (*EVENT_INT_FUNC)(void);
Definition at line 4 of file system_event.c.
Functions in detail
syInitEvent
void syInitEvent(void)
Empties the event table: every slot gets no function, priority
EVENT_PRIORITY_EMPTY and no flags.
References EventBuf, EventsInitialized, EventsRunning and Sint32.
Referenced by btDebugBattleRunMenu(), btRun(), fdEngineRun(), fdLuckyDiceRun(), fdLuckyWheelsRun(), fdSpriteViewerRun(), gmMainRoutineRun(), mnCreditsRun(), mnTitleShowCamelotLogo(), mnTitleShowPublisherLogo(), mnTitleShowTitleScreen() and syInit().
Definition at line 12 of file system_event.c.
syCopyEventWords
void syCopyEventWords(Uint32 *dest, Uint32 *src, Uint32 byteCount)
Unused: copies byteCount bytes a word at a time.
Definition at line 30 of file system_event.c.
sySortEvents
void sySortEvents(void)
Bubble-sorts the event table by priority, highest first, so each pass runs
its events from the highest priority down; removed events
(EVENT_PRIORITY_REMOVED) rise to the front.
References EventBuf, memcpy() and Sint32.
Referenced by sySetEvent().
Definition at line 41 of file system_event.c.
syFindEvent
Sint32 syFindEvent(EVENT_FUNC callback)
Unused: returns the table index of the event running callback, or -1.
References EventBuf and Sint32.
Definition at line 73 of file system_event.c.
sySetEvent
Sint32 sySetEvent(EVENT_FUNC callback, Sint32 priority)
Adds an event running callback with priority priority, or gives an event
already running it the new priority, and re-sorts the table.
References EventBuf, EventsRunning, Sint32 and sySortEvents().
Referenced by btBackgroundLoad(), btBackgroundSetMode(), btEffectOpenCanvasLayer(), btEffectRunAnnihilation(), btEffectRunAstralBlast(), btEffectRunAtalanta(), btEffectRunBoreas(), btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunCriticalHit(), btEffectRunCurse(), btEffectRunDeathPlunge(), btEffectRunDouse(), btEffectRunFire(), btEffectRunFlare(), btEffectRunFroth(), btEffectRunGatheringLights(), btEffectRunHaunt(), btEffectRunHealingMotes(), btEffectRunIce(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunOrbitingSkulls(), btEffectRunProjectileVolley(), btEffectRunRamses(), btEffectRunShiningStar(), btEffectRunStarfieldFall(), btEffectRunStatBoost(), btEffectRunTargetMotes(), btEffectRunThor(), btEffectRunThorn(), btEffectRunTorch(), btEffectRunUnusedOrbitingSpirals(), btEffectStartCanvasLayer(), btEffectStartElementStreaks(), btElementGlowInitStarField(), btHighlightSetModes(), btPlaybackSchedulePhase(), btRun(), btStagingRunAttack(), btStagingRunFullScreen(), btStagingRunItem(), btStagingRunPsynergyCast(), btTransitionRun(), fdActorSystemInit(), fdBlendScriptStart(), fdEffectInitSlots(), fdEffectInitSparkles() and 63 more.
Definition at line 97 of file system_event.c.
syEventNoOperationA
void syEventNoOperationA(void)
Unused: an empty function.
Definition at line 143 of file system_event.c.
syEventNoOperationB
void syEventNoOperationB(void)
Unused: an empty function.
Definition at line 148 of file system_event.c.
syCloseEvent
Sint32 syCloseEvent(EVENT_FUNC callback)
Removes the event running callback: clears its function and gives it
priority EVENT_PRIORITY_REMOVED, which no pass matches. Returns its old
index, or -1.
References EventBuf and Sint32.
Referenced by btCastingImpactEndPrelude(), btEffectEndCanvasLayer(), btEffectEndElementStreaks(), btEffectRunAnnihilation(), btEffectRunAtalanta(), btEffectRunAttackSlash(), btEffectRunBind(), btEffectRunBoreas(), btEffectRunCastingImpact(), btEffectRunCondemn(), btEffectRunCriticalHit(), btEffectRunCybele(), btEffectRunDjinnBeams(), btEffectRunDjinniEntrance(), btEffectRunDouse(), btEffectRunDragonFire(), btEffectRunElementBurst(), btEffectRunElementPillar(), btEffectRunFire(), btEffectRunFlare(), btEffectRunFlashingStrike(), btEffectRunFlurry(), btEffectRunFrost(), btEffectRunFroth(), btEffectRunGaia(), btEffectRunGatheringLights(), btEffectRunHaunt(), btEffectRunIce(), btEffectRunImpactBurst(), btEffectRunNeptune(), btEffectRunNereid(), btEffectRunShatteringOpening(), btEffectRunSpiderWeb(), btEffectRunStarfieldFall(), btEffectRunStatBoost(), btEffectRunTargetMotes(), btEffectRunTargetStrike(), btEffectRunThor(), btEffectRunTorch(), btEffectRunUndeadSword(), btEffectRunUnusedOrbitingSpirals(), btEffectRunUnusedTriangleStrike(), btEffectRunVolcano(), btEffectRunWhirlwind(), btElementGlowEnd(), btHighlightSetModes(), btPlaybackWaitForReady(), btRun(), btTransitionRun(), fdEffectReleaseSlots() and 106 more.
Definition at line 155 of file system_event.c.
sySuspendEvent
Sint32 sySuspendEvent(EVENT_FUNC callback)
Suspends the event running callback, or every event when callback is
null, by setting EVENT_SUSPENDED in its priority's high byte, which then
matches neither pass.
References EventBuf and Sint32.
Referenced by btRun(), fdActorSystemSuspendProjectionAndShowSprites(), fdBlendScriptSuspend(), fdGroundMaskSuspend(), fdScreenTransitionSuspendCallbacks(), fdTilesetAnimationSuspendAll() and fdWorldMapStartStillImage().
Definition at line 182 of file system_event.c.
sySuspendOverlayEvents
Sint32 sySuspendOverlayEvents(void)
Suspends every event whose function is in an overlay (EVENT_IN_OVERLAY)
unless its EVENT_FLAG_KEEP_RUNNING asks to keep it running, as sySuspendEvent
does.
References EventBuf and Sint32.
Referenced by fdWorldMapZoomOutWhileLHeld() and mnSuspendFieldEvents().
Definition at line 209 of file system_event.c.
sySetEventFlags
Sint32 sySetEventFlags(EVENT_FUNC callback, Uint32 mask)
Stores mask as the flags of the event running callback;
EVENT_FLAG_KEEP_RUNNING keeps it running while the overlay events are
suspended. Returns its index, or -1.
References EventBuf and Sint32.
Referenced by scBattleArenaEnterBattle() and scInit().
Definition at line 236 of file system_event.c.
syResumeEvent
Sint32 syResumeEvent(EVENT_FUNC callback)
Resumes the event running callback, or every event when callback is null,
by clearing EVENT_SUSPENDED in its priority's high byte.
References EventBuf and Sint32.
Referenced by fdActorSystemResumeProjectionAndHideLayers(), fdBlendScriptResume(), fdGroundMaskResume(), fdTilesetAnimationResumeAll(), fdWorldMapLoadAreaGraphics() and fdWorldMapLoadDefaultMetatilesAndUpdateBlock().
Definition at line 261 of file system_event.c.
syResumeOverlayEvents
Sint32 syResumeOverlayEvents(void)
Resumes every event whose function is in an overlay, flagged or not. Returns the last index changed, or -1.
References EventBuf and Sint32.
Referenced by fdWorldMapZoomOutWhileLHeld() and mnResumeFieldEvents().
Definition at line 285 of file system_event.c.
syExecuteEvent
void syExecuteEvent(Sint32 pass)
Runs one pass of the events: every event whose priority's high byte matches
pass's (EVENT_PASS_TICK or EVENT_PASS_VBLANK), in table order.
References EventBuf, EventsInitialized and Sint32.
Referenced by sySynch() and syVBlankHandler().
Definition at line 309 of file system_event.c.