49 while (dma[2] & 0x80000000)
101 s32 scale, blend, pos;
102 s32 matrix, i, x, y, left;
147 s32 duration, start, progress, target;
152 scale = start + (target - start) * progress / duration;
153 if (progress >= duration)
159 s32 duration, start, progress, target;
164 blend = start + (target - start) * progress / duration;
165 if (progress >= duration)
171 s32 duration, start, progress, target;
176 pos = start + (target - start) * progress / duration;
177 if (progress >= duration)
194 x = pos + scale * (i * 32 - 48) / 256;
196 if ((
u32)(x + 152) < 304) {
199 *write++ = (x << 16) | y | flags | attr | 0x700;
200 *write++ = 0xf400 | tile;
214 x = pos + scale * (i * 32 - 16) / 256;
216 if ((
u32)(x + 152) < 304) {
219 *write++ = (x << 16) | y | flags | attr | 0x700;
227#if LANGUAGE == LANGUAGE_FRENCH
235 x = pos + scale * (i * 32 - 16) / 256;
237 if ((
u32)(x + 152) < 304) {
240 *write++ = (x << 16) | y | flags | attr | 0x700;
253 if ((
u32)(pos + 120) < 304) {
256 *write++ = (x << 16) | y | flags | (matrix << 25) | 0x700;
266 if ((
u32)(pos + 152) < 304) {
269 *write++ = (x << 16) | y | flags | (matrix << 25) | 0x700;
Sprite rotation and scale, and the affine matrices handed out each frame.
Calls through a function pointer, by argument count.
The task scheduler: tasks, their order and the scheduler's state.
const u8 gColosso_LetteringPaletteOffsets[]
s16 gColosso_LetteringSlot
static void Colosso_UpdateLettering(void)
The lettering's scene callback: run its script, move, scale and fade it, and draw it as double-size a...
s16 gColosso_ModeMoveTarget
s16 * gColosso_LetteringScript
static void Colosso_LoadLettering(s32 id)
Loads lettering picture id into the lettering's VRAM block (taken once) and its palette into sprite p...
s16 gColosso_LetteringTimer
ColossoLetteringCommand
The Colosso finals' three courses (Colosso Log, River and Wall): the large lettering a race starts wi...
@ COLOSSO_LETTERING_SCALE
scale, frames: grow or shrink to scale (256 is its own size)
@ COLOSSO_LETTERING_PLACE
x, speed: put the lettering at x pixels from the centre, moving at speed 256ths of a pixel a frame
@ COLOSSO_LETTERING_WAIT
frames: run the moves for that many frames before the next command
@ COLOSSO_LETTERING_END
remove the lettering and free its VRAM block
@ COLOSSO_LETTERING_ACCELERATE
speed, frames: change the speed over that many frames
@ COLOSSO_LETTERING_FADE
weight, frames: fade to weight sixteenths over the screen
s32 gColosso_LetteringPosition
s16 gColosso_ModeMoveDuration
s16 gColosso_LetteringParam
static __inline__ void Dma_Wait(volatile u32 *dma)
s16 gColosso_LetteringMode
The engine calls the debug menus import, and their palette swatch tiles.
DMA channel registers, and the DMA and CPU fills.
static __inline__ void Dma_Set(const volatile void *source, volatile void *destination, u32 control, volatile u32 *channel)
Starts a DMA transfer: stores the source, destination and control words into channel's registers with...
static s32 FieldResource_DecodeType01(const void *source, void *destination)
Decodes type-01 compressed data.
s16 gColosso_ModeBlendTarget
s16 gColosso_ModeScaleStep
s16 gColosso_ModeBlendStep
s16 gColosso_ModeBlendDuration
s16 gColosso_ModeMoveStart
s16 gColosso_ModeBlendStart
s16 gColosso_ModeScaleStart
s16 gColosso_ModeMoveStep
u32 gColosso_LetteringSprites[]
s16 gColosso_ModeScaleDuration
s16 gColosso_ModeScaleTarget
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
s32 Engine_TaskRemoveCallback(void(*callback)(void))
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static s32 Vram_Load(s32 block, s32 size, const void *data)
The screen blend's globals and the graphics routines.
void * Runtime_BumpAllocateAlternatePool(s32 size)
As MemAlloc, but tries EWRAM first.
The hardware's I/O registers and their bits, as pret names them.
#define OBJ_PLTT_COLOR(palette, color)
The register write queue that VBlank carries out after each finished frame.
#define IO_WRITE_QUEUE_PUSH(address, value, control)
Disables interrupts to add one register write or DMA to the queue; a write to a full queue is dropped...
The heaps: allocating and freeing blocks.
void Runtime_BumpFree(void *buffer)
The reel game's title lettering.
s32 AffineMatrix_BuildForEffect(struct AffineTransform *source)
Hands out the next OAM affine matrix for a sprite drawn with source's scale and rotation and fills it...
void Runtime_PushSlotEntry(void *slotEntry, s32 slot)
Links a sprite entry into depth slot slot (clamped to 0..255) for this frame.
Resource numbers, named where their contents are known.
char ResourceId_Lettering
One lettering piece as queued for drawing: a header word, then its OAM attributes.
u16 offset
bytes from the start of OBJ VRAM
void * Resource_GetTableEntry(s32 index)
Returns the ROM address of resource index from the resource directory.
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
Values that differ by patch level or language, chosen once for their code.
#define COLOSSO_PALETTE_BYTES
The integer types, TRUE, UNUSED and the fixed-address macros.
Declares nothing of its own: it only includes the window, battle command, resource and VRAM table hea...
s32 Resource_ResetEntry(u32 no)
Frees cache entry no: its blocks go back and the entry is marked free (offset 0xffff).
s32 Resource_FindFreeEntry(void)
Returns the number of the first free cache entry, or VRAM_CACHE_ENTRY_COUNT when all are taken.
struct VramBlockCacheEntry gVramBlockCache[]