splat64 0.33.2__py3-none-any.whl → 0.34.0__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 CHANGED
@@ -1,7 +1,7 @@
1
1
  __package_name__ = __name__
2
2
 
3
3
  # Should be synced with pyproject.toml
4
- __version__ = "0.33.2"
4
+ __version__ = "0.34.0"
5
5
  __author__ = "ethteck"
6
6
 
7
7
  from . import util as util
splat/scripts/split.py CHANGED
@@ -475,7 +475,8 @@ def main(
475
475
 
476
476
  cache = cache_handler.Cache(config, use_cache, verbose)
477
477
 
478
- initialize_platform(rom_bytes)
478
+ if not options.opts.is_unsupported_platform:
479
+ initialize_platform(rom_bytes)
479
480
 
480
481
  # Initialize segments
481
482
  all_segments = initialize_segments(config["segments"])
splat/segtypes/segment.py CHANGED
@@ -99,10 +99,21 @@ class Segment:
99
99
  if seg_type.startswith("."):
100
100
  seg_type = seg_type[1:]
101
101
 
102
- segment_class = Segment.get_base_segment_class(seg_type)
103
- if segment_class == None:
104
- # Look in extensions
102
+ if options.opts.allow_segment_overrides:
105
103
  segment_class = Segment.get_extension_segment_class(seg_type)
104
+ if segment_class == None:
105
+ segment_class = Segment.get_base_segment_class(seg_type)
106
+ else:
107
+ segment_class = Segment.get_base_segment_class(seg_type)
108
+ if segment_class == None:
109
+ # Look in extensions
110
+ segment_class = Segment.get_extension_segment_class(seg_type)
111
+
112
+ if segment_class == None:
113
+ log.error(
114
+ f"could not load segment type '{seg_type}'\n(hint: confirm your extension directory is configured correctly)"
115
+ )
116
+
106
117
  return segment_class
107
118
 
108
119
  @staticmethod
@@ -147,11 +158,8 @@ class Segment:
147
158
  ext_mod = importlib.util.module_from_spec(ext_spec)
148
159
  assert ext_spec.loader is not None
149
160
  ext_spec.loader.exec_module(ext_mod)
150
- except Exception as err:
151
- log.write(err, status="error")
152
- log.error(
153
- f"could not load segment type '{seg_type}'\n(hint: confirm your extension directory is configured correctly)"
154
- )
161
+ except Exception:
162
+ return None
155
163
 
156
164
  return getattr(
157
165
  ext_mod, f"{platform.upper()}Seg{seg_type[0].upper()}{seg_type[1:]}"
splat/util/options.py CHANGED
@@ -41,6 +41,10 @@ class SplatOpts:
41
41
  gp: Optional[int]
42
42
  # Checks and errors if there are any non consecutive segment types
43
43
  check_consecutive_segment_types: bool
44
+ # Disable checks on `platform` option.
45
+ is_unsupported_platform: bool
46
+ # Allows to take precedence over the splat builtin platform segments via splat extension.
47
+ allow_segment_overrides: bool
44
48
 
45
49
  # Paths
46
50
  asset_path: Path
@@ -355,7 +359,13 @@ def _parse_yaml(
355
359
  p = OptParser(yaml)
356
360
 
357
361
  basename = p.parse_opt("basename", str)
358
- platform = p.parse_opt_within("platform", str, ["n64", "psx", "ps2", "psp"])
362
+ is_unsupported_platform = p.parse_opt("is_unsupported_platform", bool, False)
363
+
364
+ if is_unsupported_platform:
365
+ platform = p.parse_opt("platform", str)
366
+ else:
367
+ platform = p.parse_opt_within("platform", str, ["n64", "psx", "ps2", "psp"])
368
+
359
369
  comp = compiler.for_name(p.parse_opt("compiler", str, "IDO"))
360
370
 
361
371
  base_path = Path(
@@ -399,6 +409,8 @@ def _parse_yaml(
399
409
  target_path=p.parse_path(base_path, "target_path"),
400
410
  elf_path=p.parse_optional_path(base_path, "elf_path"),
401
411
  platform=platform,
412
+ is_unsupported_platform=is_unsupported_platform,
413
+ allow_segment_overrides=p.parse_opt("allow_segment_overrides", bool, False),
402
414
  compiler=comp,
403
415
  endianness=parse_endianness(),
404
416
  section_order=p.parse_opt(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splat64
3
- Version: 0.33.2
3
+ Version: 0.34.0
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
@@ -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.33.2,<1.0.0
79
+ splat64[mips]>=0.34.0,<1.0.0
80
80
  ```
81
81
 
82
82
  ### Optional dependencies
@@ -1,4 +1,4 @@
1
- splat/__init__.py,sha256=RsNLR9JOXykmo-1waX9VcDxc1ayMcuHDl38qCnLmJ4E,291
1
+ splat/__init__.py,sha256=ZaaW0dJgw7eCldOFBG7ux4Eh9_CkLS6q2OY_tN1fG6I,291
2
2
  splat/__main__.py,sha256=T333dHDgr-2HYYhtARnYMEjdECnYiNIKfcXDD99o22A,732
3
3
  splat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  splat/disassembler/__init__.py,sha256=IubLMnm_F5cZ7WUPBfk1VJ7vdj6i1if5GG6RBvEoBEA,226
@@ -15,10 +15,10 @@ 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
17
  splat/scripts/create_config.py,sha256=nFwIt1UWzlWE9C3i-2dGsVyGX2cuXzIqkp2kur2-pdE,7670
18
- splat/scripts/split.py,sha256=EJLpvwGurQZEe-FE3hfNcMFIbxLToB4SX95OXdL_qoE,19285
18
+ splat/scripts/split.py,sha256=GEjoOD8LNb9oQp5uHys7r6GXwk7sxoQH_7NOqKM2FdE,19338
19
19
  splat/segtypes/__init__.py,sha256=-upUw_4JGQtvyp6IfTMzOq_CK3xvVaT_0K0_EipHyOo,208
20
20
  splat/segtypes/linker_entry.py,sha256=e2IzjAWC1B_JCx5pxBdKJrzOCse4SYUBrLHM8l3AR3o,24765
21
- splat/segtypes/segment.py,sha256=Y8OaNle09VeQ8pghzMQtxu8I2sWKy8fWPdfRH1zkUXU,28820
21
+ splat/segtypes/segment.py,sha256=pWpX_PqPCRo8ZFVhqoiYcopzuAyB8PnKa0euEGUV5qc,29094
22
22
  splat/segtypes/common/__init__.py,sha256=mnq0acScilSCCo6q2PvkDk0Or3V8qitA7I8QMVw8haI,631
23
23
  splat/segtypes/common/asm.py,sha256=k3p4vgbQJP40iyTgQkIci1j3CpKkWksqoWBx2Pb2oh8,703
24
24
  splat/segtypes/common/asmtu.py,sha256=C52kKh-8YeDHu0EucEfQ-tQMtDgfKfwAJ6wwiW6nOBU,354
@@ -81,7 +81,7 @@ splat/util/color.py,sha256=FSmy0dAQJ9FzRBc99Yt4kBEyB62MC_YiVkqoWgPMsRU,371
81
81
  splat/util/compiler.py,sha256=xDDNdnutmkB7T21j-BccBMdkA2leU3GzXuTYEWgVgNw,1530
82
82
  splat/util/conf.py,sha256=aM6O2QikosjL95pCxI2FcCxrwDsLP8T8sRf2Uev_Pac,3236
83
83
  splat/util/log.py,sha256=GguW9AolH-EXGBmh-8aZXgUeBFJthqAOb3qKtRYUSj8,999
84
- splat/util/options.py,sha256=JHyZnBuB86tbZN_HvhAvOH8oZGsppIc9KmgRVRkBWvg,28632
84
+ splat/util/options.py,sha256=iIwI3ZVbwWNIK4_0BIe3Iu9NxhEfIoXyjVGWgjPmG-Q,29157
85
85
  splat/util/palettes.py,sha256=d3KoZnwt-zunI9eNwb3txysXg4DY3xnF0O5aQRxM4so,2920
86
86
  splat/util/progress_bar.py,sha256=41VehpIFK1cphENaXV_Aq6_3mFx25eQ8V7Z51SKFPeM,166
87
87
  splat/util/relocs.py,sha256=cgQYSaAtNpLlUZQdhEfa7ZpI8i0HqoDhwB88QtFqdJs,4212
@@ -94,8 +94,8 @@ splat/util/n64/find_code_length.py,sha256=uUoPoUORAjsAvH8oGqwnGvw6j8I_NnSrZtA-x9
94
94
  splat/util/n64/rominfo.py,sha256=U6TieblUAmxhZsn7u8nbjOKkbC6ygsC_7IiLLaOWwUE,14646
95
95
  splat/util/psx/__init__.py,sha256=kCCaR-KB1mNlIcXB4OuuSQ2zVLbWg_SnIZIUeyjeBBI,39
96
96
  splat/util/psx/psxexeinfo.py,sha256=MrxY28nes0uzpFmCz0o9JFbF8s1eQRQNOpC_82wsMVI,5725
97
- splat64-0.33.2.dist-info/METADATA,sha256=CFJ6z02JMyJ-uNmy8mBoRrVFXUvxbPnmlmk653LBbd0,3830
98
- splat64-0.33.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
99
- splat64-0.33.2.dist-info/entry_points.txt,sha256=O7Xy-qNOHcI87-OQrWJ-OhRDws74SuwVb_4rtnp0eLo,52
100
- splat64-0.33.2.dist-info/licenses/LICENSE,sha256=97VMVzjG8yQvsf8NG2M9IFSbh7R8cifJnc6QK1cZqj8,1070
101
- splat64-0.33.2.dist-info/RECORD,,
97
+ splat64-0.34.0.dist-info/METADATA,sha256=ZlrQhRSpiF0y2xLSlKG32SXRxV7gZJ4K9uBylUb92Go,3830
98
+ splat64-0.34.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
99
+ splat64-0.34.0.dist-info/entry_points.txt,sha256=O7Xy-qNOHcI87-OQrWJ-OhRDws74SuwVb_4rtnp0eLo,52
100
+ splat64-0.34.0.dist-info/licenses/LICENSE,sha256=97VMVzjG8yQvsf8NG2M9IFSbh7R8cifJnc6QK1cZqj8,1070
101
+ splat64-0.34.0.dist-info/RECORD,,