Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
text.h File Reference

Text windows, the cursor, the message and talk boxes, the font and the text helpers (text/) More...

#include "common.h"
#include <sys/types.h>
#include <libgte.h>
#include <libgpu.h>
#include "engine/task.h"
#include "engine/gfx.h"
Include dependency graph for text.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Cursor
 A menu cursor: a text window showing one of the CURSOR_FRAMES glyphs. More...
 
struct  MessageBoxFrame
 The frame of a message box: two halves of the bottom panel that grow from the sides (substate 0), stay with a "next" arrow when showArrow is set (substate 1), and fade out through five palette rows (substate 2). More...
 
struct  TalkBoxChildren
 The children of a TalkBox. More...
 
struct  TalkBox
 A box with a speaker's name and a message (createTalkBox). More...
 
struct  TalkBoxFrame
 Draws a TalkBox's panel. More...
 
struct  TextTools
 Text helpers (initTextTools) More...
 
struct  TextBuffer
 
struct  TextWindow
 A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that control code 5 inserts), drawn glyph by glyph as sprites, optionally typed out one character every typeDelay frames. More...
 
struct  TalkBoxLayout
 Where the parts of a TalkBox go, for each of its four types. More...
 
struct  Font
 The font (FONT): three text styles, the length of each control code, and decode(), which turns the next character into kind << 8 | value: kind 0 a glyph (value - 4 indexes glyphs), 1 an icon, 2 a control code, 3 a missing character, 4 the end. More...
 
struct  GlyphMap
 Maps a Shift-JIS character to a glyph. More...
 
struct  TextStyle
 
struct  Glyph
 One glyph of a font sheet. More...
 
struct  TextDraw
 Drawing state shared with the control-code handlers. More...
 
struct  MessageBox
 The children of a message box (createMessageBox) More...
 
struct  ZoomBox
 A blue rectangle outline that zooms in (or out, when closing) around a TalkBox. More...
 

Macros

#define PALETTE_WHITE   0
 The text windows' palettes (TextWindow.palette, setPalette): rows of the font's CLUTs, named by the colour of the letters (white letters with a grey shade in PALETTE_WHITE, the default)
 
#define PALETTE_BLUE   1
 a light blue: what is highlighted or current
 
#define PALETTE_DARK_BLUE   2
 
#define PALETTE_YELLOW   3
 
#define PALETTE_GREEN   4
 
#define PALETTE_RED   5
 
#define PALETTE_PURPLE   6
 
#define PALETTE_GREY   7
 what is unavailable
 

Functions

void drawMessageBoxFrame (struct MessageBoxFrame *task)
 Draws the two halves of a message box's panel, growing, still or fading.
 
void drawMessageBoxArrow (struct MessageBoxFrame *task)
 Draws a message box's blinking "next" arrow.
 
void setTextBuffer (struct TextWindow *obj, struct TextBuffer *buf, const char *text)
 Copies a string into one of a window's text buffers, growing it as needed (NULL shows STR_NULL_MESSAGE)
 
void textWindowSetSubString (struct TextWindow *obj, char *text, s32 id, s32 index)
 Text window method: puts string id of a table (-1: text itself) into text buffer index
 
void drawZoomBox (ZoomBox *task)
 Zooms the outline one frame in or out and draws it as four lines; ends when done.
 
void drawTalkBoxArrow (struct TalkBoxFrame *task)
 Draws a talk box's blinking "next" arrow where its type puts it.
 
void drawTalkBoxFrame (struct TalkBoxFrame *task)
 Draws a talk box's corner sprites and its semi-transparent panel.
 
void textWindowSetText (TextWindow *obj, const char *text)
 Text window method: shows a string.
 
void textWindowSetString (TextWindow *obj, char *text, s32 id)
 Text window method: shows string id of a string table (-1: text itself)
 
void formatNumber (u8 *buf, s32 value)
 Writes a number's decimal digits (0 for zero or less)
 
void textWindowSetNumber (TextWindow *obj, u32 index, s32 value)
 Text window method: puts a number into text buffer index, in the font's digit glyphs.
 
void textWindowSetSubText (TextWindow *obj, const char *text, s32 index)
 Text window method: puts a string into work buffer index (1-5), for control code 5.
 
void textWindowSetTypeDelay (TextWindow *, s32)
 Text window method: types the text out a character every delay frames (0 or less: all at once)
 
void textWindowSetPos (TextWindow *obj, s16 x, s16 y)
 Text window method: moves the window.
 
void textWindowSetPalette (TextWindow *obj, u8 palette)
 Text window method: the CLUT row of the glyphs.
 
void textWindowSetBlend (TextWindow *obj, s32 blend)
 old-style: u8 blend
 
void textWindowSetSpacing (TextWindow *obj, s32 x, s32 y)
 old-style: s16 x, y
 
void textWindowSetVisible (TextWindow *obj, u8 visible)
 Text window method: shows or hides the window (an empty text stays hidden)
 
void textWindowSetRightAlign (TextWindow *obj, s32 type)
 old-style: u8 type
 
void textWindowInsertPlayerName (TextWindow *obj)
 Text window method: fills the work buffers that control code 8 asks for with the player's name.
 
void textWindowSetTypeSound (TextWindow *obj, s32 sound)
 Text window method: the sound each typed character plays (0 for none)
 
void textWindowSetScale (TextWindow *obj, s32 x, s32 y)
 Text window method: scales the glyphs.
 
void textWindowSetPivot (TextWindow *obj, s32 x, s32 y)
 Text window method: the point the glyphs scale around.
 
void textWindowSetDepth (TextWindow *obj, s32 depth)
 Text window method: the OT depth the glyphs are drawn at.
 
void textWindowSetLines (TextWindow *obj, s32 lines)
 old-style: u8 lines
 
void textWindowSetUnusedC4 (TextWindow *obj, s32 value)
 old-style: u8 value
 
s32 textWindowIsFinished (TextWindow *obj)
 Text window method: whether the end of the text was reached.
 
s32 textWindowIsVisible (TextWindow *obj)
 Text window method: whether the window is shown.
 
s32 textWindowIsWaitingForButton (TextWindow *obj)
 Text window method: whether the text waits for a button (control code 2)
 
void textWindowShowPage (TextWindow *obj)
 Text window method: makes the whole current page visible at once.
 
void textWindowSetStyle (TextWindow *obj, s32 style)
 Text window method: one of the three font styles (others pick style 1)
 
void textWindowDraw (struct TextWindow *obj)
 Text window method: draws the visible part of the text as sprites, running the control codes.
 
void cursorSetVisible (Cursor *task, s32 visible)
 Cursor method: shows it (from its first frame) or hides it.
 
void cursorSetPos (Cursor *task, s32 x, s32 y)
 Cursor method: moves it.
 
void cursorSetPalette (Cursor *task, s32 palette)
 Cursor method: the CLUT row of its glyph.
 
void cursorSetIdleDelay (Cursor *task, s32 delay)
 Cursor method: the vsyncs it rests between two swings.
 
void cursorSetFrameDelay (Cursor *task, s32 delay)
 Cursor method: the vsyncs of each frame of a swing.
 
void cursorSetStill (Cursor *task, s32 still)
 Cursor method: keeps it on its first frame.
 
void updateCursor (Cursor *task, TextWindow **win)
 The cursor task: creates its text window, then swings it every idleDelay vsyncs.
 
Cursor * createCursor (s16 layerId, s32 depth, s16 x, s16 y)
 A menu cursor on a layer at (x, y)
 
void updateMessageBox (Task *task, struct MessageBox *data)
 The message box task: shows the text once the frame is open, closes when the text ends.
 
s32 processTextChar (TextWindow *obj, TextBuffer *text, TextDraw *draw, s16 *pos)
 Picks the glyph of the next character, or runs its control code; returns what the drawing does next.
 
s32 textCodeDefault (TextWindow *obj, TextBuffer *buf)
 Control codes 0, 7 and 9: show the page, or (code 7) start the text after a speaker's name.
 
s32 textCodeNewLine (TextWindow *obj, TextBuffer *buf, TextDraw *draw)
 Control code 1: a new line, or a new page when the page is full.
 
s32 textCodeWaitButton (TextWindow *obj, TextBuffer *buf)
 Control code 2: waits for one of TEXT_WAIT_BUTTONS.
 
s32 textCodePageBreak (TextWindow *obj, TextBuffer *buf)
 Control code 3: starts a new page.
 
s32 textCodeIgnore (void)
 Control code 4: skipped.
 
s32 textCodeInsert (TextWindow *obj, TextBuffer *buf, TextDraw *draw)
 Control code 5: draws the next character of a work buffer in its place.
 
s32 textCodePause (TextWindow *obj, TextBuffer *buf)
 Control code 6: pauses the typing for some frames, once.
 
s32 textCodePlayerName (TextWindow *obj, TextBuffer *buf)
 Control code 8: puts the player's name into a work buffer, once.
 
void updateTextWindow (TextWindow *obj)
 The text window task: types and draws the text, waits where the control codes say, frees the buffers at the end.
 
void updateZoomBox (struct ZoomBox *task)
 The zoom box task: starts zoomed out (opening) or in (closing), then draws.
 
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 talkBoxSetPos (TalkBox *task, s32 x, s32 y)
 Talk box method: moves the box with its outlines and windows.
 
void updateTalkBox (TalkBox *task, TalkBoxChildren *children)
 The talk box task: opens with its outlines, runs the text, then closes and ends.
 
TextWindow * createTextWindow (s16 id, s16 type, s16 x, s16 y)
 A text window on a layer, in a font style, at (x, y)
 
void updateMessageBoxFrame (struct MessageBoxFrame *task)
 The message box frame task: grows, waits with the arrow when asked, then fades out and ends.
 
MessageBoxFrame * createMessageBoxFrame (s32 layerId)
 A message box frame on a layer, with the menu sound.
 
void updateTalkBoxFrame (TalkBoxFrame *task)
 The talk box frame task: idle until the box opens, then draws the frame and the arrow.
 
TalkBoxFrame * createTalkBoxFrame (TalkBox *parent)
 The frame of a talk box.
 
Task * createMessageBox (s32 layerId, void *strings, s32 index)
 A message box with string index of a table, typed out in three-line pages.
 
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), sized to the text.
 
void bindTextTools (TextTools *obj)
 Makes obj the text tools the methods work on.
 
char * getString (s32 *table, s32 index)
 String index of a string table (a count, then byte offsets from its start), or NULL.
 
s32 measureText (TextBuffer *text, TextStyle *style, s32 spacing)
 old-style: s16 spacing
 
void initTextTools (TextTools *obj)
 Clears a text tools object, gives it its methods and binds it.
 
void convertText (void *buf, void *text, s32 mode)
 Converts the string text to buf: mode 0 from font codes to Shift-JIS (a code below 4 is followed by an icon's), mode 1 back.
 
void loadFont (void)
 Loads the font's images into VRAM and starts loading the menu sprites.
 
s16 decodeChar (u8 *s, u8 mode, TextStyle *font)
 The next character as kind << 8 | value (see Font); mode set for Shift-JIS text.
 

Variables

const char STR_NULL_MESSAGE []
 "Null message was passed"
 
const char STR_BAD_DIGIT_BUFFER []
 "Digit: the message's work number is not supported"
 
const char STR_BAD_EXT_BUFFER []
 "ExtMess: the message's work number is not supported"
 
const char STR_MESSAGE_NOT_SET []
 "The message is not set"
 
char * CURSOR_FRAMES []
 The cursor's frames, the last one repeated as it swings back.
 
s32 TEXT_WAIT_BUTTONS []
 The buttons a wait for a button (code 2) can wait for.
 
Font FONT
 decode is declared without a prototype, as callers would truncate the u8 mode, so decodeChar is cast to it
 
s32(* TEXT_CODE_HANDLERS [])()
 (obj, text, wait): most handlers take only the first two
 
GlyphMap FONT_GLYPH_MAP []
 The font's Shift-JIS codes of its glyphs and icons, up to 0xFFFF.
 
GlyphMap FONT_ICON_MAP []
 
Glyph FONT_GLYPHS_1 []
 the three font sizes' glyphs and icons (text_tools.c)
 
Glyph FONT_ICONS_1 []
 
Glyph FONT_GLYPHS_2 []
 
Glyph FONT_ICONS_2 []
 
Glyph FONT_GLYPHS_3 []
 
Glyph FONT_ICONS_3 []
 
TalkBoxLayout TALK_BOX_LAYOUTS []
 

Detailed Description

Text windows, the cursor, the message and talk boxes, the font and the text helpers (text/)

Definition in file text.h.

Macro Definition Documentation

◆ PALETTE_WHITE

#define PALETTE_WHITE   0

The text windows' palettes (TextWindow.palette, setPalette): rows of the font's CLUTs, named by the colour of the letters (white letters with a grey shade in PALETTE_WHITE, the default)

Definition at line 112 of file text.h.

◆ PALETTE_BLUE

#define PALETTE_BLUE   1

a light blue: what is highlighted or current

Definition at line 113 of file text.h.

◆ PALETTE_DARK_BLUE

#define PALETTE_DARK_BLUE   2

Definition at line 114 of file text.h.

◆ PALETTE_YELLOW

#define PALETTE_YELLOW   3

Definition at line 115 of file text.h.

◆ PALETTE_GREEN

#define PALETTE_GREEN   4

Definition at line 116 of file text.h.

◆ PALETTE_RED

#define PALETTE_RED   5

Definition at line 117 of file text.h.

◆ PALETTE_PURPLE

#define PALETTE_PURPLE   6

Definition at line 118 of file text.h.

◆ PALETTE_GREY

#define PALETTE_GREY   7

what is unavailable

Definition at line 119 of file text.h.

Function Documentation

◆ drawMessageBoxFrame()

void drawMessageBoxFrame ( struct MessageBoxFrame *  task)

Draws the two halves of a message box's panel, growing, still or fading.

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

Definition at line 4 of file message_box.c.

Referenced by updateMessageBoxFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawMessageBoxArrow()

void drawMessageBoxArrow ( struct MessageBoxFrame *  task)

Draws a message box's blinking "next" arrow.

Definition at line 29 of file message_box.c.

Referenced by updateMessageBoxFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTextBuffer()

void setTextBuffer ( struct TextWindow *  obj,
struct TextBuffer *  buf,
const char *  text 
)

Copies a string into one of a window's text buffers, growing it as needed (NULL shows STR_NULL_MESSAGE)

< the current mode's: freed by main whenever the mode task ends

Definition at line 24 of file text_window.c.

Referenced by setTextBuffer(), textWindowSetNumber(), textWindowSetSubString(), textWindowSetSubText(), and textWindowSetText().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ textWindowSetSubString()

void textWindowSetSubString ( struct TextWindow *  obj,
char *  text,
s32  id,
s32  index 
)

Text window method: puts string id of a table (-1: text itself) into text buffer index

Definition at line 136 of file text_window.c.

Referenced by createTextWindow(), textCodePlayerName(), and textWindowSetString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawZoomBox()

void drawZoomBox ( ZoomBox *  task)

Zooms the outline one frame in or out and draws it as four lines; ends when done.

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

Definition at line 143 of file talk_box.c.

Referenced by updateZoomBox().

Here is the caller graph for this function:

◆ drawTalkBoxArrow()

void drawTalkBoxArrow ( struct TalkBoxFrame *  task)

Draws a talk box's blinking "next" arrow where its type puts it.

Definition at line 4 of file talk_box.c.

Referenced by updateTalkBoxFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawTalkBoxFrame()

void drawTalkBoxFrame ( struct TalkBoxFrame *  task)

Draws a talk box's corner sprites and its semi-transparent panel.

Definition at line 35 of file talk_box.c.

Referenced by updateTalkBoxFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ textWindowSetText()

void textWindowSetText ( TextWindow *  obj,
const char *  text 
)

Text window method: shows a string.

Definition at line 68 of file text_window.c.

Referenced by createTextWindow(), textWindowSetNumber(), and textWindowSetSubText().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ textWindowSetString()

void textWindowSetString ( TextWindow *  obj,
char *  text,
s32  id 
)

Text window method: shows string id of a string table (-1: text itself)

Definition at line 73 of file text_window.c.

Referenced by createTextWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ formatNumber()

void formatNumber ( u8 *  buf,
s32  value 
)

Writes a number's decimal digits (0 for zero or less)

Definition at line 78 of file text_window.c.

Referenced by textWindowSetNumber().

Here is the caller graph for this function:

◆ textWindowSetNumber()

void textWindowSetNumber ( TextWindow *  obj,
u32  index,
s32  value 
)

Text window method: puts a number into text buffer index, in the font's digit glyphs.

Definition at line 106 of file text_window.c.

Referenced by createTextWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ textWindowSetSubText()

void textWindowSetSubText ( TextWindow *  obj,
const char *  text,
s32  index 
)

Text window method: puts a string into work buffer index (1-5), for control code 5.

Definition at line 127 of file text_window.c.

Referenced by createTextWindow(), textCodeInsert(), and textWindowInsertPlayerName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ textWindowSetTypeDelay()

void textWindowSetTypeDelay ( TextWindow *  obj,
s32  delay 
)

Text window method: types the text out a character every delay frames (0 or less: all at once)

Definition at line 395 of file text_window.c.

Referenced by createTextWindow(), and setTextBuffer().

Here is the caller graph for this function:

◆ textWindowSetPos()

void textWindowSetPos ( TextWindow *  obj,
s16  x,
s16  y 
)

Text window method: moves the window.

Definition at line 409 of file text_window.c.

Referenced by createTextWindow().

Here is the caller graph for this function:

◆ textWindowSetPalette()

void textWindowSetPalette ( TextWindow *  obj,
u8  palette 
)

Text window method: the CLUT row of the glyphs.

Definition at line 415 of file text_window.c.

Referenced by createTextWindow().

Here is the caller graph for this function:

◆ textWindowSetBlend()

void textWindowSetBlend ( TextWindow *  obj,
s32  blend 
)

old-style: u8 blend

◆ textWindowSetSpacing()

void textWindowSetSpacing ( TextWindow *  obj,
s32  x,
s32  y 
)

old-style: s16 x, y

◆ textWindowSetVisible()

void textWindowSetVisible ( TextWindow *  obj,
u8  visible 
)

Text window method: shows or hides the window (an empty text stays hidden)

Definition at line 450 of file text_window.c.

Referenced by createTextWindow().

Here is the caller graph for this function:

◆ textWindowSetRightAlign()

void textWindowSetRightAlign ( TextWindow *  obj,
s32  type 
)

old-style: u8 type

◆ textWindowInsertPlayerName()

void textWindowInsertPlayerName ( TextWindow *  obj)

Text window method: fills the work buffers that control code 8 asks for with the player's name.

Definition at line 474 of file text_window.c.

Referenced by createTextWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ textWindowSetTypeSound()

void textWindowSetTypeSound ( TextWindow *  obj,
s32  sound 
)

Text window method: the sound each typed character plays (0 for none)

Definition at line 517 of file text_window.c.

Referenced by createTextWindow().

Here is the caller graph for this function:

◆ textWindowSetScale()

void textWindowSetScale ( TextWindow *  obj,
s32  x,
s32  y 
)

Text window method: scales the glyphs.

< GTE regards 4096 as 1.0

Definition at line 522 of file text_window.c.

Referenced by createTextWindow().

Here is the caller graph for this function:

◆ textWindowSetPivot()

void textWindowSetPivot ( TextWindow *  obj,
s32  x,
s32  y 
)

Text window method: the point the glyphs scale around.

Definition at line 530 of file text_window.c.

Referenced by createTextWindow().

Here is the caller graph for this function:

◆ textWindowSetDepth()

void textWindowSetDepth ( TextWindow *  obj,
s32  depth 
)

Text window method: the OT depth the glyphs are drawn at.

Definition at line 536 of file text_window.c.

Referenced by createTextWindow().

Here is the caller graph for this function:

◆ textWindowSetLines()

void textWindowSetLines ( TextWindow *  obj,
s32  lines 
)

old-style: u8 lines

◆ textWindowSetUnusedC4()

void textWindowSetUnusedC4 ( TextWindow *  obj,
s32  value 
)

old-style: u8 value

◆ textWindowIsFinished()

s32 textWindowIsFinished ( TextWindow *  obj)

Text window method: whether the end of the text was reached.

Definition at line 557 of file text_window.c.

Referenced by createTextWindow().

Here is the caller graph for this function:

◆ textWindowIsVisible()

s32 textWindowIsVisible ( TextWindow *  obj)

Text window method: whether the window is shown.

Definition at line 562 of file text_window.c.

Referenced by createTextWindow().

Here is the caller graph for this function:

◆ textWindowIsWaitingForButton()

s32 textWindowIsWaitingForButton ( TextWindow *  obj)

Text window method: whether the text waits for a button (control code 2)

Definition at line 567 of file text_window.c.

Referenced by createTextWindow().

Here is the caller graph for this function:

◆ textWindowShowPage()

void textWindowShowPage ( TextWindow *  obj)

Text window method: makes the whole current page visible at once.

Definition at line 309 of file text_window.c.

Referenced by createTextWindow(), textCodeDefault(), and textCodeNewLine().

Here is the caller graph for this function:

◆ textWindowSetStyle()

void textWindowSetStyle ( TextWindow *  obj,
s32  style 
)

Text window method: one of the three font styles (others pick style 1)

Definition at line 381 of file text_window.c.

Referenced by createTextWindow().

Here is the caller graph for this function:

◆ textWindowDraw()

void textWindowDraw ( struct TextWindow *  obj)

Text window method: draws the visible part of the text as sprites, running the control codes.

< GTE regards 4096 as 1.0

Definition at line 154 of file text_window.c.

Referenced by createTextWindow(), and updateTextWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cursorSetVisible()

void cursorSetVisible ( Cursor *  task,
s32  visible 
)

Cursor method: shows it (from its first frame) or hides it.

Definition at line 4 of file cursor.c.

Referenced by createCursor().

Here is the caller graph for this function:

◆ cursorSetPos()

void cursorSetPos ( Cursor *  task,
s32  x,
s32  y 
)

Cursor method: moves it.

Definition at line 14 of file cursor.c.

Referenced by createCursor().

Here is the caller graph for this function:

◆ cursorSetPalette()

void cursorSetPalette ( Cursor *  task,
s32  palette 
)

Cursor method: the CLUT row of its glyph.

Definition at line 21 of file cursor.c.

Referenced by createCursor().

Here is the caller graph for this function:

◆ cursorSetIdleDelay()

void cursorSetIdleDelay ( Cursor *  task,
s32  delay 
)

Cursor method: the vsyncs it rests between two swings.

Definition at line 27 of file cursor.c.

Referenced by createCursor().

Here is the caller graph for this function:

◆ cursorSetFrameDelay()

void cursorSetFrameDelay ( Cursor *  task,
s32  delay 
)

Cursor method: the vsyncs of each frame of a swing.

Definition at line 32 of file cursor.c.

Referenced by createCursor().

Here is the caller graph for this function:

◆ cursorSetStill()

void cursorSetStill ( Cursor *  task,
s32  still 
)

Cursor method: keeps it on its first frame.

Definition at line 37 of file cursor.c.

Referenced by createCursor().

Here is the caller graph for this function:

◆ updateCursor()

void updateCursor ( Cursor *  task,
TextWindow **  win 
)

The cursor task: creates its text window, then swings it every idleDelay vsyncs.

Definition at line 42 of file cursor.c.

Referenced by createCursor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCursor()

Cursor * createCursor ( s16  layerId,
s32  depth,
s16  x,
s16  y 
)

◆ updateMessageBox()

void updateMessageBox ( Task *  task,
struct MessageBox *  data 
)

The message box task: shows the text once the frame is open, closes when the text ends.

< SYSTEM04

Definition at line 96 of file message_box.c.

Referenced by createMessageBox().

Here is the caller graph for this function:

◆ processTextChar()

s32 processTextChar ( TextWindow *  obj,
TextBuffer *  text,
TextDraw *  draw,
s16 *  pos 
)

Picks the glyph of the next character, or runs its control code; returns what the drawing does next.

Definition at line 575 of file text_window.c.

Referenced by textCodeInsert(), and textWindowDraw().

Here is the caller graph for this function:

◆ textCodeDefault()

s32 textCodeDefault ( TextWindow *  obj,
TextBuffer *  buf 
)

Control codes 0, 7 and 9: show the page, or (code 7) start the text after a speaker's name.

Definition at line 636 of file text_window.c.

Here is the call graph for this function:

◆ textCodeNewLine()

s32 textCodeNewLine ( TextWindow *  obj,
TextBuffer *  buf,
TextDraw *  draw 
)

Control code 1: a new line, or a new page when the page is full.

Definition at line 650 of file text_window.c.

Here is the call graph for this function:

◆ textCodeWaitButton()

s32 textCodeWaitButton ( TextWindow *  obj,
TextBuffer *  buf 
)

Control code 2: waits for one of TEXT_WAIT_BUTTONS.

Definition at line 672 of file text_window.c.

◆ textCodePageBreak()

s32 textCodePageBreak ( TextWindow *  obj,
TextBuffer *  buf 
)

Control code 3: starts a new page.

Definition at line 688 of file text_window.c.

◆ textCodeIgnore()

s32 textCodeIgnore ( void  )

Control code 4: skipped.

Definition at line 722 of file text_window.c.

◆ textCodeInsert()

s32 textCodeInsert ( TextWindow *  obj,
TextBuffer *  buf,
TextDraw *  draw 
)

Control code 5: draws the next character of a work buffer in its place.

Definition at line 727 of file text_window.c.

Here is the call graph for this function:

◆ textCodePause()

s32 textCodePause ( TextWindow *  obj,
TextBuffer *  buf 
)

Control code 6: pauses the typing for some frames, once.

Definition at line 756 of file text_window.c.

◆ textCodePlayerName()

s32 textCodePlayerName ( TextWindow *  obj,
TextBuffer *  buf 
)

Control code 8: puts the player's name into a work buffer, once.

Definition at line 769 of file text_window.c.

Here is the call graph for this function:

◆ updateTextWindow()

void updateTextWindow ( TextWindow *  obj)

The text window task: types and draws the text, waits where the control codes say, frees the buffers at the end.

Definition at line 781 of file text_window.c.

Referenced by createTextWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateZoomBox()

void updateZoomBox ( struct ZoomBox *  task)

The zoom box task: starts zoomed out (opening) or in (closing), then draws.

< GTE regards 4096 as 1.0

Definition at line 196 of file talk_box.c.

Referenced by createZoomBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createZoomBox()

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)

Definition at line 221 of file talk_box.c.

Referenced by updateTalkBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talkBoxSetPos()

void talkBoxSetPos ( TalkBox *  task,
s32  x,
s32  y 
)

Talk box method: moves the box with its outlines and windows.

Definition at line 241 of file talk_box.c.

Referenced by createTalkBox().

Here is the caller graph for this function:

◆ updateTalkBox()

void updateTalkBox ( TalkBox *  task,
TalkBoxChildren *  children 
)

The talk box task: opens with its outlines, runs the text, then closes and ends.

< SYSTEM03

< SYSTEM04

Definition at line 285 of file talk_box.c.

Referenced by createTalkBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createTextWindow()

TextWindow * createTextWindow ( s16  id,
s16  type,
s16  x,
s16  y 
)

A text window on a layer, in a font style, at (x, y)

< GTE regards 4096 as 1.0

Definition at line 834 of file text_window.c.

Referenced by CARDGAME_updateDeckWindow(), CARDGAME_updateScreen(), createFieldMenuWindows(), createListMenu(), createMessageBox(), createNameWindows(), createTalkBox(), FIELDSTG_runChoice(), FIELDSTG_showAreaName(), FIGHTSTG_createItemWindows(), FIGHTSTG_createSwitchInWindows(), FIGHTSTG_createSwitchWindows(), FIGHTSTG_createTechWindows(), FIGHTSTG_drawHud(), FIGHTSTG_showCommands(), FIGHTSTG_showConfusedCommands(), FIGHTSTG_showConfusedMessage(), FIGHTSTG_showDigivolveNames(), FIGHTSTG_showFighterNames(), FIGHTSTG_showMessage(), FIGHTSTG_showPageButtons(), FIGHTSTG_showStats(), FIGHTSTG_showTechs(), FIGHTSTG_updateHud(), FIGHTSTG_updateSwitchMenu(), fillEffectLists(), SHOCKTST_updateEditor(), SHOCKTST_updateLoader(), showMenuOptions(), showMenuPageLabel(), showMenuPageTitle(), showMenuTitle(), showPartyTitle(), SOUNDTST_updateSoundTest(), STAGSLCT_showBiosVersion(), STAGSLCT_startStageSelect(), STCRDABM_createWindows(), STCRDDEK_createEditorWindows(), STCRDDEK_createScreenWindows(), STCRDSHP_createBuyWindows(), STCRDSHP_createPackOpenWindows(), STCRDSHP_createShopWindows(), STDGNAME_showMenuWindow(), STFGTREP_createPartnerWindows(), STFGTREP_createWindows(), STGDGLAB_createEntryListWindows(), STGDGLAB_createEntryPanelWindows(), STGDGLAB_createSkillPanelWindows(), STGDGLAB_createSlotScreenWindows(), STGDGLAB_runSlotScreen(), STGDGLAB_showMenuPage(), STGDGLAB_showPartyPage(), STGDGLAB_updateRecipeScreen(), STGMCARD_updateInfo(), STGMCARD_updateMenu(), STGMCARD_updateSaves(), STGTRAIN_createMenuWindows(), STGTRAIN_createResultWindows(), STGTRAIN_createScreenWindows(), STGTRAIN_createSessionWindows(), STITSHOP_createBuyWindows(), STITSHOP_createInfoWindows(), STITSHOP_createItemListWindows(), STITSHOP_createSellWindows(), STITSHOP_createShopWindows(), STPLNMET_createChoiceWindows(), STPLNMET_createConfirmWindows(), STPLNMET_createTabs(), STPLNMET_updateWelcome(), STSTATUS_createCardWindows(), STSTATUS_createDemoWindows(), STSTATUS_createDigivolveWindows(), STSTATUS_createEquipWindows(), STSTATUS_createItemListWindows(), STSTATUS_createItemWindows(), STSTATUS_createSortWindows(), STSTATUS_createStatusWindows(), STSTATUS_createTechWindows(), STSTATUS_updateMapScreen(), updateCursor(), updateEvent1510(), updateEvent1512(), updateEvent1514(), updateEvent1516(), updateEvent1518(), updateEvent1520(), updateEvent9(), updateInn(), updateMenu(), WFIGHTTS_cameraList(), WFIGHTTS_fighterList(), WFIGHTTS_motionList(), and WFIGHTTS_stageList().

Here is the call graph for this function:

◆ updateMessageBoxFrame()

void updateMessageBoxFrame ( struct MessageBoxFrame *  task)

The message box frame task: grows, waits with the arrow when asked, then fades out and ends.

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

Definition at line 46 of file message_box.c.

Referenced by createMessageBoxFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createMessageBoxFrame()

MessageBoxFrame * createMessageBoxFrame ( s32  layerId)

A message box frame on a layer, with the menu sound.

< SYSTEM03

Definition at line 87 of file message_box.c.

Referenced by createMessageBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTalkBoxFrame()

void updateTalkBoxFrame ( TalkBoxFrame *  task)

The talk box frame task: idle until the box opens, then draws the frame and the arrow.

Definition at line 111 of file talk_box.c.

Referenced by createTalkBoxFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createTalkBoxFrame()

TalkBoxFrame * createTalkBoxFrame ( TalkBox *  parent)

The frame of a talk box.

Definition at line 128 of file talk_box.c.

Referenced by createTalkBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createMessageBox()

Task * createMessageBox ( s32  layerId,
void *  strings,
s32  index 
)

A message box with string index of a table, typed out in three-line pages.

Definition at line 142 of file message_box.c.

Referenced by FIELDSTG_updateSpeech().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createTalkBox()

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), sized to the text.

Definition at line 359 of file talk_box.c.

Referenced by FIELDSTG_updateSpeech().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bindTextTools()

void bindTextTools ( TextTools *  obj)

Makes obj the text tools the methods work on.

Definition at line 10 of file text_tools.c.

Referenced by initTextTools().

Here is the caller graph for this function:

◆ getString()

char * getString ( s32 *  table,
s32  index 
)

String index of a string table (a count, then byte offsets from its start), or NULL.

Definition at line 15 of file text_tools.c.

Referenced by initTextTools().

Here is the caller graph for this function:

◆ measureText()

s32 measureText ( TextBuffer *  text,
TextStyle *  style,
s32  spacing 
)

old-style: s16 spacing

◆ initTextTools()

void initTextTools ( TextTools *  obj)

Clears a text tools object, gives it its methods and binds it.

Definition at line 193 of file text_tools.c.

Referenced by CARDGAME_drawCenteredText(), createTalkBox(), getName(), initNewGameData(), setName(), showMessageText(), STGMCARD_loadFiles(), textWindowSetRightAlign(), and textWindowSetSubString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ convertText()

void convertText ( void *  buf,
void *  text,
s32  mode 
)

Converts the string text to buf: mode 0 from font codes to Shift-JIS (a code below 4 is followed by an icon's), mode 1 back.

Not terminated. The Shift-JIS side is a byte buffer written and read a halfword at a time.

Definition at line 134 of file text_tools.c.

Referenced by initTextTools().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFont()

void loadFont ( void  )

Loads the font's images into VRAM and starts loading the menu sprites.

Definition at line 4 of file font.c.

Here is the call graph for this function:

◆ decodeChar()

s16 decodeChar ( u8 *  s,
u8  mode,
TextStyle *  font 
)

The next character as kind << 8 | value (see Font); mode set for Shift-JIS text.

Definition at line 16 of file font.c.

Variable Documentation

◆ STR_NULL_MESSAGE

const char STR_NULL_MESSAGE[]
extern

"Null message was passed"

Definition at line 5 of file text_window.c.

Referenced by setTextBuffer().

◆ STR_BAD_DIGIT_BUFFER

const char STR_BAD_DIGIT_BUFFER[]
extern

"Digit: the message's work number is not supported"

Definition at line 8 of file text_window.c.

Referenced by textWindowSetNumber().

◆ STR_BAD_EXT_BUFFER

const char STR_BAD_EXT_BUFFER[]
extern

"ExtMess: the message's work number is not supported"

Definition at line 12 of file text_window.c.

Referenced by textWindowSetSubText().

◆ STR_MESSAGE_NOT_SET

const char STR_MESSAGE_NOT_SET[]
extern

"The message is not set"

Definition at line 17 of file text_window.c.

Referenced by textCodeInsert().

◆ CURSOR_FRAMES

char* CURSOR_FRAMES[]
extern

The cursor's frames, the last one repeated as it swings back.

Definition at line 119 of file cursor.c.

Referenced by updateCursor().

◆ TEXT_WAIT_BUTTONS

s32 TEXT_WAIT_BUTTONS[]
extern

The buttons a wait for a button (code 2) can wait for.

Definition at line 887 of file text_window.c.

Referenced by updateTextWindow().

◆ FONT

Font FONT
extern

decode is declared without a prototype, as callers would truncate the u8 mode, so decodeChar is cast to it

Definition at line 78 of file font.c.

Referenced by createTextWindow(), main(), measureText(), processTextChar(), STDWTITL_tickMovie(), textCodeInsert(), textCodePageBreak(), textWindowDraw(), textWindowInsertPlayerName(), textWindowSetStyle(), and textWindowShowPage().

◆ TEXT_CODE_HANDLERS

s32(* TEXT_CODE_HANDLERS[])() ( )
extern

(obj, text, wait): most handlers take only the first two

(obj, text, wait): most handlers take only the first two

Definition at line 880 of file text_window.c.

Referenced by processTextChar().

◆ FONT_GLYPH_MAP

GlyphMap FONT_GLYPH_MAP[]
extern

The font's Shift-JIS codes of its glyphs and icons, up to 0xFFFF.

Definition at line 202 of file text_tools.c.

Referenced by convertText().

◆ FONT_ICON_MAP

GlyphMap FONT_ICON_MAP[]
extern

Definition at line 244 of file text_tools.c.

Referenced by convertText().

◆ FONT_GLYPHS_1

Glyph FONT_GLYPHS_1[]
extern

the three font sizes' glyphs and icons (text_tools.c)

the three font sizes' glyphs and icons (text_tools.c)

Definition at line 272 of file text_tools.c.

◆ FONT_ICONS_1

Glyph FONT_ICONS_1[]
extern

Definition at line 431 of file text_tools.c.

◆ FONT_GLYPHS_2

Glyph FONT_GLYPHS_2[]
extern

Definition at line 512 of file text_tools.c.

◆ FONT_ICONS_2

Glyph FONT_ICONS_2[]
extern

Definition at line 671 of file text_tools.c.

◆ FONT_GLYPHS_3

Glyph FONT_GLYPHS_3[]
extern

Definition at line 752 of file text_tools.c.

◆ FONT_ICONS_3

Glyph FONT_ICONS_3[]
extern

Definition at line 911 of file text_tools.c.

◆ TALK_BOX_LAYOUTS

TalkBoxLayout TALK_BOX_LAYOUTS[]
extern