Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
registry.c File Reference
#include "engine/game.h"
Include dependency graph for registry.c:

Go to the source code of this file.

Macros

#define SetSpadStack(addr)    __asm__ volatile("move $8,%0\n\tsw $29,0($8)\n\taddiu $8,$8,-16\n\tmove $29,$8" : : "r"(addr) : "$8", "memory")
 The update runs with its stack in the scratchpad.
 
#define ResetSpadStack()   __asm__ volatile("addiu $29,$29,16\n\tlw $29,0($29)" : : : "memory")
 

Functions

void clearTaskRegistry (void)
 Forgets every registered task.
 
void registerTask (Task *task)
 Adds a task to the first free entry of the registry (ignored when it is full)
 
void unregisterTask (Task *task)
 Removes a task from the registry.
 
void * findNextTask (void)
 The next registered task that matches findTask's id and keys (-1 matches anything), or NULL.
 
void * findTask (s32 id, s32 key1, s32 key2)
 The first registered task that matches (-1 matches anything), or NULL.
 
Task * executeTask (Task *task)
 One frame of a task and its children; returns NULL once the task is gone.
 
void runChildTasks (Task *task)
 Runs a frame of each child of a task, dropping the ones that end.
 
Task * runTask (Task *task)
 Runs a frame of a task and its children; returns it, or NULL once it is gone.
 
void killTask (Task *task)
 Ends a task now: its last update and destroy run at once.
 

Variables

TaskRegistry TASK_REGISTRY
 

Macro Definition Documentation

◆ SetSpadStack

#define SetSpadStack (   addr)     __asm__ volatile("move $8,%0\n\tsw $29,0($8)\n\taddiu $8,$8,-16\n\tmove $29,$8" : : "r"(addr) : "$8", "memory")

The update runs with its stack in the scratchpad.

Definition at line 65 of file registry.c.

◆ ResetSpadStack

#define ResetSpadStack ( )    __asm__ volatile("addiu $29,$29,16\n\tlw $29,0($29)" : : : "memory")

Definition at line 67 of file registry.c.

Function Documentation

◆ clearTaskRegistry()

void clearTaskRegistry ( void  )

Forgets every registered task.

Definition at line 4 of file registry.c.

◆ registerTask()

void registerTask ( Task *  task)

Adds a task to the first free entry of the registry (ignored when it is full)

Definition at line 13 of file registry.c.

◆ unregisterTask()

void unregisterTask ( Task *  task)

Removes a task from the registry.

Definition at line 26 of file registry.c.

◆ findNextTask()

void * findNextTask ( void  )

The next registered task that matches findTask's id and keys (-1 matches anything), or NULL.

Definition at line 39 of file registry.c.

Referenced by findTask().

Here is the caller graph for this function:

◆ findTask()

void * findTask ( s32  id,
s32  key1,
s32  key2 
)

The first registered task that matches (-1 matches anything), or NULL.

Definition at line 56 of file registry.c.

Here is the call graph for this function:

◆ executeTask()

Task * executeTask ( Task *  task)

One frame of a task and its children; returns NULL once the task is gone.

Definition at line 70 of file registry.c.

Referenced by runChildTasks(), and runTask().

Here is the caller graph for this function:

◆ runChildTasks()

void runChildTasks ( Task *  task)

Runs a frame of each child of a task, dropping the ones that end.

Definition at line 94 of file registry.c.

Here is the call graph for this function:

◆ runTask()

Task * runTask ( Task *  task)

Runs a frame of a task and its children; returns it, or NULL once it is gone.

Definition at line 107 of file registry.c.

Here is the call graph for this function:

◆ killTask()

void killTask ( Task *  task)

Ends a task now: its last update and destroy run at once.

Definition at line 115 of file registry.c.

Variable Documentation

◆ TASK_REGISTRY

TaskRegistry TASK_REGISTRY
Initial value:
= {
.funcs = {
},
}
void clearTaskRegistry(void)
Forgets every registered task.
Definition registry.c:4
Task * runTask(Task *task)
Runs a frame of a task and its children; returns it, or NULL once it is gone.
Definition registry.c:107
void unregisterTask(Task *task)
Removes a task from the registry.
Definition registry.c:26
void registerTask(Task *task)
Adds a task to the first free entry of the registry (ignored when it is full)
Definition registry.c:13
void * findNextTask(void)
The next registered task that matches findTask's id and keys (-1 matches anything),...
Definition registry.c:39
void runChildTasks(Task *task)
Runs a frame of each child of a task, dropping the ones that end.
Definition registry.c:94
void killTask(Task *task)
Ends a task now: its last update and destroy run at once.
Definition registry.c:115
void * findTask(s32 id, s32 key1, s32 key2)
The first registered task that matches (-1 matches anything), or NULL.
Definition registry.c:56

Definition at line 122 of file registry.c.

Referenced by addModel(), clearTaskRegistry(), createTaskWithId(), destroyTask(), endBattleOnKnockOut(), executeTask(), fadeInStageLights(), FIELDSTG_balloonCommand(), FIELDSTG_closeField(), FIELDSTG_countBattleSteps(), FIELDSTG_drainTrail(), FIELDSTG_findActor(), FIELDSTG_findActorAt(), FIELDSTG_findHiddenSpot(), FIELDSTG_followLeader(), FIELDSTG_followWithCamera(), FIELDSTG_haltPartners(), FIELDSTG_handleFieldCommand(), FIELDSTG_isTileFree(), FIELDSTG_leaveFieldAfter(), FIELDSTG_openInn(), FIELDSTG_pickViewTiles(), FIELDSTG_pointCamera(), FIELDSTG_resumePartners(), FIELDSTG_runEvent(), FIELDSTG_runLaunch(), FIELDSTG_scrollCamera(), FIELDSTG_searchEventSpot(), FIELDSTG_setEventPose(), FIELDSTG_shakeCamera(), FIELDSTG_startActorGauge(), FIELDSTG_startAreaBattle(), FIELDSTG_startEncounter(), FIELDSTG_startEvent(), FIELDSTG_startListedEvent(), FIELDSTG_startWarp(), FIELDSTG_talkToActorAt(), FIELDSTG_updateBalloon(), FIELDSTG_updateCamera(), FIELDSTG_updateLift(), FIELDSTG_updateSpotEffect(), FIELDSTG_updateTriggers(), FIGHTSTG_getEnemyView(), FIGHTSTG_getFighterView(), FIGHTSTG_isPlayerChoosing(), FIGHTSTG_runScriptCamera(), FIGHTSTG_runScriptStage(), FIGHTSTG_setPlayerTurnStep(), FIGHTSTG_updateBattleScript(), FIGHTSTG_updateCameraShots(), FIGHTSTG_updateCameraTurn(), FIGHTSTG_updateDigimonChange(), FIGHTSTG_updateEntrance(), FIGHTSTG_updateHitEffect(), FIGHTSTG_updatePartnerView(), FIGHTSTG_updateShotCamera(), fillEffectLists(), findNextTask(), findTask(), handleCommand807(), handleCommand814(), killTask(), main(), registerTask(), removeModel(), showActorIcon(), startEvent8000(), startEvent8001(), startEvent8002(), unregisterTask(), updateEvent9015(), updateRisers(), updateTileLift(), updateTileTimer(), WFIGHTMN_blast(), WFIGHTMN_setIdleMotion(), and WFIGHTTS_motionList().