1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
|
/**
* d_s_name.cpp
* File Select Scene
*/
#include "d/s/d_s_name.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "d/com/d_com_inf_game.h"
#include "d/meter/d_meter2_info.h"
#include "f_op/f_op_scene_mng.h"
#include "m_Do/m_Do_Reset.h"
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_machine.h"
#include "m_Do/m_Do_mtx.h"
#include "f_op/f_op_overlap_mng.h"
/* 803C3040-803C304C 020160 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */
static u8 cNullVec__6Z2Calc[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
/* 804510F0-804510F8 0005F0 0008+00 2/2 0/0 0/0 .sbss g_snHIO */
static dSn_HIO_c g_snHIO;
/* 803C3094-803C30DC 0201B4 0048+00 1/2 0/0 0/0 .data MainProc */
typedef void (dScnName_c::*mainProcFunc)(void);
static mainProcFunc MainProc[6] = {
&dScnName_c::FileSelectOpen, &dScnName_c::FileSelectMain, &dScnName_c::FileSelectClose,
&dScnName_c::brightCheckOpen, &dScnName_c::brightCheck, &dScnName_c::changeGameScene,
};
/* 8025878C-802587A4 2530CC 0018+00 1/1 0/0 0/0 .text __ct__9dSn_HIO_cFv */
dSn_HIO_c::dSn_HIO_c() {
mFileSelWaitTime = 15;
}
/* 802587A4-80258820 2530E4 007C+00 1/0 0/0 0/0 .text phase_1__FPc */
static s32 phase_1(char* resName) {
mDoAud_bgmStart(-1);
if (dComIfG_setObjectRes(resName, (u8)0, NULL) == 0) {
return cPhs_ERROR_e;
}
return cPhs_NEXT_e;
}
/* 80258820-80258878 253160 0058+00 1/0 0/0 0/0 .text phase_2__FPc */
static s32 phase_2(char* resName) {
int syncStatus = dComIfG_syncObjectRes(resName);
if (syncStatus < 0) {
return cPhs_ERROR_e;
}
if (syncStatus > 0) {
return cPhs_INIT_e;
} else {
return cPhs_COMPLEATE_e;
}
}
/* 80258878-802588A0 2531B8 0028+00 1/1 0/0 0/0 .text
* resLoad__FP30request_of_phase_process_classPc */
static s32 resLoad(request_of_phase_process_class* i_phase, char* i_resName) {
static request_of_phase_process_fn l_method[2] = {
(request_of_phase_process_fn)phase_1,
(request_of_phase_process_fn)phase_2
};
return dComLbG_PhaseHandler(i_phase, l_method, i_resName);
}
s32 dScnName_c::create() {
int phase_state = resLoad(&field_0x1c4, "fileSel");
if (phase_state == cPhs_COMPLEATE_e) {
mHeap = JKRExpHeap::create(0x180000, mDoExt_getGameHeap(), false);
field_0x1d0 = (JKRExpHeap*)mDoExt_setCurrentHeap(mHeap);
dRes_info_c* res = dComIfG_getObjectResInfo("fileSel");
dFs_c = new dFile_select_c(res->getArchive());
dFs_c->_create();
if (fpcM_GetName(this) == PROC_NAME_SCENE) {
dFs_c->setUseType(0);
dComIfGs_setNoFile(0);
}
mBrightCheck = new dBrightCheck_c(res->getArchive());
field_0x420 = 0;
g_snHIO.field_0x4 = -1;
field_0x1d0->becomeCurrentHeap();
dComIfGp_setWindowNum(1);
dComIfGp_setWindow(0, 0.0f, 0.0f, mDoMch_render_c::getFbWidth(),
mDoMch_render_c::getEfbHeight(), 0.0f, 1.0f, 0, 2);
dDlst_window_c* window = dComIfGp_getWindow(0);
dComIfGp_setCamera(0, (camera_class*)&mCamera);
mCamera.mNear = 1.0f;
mCamera.mFar = 100000.0f;
mCamera.mFovy = 45.0f;
mCamera.mAspect = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getHeightF();
mCamera.mLookat.mEye.set(0.0f, 0.0f, -1000.0f);
mCamera.mLookat.mCenter.set(0.0f, 0.0f, 0.0f);
mCamera.mBank = 0;
dComIfGp_setPlayer(0, NULL);
dComIfGd_setWindow(window);
dComIfGd_setViewport(window->getViewPort());
dComIfGd_setView(&mCamera);
mDoGph_gInf_c::offAutoForcus();
setView();
dKy_setLight_init();
field_0x41e = g_snHIO.mFileSelWaitTime;
field_0x41c = 0;
field_0x41d = 0;
mDoGph_gInf_c::setTickRate((OS_BUS_CLOCK / 4) / 30);
dComIfGp_getVibration().Init();
}
return phase_state;
}
/* 80258B2C-80258BC8 25346C 009C+00 1/1 0/0 0/0 .text setView__10dScnName_cFv */
void dScnName_c::setView() {
C_MTXPerspective(mCamera.mProjMtx, mCamera.mFovy, mCamera.mAspect, mCamera.mNear,
mCamera.mFar);
mDoMtx_lookAt(mCamera.mViewMtx, &mCamera.mLookat.mEye, &mCamera.mLookat.mCenter,
mCamera.mBank);
MTXInverse(mCamera.mViewMtx, mCamera.mInvViewMtx);
MTXCopy(mCamera.mViewMtx, mCamera.mViewMtxNoTrans);
mCamera.mViewMtxNoTrans[0][3] = 0.0f;
mCamera.mViewMtxNoTrans[1][3] = 0.0f;
mCamera.mViewMtxNoTrans[2][3] = 0.0f;
MTXCopy(mCamera.mViewMtx, j3dSys.mViewMtx);
mDoMtx_concatProjView(mCamera.mProjMtx, mCamera.mViewMtx, mCamera.mProjViewMtx);
}
/* 80258BC8-80258C5C 253508 0094+00 1/1 0/0 0/0 .text execute__10dScnName_cFv */
s32 dScnName_c::execute() {
if (fopOvlpM_IsPeek() == 0) {
dComIfG_resetToOpening(this);
}
if (mDoRst::isReset() && field_0x420 == 0 && !dFs_c->getFadeFlag()) {
return 1;
}
(this->*MainProc[field_0x41d])();
return 1;
}
/* 80258C5C-80258CC8 25359C 006C+00 1/1 0/0 0/0 .text draw__10dScnName_cFv */
s32 dScnName_c::draw() {
dComIfGp_getVibration().Run();
switch (field_0x41c) {
case 0:
dFs_c->_draw();
break;
case 1:
mBrightCheck->_draw();
break;
}
return 1;
}
/* 80258CC8-80258DD0 253608 0108+00 1/1 0/0 0/0 .text __dt__10dScnName_cFv */
dScnName_c::~dScnName_c() {
delete dFs_c;
delete mBrightCheck;
dComIfG_deleteObjectResMain("fileSel");
mHeap->destroy();
for (int i = 0; i < 4; i++) {
dMeter2Info_changeWater(i + SLOT_11);
}
dComIfGp_setWindowNum(0);
dComIfGd_setView(NULL);
}
/* 80258DD0-80258E34 253710 0064+00 1/0 0/0 0/0 .text FileSelectOpen__10dScnName_cFv */
void dScnName_c::FileSelectOpen() {
if (field_0x41e != 0) {
field_0x41e--;
} else {
mDoAud_bgmStreamPrepare(0x2000000);
mDoAud_bgmStreamPlay();
field_0x41d = 1;
}
}
/* 80258E34-80258E78 253774 0044+00 1/0 0/0 0/0 .text FileSelectMain__10dScnName_cFv */
void dScnName_c::FileSelectMain() {
dFs_c->_move();
if (fpcM_GetName(this) == PROC_NAME_SCENE) {
FileSelectMainNormal();
}
}
/* 80258E78-80258F20 2537B8 00A8+00 1/1 0/0 0/0 .text FileSelectMainNormal__10dScnName_cFv */
void dScnName_c::FileSelectMainNormal() {
switch(dFs_c->isSelectEnd()) {
case 1:
field_0x41e = 15;
mDoGph_gInf_c::setFadeColor(*(JUtility::TColor*)&g_blackColor);
mDoGph_gInf_c::startFadeOut(15);
field_0x41d = 2;
field_0x420 = 1;
break;
}
}
/* 80258F20-80258FD4 253860 00B4+00 1/0 0/0 0/0 .text FileSelectClose__10dScnName_cFv */
void dScnName_c::FileSelectClose() {
field_0x41e--;
if (field_0x41e == 0) {
field_0x41d = 3;
field_0x41e = 15;
field_0x41c = 1;
mDoGph_gInf_c::setFadeColor(*(JUtility::TColor*)&g_blackColor);
mDoGph_gInf_c::startFadeIn(15);
field_0x420 = 0;
}
}
/* 80258FD4-80259008 253914 0034+00 1/0 0/0 0/0 .text brightCheckOpen__10dScnName_cFv */
void dScnName_c::brightCheckOpen() {
if (!mDoRst::isReset()) {
field_0x41e--;
if (field_0x41e == 0) {
field_0x41d = 4;
}
}
}
/* 80259008-802590F8 253948 00F0+00 1/0 0/0 0/0 .text brightCheck__10dScnName_cFv */
void dScnName_c::brightCheck() {
mBrightCheck->_move();
if (mBrightCheck->isEnd()) {
dComIfGs_setSaveTotalTime(dComIfGs_getTotalTime());
dComIfGs_setSaveStartTime(OSGetTime());
mDoAud_bgmStop(0x2D);
field_0x41f = 0;
field_0x41d = 5;
dComIfGs_offItemFirstBit(GREEN_RUPEE);
dComIfGs_offItemFirstBit(BLUE_RUPEE);
dComIfGs_offItemFirstBit(YELLOW_RUPEE);
dComIfGs_offItemFirstBit(RED_RUPEE);
dComIfGs_offItemFirstBit(PURPLE_RUPEE);
dComIfGs_offItemFirstBit(ORANGE_RUPEE);
dComIfGs_offItemFirstBit(SILVER_RUPEE);
}
}
/* 802590F8-802591C0 253A38 00C8+00 1/0 0/0 0/0 .text changeGameScene__10dScnName_cFv */
void dScnName_c::changeGameScene() {
if (!mDoRst::isReset() && !fopOvlpM_IsPeek()) {
dComIfGs_gameStart();
fopScnM_ChangeReq(this, field_0x41f == 0 ? PROC_PLAY_SCENE : PROC_PLAY_SCENE, 0, 5);
dComIfGp_offEnableNextStage();
if (dFs_c->isDataNew(dFs_c->getSelectNum())) {
dComIfGp_setNextStage("F_SP108", 21, 1, 13);
}
dKy_clear_game_init();
dComIfGs_resetDan();
dComIfGs_setRestartRoomParam(0);
}
}
/* 802591C0-802591E0 253B00 0020+00 1/0 0/0 0/0 .text dScnName_Draw__FP10dScnName_c */
static int dScnName_Draw(dScnName_c* i_this) {
return i_this->draw();
}
/* 802591E0-80259200 253B20 0020+00 1/0 0/0 0/0 .text dScnName_Execute__FP10dScnName_c */
static int dScnName_Execute(dScnName_c* i_this) {
return i_this->execute();
}
/* 80259200-80259230 253B40 0030+00 1/0 0/0 0/0 .text dScnName_IsDelete__FP10dScnName_c
*/
static int dScnName_IsDelete(dScnName_c*) {
dComIfGp_particle_cleanup();
return 1;
}
/* 80259230-80259258 253B70 0028+00 1/0 0/0 0/0 .text dScnName_Delete__FP10dScnName_c */
static int dScnName_Delete(dScnName_c* i_this) {
i_this->~dScnName_c();
return 1;
}
/* 80259258-80259294 253B98 003C+00 1/0 0/0 0/0 .text dScnName_Create__FP11scene_class */
static int dScnName_Create(scene_class* i_this) {
new (i_this) dScnName_c();
return static_cast<dScnName_c*>(i_this)->create();
}
/* 803C30DC-803C30F0 -00001 0014+00 2/0 0/0 0/0 .data l_dScnName_Method */
static leafdraw_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,
};
/* 803C30F0-803C3118 -00001 0028+00 0/0 0/0 1/0 .data g_profile_NAME_SCENE */
extern scene_process_profile_definition g_profile_NAME_SCENE = {
fpcLy_ROOT_e,
1,
fpcPi_CURRENT_e,
PROC_NAME_SCENE,
&g_fpcNd_Method.mBase,
sizeof(dScnName_c),
0,
0,
&g_fopScn_Method.mBase,
(process_method_class*)&l_dScnName_Method,
NULL,
};
/* 803C3118-803C3140 -00001 0028+00 0/0 0/0 1/0 .data g_profile_NAMEEX_SCENE */
extern scene_process_profile_definition g_profile_NAMEEX_SCENE = {
fpcLy_ROOT_e,
1,
fpcPi_CURRENT_e,
PROC_NAMEEX_SCENE,
&g_fpcNd_Method.mBase,
sizeof(dScnName_c),
0,
0,
&g_fopScn_Method.mBase,
(process_method_class*)&l_dScnName_Method,
NULL,
};
|