diff --git a/.gitignore b/.gitignore index 35a6fd24570..3a9a53c61ee 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,15 @@ build/ dump *.backup crash.xml +/audio/* +/sprite/* +/battle/* +/globals/* +/map/* +/world/* +/image/* +/strings/* +/res/* /tools/Yay0compress /tools/n64crc diff --git a/requirements.txt b/requirements.txt index 1d1b4898275..7f4826ade80 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,5 +13,5 @@ rabbitizer n64img python-githooks crunch64>=0.2.0 -splat64>=0.21.5 +splat64>=0.22.0 requests diff --git a/src/battle/common/actor/forest_fuzzy.inc.c b/src/battle/common/actor/forest_fuzzy.inc.c index 0a3f7be2209..f1218f4f0ac 100644 --- a/src/battle/common/actor/forest_fuzzy.inc.c +++ b/src/battle/common/actor/forest_fuzzy.inc.c @@ -332,7 +332,7 @@ EvtScript N(EVS_Attack_Leech) = { Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Idle) Label(100) Call(SetActorDispOffset, ACTOR_SELF, 0, 10, 0) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Anim04) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Forest_Leech) Call(SetActorDispOffset, ACTOR_SELF, 0, 9, 0) Wait(1) Call(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) diff --git a/src/battle/common/actor/fuzzy.inc.c b/src/battle/common/actor/fuzzy.inc.c index 428507c415d..5b381548902 100644 --- a/src/battle/common/actor/fuzzy.inc.c +++ b/src/battle/common/actor/fuzzy.inc.c @@ -262,7 +262,7 @@ EvtScript N(EVS_TakeTurn) = { Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Idle) Label(100) Call(SetActorDispOffset, ACTOR_SELF, 0, 10, 0) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Anim04) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Leech) Call(SetActorDispOffset, ACTOR_SELF, 0, 9, 0) Wait(1) Call(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) diff --git a/src/battle/common/actor/jungle_fuzzy.inc.c b/src/battle/common/actor/jungle_fuzzy.inc.c index 80b7bf29c11..279d72d13ea 100644 --- a/src/battle/common/actor/jungle_fuzzy.inc.c +++ b/src/battle/common/actor/jungle_fuzzy.inc.c @@ -336,7 +336,7 @@ EvtScript N(EVS_Attack_Leech) = { Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Idle) Label(100) Call(SetActorDispOffset, ACTOR_SELF, 0, 10, 0) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Anim04) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Fuzzy_Jungle_Leech) Call(SetActorDispOffset, ACTOR_SELF, 0, 9, 0) Wait(1) Call(SetActorDispOffset, ACTOR_SELF, 0, 8, 0) diff --git a/src/world/area_jan/jan_01/jan_01_3_npc.c b/src/world/area_jan/jan_01/jan_01_3_npc.c index ac8ad3e04b9..8d2e3e2bd1b 100644 --- a/src/world/area_jan/jan_01/jan_01_3_npc.c +++ b/src/world/area_jan/jan_01/jan_01_3_npc.c @@ -259,7 +259,7 @@ EvtScript N(EVS_NpcDefeat_JungleFuzzyBoss) = { EvtScript N(EVS_NpcInit_JungleFuzzy_01) = { IfLt(GB_StoryProgress, STORY_CH5_KOLORADO_ESCAPED_FUZZIES) Call(SetSelfVar, 0, 0) - Call(SetNpcAnimation, NPC_SELF, ANIM_Fuzzy_Jungle_Anim04) + Call(SetNpcAnimation, NPC_SELF, ANIM_Fuzzy_Jungle_Leech) Call(BindNpcIdle, NPC_SELF, Ref(N(EVS_NpcIdle_JungleFuzzy_01))) Call(BindNpcDefeat, NPC_SELF, Ref(N(EVS_NpcDefeat_JungleFuzzyBoss))) Else diff --git a/tools/renames/1_sprite_anims.txt b/tools/renames/1_sprite_anims.txt new file mode 100644 index 00000000000..fdc1d40a1a8 --- /dev/null +++ b/tools/renames/1_sprite_anims.txt @@ -0,0 +1,3 @@ +ANIM_Fuzzy_Anim04 ANIM_Fuzzy_Leech +ANIM_Fuzzy_Forest_Anim04 ANIM_Fuzzy_Forest_Leech +ANIM_Fuzzy_Jungle_Anim04 ANIM_Fuzzy_Jungle_Leech diff --git a/tools/splat_ext/npc_sprite_names.yaml b/tools/splat_ext/npc_sprite_names.yaml index c083a698709..75ccc237139 100644 --- a/tools/splat_ext/npc_sprite_names.yaml +++ b/tools/splat_ext/npc_sprite_names.yaml @@ -2382,7 +2382,7 @@ Fuzzy: - Idle - Walk - Run - - Anim04 + - Leech - Jump - Anim06 - Bite diff --git a/tools/splat_ext/pm_charset_palettes.py b/tools/splat_ext/pm_charset_palettes.py index aa4847b439c..48903c5b003 100644 --- a/tools/splat_ext/pm_charset_palettes.py +++ b/tools/splat_ext/pm_charset_palettes.py @@ -1,19 +1,9 @@ from splat.segtypes.n64.segment import N64Segment -from splat.segtypes.n64.palette import iter_in_groups -from splat.util.color import unpack_color +from splat.segtypes.n64.palette import N64SegPalette from splat.util import options import png # type: ignore -def parse_palette(data): - palette = [] - - for a, b in iter_in_groups(data, 2): - palette.append(unpack_color([a, b])) - - return palette - - class N64SegPm_charset_palettes(N64Segment): require_unique_name = False @@ -34,7 +24,7 @@ def scan(self, rom_bytes): self.palettes = [] for i in range(0, self.size, 0x10): - palette = parse_palette(data[i : i + 0x10]) + palette = N64SegPalette.parse_palette_bytes(data[i : i + 0x10]) self.palettes.append(palette) def split(self, rom_bytes): diff --git a/tools/splat_ext/pm_map_data.py b/tools/splat_ext/pm_map_data.py index 3d5e0908cc1..e3061feec53 100644 --- a/tools/splat_ext/pm_map_data.py +++ b/tools/splat_ext/pm_map_data.py @@ -130,7 +130,12 @@ def split(self, rom_bytes): if name == "end_data": break - assert self.files.get(name) is not None + if self.files.get(name) is None: + # TODO + # https://github.com/pmret/papermario/issues/1170 + self.warn(f"skipping unknown file {name}") + asset_idx += 1 + continue if offset == 0: path = None diff --git a/tools/splat_ext/pm_sprites.py b/tools/splat_ext/pm_sprites.py index d877581ea3a..5a2184b7c1d 100644 --- a/tools/splat_ext/pm_sprites.py +++ b/tools/splat_ext/pm_sprites.py @@ -719,11 +719,15 @@ class N64SegPm_sprites(N64Segment): def __init__(self, rom_start, rom_end, type, name, vram_start, args, yaml) -> None: super().__init__(rom_start, rom_end, type, name, vram_start, args=args, yaml=yaml) - with (Path(__file__).parent / f"npc_sprite_names.yaml").open("r") as f: + path = Path(__file__).parent / f"npc_sprite_names.yaml" + with path.open("r") as f: self.npc_cfg = yaml_loader.load(f.read(), Loader=yaml_loader.SafeLoader) + self.npc_cfg_modified_time = path.stat().st_mtime - with (Path(__file__).parent / f"player_sprite_names.yaml").open("r") as f: + path = Path(__file__).parent / f"player_sprite_names.yaml" + with path.open("r") as f: self.player_cfg = yaml_loader.load(f.read(), Loader=yaml_loader.SafeLoader) + self.player_cfg_modified_time = path.stat().st_mtime def out_path(self): return options.opts.asset_path / "sprite" / "sprites" @@ -852,4 +856,4 @@ def get_linker_entries(self): return [LinkerEntry(self, src_paths, self.out_path(), self.get_linker_section(), self.get_linker_section())] def cache(self): - return (self.yaml, self.rom_end, self.player_cfg, self.npc_cfg) + return (self.yaml, self.rom_end, self.player_cfg_modified_time, self.npc_cfg_modified_time)