Skip to Content
The Alchemy Project

src/window/screens_name_entry.c

The name entry screen. More…

Included by screens.c.

Macros

NameDescription
#defineNAME_VOICED_KEY 254The keyboard's keys for the kana voicing marks (TEXT_MARK_VOICED and TEXT_MARK_SEMIVOICED), as its tilemap's low bytes hold them.
#defineNAME_SEMIVOICED_KEY 255
#defineNAME_COMMAND_COLUMN 18The name entry screen: a keyboard window of letter keys, with a column of command keys on its right (Delete and End, and in Japanese the keyboard switch), the name above it and the character's portrait.
#defineNAME_LAST_LETTER_COLUMN 16
#defineNAME_LAST_ROW 10
#defineNAME_DELETE_ROW 8
#defineNAME_SWITCH_ROW 0
#defineNAME_GAP_ROW 5
#defineNAME_IS_GAP_COLUMN (column)The empty columns between the keyboard's groups of letters.
#defineNAME_MAX_LETTERS 5
#defineNAME_MAX_BYTES 14stored name bytes, excluding its terminator
#defineTEXT_COLOR_COMMAND 8The text control code that sets the colour of the text after it, from the byte that follows ({text_color:N} in the message catalogs).
#defineNAME_LABEL_WIDTH BY_LANGUAGE(8, 8, 8, 9, 8, 9)The width of the window showing the name, in tiles.
#defineNAME_KEY_LABELS 1
#defineNAME_END_KEY_WIDTH GERMAN_OR(4, 3)

Functions

NameDescription
Sint32mnNameEntryAcceptsMark (Sint32 mark, Sint32 letter)The international name entry screen has no voicing marks: where the Japanese edition checks a mark against the letter before it, this edition keeps a function that accepts every character.
Sint32mnNameEntryCountLetters (const Uint8 *name)Returns how many letters the Japanese name name has, not counting the voicing marks.
voidmnWindowCopyTilemapRegion (const WINDOW *window, const void *src)Decompresses the type-01 tilemap src and copies it over window's rectangle, both into WINDOW_TILEMAP_VRAM and into the UI tilemap that mirrors it.
voidmnWindowSetInteriorPalette (const WINDOW *window, Sint32 x, Sint32 y, Sint32 width, Sint32 height, Uint32 palette)Puts the tilemap entries of the width x height tile rectangle at (x, y) inside window in palette, clipped to the screen: the key or choice under the cursor flashes so between WINDOW_PALETTE and HIGHLIGHT_PALETTE.
voidmnNameEntryLoadPointingHandTiles (Sint32 slot)Loads the pointing hand cursor's tiles into VRAM slot slot.
voidmnNameEntryLoadCaretTiles (Sint32 slot)Loads the 16x16 sprite NameEntryCaretTiles into VRAM slot slot.
Sint32mnTextSetString (const Uint8 *str)Copies the name str into the window state's text buffer and returns its width in pixels, where the caret stands after it.
voidmnNameEntryDrawName (WINDOW *window, Uint8 *name)Draws the name being entered, name, at the top left of window, followed in TEXT_COLOR_RED by an underscore for each of the NAME_MAX_LETTERS places still free: the loop fills the text to 7 bytes, the name and the two-byte colour code before the underscores.
Sint32mnNameEntryEditMemberName (Sint32 member)The name entry screen for party member member: the player types a name of up to NAME_MAX_LETTERS letters on the keyboard and ends with End (or Start, which jumps there).

Description

The name entry screen. Part of screens.c.

Macros in detail

NAME_VOICED_KEY

#define NAME_VOICED_KEY 254

The keyboard's keys for the kana voicing marks (TEXT_MARK_VOICED and TEXT_MARK_SEMIVOICED), as its tilemap's low bytes hold them.

Referenced by mnNameEntryEditMemberName().

Definition at line 15 of file screens_name_entry.c.

NAME_SEMIVOICED_KEY

#define NAME_SEMIVOICED_KEY 255

Referenced by mnNameEntryEditMemberName().

Definition at line 16 of file screens_name_entry.c.

NAME_COMMAND_COLUMN

#define NAME_COMMAND_COLUMN 18

The name entry screen: a keyboard window of letter keys, with a column of command keys on its right (Delete and End, and in Japanese the keyboard switch), the name above it and the character's portrait.

the keyboard column of the command keys

Referenced by mnNameEntryEditMemberName().

Definition at line 172 of file screens_name_entry.c.

NAME_LAST_LETTER_COLUMN

#define NAME_LAST_LETTER_COLUMN 16

Referenced by mnNameEntryEditMemberName().

Definition at line 173 of file screens_name_entry.c.

NAME_LAST_ROW

#define NAME_LAST_ROW 10

#define NAME_LAST_ROW 5

Referenced by mnNameEntryEditMemberName().

Definition at lines 178 and 183 of file screens_name_entry.c.

NAME_DELETE_ROW

#define NAME_DELETE_ROW 8

#define NAME_DELETE_ROW 4

Referenced by mnNameEntryEditMemberName().

Definition at lines 179 and 184 of file screens_name_entry.c.

NAME_SWITCH_ROW

#define NAME_SWITCH_ROW 0

Referenced by mnNameEntryEditMemberName().

Definition at line 180 of file screens_name_entry.c.

NAME_GAP_ROW

#define NAME_GAP_ROW 5

Referenced by mnNameEntryEditMemberName().

Definition at line 181 of file screens_name_entry.c.

NAME_IS_GAP_COLUMN

#define NAME_IS_GAP_COLUMN(column)

The empty columns between the keyboard's groups of letters.

Referenced by mnNameEntryEditMemberName().

Definition at line 187 of file screens_name_entry.c.

NAME_MAX_LETTERS

#define NAME_MAX_LETTERS 5

Referenced by mnNameEntryDrawName() and mnNameEntryEditMemberName().

Definition at line 189 of file screens_name_entry.c.

NAME_MAX_BYTES

#define NAME_MAX_BYTES 14

stored name bytes, excluding its terminator

Referenced by mnNameEntryEditMemberName().

Definition at line 190 of file screens_name_entry.c.

TEXT_COLOR_COMMAND

#define TEXT_COLOR_COMMAND 8

The text control code that sets the colour of the text after it, from the byte that follows ({text_color:N} in the message catalogs).

Referenced by mnNameEntryDrawName().

Definition at line 223 of file screens_name_entry.c.

NAME_LABEL_WIDTH

#define NAME_LABEL_WIDTH BY_LANGUAGE(8, 8, 8, 9, 8, 9)

The width of the window showing the name, in tiles.

Referenced by mnNameEntryEditMemberName().

Definition at line 252 of file screens_name_entry.c.

NAME_KEY_LABELS

#define NAME_KEY_LABELS 1

#define NAME_KEY_LABELS 0

Definition at lines 258 and 260 of file screens_name_entry.c.

NAME_END_KEY_WIDTH

#define NAME_END_KEY_WIDTH GERMAN_OR(4, 3)

Referenced by mnNameEntryEditMemberName().

Definition at line 262 of file screens_name_entry.c.

Functions in detail

mnNameEntryAcceptsMark

Sint32 mnNameEntryAcceptsMark(Sint32 mark, Sint32 letter)

Bool mnNameEntryAcceptsMark(Sint32 mark, Sint32 letter)

The international name entry screen has no voicing marks: where the Japanese edition checks a mark against the letter before it, this edition keeps a function that accepts every character. Nothing calls it.

Returns whether mark may follow letter in a Japanese name: any character but a voicing mark may, and a voicing mark only after a letter in its table of ranges (pairs of first and last letter, ended by 0).

References NameEntrySemivoicedMarkRanges, NameEntryVoicedMarkRanges and Sint32.

Referenced by mnNameEntryEditMemberName().

Definition at lines 7 and 21 of file screens_name_entry.c.

mnNameEntryCountLetters

Sint32 mnNameEntryCountLetters(const Uint8 *name)

Returns how many letters the Japanese name name has, not counting the voicing marks.

References Sint32.

Referenced by mnNameEntryEditMemberName().

Definition at line 41 of file screens_name_entry.c.

mnWindowCopyTilemapRegion

void mnWindowCopyTilemapRegion(const WINDOW *window, const void *src)

Decompresses the type-01 tilemap src and copies it over window's rectangle, both into WINDOW_TILEMAP_VRAM and into the UI tilemap that mirrors it.

References Sint32, state, syDecompressTaggedLZ(), syHeapAllocateEWRAM() and syHeapRelease().

Referenced by mnNameEntryEditMemberName().

Definition at line 59 of file screens_name_entry.c.

mnWindowSetInteriorPalette

void mnWindowSetInteriorPalette(const WINDOW *window, Sint32 x, Sint32 y, Sint32 width, Sint32 height, Uint32 palette)

Puts the tilemap entries of the width x height tile rectangle at (x, y) inside window in palette, clipped to the screen: the key or choice under the cursor flashes so between WINDOW_PALETTE and HIGHLIGHT_PALETTE. Only the palette number's lowest bit is cleared before palette is ORed in, as those two differ in it alone.

References Sint32 and width.

Referenced by mnColossoMenuChoose() and mnNameEntryEditMemberName().

Definition at line 96 of file screens_name_entry.c.

mnNameEntryLoadPointingHandTiles

void mnNameEntryLoadPointingHandTiles(Sint32 slot)

Loads the pointing hand cursor's tiles into VRAM slot slot.

References PointingHandTiles, Sint32 and syVRAMCacheLoad().

Definition at line 158 of file screens_name_entry.c.

mnNameEntryLoadCaretTiles

void mnNameEntryLoadCaretTiles(Sint32 slot)

Loads the 16x16 sprite NameEntryCaretTiles into VRAM slot slot.

References NameEntryCaretTiles, Sint32 and syVRAMCacheLoad().

Definition at line 164 of file screens_name_entry.c.

mnTextSetString

Sint32 mnTextSetString(const Uint8 *str)

Copies the name str into the window state's text buffer and returns its width in pixels, where the caret stands after it.

References mnTextMeasureDecoded(), Sint32, state and width.

Referenced by mnNameEntryEditMemberName().

Definition at line 195 of file screens_name_entry.c.

mnNameEntryDrawName

void mnNameEntryDrawName(WINDOW *window, Uint8 *name)

Draws the name being entered, name, at the top left of window, followed in TEXT_COLOR_RED by an underscore for each of the NAME_MAX_LETTERS places still free: the loop fills the text to 7 bytes, the name and the two-byte colour code before the underscores.

References mnTextDrawString() and Sint32.

Referenced by mnNameEntryEditMemberName().

Definition at line 229 of file screens_name_entry.c.

mnNameEntryEditMemberName

Sint32 mnNameEntryEditMemberName(Sint32 member)

The name entry screen for party member member: the player types a name of up to NAME_MAX_LETTERS letters on the keyboard and ends with End (or Start, which jumps there).

References FrameCount, gmUnitGetStub(), mnCursorAdvanceStub(), mnCursorMoveTowardTargetStub(), mnCursorSetPosImmediateStub(), mnCursorSetStub(), mnNameEntryAcceptsMark(), mnNameEntryCountLetters(), mnNameEntryDrawName(), mnPortraitCloseWindow(), mnPortraitGetForSpeaker(), mnPortraitOpenWindow(), mnTextDrawString(), mnTextDrawStringInWindow(), mnTextSetString(), mnWindowClose(), mnWindowCopyTilemapRegion(), mnWindowCreate(), mnWindowDrawDividerLine(), mnWindowSetInteriorPalette(), mnWindowSpriteCreate(), mnWindowSpritePrepareForRedraw(), NameEntryAlternateKeyboardTilemap, NameEntryCaretTiles, NameEntryCaretWave, NameEntryDeleteKeyLabel, NameEntryEndKeyLabel, NameEntryKeyboardTilemap, PerPush, PerRepeat, PointingHandTiles, Sint32, state, syDMAXCopy(), sySoundPlayStub(), sySynch(), syVRAMCacheFindFreeEntry(), syVRAMCacheLoad(), syWindowLoadGraphics() and width.

Referenced by dbMenuTestEditIsaacName() and scInit().

Definition at lines 267 and 570 of file screens_name_entry.c.