splat64 0.36.1__py3-none-any.whl → 0.36.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- splat/__init__.py +1 -1
- splat/disassembler/__init__.py +0 -1
- splat/disassembler/null_disassembler.py +0 -1
- splat/disassembler/spimdisasm_disassembler.py +1 -1
- splat/platforms/ps2.py +0 -2
- splat/scripts/create_config.py +1 -1
- splat/scripts/split.py +9 -9
- splat/segtypes/common/asm.py +1 -3
- splat/segtypes/common/bin.py +2 -1
- splat/segtypes/common/c.py +12 -10
- splat/segtypes/common/code.py +1 -1
- splat/segtypes/common/codesubsegment.py +1 -1
- splat/segtypes/common/databin.py +0 -1
- splat/segtypes/common/rodata.py +1 -1
- splat/segtypes/common/rodatabin.py +0 -1
- splat/segtypes/common/segment.py +1 -1
- splat/segtypes/linker_entry.py +21 -16
- splat/segtypes/n64/gfx.py +0 -1
- splat/segtypes/segment.py +7 -7
- splat/util/cache_handler.py +1 -1
- splat/util/conf.py +5 -5
- splat/util/file_presets.py +7 -6
- splat/util/n64/rominfo.py +1 -1
- splat/util/psx/psxexeinfo.py +2 -3
- splat/util/relocs.py +3 -3
- splat/util/symbols.py +10 -8
- splat/util/utils.py +3 -3
- {splat64-0.36.1.dist-info → splat64-0.36.3.dist-info}/METADATA +5 -5
- {splat64-0.36.1.dist-info → splat64-0.36.3.dist-info}/RECORD +32 -32
- {splat64-0.36.1.dist-info → splat64-0.36.3.dist-info}/WHEEL +0 -0
- {splat64-0.36.1.dist-info → splat64-0.36.3.dist-info}/entry_points.txt +0 -0
- {splat64-0.36.1.dist-info → splat64-0.36.3.dist-info}/licenses/LICENSE +0 -0
splat/__init__.py
CHANGED
splat/disassembler/__init__.py
CHANGED
|
@@ -7,7 +7,7 @@ from typing import Set
|
|
|
7
7
|
|
|
8
8
|
class SpimdisasmDisassembler(disassembler.Disassembler):
|
|
9
9
|
# This value should be kept in sync with the version listed on requirements.txt and pyproject.toml
|
|
10
|
-
SPIMDISASM_MIN = (1,
|
|
10
|
+
SPIMDISASM_MIN = (1, 38, 0)
|
|
11
11
|
|
|
12
12
|
def configure(self):
|
|
13
13
|
# Configure spimdisasm
|
splat/platforms/ps2.py
CHANGED
splat/scripts/create_config.py
CHANGED
|
@@ -223,7 +223,7 @@ segments:
|
|
|
223
223
|
f"// The address of the end of the stack is 0x{rom.entrypoint_info.stack_top.value:08X}."
|
|
224
224
|
)
|
|
225
225
|
reloc_addrs.append(
|
|
226
|
-
f"// A common size for this stack is 0x2000, so try checking for the address 0x{rom.entrypoint_info.stack_top.value-0x2000:08X}. Note the stack may have a different size."
|
|
226
|
+
f"// A common size for this stack is 0x2000, so try checking for the address 0x{rom.entrypoint_info.stack_top.value - 0x2000:08X}. Note the stack may have a different size."
|
|
227
227
|
)
|
|
228
228
|
reloc_addrs.append(
|
|
229
229
|
f"// rom:0x{rom.entrypoint_info.stack_top.rom_hi:06X} reloc:MIPS_HI16 symbol:main_stack addend:0xXXXX"
|
splat/scripts/split.py
CHANGED
|
@@ -138,12 +138,12 @@ def initialize_segments(config_segments: Union[dict, list]) -> List[Segment]:
|
|
|
138
138
|
)
|
|
139
139
|
|
|
140
140
|
# Not user error, hopefully...
|
|
141
|
-
assert (
|
|
142
|
-
seg.
|
|
143
|
-
)
|
|
144
|
-
assert (
|
|
145
|
-
other_seg.
|
|
146
|
-
)
|
|
141
|
+
assert seg.paired_segment is None, (
|
|
142
|
+
f"Somehow '{seg.name}' was already paired so something else? It is paired to '{seg.paired_segment.name}' instead of {other_seg.name}"
|
|
143
|
+
)
|
|
144
|
+
assert other_seg.paired_segment is None, (
|
|
145
|
+
f"Somehow '{other_seg.name}' was already paired so something else? It is paired to '{other_seg.paired_segment.name}' instead of {seg.name}"
|
|
146
|
+
)
|
|
147
147
|
|
|
148
148
|
found = True
|
|
149
149
|
# Pair them
|
|
@@ -216,9 +216,9 @@ def calc_segment_dependences(
|
|
|
216
216
|
|
|
217
217
|
for follows_class in vram_class.follows_classes:
|
|
218
218
|
if follows_class in vram_class_to_segments:
|
|
219
|
-
vram_class_to_follows_segments[
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
vram_class_to_follows_segments[vram_class] += (
|
|
220
|
+
vram_class_to_segments[follows_class]
|
|
221
|
+
)
|
|
222
222
|
return vram_class_to_follows_segments
|
|
223
223
|
|
|
224
224
|
|
splat/segtypes/common/asm.py
CHANGED
splat/segtypes/common/bin.py
CHANGED
splat/segtypes/common/c.py
CHANGED
|
@@ -177,9 +177,9 @@ class CommonSegC(CommonSegCodeSubsegment):
|
|
|
177
177
|
if rodata_sibling.is_generated:
|
|
178
178
|
continue
|
|
179
179
|
|
|
180
|
-
assert isinstance(
|
|
181
|
-
rodata_sibling,
|
|
182
|
-
)
|
|
180
|
+
assert isinstance(rodata_sibling, CommonSegRodata), (
|
|
181
|
+
f"{rodata_sibling}, {rodata_sibling.type}"
|
|
182
|
+
)
|
|
183
183
|
|
|
184
184
|
if not rodata_sibling.type.startswith("."):
|
|
185
185
|
# Emit an error if we try to migrate the rodata symbols to functions if the rodata section is not prefixed with a dot
|
|
@@ -237,7 +237,7 @@ class CommonSegC(CommonSegCodeSubsegment):
|
|
|
237
237
|
entry.sectionRodata = rodata_section_type
|
|
238
238
|
if entry.function is not None:
|
|
239
239
|
if (
|
|
240
|
-
entry.function.
|
|
240
|
+
entry.function.getNameUnquoted() in self.global_asm_funcs
|
|
241
241
|
or is_new_c_file
|
|
242
242
|
or options.opts.disassemble_all
|
|
243
243
|
):
|
|
@@ -250,7 +250,8 @@ class CommonSegC(CommonSegCodeSubsegment):
|
|
|
250
250
|
assert func_sym is not None
|
|
251
251
|
|
|
252
252
|
if (
|
|
253
|
-
entry.function.
|
|
253
|
+
entry.function.getNameUnquoted()
|
|
254
|
+
not in self.global_asm_funcs
|
|
254
255
|
and options.opts.disassemble_all
|
|
255
256
|
and not is_new_c_file
|
|
256
257
|
):
|
|
@@ -263,7 +264,8 @@ class CommonSegC(CommonSegCodeSubsegment):
|
|
|
263
264
|
else:
|
|
264
265
|
for spim_rodata_sym in entry.rodataSyms:
|
|
265
266
|
if (
|
|
266
|
-
spim_rodata_sym.
|
|
267
|
+
spim_rodata_sym.getNameUnquoted()
|
|
268
|
+
in self.global_asm_rodata_syms
|
|
267
269
|
or is_new_c_file
|
|
268
270
|
or options.opts.disassemble_all
|
|
269
271
|
):
|
|
@@ -307,7 +309,7 @@ class CommonSegC(CommonSegCodeSubsegment):
|
|
|
307
309
|
"\nA gap was detected in migrated rodata symbols!", status="warn"
|
|
308
310
|
)
|
|
309
311
|
log.write(
|
|
310
|
-
f"\t In function '{func.
|
|
312
|
+
f"\t In function '{func.getNameUnquoted()}' (0x{func.vram:08X}), gap detected between '{rodata_sym.getNameUnquoted()}' (0x{rodata_sym.vram:08X}) and '{next_rodata_sym.getNameUnquoted()}' (0x{next_rodata_sym.vram:08X})"
|
|
311
313
|
)
|
|
312
314
|
log.write(
|
|
313
315
|
f"\t The address of the missing rodata symbol is 0x{rodata_sym.vramEnd:08X}"
|
|
@@ -414,7 +416,7 @@ class CommonSegC(CommonSegCodeSubsegment):
|
|
|
414
416
|
and spim_sym.instructions[0].isReturn()
|
|
415
417
|
and spim_sym.instructions[1].isNop()
|
|
416
418
|
):
|
|
417
|
-
c_lines.append(f"void {spim_sym.
|
|
419
|
+
c_lines.append(f"void {spim_sym.getNameUnquoted()}(void) {{")
|
|
418
420
|
c_lines.append("}")
|
|
419
421
|
else:
|
|
420
422
|
c_lines.append(
|
|
@@ -492,7 +494,7 @@ class CommonSegC(CommonSegCodeSubsegment):
|
|
|
492
494
|
depend_list = []
|
|
493
495
|
for entry in symbols_entries:
|
|
494
496
|
if entry.function is not None:
|
|
495
|
-
func_name = entry.function.
|
|
497
|
+
func_name = entry.function.getNameUnquoted()
|
|
496
498
|
|
|
497
499
|
if func_name in self.global_asm_funcs or is_new_c_file:
|
|
498
500
|
outpath = asm_out_dir / self.name / (func_name + ".s")
|
|
@@ -502,7 +504,7 @@ class CommonSegC(CommonSegCodeSubsegment):
|
|
|
502
504
|
f.write(f" \\\n {outpath.as_posix()}")
|
|
503
505
|
else:
|
|
504
506
|
for rodata_sym in entry.rodataSyms:
|
|
505
|
-
rodata_name = rodata_sym.
|
|
507
|
+
rodata_name = rodata_sym.getNameUnquoted()
|
|
506
508
|
|
|
507
509
|
if rodata_name in self.global_asm_rodata_syms or is_new_c_file:
|
|
508
510
|
outpath = asm_out_dir / self.name / (rodata_name + ".s")
|
splat/segtypes/common/code.py
CHANGED
|
@@ -182,7 +182,7 @@ class CommonSegCodeSubsegment(Segment):
|
|
|
182
182
|
print(
|
|
183
183
|
"File split suggestions for this segment will follow in config yaml format:"
|
|
184
184
|
)
|
|
185
|
-
print(f" - [0x{self.rom_start+in_file_offset:X}, {self.type}]")
|
|
185
|
+
print(f" - [0x{self.rom_start + in_file_offset:X}, {self.type}]")
|
|
186
186
|
|
|
187
187
|
def should_scan(self) -> bool:
|
|
188
188
|
return (
|
splat/segtypes/common/databin.py
CHANGED
splat/segtypes/common/rodata.py
CHANGED
|
@@ -130,7 +130,7 @@ class CommonSegRodata(CommonSegData):
|
|
|
130
130
|
f"\nRodata segment '{self.name}' may belong to the text segment '{text_segment.name}'"
|
|
131
131
|
)
|
|
132
132
|
print(
|
|
133
|
-
f" Based on the usage from the function {refenceeFunction.
|
|
133
|
+
f" Based on the usage from the function {refenceeFunction.getNameUnquoted()} to the symbol {symbol.getNameUnquoted()}"
|
|
134
134
|
)
|
|
135
135
|
possible_text_segments.add(text_segment)
|
|
136
136
|
|
splat/segtypes/common/segment.py
CHANGED
splat/segtypes/linker_entry.py
CHANGED
|
@@ -162,9 +162,9 @@ class LinkerEntry:
|
|
|
162
162
|
linker_writer._write_symbol(path_cname, ".")
|
|
163
163
|
|
|
164
164
|
def emit_path(self, linker_writer: "LinkerWriter"):
|
|
165
|
-
assert (
|
|
166
|
-
self.
|
|
167
|
-
)
|
|
165
|
+
assert self.object_path is not None, (
|
|
166
|
+
f"{self.segment.name}, {self.segment.rom_start}"
|
|
167
|
+
)
|
|
168
168
|
|
|
169
169
|
if self.noload and self.bss_contains_common:
|
|
170
170
|
linker_writer._write_object_path_section(
|
|
@@ -237,9 +237,9 @@ class LinkerWriter:
|
|
|
237
237
|
return
|
|
238
238
|
|
|
239
239
|
section_entries: OrderedDict[str, List[LinkerEntry]] = OrderedDict()
|
|
240
|
-
for
|
|
241
|
-
if
|
|
242
|
-
section_entries[
|
|
240
|
+
for section_name in segment.section_order:
|
|
241
|
+
if section_name in options.opts.section_order:
|
|
242
|
+
section_entries[section_name] = []
|
|
243
243
|
|
|
244
244
|
# Add all entries to section_entries
|
|
245
245
|
prev_entry = None
|
|
@@ -301,7 +301,7 @@ class LinkerWriter:
|
|
|
301
301
|
|
|
302
302
|
# To keep track which sections has been started
|
|
303
303
|
started_sections: Dict[str, bool] = {
|
|
304
|
-
|
|
304
|
+
section_name: False for section_name in options.opts.section_order
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
# Find where sections are last seen
|
|
@@ -389,14 +389,19 @@ class LinkerWriter:
|
|
|
389
389
|
|
|
390
390
|
self._begin_segment(segment, seg_name, noload=False, is_first=is_first)
|
|
391
391
|
|
|
392
|
-
for
|
|
393
|
-
if
|
|
392
|
+
for section_name in segment.section_order:
|
|
393
|
+
if section_name not in options.opts.section_order:
|
|
394
394
|
continue
|
|
395
|
-
if
|
|
395
|
+
if section_name == ".bss":
|
|
396
396
|
continue
|
|
397
397
|
|
|
398
398
|
entry = LinkerEntry(
|
|
399
|
-
segment,
|
|
399
|
+
segment,
|
|
400
|
+
[],
|
|
401
|
+
segments_path / f"{seg_name}.o",
|
|
402
|
+
section_name,
|
|
403
|
+
section_name,
|
|
404
|
+
noload=False,
|
|
400
405
|
)
|
|
401
406
|
self.dependencies_entries.append(entry)
|
|
402
407
|
entry.emit_entry(self)
|
|
@@ -439,9 +444,9 @@ class LinkerWriter:
|
|
|
439
444
|
seg_name = segment.get_cname()
|
|
440
445
|
|
|
441
446
|
section_entries: OrderedDict[str, List[LinkerEntry]] = OrderedDict()
|
|
442
|
-
for
|
|
443
|
-
if
|
|
444
|
-
section_entries[
|
|
447
|
+
for section_name in segment.section_order:
|
|
448
|
+
if section_name in options.opts.section_order:
|
|
449
|
+
section_entries[section_name] = []
|
|
445
450
|
|
|
446
451
|
# Add all entries to section_entries
|
|
447
452
|
prev_entry = None
|
|
@@ -594,7 +599,7 @@ class LinkerWriter:
|
|
|
594
599
|
if not noload:
|
|
595
600
|
seg_rom_start = get_segment_rom_start(seg_name)
|
|
596
601
|
line += f" AT({seg_rom_start})"
|
|
597
|
-
if options.opts.emit_subalign and segment.subalign
|
|
602
|
+
if options.opts.emit_subalign and segment.subalign is not None:
|
|
598
603
|
line += f" SUBALIGN({segment.subalign})"
|
|
599
604
|
|
|
600
605
|
self._writeln(line)
|
|
@@ -636,7 +641,7 @@ class LinkerWriter:
|
|
|
636
641
|
if noload:
|
|
637
642
|
line += " (NOLOAD)"
|
|
638
643
|
line += " :"
|
|
639
|
-
if options.opts.emit_subalign and segment.subalign
|
|
644
|
+
if options.opts.emit_subalign and segment.subalign is not None:
|
|
640
645
|
line += f" SUBALIGN({segment.subalign})"
|
|
641
646
|
|
|
642
647
|
self._writeln(line)
|
splat/segtypes/n64/gfx.py
CHANGED
splat/segtypes/segment.py
CHANGED
|
@@ -56,7 +56,7 @@ def parse_segment_subalign(segment: Union[dict, list]) -> Optional[int]:
|
|
|
56
56
|
default = options.opts.subalign
|
|
57
57
|
if isinstance(segment, dict):
|
|
58
58
|
subalign = segment.get("subalign", default)
|
|
59
|
-
if subalign
|
|
59
|
+
if subalign is not None:
|
|
60
60
|
subalign = int(subalign)
|
|
61
61
|
return subalign
|
|
62
62
|
return default
|
|
@@ -101,15 +101,15 @@ class Segment:
|
|
|
101
101
|
|
|
102
102
|
if options.opts.allow_segment_overrides:
|
|
103
103
|
segment_class = Segment.get_extension_segment_class(seg_type)
|
|
104
|
-
if segment_class
|
|
104
|
+
if segment_class is None:
|
|
105
105
|
segment_class = Segment.get_base_segment_class(seg_type)
|
|
106
106
|
else:
|
|
107
107
|
segment_class = Segment.get_base_segment_class(seg_type)
|
|
108
|
-
if segment_class
|
|
108
|
+
if segment_class is None:
|
|
109
109
|
# Look in extensions
|
|
110
110
|
segment_class = Segment.get_extension_segment_class(seg_type)
|
|
111
111
|
|
|
112
|
-
if segment_class
|
|
112
|
+
if segment_class is None:
|
|
113
113
|
log.error(
|
|
114
114
|
f"could not load segment type '{seg_type}'\n(hint: confirm your extension directory is configured correctly)"
|
|
115
115
|
)
|
|
@@ -538,9 +538,9 @@ class Segment:
|
|
|
538
538
|
|
|
539
539
|
@property
|
|
540
540
|
def subalign(self) -> Optional[int]:
|
|
541
|
-
assert (
|
|
542
|
-
|
|
543
|
-
)
|
|
541
|
+
assert self.parent is None, (
|
|
542
|
+
f"subalign is not valid for non-top-level segments. ({self})"
|
|
543
|
+
)
|
|
544
544
|
return self.given_subalign
|
|
545
545
|
|
|
546
546
|
@property
|
splat/util/cache_handler.py
CHANGED
|
@@ -20,7 +20,7 @@ class Cache:
|
|
|
20
20
|
log.write(f"Loaded cache ({len(self.cache.keys())} items)")
|
|
21
21
|
except Exception:
|
|
22
22
|
log.write(
|
|
23
|
-
|
|
23
|
+
"Not able to load cache file. Discarding old cache", status="warn"
|
|
24
24
|
)
|
|
25
25
|
|
|
26
26
|
# invalidate entire cache if options change
|
splat/util/conf.py
CHANGED
|
@@ -10,10 +10,10 @@ from typing import Any, Dict, List, Optional
|
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
|
|
12
12
|
# This unused import makes the yaml library faster. don't remove
|
|
13
|
-
import pylibyaml #
|
|
13
|
+
import pylibyaml # noqa: F401
|
|
14
14
|
import yaml
|
|
15
15
|
|
|
16
|
-
from . import
|
|
16
|
+
from . import options, vram_classes
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
def _merge_configs(main_config, additional_config, additional_config_path):
|
|
@@ -26,15 +26,15 @@ def _merge_configs(main_config, additional_config, additional_config_path):
|
|
|
26
26
|
for curkey in additional_config:
|
|
27
27
|
if curkey not in main_config:
|
|
28
28
|
main_config[curkey] = additional_config[curkey]
|
|
29
|
-
elif type(main_config[curkey])
|
|
29
|
+
elif type(main_config[curkey]) is not type(additional_config[curkey]):
|
|
30
30
|
raise TypeError(
|
|
31
31
|
f"Could not merge {str(additional_config_path)}: type for key '{curkey}' in configs does not match"
|
|
32
32
|
)
|
|
33
33
|
else:
|
|
34
34
|
# keys exist and match, see if a list to append
|
|
35
|
-
if type(main_config[curkey])
|
|
35
|
+
if type(main_config[curkey]) is list:
|
|
36
36
|
main_config[curkey] += additional_config[curkey]
|
|
37
|
-
elif type(main_config[curkey])
|
|
37
|
+
elif type(main_config[curkey]) is dict:
|
|
38
38
|
# need to merge sub areas
|
|
39
39
|
main_config[curkey] = _merge_configs(
|
|
40
40
|
main_config[curkey],
|
splat/util/file_presets.py
CHANGED
|
@@ -342,17 +342,17 @@ def write_assembly_inc_files():
|
|
|
342
342
|
|
|
343
343
|
|
|
344
344
|
def write_gte_macros():
|
|
345
|
-
# Taken directly from https://github.com/Decompollaborate/rabbitizer/blob
|
|
345
|
+
# Taken directly from https://github.com/Decompollaborate/rabbitizer/blob/-/docs/r3000gte/gte_macros.s
|
|
346
346
|
# Please try to upstream any fix/update done here.
|
|
347
|
-
gte_macros = """
|
|
347
|
+
gte_macros = """\
|
|
348
348
|
.ifndef .L_GTE_MACRO_INC
|
|
349
349
|
.L_GTE_MACRO_INC:
|
|
350
350
|
|
|
351
351
|
## GTE instruction macros
|
|
352
352
|
## These are meant for use with GAS and replace DMPSX
|
|
353
353
|
|
|
354
|
-
.macro cop2op
|
|
355
|
-
cop2 \\
|
|
354
|
+
.macro cop2op fake_op, op, gbg = 0, sf = 1, mx = 0, v = 0, cv = 0, lm = 0
|
|
355
|
+
cop2 \\fake_op << 20 | \\gbg << 20 | \\sf << 19 | \\mx << 17 | \\v << 15 | \\cv << 13 | \\lm << 10 | \\op
|
|
356
356
|
.endm
|
|
357
357
|
|
|
358
358
|
/* RTPS 15 0x4A180001 Perspective transform */
|
|
@@ -375,9 +375,9 @@ def write_gte_macros():
|
|
|
375
375
|
cop2op 0x07, 0x10
|
|
376
376
|
.endm
|
|
377
377
|
|
|
378
|
-
/* DPCT 17
|
|
378
|
+
/* DPCT 17 0x4AF8002A Depth cue color RGB0,RGB1,RGB2 */
|
|
379
379
|
.macro dpct
|
|
380
|
-
cop2op
|
|
380
|
+
cop2op 0x0F, 0x2A
|
|
381
381
|
.endm
|
|
382
382
|
|
|
383
383
|
/* INTPL 8 0x4A980011 Interpolation of vector and far color */
|
|
@@ -442,6 +442,7 @@ def write_gte_macros():
|
|
|
442
442
|
|
|
443
443
|
|
|
444
444
|
## Instructions which take an argument
|
|
445
|
+
# gbg: arg is 5 bit wide
|
|
445
446
|
# sf : arg is 1 bit wide
|
|
446
447
|
# mx : arg is 2 bit wide
|
|
447
448
|
# v : arg is 2 bit wide
|
splat/util/n64/rominfo.py
CHANGED
|
@@ -437,7 +437,7 @@ def get_info_bytes(rom_bytes: bytes, header_encoding: str) -> N64Rom:
|
|
|
437
437
|
|
|
438
438
|
try:
|
|
439
439
|
name = rom_bytes[0x20:0x34].decode(header_encoding).rstrip(" \0") or "empty"
|
|
440
|
-
except:
|
|
440
|
+
except UnicodeError:
|
|
441
441
|
sys.exit(
|
|
442
442
|
"splat could not decode the game name;"
|
|
443
443
|
" try using a different encoding by passing the --header-encoding argument"
|
splat/util/psx/psxexeinfo.py
CHANGED
|
@@ -12,7 +12,6 @@ import dataclasses
|
|
|
12
12
|
from pathlib import Path
|
|
13
13
|
|
|
14
14
|
import rabbitizer
|
|
15
|
-
import spimdisasm
|
|
16
15
|
|
|
17
16
|
# PSX EXE has the following layout
|
|
18
17
|
# header ; 0x80 bytes
|
|
@@ -215,11 +214,11 @@ def main():
|
|
|
215
214
|
|
|
216
215
|
print(f"Entrypoint: 0x{exe.entrypoint:08X}")
|
|
217
216
|
|
|
218
|
-
print(
|
|
217
|
+
print("Initial GP: ", end="")
|
|
219
218
|
if exe.initial_gp != 0:
|
|
220
219
|
print(f"0x{exe.initial_gp:08X}")
|
|
221
220
|
else:
|
|
222
|
-
print(
|
|
221
|
+
print("No")
|
|
223
222
|
|
|
224
223
|
print()
|
|
225
224
|
print(f"Destination VRAM: 0x{exe.destination_vram:08X}")
|
splat/util/relocs.py
CHANGED
|
@@ -94,13 +94,13 @@ def initialize():
|
|
|
94
94
|
|
|
95
95
|
if rom_addr is None:
|
|
96
96
|
log.parsing_error_preamble(path, line_num, line)
|
|
97
|
-
log.error(
|
|
97
|
+
log.error("Missing required 'rom' attribute for reloc")
|
|
98
98
|
if reloc_type is None:
|
|
99
99
|
log.parsing_error_preamble(path, line_num, line)
|
|
100
|
-
log.error(
|
|
100
|
+
log.error("Missing required 'reloc' attribute for reloc")
|
|
101
101
|
if symbol_name is None:
|
|
102
102
|
log.parsing_error_preamble(path, line_num, line)
|
|
103
|
-
log.error(
|
|
103
|
+
log.error("Missing required 'symbol' attribute for reloc")
|
|
104
104
|
|
|
105
105
|
reloc = Reloc(rom_addr, reloc_type, symbol_name)
|
|
106
106
|
if addend is not None:
|
splat/util/symbols.py
CHANGED
|
@@ -226,7 +226,9 @@ def handle_sym_addrs(
|
|
|
226
226
|
tf_val = (
|
|
227
227
|
True
|
|
228
228
|
if is_truey(attr_val)
|
|
229
|
-
else False
|
|
229
|
+
else False
|
|
230
|
+
if is_falsey(attr_val)
|
|
231
|
+
else None
|
|
230
232
|
)
|
|
231
233
|
if tf_val is None:
|
|
232
234
|
log.parsing_error_preamble(path, line_num, line)
|
|
@@ -432,9 +434,9 @@ def initialize_spim_context(all_segments: "List[Segment]") -> None:
|
|
|
432
434
|
overlaps_found = False
|
|
433
435
|
# Check the vram range of the global segment does not overlap with any overlay segment
|
|
434
436
|
for ovl_segment in overlay_segments:
|
|
435
|
-
assert (
|
|
436
|
-
ovl_segment.vramStart
|
|
437
|
-
)
|
|
437
|
+
assert ovl_segment.vramStart <= ovl_segment.vramEnd, (
|
|
438
|
+
f"{ovl_segment.vramStart:08X} {ovl_segment.vramEnd:08X}"
|
|
439
|
+
)
|
|
438
440
|
if (
|
|
439
441
|
ovl_segment.vramEnd > global_vram_start
|
|
440
442
|
and global_vram_end > ovl_segment.vramStart
|
|
@@ -446,20 +448,20 @@ def initialize_spim_context(all_segments: "List[Segment]") -> None:
|
|
|
446
448
|
overlaps_found = True
|
|
447
449
|
if overlaps_found:
|
|
448
450
|
log.write(
|
|
449
|
-
|
|
451
|
+
"Many overlaps between non-global and global segments were found.",
|
|
450
452
|
)
|
|
451
453
|
log.write(
|
|
452
|
-
|
|
454
|
+
"This is usually caused by missing `exclusive_ram_id` tags on segments that have a higher vram address than other `exclusive_ram_id`-tagged segments"
|
|
453
455
|
)
|
|
454
456
|
if len(global_segments_after_overlays) > 0:
|
|
455
457
|
log.write(
|
|
456
|
-
|
|
458
|
+
"These segments are the main suspects for missing a `exclusive_ram_id` tag:",
|
|
457
459
|
status="warn",
|
|
458
460
|
)
|
|
459
461
|
for seg in global_segments_after_overlays:
|
|
460
462
|
log.write(f" '{seg.name}', rom: 0x{seg.rom_start:06X}")
|
|
461
463
|
else:
|
|
462
|
-
log.write(
|
|
464
|
+
log.write("No suspected segments??", status="warn")
|
|
463
465
|
log.error("Stopping due to the above errors")
|
|
464
466
|
|
|
465
467
|
# pass the global symbols to spimdisasm
|
splat/util/utils.py
CHANGED
|
@@ -3,7 +3,7 @@ from typing import List, Optional, TypeVar
|
|
|
3
3
|
T = TypeVar("T")
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def list_index(
|
|
7
|
-
if value not in
|
|
6
|
+
def list_index(the_list: List[T], value: T) -> Optional[int]:
|
|
7
|
+
if value not in the_list:
|
|
8
8
|
return None
|
|
9
|
-
return
|
|
9
|
+
return the_list.index(value)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: splat64
|
|
3
|
-
Version: 0.36.
|
|
3
|
+
Version: 0.36.3
|
|
4
4
|
Summary: A binary splitting tool to assist with decompilation and modding projects
|
|
5
5
|
Project-URL: Repository, https://github.com/ethteck/splat
|
|
6
6
|
Project-URL: Issues, https://github.com/ethteck/splat/issues
|
|
@@ -36,13 +36,13 @@ Requires-Dist: pylibyaml
|
|
|
36
36
|
Requires-Dist: pyyaml
|
|
37
37
|
Requires-Dist: tqdm
|
|
38
38
|
Provides-Extra: dev
|
|
39
|
-
Requires-Dist: black; extra == 'dev'
|
|
40
39
|
Requires-Dist: crunch64<1.0.0,>=0.5.1; extra == 'dev'
|
|
41
40
|
Requires-Dist: mypy; extra == 'dev'
|
|
42
41
|
Requires-Dist: n64img>=0.3.3; extra == 'dev'
|
|
43
42
|
Requires-Dist: pygfxd; extra == 'dev'
|
|
44
43
|
Requires-Dist: rabbitizer<2.0.0,>=1.12.0; extra == 'dev'
|
|
45
|
-
Requires-Dist:
|
|
44
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
45
|
+
Requires-Dist: spimdisasm<2.0.0,>=1.38.0; extra == 'dev'
|
|
46
46
|
Requires-Dist: types-colorama; extra == 'dev'
|
|
47
47
|
Requires-Dist: types-pyyaml; extra == 'dev'
|
|
48
48
|
Provides-Extra: mips
|
|
@@ -50,7 +50,7 @@ Requires-Dist: crunch64<1.0.0,>=0.5.1; extra == 'mips'
|
|
|
50
50
|
Requires-Dist: n64img>=0.3.3; extra == 'mips'
|
|
51
51
|
Requires-Dist: pygfxd; extra == 'mips'
|
|
52
52
|
Requires-Dist: rabbitizer<2.0.0,>=1.12.0; extra == 'mips'
|
|
53
|
-
Requires-Dist: spimdisasm<2.0.0,>=1.
|
|
53
|
+
Requires-Dist: spimdisasm<2.0.0,>=1.38.0; extra == 'mips'
|
|
54
54
|
Description-Content-Type: text/markdown
|
|
55
55
|
|
|
56
56
|
# splat
|
|
@@ -76,7 +76,7 @@ The brackets corresponds to the optional dependencies to install while installin
|
|
|
76
76
|
If you use a `requirements.txt` file in your repository, then you can add this library with the following line:
|
|
77
77
|
|
|
78
78
|
```txt
|
|
79
|
-
splat64[mips]>=0.36.
|
|
79
|
+
splat64[mips]>=0.36.3,<1.0.0
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
### Optional dependencies
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
splat/__init__.py,sha256=
|
|
1
|
+
splat/__init__.py,sha256=Jd0jequ-9rFyGBhXTci1H5cne5ZAVFvapdlzAM-y-4o,291
|
|
2
2
|
splat/__main__.py,sha256=T333dHDgr-2HYYhtARnYMEjdECnYiNIKfcXDD99o22A,732
|
|
3
3
|
splat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
splat/disassembler/__init__.py,sha256=
|
|
4
|
+
splat/disassembler/__init__.py,sha256=LXuCElHxOvbb9xuSSeswT8W_v78chwtqjKq_9nxFVzQ,167
|
|
5
5
|
splat/disassembler/disassembler.py,sha256=2ynehZRz1P6UnaBk6DWRy4c3ynRnnWApMhf0K9j1FOI,434
|
|
6
6
|
splat/disassembler/disassembler_instance.py,sha256=09GW7QYoNolgE2wnO7ALngw_CxgF-mfyLiXBsyv22jA,916
|
|
7
7
|
splat/disassembler/disassembler_section.py,sha256=J9jtplQVDVeGBmyEOcMpC3Hv3DyecqaNjlYc7zqEqDI,7459
|
|
8
|
-
splat/disassembler/null_disassembler.py,sha256=
|
|
9
|
-
splat/disassembler/spimdisasm_disassembler.py,sha256
|
|
8
|
+
splat/disassembler/null_disassembler.py,sha256=g1LCsCJ5mBClyPW-Sf7t_nudKLoTk9q1m9dwdR0QrW4,291
|
|
9
|
+
splat/disassembler/spimdisasm_disassembler.py,sha256=-COKUTd2YmggXKYNLqYmrzJXWmdD_PrZoV-FF9LnoWs,5920
|
|
10
10
|
splat/platforms/__init__.py,sha256=qjqKi63k5N3DUdILNfuk6qpJJkVeAWpjAs36L97vvP4,100
|
|
11
11
|
splat/platforms/n64.py,sha256=kgWr6nesGC0X-qVydmu8tSq48NbqVf9mF6EyqvUuoUM,421
|
|
12
|
-
splat/platforms/ps2.py,sha256=
|
|
12
|
+
splat/platforms/ps2.py,sha256=7wefhMRNxTguyxofWyDGrLGD59K6oDwzJu3Btpez3q4,298
|
|
13
13
|
splat/platforms/psp.py,sha256=rCr_uf1SuHNaMUXjIC0GyoA_463OQZv0se2KMarWry0,125
|
|
14
14
|
splat/platforms/psx.py,sha256=YxQERdOBr4p3ab9Wk80FNhVYi-uvmh7p_jeykSFp23M,40
|
|
15
15
|
splat/scripts/__init__.py,sha256=OY0nHg6a7JB437Sb96qLbZ_7ByVsal1gStj35wJAI_Y,101
|
|
16
16
|
splat/scripts/capy.py,sha256=svbOfLO34-QN3xLiBy9vk2RGs_To8TWMWEKBw6yx2xQ,3674
|
|
17
|
-
splat/scripts/create_config.py,sha256=
|
|
18
|
-
splat/scripts/split.py,sha256=
|
|
17
|
+
splat/scripts/create_config.py,sha256=WU_4jZQZ1Y9uLITWARgsYMl1J1YaKuPaX-bsPhqDsa4,11785
|
|
18
|
+
splat/scripts/split.py,sha256=wWib2lDdedzjcNLH-Ay48gM2XGZ9JCUsrriamuHzkOU,21935
|
|
19
19
|
splat/segtypes/__init__.py,sha256=-upUw_4JGQtvyp6IfTMzOq_CK3xvVaT_0K0_EipHyOo,208
|
|
20
|
-
splat/segtypes/linker_entry.py,sha256=
|
|
21
|
-
splat/segtypes/segment.py,sha256
|
|
20
|
+
splat/segtypes/linker_entry.py,sha256=WHFdVFC_NW6_ub-LJbfwze-FZGCTRtjEZHz_bhIkX-M,25160
|
|
21
|
+
splat/segtypes/segment.py,sha256=wo4QCdDAmR1TZRgk0DgTZ0RJGuhdZGuJy20L_Fgz_Ss,30629
|
|
22
22
|
splat/segtypes/common/__init__.py,sha256=mnq0acScilSCCo6q2PvkDk0Or3V8qitA7I8QMVw8haI,631
|
|
23
|
-
splat/segtypes/common/asm.py,sha256=
|
|
23
|
+
splat/segtypes/common/asm.py,sha256=gpR4uZ57l4Q9G0XTOeO1JIk9P5d8xXBxRfkrPIN-M1A,644
|
|
24
24
|
splat/segtypes/common/asmtu.py,sha256=C52kKh-8YeDHu0EucEfQ-tQMtDgfKfwAJ6wwiW6nOBU,354
|
|
25
|
-
splat/segtypes/common/bin.py,sha256=
|
|
25
|
+
splat/segtypes/common/bin.py,sha256=qZeuvHNSrRuxdk-8V0xW0tcFhtzPk6doyf43E_t7D9Q,1250
|
|
26
26
|
splat/segtypes/common/bss.py,sha256=nktRbKrDivweyLdsUQkL5guSayqpwn7NK5j3gq3arKc,3084
|
|
27
|
-
splat/segtypes/common/c.py,sha256=
|
|
28
|
-
splat/segtypes/common/code.py,sha256=
|
|
29
|
-
splat/segtypes/common/codesubsegment.py,sha256=
|
|
27
|
+
splat/segtypes/common/c.py,sha256=nIcnBOraSxSLcg6kn2fwkV3WMS-Tx7zfzbi7YXMdr7A,20549
|
|
28
|
+
splat/segtypes/common/code.py,sha256=FfBuy6x8fQXoJYX2Ul80uOs-CzlVslUaveD-hBmvKXM,10693
|
|
29
|
+
splat/segtypes/common/codesubsegment.py,sha256=n6mtHMpwjxNoTSh3aMT5Y19xvriAaaBP_r8AhVW52uU,10648
|
|
30
30
|
splat/segtypes/common/cpp.py,sha256=p-duowCt4czrmaWgj1LuFw5LGfdyB_uaeLTKVmH80Cg,180
|
|
31
31
|
splat/segtypes/common/data.py,sha256=r9G_vYieNlRze-5wGOKFazvFjpuodfSLad6iCNsBOAU,5665
|
|
32
|
-
splat/segtypes/common/databin.py,sha256=
|
|
32
|
+
splat/segtypes/common/databin.py,sha256=nDI1ciAv0QLt2xDYjEtGJHSoONZzJZKyST-BuSKML2Q,1169
|
|
33
33
|
splat/segtypes/common/eh_frame.py,sha256=MzL373ej2E38leM47py3T5beLq2IolsYszLZM8PYS2Y,913
|
|
34
34
|
splat/segtypes/common/gcc_except_table.py,sha256=-ZrQL5dCcRu7EPFFPgL8lIJwWL5FsEeeQoSUVfTkyIg,2112
|
|
35
35
|
splat/segtypes/common/group.py,sha256=wSrNQXWJpRZl8-cHtdlFy08TQDI_n7QAsYhUsCRb7Bs,7125
|
|
@@ -39,18 +39,18 @@ splat/segtypes/common/lib.py,sha256=WaJH0DH0B8iJvhYQWYBjThbNeEXz3Yh7E8ZyONe5JtQ,
|
|
|
39
39
|
splat/segtypes/common/linker_offset.py,sha256=IaEXMXq62BS2g95I4lS0wax5Ehjfi3O3C-uSDUbMjvI,767
|
|
40
40
|
splat/segtypes/common/pad.py,sha256=-7SaRgXrmGeOINKVV9v1c3e9jn8aVQknD8EVaEPcPrw,758
|
|
41
41
|
splat/segtypes/common/rdata.py,sha256=ab2MFZVjlnD2p5nDVNroo3W9blaVJND2jN2PJPy6a_Y,142
|
|
42
|
-
splat/segtypes/common/rodata.py,sha256=
|
|
43
|
-
splat/segtypes/common/rodatabin.py,sha256=
|
|
42
|
+
splat/segtypes/common/rodata.py,sha256=Y8ugWuHDfdU6vQSXdfLF9YKdfvuaoVcRcyk3cFeo_iA,6191
|
|
43
|
+
splat/segtypes/common/rodatabin.py,sha256=RsvhGxY9iX1QHSyMfuWLaFrqdBvDEtL4j13-jPpvyvk,1174
|
|
44
44
|
splat/segtypes/common/sbss.py,sha256=blIEuVYie4qNEOYMmlSdltn5f4MvgJu3AV8vqVD8Nh4,131
|
|
45
45
|
splat/segtypes/common/sdata.py,sha256=dnLzNSNtSyclLZiNUmFTv0e0BWN8glxB1km1MSRq6xY,136
|
|
46
|
-
splat/segtypes/common/segment.py,sha256=
|
|
46
|
+
splat/segtypes/common/segment.py,sha256=gFPzEi0Jq0NGtL4xlblIlNZus7dHkxebLKkr6jhOkxs,81
|
|
47
47
|
splat/segtypes/common/textbin.py,sha256=PXEb1JQB2NEqVDLg5KW2vI0NLSqrROJvCOifxB0NUms,5994
|
|
48
48
|
splat/segtypes/n64/__init__.py,sha256=tf2yWlijeKmOp1OhEEL-aW88mU-mWQRC2lSjQ5Ww1eI,569
|
|
49
49
|
splat/segtypes/n64/ci.py,sha256=An7wIHcoZ89KiGCKpCRbM7IrmDNYBidXT-6kjKn2vH0,2400
|
|
50
50
|
splat/segtypes/n64/ci4.py,sha256=ZP8e12CpV8U7r8oLnb9uHc-MkmBbxjXBbJxROFvOjiM,184
|
|
51
51
|
splat/segtypes/n64/ci8.py,sha256=tS4USmp0LuJnP-UlgaOYoxvYxBKgE67wYCz-KeRLlFk,184
|
|
52
52
|
splat/segtypes/n64/decompressor.py,sha256=YuKo-PS_S2-Ow1Zw8QTO70NWlSYTY79JZN0kUQB7T0U,1779
|
|
53
|
-
splat/segtypes/n64/gfx.py,sha256=
|
|
53
|
+
splat/segtypes/n64/gfx.py,sha256=ACSIMpHRcbH9OBBN8IMe0FOuPIPWx5GiVUARSxn3xyg,8365
|
|
54
54
|
splat/segtypes/n64/header.py,sha256=7Ubmvs49FTK1h4GX58XHOa922bbmjpOJCY3QXvd9078,2018
|
|
55
55
|
splat/segtypes/n64/i1.py,sha256=Mr7YRdKpvuTGu7P5QZPo6PF1XOcVy4W6_zthcRkLKps,204
|
|
56
56
|
splat/segtypes/n64/i4.py,sha256=wPYCGNa4dQHKf8lbDijSD80_yOt9kQIgOQO6ZOB_pGA,204
|
|
@@ -76,27 +76,27 @@ splat/segtypes/psp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
|
76
76
|
splat/segtypes/psx/__init__.py,sha256=tn0oDYUPtF0PfC8I4G23nPvH_JAcuLGxOCvYN1SE3Dc,31
|
|
77
77
|
splat/segtypes/psx/header.py,sha256=2S8XG_6zfLGzmEA0XpFqs0-4nf52YD9Erk6SbMUlVzo,2639
|
|
78
78
|
splat/util/__init__.py,sha256=rsnoPNjNVbu9j_yxoubyq8Pf-clIbOHk2vQyuKSmxyI,513
|
|
79
|
-
splat/util/cache_handler.py,sha256=
|
|
79
|
+
splat/util/cache_handler.py,sha256=BrTWo8U4bj8TBcZfIRwiAYmogc3YUlBz9P-34Y0aIrg,1851
|
|
80
80
|
splat/util/color.py,sha256=FSmy0dAQJ9FzRBc99Yt4kBEyB62MC_YiVkqoWgPMsRU,371
|
|
81
81
|
splat/util/compiler.py,sha256=uXShMm49380ENecSFlsi75LWI45yakWkExZX8NT5pOU,1778
|
|
82
|
-
splat/util/conf.py,sha256=
|
|
83
|
-
splat/util/file_presets.py,sha256=
|
|
82
|
+
splat/util/conf.py,sha256=0Qcv5d5XAvdVzqF4i4L_lJuC5hI0PEufeob58YaN-xs,3230
|
|
83
|
+
splat/util/file_presets.py,sha256=whms6WHRwvVfg-PQTwao4QimvVHSxfUIUaz-qXdcEbM,18585
|
|
84
84
|
splat/util/log.py,sha256=aJA1rg8IirJu1wGzjNuATHvepYvD3k5CtEyMasyJWxI,1193
|
|
85
85
|
splat/util/options.py,sha256=bXFruGE-tcqsdM0nYNqf_IQIiqxFCxn7NWEo_igOZIc,31252
|
|
86
86
|
splat/util/palettes.py,sha256=d3KoZnwt-zunI9eNwb3txysXg4DY3xnF0O5aQRxM4so,2920
|
|
87
87
|
splat/util/progress_bar.py,sha256=41VehpIFK1cphENaXV_Aq6_3mFx25eQ8V7Z51SKFPeM,166
|
|
88
|
-
splat/util/relocs.py,sha256=
|
|
88
|
+
splat/util/relocs.py,sha256=j8fzM9u0ZQwZa1b1Dd26ho9GwIooBXt8mE0jAN7wqV0,4153
|
|
89
89
|
splat/util/statistics.py,sha256=8C88vLW8q4Xd4i1Crz8X24NLoraLyKd0lw3ebbeonSo,1906
|
|
90
|
-
splat/util/symbols.py,sha256=
|
|
91
|
-
splat/util/utils.py,sha256=
|
|
90
|
+
splat/util/symbols.py,sha256=xYPbLTSlPrxsDvRw3aOTbN0wRZG6Ob4ZXD35cqC7YkE,31322
|
|
91
|
+
splat/util/utils.py,sha256=kAC0DAjaGa0Kq2k86RfQtFkheV87XuyeOgZIVIk3CHE,208
|
|
92
92
|
splat/util/vram_classes.py,sha256=UH4rkugEwoec_-alJ4smNOcnU51G-V5OG7Pfsj47eaM,3491
|
|
93
93
|
splat/util/n64/__init__.py,sha256=hsBkPh6NUz-bW7HVspcNZ0mCxBhdfcPC07_7gbga95o,84
|
|
94
94
|
splat/util/n64/find_code_length.py,sha256=uUoPoUORAjsAvH8oGqwnGvw6j8I_NnSrZtA-x9h9h7E,1414
|
|
95
|
-
splat/util/n64/rominfo.py,sha256=
|
|
95
|
+
splat/util/n64/rominfo.py,sha256=Ms9P-MuuOSyEF4QNB3wBuC-U9OdrfByqR0VPAHqTBQI,16976
|
|
96
96
|
splat/util/psx/__init__.py,sha256=kCCaR-KB1mNlIcXB4OuuSQ2zVLbWg_SnIZIUeyjeBBI,39
|
|
97
|
-
splat/util/psx/psxexeinfo.py,sha256=
|
|
98
|
-
splat64-0.36.
|
|
99
|
-
splat64-0.36.
|
|
100
|
-
splat64-0.36.
|
|
101
|
-
splat64-0.36.
|
|
102
|
-
splat64-0.36.
|
|
97
|
+
splat/util/psx/psxexeinfo.py,sha256=Oxd5Lt8HTNHuUzw3cVujdyJRqEG-yo0XT78wEISUXms,5705
|
|
98
|
+
splat64-0.36.3.dist-info/METADATA,sha256=Ugzp2ibo0F22MBBZwQKte5jm-Kv6-9sJFda1lTcugUw,3829
|
|
99
|
+
splat64-0.36.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
100
|
+
splat64-0.36.3.dist-info/entry_points.txt,sha256=O7Xy-qNOHcI87-OQrWJ-OhRDws74SuwVb_4rtnp0eLo,52
|
|
101
|
+
splat64-0.36.3.dist-info/licenses/LICENSE,sha256=97VMVzjG8yQvsf8NG2M9IFSbh7R8cifJnc6QK1cZqj8,1070
|
|
102
|
+
splat64-0.36.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|