mirror of
https://github.com/encounter/dtk-template.git
synced 2025-12-18 17:35:24 +00:00
Replace object-level clean_extab with extab_padding
This commit is contained in:
@@ -102,6 +102,9 @@ ldscript_template: config/GAMEID/module/ldscript.tpl
|
|||||||
# the uninitialized data zeroed out. When targeting a cleaned DOL hash,
|
# the uninitialized data zeroed out. When targeting a cleaned DOL hash,
|
||||||
# this option can be set to true to scrub the uninitialized data from
|
# this option can be set to true to scrub the uninitialized data from
|
||||||
# the extab section in the split objects.
|
# the extab section in the split objects.
|
||||||
|
#
|
||||||
|
# Alternatively, you can set extab_padding on any affected objects in
|
||||||
|
# configure.py, in order to exactly match the original DOL.
|
||||||
clean_extab: false
|
clean_extab: false
|
||||||
|
|
||||||
# (optional) Configuration for modules.
|
# (optional) Configuration for modules.
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ if not config.non_matching:
|
|||||||
# Tool versions
|
# Tool versions
|
||||||
config.binutils_tag = "2.42-1"
|
config.binutils_tag = "2.42-1"
|
||||||
config.compilers_tag = "20250520"
|
config.compilers_tag = "20250520"
|
||||||
config.dtk_tag = "v1.6.0"
|
config.dtk_tag = "v1.6.1"
|
||||||
config.objdiff_tag = "v3.0.0-beta.8"
|
config.objdiff_tag = "v3.0.0-beta.8"
|
||||||
config.sjiswrap_tag = "v1.2.1"
|
config.sjiswrap_tag = "v1.2.1"
|
||||||
config.wibo_tag = "0.6.16"
|
config.wibo_tag = "0.6.16"
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class Object:
|
|||||||
"asflags": None,
|
"asflags": None,
|
||||||
"asm_dir": None,
|
"asm_dir": None,
|
||||||
"cflags": None,
|
"cflags": None,
|
||||||
"clean_extab": None,
|
"extab_padding": None,
|
||||||
"extra_asflags": [],
|
"extra_asflags": [],
|
||||||
"extra_cflags": [],
|
"extra_cflags": [],
|
||||||
"extra_clang_flags": [],
|
"extra_clang_flags": [],
|
||||||
@@ -90,7 +90,7 @@ class Object:
|
|||||||
set_default("add_to_all", True)
|
set_default("add_to_all", True)
|
||||||
set_default("asflags", config.asflags)
|
set_default("asflags", config.asflags)
|
||||||
set_default("asm_dir", config.asm_dir)
|
set_default("asm_dir", config.asm_dir)
|
||||||
set_default("clean_extab", False)
|
set_default("extab_padding", None)
|
||||||
set_default("mw_version", config.linker_version)
|
set_default("mw_version", config.linker_version)
|
||||||
set_default("scratch_preset_id", config.scratch_preset_id)
|
set_default("scratch_preset_id", config.scratch_preset_id)
|
||||||
set_default("shift_jis", config.shift_jis)
|
set_default("shift_jis", config.shift_jis)
|
||||||
@@ -649,9 +649,9 @@ def generate_build_ninja(
|
|||||||
mwcc_sjis_implicit: List[Optional[Path]] = [*mwcc_implicit, sjiswrap]
|
mwcc_sjis_implicit: List[Optional[Path]] = [*mwcc_implicit, sjiswrap]
|
||||||
|
|
||||||
# MWCC with extab post-processing
|
# MWCC with extab post-processing
|
||||||
mwcc_extab_cmd = f"{CHAIN}{mwcc_cmd} && {dtk} extab clean $out $out"
|
mwcc_extab_cmd = f"{CHAIN}{mwcc_cmd} && {dtk} extab clean --padding \"$extab_padding\" $out $out"
|
||||||
mwcc_extab_implicit: List[Optional[Path]] = [*mwcc_implicit, dtk]
|
mwcc_extab_implicit: List[Optional[Path]] = [*mwcc_implicit, dtk]
|
||||||
mwcc_sjis_extab_cmd = f"{CHAIN}{mwcc_sjis_cmd} && {dtk} extab clean $out $out"
|
mwcc_sjis_extab_cmd = f"{CHAIN}{mwcc_sjis_cmd} && {dtk} extab clean --padding \"$extab_padding\" $out $out"
|
||||||
mwcc_sjis_extab_implicit: List[Optional[Path]] = [*mwcc_sjis_implicit, dtk]
|
mwcc_sjis_extab_implicit: List[Optional[Path]] = [*mwcc_sjis_implicit, dtk]
|
||||||
|
|
||||||
# MWLD
|
# MWLD
|
||||||
@@ -927,26 +927,30 @@ def generate_build_ninja(
|
|||||||
lib_name = obj.options["lib"]
|
lib_name = obj.options["lib"]
|
||||||
build_rule = "mwcc"
|
build_rule = "mwcc"
|
||||||
build_implcit = mwcc_implicit
|
build_implcit = mwcc_implicit
|
||||||
if obj.options["shift_jis"] and obj.options["clean_extab"]:
|
|
||||||
build_rule = "mwcc_sjis_extab"
|
|
||||||
build_implcit = mwcc_sjis_extab_implicit
|
|
||||||
elif obj.options["shift_jis"]:
|
|
||||||
build_rule = "mwcc_sjis"
|
|
||||||
build_implcit = mwcc_sjis_implicit
|
|
||||||
elif obj.options["clean_extab"]:
|
|
||||||
build_rule = "mwcc_extab"
|
|
||||||
build_implcit = mwcc_extab_implicit
|
|
||||||
n.comment(f"{obj.name}: {lib_name} (linked {obj.completed})")
|
|
||||||
n.build(
|
|
||||||
outputs=obj.src_obj_path,
|
|
||||||
rule=build_rule,
|
|
||||||
inputs=src_path,
|
|
||||||
variables = {
|
variables = {
|
||||||
"mw_version": Path(obj.options["mw_version"]),
|
"mw_version": Path(obj.options["mw_version"]),
|
||||||
"cflags": cflags_str,
|
"cflags": cflags_str,
|
||||||
"basedir": os.path.dirname(obj.src_obj_path),
|
"basedir": os.path.dirname(obj.src_obj_path),
|
||||||
"basefile": obj.src_obj_path.with_suffix(""),
|
"basefile": obj.src_obj_path.with_suffix(""),
|
||||||
},
|
}
|
||||||
|
|
||||||
|
if obj.options["shift_jis"] and obj.options["extab_padding"] is not None:
|
||||||
|
build_rule = "mwcc_sjis_extab"
|
||||||
|
build_implcit = mwcc_sjis_extab_implicit
|
||||||
|
variables["extab_padding"] = "".join(f"{i:02x}" for i in obj.options["extab_padding"])
|
||||||
|
elif obj.options["shift_jis"]:
|
||||||
|
build_rule = "mwcc_sjis"
|
||||||
|
build_implcit = mwcc_sjis_implicit
|
||||||
|
elif obj.options["extab_padding"] is not None:
|
||||||
|
build_rule = "mwcc_extab"
|
||||||
|
build_implcit = mwcc_extab_implicit
|
||||||
|
variables["extab_padding"] = "".join(f"{i:02x}" for i in obj.options["extab_padding"])
|
||||||
|
n.comment(f"{obj.name}: {lib_name} (linked {obj.completed})")
|
||||||
|
n.build(
|
||||||
|
outputs=obj.src_obj_path,
|
||||||
|
rule=build_rule,
|
||||||
|
inputs=src_path,
|
||||||
|
variables=variables,
|
||||||
implicit=build_implcit,
|
implicit=build_implcit,
|
||||||
order_only="pre-compile",
|
order_only="pre-compile",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user