Skip to content

Commit 0b16915

Browse files
committed
Ninja fixups, add map5_s01 random bytes to postbuild
1 parent 7fc97aa commit 0b16915

File tree

11 files changed

+24
-10
lines changed

11 files changed

+24
-10
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ INSERT_OVLS_FLAGS := -exe "$(ROM_DIR)/$(GAME_VERSION)/$(GAME_FILE_EXE)" -fs "$
8686
TARGET_PREBUILD := main bodyprog screens/stream
8787

8888
# Targets that will run tools/postbuild.py after being linked & extracted from ELF.
89-
TARGET_POSTBUILD := bodyprog screens/stream maps/map3_s06 maps/map4_s05
89+
TARGET_POSTBUILD := bodyprog screens/stream maps/map3_s06 maps/map4_s05 maps/map5_s01
9090

9191
# Adjusts compiler and assembler flags based on source file location.
9292
# - Files under main executable paths use -G8; overlay files use -G0.

configs/USA/maps/map1_s04.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ segments:
5959
- [0x1050, .rodata, map1_s04]
6060

6161
# .text section
62+
- [0x13E4, c, map1_s04_anim_info]
63+
- [0x13E4, c, map1_s04_header]
6264
- [0x13E4, c, map1_s04]
6365

6466
# .data section

configs/USA/maps/map2_s01.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ segments:
6262
- [0x1178, .rodata, map2_s01_2]
6363

6464
# .text section
65+
- [0x1A98, c, map2_s01_anim_info]
66+
- [0x1A98, c, map2_s01_header]
6567
- [0x1A98, c, map2_s01]
6668
- [0x3C94, c, Chara_Dahlia]
6769
- [0x4828, c, map2_s01_2]

configs/USA/maps/map2_s03.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ segments:
5959
- [0x1050, .rodata, map2_s03]
6060

6161
# .text section
62+
- [0x138C, c, map2_s03_anim_info]
63+
- [0x138C, c, map2_s03_header]
6264
- [0x138C, c, map2_s03]
6365

6466
# .data section

configs/USA/maps/map2_s04.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ segments:
5959
- [0x1050, .rodata, map2_s04]
6060

6161
# .text section
62+
- [0x1654, c, map2_s04_anim_info]
63+
- [0x1654, c, map2_s04_header]
6264
- [0x1654, c, map2_s04]
6365

6466
# .data section

configs/USA/maps/map5_s01.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ segments:
5555
subsegments:
5656
# .rodata section
5757
- [0x0, .rodata, map5_s01]
58+
- [0x3515, rodata] # 3 random bytes, linker artifact, splat doesn't seem to write to .s so postbuild.py has to patch them back in.
5859

5960
# .text section
6061
- [0x3518, c, map5_s01]

configs/USA/maps/map5_s03.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ segments:
6262
- [0x1468, .rodata, map5_s03_2]
6363

6464
# .text section
65+
- [0x237C, c, map5_s03_anim_info]
66+
- [0x237C, c, map5_s03_header]
6567
- [0x237C, c, map5_s03]
6668
- [0x6364, c, Chara_Kaufmann]
6769
- [0x6FD4, c, map5_s03_2]

include/maps/map5/map5_s01.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ extern s_WorldObjectDescNoRot g_WorldObject0; // D_800F3E10
1919
extern s_WorldObjectDesc g_WorldObject1; // D_800F3E40
2020
extern s_WorldObjectPose g_CommonWorldObjectPoses[5]; // 0x800F018C
2121

22-
extern u8 D_800CCA84[]; // "HOOK_HID" + garbage after null byte
23-
extern SVECTOR3 D_800CC938; // Empty `SVECTOR3`, remove after all functions that use it are decompiled.
2422
extern u16 D_800F0174;
2523
extern s_FsImageDesc D_800F0178;
2624
extern VECTOR3 D_800F0180;

ninja_config.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ class YAML_INFO:
202202
AS_FLAGS = f"{ENDIAN} {INCLUDE_FLAGS} {OPT_FLAGS} -march=r3000 -mtune=r3000 -no-pad-sections"
203203
OBJDUMP_FLAGS = f"--disassemble-all --reloc --disassemble-zeroes -Mreg-names=32"
204204

205+
TARGETS_POSTBUILD = ["1ST/BODYPROG.BIN", "VIN/STREAM.BIN", "VIN/MAP3_S06.BIN", "VIN/MAP4_S05.BIN", "VIN/MAP5_S01.BIN"]
206+
205207
def ninja_setup_list_add_source(target_path: str, source_path: str, ninja_file, objdiff_file, non_matching_enabled):
206208

207209
skipAsm = ""
@@ -475,7 +477,7 @@ def ninja_setup_main(ninja_file_prefix: str, game_version_idx: int, split_entrie
475477
implicit=f"{output}.elf"
476478
)
477479

478-
if split_config.SPLIT_BASENAME == "1ST/BODYPROG.BIN" or split_config.SPLIT_BASENAME == "VIN/STREAM.BIN":
480+
if split_config.SPLIT_BASENAME in TARGETS_POSTBUILD:
479481
ninja.build(
480482
outputs=f"{output}.fix",
481483
rule="postbuild",
@@ -804,7 +806,7 @@ def main():
804806
parser.add_argument(
805807
"-iso_e", "--iso_extract",
806808
help="Extract game files",
807-
type=str
809+
action="store_true"
808810
)
809811
parser.add_argument(
810812
"-set", "--setup",
@@ -863,7 +865,7 @@ def main():
863865
clean_working_files(False)
864866
return
865867

866-
if args.iso_extract != None:
868+
if args.iso_extract:
867869
extract_files(gameVersionOption)
868870
return
869871

src/maps/map5_s01/map5_s01.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,8 +1045,7 @@ void func_800ECB58(void) // 0x800ECB58
10451045
{
10461046
WorldObjectNoRotInit(&g_WorldObject0, "RSRMAP_H", -46.5f, 0.0f, 2.5f);
10471047

1048-
// @hack D_800CCA84 = "HOOK_HID" with some garbage after the null byte.
1049-
WorldObjectInit(&g_WorldObject1, D_800CCA84, 52.15f, -1.359f, -57.925f, 0.0f, 0.0f, 5.8f);
1048+
WorldObjectInit(&g_WorldObject1, "FOOK_HID", 52.15f, -1.359f, -57.925f, 0.0f, 0.0f, 5.8f);
10501049

10511050
if (g_SavegamePtr->gameDifficulty_260 == GameDifficulty_Easy)
10521051
{
@@ -1130,5 +1129,3 @@ void func_800ECC8C(void) // 0x800ECC8C
11301129
}
11311130
}
11321131
}
1133-
1134-
INCLUDE_RODATA("asm/maps/map5_s01/nonmatchings/map5_s01", D_800CCA84);

0 commit comments

Comments
 (0)