Alchemy
Loading...
Searching...
No Matches

callback_scheduler.h File Reference

The task scheduler: tasks, their order and the scheduler's state. More...

Go to the source code of this file.

Data Structures

struct  SchedulerTask
 A scheduled task: its routine's address, its order (see SCHEDULER_KEY_) and its flags, where bit 0 keeps it running while overlay tasks are suspended. More...

Macros

#define SCHEDULER_KEY_VBLANK   0x480
 A task's order: the high byte picks the pass that runs it, the low byte ranks it within the pass (higher runs first).
#define SCHEDULER_KEY_MAIN_LOOP   0xc80
#define TASK_STATE_HIGH(task)

Typedefs

typedef void(*) SchedulerCallback(void)

Enumerations

enum  SchedulerTaskLimits { SCHEDULER_TBS_TASK_COUNT = 20 , SCHEDULER_TLA_TASK_COUNT = 24 }

Functions

 STATIC_ASSERT (sizeof(struct SchedulerTask)==8)
 STATIC_ASSERT (offsetof(struct SchedulerTask, state)==4)
 STATIC_ASSERT (offsetof(struct SchedulerTask, mask)==6)
void Runtime_CallWorkEntryWithArgs (s32 arg0, s32 arg1)
void Scheduler_RunCallbacksByKey (s32 key)
s32 Scheduler_CountCallbacksByKey (s32 key)
void Scheduler_RunCallbacksBeforeBoundary (s32 key)

Variables

volatile u8 gSchedulerStatus
u8 gSchedulerReady
 1 once the task table is set up
struct SchedulerTask gSchedulerTaskTable []

Detailed Description

The task scheduler: tasks, their order and the scheduler's state.

Definition in file callback_scheduler.h.

Macro Definition Documentation

◆ SCHEDULER_KEY_VBLANK

#define SCHEDULER_KEY_VBLANK   0x480

A task's order: the high byte picks the pass that runs it, the low byte ranks it within the pass (higher runs first).

An odd high byte means the task is suspended, so no pass matches it.

Definition at line 34 of file callback_scheduler.h.

Referenced by DisplayScroll_InitObjectTable(), DisplayScroll_RunSlideshow(), System_VBlankHandler(), and Title_ShowIntro().

◆ SCHEDULER_KEY_MAIN_LOOP

#define SCHEDULER_KEY_MAIN_LOOP   0xc80

◆ TASK_STATE_HIGH

#define TASK_STATE_HIGH ( task)
Value:
(((u8 *)&(task)->state)[1])
unsigned char u8
Definition types.h:11

Definition at line 37 of file callback_scheduler.h.

Referenced by Scheduler_ResumeOverlayTasks(), Scheduler_ResumeTasks(), Scheduler_RunPass(), Scheduler_SuspendOverlayTasks(), and Scheduler_SuspendTasks().

Typedef Documentation

◆ SchedulerCallback

typedef void(*) SchedulerCallback(void)

Definition at line 16 of file callback_scheduler.h.

Enumeration Type Documentation

◆ SchedulerTaskLimits

Enumerator
SCHEDULER_TBS_TASK_COUNT 
SCHEDULER_TLA_TASK_COUNT 

Definition at line 11 of file callback_scheduler.h.

Function Documentation

◆ STATIC_ASSERT() [1/3]

STATIC_ASSERT ( sizeof(struct SchedulerTask) = =8)

◆ STATIC_ASSERT() [2/3]

STATIC_ASSERT ( offsetof(struct SchedulerTask, state) = =4)

◆ STATIC_ASSERT() [3/3]

STATIC_ASSERT ( offsetof(struct SchedulerTask, mask) = =6)

◆ Runtime_CallWorkEntryWithArgs()

void Runtime_CallWorkEntryWithArgs ( s32 arg0,
s32 arg1 )

◆ Scheduler_RunCallbacksByKey()

void Scheduler_RunCallbacksByKey ( s32 key)

◆ Scheduler_CountCallbacksByKey()

s32 Scheduler_CountCallbacksByKey ( s32 key)

◆ Scheduler_RunCallbacksBeforeBoundary()

void Scheduler_RunCallbacksBeforeBoundary ( s32 key)

Variable Documentation

◆ gSchedulerStatus

◆ gSchedulerReady

u8 gSchedulerReady
extern

1 once the task table is set up

Referenced by Scheduler_ResetTaskTable(), and Scheduler_RunPass().

◆ gSchedulerTaskTable