13 if (task->
frame != frame) {
40 for (i = 0; i < 3; i++) {
42 for (j = 0; j < 5; j++) {
61 addPrim(ot, prim.
any);
66 addPrim(ot, prim.
any);
90 s16 *p = (
s16 *)(data + 1);
92 for (i = 0; i < 3; i++) {
95 for (j = 0; j < count; j++) {
112 task->
clutY = slot + 0xF0;
138 switch (task->
state) {
CdReader CD_READER
The CD reader.
GfxState GFX
GFX: the graphics state and its methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
FIELDSTG.PRO: the field mode, where the player walks around the map.
Vec2 FIELDSTG_slotImages[]
VRAM position of each StreamTask slot's image.
s32 FIELDSTG_spriteDepths[]
depth of each layer of a StreamTask's sprites
FieldState FIELDSTG_state
FileCache FILE_CACHE
The file cache.
Heap HEAP
The functions that return what a call left in v0 (allocMemHigh, findTask) and the ones that take othe...
void FIELDSTG_loadStreamSprites(StreamTask *task)
Takes a decompressed tile's sprites and loads its image into its slot's VRAM.
s32 FIELDSTG_isStreamLoaded(StreamTask *task)
Whether a stream task's read is done.
void FIELDSTG_updateStream(StreamTask *task)
A stream task's update: takes its tile once decompressed, and notes when its read ends.
s32 FIELDSTG_getStreamFrame(StreamTask *task)
A stream task's frame, the tile it holds.
void FIELDSTG_touchStream(StreamTask *task)
Marks a stream task used now (FIELDSTG_findOldestStream)
void FIELDSTG_setStreamSource(StreamTask *task, s32 slot, Decompressor *source)
Decompresses a stream task's tile into slot.
StreamTask * FIELDSTG_createStream(s32 size, s32 file)
Creates a stream task of a file, with a buffer of size.
void FIELDSTG_seekStream(StreamTask *task, s32 frame, s32 size)
Reads a frame of the map file, a tile, from the CD, unless it has it already.
s32 FIELDSTG_getStreamSlot(StreamTask *task)
A stream task's slot, or -1.
void FIELDSTG_drawStream(StreamTask *task, Layer *layer, s32 x, s32 y)
Draws a stream task's tile at (x, y) on a layer: its sprites at the three depths.
void FIELDSTG_clearStreamSlot(StreamTask *task)
Forgets a stream task's slot.
void(* read)(s32 file, s32 offset, s32 size, void *buf, s32 *done)
Expands "RLEN" data (a run-length encoding: a byte n < 0x80 copies n bytes, n | 0x80 repeats the next...
CVECTOR spriteColor
the field's sprites' color, unless cd is 0
void *(* getArchiveEntry)(s32 index, void *archive)
void(* setPrim)(void *next)
void *(* allocHigh)(s32 size, s32 tag)
from the end of the heap
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
u_long *(* getOtEntry)(struct Layer *, s32 depth)
A task that reads the frames of a file from the disc (FIELDSTG_createStream)
s32 * data
the decompressed tile: its sprites, then its image
s32(* getFrame)(struct StreamTask *task)
s32(* getSlot)(struct StreamTask *task)
void(* seek)(struct StreamTask *task, s32 frame, s32 size)
void(* setSource)(struct StreamTask *task, s32 slot, Decompressor *source)
void(* clearSlot)(struct StreamTask *task)
void(* updateTime)(struct StreamTask *task)
void(* draw)(struct StreamTask *task, Layer *layer, s32 x, s32 y)
StreamSprite sprites[3][5]
Decompressor * source
what it reads its sprites from (FIELDSTG_setStreamSource)
s32(* isLoaded)(struct StreamTask *task)
s32 loadedTime
when its read ended, 0 while reading
void(* nextState)(struct StreamTask *task)
void(* setSubstate)(struct StreamTask *task, s32 substate)
s32 loadedSlot
the slot its image is loaded into, or -1
Uploads TIM images to VRAM (initTimLoader); acts on TIM_LOADER.
void(* setClutPos)()
(x, y)
void(* setImagePos)()
(x, y)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
void initTimLoader(TimLoader *obj)
Clears a TIM loader, gives it its methods and binds it.
The next free primitive of the packet buffer (getPrim), written as the kind that is drawn next.