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
|
//
// Generated by dtk
// Translation Unit: f_pc_manager.cpp
//
#include "d/dolzel.h" // IWYU pragma: keep
#include "f_pc/f_pc_manager.h"
#include "f_pc/f_pc_creator.h"
#include "f_pc/f_pc_draw.h"
#include "f_pc/f_pc_deletor.h"
#include "f_pc/f_pc_fstcreate_req.h"
#include "f_pc/f_pc_layer_iter.h"
#include "f_pc/f_pc_line.h"
#include "f_pc/f_pc_pause.h"
#include "f_pc/f_pc_priority.h"
#include "d/d_com_inf_game.h"
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_Reset.h"
#include "SSystem/SComponent/c_lib.h"
#include "SSystem/SComponent/c_API_graphic.h"
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "JSystem/J2DGraph/J2DPicture.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "JSystem/J3DGraphBase/J3DSys.h"
#include "JSystem/JAudio/JAIStreamMgr.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/dvd/dvd.h"
#include "dolphin/gx/GX.h"
#include "assets/black_tex.h"
#include "assets/msg_data.h"
#if VERSION == VERSION_PAL
#include "assets/msg_data_ge.h"
#include "assets/msg_data_fr.h"
#include "assets/msg_data_sp.h"
#include "assets/msg_data_it.h"
#endif
#include "assets/font_data.h"
/* 8003E318-8003E338 .text fpcM_Draw__FPv */
BOOL fpcM_Draw(void* i_proc) {
return fpcDw_Execute((base_process_class*)i_proc);
}
/* 8003E338-8003E370 .text fpcM_DrawIterater__FPFPvPv_i */
BOOL fpcM_DrawIterater(fpcM_DrawIteraterFunc i_drawIterFunc) {
return fpcLyIt_OnlyHere(fpcLy_RootLayer(), (fpcLyIt_OnlyHereFunc)i_drawIterFunc, NULL);
}
/* 8003E370-8003E390 .text fpcM_Execute__FPv */
BOOL fpcM_Execute(void* i_proc) {
return fpcEx_Execute((base_process_class*)i_proc);
}
/* 8003E390-8003E3B0 .text fpcM_Delete__FPv */
BOOL fpcM_Delete(void* i_proc) {
return fpcDt_Delete((base_process_class*)i_proc);
}
/* 8003E3B0-8003E3D0 .text fpcM_IsCreating__FUi */
BOOL fpcM_IsCreating(fpc_ProcID pID) {
return fpcCt_IsCreatingByID(pID);
}
struct BMG_INF1 : JUTDataBlockHeader {
/* 0x08 */ u8 m08[0x10 - 0x08];
/* 0x10 */ u32 entries[6];
};
/* 8003E3D0-8003E9F0 .text messageSet__FUl */
void messageSet(u32 status) {
#if VERSION == VERSION_PAL
BMG_INF1* inf1;
if (dComIfGs_getPalLanguage() == 1) {
inf1 = (BMG_INF1*)&msg_data_ge[0x20];
} else if (dComIfGs_getPalLanguage() == 2) {
inf1 = (BMG_INF1*)&msg_data_fr[0x20];
} else if (dComIfGs_getPalLanguage() == 3) {
inf1 = (BMG_INF1*)&msg_data_sp[0x20];
} else if (dComIfGs_getPalLanguage() == 4) {
inf1 = (BMG_INF1*)&msg_data_it[0x20];
} else {
inf1 = (BMG_INF1*)&msg_data[0x20]; // English
}
#else
BMG_INF1* inf1 = (BMG_INF1*)&msg_data[0x20];
#endif
u8* dat1Block = (u8*)inf1 + inf1->mSize;
const char * msg = (const char*)(dat1Block + sizeof(JUTDataBlockHeader) + inf1->entries[status]);
f32 f30 = 0.0f;
f32 f31 = 660.0f;
f32 f29 = 200.0f;
J2DTextBox * tpane = new J2DTextBox('TXT1', JGeometry::TBox2<f32>(f30, f30, f30 + f31, f30 + f29), (ResFONT*)font_data, msg, HBIND_CENTER, VBIND_CENTER);
JUT_ASSERT(VERSION_SELECT(299, 299, 321, 321), tpane != NULL);
J2DTextBox * spane = new J2DTextBox('TXT2', JGeometry::TBox2<f32>(f30, f30, f30 + f31, f30 + f29), (ResFONT*)font_data, msg, HBIND_CENTER, VBIND_CENTER);
JUT_ASSERT(VERSION_SELECT(307, 307, 329, 329), spane != NULL);
J2DPicture * ppane = new J2DPicture('PIC1', JGeometry::TBox2<f32>(0.0f, 0.0f, 665.0f, 530.0f), (ResTIMG*)black_tex, NULL);
JUT_ASSERT(VERSION_SELECT(312, 312, 334, 334), ppane != NULL);
J2DTextBox::TFontSize size;
size.mSizeX = 27.0f;
size.mSizeY = 27.0f;
tpane->setFontSize(size);
tpane->setCharColor(JUtility::TColor(0xFF, 0xC8, 0x00, 0xFF));
tpane->setGradColor(JUtility::TColor(0xFF, 0xB4, 0x00, 0xFF));
tpane->setCharSpace(0.0f);
tpane->setLineSpace(27.0f);
tpane->setBlack(JUtility::TColor(0xFF, 0xFF, 0xFF, 0x00));
spane->setFontSize(size);
spane->setCharColor(JUtility::TColor(0x00, 0x00, 0x00, 0xC8));
spane->setGradColor(JUtility::TColor(0x00, 0x00, 0x00, 0xC8));
spane->setCharSpace(0.0f);
spane->setLineSpace(27.0f);
ppane->setAlpha(130);
#if VERSION > VERSION_JPN
JUTResFont * font = new JUTResFont((ResFONT*)font_data, NULL);
#endif
s16 height = 27;
#if VERSION > VERSION_JPN
f32 maxWidth = 0.0f;
s32 curLine = 0;
f32 lineWidth[6];
for (s32 i = 0; i < (s32)ARRAY_SIZE(lineWidth); i++) {
lineWidth[i] = 0.0f;
}
#endif
for (; *msg != '\0'; msg++) {
if (*msg == '\n') {
height += 27;
#if VERSION > VERSION_JPN
curLine++;
#endif
continue;
}
#if VERSION > VERSION_JPN
lineWidth[curLine] += font->JUTFont::getWidth((u8)*msg);
#endif
}
#if VERSION > VERSION_JPN
for (s32 i = 0; i < (s32)ARRAY_SIZE(lineWidth); i++) {
f32 width = lineWidth[i];
if (maxWidth < width)
maxWidth = width;
}
#endif
#if VERSION <= VERSION_JPN
f32 x = -9.0f + (659.0f - f31) / 2.0f; // -9.5f;
#else
f32 x = (659.0f - maxWidth) / 2.0f + -9.0f;
#endif
f32 y = (524 - height) / 2.0f + -21.0f;
ppane->draw(-12.0f, -24.0f, 665.0f, 530.0f, false, false, false);
#if VERSION == VERSION_PAL
if (dComIfGs_getPalLanguage() == 0) {
spane->draw(x + 2.0f, y + 10.0f + 2.0f, 660.0f, HBIND_LEFT);
tpane->draw(x, y + 10.0f, 660.0f, HBIND_LEFT);
} else {
spane->draw(-7.0f, y + 10.0f + 2.0f, 660.0f, HBIND_CENTER);
tpane->draw(-9.0f, y + 10.0f, 660.0f, HBIND_CENTER);
}
#else
spane->draw(x + 2.0f, y + 10.0f + 2.0f, f31, VERSION_SELECT(HBIND_CENTER, HBIND_CENTER, HBIND_LEFT, HBIND_LEFT));
tpane->draw(x, y + 10.0f, f31, VERSION_SELECT(HBIND_CENTER, HBIND_CENTER, HBIND_LEFT, HBIND_LEFT));
#endif
#if VERSION > VERSION_JPN
delete font;
#endif
delete ppane;
delete tpane;
delete spane;
}
/* 8003E9F0-8003EBD4 .text drawDvdCondition__Fl */
void drawDvdCondition(long status) {
#if VERSION > VERSION_DEMO
#if VERSION == VERSION_PAL
JUtility::TColor backColor = g_clearColor;
#else
JFWDisplay::getManager()->setFader(NULL);
JUtility::TColor backColor = mDoGph_gInf_c::getBackColor();
#endif
JFWDisplay::getManager()->setClearColor(backColor);
JFWDisplay::getManager()->beginRender();
GXSetAlphaUpdate(GX_FALSE);
j3dSys.drawInit();
J2DOrthoGraph draw2D(0.0f, 0.0f, 640.0f, 480.0f, -1.0f, 1.0);
draw2D.setOrtho(-9.0f, -21.0f, 659.0f, 524.0f, -1.0f, 1.0f);
draw2D.setPort();
dComIfGp_setCurrentGrafPort(&draw2D);
#endif
if (status == 4) {
messageSet(2);
} else if (status == 5) {
messageSet(1);
} else if (status == 6) {
messageSet(3);
} else if (status == 11) {
messageSet(4);
} else if (status == 1) {
messageSet(0);
#if VERSION == VERSION_DEMO
} else {
messageSet(5);
}
#else
} else if (status == -1) {
messageSet(5);
#if VERSION > VERSION_JPN
JAInter::StreamLib::stop();
#endif
} else {
JUT_WARN(VERSION_SELECT(423, 423, 481, 478), "Dvd Error !! <%d>\n", status);
}
#endif
#if VERSION > VERSION_DEMO
JFWDisplay::getManager()->endRender();
#if VERSION == VERSION_PAL
JFWDisplay::getManager()->setFader(NULL);
#endif
#endif
}
/* 8003EBD4-8003EC84 .text checkDvdCondition__Fv */
int checkDvdCondition() {
static int l_dvdError = 0;
int status = DVDGetDriveStatus();
if (status != 0 && status != 1)
l_dvdError = 1;
if (l_dvdError != 0) {
if (status == 0) {
l_dvdError = 0;
} else if (mDoRst::isReset()) {
#if VERSION == VERSION_DEMO
mDoRst_reset(1, 0x80000000, 1);
mDoRst::offReset();
#else
mDoRst::offReset();
mDoRst_reset(1, 0x80000000, 0);
#endif
} else {
drawDvdCondition(status);
}
}
return l_dvdError;
}
/* 8003EC84-8003ED90 .text fpcM_Management__FPFv_vPFv_v */
void fpcM_Management(fpcM_ManagementFunc callBack1, fpcM_ManagementFunc callBack2) {
MtxInit();
#if VERSION == VERSION_DEMO
cAPIGph_Painter();
#endif
if (checkDvdCondition())
return;
#if VERSION > VERSION_DEMO
cAPIGph_Painter();
#endif
fpcDt_Handler();
if (!fpcPi_Handler())
JUT_ASSERT(VERSION_SELECT(460, 490, 548, 547), 0);
if (!fpcCt_Handler())
JUT_ASSERT(VERSION_SELECT(464, 494, 552, 551), 0);
if (callBack1 != NULL)
callBack1();
fpcEx_Handler((fpcLnIt_QueueFunc)fpcM_Execute);
fpcDw_Handler((fpcDw_HandlerFuncFunc)fpcM_DrawIterater, (fpcDw_HandlerFunc)fpcM_Draw);
if (callBack2 != NULL)
callBack2();
}
/* 8003ED90-8003EDCC .text fpcM_Init__Fv */
void fpcM_Init() {
static layer_class rootlayer;
static node_list_class queue[10];
fpcLy_Create(&rootlayer, NULL, queue, 10);
fpcLn_Create();
}
/* 8003EDCC-8003EE20 .text fpcM_FastCreate__FsPFPv_iPvPv */
base_process_class* fpcM_FastCreate(s16 i_procTypeID, FastCreateReqFunc i_createReqFunc,
void* i_createData, void* i_data) {
return fpcFCtRq_Request(fpcLy_CurrentLayer(), i_procTypeID, (fstCreateFunc)i_createReqFunc,
i_createData, i_data);
}
/* 8003EE20-8003EE44 .text fpcM_IsPause__FPvUc */
s32 fpcM_IsPause(void* i_proc, u8 i_flag) {
return fpcPause_IsEnable((base_process_class*)i_proc, i_flag & 0xFF);
}
/* 8003EE44-8003EE68 .text fpcM_PauseEnable__FPvUc */
void fpcM_PauseEnable(void* i_proc, u8 i_flag) {
fpcPause_Enable((process_node_class*)i_proc, i_flag & 0xFF);
}
/* 8003EE68-8003EE8C .text fpcM_PauseDisable__FPvUc */
void fpcM_PauseDisable(void* i_proc, u8 i_flag) {
fpcPause_Disable((process_node_class*)i_proc, i_flag & 0xFF);
}
/* 8003EE8C-8003EF00 .text fpcM_JudgeInLayer__FUiPFPvPv_PvPv */
void* fpcM_JudgeInLayer(uint i_layerID, fpcCtIt_JudgeFunc i_judgeFunc, void* i_data) {
layer_class* layer = fpcLy_Layer(i_layerID);
if (layer != NULL) {
void* ret = fpcCtIt_JudgeInLayer(i_layerID, i_judgeFunc, i_data);
if (ret == NULL) {
ret = fpcLyIt_Judge(layer, i_judgeFunc, i_data);
}
return ret;
} else {
return NULL;
}
}
|