Skip to content

Commit b398570

Browse files
committed
d_a_title debug / handle shield rel changes
1 parent fc4282d commit b398570

File tree

5 files changed

+164
-73
lines changed

5 files changed

+164
-73
lines changed

configure.py

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -524,18 +524,31 @@ def RevolutionLib(lib_name: str, objects: List[Object], extra_cflags=[]) -> Dict
524524
}
525525

526526
# Helper function for REL script objects
527-
def Rel(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
528-
return {
529-
"lib": lib_name,
530-
"mw_version": MWVersion(config.version),
531-
"cflags": [*cflags_rel],
532-
"progress_category": "game",
533-
"objects": objects,
534-
}
527+
def Rel(lib_name: str, objects: List[Object], isInDol=False) -> Dict[str, Any]:
528+
if (config.version == "ShieldD" or config.version == "Shield") and isInDol:
529+
# For Shield version, some RELs were moved into the DOL
530+
return {
531+
"lib": lib_name,
532+
"mw_version": MWVersion(config.version),
533+
"cflags": [*cflags_framework, "-D__FORCE_REL_IN_DOL__=1"],
534+
"progress_category": "game",
535+
"objects": objects,
536+
}
537+
else:
538+
return {
539+
"lib": lib_name,
540+
"mw_version": MWVersion(config.version),
541+
"cflags": [*cflags_rel],
542+
"progress_category": "game",
543+
"objects": objects,
544+
}
535545

536546
# Helper function for actor RELs
537-
def ActorRel(status: bool, rel_name: str, extra_cflags: List[str]=[]) -> Dict[str, Any]:
538-
return Rel(rel_name, [Object(status, f"d/actor/{rel_name}.cpp", extra_cflags=extra_cflags, scratch_preset_id=70)])
547+
def ActorRel(status: bool, rel_name: str, extra_cflags: List[str]=[], isInDol=False) -> Dict[str, Any]:
548+
if isInDol:
549+
return Rel(rel_name, [Object(status, f"d/actor/{rel_name}.cpp", extra_cflags=extra_cflags, scratch_preset_id=70)], True)
550+
else:
551+
return Rel(rel_name, [Object(status, f"d/actor/{rel_name}.cpp", extra_cflags=extra_cflags, scratch_preset_id=70)])
539552

540553

541554
# Helper function for JSystem libraries
@@ -2228,15 +2241,15 @@ def MatchingFor(*versions) -> bool:
22282241
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_allmato"),
22292242
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_camera"), # debug extra weak fns
22302243
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_chkpoint"), # debug weak func order
2231-
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_event"), # TODO: this is part of Rframework in ShieldD
2244+
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_event", [], True), # TODO: this is part of Rframework in ShieldD
22322245
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_evt"), # debug extra weak fns
22332246
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_evtarea"), # debug weak func order
22342247
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_evtmsg"), # debug weak func order
22352248
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_howl"), # debug weak func order
22362249
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_kmsg"),
22372250
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_lantern"), # debug weak func order
22382251
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_mist"), # debug weak func order
2239-
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_msg"), # TODO: this is part of Rframework in ShieldD
2252+
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_msg", [], True), # TODO: this is part of Rframework in ShieldD
22402253
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_push"), # debug weak func order
22412254
ActorRel(MatchingFor(ALL_GCN, "Shield"), "d_a_tag_telop"), # debug weak func order
22422255
ActorRel(MatchingFor(ALL_GCN), "d_a_tbox"),
@@ -2257,7 +2270,7 @@ def MatchingFor(*versions) -> bool:
22572270
ActorRel(MatchingFor(ALL_GCN), "d_a_suspend"),
22582271
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_attention"),
22592272
ActorRel(MatchingFor(ALL_GCN), "d_a_alldie"),
2260-
ActorRel(MatchingFor(ALL_GCN), "d_a_andsw2"),
2273+
ActorRel(MatchingFor(ALL_GCN), "d_a_andsw2", [], True),
22612274
ActorRel(MatchingFor(ALL_GCN), "d_a_bd"),
22622275
ActorRel(MatchingFor(ALL_GCN), "d_a_canoe"),
22632276
ActorRel(MatchingFor(ALL_GCN), "d_a_cstaF"),
@@ -2271,7 +2284,7 @@ def MatchingFor(*versions) -> bool:
22712284
ActorRel(MatchingFor(ALL_GCN), "d_a_e_rd"),
22722285
ActorRel(MatchingFor(ALL_GCN), "d_a_econt"),
22732286
ActorRel(MatchingFor(ALL_GCN), "d_a_fr"),
2274-
ActorRel(MatchingFor(ALL_GCN), "d_a_grass"),
2287+
ActorRel(MatchingFor(ALL_GCN), "d_a_grass", [], True),
22752288
ActorRel(MatchingFor(ALL_GCN, "Shield"), "d_a_kytag05"),
22762289
ActorRel(MatchingFor(ALL_GCN), "d_a_kytag10"),
22772290
ActorRel(MatchingFor(ALL_GCN), "d_a_kytag11"),
@@ -2318,7 +2331,7 @@ def MatchingFor(*versions) -> bool:
23182331
ActorRel(MatchingFor(ALL_GCN), "d_a_scene_exit2"),
23192332
ActorRel(MatchingFor(ALL_GCN), "d_a_shop_item"),
23202333
ActorRel(MatchingFor(ALL_GCN), "d_a_sq"),
2321-
ActorRel(MatchingFor(ALL_GCN), "d_a_swc00"),
2334+
ActorRel(MatchingFor(ALL_GCN), "d_a_swc00", [], True),
23222335
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_CstaSw"), # debug weak func order
23232336
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_ajnot"), # debug weak func order
23242337
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_attack_item"), # debug weak func order
@@ -2464,7 +2477,7 @@ def MatchingFor(*versions) -> bool:
24642477
ActorRel(Equivalent, "d_a_hozelda"), # weak func order (J3DMtxCalcNoAnm)
24652478
ActorRel(MatchingFor(ALL_GCN), "d_a_izumi_gate"),
24662479
ActorRel(MatchingFor(ALL_GCN), "d_a_kago"),
2467-
ActorRel(MatchingFor(ALL_GCN), "d_a_kytag01"),
2480+
ActorRel(MatchingFor(ALL_GCN), "d_a_kytag01", [], True),
24682481
ActorRel(MatchingFor(ALL_GCN), "d_a_kytag02"),
24692482
ActorRel(MatchingFor(ALL_GCN), "d_a_kytag03"),
24702483
ActorRel(MatchingFor(ALL_GCN), "d_a_kytag06"),
@@ -2534,7 +2547,7 @@ def MatchingFor(*versions) -> bool:
25342547
ActorRel(MatchingFor(ALL_GCN), "d_a_npc_lf"),
25352548
ActorRel(MatchingFor(ALL_GCN), "d_a_npc_lud"),
25362549
ActorRel(MatchingFor(ALL_GCN), "d_a_npc_midp"),
2537-
ActorRel(MatchingFor(ALL_GCN, ALL_SHIELD), "d_a_npc_mk"),
2550+
ActorRel(MatchingFor(ALL_GCN, ALL_SHIELD), "d_a_npc_mk", [], True),
25382551
ActorRel(MatchingFor(ALL_GCN), "d_a_npc_moi"),
25392552
ActorRel(MatchingFor(ALL_GCN), "d_a_npc_moir"),
25402553
ActorRel(MatchingFor(ALL_GCN), "d_a_npc_myna2"),
@@ -2682,7 +2695,7 @@ def MatchingFor(*versions) -> bool:
26822695
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_iceblock"),
26832696
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_iceleaf"),
26842697
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_ihasi"),
2685-
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_ikada"),
2698+
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_ikada", [], True),
26862699
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_inobone"),
26872700
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_ita"),
26882701
ActorRel(MatchingFor(ALL_GCN), "d_a_obj_itamato"),
@@ -2940,7 +2953,7 @@ def MatchingFor(*versions) -> bool:
29402953
ActorRel(MatchingFor(ALL_GCN, ALL_WII, "Shield"), "d_a_tag_setBall"), # debug weak func order
29412954
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_setrestart"), # debug weak func order
29422955
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_shop_camera"), # debug weak func order
2943-
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_shop_item"), # debug weak func order
2956+
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_shop_item", [], True), # debug weak func order
29442957
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_smk_emt"), # debug weak func order
29452958
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_spinner"), # debug weak func order
29462959
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_sppath"), # debug weak func order
@@ -2954,7 +2967,7 @@ def MatchingFor(*versions) -> bool:
29542967
ActorRel(MatchingFor(ALL_GCN), "d_a_tag_yami"), # debug weak func order
29552968
ActorRel(MatchingFor(ALL_GCN), "d_a_talk"),
29562969
ActorRel(MatchingFor(ALL_GCN, "Shield"), "d_a_tboxSw"),
2957-
ActorRel(MatchingFor(ALL_GCN), "d_a_title"),
2970+
ActorRel(MatchingFor(ALL_GCN), "d_a_title", [], True),
29582971
ActorRel(MatchingFor(ALL_GCN), "d_a_warp_bug"),
29592972
]
29602973

include/d/actor/d_a_title.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class CPaneMgrAlpha;
2525
*/
2626
class daTitle_c : public fopAc_ac_c {
2727
public:
28-
//daTitle_c() {}
2928
int CreateHeap();
3029
int create();
3130
static int createHeapCallBack(fopAc_ac_c*);
@@ -47,6 +46,10 @@ class daTitle_c : public fopAc_ac_c {
4746
int Draw();
4847
int Delete();
4948

49+
#if VERSION == VERSION_SHIELD_DEBUG
50+
void KeyWaitPosMove();
51+
#endif
52+
5053
private:
5154
/* 0x568 */ request_of_phase_process_class mPhaseReq;
5255
/* 0x570 */ JKRHeap* mpHeap;
@@ -60,11 +63,11 @@ class daTitle_c : public fopAc_ac_c {
6063
/* 0x5E4 */ dDlst_daTitle_c mTitle;
6164
/* 0x5EC */ JUTFont* mpFont;
6265
/* 0x5F0 */ u8 field_0x5f0[8];
63-
/* 0x5F8 */ u8 field_0x5f8;
66+
/* 0x5F8 */ u8 mIsDispLogo;
6467
/* 0x5F9 */ u8 field_0x5f9;
6568
/* 0x5FA */ u8 field_0x5fa;
6669
/* 0x5FB */ u8 mProcID;
67-
/* 0x5FC */ u8 field_0x5fc;
70+
/* 0x5FC */ u8 mWaitTimer;
6871
/* 0x600 */ CPaneMgrAlpha* field_0x600;
6972
/* 0x604 */ u8 field_0x604;
7073
}; // Size: 0x608

include/d/d_menu_collect.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ class dMenu_Collect3D_c {
209209

210210
virtual ~dMenu_Collect3D_c();
211211

212+
static void setViewPortOffsetY(f32 i_offset) {
213+
mViewOffsetY = i_offset;
214+
}
215+
212216
static f32 mViewOffsetY;
213217

214218
private:

include/d/dolzel_rel.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
#ifndef DOLZEL_REL_H
22
#define DOLZEL_REL_H
33

4-
#if __MWERKS__ && !defined(DECOMPCTX)
5-
#include "d/dolzel_rel.mch"
4+
// Shield versions move some RELs into the DOL, so need a way to switch which
5+
// precompiled headers are being used depending on some variable
6+
#if __FORCE_REL_IN_DOL__
7+
#if __MWERKS__ && !defined(DECOMPCTX)
8+
#include "d/dolzel.mch"
9+
#else
10+
#include "d/dolzel.pch"
11+
#endif
612
#else
7-
#include "d/dolzel_rel.pch"
13+
#if __MWERKS__ && !defined(DECOMPCTX)
14+
#include "d/dolzel_rel.mch"
15+
#else
16+
#include "d/dolzel_rel.pch"
17+
#endif
818
#endif
919

1020
#endif // DOLZEL_REL_H

0 commit comments

Comments
 (0)