32 }
while (remaining >= 0);
40 for (index = 0; index < byteCount; index++)
41 *destination++ = *source++;
64 for (index = 0; index < pass; index++) {
66 memcpy(&saved, task,
sizeof(saved));
67 memcpy(task, task + 1,
sizeof(saved));
68 memcpy(task + 1, &saved,
sizeof(saved));
80 u32 savedInterruptMaster;
103 u32 savedInterruptState;
148 u32 savedInterruptMaster;
158 task->
state = 0x7fff;
174 u32 savedInterruptMaster;
199 u32 savedInterruptMaster;
207 if ((task->
callback >> 24) == 2 && (task->
mask & 1) == 0) {
222 u32 savedInterruptMaster;
245 u32 savedInterruptMaster;
267 u32 savedInterruptMaster;
298 if (--remaining == 0)
#define TASK_STATE_HIGH(task)
struct SchedulerTask gSchedulerTaskTable[]
u8 gSchedulerReady
1 once the task table is set up
volatile u8 gSchedulerStatus
void(*) SchedulerCallback(void)
@ SCHEDULER_TBS_TASK_COUNT
#define IRQ_UNLOCK(saved)
Restores the IME value saved by IRQ_LOCK.
#define IRQ_LOCK(saved)
Disables interrupts and saves IME in saved; IRQ_UNLOCK restores it.
What every part of the runtime object shares: its includes and the library call two parts make.
s32 Scheduler_ResumeTasks(SchedulerCallback callback)
Resumes the task running callback, or every task when callback is null, by clearing bit 0 of its orde...
s32(*) KeyCallbackFn(void)
s32 Scheduler_AddOrUpdateCallback(SchedulerCallback callback, s32 order)
Schedules callback with order, or gives a task already running it the new order, and re-sorts the tab...
void Scheduler_ResetTaskTable(void)
Empties the task table: every slot gets no routine, order 0xffff (sorted last) and no flags.
void Scheduler_RunPass(s32 key)
Runs one pass of the scheduler: every task whose order's high byte matches key's (SCHEDULER_KEY_MAIN_...
UNUSED void Scheduler_CopyWords(u32 *destination, u32 *source, u32 byteCount)
Copies byteCount bytes a word at a time. Nothing in ☀️ calls it.
s32 Scheduler_SuspendTasks(SchedulerCallback callback)
Suspends the task running callback, or every task when callback is null, by setting bit 0 of its orde...
s32 Scheduler_ResumeOverlayTasks(void)
Resumes every task whose routine is in an overlay, flagged or not.
s32 Scheduler_SuspendOverlayTasks(void)
Suspends every task whose routine is in an overlay (EWRAM, 0x02xxxxxx) unless its flag bit 0 asks to ...
UNUSED void Scheduler_Idle(void)
An empty routine; nothing in ☀️ calls it.
void Scheduler_SortTasks(void)
Bubble-sorts the task table by order, highest first, so each pass runs its tasks from the highest ord...
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
UNUSED s32 Scheduler_FindCallback(SchedulerCallback callback)
Returns the table index of the task running callback, or -1.
s32 Scheduler_SetTaskFlags(SchedulerCallback callback, u32 mask)
Stores mask as the flags of the task running callback; bit 0 keeps it running while the overlay tasks...
UNUSED void Scheduler_EmptyCallback(void)
An empty routine; nothing in ☀️ calls it.
A scheduled task: its routine's address, its order (see SCHEDULER_KEY_) and its flags,...
void * memcpy(void *destination, const void *source, unsigned long size)