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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
|
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_title.h"
#include "d/d_s_logo.h"
#include "d/d_s_play.h"
#include "d/d_demo.h"
#include "d/d_pane_class_alpha.h"
#include "d/d_menu_collect.h"
#include "m_Do/m_Do_Reset.h"
#include "m_Do/m_Do_controller_pad.h"
#include "d/d_com_inf_game.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "f_op/f_op_overlap_mng.h"
#include "f_op/f_op_msg_mng.h"
#include "f_op/f_op_scene_mng.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/JKernel/JKRMemArchive.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "m_Do/m_Do_graphic.h"
class daTit_HIO_c : public JORReflexible {
public:
daTit_HIO_c();
virtual ~daTit_HIO_c() {}
void genMessage(JORMContext*);
/* 0x04 */ s8 id;
/* 0x08 */ f32 mPSScaleX;
/* 0x0C */ f32 mPSScaleY;
/* 0x10 */ f32 mPSPosX;
/* 0x14 */ f32 mPSPosY;
#if DEBUG
/* 0x18 */ u8 unk_0x18[0x48 - 0x18];
#endif
/* 0x18 */ u8 mAppear;
/* 0x19 */ u8 mArrow;
/* 0x1A */ u8 field_0x1a;
};
static daTit_HIO_c g_daTitHIO;
static u8 const lit_3772[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#if VERSION == VERSION_GCN_PAL
static char const l_arcName[] = "TitlePal";
#else
static char const l_arcName[] = "Title";
#endif
daTit_HIO_c::daTit_HIO_c() {
mPSScaleX = 1.0f;
mPSScaleY = 1.0f;
#if VERSION == VERSION_GCN_PAL
switch (OSGetLanguage()) {
case OS_LANGUAGE_ENGLISH:
case OS_LANGUAGE_GERMAN:
case OS_LANGUAGE_SPANISH:
case OS_LANGUAGE_ITALIAN:
case OS_LANGUAGE_DUTCH:
mPSPosX = 303.0f;
break;
case OS_LANGUAGE_FRENCH:
mPSPosX = FB_WIDTH / 2;
break;
}
#else
mPSPosX = 303.0f;
#endif
mPSPosY = 347.0f;
mAppear = 15;
mArrow = 60;
field_0x1a = 15;
}
#if DEBUG
void daTit_HIO_c::genMessage(JORMContext* mctx) {
mctx->genLabel("\n======= PRESS START ========", 0);
mctx->genSlider("Scale X", &mPSScaleX, 0.1f, 100.0f);
mctx->genSlider("Scale Y", &mPSScaleY, 0.1f, 100.0f);
mctx->genSlider("Pos X", &mPSPosX, 0.0f, 1000.0f);
mctx->genSlider("Pos Y", &mPSPosY, 0.0f, 1000.0f);
mctx->genLabel("\n======= ", 0);
mctx->genSlider("出現", &mAppear, 0, 255);
mctx->genSlider("矢印", &mArrow, 0, 255);
}
#endif
int daTitle_c::CreateHeap() {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 10);
JUT_ASSERT(258, modelData);
mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000285);
if (mpModel == NULL) {
return 0;
}
int res = mBck.init((J3DAnmTransform*)dComIfG_getObjectRes(l_arcName, 7), 1, 0, 2.0f, 0, -1, false);
JUT_ASSERT(276, res == 1);
res = mBpk.init(modelData, (J3DAnmColor*)dComIfG_getObjectRes(l_arcName, 13), 1, 0, 2.0f, 0, -1);
JUT_ASSERT(283, res == 1);
res = mBrk.init(modelData, (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 16), 1, 0, 2.0f, 0, -1);
JUT_ASSERT(290, res == 1);
res = mBtk.init(modelData, (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 19), 1, 0, 2.0f, 0, -1);
JUT_ASSERT(297, res == 1);
return 1;
}
static procFunc daTitleProc[6] = {
&daTitle_c::loadWait_proc, &daTitle_c::logoDispWait, &daTitle_c::logoDispAnm,
&daTitle_c::keyWait, &daTitle_c::nextScene_proc, &daTitle_c::fastLogoDisp,
};
int daTitle_c::create() {
fopAcM_ct(this, daTitle_c);
int phase_state = dComIfG_resLoad(&mPhaseReq, l_arcName);
if (phase_state != cPhs_COMPLEATE_e) {
return phase_state;
}
if (!fopAcM_entrySolidHeap(this, createHeapCallBack, 0x4000)) {
return cPhs_ERROR_e;
}
mpMount = mDoDvdThd_mountArchive_c::create("/res/Layout/Title2D.arc", 0, NULL);
mIsDispLogo = 0;
field_0x5f9 = 0;
m2DHeap = JKRCreateExpHeap(0x8000, mDoExt_getGameHeap(), false);
JUT_ASSERT(345, m2DHeap != NULL);
loadWait_init();
g_daTitHIO.id = mDoHIO_CREATE_CHILD("タイトルロゴ", &g_daTitHIO);
return phase_state;
}
int daTitle_c::createHeapCallBack(fopAc_ac_c* actor) {
daTitle_c* i_this = (daTitle_c*)actor;
return i_this->CreateHeap();
}
int daTitle_c::Execute() {
#if PLATFORM_WII || PLATFORM_SHIELD
mDoGph_gInf_c::resetDimming();
#endif
if (fopOvlpM_IsPeek()) {
return 1;
}
dMenu_Collect3D_c::setViewPortOffsetY(0.0f);
if (mDoRst::isReset()) {
return 1;
}
(this->*daTitleProc[mProcID])();
KeyWaitAnm();
#if VERSION == VERSION_SHIELD_DEBUG
KeyWaitPosMove();
#endif
return 1;
}
void daTitle_c::KeyWaitAnm() {
if (field_0x5f9 != 0) {
if (field_0x604 == 0) {
if (field_0x5fa != 0) {
field_0x600->alphaAnime(g_daTitHIO.mArrow, 0, 255, 0);
} else {
field_0x600->alphaAnimeLoop(g_daTitHIO.mArrow, 255, 128, 0);
}
if (field_0x600->getAlpha() == 255) {
if (field_0x5fa != 0) {
field_0x5fa = 0;
}
field_0x604 = g_daTitHIO.field_0x1a;
}
}
if (field_0x604 != 0) {
field_0x604--;
}
}
}
#if VERSION == VERSION_SHIELD_DEBUG
void daTitle_c::KeyWaitPosMove() {
J2DPane* pane = mTitle.Scr->search(MULTI_CHAR('n_all'));
pane->translate(g_daTitHIO.mPSPosX, g_daTitHIO.mPSPosY);
pane->scale(g_daTitHIO.mPSScaleX, g_daTitHIO.mPSScaleY);
}
#endif
void daTitle_c::loadWait_init() {
mProcID = 0;
}
void daTitle_c::loadWait_proc() {
if (mpMount->sync()) {
mpHeap = mDoExt_setCurrentHeap(m2DHeap);
mpFont = mDoExt_getMesgFont();
mTitle.Scr = new J2DScreen();
JUT_ASSERT(529, mTitle.Scr != NULL);
mTitle.Scr->setPriority("zelda_press_start.blo", 0x100000, mpMount->getArchive());
J2DTextBox* text[7];
text[0] = (J2DTextBox*)mTitle.Scr->search(MULTI_CHAR('t_s_00'));
text[1] = (J2DTextBox*)mTitle.Scr->search(MULTI_CHAR('t_s_01'));
text[2] = (J2DTextBox*)mTitle.Scr->search(MULTI_CHAR('t_s_02'));
text[3] = (J2DTextBox*)mTitle.Scr->search(MULTI_CHAR('t_s_03'));
text[4] = (J2DTextBox*)mTitle.Scr->search(MULTI_CHAR('t_s_04'));
text[5] = (J2DTextBox*)mTitle.Scr->search(MULTI_CHAR('t_s_05'));
text[6] = (J2DTextBox*)mTitle.Scr->search('t_o');
for (int i = 0; i < 7; i++) {
text[i]->setFont(mpFont);
text[i]->setString(0x80, "");
char* msg = text[i]->getStringPtr();
fopMsgM_messageGet(msg, 100);
}
field_0x600 = new CPaneMgrAlpha(mTitle.Scr, MULTI_CHAR('n_all'), 2, NULL);
field_0x600->setAlpha(0);
J2DPane* pane = mTitle.Scr->search(MULTI_CHAR('n_all'));
pane->translate(g_daTitHIO.mPSPosX, g_daTitHIO.mPSPosY);
pane->scale(g_daTitHIO.mPSScaleX, g_daTitHIO.mPSScaleY);
JKRSetCurrentHeap(mpHeap);
logoDispWaitInit();
}
}
void daTitle_c::logoDispWaitInit() {
mProcID = 1;
}
void daTitle_c::logoDispWait() {
if (mDoCPd_c::getTrigA(PAD_1) || mDoCPd_c::getTrigStart(PAD_1)) {
fastLogoDispInit();
} else if (getDemoPrm() == 1) {
logoDispAnmInit();
}
}
void daTitle_c::logoDispAnmInit() {
mBck.setPlaySpeed(1.0f);
mBpk.setPlaySpeed(1.0f);
mBrk.setPlaySpeed(1.0f);
mBtk.setPlaySpeed(1.0f);
mIsDispLogo = 1;
mProcID = 2;
}
void daTitle_c::logoDispAnm() {
mBck.play();
mBpk.play();
mBrk.play();
mBtk.play();
if (mBrk.isStop() && mBtk.isStop() && mBck.isStop() && mBpk.isStop()) {
field_0x600->alphaAnimeStart(0);
field_0x604 = 0;
field_0x5f9 = 1;
field_0x5fa = 1;
keyWaitInit();
}
}
void daTitle_c::keyWaitInit() {
mProcID = 3;
}
void daTitle_c::keyWait() {
if (mDoCPd_c::getTrigA(PAD_1) || mDoCPd_c::getTrigStart(PAD_1)) {
mDoAud_seStart(Z2SE_TITLE_ENTER, NULL, 0, 0);
nextScene_init();
}
}
void daTitle_c::nextScene_init() {
mProcID = 4;
}
void daTitle_c::nextScene_proc() {
scene_class* playScene;
if (!fopOvlpM_IsPeek() && !mDoRst::isReset()) {
playScene = fopScnM_SearchByID(dStage_roomControl_c::getProcID());
JUT_ASSERT(706, playScene != NULL);
#if DEBUG
if (!dScnLogo_c::isOpeningCut())
#endif
{
fopScnM_ChangeReq(playScene, fpcNm_NAME_SCENE_e, 0, 5);
}
#if DEBUG
else {
fopScnM_ChangeReq(playScene, fpcNm_MENU_SCENE_e, 0, 5);
dComIfGs_init();
dComIfG_playerStatusD();
}
#endif
#if VERSION != VERSION_SHIELD_DEBUG
mDoGph_gInf_c::setFadeColor(*(JUtility::TColor*)&g_blackColor);
#endif
}
}
void daTitle_c::fastLogoDispInit() {
mBck.setFrame(mBck.getEndFrame() - 1.0f);
mBpk.setFrame(mBpk.getEndFrame() - 1.0f);
mBrk.setFrame(mBrk.getEndFrame() - 1.0f);
mBtk.setFrame(mBtk.getEndFrame() - 1.0f);
field_0x600->alphaAnimeStart(0);
field_0x604 = 0;
mWaitTimer = 30;
mProcID = 5;
}
void daTitle_c::fastLogoDisp() {
if (mWaitTimer != 0) {
mWaitTimer--;
return;
}
field_0x5f9 = 1;
field_0x5fa = 1;
mIsDispLogo = 1;
keyWaitInit();
}
int daTitle_c::getDemoPrm() {
dDemo_actor_c* demoActor = dDemo_c::getActor(demoActorID);
dDemo_prm_c* prm;
if (demoActor != NULL && demoActor->checkEnable(1) && (prm = demoActor->getPrm())) {
JStudio::stb::TParseData_fixed<49> parser(prm->getData());
TValueIterator_raw<u8> iter = parser.begin();
return *iter;
}
return -1;
}
int daTitle_c::Draw() {
J3DModelData* modelData = mpModel->getModelData();
cMtx_trans(mpModel->getBaseTRMtx(), IREG_F(7), IREG_F(8), IREG_F(9) + -430.0f);
mpModel->getBaseScale()->x = -1.0f;
mBck.entry(modelData);
mBpk.entry(modelData);
mBrk.entry(modelData);
mBtk.entry(modelData);
dComIfGd_setListItem3D();
mDoExt_modelUpdateDL(mpModel);
dComIfGd_setList();
if (mIsDispLogo) {
dComIfGd_set2DOpaTop(&mTitle);
}
return 1;
}
int daTitle_c::Delete() {
mDoHIO_DELETE_CHILD(g_daTitHIO.id);
dComIfG_resDelete(&mPhaseReq, l_arcName);
delete mTitle.Scr;
delete field_0x600;
mpMount->getArchive()->removeResourceAll();
JKRUnmountArchive(mpMount->getArchive());
mpMount->destroy();
if (m2DHeap != NULL) {
m2DHeap->destroy();
}
return 1;
}
static int daTitle_Draw(daTitle_c* i_this) {
return i_this->Draw();
}
static int daTitle_Execute(daTitle_c* i_this) {
return i_this->Execute();
}
static int daTitle_Delete(daTitle_c* i_this) {
fpc_ProcID id = fopAcM_GetID(i_this);
return i_this->Delete();
}
static int daTitle_Create(fopAc_ac_c* i_this) {
daTitle_c* a_this = (daTitle_c*)i_this;
fpc_ProcID id = fopAcM_GetID(i_this);
return a_this->create();
}
void dDlst_daTitle_c::draw() {
J2DGrafContext* ctx = dComIfGp_getCurrentGrafPort();
Scr->draw(0.0f, 0.0f, ctx);
}
static actor_method_class l_daTitle_Method = {
(process_method_func)daTitle_Create,
(process_method_func)daTitle_Delete,
(process_method_func)daTitle_Execute,
(process_method_func)NULL,
(process_method_func)daTitle_Draw,
};
actor_process_profile_definition g_profile_TITLE = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 7,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_TITLE_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(daTitle_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_TITLE_e,
/* Actor SubMtd */ &l_daTitle_Method,
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_UNK_0x4000_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
};
|