57 switch (task->
state) {
60#if VERSION_EU || VERSION_JP
97 if (task->
speed == 0) {
103 if (task->
speed == 0) {
108#if VERSION_EU || VERSION_JP
109 index = task->
cursor >> 10;
110 shift = (task->
cursor >> 7) & 6;
112 cell = (cell >> shift) & 3;
114 if (task->
counter == 0 && cell == 1) {
125 index = task->
cursor >> 10;
126 shift = (task->
cursor >> 7) & 6;
128 cell = (cell >> shift) & 3;
GfxState GFX
GFX: the graphics state and its methods.
GameState GAME
The save data, the game mode and the methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
#define FIELD_LAYER_MAP
the map, its objects and characters, and the menus
FIELDSTG.PRO: the field mode, where the player walks around the map.
#define GAUGE_X
where it is drawn, on the screen
#define GAUGE_CURSOR_FRAME
#define GAUGE_START_DELAY
frames before the cursor runs
#define GAUGE_ROWS
A gauge game (FIELDSTG_createGauge, FIELDSTG_runGauge)
#define GAUGE_RUNNING
The steps of a running gauge.
#define GAUGE_CURSOR_MAX
the row's 48 pixels, in 1/256 pixels
#define FIELD_SPRITES_X
Where the field keeps its textures in VRAM: the two images of FIELD_SPRITES_FILE (its entries 2 and 3...
#define GAUGE_RESULT_DELAY
frames on the stopped cursor
#define FIELD_SPRITES_FILE
The field's effect sprites (FIELDSTG_drawSpotEffect): the discs number their files differently.
#define GAUGE_STOPPING_SLOWLY
one time in four
#define GAUGE_EMPTY_ROW
the European version's, all zeros
#define GAUGE_FRAME
its sprites, of FIELD_SPRITES_FILE's sheet 1
u8 * FIELDSTG_gaugeRows[]
The rows of FIELDSTG_runGauge's gauges, 2 bits a cell.
FieldBattleFuncs FIELDSTG_battleFuncs
FileCache FILE_CACHE
The file cache.
void FIELDSTG_runGauge(GaugeGame *task)
A gauge game: a cursor runs back and forth along one of the gauge rows until cross is pressed,...
static void moveGaugeCursor(GaugeGame *task)
The cursor goes back and forth over the gauge at the game's speed.
GaugeGame * FIELDSTG_createGauge(Vec2 pos)
Creates the gauge game at a tile.
static void drawGauge(GaugeGame *task)
Draws the four frames sprite (0x60-0x63) at pos, next to the player, then the gauge: its cursor,...
PadState PAD
Controller input: cleared by initPad, then the methods.
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define SOUND_MENU_MOVE
SYSTEM06.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
void(* startEventBattle)(s32 index)
FIELDSTG_startEventBattle.
void *(* getEntry)(u32 fileAndIndex)
s32 randomGauges
gauge games left with random rows, reset with each new mode
void(* setStep)(struct GaugeGame *task, s32 step)
void(* setState)(struct GaugeGame *task, s32 state)
void(* nextSubstate)(struct GaugeGame *task)
void(* nextState)(struct GaugeGame *task)
s32 cursor
along the row, 0-GAUGE_CURSOR_MAX
s32 back
the cursor goes back
s32 row
of FIELDSTG_gaugeRows
s32(* getFrameTime)(void)
s32(* getPressed)(s32 pad)
s32(* next)(void)
0 to RANDOM_COUNT - 1
short(* playSound)(s32 id)
returns the voice of a key-on
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
void(* setLayerId)()
(id, depth)
void(* setFollowScroll)()
(on)
void(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find