diff --git a/.vscode/settings.json b/.vscode/settings.json index 65c5cbc0b4..7ade75da5a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -30,14 +30,13 @@ "build/*/baseline.json": true, "build/**/*.MAP": true, "build/**/*.o": true, - "build/**/*.s": true, "build/**/*.plf": true, "build/**/*.rel": true, "orig/**/*.rel": true, "build/**/*.lcf": true, "build/**/*.preplf": true, "build/**/*.d": true, - // "build/**/*.s": true, + "build/**/*.s": true, "build/**/*.map": true, "build/**/*.cpp": true, "build/**/*.ctx": true, diff --git a/config/GZ2E01/rels/d_a_npc_kn/symbols.txt b/config/GZ2E01/rels/d_a_npc_kn/symbols.txt index ce0635131b..91fb91b8c0 100644 --- a/config/GZ2E01/rels/d_a_npc_kn/symbols.txt +++ b/config/GZ2E01/rels/d_a_npc_kn/symbols.txt @@ -463,8 +463,10 @@ mFindCount__10daNpc_Kn_c = .bss:0x00000110; // type:object size:0x4 scope:global @5904 = .bss:0x00000114; // type:object size:0xC scope:local l_HIO = .bss:0x00000120; // type:object size:0x4 scope:global data:4byte @12316 = .bss:0x00000124; // type:object size:0xC scope:local +init$9794 = .bss:0x00000130; // type:object size:0x1 scope:local align:1 lightAParticleScale$12315 = .bss:0x00000134; // type:object size:0xC scope:local @12320 = .bss:0x00000140; // type:object size:0xC scope:local +init$9798 = .bss:0x0000014C; // type:object size:0x1 scope:local align:1 lightALocalTrans$12319 = .bss:0x00000150; // type:object size:0xC scope:local sInstance__40JASGlobalInstance<19JASDefaultBankTable> = .bss:0x0000015C; // type:object size:0x4 scope:global sInstance__35JASGlobalInstance<14JASAudioThread> = .bss:0x00000160; // type:object size:0x4 scope:global diff --git a/config/GZ2E01/rels/d_a_obj_volcball/symbols.txt b/config/GZ2E01/rels/d_a_obj_volcball/symbols.txt index 3462411180..0e59010226 100644 --- a/config/GZ2E01/rels/d_a_obj_volcball/symbols.txt +++ b/config/GZ2E01/rels/d_a_obj_volcball/symbols.txt @@ -111,4 +111,4 @@ __vt__12dBgS_ObjAcch = .data:0x0000021C; // type:object size:0x24 scope:global __vt__8cM3dGAab = .data:0x00000240; // type:object size:0xC scope:global __vt__8cM3dGSph = .data:0x0000024C; // type:object size:0xC scope:global __vt__17dEvLib_callback_c = .data:0x00000258; // type:object size:0x18 scope:global -lbl_675_bss_0 = .bss:0x00000000; // type:object size:0x1 data:byte +init$1953 = .bss:0x00000000; // type:object size:0x1 scope:local align:1 diff --git a/config/GZ2E01/symbols.txt b/config/GZ2E01/symbols.txt index 1a64fb559f..aaddb0aa25 100644 --- a/config/GZ2E01/symbols.txt +++ b/config/GZ2E01/symbols.txt @@ -21705,18 +21705,8 @@ aram_cache_size = .sbss:0x80450C68; // type:object size:0x4 scope:global align:4 mSystemFar__14mDoLib_clipper = .sbss:0x80450C70; // type:object size:0x4 scope:global align:4 data:float mFovyRate__14mDoLib_clipper = .sbss:0x80450C74; // type:object size:0x4 scope:global align:4 data:float mResetData__6mDoRst = .sbss:0x80450C78; // type:object size:0x4 scope:global align:4 data:4byte -struct_80450C7C = .sbss:0x80450C7C; // type:object size:0x1 scope:global align:1 -struct_80450C7D = .sbss:0x80450C7D; // type:object size:0x1 scope:global align:1 -struct_80450C7E = .sbss:0x80450C7E; // type:object size:0x1 scope:global align:1 -struct_80450C7F = .sbss:0x80450C7F; // type:object size:0x1 scope:global align:1 SyncWidthSound__9mDoDvdThd = .sbss:0x80450C80; // type:object size:0x1 scope:global align:1 data:byte sDefaultDirection = .sbss:0x80450C81; // type:object size:0x1 scope:global align:1 data:byte -struct_80450C82 = .sbss:0x80450C82; // type:object size:0x1 scope:global align:1 -struct_80450C83 = .sbss:0x80450C83; // type:object size:0x1 scope:global align:1 -struct_80450C84 = .sbss:0x80450C84; // type:object size:0x1 scope:global align:1 -struct_80450C85 = .sbss:0x80450C85; // type:object size:0x1 scope:global align:1 -struct_80450C86 = .sbss:0x80450C86; // type:object size:0x1 scope:global align:1 -struct_80450C87 = .sbss:0x80450C87; // type:object size:0x1 scope:global align:1 mDoDvdErr_initialized = .sbss:0x80450C88; // type:object size:0x1 scope:global align:1 data:byte sConsole = .sbss:0x80450C90; // type:object size:0x4 scope:local align:4 data:4byte cDmr_SkipInfo = .sbss:0x80450C98; // type:object size:0x1 scope:global align:1 diff --git a/config/GZ2P01/rels/d_a_e_fb/symbols.txt b/config/GZ2P01/rels/d_a_e_fb/symbols.txt index 0067289040..176e6ce64d 100644 --- a/config/GZ2P01/rels/d_a_e_fb/symbols.txt +++ b/config/GZ2P01/rels/d_a_e_fb/symbols.txt @@ -114,7 +114,7 @@ __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:globa @1012 = .bss:0x0000003C; // type:object size:0x1 scope:local @1010 = .bss:0x00000040; // type:object size:0x1 scope:local @1009 = .bss:0x00000044; // type:object size:0x1 scope:local -l_HIOInit = .bss:0x00000045; // type:object size:0x1 data:byte scope:local +l_HIOInit = .bss:0x00000045; // type:object size:0x1 scope:local data:byte @3657 = .bss:0x00000048; // type:object size:0xC scope:local l_HIO = .bss:0x00000054; // type:object size:0x24 scope:global data:byte mFireTimer = .bss:0x00000078; // type:object size:0x4 scope:global data:4byte diff --git a/config/GZ2P01/splits.txt b/config/GZ2P01/splits.txt index 78ffa110f6..9668ea8812 100644 --- a/config/GZ2P01/splits.txt +++ b/config/GZ2P01/splits.txt @@ -788,7 +788,7 @@ d/actor/d_a_npc_cd2.cpp: .rodata start:0x80394A50 end:0x80395588 .data start:0x803B7EA0 end:0x803BBA80 .bss start:0x8042A5B0 end:0x8042E898 - .sbss start:0x80452FC0 end:0x80452FD8 + .sbss start:0x80452FC0 end:0x80452FD0 .sdata2 start:0x804554A0 end:0x80455510 d/actor/d_a_obj_item.cpp: @@ -797,6 +797,7 @@ d/actor/d_a_obj_item.cpp: .rodata start:0x80395588 end:0x80395598 .data start:0x803BBA80 end:0x803BBD58 .sdata start:0x80452668 end:0x80452670 + .sbss start:0x80452FD0 end:0x80452FD8 .sdata2 start:0x80455510 end:0x804555A0 d/d_insect.cpp: diff --git a/config/GZ2P01/symbols.txt b/config/GZ2P01/symbols.txt index 1c6d851a81..6b74538276 100644 --- a/config/GZ2P01/symbols.txt +++ b/config/GZ2P01/symbols.txt @@ -17486,7 +17486,7 @@ j2dDefaultIndTevStageInfo = .rodata:0x803A38D4; // type:object size:0xC scope:gl @1849 = .rodata:0x803A3900; // type:object size:0x10 scope:local align:4 data:4byte @3028 = .rodata:0x803A3910; // type:object size:0x10 scope:local align:4 data:4byte @3037 = .rodata:0x803A3920; // type:object size:0x14 scope:local align:4 data:4byte -@stringBase0 = .rodata:0x803A3938; // type:object size:0x4 scope:local align:4 data:string_table +@stringBase0 = .rodata:0x803A3938; // type:object size:0x3 scope:local align:4 data:string_table ...rodata.0 = .rodata:0x803A3940; // type:label scope:local align:4 @1508 = .rodata:0x803A3940; // type:object size:0x10 scope:local align:4 data:4byte @1557 = .rodata:0x803A3950; // type:object size:0x10 scope:local align:4 @@ -21954,7 +21954,7 @@ lbl_80452FC0 = .sbss:0x80452FC0; // type:object size:0x1 data:byte target = .sbss:0x80452FC4; // type:object size:0x4 scope:global align:4 data:4byte targetWay = .sbss:0x80452FC8; // type:object size:0x4 scope:global align:4 data:float wolfAngle = .sbss:0x80452FCC; // type:object size:0x2 scope:global align:4 data:2byte -lbl_80452FD0 = .sbss:0x80452FD0; // type:object size:0x1 data:byte +init$2639 = .sbss:0x80452FD0; // type:object size:0x1 scope:local align:1 data:byte m_midnaActor__9daPy_py_c = .sbss:0x80452FD8; // type:object size:0x4 scope:global align:4 data:4byte m_dropAngleY__20daPy_boomerangMove_c = .sbss:0x80452FDC; // type:object size:0x2 scope:global align:2 data:2byte m_eventKeepFlg__20daPy_boomerangMove_c = .sbss:0x80452FDE; // type:object size:0x2 scope:global align:2 data:2byte diff --git a/config/ShieldD/rels/d_a_npc_knD/symbols.txt b/config/ShieldD/rels/d_a_npc_knD/symbols.txt index 91ca489080..e9246fc16e 100644 --- a/config/ShieldD/rels/d_a_npc_knD/symbols.txt +++ b/config/ShieldD/rels/d_a_npc_knD/symbols.txt @@ -582,5 +582,7 @@ mFindActorPtrs__10daNpc_Kn_c = .bss:0x00000098; // type:object size:0xC8 scope:g mFindCount__10daNpc_Kn_c = .bss:0x00000160; // type:object size:0x4 scope:global @126080 = .bss:0x00000164; // type:object size:0xC scope:local l_HIO = .bss:0x00000170; // type:object size:0xBC scope:global +@GUARD@setSwordChargePtcl__10daNpc_Kn_cFv@lightAParticleScale = .bss:0x0000022C; // type:object size:0x1 scope:local align:1 @LOCAL@setSwordChargePtcl__10daNpc_Kn_cFv@lightAParticleScale = .bss:0x00000230; // type:object size:0xC scope:local +@GUARD@setSwordChargePtcl__10daNpc_Kn_cFv@lightALocalTrans@0 = .bss:0x0000023C; // type:object size:0x1 scope:local align:1 @LOCAL@setSwordChargePtcl__10daNpc_Kn_cFv@lightALocalTrans@0 = .bss:0x00000240; // type:object size:0xC scope:local diff --git a/configure.py b/configure.py index a36cf670b8..951f5dcf81 100755 --- a/configure.py +++ b/configure.py @@ -461,11 +461,6 @@ def MatchingFor(*versions) -> bool: return config.version in versions -# For whatever reason, daNpcF_c::daNpcF_c gets inlined. -# Using the following prevents that from happening: -# TODO: This is just a temporary hack and should be looked into more extensively in the future -DANPCF_C_HACK = '-pragma "inline_max_size(494)"' - config.warn_missing_config = True config.warn_missing_source = False config.precompiled_headers = [ @@ -680,7 +675,7 @@ config.libs = [ Object(NonMatching, "d/actor/d_a_npc.cpp"), Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d/actor/d_a_npc_cd.cpp"), Object(NonMatching, "d/actor/d_a_npc_cd2.cpp"), - Object(NonMatching, "d/actor/d_a_obj_item.cpp"), + Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d/actor/d_a_obj_item.cpp"), Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d/d_insect.cpp"), Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d/actor/d_a_obj_ss_base.cpp"), Object(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d/actor/d_a_player.cpp"), @@ -1612,7 +1607,7 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_vrbox"), ActorRel(NonMatching, "d_a_vrbox2"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_arrow"), - ActorRel(NonMatching, "d_a_boomerang"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_boomerang"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_crod"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_demo00"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_disappear"), @@ -1850,48 +1845,48 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_myna"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_ni"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_aru"), - ActorRel(Equivalent, "d_a_npc_ash", extra_cflags=[DANPCF_C_HACK]), # weak func order - ActorRel(Equivalent, "d_a_npc_ashB", extra_cflags=[DANPCF_C_HACK]), # weak func order + ActorRel(Equivalent, "d_a_npc_ash"), # weak func order + ActorRel(Equivalent, "d_a_npc_ashB"), # weak func order ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_bans"), - ActorRel(NonMatching, "d_a_npc_blue_ns", extra_cflags=[DANPCF_C_HACK]), + ActorRel(NonMatching, "d_a_npc_blue_ns"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_bou"), - ActorRel(Equivalent, "d_a_npc_bouS", extra_cflags=[DANPCF_C_HACK]), # weak func order + ActorRel(Equivalent, "d_a_npc_bouS"), # weak func order ActorRel(NonMatching, "d_a_npc_cdn3"), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_chat", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_chin", extra_cflags=[DANPCF_C_HACK]), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_chat"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_chin"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_clerka"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_clerkb"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_clerkt"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_coach"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_df"), ActorRel(NonMatching, "d_a_npc_doc"), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_doorboy", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_drainSol", extra_cflags=[DANPCF_C_HACK]), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_doorboy"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_drainSol"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_du"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_fairy"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_fguard"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_gnd"), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_gra", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grc", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grd", extra_cflags=[DANPCF_C_HACK]), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_gra"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grc"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grd"), ActorRel(NonMatching, "d_a_npc_grm"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grmc"), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_gro", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grr", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grs", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grz", extra_cflags=[DANPCF_C_HACK]), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_gro"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grr"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grs"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_grz"), ActorRel(NonMatching, "d_a_npc_guard"), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_gwolf", extra_cflags=[DANPCF_C_HACK]), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_gwolf"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_hanjo"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01", "Shield"), "d_a_npc_henna0"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_hoz"), - ActorRel(Equivalent, "d_a_npc_impal", extra_cflags=[DANPCF_C_HACK]), # weak func order + ActorRel(Equivalent, "d_a_npc_impal"), # weak func order ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_inko"), - ActorRel(Equivalent, "d_a_npc_ins", extra_cflags=[DANPCF_C_HACK]), # weak func order + ActorRel(Equivalent, "d_a_npc_ins"), # weak func order ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_jagar"), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_kasi_hana", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_kasi_kyu", extra_cflags=[DANPCF_C_HACK]), - ActorRel(Equivalent, "d_a_npc_kasi_mich", extra_cflags=[DANPCF_C_HACK]), # idk this why can't link + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_kasi_hana"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_kasi_kyu"), + ActorRel(Equivalent, "d_a_npc_kasi_mich"), # idk this why can't link ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01", "Shield"), "d_a_npc_kdk"), ActorRel(NonMatching, "d_a_npc_kn"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_knj"), @@ -1904,8 +1899,8 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_midp"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01", "ShieldD"), "d_a_npc_mk"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_moi"), - ActorRel(NonMatching, "d_a_npc_moir", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_myna2", extra_cflags=[DANPCF_C_HACK]), + ActorRel(NonMatching, "d_a_npc_moir"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_myna2"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_ne"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01", "ShieldD"), "d_a_npc_p2"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_pachi_besu"), @@ -1915,9 +1910,9 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_passer2"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_post"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_pouya"), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_prayer", extra_cflags=[DANPCF_C_HACK]), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_prayer"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_raca"), - ActorRel(Equivalent, "d_a_npc_rafrel", extra_cflags=[DANPCF_C_HACK]), # weak func order + ActorRel(Equivalent, "d_a_npc_rafrel"), # weak func order ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_saru"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_seib"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_seic"), @@ -1925,26 +1920,26 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_seira"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_seira2"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_seirei"), - ActorRel(Equivalent, "d_a_npc_shad", extra_cflags=[DANPCF_C_HACK]), # weak func order + ActorRel(Equivalent, "d_a_npc_shad"), # weak func order ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_shaman"), - ActorRel(NonMatching, "d_a_npc_shoe", extra_cflags=[DANPCF_C_HACK]), + ActorRel(NonMatching, "d_a_npc_shoe"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_shop0"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_shop_maro"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_sola"), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_soldierA", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_soldierB", extra_cflags=[DANPCF_C_HACK]), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_soldierA"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_soldierB"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_sq"), - ActorRel(NonMatching, "d_a_npc_the", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_theB", extra_cflags=[DANPCF_C_HACK]), + ActorRel(NonMatching, "d_a_npc_the"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_theB"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_tk"), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_tkc", extra_cflags=[DANPCF_C_HACK]), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_tkc"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_tkj2"), - ActorRel(NonMatching, "d_a_npc_tks", extra_cflags=[DANPCF_C_HACK]), + ActorRel(NonMatching, "d_a_npc_tks"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_toby"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_tr"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_uri"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_worm"), - ActorRel(NonMatching, "d_a_npc_wrestler", extra_cflags=[DANPCF_C_HACK]), + ActorRel(NonMatching, "d_a_npc_wrestler"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_yamid"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_yamis"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_yamit"), @@ -1956,9 +1951,9 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_zelR"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_zelRo"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_zelda"), - ActorRel(Equivalent, "d_a_npc_zra", extra_cflags=[DANPCF_C_HACK]), # weak func order - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_zrc", extra_cflags=[DANPCF_C_HACK]), - ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_zrz", extra_cflags=[DANPCF_C_HACK]), + ActorRel(Equivalent, "d_a_npc_zra"), # weak func order + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_zrc"), + ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_zrz"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_Lv5Key"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_Turara"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_TvCdlst"), @@ -2226,7 +2221,7 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_thashi"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_thdoor"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_timeFire"), - ActorRel(Equivalent, "d_a_obj_tks", extra_cflags=[DANPCF_C_HACK]), # weak function order + ActorRel(Equivalent, "d_a_obj_tks"), # weak function order ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_tmoon"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_toaru_maki"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_toby"), diff --git a/include/JSystem/JGeometry.h b/include/JSystem/JGeometry.h index 2522028442..99209023af 100644 --- a/include/JSystem/JGeometry.h +++ b/include/JSystem/JGeometry.h @@ -488,8 +488,8 @@ template struct TBox2 : public TBox > { TBox2() {} TBox2(const TVec2& _i, const TVec2& _f) { - i.set(_i); - f.set(_f); + TBox >::i.set(_i); + TBox >::f.set(_f); } TBox2(f32 x0, f32 y0, f32 x1, f32 y1) { set(x0, y0, x1, y1); } diff --git a/include/d/actor/d_a_npc.h b/include/d/actor/d_a_npc.h index fa9b6781d5..c8a8f4b1b0 100644 --- a/include/d/actor/d_a_npc.h +++ b/include/d/actor/d_a_npc.h @@ -488,10 +488,6 @@ public: void setIdx(int i_idx) { mIdx = i_idx; } const int getIdx() { return mIdx; } -#if VERSION != VERSION_SHIELD_DEBUG - // fakematch inline to fix daNpcT_Path_c::chkPassed1 - const u16 get_u16_Idx() { return mIdx; } -#endif dPath* getPathInfo() { return mPathInfo; } @@ -1149,7 +1145,10 @@ public: /* 5 */ LOOK_ATTN, }; - daNpcF_c() { initialize(); } + daNpcF_c() { + FORCE_DONT_INLINE; + initialize(); + } /* 80152014 */ BOOL execute(); /* 801522AC */ int draw(BOOL, BOOL, f32, _GXColorS10*, BOOL); /* 80152614 */ static void tgHitCallBack(fopAc_ac_c*, dCcD_GObjInf*, fopAc_ac_c*, diff --git a/include/d/actor/d_a_obj_Turara.h b/include/d/actor/d_a_obj_Turara.h index a3f6d12e68..6cca41dbdc 100644 --- a/include/d/actor/d_a_obj_Turara.h +++ b/include/d/actor/d_a_obj_Turara.h @@ -41,9 +41,9 @@ public: /* 80B9E388 */ int Draw(); /* 80B9E478 */ int Delete(); - u8 getSwBit1() { return fopAcM_GetParamBit(this, 0, 8); } - u8 getSwBit2() { return fopAcM_GetParamBit(this, 8, 8); } - u8 getSwBit3() { return fopAcM_GetParamBit(this, 16, 8); } + int getSwBit1() { return fopAcM_GetParamBit(this, 0, 8); } + int getSwBit2() { return fopAcM_GetParamBit(this, 8, 8); } + int getSwBit3() { return fopAcM_GetParamBit(this, 16, 8); } s32 getEvetID() { return fopAcM_GetParamBit(this, 0x18, 8); @@ -51,6 +51,7 @@ public: u8 getWaitTime() { return shape_angle.z; } int getItemTbleNum() { return shape_angle.x >> 8 & 0xff; } + int getState() { return shape_angle.x; } static const dCcD_SrcGObjInf mCcDObjInfo; static dCcD_SrcCyl mCcDCyl; @@ -76,7 +77,7 @@ private: /* 0x7a8 */ dBgS_ObjAcch mAcch; /* 0x980 */ dBgW* field_0x980; /* 0x984 */ u8 field_0x984; - /* 0x988 */ u32 field_0x988; + /* 0x988 */ u32 mEmID; /* 0x98c */ u8 field_0x98c; /* 0x98d */ u8 field_0x98d[0x994 - 0x98d]; /* 0x994 */ u8 field_0x994; diff --git a/include/global.h b/include/global.h index c21c08164b..03256e9c4c 100644 --- a/include/global.h +++ b/include/global.h @@ -75,4 +75,23 @@ void* __memcpy(void*, const void*, int); #define READU32_BE(ptr, offset) \ (((u32)ptr[offset] << 24) | ((u32)ptr[offset + 1] << 16) | ((u32)ptr[offset + 2] << 8) | (u32)ptr[offset + 3]); +// Hack to trick the compiler into not inlining functions that use this macro. +#define FORCE_DONT_INLINE \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \ + (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; + #endif diff --git a/src/JSystem/J2DGraph/J2DWindowEx.cpp b/src/JSystem/J2DGraph/J2DWindowEx.cpp index 411462819a..d052b84ba5 100644 --- a/src/JSystem/J2DGraph/J2DWindowEx.cpp +++ b/src/JSystem/J2DGraph/J2DWindowEx.cpp @@ -658,10 +658,7 @@ bool J2DWindowEx::setBlackWhite(JUtility::TColor black, JUtility::TColor white) return false; } - bool bVar1 = false; - if ((u32)black != 0 || (u32)white != 0xffffffff) { - bVar1 = true; - } + bool bVar1 = (u32)black != 0 || (u32)white != 0xffffffff; u8 uVar3 = bVar1 ? 2 : 1; for (int i = 0; i < 4; i++) { mFrameMaterial[i]->getTevBlock()->setTevStageNum(uVar3); diff --git a/src/JSystem/JAudio2/JASHeapCtrl.cpp b/src/JSystem/JAudio2/JASHeapCtrl.cpp index 985336cf67..ec89a82aba 100644 --- a/src/JSystem/JAudio2/JASHeapCtrl.cpp +++ b/src/JSystem/JAudio2/JASHeapCtrl.cpp @@ -118,7 +118,7 @@ bool JASHeap::free() { JSUTreeIterator stack_20; for (JSUTreeIterator it(mTree.getFirstChild()); it != mTree.getEndChild(); it = stack_20) { stack_20 = it; - stack_20++; + ++stack_20; it->free(); } JSUTree* parentTree = mTree.getParent(); diff --git a/src/JSystem/JStudio/JStudio/fvb.cpp b/src/JSystem/JStudio/JStudio/fvb.cpp index f4f3cebe8d..3b64a26444 100644 --- a/src/JSystem/JStudio/JStudio/fvb.cpp +++ b/src/JSystem/JStudio/JStudio/fvb.cpp @@ -155,7 +155,7 @@ void TObject::prepare(data::TParse_TBlock const& rBlock, TControl* pControl) { JGADGET_WARNMSG(211, "unknown paragraph : " << u32Type); } pData = dat.next; - JUT_ASSERT(214, pData!=0); + JUT_ASSERT(214, pData!=NULL); } end: JGADGET_ASSERTWARN(216, pData==pNext); @@ -414,7 +414,7 @@ bool TParse::parseHeader_next(void const** ppData_inout, u32* puBlock_out, u32 f ASSERT(puBlock_out != 0); const void* pData = *ppData_inout; - ASSERT(pData != 0); + ASSERT(pData != NULL); const data::TParse_THeader header(pData); *ppData_inout = header.getContent(); @@ -449,7 +449,7 @@ bool TParse::parseBlock_next(void const** ppData_inout, u32* puData_out, u32 fla ASSERT(puData_out != 0); const void* pData = *ppData_inout; - ASSERT(pData != 0); + ASSERT(pData != NULL); data::TParse_TBlock blk(pData); *ppData_inout = blk.getNext(); *puData_out = blk.get_size(); diff --git a/src/JSystem/JStudio/JStudio/stb-data-parse.cpp b/src/JSystem/JStudio/JStudio/stb-data-parse.cpp index 99ee1ef081..8cba3d99c5 100644 --- a/src/JSystem/JStudio/JStudio/stb-data-parse.cpp +++ b/src/JSystem/JStudio/JStudio/stb-data-parse.cpp @@ -14,7 +14,7 @@ namespace stb { namespace data { void TParse_TSequence::getData(TData* pData) const { - ASSERT(pData != 0); + ASSERT(pData != NULL); pData->content = NULL; pData->next = NULL; @@ -35,7 +35,7 @@ void TParse_TSequence::getData(TData* pData) const { } void TParse_TParagraph::getData(TData* pData) const { - ASSERT(pData != 0); + ASSERT(pData != NULL); const void* data = getRaw(); u32 result; diff --git a/src/JSystem/JStudio/JStudio/stb.cpp b/src/JSystem/JStudio/JStudio/stb.cpp index b4ec0eeec8..027784e432 100644 --- a/src/JSystem/JStudio/JStudio/stb.cpp +++ b/src/JSystem/JStudio/JStudio/stb.cpp @@ -198,29 +198,31 @@ void TObject::process_sequence_() { switch (type) { case 0: JUT_EXPECT(u32Value == 0); - JUT_EXPECT(pContent == 0); + JUT_EXPECT(pContent == NULL); break; case 1: - JUT_EXPECT(pContent == 0); + JUT_EXPECT(pContent == NULL); setFlag_operation_(u32Value); break; case 2: - JUT_EXPECT(pContent == 0); + JUT_EXPECT(pContent == NULL); setWait(u32Value); break; - case 3: - JUT_EXPECT(pContent == 0); + case 3: { + JUT_EXPECT(pContent == NULL); s32 off = toInt32FromUInt24_(u32Value); void* nextseq = (void*)getSequence_offset(off); setSequence_next(nextseq); break; - case 4: - JUT_EXPECT(pContent == 0); + } + case 4: { + JUT_EXPECT(pContent == NULL); u32 val = toInt32FromUInt24_(u32Value); suspend(val); break; - case 0x80: - ASSERT(pContent != 0); + } + case 0x80: { + ASSERT(pContent != NULL); void* p = (void*)pContent; data::TParse_TParagraph para(NULL); while (p < pNext) { @@ -234,10 +236,11 @@ void TObject::process_sequence_() { on_paragraph(para_dat.type, para_dat.content, para_dat.param); } p = (void*)para_dat.next; - ASSERT(p != 0); + ASSERT(p != NULL); } JUT_EXPECT(p == pNext); break; + } default: JUTWarn w; w << "unknown sequence : " << dat.type; @@ -248,32 +251,34 @@ void TObject::process_sequence_() { void TObject::process_paragraph_reserved_(u32 arg1, const void* pContent, u32 uSize) { switch (arg1) { case 0x1: - ASSERT(pContent != 0); + ASSERT(pContent != NULL); ASSERT(uSize == 4); setFlag_operation_(*(u32*)pContent); break; case 0x2: - ASSERT(pContent != 0); + ASSERT(pContent != NULL); ASSERT(uSize == 4); setWait(*(u32*)pContent); break; - case 0x3: - ASSERT(pContent != 0); + case 0x3: { + ASSERT(pContent != NULL); ASSERT(uSize == 4); const void* seq = getSequence_offset(*(s32*)pContent); setSequence_next(seq); break; + } case 0x80: on_data(NULL, 0, pContent, uSize); break; - case 0x81: + case 0x81: { data::TParse_TParagraph_dataID dataID(pContent); const void* temp = dataID.getContent(); on_data(dataID.get_ID(), dataID.get_IDSize(), temp, uSize - ((uintptr_t)temp - (uintptr_t)dataID.getRaw())); break; + } case 0x82: - ASSERT(pContent != 0); + ASSERT(pContent != NULL); break; } } @@ -300,7 +305,7 @@ void TControl::appendObject(TObject* p) { } void TControl::removeObject(TObject* p) { - ASSERT(p != 0); + ASSERT(p != NULL); ASSERT(p->getControl() == this); p->setControl_(NULL); mObjectContainer.Erase(p); @@ -308,7 +313,7 @@ void TControl::removeObject(TObject* p) { void TControl::destroyObject(TObject* p) { removeObject(p); - ASSERT(pFactory != 0); + ASSERT(pFactory != NULL); pFactory->destroy(p); } @@ -376,11 +381,11 @@ TParse::TParse(TControl* pControl) : pControl(pControl) {} TParse::~TParse() {} bool TParse::parseHeader_next(const void** ppData_inout, u32* puBlock_out, u32 flags) { - ASSERT(ppData_inout != 0); - ASSERT(puBlock_out != 0); + ASSERT(ppData_inout != NULL); + ASSERT(puBlock_out != NULL); const void* pData = *ppData_inout; - ASSERT(pData != 0); + ASSERT(pData != NULL); const data::TParse_THeader header(pData); *ppData_inout = header.getContent(); @@ -411,11 +416,11 @@ bool TParse::parseHeader_next(const void** ppData_inout, u32* puBlock_out, u32 f } bool TParse::parseBlock_next(void const** ppData_inout, u32* puData_out, u32 flags) { - ASSERT(ppData_inout != 0); - ASSERT(puData_out != 0); + ASSERT(ppData_inout != NULL); + ASSERT(puData_out != NULL); const void* pData = *ppData_inout; - ASSERT(pData != 0); + ASSERT(pData != NULL); data::TParse_TBlock blk(pData); *ppData_inout = blk.getNext(); @@ -433,7 +438,7 @@ bool TParse::parseBlock_block(const data::TParse_TBlock& ppBlock, u32 flags) { bool TParse::parseBlock_object(const data::TParse_TBlock_object& ppObject, u32 flags) { TControl* pControl = getControl(); - ASSERT(pControl != 0); + ASSERT(pControl != NULL); if (ppObject.get_type() == data::BLOCK_NONE) { TObject_control& ref = pControl->referObject_control(); diff --git a/src/d/actor/d_a_arrow.cpp b/src/d/actor/d_a_arrow.cpp index 2509741d0d..b61474dc19 100644 --- a/src/d/actor/d_a_arrow.cpp +++ b/src/d/actor/d_a_arrow.cpp @@ -1259,6 +1259,7 @@ static int daArrow_delete(daArrow_c* i_this) { } AUDIO_INSTANCES; +template<> JAUSectionHeap* JASGlobalInstance::sInstance; /* 8049DE8C-8049DEAC -00001 0020+00 1/0 0/0 0/0 .data l_daArrowMethodTable */ diff --git a/src/d/actor/d_a_b_zant.cpp b/src/d/actor/d_a_b_zant.cpp index e1749690ab..e5cb60f023 100644 --- a/src/d/actor/d_a_b_zant.cpp +++ b/src/d/actor/d_a_b_zant.cpp @@ -5724,4 +5724,5 @@ extern actor_process_profile_definition g_profile_B_ZANT = { }; AUDIO_INSTANCES; +template<> JAUSectionHeap* JASGlobalInstance::sInstance; diff --git a/src/d/actor/d_a_boomerang.cpp b/src/d/actor/d_a_boomerang.cpp index cd147e40c1..b6d5bebc6d 100644 --- a/src/d/actor/d_a_boomerang.cpp +++ b/src/d/actor/d_a_boomerang.cpp @@ -1585,3 +1585,6 @@ extern actor_process_profile_definition g_profile_BOOMERANG = { }; AUDIO_INSTANCES; +class JAUSectionHeap; +template<> +JAUSectionHeap* JASGlobalInstance::sInstance; diff --git a/src/d/actor/d_a_canoe.cpp b/src/d/actor/d_a_canoe.cpp index 6dcc628180..556c75b989 100644 --- a/src/d/actor/d_a_canoe.cpp +++ b/src/d/actor/d_a_canoe.cpp @@ -964,4 +964,5 @@ extern actor_process_profile_definition g_profile_CANOE = { }; AUDIO_INSTANCES +template<> JAUSectionHeap* JASGlobalInstance::sInstance; diff --git a/src/d/actor/d_a_cstatue.cpp b/src/d/actor/d_a_cstatue.cpp index 768b942aa6..d51d792a60 100644 --- a/src/d/actor/d_a_cstatue.cpp +++ b/src/d/actor/d_a_cstatue.cpp @@ -1258,5 +1258,5 @@ extern actor_process_profile_definition g_profile_CSTATUE = { AUDIO_INSTANCES; #include "JSystem/JAudio2/JAUSectionHeap.h" -template <> +template<> JAUSectionHeap* JASGlobalInstance::sInstance; diff --git a/src/d/actor/d_a_e_arrow.cpp b/src/d/actor/d_a_e_arrow.cpp index 0f81f3a889..ba0af97585 100644 --- a/src/d/actor/d_a_e_arrow.cpp +++ b/src/d/actor/d_a_e_arrow.cpp @@ -237,7 +237,7 @@ static void hit_check(e_arrow_class* i_this) { /* 8067D21C-8067D40C 000B3C 01F0+00 1/1 0/0 0/0 .text e_arrow_shot__FP13e_arrow_class */ static void e_arrow_shot(e_arrow_class* i_this) { switch (i_this->mMode) { - case 0: + case 0: { i_this->speedF = 100.0f; i_this->mMode = 1; @@ -254,6 +254,7 @@ static void e_arrow_shot(e_arrow_class* i_this) { i_this->field_0x5d0 = parent_p->speed.x; i_this->field_0x5d4 = parent_p->speed.z; } + } case 1: if (i_this->mFlags & 0x20) { fopAc_ac_c* coach_p = fopAcM_SearchByName(PROC_NPC_COACH); diff --git a/src/d/actor/d_a_e_ws.cpp b/src/d/actor/d_a_e_ws.cpp index 96a2d21e83..6b74a412b9 100644 --- a/src/d/actor/d_a_e_ws.cpp +++ b/src/d/actor/d_a_e_ws.cpp @@ -198,17 +198,24 @@ int daE_WS_c::checkPlayerPos() { } /* 807E4568-807E470C 000C48 01A4+00 1/1 0/0 0/0 .text checkAttackEnd__8daE_WS_cFv */ -// NONMATCHING bool daE_WS_c::checkAttackEnd() { cXyz player_pos; mDoMtx_stack_c::copy(daPy_getLinkPlayerActorClass()->getModelJointMtx(0)); mDoMtx_stack_c::multVecZero(&player_pos); - if (!(daPy_getPlayerActorClass()->checkClimbMove() || + BOOL r30 = false; + if ( + daPy_getPlayerActorClass()->checkClimbMove() || dComIfGp_checkPlayerStatus1(0, 0x02000000) || dComIfGp_checkPlayerStatus1(0, 0x10000) || - calcTargetDist(current.pos, player_pos) < 200.0f) || - (!checkInSearchRange(current.pos, field_0x65c) || checkBeforeBg(shape_angle.y))) + calcTargetDist(current.pos, player_pos) < 200.0f + ) { + r30 = true; + } + if (!r30 || + !checkInSearchRange(current.pos, field_0x65c) || + checkBeforeBg(shape_angle.y) + ) { setActionMode(ACTION_WAIT_e); speedF = 0.0f; diff --git a/src/d/actor/d_a_mg_rod.cpp b/src/d/actor/d_a_mg_rod.cpp index 41a8c8c7b2..ff3bf2fdae 100644 --- a/src/d/actor/d_a_mg_rod.cpp +++ b/src/d/actor/d_a_mg_rod.cpp @@ -6409,4 +6409,5 @@ extern actor_process_profile_definition g_profile_MG_ROD = { AUDIO_INSTANCES #include "JSystem/JAudio2/JAUSectionHeap.h" +template<> JAUSectionHeap* JASGlobalInstance::sInstance; diff --git a/src/d/actor/d_a_npc.cpp b/src/d/actor/d_a_npc.cpp index 5bbea1652e..51d04925c8 100644 --- a/src/d/actor/d_a_npc.cpp +++ b/src/d/actor/d_a_npc.cpp @@ -467,12 +467,7 @@ int daNpcT_Path_c::chkPassed1(cXyz i_pnt, int i_num) { cXyz next_pos; cXyz sp5C; -#if VERSION != VERSION_SHIELD_DEBUG - // FIXME: fakematch. I literally don't know how else to get this to match.... - u16 cur_idx = get_u16_Idx(); -#else - u16 cur_idx = getIdx(); -#endif + u16 cur_idx = (int)(u16)getIdx(); u16 prev_idx, next_idx; prev_idx = next_idx = cur_idx; diff --git a/src/d/actor/d_a_npc_moir.cpp b/src/d/actor/d_a_npc_moir.cpp index a478ce9843..3381654437 100644 --- a/src/d/actor/d_a_npc_moir.cpp +++ b/src/d/actor/d_a_npc_moir.cpp @@ -783,9 +783,7 @@ void daNpcMoiR_c::playExpression() { daNpcF_anmPlayData* pDat2[1] = {&dat2}; daNpcF_anmPlayData dat3 = {ANM_FH_SERIOUS, mpHIO->m.common.morf_frame, 0}; daNpcF_anmPlayData* pDat3[1] = {&dat3}; - // FIXME: daNpcF hack in configure.py prevents us from converting more of these, - // otherwise this function will not inline in GCN. - daNpcF_anmPlayData dat4 = {ANM_F_TAKAJO_HI, daNpcMoiR_Param_c::m.common.morf_frame, 0}; + daNpcF_anmPlayData dat4 = {ANM_F_TAKAJO_HI, mpHIO->m.common.morf_frame, 0}; daNpcF_anmPlayData* pDat4[1] = {&dat4}; daNpcF_anmPlayData dat5 = {ANM_FH_TAKAJO_HI, 0.0f, 0}; daNpcF_anmPlayData* pDat5[1] = {&dat5}; @@ -795,9 +793,9 @@ void daNpcMoiR_c::playExpression() { daNpcF_anmPlayData* pDat7[1] = {&dat7}; daNpcF_anmPlayData dat8 = {ANM_F_HOLD_S, 0.0f, 0}; daNpcF_anmPlayData* pDat8[1] = {&dat8}; - daNpcF_anmPlayData dat9 = {ANM_FH_HOLD_S, daNpcMoiR_Param_c::m.common.morf_frame, 0}; + daNpcF_anmPlayData dat9 = {ANM_FH_HOLD_S, mpHIO->m.common.morf_frame, 0}; daNpcF_anmPlayData* pDat9[1] = {&dat9}; - daNpcF_anmPlayData dat10 = {ANM_NONE, daNpcMoiR_Param_c::m.common.morf_frame, 0}; + daNpcF_anmPlayData dat10 = {ANM_NONE, mpHIO->m.common.morf_frame, 0}; daNpcF_anmPlayData* pDat10[1] = {&dat10}; daNpcF_anmPlayData* pDat11[1] = {&dat0}; diff --git a/src/d/actor/d_a_npc_theB.cpp b/src/d/actor/d_a_npc_theB.cpp index 13b7ee6be2..079776fde4 100644 --- a/src/d/actor/d_a_npc_theB.cpp +++ b/src/d/actor/d_a_npc_theB.cpp @@ -1032,16 +1032,6 @@ void daNpcTheB_c::lookat() { mLookat.calc(this, model->getBaseTRMtx(), lookat_angle, FALSE, angle_delta, false); } -#pragma inline_max_size(503) -/* - FAKEMATCH - The DANPCF_C_HACK sets an inline size that prevents the parent constructor - from being inlined, however that same hack also prevents the following - function from being inlined when it needs to. - - Once a proper solution is found for the constructor issue, the pragma - should be removed -*/ inline void daNpcTheB_c::setWaitAnimation() { if ( mAnm_p->getAnm() == getTrnsfrmKeyAnmP(l_arcName, l_bckGetParamList[8].fileIdx) diff --git a/src/d/actor/d_a_obj_Turara.cpp b/src/d/actor/d_a_obj_Turara.cpp index c3236bc8cb..2b286c3271 100644 --- a/src/d/actor/d_a_obj_Turara.cpp +++ b/src/d/actor/d_a_obj_Turara.cpp @@ -89,10 +89,8 @@ static u32 const l_bmdIdx[2] = {5, 8}; /* 80B9CD74-80B9CED8 0002D4 0164+00 1/0 0/0 0/0 .text CreateHeap__10daTurara_cFv */ int daTurara_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*) dComIfG_getObjectRes("M_Turara", l_bmdIdx[field_0x98c]); + JUT_ASSERT(260, modelData != NULL); - if (modelData == NULL) { - // FIXME: For shield decomp matching, needs a JUT assert. - } if (field_0x98c == 0) { mpModel[0] = mDoExt_J3DModel__create(modelData, 0, 0x11000084); } else { @@ -103,15 +101,12 @@ int daTurara_c::CreateHeap() { } modelData = (J3DModelData*) dComIfG_getObjectRes("M_Turara", 9); - if (modelData == NULL) { - // FIXME: For shield decomp matching, needs a JUT assert. - } + JUT_ASSERT(279, modelData != NULL); mpModel[1] = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); if (mpModel[1] == NULL) { return 0; } - dBgW* my_dBgW = new dBgW; - field_0x980 = my_dBgW; + field_0x980 = new dBgW; if (field_0x980 == NULL || field_0x980->Set((cBgD_t *)dComIfG_getObjectRes("M_Turara", 0xd), 1, &mBgMtx) != 0) { field_0x980 = NULL; @@ -123,19 +118,17 @@ int daTurara_c::CreateHeap() { /* 80B9CED8-80B9D29C 000438 03C4+00 1/1 0/0 0/0 .text create__10daTurara_cFv */ int daTurara_c::create() { fopAcM_ct(this, daTurara_c); - u8 my_bit = getSwBit3(); - if (fopAcM_isSwitch(this, my_bit)) { + if (fopAcM_isSwitch(this, getSwBit3())) { return cPhs_ERROR_e; } int phase = dComIfG_resLoad(&mPhaseReq,"M_Turara"); if (phase == cPhs_COMPLEATE_e) { - u8 my_bool = 0; - field_0x98c = shape_angle.x; + u8 r26 = 0; + field_0x98c = getState(); if (field_0x98c != 0) { if (field_0x98c == 1) { - my_bool = 1; - u8 my_bit1 = getSwBit1(); - fopAcM_onSwitch(this, my_bit1); + r26 = 1; + fopAcM_onSwitch(this, getSwBit1()); } fopAcM_SetGroup(this,0); field_0x98c = 1; @@ -160,8 +153,7 @@ int daTurara_c::create() { mCylCollider.Set(mCcDCyl); mCylCollider.SetStts(&mColliderStts); mCylCollider.OffAtSetBit(); - u8 my_bit1 = getSwBit1(); - if (fopAcM_isSwitch(this, my_bit1)) { + if (fopAcM_isSwitch(this, getSwBit1())) { field_0x984 = 1; mCylCollider.OffCoSetBit(); if (mpBgW) { @@ -171,7 +163,7 @@ int daTurara_c::create() { dComIfG_Bgsp().Regist(field_0x980, this); field_0x980->Move(); } - if (my_bool) { + if (r26) { mMode = 3; } else { setFallStat(); @@ -185,7 +177,9 @@ int daTurara_c::create() { fopAcM_setCullSizeBox2(this, mpModel[field_0x984]->getModelData()); setBaseMtx(); field_0x994 = 1; - // FIXME: Needs entryHIO here. + #ifdef DEBUG + l_HIO.entryHIO("つらら"); + #endif } return phase; } @@ -226,9 +220,9 @@ void daTurara_c::move() { mCylCollider.SetR(130.0f); } mCylCollider.SetH(510.0f); - cXyz my_vec(current.pos); - my_vec.y -= 50.0f; - mCylCollider.SetC(my_vec); + cXyz sp08(current.pos); + sp08.y -= 50.0f; + mCylCollider.SetC(sp08); dComIfG_Ccsp()->Set(&mCylCollider); } @@ -247,21 +241,19 @@ void daTurara_c::modeWait() { } } if (mCylCollider.ChkTgHit()) { - dCcD_GObjInf* my_actor = mCylCollider.GetTgHitGObj(); - if (my_actor->GetAtType() == AT_TYPE_BOMB) { + dCcD_GObjInf* r29 = mCylCollider.GetTgHitGObj(); + if (r29->GetAtType() == AT_TYPE_BOMB) { if (getEvetID() != 0xff) { orderEvent(getEvetID(), 0xFF, 1); } else { eventStart(); } - } else if (my_actor->GetAtType() == AT_TYPE_IRON_BALL) { - dComIfGp_particle_set(0x8a8f, ¤t.pos, NULL, NULL, NULL, 0xff, NULL, -1, NULL, NULL, NULL); - dComIfGp_particle_set(0x8a90, ¤t.pos, NULL, NULL, NULL, 0xff, NULL, -1, NULL, NULL, NULL); - dComIfGp_particle_set(0x8a91, ¤t.pos, NULL, NULL, NULL, 0xff, NULL, -1, NULL, NULL, NULL); - s8 roomNo = fopAcM_GetRoomNo(this); - mDoAud_seStart(Z2SE_OBJ_ICICLE_BRK, ¤t.pos, 0, dComIfGp_getReverb(roomNo)); - u8 swbit3 = getSwBit3(); - fopAcM_onSwitch(this, swbit3); + } else if (r29->GetAtType() == AT_TYPE_IRON_BALL) { + dComIfGp_particle_set(0x8a8f, ¤t.pos, NULL, NULL); + dComIfGp_particle_set(0x8a90, ¤t.pos, NULL, NULL); + dComIfGp_particle_set(0x8a91, ¤t.pos, NULL, NULL); + mDoAud_seStart(Z2SE_OBJ_ICICLE_BRK, ¤t.pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(this))); + fopAcM_onSwitch(this, getSwBit3()); fopAcM_delete(this); } } @@ -346,35 +338,30 @@ void daTurara_c::init_modeDropEnd() { } mCylCollider.OffCoSetBit(); mCylCollider.OffAtSetBit(); - u8 swbit1 = getSwBit1(); - fopAcM_onSwitch(this, swbit1); - s8 roomNo = fopAcM_GetRoomNo(this); - mDoAud_seStart(Z2SE_OBJ_ICICLE_LAND, ¤t.pos, 0, dComIfGp_getReverb(roomNo)); + fopAcM_onSwitch(this, getSwBit1()); + mDoAud_seStart(Z2SE_OBJ_ICICLE_LAND, ¤t.pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(this))); mMode = 3; } /* 80B9DE48-80B9E078 0013A8 0230+00 1/0 0/0 0/0 .text modeDropEnd__10daTurara_cFv */ void daTurara_c::modeDropEnd() { if (mCylCollider.ChkTgHit()) { - dCcD_GObjInf* my_actor = mCylCollider.GetTgHitGObj(); - u32 att_type = my_actor->GetAtType(); - if ((att_type & AT_TYPE_UNK) || (att_type & AT_TYPE_20000000)) { + dCcD_GObjInf* r29 = mCylCollider.GetTgHitGObj(); + if ((r29->GetAtType() & AT_TYPE_UNK) || (r29->GetAtType() & AT_TYPE_20000000)) { if (field_0x980) { dComIfG_Bgsp().Release(field_0x980); field_0x980->Move(); } - csXyz my_vec(0, home.angle.y, 0); + csXyz sp10(0, home.angle.y, 0); fopAcM_createItemFromTable(¤t.pos, getItemTbleNum(), -1, - fopAcM_GetHomeRoomNo(this), &my_vec, 0, (cXyz*)NULL, + fopAcM_GetHomeRoomNo(this), &sp10, 0, (cXyz*)NULL, NULL, NULL, false); } dComIfGp_particle_set(0x8a8f, ¤t.pos, NULL, NULL); dComIfGp_particle_set(0x8a90, ¤t.pos, NULL, NULL); dComIfGp_particle_set(0x8a91, ¤t.pos, NULL, NULL); - s8 roomNo = fopAcM_GetRoomNo(this); - mDoAud_seStart(Z2SE_OBJ_ICICLE_BRK, ¤t.pos, 0, dComIfGp_getReverb(roomNo)); - u8 swbit3 = getSwBit3(); - fopAcM_onSwitch(this, swbit3); + mDoAud_seStart(Z2SE_OBJ_ICICLE_BRK, ¤t.pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(this))); + fopAcM_onSwitch(this, getSwBit3()); fopAcM_delete(this); } } @@ -390,28 +377,25 @@ void daTurara_c::init_modeDropEnd2() { } mCylCollider.OffCoSetBit(); mCylCollider.OffAtSetBit(); - s8 roomNo = fopAcM_GetRoomNo(this); - mDoAud_seStart(Z2SE_OBJ_ICICLE_BRK, ¤t.pos, 0, dComIfGp_getReverb(roomNo)); + mDoAud_seStart(Z2SE_OBJ_ICICLE_BRK, ¤t.pos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(this))); current.pos.y -= 100.0f; cXyz first_vec(current.pos); first_vec.y += 100.0f; - s16 my_proc = PROC_E_KK; - field_0x988 = fopAcM_create(my_proc, getSwBit1() << 0x10 | 3, &first_vec, fopAcM_GetRoomNo(this), 0, 0, 0xffffffff); - // FIXME: JUT assert needed here + mEmID = fopAcM_create(PROC_E_KK, getSwBit1() << 0x10 | 3, &first_vec, fopAcM_GetRoomNo(this), 0, 0, -1); + JUT_ASSERT(770, mEmID != fpcM_ERROR_PROCESS_ID_e); cXyz second_vec(0.7f, 0.7f, 0.7f); dComIfGp_particle_set(0x8a8f, &first_vec, NULL, &second_vec); dComIfGp_particle_set(0x8a90, &first_vec, NULL, &second_vec); dComIfGp_particle_set(0x8a91, &first_vec, NULL, &second_vec); dComIfGp_particle_set(0x8a92, &first_vec, NULL, &second_vec); - u8 swbit = getSwBit3(); - fopAcM_onSwitch(this, swbit); + fopAcM_onSwitch(this, getSwBit3()); field_0x994 = 0; mMode = 4; } /* 80B9E338-80B9E388 001898 0050+00 1/0 0/0 0/0 .text modeDropEnd2__10daTurara_cFv */ void daTurara_c::modeDropEnd2() { - if (fopAcM_SearchByID(field_0x988)) { + if (fopAcM_SearchByID(mEmID)) { fopAcM_delete(this); } } diff --git a/src/d/actor/d_a_obj_item.cpp b/src/d/actor/d_a_obj_item.cpp index 8fa0a96827..e795c596ab 100644 --- a/src/d/actor/d_a_obj_item.cpp +++ b/src/d/actor/d_a_obj_item.cpp @@ -16,21 +16,6 @@ #include "f_op/f_op_camera_mng.h" #include "m_Do/m_Do_mtx.h" -// -// Forward References: -// - -extern "C" void itemGetNextExecute__8daItem_cFv(); -extern "C" void checkPlayerGet__8daItem_cFv(); - -// -// External References: -// - -extern "C" extern void* __vt__16Z2SoundObjSimple[8]; -extern "C" void __dl__FPv(); -extern "C" void __dt__14Z2SoundObjBaseFv(); - /* 8015ADCC-8015B0B8 15570C 02EC+00 1/1 0/0 0/0 .text Reflect__FP4cXyzRC13cBgS_PolyInfof */ static f32 Reflect(cXyz* i_vec, cBgS_PolyInfo const& i_polyinfo, f32 i_scale) { @@ -105,8 +90,6 @@ void daItem_c::setBaseMtx_1() { /* 8015B254-8015B320 155B94 00CC+00 2/2 0/0 0/0 .text * itemGetCoCallBack__FP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf */ -// NONMATCHING - matches, but pushes up weak daPy_py_c functions incorrectly -// might need other TUs that use daPy_py_c weaks to be finished first static void itemGetCoCallBack(fopAc_ac_c* i_coActorA, dCcD_GObjInf* i_coObjInfA, fopAc_ac_c* i_coActorB, dCcD_GObjInf* i_coObjInfB) { daItem_c* a_coActorA = (daItem_c*)i_coActorA; @@ -324,12 +307,6 @@ int daItem_c::_daItem_create() { return phase_state; } -/* 8015BA3C-8015BA9C 15637C 0060+00 0/0 1/1 0/0 .text __dt__16Z2SoundObjSimpleFv */ -// Z2SoundObjSimple::~Z2SoundObjSimple() { -extern "C" void __dt__16Z2SoundObjSimpleFv() { - // NONMATCHING -} - /* 8015BA9C-8015BD84 1563DC 02E8+00 1/1 0/0 0/0 .text _daItem_execute__8daItem_cFv */ int daItem_c::_daItem_execute() { field_0x950 = speed; diff --git a/src/d/actor/d_a_obj_volcball.cpp b/src/d/actor/d_a_obj_volcball.cpp index e935518eba..9f559a1407 100644 --- a/src/d/actor/d_a_obj_volcball.cpp +++ b/src/d/actor/d_a_obj_volcball.cpp @@ -262,7 +262,6 @@ void daObjVolcBall_c::actionWarning() { /* 80D22944-80D22C6C 000EA4 0328+00 1/0 0/0 0/0 .text actionEruption__15daObjVolcBall_cFv */ -// NONMATCHING small regalloc void daObjVolcBall_c::actionEruption() { if (!dComIfGp_getVibration().CheckQuake()) { startQuake(); diff --git a/src/d/actor/d_a_spinner.cpp b/src/d/actor/d_a_spinner.cpp index bd09dca995..21c2d10272 100644 --- a/src/d/actor/d_a_spinner.cpp +++ b/src/d/actor/d_a_spinner.cpp @@ -985,4 +985,5 @@ extern actor_process_profile_definition g_profile_SPINNER = { AUDIO_INSTANCES struct JAUSectionHeap; +template<> JAUSectionHeap* JASGlobalInstance::sInstance; diff --git a/src/d/d_insect.cpp b/src/d/d_insect.cpp index c41ede21fd..9bd64875a1 100644 --- a/src/d/d_insect.cpp +++ b/src/d/d_insect.cpp @@ -12,24 +12,6 @@ #include "m_Do/m_Do_lib.h" #include "dol2asm.h" -#if VERSION == VERSION_GCN_USA -// This is a HACK to get d_insect data at correct address due to -// issues with the d_a_obj_item vtable. TODO: fix daItem_c vtable -#pragma push -#pragma force_active on -SECTION_DATA extern void* __vt__8daItem_c__HACK[] = { - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, -}; -#pragma pop -#endif - /* 8015E010-8015E078 158950 0068+00 0/0 0/0 13/13 .text __ct__9dInsect_cFv */ dInsect_c::dInsect_c() { m_itemId = -1; diff --git a/src/d/d_map.cpp b/src/d/d_map.cpp index 7fde89416c..05c96cc3cb 100644 --- a/src/d/d_map.cpp +++ b/src/d/d_map.cpp @@ -1232,12 +1232,13 @@ void dMap_c::_move(f32 i_centerX, f32 i_centerZ, int i_roomNo, f32 param_3) { break; case 2: switch (field_0x8f) { - case 2: + case 2: { f32 temp_f31 = (f32)field_0x90 / 5.0f; setMapPaletteColorAlphaPer(0x2F, 0x32, temp_f31); setMapPaletteColorAlphaPer(0x21, 0x2B, temp_f31); break; - case 3: + } + case 3: { calcMapCenterXZ(field_0x88, &mCenterX, &mCenterZ); f32 sp24, sp20; calcMapCenterXZ(field_0x84, &sp24, &sp20); @@ -1268,11 +1269,13 @@ void dMap_c::_move(f32 i_centerX, f32 i_centerZ, int i_roomNo, f32 param_3) { mCenterX += sp14; mCenterZ -= sp10; break; - case 4: + } + case 4: { f32 temp_f31_3 = 1.0f - ((f32)field_0x90 / 5.0f); setMapPaletteColorAlphaPer(0x2F, 0x32, temp_f31_3); setMapPaletteColorAlphaPer(0x21, 0x2B, temp_f31_3); break; + } case 6: copyPalette(); break;