diff options
| author | cadmic <cadmic24@gmail.com> | 2024-07-21 18:50:20 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-21 21:50:20 -0400 |
| commit | 47fd0232389eebcf883f58bdbc2002abd4e3ad18 (patch) | |
| tree | 81f2ca8a0d0c27e704505e6b1026c07b5294bcdb /include | |
| parent | ab2ca85227bb4ed245d3a39faedc25f793a39a45 (diff) | |
Match NTSC z_kanfont.c and z_message.c (#1997)
* Match NTSC z_kanfont.c and z_message.c
Co-authored-by: inspectredc <inspectredc@gmail.com>
* Apply suggestions from code review
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
* Remove now-unnecessary padding
* Remove msgBufDecoded comment
* Use == NULL for fake match
* Rename Message_DrawText{JPN,NES} -> Message_DrawText[Wide]
* Font_LoadKanji -> Font_LoadCharWide
* Restore FONT_MESSAGE_OFFSET/FONT_MESSAGE_LENGTH
---------
Co-authored-by: inspectredc <inspectredc@gmail.com>
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/functions.h | 3 | ||||
| -rw-r--r-- | include/message_data_fmt.h | 32 | ||||
| -rw-r--r-- | include/z64message.h | 6 |
3 files changed, 38 insertions, 3 deletions
diff --git a/include/functions.h b/include/functions.h index d9c29270a..d0547e5d6 100644 --- a/include/functions.h +++ b/include/functions.h @@ -776,7 +776,8 @@ s32 Jpeg_Decode(void* data, void* zbuffer, void* work, u32 workSize); void KaleidoSetup_Update(PlayState* play); void KaleidoSetup_Init(PlayState* play); void KaleidoSetup_Destroy(PlayState* play); -void func_8006EE50(Font* font, u16 arg1, u16 arg2); +s32 Kanji_OffsetFromShiftJIS(s32 character); +void Font_LoadCharWide(Font* font, u16 character, u16 codePointIndex); void Font_LoadChar(Font* font, u8 character, u16 codePointIndex); void Font_LoadMessageBoxIcon(Font* font, u16 icon); void Font_LoadOrderedFont(Font* font); diff --git a/include/message_data_fmt.h b/include/message_data_fmt.h index 2b184dac0..08e3a4999 100644 --- a/include/message_data_fmt.h +++ b/include/message_data_fmt.h @@ -76,6 +76,38 @@ #define MESSAGE_WIDE_TIME 0x81A1 /* + * Message character constants + */ + +// Non-Wide (nes/ger/fra) + +#define MESSAGE_CHAR_SPACE 0x20 // ' ' + +// Wide (jpn) + +#define MESSAGE_WIDE_CHAR_SPACE 0x8140 // ' ' +#define MESSAGE_WIDE_CHAR_TOUTEN 0x8141 // '、' +#define MESSAGE_WIDE_CHAR_KUTEN 0x8142 // '。' +#define MESSAGE_WIDE_CHAR_PERIOD 0x8144 // '.' +#define MESSAGE_WIDE_CHAR_NAKATEN 0x8145 // '・' +#define MESSAGE_WIDE_CHAR_QUESTION_MARK 0x8148 // '?' +#define MESSAGE_WIDE_CHAR_EXCLAMATION_MARK 0x8149 // '!' +#define MESSAGE_WIDE_CHAR_CIRCUMFLEX_ACCENT 0x814F // '^' +#define MESSAGE_WIDE_CHAR_DOUBLE_QUOTATION_MARK_LEFT 0x8167 // '“' +#define MESSAGE_WIDE_CHAR_DOUBLE_QUOTATION_MARK_RIGHT 0x8168 // '”' +#define MESSAGE_WIDE_CHAR_PARENTHESES_LEFT 0x8169 // '(' +#define MESSAGE_WIDE_CHAR_PARENTHESES_RIGHT 0x816A // ')' +#define MESSAGE_WIDE_CHAR_KAGIKAKKO_LEFT 0x8175 // '「' +#define MESSAGE_WIDE_CHAR_KAGIKAKKO_RIGHT 0x8176 // '」' +#define MESSAGE_WIDE_CHAR_NUMBER_SIGN 0x8194 // '#' +#define MESSAGE_WIDE_CHAR_ASTERISK 0x8196 // '*' +#define MESSAGE_WIDE_CHAR_ZERO 0x824F // '0' +#define MESSAGE_WIDE_CHAR_ONE 0x8250 // '1' +#define MESSAGE_WIDE_CHAR_HOURS 0x8E9E // '時' +#define MESSAGE_WIDE_CHAR_SECONDS 0x9562 // '秒' +#define MESSAGE_WIDE_CHAR_MINUTES 0x95AA // '分' + +/* * Colors */ diff --git a/include/z64message.h b/include/z64message.h index cf942a4c5..014c379b8 100644 --- a/include/z64message.h +++ b/include/z64message.h @@ -235,8 +235,10 @@ typedef struct { /* 0xE2FE */ u8 textBoxPos; // text box position /* 0xE300 */ s32 msgLength; // original name : "msg_data" /* 0xE304 */ u8 msgMode; // original name: "msg_mode" - /* 0xE305 */ char unk_E305[0x1]; - /* 0xE306 */ u8 msgBufDecoded[200]; // decoded message buffer, may be smaller than this + /* 0xE306 */ union { + u8 msgBufDecoded[200]; + u16 msgBufDecodedWide[100]; + }; /* 0xE3CE */ u16 msgBufPos; // original name : "rdp" /* 0xE3D0 */ u16 unk_E3D0; // unused, only ever set to 0 /* 0xE3D2 */ u16 textDrawPos; // draw all decoded characters up to this buffer position |
