Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Update Splat to 0.27.3" #2169

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/splat.hd.ric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ options:
- .sbss
ld_bss_is_noload: false
disasm_unknown: true
include_macro_inc: false
sha1: 1dcd6b881e2c0906854c3d53839dfb4ae0d359d6
segments:
- name: ric
Expand Down
1 change: 1 addition & 0 deletions config/splat.hd.stcen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ options:
- .sbss
ld_bss_is_noload: false
disasm_unknown: true
include_macro_inc: false
sha1: 32698a322586d2fd4249467c99f5102faff44f30
segments:
- name: stcen
Expand Down
1 change: 1 addition & 0 deletions config/splat.pspeu.stst0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ options:
- .bss
ld_bss_is_noload: true
disasm_unknown: true
include_macro_inc: false
global_vram_start: 0x08000000
asm_inc_header: |
.set noat /* allow manual use of $at */
Expand Down
1 change: 1 addition & 0 deletions config/splat.us.bomar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ options:
- .bss
ld_bss_is_noload: false
disasm_unknown: true
include_macro_inc: False
sha1: 4cd6c07959db859f5bc19390a283f34df4bf1619
segments:
- name: bomar
Expand Down
1 change: 1 addition & 0 deletions config/splat.us.borbo3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ options:
- .sbss
ld_bss_is_noload: false
disasm_unknown: true
include_macro_inc: false
sha1: 8748529fc72268169d440fe0b008a5d50154c8b7
segments:
- name: borbo3
Expand Down
1 change: 1 addition & 0 deletions config/splat.us.stlib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ options:
- .sbss
ld_bss_is_noload: false
disasm_unknown: true
include_macro_inc: false
sha1: ddd108c3a9ec564d34063e5008685a9a41f8eabd
segments:
- name: stlib
Expand Down
1 change: 1 addition & 0 deletions config/splat.us.stno0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ options:
- .sbss
ld_bss_is_noload: false
disasm_unknown: true
include_macro_inc: false
sha1: d07f054f9dc8ef639257aca01deb1f24a2811924
segments:
- name: stno0
Expand Down
1 change: 1 addition & 0 deletions config/splat.us.stno1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ options:
- .sbss
ld_bss_is_noload: false
disasm_unknown: true
include_macro_inc: false
sha1: 41ccd886308d5527684ae2c41164ecf6c554721f
segments:
- name: stno1
Expand Down
1 change: 1 addition & 0 deletions config/splat.us.tt_001.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ options:
- .sbss
ld_bss_is_noload: false
disasm_unknown: true
include_macro_inc: false
sha1: 326c9d2f9b9e2af678f5d63b30b31fba99ae75d4
segments:
- name: tt_001
Expand Down
1 change: 1 addition & 0 deletions config/splat.us.tt_002.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ options:
- .sbss
ld_bss_is_noload: false
disasm_unknown: true
include_macro_inc: false
sha1: 4589bb04fe475439c6d6e9b7273a8971ad859b4d
segments:
- name: tt_002
Expand Down
1 change: 1 addition & 0 deletions config/splat.us.tt_003.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ options:
- .sbss
ld_bss_is_noload: false
disasm_unknown: true
include_macro_inc: false
sha1: b54466dec3923d43bd08d71bec688da252153984
segments:
- name: tt_003
Expand Down
1 change: 1 addition & 0 deletions config/splat.us.tt_004.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ options:
- .sbss
ld_bss_is_noload: false
disasm_unknown: true
include_macro_inc: false
sha1: 0f2ff898829ead77bb15545324c7b8958f9fb4e1
segments:
- name: tt_004
Expand Down
4 changes: 0 additions & 4 deletions include/gte.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.ifndef .L_GTE_INC
.L_GTE_INC:
# GTE macros

.macro RTPS
Expand Down Expand Up @@ -89,5 +87,3 @@
.macro GPL sf
.word 0x4BA0003E|\sf<<19
.endm

.endif
5 changes: 0 additions & 5 deletions include/macro.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.ifndef .L_MACRO_INC
.L_MACRO_INC:

.macro jlabel label
glabel \label
.endm
Expand All @@ -15,5 +12,3 @@


.include "gte.inc"

.endif
1 change: 1 addition & 0 deletions tools/dups/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ fn process_directory(dir_path: &str, funcs: &mut Vec<Function>) {
Err(error) => {
eprintln!("Unable to read directory: {}", error);
println!("Directory path: {}", dir_path);
exit(1);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions tools/make-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ def get_splat_config(
"section_order": section_order,
"ld_bss_is_noload": bss_is_no_load,
"disasm_unknown": True,
"include_macro_inc": False,
"disassemble_all": True,
}
}
Expand Down
36 changes: 8 additions & 28 deletions tools/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import requests
import subprocess
import sys
import yaml
from pathlib import Path
from mapfile_parser import MapFile
from mapfile_parser import ProgressStats
Expand Down Expand Up @@ -84,24 +83,21 @@ def get_nonmatchings_path(self, asm_path: Path) -> Path:
`asm/pspeu/st/wrp_psp/psp/wrp_psp`
"""
nonmatchings = f"{asm_path}/nonmatchings"
if not os.path.exists(nonmatchings) and not os.path.exists(
f"{asm_path}/matchings"
):

if not os.path.exists(nonmatchings):
nonmatchings_psp = f"{asm_path}/psp/{os.path.basename(asm_path)}"
if os.path.exists(nonmatchings_psp) and os.path.exists(
f"{asm_path}/matchings"
):
nonmatchings = nonmatchings_psp
else:
print(f"unable to determine nonmatchings path for {asm_path}")
print("unable to determine nonmatchings path")
exit(1)
# hack to return 'asm/us/main/nonmatchings' instead of 'asm/us/main/nonmatchings/main'
if nonmatchings.endswith("/main"):
nonmatchings = nonmatchings[:-5]
return Path(nonmatchings)

def __init__(self, module_name: str, path: str, src_dir: str = None):
def __init__(self, module_name: str, path: str):
self.name = module_name
self.data_imported = 0
self.data_total = 0
Expand All @@ -110,23 +106,7 @@ def __init__(self, module_name: str, path: str, src_dir: str = None):
self.functions_matching = 0
self.functions_total = 0

if src_dir == None:
src_dir = path

splat_config_path = f"config/splat.{args.version}.{module_name}.yaml"
if os.path.exists(splat_config_path):
with open(
f"config/splat.{args.version}.{module_name}.yaml"
) as config_yaml_ref:
config = yaml.safe_load(config_yaml_ref)

map_path = Path(f"{config["options"]["build_path"]}/{module_name}.map")

# first check for path override
if not os.path.exists(map_path):
map_path = Path(f"build/{args.version}/{path}.map")

# then fall back to path check (really only for weapons)
map_path = Path(f"build/{args.version}/{module_name}.map")
if not os.path.exists(map_path):
printerr(f"file '{map_path}' not found")
self.exists = False
Expand All @@ -136,9 +116,9 @@ def __init__(self, module_name: str, path: str, src_dir: str = None):
map_file = mapfile_parser.MapFile()
map_file.readMapFile(map_path)

asm_path = Path(config["options"]["asm_path"])
nonmatchings = Path(f"{asm_path}/nonmatchings")
depth = 4 + src_dir.count("/")
asm_path = self.get_asm_path(path)
nonmatchings = self.get_nonmatchings_path(asm_path)
depth = 4 + path.count("/")
self.calculate_progress(
map_file.filterBySectionType(".text"), asm_path, nonmatchings, depth
)
Expand Down Expand Up @@ -239,7 +219,7 @@ def __init__(self):
self.data_imported = 0
self.data_total = 0
for i in range(0, 59):
stats = DecompProgressStats("weapon", f"weapon/w0_{i:03d}", "weapon")
stats = DecompProgressStats(f"weapon/w0_{i:03d}", "weapon")
if stats.exists:
self.code_matching += stats.code_matching
self.code_total += stats.code_total
Expand Down
2 changes: 1 addition & 1 deletion tools/requirements-python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mapfile-parser==2.1.4
tabulate
requests
graphviz
splat64==0.27.3
splat64==0.24.6
crunch64
spimdisasm>=1.31.3
rabbitizer>=1.12.5
Expand Down
4 changes: 2 additions & 2 deletions tools/splat_ext/animset.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

sys.path.append(f"{os.getcwd()}/tools/splat_ext")
from splat.util import options
from splat.segtypes.segment import Segment
from splat.segtypes.n64.segment import N64Segment


class PSXSegAnimset(Segment):
class PSXSegAnimset(N64Segment):
def __init__(self, rom_start, rom_end, type, name, vram_start, args, yaml):
super().__init__(rom_start, rom_end, type, name, vram_start, args, yaml),

Expand Down
4 changes: 2 additions & 2 deletions tools/splat_ext/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

sys.path.append(f"{os.getcwd()}/tools/splat_ext")
from splat.util import options, log
from splat.segtypes.segment import Segment
from splat.segtypes.n64.segment import N64Segment
import utils


Expand Down Expand Up @@ -127,7 +127,7 @@ def serialize_asset(content: str, asset_config: str) -> bytearray:
return asm_output


class PSXSegAssets(Segment):
class PSXSegAssets(N64Segment):
def __init__(self, rom_start, rom_end, type, name, vram_start, args, yaml):
super().__init__(rom_start, rom_end, type, name, vram_start, args, yaml),

Expand Down
3 changes: 2 additions & 1 deletion tools/splat_ext/cmp.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from pathlib import Path
from typing import Optional
from splat.segtypes.n64.segment import N64Segment
from splat.segtypes.segment import Segment
from splat.util import options, log


class PSXSegCmp(Segment):
class PSXSegCmp(N64Segment):
def __init__(self, rom_start, rom_end, type, name, vram_start, args, yaml):
super().__init__(
rom_start, rom_end, type, name, vram_start, args=args, yaml=yaml
Expand Down
4 changes: 2 additions & 2 deletions tools/splat_ext/cmpgfx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
import sys
from typing import List, Optional, Tuple
import n64img
from splat.segtypes.segment import Segment
from splat.segtypes.n64.segment import N64Segment
from splat.util import options, log

sys.path.append(f"{os.getcwd()}/tools/splat_ext")
from cmp import SOTNDecompress
from utils import log_fatal


class PSXSegCmpgfx(Segment):
class PSXSegCmpgfx(N64Segment):
def __init__(self, rom_start, rom_end, type, name, vram_start, args, yaml):
super().__init__(
rom_start, rom_end, type, name, vram_start, args=args, yaml=yaml
Expand Down
4 changes: 2 additions & 2 deletions tools/splat_ext/pal.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from splat.util import options, log
from splat.segtypes.n64.i4 import N64SegI4
from splat.segtypes.n64.rgba16 import N64SegRgba16
from splat.segtypes.segment import Segment
from splat.segtypes.n64.segment import N64Segment
from typing import Optional
from pathlib import Path


class PSXSegPal(Segment):
class PSXSegPal(N64Segment):
def __init__(self, rom_start, rom_end, type, name, vram_start, args, yaml):
super().__init__(rom_start, rom_end, type, name, vram_start, args, yaml),

Expand Down
4 changes: 2 additions & 2 deletions tools/splat_ext/raw.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from splat.util import options, log
from splat.segtypes.n64.i4 import N64SegI4
from splat.segtypes.n64.rgba16 import N64SegRgba16
from splat.segtypes.segment import Segment
from splat.segtypes.n64.segment import N64Segment
from typing import Optional
from pathlib import Path


class PSXSegRaw(Segment):
class PSXSegRaw(N64Segment):
def __init__(self, rom_start, rom_end, type, name, vram_start, args, yaml):
super().__init__(rom_start, rom_end, type, name, vram_start, args, yaml),

Expand Down
4 changes: 2 additions & 2 deletions tools/splat_ext/spritesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

sys.path.append(f"{os.getcwd()}/tools/splat_ext")
from splat.util import options, log
from splat.segtypes.segment import Segment
from splat.segtypes.n64.segment import N64Segment
import utils

max_width = 256
Expand Down Expand Up @@ -226,7 +226,7 @@ def extract_sprite(output_file_name, data, w, h, pal):
return items


class PSXSegSpritesheet(Segment):
class PSXSegSpritesheet(N64Segment):
def __init__(self, rom_start, rom_end, type, name, vram_start, args, yaml):
super().__init__(rom_start, rom_end, type, name, vram_start, args, yaml),

Expand Down
Loading