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
|
//
// Generated by dtk
// Translation Unit: d_place_name.cpp
//
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_place_name.h"
#include "f_op/f_op_msg.h"
#include "f_op/f_op_msg_mng.h"
#include "d/d_com_inf_game.h"
#include "d/d_drawlist.h"
#include "d/d_meter.h"
#include "m_Do/m_Do_dvd_thread.h"
#include "m_Do/m_Do_ext.h"
#include "JSystem/JKernel/JKRArchive.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "JSystem/J2DGraph/J2DPane.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "stdio.h"
enum { dPn_stage_max_e = 19 };
#if VERSION == VERSION_PAL
const char * name_texture[] = {
"pn_01",
"pn_02",
"pn_03",
"pn_04",
"pn_05",
"pn_06",
"pn_07",
"pn_08",
"pn_09",
"pn_10",
"pn_11",
"pn_12",
"pn_13",
"pn_14",
"pn_15",
"pn_16",
"pn_17",
"pn_18",
"pn_19",
};
#else
const char * name_texture[] = {
"/res/placename/pn_01.bti",
"/res/placename/pn_02.bti",
"/res/placename/pn_03.bti",
"/res/placename/pn_04.bti",
"/res/placename/pn_05.bti",
"/res/placename/pn_06.bti",
"/res/placename/pn_07.bti",
"/res/placename/pn_08.bti",
"/res/placename/pn_09.bti",
"/res/placename/pn_10.bti",
"/res/placename/pn_11.bti",
"/res/placename/pn_12.bti",
"/res/placename/pn_13.bti",
"/res/placename/pn_14.bti",
"/res/placename/pn_15.bti",
"/res/placename/pn_16.bti",
"/res/placename/pn_17.bti",
"/res/placename/pn_18.bti",
"/res/placename/pn_19.bti",
};
#endif
/* 80160F60-801610A8 .text setScreen__13dPlace_name_cFPCcP10JKRArchive */
void dPlace_name_c::setScreen(const char* name, JKRArchive* arc) {
scrn = new J2DScreen();
JUT_ASSERT(VERSION_SELECT(69, 69, 91, 91), scrn != NULL);
scrn->set(name, arc);
fopMsgM_setPaneData(&pane, scrn, 0x706e);
scrn->search('blc1')->hide();
scrn->search('blc2')->hide();
}
/* 801610A8-80161100 .text _openAnime__13dPlace_name_cFv */
BOOL dPlace_name_c::_openAnime() {
if (getCounter() < 10) {
addCounter();
f32 alpha = fopMsgM_valueIncrease(10, getCounter(), 0);
fopMsgM_setNowAlpha(&pane, alpha);
}
return TRUE;
}
/* 80161100-80161174 .text _closeAnime__13dPlace_name_cFv */
BOOL dPlace_name_c::_closeAnime() {
BOOL ret = FALSE;
if (getCounter() > 0) {
decCounter();
f32 alpha = fopMsgM_valueIncrease(10, getCounter(), 0);
fopMsgM_setNowAlpha(&pane, alpha);
}
if (getCounter() <= 0)
ret = TRUE;
return ret;
}
/* 80161174-801611E0 .text draw__13dPlace_name_cFv */
void dPlace_name_c::draw() {
fopMsgM_setAlpha(&pane);
J2DOrthoGraph * graf = dComIfGp_getCurrentGrafPort();
graf->setPort();
scrn->draw(0.0f, 0.0f, graf);
}
/* 801611E0-801614E8 .text _create__5dPn_cFv */
cPhs_State dPn_c::_create() {
cPhs_State rt = dComIfG_resLoad(&mPhs, "PName");
if (dMenu_flag() || (dComIfGp_isHeapLockFlag() != 0 && dComIfGp_isHeapLockFlag() != 10) || dComIfGp_getMesgStatus() != 0)
return cPhs_INIT_e;
if (mState == 0) {
if (rt == cPhs_COMPLEATE_e) {
dRes_info_c * resInfo = dComIfG_getObjectResInfo("PName");
JUT_ASSERT(VERSION_SELECT(147, 147, 169, 169), resInfo != NULL);
mpHeap = dComIfGp_getExpHeap2D();
dComIfGp_setHeapLockFlag(10);
JKRHeap * oldHeap = mDoExt_setCurrentHeap(mpHeap);
dPn_scrn = new dPlace_name_c();
JUT_ASSERT(VERSION_SELECT(155, 155, 177, 177), dPn_scrn != NULL);
dPn_scrn->setScreen("place_name.blo", resInfo->getArchive());
mpTIMG = (ResTIMG*)mpHeap->alloc(0x3c00, 0x20);
mDoExt_setCurrentHeap(oldHeap);
mState = 1;
dvd = NULL;
#if VERSION == VERSION_PAL
return cPhs_INIT_e;
#else
if (dComIfGp_getNowStageNum() != 0)
return cPhs_INIT_e;
#endif
} else {
return rt;
}
} else if (mState == 1) {
JKRHeap * oldHeap = mDoExt_setCurrentHeap(mpHeap);
JUT_ASSERT(VERSION_SELECT(175, 175, 201, 201), dComIfGp_getNowStageNum() < dPn_stage_max_e);
#if VERSION == VERSION_PAL
u32 lang = dComIfGs_getPalLanguage();
char buf[32];
sprintf(buf, "/res/placename/PN%d/pn_%02d_%d.bti", lang, dComIfGp_getNowStageNum() + 1, lang);
dvd = mDoDvdThd_toMainRam_c::create(buf, JKRArchive::DEFAULT_MOUNT_DIRECTION, mpHeap);
#else
dvd = mDoDvdThd_toMainRam_c::create(name_texture[dComIfGp_getNowStageNum()], JKRArchive::DEFAULT_MOUNT_DIRECTION, mpHeap);
#endif
mState = 2;
mDoExt_setCurrentHeap(oldHeap);
return cPhs_INIT_e;
} else {
JKRHeap * oldHeap = mDoExt_setCurrentHeap(mpHeap);
if (dvd->sync()) {
memcpy(mpTIMG, dvd->getMemAddress(), 0x3c00);
#if VERSION <= VERSION_JPN
DCFlushRangeNoSync(mpTIMG, 0x3c00);
#else
DCStoreRangeNoSync(mpTIMG, 0x3c00);
#endif
dPn_scrn->changeTexture(mpTIMG);
mState = 3;
}
mDoExt_setCurrentHeap(oldHeap);
if (mState != 3)
return cPhs_INIT_e;
}
return cPhs_COMPLEATE_e;
}
/* 801614E8-80161554 .text _execute__5dPn_cFv */
BOOL dPn_c::_execute() {
if (dComIfGp_checkStageName() == 2) {
dPn_scrn->_openAnime();
} else if (dComIfGp_checkStageName() == 1) {
if (dPn_scrn->_closeAnime())
fopMsgM_Delete(this);
}
return TRUE;
}
/* 80161554-80161594 .text _draw__5dPn_cFv */
BOOL dPn_c::_draw() {
dComIfGd_set2DOpa(dPn_scrn);
return TRUE;
}
/* 80161594-8016168C .text _delete__5dPn_cFv */
BOOL dPn_c::_delete() {
JKRHeap * oldHeap = mDoExt_setCurrentHeap(mpHeap);
dComIfGp_setStageNameDelete();
dPn_scrn->deleteScreen();
delete dPn_scrn;
if (dvd != NULL)
delete dvd;
mpHeap->free(mpTIMG);
mpHeap->freeAll();
dComIfGp_offHeapLockFlag();
mDoExt_setCurrentHeap(oldHeap);
dComIfG_resDeleteDemo(&mPhs, "PName");
return TRUE;
}
/* 8016168C-801616AC .text dPn_Draw__FP5dPn_c */
static BOOL dPn_Draw(dPn_c* i_this) {
return i_this->_draw();
}
/* 801616AC-801616CC .text dPn_Execute__FP5dPn_c */
static BOOL dPn_Execute(dPn_c* i_this) {
return i_this->_execute();
}
/* 801616CC-801616D4 .text dPn_IsDelete__FP5dPn_c */
static BOOL dPn_IsDelete(dPn_c* i_this) {
return TRUE;
}
/* 801616D4-801616F4 .text dPn_Delete__FP5dPn_c */
static BOOL dPn_Delete(dPn_c* i_this) {
return i_this->_delete();
}
/* 801616F4-80161714 .text dPn_Create__FP9msg_class */
static cPhs_State dPn_Create(msg_class* i_msg) {
dPn_c * i_this = (dPn_c *)i_msg;
return i_this->_create();
}
static msg_method_class l_dPlace_name_Method = {
(process_method_func)dPn_Create,
(process_method_func)dPn_Delete,
(process_method_func)dPn_Execute,
(process_method_func)dPn_IsDelete,
(process_method_func)dPn_Draw,
};
msg_process_profile_definition g_profile_PLACE_NAME = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 12,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_PLACE_NAME_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(dPn_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopMsg_Method,
/* Draw Prio */ fpcDwPi_PLACE_NAME_e,
/* Msg SubMtd */ &l_dPlace_name_Method,
};
|