Skip to content

Commit

Permalink
Merge branch 'main' into shift-bss-be-gone
Browse files Browse the repository at this point in the history
  • Loading branch information
Alto1772 committed Feb 21, 2024
2 parents f01234a + c3cf156 commit 8ed03a2
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 22 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ build/
dump
*.backup
crash.xml
/audio/*
/sprite/*
/battle/*
/globals/*
/map/*
/world/*
/image/*
/strings/*
/res/*

/tools/Yay0compress
/tools/n64crc
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ rabbitizer
n64img
python-githooks
crunch64>=0.2.0
splat64>=0.21.5
splat64>=0.22.0
requests
2 changes: 1 addition & 1 deletion src/battle/common/actor/forest_fuzzy.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/battle/common/actor/fuzzy.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/battle/common/actor/jungle_fuzzy.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/world/area_jan/jan_01/jan_01_3_npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tools/renames/1_sprite_anims.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tools/splat_ext/npc_sprite_names.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2382,7 +2382,7 @@ Fuzzy:
- Idle
- Walk
- Run
- Anim04
- Leech
- Jump
- Anim06
- Bite
Expand Down
14 changes: 2 additions & 12 deletions tools/splat_ext/pm_charset_palettes.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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):
Expand Down
7 changes: 6 additions & 1 deletion tools/splat_ext/pm_map_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions tools/splat_ext/pm_sprites.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

0 comments on commit 8ed03a2

Please sign in to comment.