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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
|
//
// Generated By: dol2asm
// Translation Unit: d/d_map_path_fmap
//
#include "d/d_map_path_fmap.h"
#include "d/d_com_inf_game.h"
#include "dol2asm.h"
//
// Forward References:
//
extern "C" void addTypeGroupData__26fmpTresTypeGroupDataList_cFUcPCQ27dTres_c6data_s();
extern "C" void isArrival__22dMenu_Fmap_room_data_cFv();
extern "C" void buildTresTypeGroup__22dMenu_Fmap_room_data_cFiii();
extern "C" void buildFmapRoomData__22dMenu_Fmap_room_data_cFiiffff();
extern "C" void isArrival__23dMenu_Fmap_stage_data_cFv();
extern "C" void buildFmapStageData__23dMenu_Fmap_stage_data_cFiff();
extern "C" void getMenuFmapStageData__24dMenu_Fmap_region_data_cFi();
extern "C" void getPointStagePathInnerNo__24dMenu_Fmap_region_data_cFffiPiPi();
extern "C" void buildFmapRegionData__24dMenu_Fmap_region_data_cFi();
extern "C" void create__23dMenu_Fmap_world_data_cFP24dMenu_Fmap_region_data_c();
extern "C" void buildFmapWorldData__23dMenu_Fmap_world_data_cFv();
extern "C" void
init__22dMenuFmapIconPointer_cFP24dMenu_Fmap_region_data_cP23dMenu_Fmap_stage_data_cUcii();
extern "C" void getFirstData__22dMenuFmapIconPointer_cFv();
extern "C" void getData__22dMenuFmapIconPointer_cFv();
extern "C" void getFirstRoomData__22dMenuFmapIconPointer_cFv();
extern "C" void getNextRoomData__22dMenuFmapIconPointer_cFv();
extern "C" void getNextStageData__22dMenuFmapIconPointer_cFv();
extern "C" void getNextData__22dMenuFmapIconPointer_cFv();
extern "C" void nextData__22dMenuFmapIconPointer_cFv();
extern "C" void getValidData__22dMenuFmapIconPointer_cFv();
extern "C" void getPosition__19dMenuFmapIconDisp_cFPiPiPfPfPPCQ27dTres_c6data_s();
extern "C" void isDrawDisp__19dMenuFmapIconDisp_cFv();
extern "C" void __dt__26fmpTresTypeGroupDataList_cFv();
extern "C" void __dt__22fmpTresTypeGroupData_cFv();
extern "C" void __ct__26fmpTresTypeGroupDataList_cFv();
extern "C" extern void* __vt__19dMenuFmapIconDisp_c[3];
//
// External References:
//
extern "C" void dComIfGs_isStageTbox__Fii();
extern "C" void dComIfGs_isStageSwitch__Fii();
extern "C" void dComIfGp_isLightDropMapVisible__Fv();
extern "C" void isTbox__12dSv_memBit_cCFi();
extern "C" void isEventBit__11dSv_event_cCFUs();
extern "C" void isVisitedRoom__13dSv_memory2_cFi();
extern "C" void getSave2__10dSv_save_cFi();
extern "C" void isSwitch__10dSv_info_cCFii();
extern "C" void getFirstData__7dTres_cFUc();
extern "C" void getNextData__7dTres_cFPQ27dTres_c15typeGroupData_c();
extern "C" void getTypeGroupNoToType__7dTres_cFUc();
extern "C" void getTypeToTypeGroupNo__7dTres_cFUc();
extern "C" void* __nw__FUl();
extern "C" void __dl__FPv();
extern "C" void __construct_array();
extern "C" void _savegpr_14();
extern "C" void _savegpr_22();
extern "C" void _savegpr_26();
extern "C" void _savegpr_27();
extern "C" void _savegpr_28();
extern "C" void _savegpr_29();
extern "C" void _restgpr_14();
extern "C" void _restgpr_22();
extern "C" void _restgpr_26();
extern "C" void _restgpr_27();
extern "C" void _restgpr_28();
extern "C" void _restgpr_29();
extern "C" u8 saveBitLabels__16dSv_event_flag_c[1644 + 4 /* padding */];
//
// Declarations:
//
/* 8003D790-8003D818 0380D0 0088+00 1/1 0/0 0/0 .text
* addTypeGroupData__26fmpTresTypeGroupDataList_cFUcPCQ27dTres_c6data_s */
void fmpTresTypeGroupDataList_c::addTypeGroupData(u8 i_typeGroupNo,
dTres_c::data_s const* i_tresData) {
fmpTresTypeGroupData_c* next = mpNextData;
fmpTresTypeGroupData_c* fmpTresTypeGroupData_p = new fmpTresTypeGroupData_c();
if (mpTypeGroupDataHead == NULL) {
mpTypeGroupDataHead = fmpTresTypeGroupData_p;
}
fmpTresTypeGroupData_p->setTresData(i_tresData);
fmpTresTypeGroupData_p->setNextData(NULL);
fmpTresTypeGroupData_p->setTypeGroupNo(i_typeGroupNo);
if (next != NULL) {
next->setNextData(fmpTresTypeGroupData_p);
}
mpNextData = fmpTresTypeGroupData_p;
}
/* 8003D818-8003D868 038158 0050+00 1/1 1/1 0/0 .text isArrival__22dMenu_Fmap_room_data_cFv */
bool dMenu_Fmap_room_data_c::isArrival() {
u8 table_no = mp_parentStage->getStageArc()->mVisitedRoomSaveTableNo;
return dComIfGs_isSaveVisitedRoom(table_no, m_roomNo) != false;
}
/* 8003D868-8003D92C 0381A8 00C4+00 1/1 0/0 0/0 .text
* buildTresTypeGroup__22dMenu_Fmap_room_data_cFiii */
void dMenu_Fmap_room_data_c::buildTresTypeGroup(int i_stageNo, int i_roomIndex, int i_roomNo) {
dTres_c::list_class* tresure_p = mp_fmapData->getTresure();
if (tresure_p != NULL) {
int num = tresure_p->field_0x0;
dTres_c::data_s* data_p = tresure_p->field_0x4->getDataPointer();
if (mp_fmpTresTypeGroupDataListAll == NULL) {
mp_fmpTresTypeGroupDataListAll = new fmpTresTypeGroupDataListAll_c();
}
for (int i = 0; i < num; i++) {
data_p->mRoomNo = i_roomNo;
u8 typeGroupNo = dTres_c::getTypeToTypeGroupNo(data_p->mType);
mp_fmpTresTypeGroupDataListAll->addTypeGroupData(typeGroupNo, data_p);
data_p++;
}
}
}
/* 8003D92C-8003D95C 03826C 0030+00 1/1 0/0 0/0 .text
* buildFmapRoomData__22dMenu_Fmap_room_data_cFiiffff */
void dMenu_Fmap_room_data_c::buildFmapRoomData(int i_stageNo, int i_index, f32 i_regionOffsetX,
f32 i_regionOffsetZ, f32 i_stageOffsetX,
f32 i_stageOffsetZ) {
int roomNo = m_roomNo;
if (mp_fmapData != NULL) {
buildTresTypeGroup(i_stageNo, i_index, roomNo);
}
}
/* 8003D95C-8003D9D8 03829C 007C+00 1/1 0/0 0/0 .text isArrival__23dMenu_Fmap_stage_data_cFv */
bool dMenu_Fmap_stage_data_c::isArrival() {
bool is_arrival = false;
dMenu_Fmap_room_data_c* room = mp_roomTop;
int table_no = mpStageArc->getVisitedRoomSaveTableNo();
for (; !is_arrival && room != NULL; room = room->getNextData()) {
// fakematch: should be room->getRoomNo()
is_arrival = dComIfGs_isSaveVisitedRoom(table_no, room->m_roomNo) != false;
}
return is_arrival;
}
/* 8003D9D8-8003DB48 038318 0170+00 1/1 0/0 0/0 .text
* buildFmapStageData__23dMenu_Fmap_stage_data_cFiff */
int dMenu_Fmap_stage_data_c::buildFmapStageData(int i_stageNo, f32 i_regionOffsetX,
f32 i_regionOffsetZ) {
dMenu_Fmap_room_data_c* room = mp_roomTop;
f32 stage_min_x = FLT_MAX;
f32 stage_min_z = FLT_MAX;
f32 stage_max_x = -FLT_MAX;
f32 stage_max_z = -FLT_MAX;
int room_no = 0;
for (; room != NULL; room_no++, room = room->getNextData()) {
room->buildFmapRoomData(i_stageNo, room_no, i_regionOffsetX, i_regionOffsetZ,
m_offsetX, m_offsetZ);
f32 room_min_x = room->getFileList2MinX();
f32 room_min_z = room->getFileList2MinZ();
f32 room_max_x = room->getFileList2MaxX();
f32 room_max_z = room->getFileList2MaxZ();
if (room_min_x < stage_min_x) {
stage_min_x = room_min_x;
}
if (room_min_z < stage_min_z) {
stage_min_z = room_min_z;
}
if (room_max_x > stage_max_x) {
stage_max_x = room_max_x;
}
if (room_max_z > stage_max_z) {
stage_max_z = room_max_z;
}
}
if (room_no > 0) {
m_stageMinX = stage_min_x;
m_stageMinZ = stage_min_z;
m_stageMaxX = stage_max_x;
m_stageMaxZ = stage_max_z;
} else {
m_stageMinX = 0.0f;
m_stageMinZ = 0.0f;
m_stageMaxX = 0.0f;
m_stageMaxZ = 0.0f;
}
return room_no;
}
/* 8003DB48-8003DB70 038488 0028+00 0/0 1/1 0/0 .text
* getMenuFmapStageData__24dMenu_Fmap_region_data_cFi */
dMenu_Fmap_stage_data_c* dMenu_Fmap_region_data_c::getMenuFmapStageData(int param_0) {
dMenu_Fmap_stage_data_c* stage = mpMenuFmapStageDataTop;
for (int i = 0; stage != NULL && i < param_0; i++) {
stage = stage->getNextData();
}
return stage;
}
/* 8003DB70-8003DEE0 0384B0 0370+00 0/0 1/1 0/0 .text
* getPointStagePathInnerNo__24dMenu_Fmap_region_data_cFffiPiPi */
int dMenu_Fmap_region_data_c::getPointStagePathInnerNo(f32 i_pointX, f32 i_pointZ, int i_stageNo,
int* o_stageNo, int* o_roomNo) {
int line_num, group_num, floor_num;
f32* point;
u16* point_index;
dDrawPath_c::line_class* line;
dDrawPath_c::group_class* group;
dDrawPath_c::floor_class* floor;
f32* points;
dMenu_Fmap_room_data_c* room;
dMenu_Fmap_stage_data_c* stage;
int point_num, point_no;
int stage_no = 0;
bool outside, found;
int floor_no, group_no, line_no;
int found_stage_no = -1;
int dir, prev_dir;
int found_room_no = -1;
cXyz vec1, vec2, cross;
vec1.y = 0.0f;
vec2.y = 0.0f;
stage = mpMenuFmapStageDataTop;
for(; stage != NULL; stage = stage->getNextData(), stage_no++) {
if (stage->getStageArc() == NULL) continue;
int save_table_no = stage->getStageArc()->getVisitedRoomSaveTableNo();
room = stage->getFmapRoomDataTop();
for (; room != NULL; room = room->getNextData()) {
if (!(i_stageNo == stage_no || stage->isArrival())) continue;
// fakematch: should be room->getRoomNo()
if (!dComIfGs_isSaveVisitedRoom(save_table_no, room->m_roomNo)) continue;
f32 offsetX = mRegionOffsetX + stage->getOffsetX();
f32 offsetZ = mRegionOffsetZ + stage->getOffsetZ();
dMenu_Fmap_data_c* map_data = room->getFmapData();
if (map_data == NULL) continue;
dDrawPath_c::room_class* path = map_data->getMapPath();
if (path == NULL) continue;
floor = path->mpFloor;
points = path->mpFloatData;
if (floor == NULL) continue;
found = false;
floor_num = path->mFloorNum;
for (floor_no = 0; !found && floor_no < floor_num; floor_no++, floor++) {
group_num = floor->mGroupNum;
group = floor->mpGroup;
if (group == NULL) continue;
for (group_no = 0; !found && group_no < group_num; group_no++, group++) {
line_num = group->mLineNum;
if (line_num <= 0) continue;
line = group->mpLine;
if (line == NULL) continue;
for (line_no = 0; !found && line_no < line_num; line_no++, line++) {
if (line->field_0x1 != 3) continue;
point_num = line->mDataNum;
if (!(point_num >= 3)) continue;
outside = false;
point_index = line->mpData;
f32* prev_point = &points[point_index[0] * 2];
point = &points[point_index[1] * 2];
point_no = 2;
point_index += 2;
do {
vec1.x = prev_point[0] + offsetX - i_pointX;
vec1.z = prev_point[1] + offsetZ - i_pointZ;
vec2.x = point[0] + offsetX - i_pointX;
vec2.z = point[1] + offsetZ - i_pointZ;
PSVECCrossProduct(&vec1, &vec2, &cross);
if (cross.y >= 0.0f) {
dir = 0;
} else {
dir = -1;
}
if (point_no > 2 && dir != prev_dir) {
outside = true;
break;
}
prev_dir = dir;
prev_point = point;
point = &points[*point_index * 2];
point_no++;
point_index++;
} while (point_no <= point_num);
if (!outside) {
found = true;
found_stage_no = stage_no;
found_room_no = room->getRoomNo();
}
}
}
}
}
}
if (o_stageNo != NULL) {
*o_stageNo = found_stage_no;
}
if (o_roomNo != NULL) {
*o_roomNo = found_room_no;
}
return 1;
}
/* 8003DEE0-8003E028 038820 0148+00 0/0 1/1 0/0 .text
* buildFmapRegionData__24dMenu_Fmap_region_data_cFi */
int dMenu_Fmap_region_data_c::buildFmapRegionData(int param_0) {
f32 region_min_x = FLT_MAX;
f32 region_min_z = FLT_MAX;
f32 region_max_x = -FLT_MAX;
f32 region_max_z = -FLT_MAX;
dMenu_Fmap_stage_data_c* stage = mpMenuFmapStageDataTop;
int stage_no = 0;
for (; stage != NULL; stage_no++, stage = stage->getNextData()) {
stage->buildFmapStageData(stage_no, mRegionOffsetX, mRegionOffsetZ);
f32 stage_min_x = stage->getStageMinX() + stage->getOffsetX();
f32 stage_min_z = stage->getStageMinZ() + stage->getOffsetZ();
f32 stage_max_x = stage->getStageMaxX() + stage->getOffsetX();
f32 stage_max_z = stage->getStageMaxZ() + stage->getOffsetZ();
if (stage_min_x < region_min_x) {
region_min_x = stage_min_x;
}
if (stage_min_z < region_min_z) {
region_min_z = stage_min_z;
}
if (stage_max_x > region_max_x) {
region_max_x = stage_max_x;
}
if (stage_max_z > region_max_z) {
region_max_z = stage_max_z;
}
}
if (stage_no > 0) {
mRegionMinX = region_min_x;
mRegionMinZ = region_min_z;
mRegionMaxX = region_max_x;
mRegionMaxZ = region_max_z;
} else {
mRegionMinX = 0.0f;
mRegionMaxX = 0.0f;
mRegionMinZ = 0.0f;
mRegionMaxZ = 0.0f;
}
return stage_no;
}
/* 8003E028-8003E04C 038968 0024+00 0/0 1/1 0/0 .text
* create__23dMenu_Fmap_world_data_cFP24dMenu_Fmap_region_data_c */
void dMenu_Fmap_world_data_c::create(dMenu_Fmap_region_data_c* i_regionData) {
mp_fmapRegionData = i_regionData;
buildFmapWorldData();
}
/* 8003E04C-8003E114 03898C 00C8+00 1/1 0/0 0/0 .text
* buildFmapWorldData__23dMenu_Fmap_world_data_cFv */
int dMenu_Fmap_world_data_c::buildFmapWorldData() {
f32 min_x = FLT_MAX;
f32 min_z = FLT_MAX;
f32 max_x = -FLT_MAX;
f32 max_z = -FLT_MAX;
dMenu_Fmap_region_data_c* region = mp_fmapRegionData;
int region_no = 0;
for (; region != NULL; region_no++, region = region->getNextData()) {
f32 region_min_x = region->getRegionMinX() + region->getRegionOffsetX();
f32 region_min_z = region->getRegionMinZ() + region->getRegionOffsetZ();
f32 region_max_x = region->getRegionMaxX() + region->getRegionOffsetX();
f32 region_max_z = region->getRegionMaxZ() + region->getRegionOffsetZ();
if (region_min_x < min_x) {
min_x = region_min_x;
}
if (region_min_z < min_z) {
min_z = region_min_z;
}
if (region_max_x > max_x) {
max_x = region_max_x;
}
if (region_max_z > max_z) {
max_z = region_max_z;
}
}
if (region_no > 0) {
m_worldMinX = min_x;
m_worldMinZ = min_z;
m_worldMaxX = max_x;
m_worldMaxZ = max_z;
} else {
m_worldMinX = 0.0f;
m_worldMaxX = 0.0f;
m_worldMinZ = 0.0f;
m_worldMaxZ = 0.0f;
}
return region_no;
}
/* 8003E114-8003E1C0 038A54 00AC+00 0/0 3/3 0/0 .text
* init__22dMenuFmapIconPointer_cFP24dMenu_Fmap_region_data_cP23dMenu_Fmap_stage_data_cUcii */
bool dMenuFmapIconPointer_c::init(dMenu_Fmap_region_data_c* i_regionData,
dMenu_Fmap_stage_data_c* i_stageData, u8 i_typeGroupNo,
int i_stayStageNo, int i_stayRoomNo) {
stage_stag_info_class* stag_info = dComIfGp_getStage()->getStagInfo();
if (stag_info == NULL) {
return false;
}
mSaveTbl = i_dStage_stagInfo_GetSaveTbl(stag_info);
mpRegionData = i_regionData;
mpStageData = i_stageData;
mType = dTres_c::getTypeGroupNoToType(i_typeGroupNo);
mTypeGroupNo = i_typeGroupNo;
mStayStageNo = i_stayStageNo;
mStayRoomNo = i_stayRoomNo;
mStageNo = 0;
getFirstRoomData();
return true;
}
/* 8003E1C0-8003E2BC 038B00 00FC+00 2/2 0/0 0/0 .text getFirstData__22dMenuFmapIconPointer_cFv */
bool dMenuFmapIconPointer_c::getFirstData() {
bool ret = false;
if (!strcmp(mpStageData->getStageName(), dComIfGp_getStartStageName())) {
mpTresTypeGroupData = dTres_c::getFirstData(mTypeGroupNo);
mpTresData = mpTresTypeGroupData->getConstDataPointer();
} else {
mpFmpTresTypeGroupDataList = NULL;
mpFmpTresTypeGroupData = NULL;
mpTresData = NULL;
mpFmpTresTypeGroupDataListAll = mpRoomData->getTypeGroupDataListAll();
if (mpFmpTresTypeGroupDataListAll != NULL) {
mpFmpTresTypeGroupDataList =
mpFmpTresTypeGroupDataListAll->getTypeGroupDataList(mTypeGroupNo);
if (mpFmpTresTypeGroupDataList != NULL) {
mpFmpTresTypeGroupData = mpFmpTresTypeGroupDataList->getTypeGroupDataHead();
if (mpFmpTresTypeGroupData != NULL) {
do {
mpTresData = mpFmpTresTypeGroupData->getTresData();
if (mpTresData != NULL) {
ret = true;
break;
}
mpFmpTresTypeGroupData = mpFmpTresTypeGroupData->getNextData();
} while (mpTresData != NULL); // !@bug presumably supposed to be mpFmpTresTypeGroupData != NULL
}
}
}
}
return ret;
}
/* 8003E2BC-8003E350 038BFC 0094+00 1/1 0/0 0/0 .text getData__22dMenuFmapIconPointer_cFv
*/
bool dMenuFmapIconPointer_c::getData() {
bool ret = false;
if (!strcmp(mpStageData->getStageName(), dComIfGp_getStartStageName())) {
if (mpTresTypeGroupData != NULL
&& mpRoomData->getRoomNo() == mpTresTypeGroupData->getRoomNo())
{
mpTresData = mpTresTypeGroupData->getConstDataPointer();
ret = true;
}
} else {
if (mpTresData != NULL) {
ret = true;
}
}
return ret;
}
/* 8003E350-8003E37C 038C90 002C+00 2/2 0/0 0/0 .text getFirstRoomData__22dMenuFmapIconPointer_cFv
*/
void dMenuFmapIconPointer_c::getFirstRoomData() {
mpRoomData = mpStageData->getFmapRoomDataTop();
getFirstData();
}
/* 8003E37C-8003E3A4 038CBC 0028+00 1/1 0/0 0/0 .text getNextRoomData__22dMenuFmapIconPointer_cFv
*/
bool dMenuFmapIconPointer_c::getNextRoomData() {
bool ret = false;
mpRoomData = mpRoomData->getNextData();
if (mpRoomData == NULL) {
ret = true;
}
return ret;
}
/* 8003E3A4-8003E3D8 038CE4 0034+00 1/1 0/0 0/0 .text getNextStageData__22dMenuFmapIconPointer_cFv
*/
bool dMenuFmapIconPointer_c::getNextStageData() {
bool ret = false;
mStageNo++;
mpStageData = mpStageData->getNextData();
if (mpStageData == NULL) {
ret = true;
}
return ret;
}
/* 8003E3D8-8003E490 038D18 00B8+00 1/1 0/0 0/0 .text getNextData__22dMenuFmapIconPointer_cFv */
bool dMenuFmapIconPointer_c::getNextData() {
bool ret = true;
if (!strcmp(mpStageData->getStageName(), dComIfGp_getStartStageName())) {
if (mpTresTypeGroupData != NULL) {
mpTresTypeGroupData = dTres_c::getNextData(mpTresTypeGroupData);
if (mpTresTypeGroupData != NULL) {
mpTresData = mpTresTypeGroupData->getConstDataPointer();
ret = false;
}
}
} else {
if (mpFmpTresTypeGroupData != NULL) {
mpFmpTresTypeGroupData = mpFmpTresTypeGroupData->getNextData();
if (mpFmpTresTypeGroupData != NULL) {
mpTresData = mpFmpTresTypeGroupData->getTresData();
if (mpTresData != NULL) {
ret = false;
}
}
}
}
return ret;
}
/* 8003E490-8003E510 038DD0 0080+00 1/1 3/3 0/0 .text nextData__22dMenuFmapIconPointer_cFv */
bool dMenuFmapIconPointer_c::nextData() {
bool ret = false;
if (getNextData()) {
if (getNextRoomData()) {
if (getNextStageData()) {
ret = true;
} else {
getFirstRoomData();
}
} else {
getFirstData();
}
}
return ret;
}
/* 8003E510-8003E578 038E50 0068+00 0/0 3/3 0/0 .text getValidData__22dMenuFmapIconPointer_cFv */
bool dMenuFmapIconPointer_c::getValidData() {
bool iVar1, iVar2 = false;
do {
iVar1 = getData();
if (!iVar1) {
iVar2 = nextData();
}
} while (!iVar2 && !iVar1);
return iVar2;
}
/* 8003E578-8003E6E8 038EB8 0170+00 0/0 3/3 0/0 .text
* getPosition__19dMenuFmapIconDisp_cFPiPiPfPfPPCQ27dTres_c6data_s */
bool dMenuFmapIconDisp_c::getPosition(int* o_stageNo, int* o_roomNo, f32* o_posX, f32* o_posZ,
dTres_c::data_s const** o_tresData) {
f32 offset_x = mpRegionData->getRegionOffsetX() + mpStageData->getOffsetX();
f32 offset_z = mpRegionData->getRegionOffsetZ() + mpStageData->getOffsetZ();
if (o_posX != NULL) {
*o_posX = 0.0f;
}
if (o_posZ != NULL) {
*o_posZ = 0.0f;
}
if (o_stageNo != NULL) {
*o_stageNo = mStageNo;
}
if (o_roomNo != NULL) {
*o_roomNo = mpRoomData->getRoomNo();
}
if (!strcmp(mpStageData->getStageName(), dComIfGp_getStartStageName())) {
if (mpTresTypeGroupData != NULL) {
if (o_tresData != NULL) {
*o_tresData = mpTresTypeGroupData->getConstDataPointer();
}
if (o_posX != NULL) {
*o_posX = offset_x + mpTresTypeGroupData->getPos()->x;
}
if (o_posZ != NULL) {
*o_posZ = offset_z + mpTresTypeGroupData->getPos()->z;
}
}
} else {
if (mpTresData != NULL) {
if (o_tresData != NULL) {
*o_tresData = mpTresData;
}
if (o_posX != NULL) {
*o_posX = offset_x + mpTresData->mPos.x;
}
if (o_posZ != NULL) {
*o_posZ = offset_z + mpTresData->mPos.z;
}
}
}
return false;
}
#ifndef NONMATCHING
/* ############################################################################################## */
/* 803A7D38-803A7D74 -00001 003C+00 1/1 0/0 0/0 .data @4467 */
SECTION_DATA static void* lit_4467[15] = {
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x40C),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0xA8),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x40C),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x40C),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x154),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x1FC),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x308),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x40C),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0xA8),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x40C),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x35C),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x40C),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x40C),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x388),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x388),
};
#endif
/* 8003E6E8-8003EB10 039028 0428+00 2/0 3/3 0/0 .text isDrawDisp__19dMenuFmapIconDisp_cFv
*/
#ifdef NONMATCHING
//? regalloc
bool dMenuFmapIconDisp_c::isDrawDisp() {
bool ret;
dMenu_Fmap_stage_arc_data_c* stage_arc = mpStageData->getStageArc();
if (stage_arc == NULL) {
return false;
}
u8 save_table_no = stage_arc->getSaveTableNo();
int room_no = mpRoomData->getRoomNo();
bool bVar2 = (mStayStageNo == mStageNo && mStayRoomNo == room_no) || mpRoomData->isArrival();
ret = false;
bool bVar1;
switch (mTypeGroupNo) {
case 1:
case 8:
if (save_table_no == mSaveTbl) {
ret = bVar2 && (mpTresData->mSwBit == 0xff ||
(mpTresData->mSwBit != 0xff && dComIfGs_isSwitch(mpTresData->mSwBit, room_no)));
} else {
ret = bVar2 && (mpTresData->mSwBit == 0xff ||
(mpTresData->mSwBit != 0xff && mpTresData->mSwBit < 0x80
&& dComIfGs_isStageSwitch(save_table_no, mpTresData->mSwBit)));
}
break;
case 4:
bVar1 = false;
if (dComIfGp_isLightDropMapVisible()) {
if (dComIfGp_getStartStageDarkArea() == 2) {
int tres_no = mpTresData->mNo;
if (tres_no == 0x33 || tres_no == 0x34 || tres_no == 0x35) {
if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[119])) {
bVar1 = true;
}
} else {
bVar1 = true;
}
} else {
bVar1 = true;
}
}
if (bVar1 && mpTresData->mNo != 0xff && !dComIfGs_isStageTbox(save_table_no, mpTresData->mNo)) {
ret = true;
}
break;
case 5:
if (save_table_no == mSaveTbl) {
ret = (mpTresData->mNo == 0xff ||
(mpTresData->mNo != 0xff && !dComIfGs_isTbox(mpTresData->mNo)))
&& (mpTresData->mSwBit == 0xff || (mpTresData->mSwBit != 0xff
&& dComIfGs_isSwitch(mpTresData->mSwBit, room_no)));
} else {
ret = (mpTresData->mNo == 0xff || (mpTresData->mNo != 0xff
&& !dComIfGs_isStageTbox(save_table_no, mpTresData->mNo)))
&& (mpTresData->mSwBit == 0xff ||
(mpTresData->mSwBit != 0xff && mpTresData->mSwBit < 0x80 &&
dComIfGs_isStageSwitch(save_table_no, mpTresData->mSwBit)));
}
break;
case 6:
if (save_table_no == mSaveTbl) {
ret = dComIfGs_isSwitch(mpTresData->mSwBit, room_no) ? true : false;
} else {
if (mpTresData->mSwBit < 0x80) {
ret = dComIfGs_isStageSwitch(save_table_no, mpTresData->mSwBit) ? true : false;
}
}
break;
case 10:
ret = mpTresData->mNo != 0xff && dComIfGs_isStageTbox(save_table_no, mpTresData->mNo);
break;
case 13:
case 14:
if (save_table_no == mSaveTbl) {
ret = mpTresData->mSwBit == 0xff ||
(mpTresData->mSwBit != 0xff && dComIfGs_isSwitch(mpTresData->mSwBit, room_no));
} else {
ret = mpTresData->mSwBit == 0xff || (mpTresData->mSwBit < 0x80
&& dComIfGs_isStageSwitch(save_table_no, mpTresData->mSwBit));
}
break;
}
return ret;
}
#else
bool dMenuFmapIconDisp_c::isDrawDisp() {
// NONMATCHING
}
#endif
/* 8003EB10-8003EB70 039450 0060+00 1/1 1/1 0/0 .text __dt__26fmpTresTypeGroupDataList_cFv */
fmpTresTypeGroupDataList_c::~fmpTresTypeGroupDataList_c() {
if (mpTypeGroupDataHead != NULL) {
delete mpTypeGroupDataHead;
}
}
/* 8003EC90-8003ECA0 0395D0 0010+00 1/1 0/0 0/0 .text __ct__26fmpTresTypeGroupDataList_cFv */
fmpTresTypeGroupDataList_c::fmpTresTypeGroupDataList_c() {
mpTypeGroupDataHead = NULL;
mpNextData = NULL;
}
|