Files
tww/src/d/d_s_name.cpp
T
LagoLunatic 86a17bbfb7 JAIZelInst OK (#1005)
* JAIZelInst OK

* Clean up some default args
2026-05-17 17:10:52 -04:00

1000 lines
30 KiB
C++

//
// Generated by dtk
// Translation Unit: d_s_name.cpp
//
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_s_name.h"
#include "d/d_com_inf_game.h"
#include "d/d_com_lib_game.h"
#include "d/d_file_error.h"
#include "d/d_file_select.h"
#include "d/d_procname.h"
#include "d/d_menu_cloth.h"
#include "d/d_menu_save.h"
#include "d/d_name.h"
#include "f_ap/f_ap_game.h"
#include "f_op/f_op_draw_iter.h"
#include "f_op/f_op_kankyo_mng.h"
#include "f_op/f_op_overlap_mng.h"
#include "f_op/f_op_scene_mng.h"
#include "m_Do/m_Do_audio.h"
#include "m_Do/m_Do_dvd_thread.h"
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_hostIO.h"
#include "m_Do/m_Do_machine.h"
#include "m_Do/m_Do_MemCard.h"
#include "m_Do/m_Do_MemCardRWmng.h"
#include "m_Do/m_Do_mtx.h"
#include "m_Do/m_Do_Reset.h"
#include "JSystem/JKernel/JKRAram.h"
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JKernel/JKRMemArchive.h"
dSn_HIO_c g_snHIO;
/* 8022F86C-8022F8F0 .text __ct__9dSn_HIO_cFv */
dSn_HIO_c::dSn_HIO_c() {
field_0x5 = 20;
field_0x6 = 15;
field_0x7 = 30;
field_0x8 = 0;
field_0x9 = 0;
field_0xa = 0;
field_0xb = 0;
field_0xe = 7;
field_0xc = -200;
field_0xf = 2;
field_0x10 = 0;
field_0x11 = 0;
field_0x12 = 0;
field_0x13 = 0;
field_0x14 = 0;
field_0x15 = 0;
field_0x16 = 0;
field_0x17 = 0;
field_0x18 = 0;
field_0x19 = 0;
field_0x1a = 0;
field_0x1b = 0;
}
/* 8022F8F0-8022F95C .text phase_1__FPc */
static cPhs_State phase_1(char* resName) {
mDoAud_bgmStart(JA_BGM_SELECT);
if (dComIfG_setStageRes(resName, NULL) == FALSE) {
return cPhs_ERROR_e;
}
return cPhs_NEXT_e;
}
/* 8022F95C-8022F9B4 .text phase_2__FPc */
static cPhs_State phase_2(char* resName) {
s32 rt = dComIfG_syncStageRes(resName);
if (rt < 0)
return cPhs_ERROR_e;
else if (rt > 0)
return cPhs_INIT_e;
return cPhs_NEXT_e;
}
/* 8022F9B4-8022F9BC .text phase_3__FPc */
static cPhs_State phase_3(char*) {
return cPhs_COMPLEATE_e;
}
/* 8022F9BC-8022F9FC .text resLoad__FP30request_of_phase_process_classPc */
cPhs_State resLoad(request_of_phase_process_class* phase, char* resName) {
static cPhs__Handler l_method[] = {
(cPhs__Handler)phase_1,
(cPhs__Handler)phase_2,
(cPhs__Handler)phase_3,
};
if (phase->id == 2) {
return cPhs_COMPLEATE_e;
}
return dComLbG_PhaseHandler(phase, l_method, resName);
}
/* 8022F9FC-802301C8 .text create__10dScnName_cFv */
cPhs_State dScnName_c::create() {
dComIfGp_offEnableNextStage();
dComIfGp_setNextStage("Name", 0, 0);
dComIfGp_setStartStage(dComIfGp_getNextStartStage());
dComIfGp_offEnableNextStage();
cPhs_State rt = resLoad(&mPhs, "Stage");
if (rt == cPhs_COMPLEATE_e) {
heap = JKRCreateExpHeap(0x68000, mDoExt_getGameHeap(), false);
JUT_ASSERT(0x1c8, heap != NULL);
oldHeap = mDoExt_setCurrentHeap(heap);
mArchive = new JKRMemArchive();
mArchive->mountFixed(dComIfG_getStageRes("Stage", 0x17), JKRMEMBREAK_FLAG_UNKNOWN0);
cloth_create();
buttonIconCreate();
dFs_c = new dFile_select_c();
JUT_ASSERT(470, dFs_c != NULL);
dFs_c->field_0x0 = mArchive;
savePicDatabuf = new (0x20) card_pictdata[3 * 3];
JUT_ASSERT(476, savePicDatabuf != NULL);
if (fpcM_GetName(this) == PROC_NAME_SCENE) {
dFs_c->setUseType(0);
dNm_c = new dName_c();
JUT_ASSERT(484, dNm_c != NULL);
dNm_c->_create();
dFe_c = new dFile_error_c();
JUT_ASSERT(489, dFe_c != NULL);
dFe_c->_create();
dMs_c = NULL;
dComIfGs_setNoFile(0);
dComIfGs_setNewFile(0);
}
if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) {
dComIfGs_setClearCount(1);
dFs_c->setUseType(1);
dMs_c = new dMenu_save_c();
JUT_ASSERT(511, dMs_c != NULL);
dMs_c->setUseType(3);
dMs_c->_create();
dFe_c = NULL;
dNm_c = NULL;
}
dFs_c->_create();
g_snHIO.mNo = mDoHIO_root.m_subroot.createChild("名前登録シーン", &g_snHIO);
dComIfGp_setWindowNum(1);
dComIfGp_setWindow(0, 0.0f, 0.0f, mDoMch_render_c::getFbWidth(), mDoMch_render_c::getEfbHeight(), 0.0f, 1.0f, 0, 2);
g_dComIfG_gameInfo.play.mCameraInfo[0].mpCamera = (camera_class*)&field_0x1d4;
field_0x29c = 5.0f;
field_0x2a0 = 160000.0f;
field_0x2a4 = 60.0f;
f32 aspect = dComIfGp_getWindow(0)->getViewPort()->mWidth / dComIfGp_getWindow(0)->getViewPort()->mHeight;
field_0x2a8 = aspect * fapGmHIO_getAspectRatio();
field_0x2ac.x = 9377.0f;
field_0x2ac.y = 0.0;
field_0x2ac.z = 7644.0;
field_0x2b8.x = 0.0;
field_0x2b8.y = 6311.0;
field_0x2b8.z = 1000.0;
field_0x2d0 = 0;
dComIfGp_setPlayer(0, NULL);
dComIfGd_setWindow(dComIfGp_getWindow(0));
dComIfGd_setViewport(dComIfGp_getWindow(0)->getViewPort());
dComIfGd_setView((view_class*)&field_0x1d4);
mDoGph_gInf_c::offAutoForcus();
setView();
dKy_setLight_init();
fopKyM_Create(PROC_KYEFF, 0, 0);
fopKyM_Create(PROC_KYEFF2, 0, 0);
fpcSCtRq_Request(fpcLy_CurrentLayer(), PROC_VRBOX, NULL, NULL, NULL);
fpcSCtRq_Request(fpcLy_CurrentLayer(), PROC_VRBOX2, NULL, NULL, NULL);
g_env_light.mVrSkyColor.r = 0x50;
g_env_light.mVrSkyColor.g = 0x78;
g_env_light.mVrSkyColor.b = 0xff;
g_env_light.mVrSkyColor.a = 0xff;
g_env_light.mVrkumoColor.r = 0xff;
g_env_light.mVrkumoColor.g = 0xff;
g_env_light.mVrkumoColor.b = 0xff;
g_env_light.mVrkumoColor.a = 0xff;
g_env_light.mVrKasumiMaeColor.r = 0xd2;
g_env_light.mVrKasumiMaeColor.g = 0xe5;
g_env_light.mVrKasumiMaeColor.b = 0xff;
g_env_light.mVrKasumiMaeColor.a = 0xff;
field_0x558 = g_snHIO.field_0x5;
field_0x1bb8 = 0;
if (fpcM_GetName(this) == PROC_NAME_SCENE) {
mMainProc = 0;
field_0x556 = 0;
mDrawProc = 0;
} else if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) {
mMainProc = 10;
mDrawProc = 3;
}
JFWDisplay::getManager()->setTickRate(OS_TIMER_CLOCK / 30);
}
return rt;
}
/* 802301C8-802301FC .text cloth_create__10dScnName_cFv */
void dScnName_c::cloth_create() {
cloth2D_create();
field_0x55d = 0;
}
/* 802301FC-80230240 .text cloth_move__10dScnName_cFv */
void dScnName_c::cloth_move() {
if (field_0x55d && !g_snHIO.field_0xb) {
cloth.cloth_c->cloth_move();
}
}
/* 80230240-802302F8 .text cloth2D_create__10dScnName_cFv */
void dScnName_c::cloth2D_create() {
JKRArchive* clothRes = dComIfGp_getClothResArchive();
cloth.cloth_c = new dMCloth_c();
JUT_ASSERT(801, cloth.cloth_c != NULL);
cloth.cloth_c->setArchive(clothRes);
cloth.cloth_c->setClothType(MENU_CLOTH_TYPE_FILE_SELECT);
}
static void dummy() {
OSReport("baseMdl != 0");
OSReport("baseMdl->getModel() != 0");
OSReport("brkAnm != 0");
OSReport("res != 0");
}
/* 802302F8-80230500 .text buttonIconCreate__10dScnName_cFv */
void dScnName_c::buttonIconCreate() {
btnIcon.scr = new J2DScreen();
JUT_ASSERT(866, btnIcon.scr != NULL);
btnIcon.scr->set("main_parts_fileselect.blo", mArchive);
fopMsgM_setPaneData(&field_0x43c, btnIcon.scr->search('cent'));
fopMsgM_setPaneData(&field_0x474, btnIcon.scr->search('bab'));
fopMsgM_setPaneData(&field_0x4ac, btnIcon.scr->search('baat'));
fopMsgM_setPaneData(&field_0x4e4, btnIcon.scr->search('bawp'));
fopMsgM_setPaneData(&field_0x51c, btnIcon.scr->search('bawd'));
field_0x1bb4 = 0;
paneTransButtonIcon(field_0x1bb4, g_snHIO.field_0xe, g_snHIO.field_0xc, 0.0f, 0);
field_0x1bb6 = 6;
}
/* 80230500-802305E0 .text paneTransButtonIcon__10dScnName_cFsUcffUc */
BOOL dScnName_c::paneTransButtonIcon(s16 param_1, u8 param_2, f32 param_3, f32 param_4, u8 param_5) {
if (param_1 < 0) {
return false;
}
if (param_1 > param_2) {
return true;
}
f32 tmp = fopMsgM_valueIncrease(param_2, param_1, param_5);
tmp *= (param_4 - param_3);
fopMsgM_paneTrans(&field_0x43c, 0.0f, param_3 + tmp);
fopMsgM_paneTrans(&field_0x474, 0.0f, param_3 + tmp);
fopMsgM_paneTrans(&field_0x4ac, 0.0f, param_3 + tmp);
fopMsgM_paneTrans(&field_0x4e4, 0.0f, param_3 + tmp);
fopMsgM_paneTrans(&field_0x51c, 0.0f, param_3 + tmp);
return false;
}
void (dScnName_c::*MainProc[])() = {
&dScnName_c::MemCardCheckMain,
&dScnName_c::NoteOpen,
&dScnName_c::NoteOpenWait,
&dScnName_c::FileSelectOpen,
&dScnName_c::FileSelectMain,
&dScnName_c::FileSelectClose,
&dScnName_c::NameInOpen,
&dScnName_c::NameInMain,
&dScnName_c::NameInClose,
&dScnName_c::changeGameScene,
&dScnName_c::SaveOpen,
&dScnName_c::SaveMain,
&dScnName_c::SaveClose,
&dScnName_c::ResetWait,
&dScnName_c::ShopDemoDataLoad,
&dScnName_c::ShopDemoDataSet,
};
void (dScnName_c::*MemCardCheckProc[])() = {
&dScnName_c::MemCardStatCheck,
&dScnName_c::MemCardLoadWait,
&dScnName_c::MemCardErrMsgWaitKey,
&dScnName_c::MemCardErrMsgWaitKey2,
&dScnName_c::MemCardErrMsgWaitNoSaveSel,
&dScnName_c::MemCardErrMsgWaitFormatSel,
&dScnName_c::MemCardErrMsgWaitFormatSel2,
&dScnName_c::MemCardFormat,
&dScnName_c::MemCardFormatCheck,
&dScnName_c::MemCardMakeGameFileSel,
&dScnName_c::MemCardMakeGameFile,
&dScnName_c::MemCardMakeGameFileCheck,
&dScnName_c::MemCardGotoFileSelect,
&dScnName_c::MemCardGotoIPLSelect,
&dScnName_c::MemCardGotoIPL,
&dScnName_c::MemCardCheckDbg,
&dScnName_c::MemCardCheckDbgWait,
};
void (dScnName_c::*NameOpenProc[])() = {
&dScnName_c::NameOpenMain,
&dScnName_c::NameOpenWait,
};
void (dScnName_c::*FileSelOpenProc[])() = {
&dScnName_c::FileSelOpenMain,
&dScnName_c::FileselOpenWait,
};
void (dScnName_c::*DrawProc[])() = {
&dScnName_c::FileErrorDraw,
&dScnName_c::FileSelectDraw,
&dScnName_c::NameInDraw,
&dScnName_c::SaveDraw,
&dScnName_c::NoneDraw,
};
/* 802305E0-80230678 .text execute__10dScnName_cFv */
BOOL dScnName_c::execute() {
if (!fopOvlpM_IsPeek()) {
dComIfG_resetToOpening(this);
}
if (mDoRst::isReset()) {
return TRUE;
}
cloth_move();
if (dFe_c != NULL) {
dFe_c->_move();
}
(this->*(MainProc[mMainProc]))();
buttonIconProc();
return TRUE;
}
/* 80230678-80230714 .text setView__10dScnName_cFv */
void dScnName_c::setView() {
C_MTXPerspective(field_0x2d4, field_0x2a4, field_0x2a8, field_0x29c, field_0x2a0);
mDoMtx_lookAt(field_0x314, &field_0x2ac, &field_0x2b8, field_0x2d0);
mDoMtx_inverse(field_0x314, field_0x344);
mDoMtx_copy(field_0x314, field_0x3b4);
field_0x3b4[0][3] = 0.0f;
field_0x3b4[1][3] = 0.0f;
field_0x3b4[2][3] = 0.0f;
j3dSys.setViewMtx(field_0x314);
mDoMtx_concatProjView(field_0x2d4, field_0x314, field_0x374);
}
/* 80230714-802307EC .text draw__10dScnName_cFv */
BOOL dScnName_c::draw() {
setView();
for (create_tag_class* pTag = fopDwIt_Begin(); pTag != NULL; pTag = fopDwIt_Next(pTag))
fpcM_Draw(pTag->mpTagData);
if (field_0x55d && !g_snHIO.field_0xb) {
dComIfGd_set2DOpa(&cloth);
}
(this->*(DrawProc[mDrawProc]))();
dComIfGd_set2DOpa(&btnIcon);
return TRUE;
}
/* 802307EC-80230A14 .text __dt__10dScnName_cFv */
dScnName_c::~dScnName_c() {
dFs_c->_delete();
delete dFs_c;
if (dNm_c) {
dNm_c->_delete();
delete dNm_c;
}
if (dFe_c) {
dFe_c->_delete();
delete dFe_c;
}
if (dMs_c) {
dMs_c->_delete();
delete dMs_c;
}
delete savePicDatabuf;
delete btnIcon.scr;
mArchive->unmountFixed();
delete cloth.cloth_c;
mDoHIO_root.m_subroot.deleteChild(g_snHIO.mNo);
JKRSetCurrentHeap(oldHeap);
heap->destroy();
dComIfG_deleteStageRes("Stage");
dComIfGp_setWindowNum(0);
dComIfGs_setRestartOption(0);
}
/* 80230A14-80230AD0 .text MemCardCheckMain__10dScnName_cFv */
void dScnName_c::MemCardCheckMain() {
/* Nonmatching */
}
/* 80230AD0-80230C78 .text MemCardStatCheck__10dScnName_cFv */
void dScnName_c::MemCardStatCheck() {
/* Nonmatching */
}
/* 80230C78-80230D20 .text MemCardLoadWait__10dScnName_cFv */
void dScnName_c::MemCardLoadWait() {
/* Nonmatching */
}
/* 80230D20-80230D74 .text MemCardErrMsgWaitKey__10dScnName_cFv */
void dScnName_c::MemCardErrMsgWaitKey() {
/* Nonmatching */
}
/* 80230D74-80230DE8 .text MemCardErrMsgWaitKey2__10dScnName_cFv */
void dScnName_c::MemCardErrMsgWaitKey2() {
/* Nonmatching */
}
/* 80230DE8-80230E50 .text MemCardGotoIPLSelect__10dScnName_cFv */
void dScnName_c::MemCardGotoIPLSelect() {
/* Nonmatching */
}
/* 80230E50-80230E7C .text MemCardGotoIPL__10dScnName_cFv */
void dScnName_c::MemCardGotoIPL() {
OSResetSystem(1, 1, TRUE);
}
/* 80230E7C-80230F4C .text MemCardErrMsgWaitNoSaveSel__10dScnName_cFv */
void dScnName_c::MemCardErrMsgWaitNoSaveSel() {
/* Nonmatching */
}
/* 80230F4C-80230FD0 .text MemCardErrMsgWaitFormatSel__10dScnName_cFv */
void dScnName_c::MemCardErrMsgWaitFormatSel() {
/* Nonmatching */
}
/* 80230FD0-8023106C .text MemCardErrMsgWaitFormatSel2__10dScnName_cFv */
void dScnName_c::MemCardErrMsgWaitFormatSel2() {
/* Nonmatching */
}
/* 8023106C-802310C0 .text MemCardFormat__10dScnName_cFv */
void dScnName_c::MemCardFormat() {
field_0x1bbc = mDoMemCd_FormatSync();
if (field_0x1bbc != 0) {
dFe_c->closeMessage();
field_0x556 = 8;
}
}
/* 802310C0-8023117C .text MemCardFormatCheck__10dScnName_cFv */
void dScnName_c::MemCardFormatCheck() {
/* Nonmatching */
}
/* 8023117C-80231284 .text MemCardMakeGameFileSel__10dScnName_cFv */
void dScnName_c::MemCardMakeGameFileSel() {
/* Nonmatching */
}
/* 80231284-802312D8 .text MemCardMakeGameFile__10dScnName_cFv */
void dScnName_c::MemCardMakeGameFile() {
field_0x1bbc = mDoMemCd_SaveSync();
if (field_0x1bbc != 0) {
dFe_c->closeMessage();
field_0x556 = 11;
}
}
/* 802312D8-80231398 .text MemCardMakeGameFileCheck__10dScnName_cFv */
void dScnName_c::MemCardMakeGameFileCheck() {
/* Nonmatching */
}
/* 80231398-802313AC .text MemCardGotoFileSelect__10dScnName_cFv */
void dScnName_c::MemCardGotoFileSelect() {
mMainProc = 1;
mDrawProc = 4;
}
/* 802313AC-802313B0 .text MemCardCheckDbg__10dScnName_cFv */
void dScnName_c::MemCardCheckDbg() {}
/* 802313B0-80231428 .text MemCardCheckDbgWait__10dScnName_cFv */
void dScnName_c::MemCardCheckDbgWait() {
}
/* 80231428-80231454 .text FileErrorDraw__10dScnName_cFv */
void dScnName_c::FileErrorDraw() {
if (dFe_c) {
dFe_c->_draw();
}
}
/* 80231454-802314E8 .text NoteOpen__10dScnName_cFv */
void dScnName_c::NoteOpen() {
if (field_0x558) {
field_0x558--;
return;
}
mDoAud_seStart(JA_SE_MSEL_CLOTH_ON);
mMainProc = 2;
field_0x55d = 1;
cloth.cloth_c->init();
field_0x559 = g_snHIO.field_0x6;
}
/* 802314E8-802315A8 .text NoteOpenWait__10dScnName_cFv */
void dScnName_c::NoteOpenWait() {
if (field_0x559) {
field_0x559--;
return;
}
if (g_snHIO.field_0x8 == 0) {
if (fpcM_GetName(this) == PROC_NAME_SCENE) {
dFs_c->setSaveDataPtr(saveMemory);
dFs_c->setSavePicDataPtr((u8*)savePicDatabuf);
}
if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) {
dFs_c->setSaveDataPtr(dMs_c->getDataBufPtr());
dFs_c->setSavePicDataPtr((u8*)savePicDatabuf);
}
dFs_c->initial();
mMainProc = 3;
field_0x555 = 0;
mDrawProc = 1;
}
}
/* 802315A8-802315E0 .text FileSelectOpen__10dScnName_cFv */
void dScnName_c::FileSelectOpen() {
(this->*(FileSelOpenProc[field_0x555]))();
}
/* 802315E0-802319B4 .text buttonIconProc__10dScnName_cFv */
void dScnName_c::buttonIconProc() {
switch (field_0x1bb6) {
case 0:
{
s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, g_snHIO.field_0xc, 0.0f, 1);
field_0x1bb4++;
if (ret == 1) {
field_0x1bb4 = 0;
field_0x1bb6 = 6;
dFs_c->setIconMode(field_0x1bb6);
}
}
break;
case 1:
{
if (field_0x51c.pane->isVisible()) {
field_0x51c.pane->hide();
field_0x474.pane->hide();
field_0x4ac.pane->hide();
}
s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, g_snHIO.field_0xc, 0.0f, 1);
field_0x1bb4++;
if (ret == 1) {
field_0x1bb4 = 0;
field_0x1bb6 = 6;
dFs_c->setIconMode(field_0x1bb6);
}
}
break;
case 2:
{
if (!field_0x51c.pane->isVisible()) {
field_0x51c.pane->show();
field_0x474.pane->show();
field_0x4ac.pane->show();
}
s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, g_snHIO.field_0xc, 0.0f, 1);
field_0x1bb4++;
if (ret == 1) {
field_0x1bb4 = 0;
field_0x1bb6 = 6;
dFs_c->setIconMode(field_0x1bb6);
}
}
break;
case 3:
{
s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, 0.0f, g_snHIO.field_0xc, 0);
field_0x1bb4++;
if (ret == 1) {
field_0x1bb4 = 0;
field_0x1bb6 = 6;
dFs_c->setIconMode(field_0x1bb6);
}
}
break;
case 4:
{
s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, 0.0f, g_snHIO.field_0xc, 0);
field_0x1bb4++;
if (ret == 1) {
field_0x1bb4 = 0;
if (!field_0x51c.pane->isVisible()) {
field_0x51c.pane->show();
field_0x474.pane->show();
field_0x4ac.pane->show();
}
field_0x1bb6 = 0;
dFs_c->setIconMode(field_0x1bb6);
}
}
break;
case 5:
{
s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, 0.0f, g_snHIO.field_0xc, 0);
field_0x1bb4++;
if (ret == 1) {
field_0x1bb4 = 0;
if (field_0x51c.pane->isVisible()) {
field_0x51c.pane->hide();
field_0x474.pane->hide();
field_0x4ac.pane->hide();
}
field_0x1bb6 = 0;
dFs_c->setIconMode(field_0x1bb6);
}
}
break;
case 6:
break;
}
}
/* 802319B4-80231A24 .text FileSelOpenMain__10dScnName_cFv */
void dScnName_c::FileSelOpenMain() {
if (dFs_c->_open() != 1) {
return;
}
if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) {
field_0x1bb6 = 2;
} else {
field_0x1bb6 = 1;
}
dFs_c->setIconMode(field_0x1bb6);
mMainProc = 4;
}
/* 80231A24-80231A28 .text FileselOpenWait__10dScnName_cFv */
void dScnName_c::FileselOpenWait() {}
/* 80231A28-80231A8C .text FileSelectMain__10dScnName_cFv */
void dScnName_c::FileSelectMain() {
dFs_c->_move();
field_0x1bb6 = dFs_c->getIconMode();
if (fpcM_GetName(this) == PROC_NAME_SCENE)
FileSelectMainNormal();
if (fpcM_GetName(this) == PROC_NAMEEX_SCENE)
FileSelectMainExSave();
}
/* 80231A8C-80231CB8 .text FileSelectMainNormal__10dScnName_cFv */
void dScnName_c::FileSelectMainNormal() {
/* Nonmatching */
switch (dFs_c->field_0x392c) {
case 1:
field_0x1bb9 = 0;
if (dFs_c->field_0x3914[dFs_c->saveSlot] != 0) {
field_0x1bb6 = 3;
mMainProc = 5;
} else {
dComIfGs_setCardToMemory(saveMemory, dFs_c->saveSlot);
if (dFs_c->saveStatus[dFs_c->saveSlot] != 0 && !dComIfGs_isEventBit(dSv_event_flag_c::UNK_3510)) {
field_0x1bb9 = 1;
}
u8 pictureNum = dComIfGs_getPictureNum();
if (dComIfGs_getPictureNum() != 0) {
u8 failed = 0;
u8 boxDataIdx = 0;
u8 r25 = 0;
card_pictdata* workBuf = &savePicDatabuf[dFs_c->saveSlot * 3];
for (s32 i = 0; i < 3; i++) {
u32 mask = 1 << i;
if ((dComIfGs_getEventReg(dSv_event_flag_c::UNK_89FF) & mask)) {
workBuf++;
continue;
}
if (mDoMemCdRWm_TestCheckSumPictData(workBuf)) {
JKRMainRamToAram((u8*)workBuf, dComIfGp_getPictureBoxData(boxDataIdx), sizeof(card_pictdata), EXPAND_SWITCH_UNKNOWN0, 0, NULL, -1);
boxDataIdx++;
} else {
failed++;
}
r25++;
if (r25 == pictureNum)
break;
workBuf++;
}
dComIfGs_setPictureNum(pictureNum - failed);
}
dComIfGs_setEventReg(dSv_event_flag_c::UNK_89FF, 0);
mDoMemCd_setPictDataPtr(NULL);
dComIfGp_itemDataInit();
if (field_0x1bb9 != 0) {
field_0x1bb6 = 3;
mMainProc = 5;
} else {
field_0x55f = 0;
mMainProc = 9;
}
}
break;
case 2:
field_0x1bb6 = 3;
mMainProc = 5;
break;
}
}
/* 80231CB8-80231D00 .text FileSelectMainExSave__10dScnName_cFv */
void dScnName_c::FileSelectMainExSave() {
/* Nonmatching */
switch (dFs_c->field_0x392c) {
case 1:
field_0x558 = 0x2d;
mMainProc = 13;
return;
case 2:
case 3:
field_0x1bb6 = 3;
mMainProc = 5;
return;
default:
return;
}
}
/* 80231D00-80231D28 .text ResetWait__10dScnName_cFv */
void dScnName_c::ResetWait() {
if (field_0x558) {
field_0x558--;
return;
}
mDoRst::onReset();
}
/* 80231D28-80231E9C .text FileSelectClose__10dScnName_cFv */
void dScnName_c::FileSelectClose() {
if (dFs_c->_close() == 1) {
switch (dFs_c->field_0x392c) {
case 2:
if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) {
dMs_c->initialize();
dMs_c->field_0x053c = 1;
dMs_c->field_0x053d = dFs_c->field_0x392f; // getErrType?
if (dFs_c->field_0x392f == 2) {
dMs_c->initializeEx();
}
mMainProc = 10;
mDrawProc = 3;
} else {
field_0x55d = 0;
cloth.cloth_c->init();
mMainProc = 0;
field_0x556 = 0;
mDrawProc = 0;
}
cloth.cloth_c->alpha_out();
break;
case 3:
cloth.cloth_c->alpha_out();
dMs_c->initialize();
mMainProc = 10;
mDrawProc = 3;
break;
case 1:
if (field_0x1bb9) {
dNm_c->setNextNameStr((char*)dComIfGs_getPlayerName());
} else {
dNm_c->setNextNameStr("");
}
dNm_c->initial();
mMainProc = 6;
field_0x555 = 0;
mDrawProc = 2;
break;
}
}
}
/* 80231E9C-80231EC0 .text FileSelectDraw__10dScnName_cFv */
void dScnName_c::FileSelectDraw() {
dFs_c->_draw();
}
/* 80231EC0-80231EF8 .text NameInOpen__10dScnName_cFv */
void dScnName_c::NameInOpen() {
(this->*(NameOpenProc[field_0x555]))();
}
/* 80231EF8-80231F44 .text NameOpenMain__10dScnName_cFv */
void dScnName_c::NameOpenMain() {
if (dNm_c->_open() == true) {
field_0x1bb6 = 0;
mMainProc = 7;
}
}
/* 80231F44-80231F48 .text NameOpenWait__10dScnName_cFv */
void dScnName_c::NameOpenWait() {}
/* 80231F48-80231FF4 .text NameInMain__10dScnName_cFv */
void dScnName_c::NameInMain() {
dNm_c->_move();
if (dNm_c->isInputEnd() == 1) {
if (!field_0x1bb9) {
dComIfGs_init();
dComIfGp_itemDataInit();
}
dComIfGs_setPlayerName(dNm_c->getInputStrPtr());
field_0x55f = 1;
mMainProc = 9;
} else if (dNm_c->isInputEnd() == 2) {
field_0x1bb6 = 3;
mMainProc = 8;
}
}
/* 80231FF4-80232050 .text NameInClose__10dScnName_cFv */
void dScnName_c::NameInClose() {
if ((BOOL)dNm_c->_close() == TRUE) {
dFs_c->initial();
mMainProc = 3;
field_0x555 = 0;
mDrawProc = 1;
}
}
/* 80232050-80232074 .text NameInDraw__10dScnName_cFv */
void dScnName_c::NameInDraw() {
dNm_c->draw();
}
/* 80232074-802320C0 .text ShopDemoDataLoad__10dScnName_cFv */
void dScnName_c::ShopDemoDataLoad() {
field_0x410 = mDoDvdThd_toMainRam_c::create("/res/ShopDemo/zelda_save.bin", 0, NULL);
mMainProc = 15;
}
/* 802320C0-8023213C .text ShopDemoDataSet__10dScnName_cFv */
void dScnName_c::ShopDemoDataSet() {
if (field_0x410->sync()) {
memcpy(saveMemory, ((u8*)field_0x410->getMemAddress()) + 8, sizeof(saveMemory));
delete field_0x410;
mMainProc = 1;
mDrawProc = 4;
}
}
/* 8023213C-802321AC .text SaveOpen__10dScnName_cFv */
void dScnName_c::SaveOpen() {
if (field_0x558) {
field_0x558--;
return;
}
if (dMs_c->_open() == 1) {
field_0x1bb6 = 1;
dFs_c->setIconMode(field_0x1bb6);
mMainProc = 11;
}
}
/* 802321AC-8023222C .text SaveMain__10dScnName_cFv */
void dScnName_c::SaveMain() {
switch (dMs_c->getSaveStatus()) {
case 2:
dMs_c->_move();
if (dMs_c->getEndStatus() == 0) {
field_0x558 = 0x2d;
mMainProc = 13;
}
break;
case 3:
field_0x1bb6 = 3;
mMainProc = 12;
break;
}
}
/* 8023222C-80232278 .text SaveClose__10dScnName_cFv */
void dScnName_c::SaveClose() {
if (dMs_c->_close() == true) {
mMainProc = 1;
mDrawProc = 4;
}
}
/* 80232278-8023229C .text SaveDraw__10dScnName_cFv */
void dScnName_c::SaveDraw() {
dMs_c->_draw2();
}
/* 8023229C-802322A0 .text NoneDraw__10dScnName_cFv */
void dScnName_c::NoneDraw() {
}
/* 802322A0-80232338 .text changeGameScene__10dScnName_cFv */
void dScnName_c::changeGameScene() {
if (fopOvlpM_IsPeek())
return;
dComIfGs_gameStart();
u32 procName = field_0x55f ? PROC_OPEN_SCENE : PROC_PLAY_SCENE;
if (fopScnM_ChangeReq(this, procName, PROC_OVERLAP0, 5)) {
g_dComIfG_gameInfo.save.getDan().mStageNo = -1;
dComIfGs_setRestartRoomParam(0);
mDoAud_setSceneName(dComIfGp_getNextStageName(), dComIfGp_getNextStageRoomNo(), dComIfGp_getNextStageLayer());
}
}
/* 80232338-80232358 .text dScnName_Draw__FP10dScnName_c */
static BOOL dScnName_Draw(dScnName_c* i_this) {
return i_this->draw();
}
/* 80232358-80232378 .text dScnName_Execute__FP10dScnName_c */
static BOOL dScnName_Execute(dScnName_c* i_this) {
return i_this->execute();
}
/* 80232378-80232380 .text dScnName_IsDelete__FP10dScnName_c */
static BOOL dScnName_IsDelete(dScnName_c*) {
return TRUE;
}
/* 80232380-802323A8 .text dScnName_Delete__FP10dScnName_c */
static BOOL dScnName_Delete(dScnName_c* i_this) {
i_this->~dScnName_c();
return TRUE;
}
/* 802323A8-802323F8 .text dScnName_Create__FP11scene_class */
static cPhs_State dScnName_Create(scene_class* i_scn) {
dScnName_c* i_this = new (i_scn) dScnName_c();
return i_this->create();
}
/* 802323F8-8023245C .text draw__13dDlst_BTICN_cFv */
void dDlst_BTICN_c::draw() {
J2DOrthoGraph* graf = dComIfGp_getCurrentGrafPort();
graf->setPort();
scr->draw(0.0f, 0.0f, graf);
}
/* 8023245C-80232518 .text draw__19dDlst_FLSEL_CLOTH_cFv */
void dDlst_FLSEL_CLOTH_c::draw() {
Mtx44 mtx;
view_port_class* viewport = dComIfGp_getCurrentViewport();
f32 aspect = viewport->mWidth / viewport->mHeight;
C_MTXPerspective(mtx, 30.0f, aspect * fapGmHIO_getAspectRatio(), 1.0f, 100000.0f);
GXSetProjection(mtx, GX_PERSPECTIVE);
cloth_c->draw(0.0f, (GXColor){0xe3, 0xff, 0xb3, 0xff}, (GXColor){0x00, 0x00, 0x00, 0x00}, 0);
dComIfGp_getCurrentGrafPort()->setPort();
}
scene_method_class l_dScnName_Method = {
(process_method_func)dScnName_Create,
(process_method_func)dScnName_Delete,
(process_method_func)dScnName_Execute,
(process_method_func)dScnName_IsDelete,
(process_method_func)dScnName_Draw,
};
scene_process_profile_definition g_profile_NAME_SCENE = {
/* LayerID */ fpcLy_ROOT_e,
/* ListID */ 1,
/* ListPrio */ fpcPi_CURRENT_e,
/* ProcName */ PROC_NAME_SCENE,
/* Proc SubMtd */ &g_fpcNd_Method.base,
/* Size */ sizeof(dScnName_c),
/* SizeOther */ 0,
/* Parameters */ 0,
/* Node SubMtd */ &g_fopScn_Method.base,
/* Scene SubMtd */ &l_dScnName_Method,
};
scene_process_profile_definition g_profile_NAMEEX_SCENE = {
/* LayerID */ fpcLy_ROOT_e,
/* ListID */ 1,
/* ListPrio */ fpcPi_CURRENT_e,
/* ProcName */ PROC_NAMEEX_SCENE,
/* Proc SubMtd */ &g_fpcNd_Method.base,
/* Size */ sizeof(dScnName_c),
/* SizeOther */ 0,
/* Parameters */ 0,
/* Node SubMtd */ &g_fopScn_Method.base,
/* Scene SubMtd */ &l_dScnName_Method,
};