1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-17 05:15:16 +00:00

Match NTSC file select (#1998)

* Match NTSC file select

Co-authored-by: inspectredc <inspectredc@gmail.com>

* nes -> eng in macros

* Duplicate more code but use less #ifs

* Format

---------

Co-authored-by: inspectredc <inspectredc@gmail.com>
This commit is contained in:
cadmic 2024-08-07 21:27:02 -07:00 committed by GitHub
parent 29acf96db2
commit feac688313
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 832 additions and 103 deletions

View file

@ -157,7 +157,13 @@ typedef enum {
typedef enum {
/* 0 */ FS_CHAR_PAGE_HIRA,
/* 1 */ FS_CHAR_PAGE_KATA,
/* 2 */ FS_CHAR_PAGE_ENG
/* 2 */ FS_CHAR_PAGE_ENG,
/* 3 */ FS_CHAR_PAGE_HIRA_TO_KATA,
/* 4 */ FS_CHAR_PAGE_KATA_TO_HIRA,
/* 5 */ FS_CHAR_PAGE_HIRA_TO_ENG,
/* 6 */ FS_CHAR_PAGE_ENG_TO_HIRA,
/* 7 */ FS_CHAR_PAGE_KATA_TO_ENG,
/* 8 */ FS_CHAR_PAGE_ENG_TO_KATA
} CharPage;
typedef enum {
@ -214,6 +220,4 @@ void FileSelect_DrawOptions(GameState* thisx);
void FileSelect_DrawNameEntry(GameState* thisx);
void FileSelect_DrawCharacter(GraphicsContext* gfxCtx, void* texture, s16 vtx);
extern s16 D_808123F0[];
#endif

View file

@ -189,7 +189,16 @@ void FileSelect_UpdateMainMenu(GameState* thisx) {
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->configMode = CM_ROTATE_TO_NAME_ENTRY;
this->kbdButton = FS_KBD_BTN_NONE;
#if OOT_NTSC
this->charPage = FS_CHAR_PAGE_HIRA;
if (gSaveContext.language != LANGUAGE_JPN) {
this->charPage = FS_CHAR_PAGE_ENG;
}
#else
this->charPage = FS_CHAR_PAGE_ENG;
#endif
this->kbdX = 0;
this->kbdY = 0;
this->charIndex = 0;
@ -224,7 +233,7 @@ void FileSelect_UpdateMainMenu(GameState* thisx) {
this->nextTitleLabel = FS_TITLE_ERASE_FILE;
} else {
this->configMode = CM_MAIN_TO_OPTIONS;
this->kbdButton = 0;
this->kbdButton = FS_KBD_BTN_HIRA;
this->kbdX = 0;
this->kbdY = 0;
this->charBgAlpha = 0;
@ -798,6 +807,11 @@ static s16 sQuestItemRed[] = { 255, 255, 255, 0, 255, 0, 255, 200, 200 };
static s16 sQuestItemGreen[] = { 255, 255, 255, 255, 60, 100, 130, 50, 200 };
static s16 sQuestItemBlue[] = { 255, 255, 255, 0, 0, 255, 0, 255, 0 };
static s16 sQuestItemFlags[] = { 0x0012, 0x0013, 0x0014, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005 };
#if OOT_NTSC
static void* sSaveXTextures[] = { gFileSelSaveXJPNTex, gFileSelSaveXENGTex };
#endif
static s16 sNamePrimColors[2][3] = { { 255, 255, 255 }, { 100, 100, 100 } };
static void* sHeartTextures[] = { gHeartFullTex, gDefenseHeartFullTex };
static s16 sHeartPrimColors[2][3] = { { 255, 70, 50 }, { 200, 0, 0 } };
@ -1729,9 +1743,11 @@ void FileSelect_Main(GameState* thisx) {
void FileSelect_InitContext(GameState* thisx) {
FileSelectState* this = (FileSelectState*)thisx;
EnvironmentContext* envCtx = &this->envCtx;
#if OOT_PAL
SramContext* sramCtx = &this->sramCtx;
#endif
Sram_Alloc(&this->state, sramCtx);
Sram_Alloc(&this->state, &this->sramCtx);
ZREG(7) = 32;
ZREG(8) = 22;
@ -1888,6 +1904,7 @@ void FileSelect_InitContext(GameState* thisx) {
this->n64ddFlags[0] = this->n64ddFlags[1] = this->n64ddFlags[2] = this->defense[0] = this->defense[1] =
this->defense[2] = 0;
#if OOT_PAL
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), sramCtx->readBuff, SRAM_SIZE, OS_READ);
gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE];
@ -1895,6 +1912,7 @@ void FileSelect_InitContext(GameState* thisx) {
if (gSaveContext.language >= LANGUAGE_MAX) {
sramCtx->readBuff[SRAM_HEADER_LANGUAGE] = gSaveContext.language = LANGUAGE_ENG;
}
#endif
}
void FileSelect_Destroy(GameState* thisx) {

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1 @@
#include "file_select.h"
#include "assets/overlays/ovl_file_choose/ovl_file_choose.c"
s16 D_808123F0[] = {
0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016,
0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023,
0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030,
0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D,
0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0040, 0x003F, 0x003E,
};