Skip to Content
The Alchemy Project

src/scene/shared/colosso_task.c

The sites of the three Colosso finals matches (Colosseum Final 1, 2 and 3): the large lettering a race starts with. More…

Included by colosseum_azart_match.c, colosseum_navampa_match.c and colosseum_satrage_match.c.

Macros

NameDescription
#defineCOLOSSO_LETTERING_PICTURE_BYTES (4 * 32 * 16 / 2)The bytes of one lettering picture's tiles: 2,048 pixels at 4 bits each, as four 32x16 pieces or two 32x32 ones (lettering.tsv).
#defineCOLOSSO_LETTERING_SUBPIXELS 256The lettering's x and speed are kept in 256ths of a pixel.
#defineCOLOSSO_LETTERING_DEPTH (OAM_DEPTH_WINDOW - 4)The lettering's sprites are drawn just behind the windows.
#defineCOLOSSO_LETTERING_PALETTE 15The sprite palette the lettering's colours are loaded into.
#defineCOLOSSO_LETTERING_PIECE_X (i, n) ((i) * 32 - ((n) - 1) * 16)The lettering's pieces are 32 pixels wide: piece i of a row of n lies this far from the row's centre.

Enumerations

NameDescription
enumCOLOSSO_LETTERING_COMMAND { COLOSSO_LETTERING_PLACE, COLOSSO_LETTERING_ACCELERATE, COLOS … }The lettering moves by a script of 16-bit words, a command and its values:
enumCOLOSSO_LETTERING_PICTURE { COLOSSO_PICTURE_LEND_A_HAND, COLOSSO_PICTURE_MATCH_TITLE_FIR … }The lettering pictures, in lettering.tsv's order (scColossoLoadLettering).
enumCOLOSSO_LETTERING_SHAPE { COLOSSO_SHAPE_TITLE, COLOSSO_SHAPE_DIGIT, COLOSSO_SHAPE_RESU … }How scColossoUpdateLettering lays a picture out (ColossoLetteringMode); ColossoLetteringParameter picks the second half of a picture.

Functions

NameDescription
static voidscColossoLoadLettering (Sint32 id)Loads lettering picture id into the lettering's VRAM block (taken once) and its palette into COLOSSO_LETTERING_PALETTE.
static voidscColossoUpdateLettering (void)The lettering's event: run its script, move, scale and fade it, and draw it as double-size affine sprites blended over the screen, in the shape of ColossoLetteringMode.

Variables

NameDescription
extern Sint16ColossoLetteringTimerThe lettering's script as it runs: the ticks its wait has left, its glide's target and ticks, its layout mode and parameter, its position (8.8 pixels) and the script itself.
extern Sint16ColossoLetteringMoveTarget
extern Sint16ColossoLetteringMoveDuration
extern Sint16ColossoLetteringMode
extern Sint16ColossoLetteringParameter
extern Sint32ColossoLetteringPosition
extern Sint16 *ColossoLetteringScript

Description

The sites of the three Colosso finals matches (Colosseum Final 1, 2 and 3): the large lettering a race starts with. It reads "The 1st Match", "3", "2", "1", "GO", from the pictures of games/tbs/src/graphics/colosso/lettering.tsv (COLOSSO_LETTERING_PICTURE). Each picture is COLOSSO_LETTERING_PICTURE_BYTES of tiles after the palettes.

Macros in detail

COLOSSO_LETTERING_PICTURE_BYTES

#define COLOSSO_LETTERING_PICTURE_BYTES (4 * 32 * 16 / 2)

The bytes of one lettering picture's tiles: 2,048 pixels at 4 bits each, as four 32x16 pieces or two 32x32 ones (lettering.tsv).

Referenced by scColossoLoadLettering().

Definition at line 45 of file colosso_task.c.

COLOSSO_LETTERING_SUBPIXELS

#define COLOSSO_LETTERING_SUBPIXELS 256

The lettering's x and speed are kept in 256ths of a pixel.

Referenced by scColossoUpdateLettering().

Definition at line 48 of file colosso_task.c.

COLOSSO_LETTERING_DEPTH

#define COLOSSO_LETTERING_DEPTH (OAM_DEPTH_WINDOW - 4)

The lettering's sprites are drawn just behind the windows.

Referenced by scColossoUpdateLettering().

Definition at line 51 of file colosso_task.c.

COLOSSO_LETTERING_PALETTE

#define COLOSSO_LETTERING_PALETTE 15

The sprite palette the lettering's colours are loaded into.

Referenced by scColossoLoadLettering() and scColossoUpdateLettering().

Definition at line 53 of file colosso_task.c.

COLOSSO_LETTERING_PIECE_X

#define COLOSSO_LETTERING_PIECE_X(i, n) ((i) * 32 - ((n) - 1) * 16)

The lettering's pieces are 32 pixels wide: piece i of a row of n lies this far from the row's centre.

Referenced by scColossoUpdateLettering().

Definition at line 56 of file colosso_task.c.

Enumerations in detail

COLOSSO_LETTERING_COMMAND

enum COLOSSO_LETTERING_COMMAND

The lettering moves by a script of 16-bit words, a command and its values:

EnumeratorValueDescription
COLOSSO_LETTERING_PLACE0x4000x, speed: put the lettering at x pixels from the centre, moving speed / COLOSSO_LETTERING_SUBPIXELS pixels a tick
COLOSSO_LETTERING_ACCELERATE0x3000speed, ticks: change the speed over that many ticks
COLOSSO_LETTERING_SCALE0x1000scale, ticks: grow or shrink to scale (256 is its own size)
COLOSSO_LETTERING_FADE0x2000weight, ticks: fade to weight sixteenths over the screen
COLOSSO_LETTERING_WAIT0x7fffticks: run the moves for that many ticks before the next command
COLOSSO_LETTERING_END-1remove the lettering and free its VRAM block

Definition at line 10 of file colosso_task.c.

COLOSSO_LETTERING_PICTURE

enum COLOSSO_LETTERING_PICTURE

The lettering pictures, in lettering.tsv's order (scColossoLoadLettering).

EnumeratorValueDescription
COLOSSO_PICTURE_LEND_A_HAND0
COLOSSO_PICTURE_MATCH_TITLE_FIRST1"The 1st Match", then the 2nd and
COLOSSO_PICTURE_WIN_LOSE43rd
COLOSSO_PICTURE_COUNTDOWN_START5the countdown's 3 and 2
COLOSSO_PICTURE_COUNTDOWN_END6the countdown's 1
COLOSSO_PICTURE_GO7
COLOSSO_PICTURE_WIN_LOSE_FOR_LOSS8COLOSSO_PICTURE_WIN_LOSE in the blue loss palette

Definition at line 30 of file colosso_task.c.

COLOSSO_LETTERING_SHAPE

enum COLOSSO_LETTERING_SHAPE

How scColossoUpdateLettering lays a picture out (ColossoLetteringMode); ColossoLetteringParameter picks the second half of a picture.

EnumeratorValueDescription
COLOSSO_SHAPE_TITLE1Four 32x16 pieces in a row: The 1st to 3rd Match, Lend a Hand!
COLOSSO_SHAPE_DIGIT2one 32x32 piece: 3, 2, 1
COLOSSO_SHAPE_RESULT3two 32x16 pieces: WIN or LOSE
COLOSSO_SHAPE_GO4Go!: one 64x32 piece, or two 32x16 in French

Definition at line 60 of file colosso_task.c.

Functions in detail

scColossoLoadLettering

static void scColossoLoadLettering(Sint32 id)

Loads lettering picture id into the lettering's VRAM block (taken once) and its palette into COLOSSO_LETTERING_PALETTE.

References ColossoLetteringPaletteOffsets, ColossoLetteringSlot, mnVRAMLoad(), scFieldDecompressTaggedLZ(), Sint32, syDMAWait(), syDMAXCopy(), syHeapAllocateEWRAM(), syHeapRelease(), syResourceGetTableEntry() and syVRAMCacheFindFreeEntry().

Referenced by scColossoShowMatchResult() and scColossoShowOpeningLettering().

Definition at line 82 of file colosso_task.c.

scColossoUpdateLettering

static void scColossoUpdateLettering(void)

The lettering's event: run its script, move, scale and fade it, and draw it as double-size affine sprites blended over the screen, in the shape of ColossoLetteringMode.

References ColossoLetteringFadeStart, ColossoLetteringFadeStep, ColossoLetteringFadeTarget, ColossoLetteringMode, ColossoLetteringMoveDuration, ColossoLetteringMoveStart, ColossoLetteringMoveStep, ColossoLetteringMoveTarget, ColossoLetteringParameter, ColossoLetteringPosition, ColossoLetteringScaleDuration, ColossoLetteringScaleStart, ColossoLetteringScaleStep, ColossoLetteringScaleTarget, ColossoLetteringScript, ColossoLetteringSlot, ColossoLetteringSprites, ColossoLetteringTimer, Sint32, syCloseEvent(), syOAMAddSpriteAtDepth(), syOAMMatrixAllocateFromTransform(), syVRAMCacheFreeEntry() and VramCacheEntries.

Referenced by scColossoStartLettering().

Definition at line 112 of file colosso_task.c.

Variables in detail

ColossoLetteringScript

extern Sint16 *ColossoLetteringScript

Referenced by scColossoStartLettering() and scColossoUpdateLettering().

Definition at line 78 of file colosso_task.c.