diff --git a/configure.py b/configure.py index 5febf47ffd..21f6f860ee 100755 --- a/configure.py +++ b/configure.py @@ -47,8 +47,7 @@ def read_splat(splat_config: str): for segment in all_segments: for subdir, path, obj_type, start in segment.get_ld_files(): - print(path) - path = (segment.name if segment.name.endswith("/") else "") + subdir + "/" + path + path = subdir + "/" + path objects.add(path) segments[path] = segment diff --git a/tools/splat/segtypes/n64/code.py b/tools/splat/segtypes/n64/code.py index 795db82337..1eb3dcf024 100644 --- a/tools/splat/segtypes/n64/code.py +++ b/tools/splat/segtypes/n64/code.py @@ -46,7 +46,7 @@ def get_funcs_defined_in_c(c_file): class N64SegCode(N64Segment): def parse_segment_files(self, segment, seg_start, seg_end, seg_name, seg_vram): - prefix = "" if seg_name.endswith("/") else f"{seg_name}_" + prefix = seg_name if seg_name.endswith("/") else f"{seg_name}_" ret = [] prev_start = -1 @@ -70,6 +70,8 @@ class N64SegCode(N64Segment): if not name: name = self.get_default_name(start) if seg_name == self.get_default_name(seg_start) else f"{prefix}{start:X}" + elif seg_name.endswith("/"): + name = seg_name + name vram = seg_vram + (start - seg_start) @@ -735,7 +737,6 @@ class N64SegCode(N64Segment): c_path = os.path.join( base_path, "src", - self.name if self.name.endswith("/") else "", split_file["name"] + "." + self.get_ext(split_file["subtype"]) ) diff --git a/tools/splat/segtypes/segment.py b/tools/splat/segtypes/segment.py index a02f1ccc24..924ab98782 100644 --- a/tools/splat/segtypes/segment.py +++ b/tools/splat/segtypes/segment.py @@ -130,7 +130,7 @@ class Segment: for subdir, path, obj_type, start in self.get_ld_files(): # Hack for non-0x10 alignment if start % 0x10 != 0 and i != 0: - tmp_sect_name = os.path.join(subdir, path).replace(".", "_") + tmp_sect_name = path.replace(".", "_") tmp_sect_name = tmp_sect_name.replace("/", "_") tmp_vram = start - self.rom_start + self.vram_start s += (