51 for (i = 0; i < n; i++) {
58 for (i = 0; i < n; i++) {
110 switch (task->
state) {
void updateDecompressor(Decompressor *task)
The decompressor task: unpacks a chunk a frame, frees the buffer at the end.
void decompressorAllocBuffer(Decompressor *task)
Makes the buffer big enough for the unpacked size.
void decompressorStep(Decompressor *task)
Unpacks at least chunkSize bytes; back to substate 0 at the end.
void * decompressorRun(Decompressor *task, s32 *data)
Decompressor method: unpacks data at once; returns it unpacked (plain data as it is)
void decompressorFree(Decompressor *task)
Decompressor method: frees its buffer.
void * decompressorGetData(Decompressor *task)
Decompressor method: the unpacked data, or NULL while it is unpacking.
Decompressor * createDecompressor(void)
A decompressor task.
void decompressorStart(Decompressor *task, s32 *data, s32 chunkSize)
Decompressor method: starts unpacking data chunkSize bytes a frame.
void decompressorSetData(Decompressor *task, s32 *data)
Points the decompressor at data, which is RLEN-packed or plain.
#define RLEN_MAGIC
The first word of "RLEN" data, which its unpacked size follows.
Heap HEAP
The functions that return what a call left in v0 (allocMemHigh, findTask) and the ones that take othe...
#define MEM_MODE
the current mode's: freed by main whenever the mode task ends
Expands "RLEN" data (a run-length encoding: a byte n < 0x80 copies n bytes, n | 0x80 repeats the next...
void(* setSubstate)(struct Decompressor *task, s32 substate)
void(* nextState)(struct Decompressor *task)
void * src
the next packed byte
void *(* alloc)(s32 size, s32 tag)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find