Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
player_name.h
Go to the documentation of this file.
1#ifndef STPLNMET_H
2#define STPLNMET_H
3
4/* STPLNMET.PRO: the player's name entry (MODE_PLAYER_NAME). Its modules are in
5 src/menus/player_name/, and the functions below are by module, in the order they
6 link. */
7
8#include "engine/game.h"
9
10/* The name of this overlay's copy of a function or type of src/shared/ */
11#define OVL_NAME(name) STPLNMET_##name
12
13/* The overlay's NameEntry and the name entry's files (name_entry.h) */
14#define NAME_ENTRY_HAS_UNUSED98 0
15#define NAME_ENTRY_HAS_HIDE 1
16#define NAME_ENTRY_SPRITES PLNMET_BANK
17#define NAME_ENTRY_FILE_KEYBOARD FILE_PLNMET_KEYBOARD
18#include "shared/name_entry.h" /* the keyboard's types, as STDGNAME's and STCRDDEK's */
19
20/* The files of the screen */
21#if VERSION_US || VERSION_JP
22#define FILE_PLNMET_SPRITES 0x27C
23#define FILE_PLNMET_KEYBOARD 0x762
24#define FILE_PLNMET_IMAGE 0x896
25#define FILE_PLNMET_MENU 0x27B
26#define FILE_PLNMET_BANK 0x761
27#define FILE_PLNMET_SCROLL 0x2B5
28#elif VERSION_EU
29#define FILE_PLNMET_SPRITES 0x28B
30#define FILE_PLNMET_KEYBOARD 0x771
31#define FILE_PLNMET_IMAGE 0x8A7
32#define FILE_PLNMET_MENU 0x28A
33#define FILE_PLNMET_BANK 0x770
34#define FILE_PLNMET_SCROLL 0x2C4
35#endif
36#define PLNMET_MENU (FILE_PLNMET_MENU << 16) /* sprite bank */
37#define PLNMET_BANK (FILE_PLNMET_BANK << 16) /* the keyboard's and partners' sprites */
38#define PLNMET_SCROLL (FILE_PLNMET_SCROLL << 16)
39
40/* Two scrolling sprites (STPLNMET_createScroll), once their image is loaded */
41typedef struct NameScroll {
43 /* 0x50 */ s32 vramX;
44 /* 0x54 */ s32 vramY;
45 /* 0x58 */ s32 loaded;
46 /* 0x5C */ s32 layer;
47 /* 0x60 */ s32 depth;
48 /* 0x64 */ s32 times[2];
49 /* 0x6C */ s32 pos[2][2];
50 /* 0x7C */ void (*load)(struct NameScroll *task, s32 x, s32 y);
51 /* 0x80 */ void (*setLayer)(struct NameScroll *task, s32 layer, s32 depth);
53
54/* A frame of STPLNMET_updateShine's animation: 0 ends */
55typedef struct SparkleFrame {
56 /* 0x0 */ s32 delay;
57 /* 0x4 */ s32 sprite;
59
60/* An animated sprite (STPLNMET_updateSparkles, STPLNMET_updateShine) */
61typedef struct NameSparkle {
63 /* 0x50 */ s32 pad[4]; /* never read or written */
64 /* 0x60 */ s32 frame;
65 /* 0x64 */ s32 time;
67
68/* The welcome to Digimon Online and its registration (STPLNMET_createWelcome) */
69typedef struct NameDialog {
71 /* 0x50 */ struct PlayerNameScreen *screen;
72 /* 0x54 */ s32 clutRow;
73 /* 0x58 */ s32 pad; /* never read or written: createTask allocates 0x5C bytes */
75
76typedef struct NameDialogWindows {
77 /* 0x0 */ TextWindow *text;
78 /* 0x4 */ TextWindow *arrow; /* follows the text, blinks while it waits */
80
81/* The main task of the screen (STPLNMET_createScreen) */
82typedef struct PlayerNameScreen {
84 /* 0x50 */ s32 layer;
85 /* 0x54 */ s32 depth;
86 /* 0x58 */ s32 page; /* 0 the name, 1 the partners, 2 the confirmation */
87 /* 0x5C */ PanelAnim fade;
89
91 /* 0x00 */ struct NameDialog *dialog;
92 /* 0x04 */ NameEntry *name;
93 /* 0x08 */ struct PartnerChoice *partners;
94 /* 0x0C */ struct NameConfirm *confirm;
95 /* 0x10 */ NameScroll *scroll;
96 /* 0x14 */ NameSparkle *sparkles;
97 /* 0x18 */ NameSparkle *shine;
98 /* 0x1C */ TextWindow *tabs[3];
100
101/* The confirmation of the name and the partners (STPLNMET_updateConfirm) */
102typedef struct NameConfirm {
104 /* 0x50 */ struct PlayerNameScreen *screen;
105 /* 0x54 */ s32 layer;
106 /* 0x58 */ s32 depth;
107 /* 0x5C */ s32 choice; /* STPLNMET_funcs.choices */
108 /* 0x60 */ s32 cursor; /* 0 yes, 1 no */
109 /* 0x64 */ s32 clutRow;
110 /* 0x68 */ s32 clutTime;
111 /* 0x6C */ u16 *name;
112 /* 0x70 */ s32 frames[3];
113 /* 0x7C */ s32 frameTime;
114 /* 0x80 */ s32 progress; /* 0-100 */
115 /* 0x84 */ VECTOR scale;
116 /* 0x94 */ SVECTOR rot;
117 /* 0x9C */ MATRIX matrix;
118 /* 0xBC */ PanelAnim tweenA;
119 /* 0xCC */ PanelAnim tweenB;
120 /* 0xDC */ void (*hide)(struct NameConfirm *task, s32 hide);
121 /* 0xE0 */ void (*close)(struct NameConfirm *task);
123
124typedef struct NameConfirmWindows {
125 /* 0x00 */ TextWindow *title;
126 /* 0x04 */ TextWindow *name;
127 /* 0x08 */ TextWindow *pack;
128 /* 0x0C */ TextWindow *message;
129 /* 0x10 */ TextWindow *progress;
130 /* 0x14 */ TextWindow *yes;
131 /* 0x18 */ TextWindow *no;
132 /* 0x1C */ Cursor *cursor;
134
135/* The choice of the partners (STPLNMET_updateChoice) */
136typedef struct PartnerChoice {
138 /* 0x50 */ struct PlayerNameScreen *screen;
139 /* 0x54 */ s32 layer;
140 /* 0x58 */ s32 depth;
141 /* 0x5C */ s32 frames[3];
142 /* 0x68 */ s32 frameTime;
143 /* 0x6C */ s32 choice; /* STPLNMET_funcs.choices */
144 /* 0x70 */ s32 arrowFrame;
145 /* 0x74 */ s32 arrowTime;
146 /* 0x78 */ u8 pad[0x88 - 0x78]; /* never read or written */
147 /* 0x88 */ void (*hide)(struct PartnerChoice *task, s32 hide);
149
150typedef struct PartnerChoiceWindows {
151 /* 0x00 */ TextWindow *title;
152 /* 0x04 */ TextWindow *labels[3];
153 /* 0x10 */ TextWindow *name;
154 /* 0x14 */ TextWindow *text;
155 /* 0x18 */ struct {
160
161/* The screen's helpers (STPLNMET_funcs) */
162typedef struct PlayerNameFuncs {
163 /* 0x00 */ PartnerAnim *anims;
164 /* 0x04 */ s32 (*choices)[3]; /* three partners each */
165 /* 0x08 */ void (*loadFiles)(void);
166 /* 0x0C */ s32 (*filesLoading)(void);
167 /* 0x10 */ void (*startFade)(PanelAnim *fade, s32 fadeIn);
168 /* 0x14 */ s32 (*updateFade)(PanelAnim *fade);
169 /* 0x18 */ void (*startLerp)(MenuLerp *lerp, s32 from, s32 to, s32 frames);
170 /* 0x1C */ s32 (*updateLerp)(MenuLerp *lerp);
172
173/* scene.c */
174void STPLNMET_centerLayer(Task *task, PlayerNameScreen **screen, Layer *layer, RECT *rect);
175void STPLNMET_updateScene(Task *task, PlayerNameScreen **screen);
176
177/* backdrop.c */
179void STPLNMET_loadScroll(NameScroll *task, s32 x, s32 y);
180void STPLNMET_setScrollLayer(NameScroll *task, s32 layer, s32 depth);
186
187/* welcome.c */
190
191/* name_entry.c */
200void STPLNMET_setName(NameEntry *task, char *name);
201void STPLNMET_getName(NameEntry *task, char *out);
203void STPLNMET_hideNameEntry(NameEntry *task, s32 hide);
205
206/* confirm.c */
211void STPLNMET_hideConfirm(NameConfirm *task, s32 hide);
215
216/* choice.c */
221void STPLNMET_hideChoice(PartnerChoice *task, s32 hide);
224
225/* screen.c */
232void STPLNMET_loadFiles(void);
234void STPLNMET_startFade(PanelAnim *fade, s32 fadeIn);
236void STPLNMET_startLerp(MenuLerp *lerp, s32 from, s32 to, s32 frames);
238
239/* STPLNMET's data (data/stplnmet.c), in its order */
242extern s32 STPLNMET_scrollEnds[];
244extern s32 STPLNMET_nameAnims[][7];
245extern BigKey STPLNMET_bigKeys[];
253extern s32 STPLNMET_tabX[];
254
255#endif /* STPLNMET_H */
signed int s32
Definition common.h:11
unsigned short u16
Definition common.h:10
unsigned char u8
Definition common.h:8
#define TASK_HEADER(Type)
Definition task.h:39
The on-screen keyboard that the overlays use to type a name (STCRDDEK's deck names,...
void STPLNMET_closeConfirm(NameConfirm *task)
Starts closing the confirmation (confirm->close): its panels close, then it ends.
Definition confirm.c:259
void STPLNMET_drawConfirm(NameConfirm *task)
Draws the confirmation: the title panel with its glow, the three partners chosen (animated) and the p...
Definition confirm.c:61
void STPLNMET_updateSparkles(NameSparkle *task)
The sparkles' task: draws five sparkles in place, all on the same looping frame.
Definition backdrop.c:73
void STPLNMET_hideChoice(PartnerChoice *task, s32 hide)
Hides the choice of the partners, or shows it again (partners->hide)
Definition choice.c:138
void STPLNMET_setScrollLayer(NameScroll *task, s32 layer, s32 depth)
Sets the layer and depth the scrolling sprites are drawn in (scroll->setLayer)
Definition backdrop.c:58
NameEntry * STPLNMET_createNameEntry(char *name)
Creates the name entry (task) for the player's name, starting from name: up to 8 characters (5 in Jap...
Definition name_entry.c:45
void STPLNMET_startLerp(MenuLerp *lerp, s32 from, s32 to, s32 frames)
s32 STPLNMET_keyArrowCluts[]
The CLUT rows the page arrows cycle through.
Definition stplnmet.c:812
PartnerChoice * STPLNMET_createChoice(PlayerNameScreen *screen)
Creates the choice of the partners (task), hidden.
Definition choice.c:171
BigKey STPLNMET_bigKeys[]
The keys bigger than a cell, where the keyboard cursor highlights them.
Definition stplnmet.c:808
void STPLNMET_runChoice(PartnerChoice *task, PartnerChoiceWindows *windows)
Picks one of the three choices of partners (up/down); cross confirms them (substate 100),...
Definition choice.c:103
void STPLNMET_updateKeyboard(NameEntry *task, NameEntryWindows *windows)
void STPLNMET_showChoiceWindows(PartnerChoice *task, PartnerChoiceWindows *windows, s32 show)
Shows the choice's windows with the texts of the partners under the arrow, or hides them.
Definition choice.c:31
void STPLNMET_createChoiceWindows(PartnerChoice *task, PartnerChoiceWindows *windows)
choice.c
Definition choice.c:7
s32 STPLNMET_updateFade(PanelAnim *fade)
NameSparkle * STPLNMET_createShine(void)
Creates the shine (task)
Definition backdrop.c:139
void STPLNMET_runConfirm(NameConfirm *task, NameConfirmWindows *windows)
The confirmation's states: yes or no (substate 200 for no or triangle); yes counts the progress up to...
Definition confirm.c:165
KeyTabs STPLNMET_keyPages[]
The keyboard's pages and characters.
Definition stplnmet.c:781
PlayerNameScreen * STPLNMET_createScreen(void)
Creates the player's name screen (task)
Definition screen.c:171
void STPLNMET_drawTitle(PlayerNameScreen *screen)
Draws the page's title, opening and closing with the screen's fade.
Definition screen.c:115
NameKeyboard STPLNMET_keyboard
Definition stplnmet.c:845
s32 STPLNMET_updateLerp(MenuLerp *lerp)
void STPLNMET_updateConfirm(NameConfirm *task, NameConfirmWindows *windows)
The confirmation's task: creates its windows and waits hidden with its panels open,...
Definition confirm.c:265
NameSparkle * STPLNMET_createSparkles(void)
Creates the sparkles (task)
Definition backdrop.c:106
void STPLNMET_startTween(PanelAnim *fade, s32 fadeIn)
name_entry.c
void STPLNMET_createNameWindows(NameEntry *task, NameEntryWindows *windows)
s32 STPLNMET_choiceArrowCluts[]
The CLUT rows the partner choice's cursor cycles through.
Definition stplnmet.c:817
void STPLNMET_updateWelcome(NameDialog *task, NameDialogWindows *windows)
welcome.c
Definition welcome.c:8
KeyTabs STPLNMET_keyPagesJp[]
The keyboard's pages and characters in Japanese (LANGUAGE 0), which only the European version uses.
Definition stplnmet.c:746
s32 STPLNMET_scrollEnds[]
Where each scroll layer starts over (STPLNMET_updateScroll)
Definition stplnmet.c:6
void STPLNMET_hideConfirm(NameConfirm *task, s32 hide)
Hides the confirmation, or shows it again (confirm->hide) with its cursor on yes and the partners' an...
Definition confirm.c:240
NameDialog * STPLNMET_createWelcome(PlayerNameScreen *screen)
Creates the welcome (task), the first thing the screen shows.
Definition welcome.c:95
void STPLNMET_startFade(PanelAnim *fade, s32 fadeIn)
s32 STPLNMET_filesLoading(void)
Whether the screen's texts or the keyboard are still loading.
Definition screen.c:193
KeyPage STPLNMET_keyChars[]
Definition stplnmet.c:784
PlayerNameFuncs STPLNMET_funcs
STPLNMET's data (data/stplnmet.c), in its order.
Definition stplnmet.c:841
void STPLNMET_hideNameEntry(NameEntry *task, s32 hide)
Hides the name entry, putting its cursor after the name's last character, or shows it again (name->hi...
Definition name_entry.c:22
SparkleFrame STPLNMET_sparkleFrames[]
The sparkle's frames (STPLNMET_updateShine): sprite 0 starts over.
Definition stplnmet.c:10
void STPLNMET_updateScroll(NameScroll *task)
backdrop.c
Definition backdrop.c:8
void STPLNMET_showConfirmWindows(NameConfirm *task, NameConfirmWindows *windows, s32 show)
Shows the confirmation's windows with the name typed (without its leading spaces) and the partners ch...
Definition confirm.c:30
void STPLNMET_drawChoice(PartnerChoice *task)
Draws the choice: the three partners under the arrow (animated), the panel and the blinking arrow on ...
Definition choice.c:63
void STPLNMET_loadScroll(NameScroll *task, s32 x, s32 y)
Loads the scrolling sprites' image into VRAM at (x, y) (scroll->load)
Definition backdrop.c:46
NameConfirm * STPLNMET_createConfirm(PlayerNameScreen *screen)
Creates the confirmation of the name and the partners (task), hidden.
Definition confirm.c:288
void STPLNMET_showNameWindows(NameEntry *task, NameEntryWindows *windows, s32 show)
void STPLNMET_showTabs(PlayerNameScreen *screen, PlayerNameScreenChildren *children, s32 show)
Shows the tabs, the current page's one highlighted, or hides them.
Definition screen.c:19
void STPLNMET_centerLayer(Task *task, PlayerNameScreen **screen, Layer *layer, RECT *rect)
scene.c
Definition scene.c:6
void STPLNMET_setName(NameEntry *task, char *name)
void STPLNMET_closeNameEntry(NameEntry *task)
void STPLNMET_getName(NameEntry *task, char *out)
void STPLNMET_loadFiles(void)
Loads the screen's sprites into VRAM and requests its texts and the keyboard.
Definition screen.c:180
TextStyle STPLNMET_nameStyle
The font of the name and the keyboard.
Definition stplnmet.c:796
void STPLNMET_setNameVram(NameEntry *task, s32 x, s32 y)
void STPLNMET_createTabs(PlayerNameScreen *screen, PlayerNameScreenChildren *children)
screen.c
Definition screen.c:7
void STPLNMET_updateScreen(PlayerNameScreen *screen, PlayerNameScreenChildren *children)
The screen's task: loads its files and sound bank and creates the tabs, then starts its music and run...
Definition screen.c:133
void STPLNMET_stepScreen(PlayerNameScreen *screen, PlayerNameScreenChildren *children)
The screen's states: starts the sprites and the welcome, then goes through the name,...
Definition screen.c:35
s32 STPLNMET_tabX[]
The x of the keyboard's three tabs.
Definition stplnmet.c:822
s32 STPLNMET_nameAnims[][7]
The partner's animation beside the name: 7 frames per partner, -1 ends one.
Definition stplnmet.c:801
s32 STPLNMET_updateTween(PanelAnim *fade)
void STPLNMET_updateScene(Task *task, PlayerNameScreen **screen)
The mode's root task: sets up the 320x240 display, a near-black layer and a second layer above it,...
Definition scene.c:13
void STPLNMET_updateNameEntry(NameEntry *task, NameEntryWindows *windows)
void STPLNMET_updateChoice(PartnerChoice *task, PartnerChoiceWindows *windows)
The choice's task: creates its windows and waits hidden, then runs and draws it while shown.
Definition choice.c:152
KeyPage STPLNMET_keyCharsJp[]
Definition stplnmet.c:751
NameScroll * STPLNMET_createScroll(void)
Creates the scrolling sprites (task), drawn once their image is loaded.
Definition backdrop.c:64
void STPLNMET_drawKeyboard(NameEntry *task)
void STPLNMET_createConfirmWindows(NameConfirm *task, NameConfirmWindows *windows)
confirm.c
Definition confirm.c:8
void STPLNMET_updateShine(NameSparkle *task)
The shine's task: draws a sprite animated by STPLNMET_sparkleFrames, looping.
Definition backdrop.c:111
A key of the keyboard bigger than one cell: its sprite and where it goes.
Definition name_entry.h:45
A menu cursor: a text window showing one of the CURSOR_FRAMES glyphs.
Definition text.h:19
A page of the keyboard: 7 rows of 15 cells.
Definition name_entry.h:58
The texts of a keyboard page's three tabs.
Definition name_entry.h:63
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
Definition gfx.h:128
Moves a value towards a target in fixed point, as the menu overlays' startLerp and updateLerp do.
Definition menu.h:27
TextWindow * pack
TextWindow * name
TextWindow * message
TextWindow * title
TextWindow * no
TextWindow * progress
TextWindow * yes
The confirmation of the name and the partners (STPLNMET_updateConfirm)
SVECTOR rot
PanelAnim tweenB
void(* hide)(struct NameConfirm *task, s32 hide)
s32 frames[3]
MATRIX matrix
PanelAnim tweenA
void(* close)(struct NameConfirm *task)
s32 choice
STPLNMET_funcs.choices.
s32 progress
0-100
s32 cursor
0 yes, 1 no
struct PlayerNameScreen * screen
TextWindow * arrow
follows the text, blinks while it waits
Definition player_name.h:78
TextWindow * text
Definition player_name.h:77
The welcome to Digimon Online and its registration (STPLNMET_createWelcome)
Definition player_name.h:69
s32 pad
never read or written: createTask allocates 0x5C bytes
Definition player_name.h:73
struct PlayerNameScreen * screen
Definition player_name.h:71
A name entry: the keyboard, the name typed so far and the panels that open and close.
Definition name_entry.h:95
The character pages of the keyboard (as STDGNAME's and STPLNMET's)
Definition name_entry.h:68
Two scrolling sprites (STPLNMET_createScroll), once their image is loaded.
Definition player_name.h:41
s32 times[2]
Definition player_name.h:48
void(* load)(struct NameScroll *task, s32 x, s32 y)
Definition player_name.h:50
void(* setLayer)(struct NameScroll *task, s32 layer, s32 depth)
Definition player_name.h:51
s32 pos[2][2]
Definition player_name.h:49
An animated sprite (STPLNMET_updateSparkles, STPLNMET_updateShine)
Definition player_name.h:61
s32 pad[4]
never read or written
Definition player_name.h:63
Opens or closes a menu panel: level goes 0 -> ONE in duration frames (or back at twice the speed),...
Definition menu.h:18
A partner Digimon's animation in a menu: up to seven sprite ids, -1 ending it early (the sprites are ...
Definition game_state.h:340
TextWindow * labels[3]
struct PartnerChoiceWindows::@17 partners[3]
The choice of the partners (STPLNMET_updateChoice)
u8 pad[0x88 - 0x78]
never read or written
void(* hide)(struct PartnerChoice *task, s32 hide)
struct PlayerNameScreen * screen
s32 choice
STPLNMET_funcs.choices.
The screen's helpers (STPLNMET_funcs)
s32(* updateLerp)(MenuLerp *lerp)
void(* startFade)(PanelAnim *fade, s32 fadeIn)
void(* loadFiles)(void)
void(* startLerp)(MenuLerp *lerp, s32 from, s32 to, s32 frames)
s32(* updateFade)(PanelAnim *fade)
s32(* filesLoading)(void)
PartnerAnim * anims
s32(* choices)[3]
three partners each
struct NameConfirm * confirm
Definition player_name.h:94
TextWindow * tabs[3]
Definition player_name.h:98
struct PartnerChoice * partners
Definition player_name.h:93
struct NameDialog * dialog
Definition player_name.h:91
The main task of the screen (STPLNMET_createScreen)
Definition player_name.h:82
s32 page
0 the name, 1 the partners, 2 the confirmation
Definition player_name.h:86
A frame of STPLNMET_updateShine's animation: 0 ends.
Definition player_name.h:55
Any task, seen through its header.
Definition task.h:62
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
Definition text.h:131