51 widthOffset = parent->
w;
58 for (i = 0; i < 4; pos++, i++) {
82 v[0].vx = v[2].vx = task->
parent->
x + pos->vx - widthOffset;
83 v[1].vx = v[3].vx = v[0].vx + task->
parent->
w;
84 v[0].vy = v[1].vy = task->
parent->
y + pos->vy;
85 v[2].vy = v[3].vy = v[0].vy + task->
parent->
h;
86 v[0].vz = v[1].vz = v[2].vz = v[3].vz = 0;
89 setRGB0(p, 0x80, 0x80, 0x80);
91#if VERSION_US || VERSION_JP
105 setUV4(p, 0xBC, 0, 0xC7, 0, 0xBC, 0x3E, 0xC7, 0x3E);
112 switch (task->
state) {
154 if (task->
zoom > ONE) {
161 if (task->
zoom < 0) {
168 RotMatrixYXZ_gte(&task->
rot, &task->
matrix);
170 in[0].vx = in[2].vx = task->
left - task->
x;
171 in[1].vx = in[3].vx = in[0].vx + task->
w;
172 in[0].vy = in[1].vy = task->
top - task->
y;
173 in[2].vy = in[3].vy = in[0].vy + task->
h;
174 in[0].vz = in[1].vz = in[2].vz = in[3].vz = 0;
175 for (i = 0; i < 4; i++) {
176 ApplyMatrixSV(&task->
matrix, &in[i], &out[i]);
177 out[i].vx += task->
x;
178 out[i].vy += task->
y;
181 for (i = 0; i < 4; i++) {
184 setRGB0(line, 0, 0, 0xFF);
185 line->x0 = out[i].vx;
186 line->y0 = out[i].vy;
187 line->x1 = out[order.
next[i]].vx;
188 line->y1 = out[order.
next[i]].vy;
197 switch (task->
state) {
230 if (type == 2 || type == 3) {
251 for (i = 0; i < 3; i++) {
288 switch (task->
state) {
311 switch (task->
step) {
384 if (text[0] == 2 && text[1] == 7) {
386 while (text[end] != 2 && text[end + 1] != 7) {
390 if (text[i + 2] == 2 && text[i + 3] == 9) {
393 strncpy(name, &text[i + 2], -2 - i + end);
405 }
else if (w >= 0x8C) {
414 for (i = 0; i < 2; i++) {
423 { 3, { 0, -16 }, { 0, -74 }, { 16, -74 }, { 16, -74 }, 6, -71, 6, -58, { 16, -38 } },
424 { 5, { 0, 0 }, { 0, 12 }, { 16, 12 }, { 16, 12 }, 6, 15, 6, 28, { 16, 48 } },
425 { 4, { -16, -16 }, { -26, -74 }, { -10, -74 }, { 125, -74 }, -20, -71, -20, -58, { 125, -38 } },
426 { 6, { -20, 0 }, { -26, 12 }, { -10, 12 }, { 125, 12 }, -20, 15, -20, 28, { 125, 48 } },
GfxState GFX
GFX: the graphics state and its methods.
GameState GAME
The save data, the game mode and the methods.
#define FILE_MENU_SPRITES
Files the engine loads by number.
FileCache FILE_CACHE
The file cache.
char * strncpy(char *dst, const char *src, s32 n)
char * strcpy(char *dst, const char *src)
Heap HEAP
The functions that return what a call left in v0 (allocMemHigh, findTask) and the ones that take othe...
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define SOUND_MENU_CLOSE
SYSTEM04.
#define SOUND_MENU_OPEN
SYSTEM03.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
The file cache (FILE_CACHE): up to 64 files loaded in the heap (tag 3), read in the background one at...
void *(* getEntry)(u32 fileAndIndex)
char name[0x18]
the player's
struct Layer *(* getLayer)(s32 id)
void(* setPrim)(void *next)
void(* zero)(void *ptr, s32 size)
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
u_long *(* getOtEntry)(struct Layer *, s32 depth)
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(* setClutRow)()
(row)
void(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
The children of a TalkBox.
struct TextWindow * windows[2]
speaker, message
struct TalkBoxFrame * frame
struct ZoomBox * zoomBoxes[3]
void(* setState)(struct TalkBoxFrame *task, s32 state)
Where the parts of a TalkBox go, for each of its four types.
DVECTOR sprite0Pos
also the ZoomBox's offset
DVECTOR arrow
where the talk box arrow is drawn
DVECTOR spritePos
the four positions drawTalkBoxFrame walks
A box with a speaker's name and a message (createTalkBox).
void(* setState)(struct TalkBox *task, s32 state)
void(* setSubstate)(struct TalkBox *task, s32 substate)
void(* setPos)(struct TalkBox *box, s32 x, s32 y)
void(* nextStep)(struct TalkBox *task)
Text helpers (initTextTools)
char *(* getString)()
(table, index)
s32(* measure)()
(TextBuffer *, style, spacing)
s32(* isWaitingForButton)()
void(* setPalette)(struct TextWindow *obj, u8 arg)
s32(* isFinished)()
s32: callers don't truncate the result to a byte
void(* insertPlayerName)()
void(* setLines)()
no prototype: callers would truncate u8 args
void(* setPos)(struct TextWindow *obj, s16 x, s16 y)
void(* setVisible)(struct TextWindow *obj, u8 arg)
A blue rectangle outline that zooms in (or out, when closing) around a TalkBox.
void(* setState)(struct ZoomBox *task, s32 state)
s32 unused68
only cleared when the box starts; nothing reads it
VECTOR trans
the centre, set but not read
void(* nextState)(struct ZoomBox *task)
const Order4 OUTLINE_ORDER
The corner of the box each corner's side of the outline goes to.
void updateTalkBoxFrame(TalkBoxFrame *task)
The talk box frame task: idle until the box opens, then draws the frame and the arrow.
ZoomBox * createZoomBox(s32 layerId, s16 x, s16 y, s32 w, s32 h, s32 type)
A zoom box around a talk box of type type at (x, y)
void updateTalkBox(TalkBox *task, TalkBoxChildren *children)
The talk box task: opens with its outlines, runs the text, then closes and ends.
TalkBoxFrame * createTalkBoxFrame(TalkBox *parent)
The frame of a talk box.
const Delays3 ZOOM_BOX_DELAYS
The frames before each of the three zoom boxes of an opening or closing.
void talkBoxSetPos(TalkBox *task, s32 x, s32 y)
Talk box method: moves the box with its outlines and windows.
TalkBox * createTalkBox(s32 id, s16 x, s16 y, void *strings, s32 index, u32 type)
A talk box with string index of a table (an optional speaker's name between 02 07 codes),...
void drawTalkBoxFrame(TalkBoxFrame *task)
Draws a talk box's corner sprites and its semi-transparent panel.
void updateZoomBox(ZoomBox *task)
The zoom box task: starts zoomed out (opening) or in (closing), then draws.
void drawZoomBox(ZoomBox *task)
Zooms the outline one frame in or out and draws it as four lines; ends when done.
void drawTalkBoxArrow(TalkBoxFrame *task)
Draws a talk box's blinking "next" arrow where its type puts it.
TalkBoxLayout TALK_BOX_LAYOUTS[4]
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
#define PALETTE_DARK_BLUE
void initTextTools(TextTools *obj)
Clears a text tools object, gives it its methods and binds it.
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)