splat64 0.36.3__tar.gz → 0.37.0__tar.gz
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.
- {splat64-0.36.3 → splat64-0.37.0}/.github/workflows/unit_tests.yml +30 -8
- {splat64-0.36.3 → splat64-0.37.0}/.gitignore +1 -0
- {splat64-0.36.3 → splat64-0.37.0}/CHANGELOG.md +21 -0
- {splat64-0.36.3 → splat64-0.37.0}/PKG-INFO +11 -11
- {splat64-0.36.3 → splat64-0.37.0}/README.md +1 -1
- {splat64-0.36.3 → splat64-0.37.0}/create_config.py +1 -3
- {splat64-0.36.3 → splat64-0.37.0}/docs/Configuration.md +24 -0
- {splat64-0.36.3 → splat64-0.37.0}/docs/Home.md +1 -1
- splat64-0.37.0/docs/Quickstart-Elf.md +199 -0
- {splat64-0.36.3 → splat64-0.37.0}/docs/Quickstart.md +3 -2
- {splat64-0.36.3 → splat64-0.37.0}/pyproject.toml +8 -8
- {splat64-0.36.3 → splat64-0.37.0}/requirements.txt +7 -7
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/__init__.py +1 -1
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/disassembler/spimdisasm_disassembler.py +3 -1
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/scripts/create_config.py +206 -4
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/scripts/split.py +1 -1
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/bss.py +1 -1
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/c.py +17 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/codesubsegment.py +3 -3
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/data.py +2 -2
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/rodata.py +2 -2
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/ci.py +2 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/img.py +4 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/palette.py +21 -2
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/segment.py +1 -2
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/__init__.py +1 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/compiler.py +2 -1
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/file_presets.py +22 -7
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/options.py +13 -0
- splat64-0.37.0/src/splat/util/ps2/__init__.py +1 -0
- splat64-0.37.0/src/splat/util/ps2/ps2elfinfo.py +249 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/symbols.py +7 -2
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/include/include_asm.h +6 -1
- {splat64-0.36.3 → splat64-0.37.0}/test.py +28 -15
- {splat64-0.36.3 → splat64-0.37.0}/.gitattributes +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/.github/workflows/format.yml +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/.github/workflows/lint.yml +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/.github/workflows/publish_docs_to_wiki.yml +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/.github/workflows/pypi.yml +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/.github/workflows/test_lib.yml +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/LICENSE +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/docs/Adding-Symbols.md +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/docs/Advanced-Reloc.md +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/docs/Advanced.md +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/docs/Examples.md +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/docs/General-Workflow.md +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/docs/Segments.md +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/docs/VramClasses.md +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/mypy.ini +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/split.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/__main__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/disassembler/__init__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/disassembler/disassembler.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/disassembler/disassembler_instance.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/disassembler/disassembler_section.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/disassembler/null_disassembler.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/platforms/__init__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/platforms/n64.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/platforms/ps2.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/platforms/psp.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/platforms/psx.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/py.typed +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/scripts/__init__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/scripts/capy.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/__init__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/__init__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/asm.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/asmtu.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/bin.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/code.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/cpp.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/databin.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/eh_frame.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/gcc_except_table.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/group.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/hasm.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/header.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/lib.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/linker_offset.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/pad.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/rdata.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/rodatabin.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/sbss.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/sdata.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/segment.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/common/textbin.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/linker_entry.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/__init__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/ci4.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/ci8.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/decompressor.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/gfx.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/header.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/i1.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/i4.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/i8.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/ia16.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/ia4.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/ia8.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/ipl3.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/mio0.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/rgba16.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/rgba32.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/rsp.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/vtx.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/n64/yay0.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/ps2/__init__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/ps2/ctor.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/ps2/lit4.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/ps2/lit8.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/ps2/vtables.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/psp/__init__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/psx/__init__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/segtypes/psx/header.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/cache_handler.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/color.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/conf.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/log.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/n64/__init__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/n64/find_code_length.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/n64/rominfo.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/palettes.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/progress_bar.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/psx/__init__.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/psx/psxexeinfo.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/relocs.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/statistics.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/utils.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/src/splat/util/vram_classes.py +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/Dockerfile +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/README.md +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/.gitignore +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/Makefile +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/build/basic_app.bin +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/dummy_ipl3.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/.splache +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/asm/data/main.bss.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/asm/data/main.data.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/asm/data/main.rodata.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/asm/handwritten.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/asm/header.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/asm/main.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/asm/nonmatchings/main/D_80000510.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/asm/nonmatchings/main/func_80000400.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/asm/nonmatchings/main/func_800004A0.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/assets/dummy_ipl3.bin +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/basic_app.d +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/build/test/basic_app/split/src/main.asmproc.d +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/include/labels.inc +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/include/macro.inc +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/src/main.c +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/undefined_funcs_auto.txt +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/expected/undefined_syms_auto.txt +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/handwritten.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/header.s +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/basic_app/main.c +0 -0
- {splat64-0.36.3 → splat64-0.37.0}/test/test_gen_expected.sh +0 -0
|
@@ -6,7 +6,7 @@ on:
|
|
|
6
6
|
|
|
7
7
|
jobs:
|
|
8
8
|
unit_tests:
|
|
9
|
-
name: unit_tests on ${{ matrix.os.name }}
|
|
9
|
+
name: unit_tests on '${{ matrix.os.name }}', Python ${{ matrix.py_version }}
|
|
10
10
|
runs-on: ${{ matrix.os.runner }}
|
|
11
11
|
strategy:
|
|
12
12
|
fail-fast: false
|
|
@@ -15,19 +15,27 @@ jobs:
|
|
|
15
15
|
{
|
|
16
16
|
name: linux,
|
|
17
17
|
runner: ubuntu-latest,
|
|
18
|
-
|
|
18
|
+
python_venv_activate: source .venv/bin/activate,
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
name: macos,
|
|
22
22
|
runner: macos-latest,
|
|
23
|
-
|
|
23
|
+
python_venv_activate: source .venv/bin/activate,
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
name: windows,
|
|
27
27
|
runner: windows-latest,
|
|
28
|
-
|
|
28
|
+
python_venv_activate: .venv/Scripts/Activate.ps1,
|
|
29
29
|
},
|
|
30
30
|
]
|
|
31
|
+
py_version:
|
|
32
|
+
- '3.9'
|
|
33
|
+
- '3.10'
|
|
34
|
+
- '3.11'
|
|
35
|
+
- '3.12'
|
|
36
|
+
- '3.13'
|
|
37
|
+
- '3.14'
|
|
38
|
+
- '3.x' # Explicit latest
|
|
31
39
|
|
|
32
40
|
steps:
|
|
33
41
|
- name: Checkout
|
|
@@ -35,16 +43,29 @@ jobs:
|
|
|
35
43
|
|
|
36
44
|
- name: Install dependencies
|
|
37
45
|
if: matrix.os.name == 'linux'
|
|
38
|
-
run: sudo apt-get install -y build-essential make binutils-mips-linux-gnu
|
|
46
|
+
run: sudo apt-get install -y build-essential make binutils-mips-linux-gnu wget
|
|
47
|
+
|
|
48
|
+
- name: Print Python version
|
|
49
|
+
run: |
|
|
50
|
+
python3 --version
|
|
51
|
+
|
|
52
|
+
- name: Set up Python ${{ matrix.py_version }}
|
|
53
|
+
uses: actions/setup-python@v6
|
|
54
|
+
with:
|
|
55
|
+
python-version: ${{ matrix.py_version }}
|
|
39
56
|
|
|
40
57
|
- name: Setup Python venv
|
|
41
58
|
run: |
|
|
59
|
+
python3 --version
|
|
42
60
|
python3 -m venv .venv
|
|
61
|
+
${{ matrix.os.python_venv_activate }}
|
|
62
|
+
python3 --version
|
|
43
63
|
|
|
44
64
|
- name: Install Python dependencies
|
|
45
65
|
run: |
|
|
46
|
-
${{ matrix.os.
|
|
47
|
-
|
|
66
|
+
${{ matrix.os.python_venv_activate }}
|
|
67
|
+
python3 -m pip install -U -r requirements.txt
|
|
68
|
+
python3 -m pip install -e .
|
|
48
69
|
|
|
49
70
|
- name: Build `basic_app` on ${{ matrix.os.name }}
|
|
50
71
|
if: matrix.os.name == 'linux'
|
|
@@ -57,4 +78,5 @@ jobs:
|
|
|
57
78
|
|
|
58
79
|
- name: Run the test
|
|
59
80
|
run: |
|
|
60
|
-
${{ matrix.os.
|
|
81
|
+
${{ matrix.os.python_venv_activate }}
|
|
82
|
+
python3 test.py
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# splat Release Notes
|
|
2
2
|
|
|
3
|
+
### 0.37.0
|
|
4
|
+
|
|
5
|
+
* Add define check to allow using `macro.inc` instead of `labels.inc` in `include_asm.h`.
|
|
6
|
+
* The macro must be `INCLUDE_ASM_USE_MACRO_INC` and have a non zero value.
|
|
7
|
+
* New option: `generated_asm_macros_directory`
|
|
8
|
+
* Allow changing the directory for the generated assembly macros files.
|
|
9
|
+
* Add workaround for the short loop bug that happens in SN PS2 compilers.
|
|
10
|
+
* This workaround is only used when the selected compiler is `EEGCC`.
|
|
11
|
+
* This can be manually overriden with the option `align_on_branch_labels`.
|
|
12
|
+
* Emit an `.align` directive in branch labels to avoid triggering the bug.
|
|
13
|
+
* The bug in question adds a non-zero number of nops as a workaround for a hardware defect, producing non-matching builds.
|
|
14
|
+
|
|
15
|
+
### 0.36.4
|
|
16
|
+
|
|
17
|
+
* Fix missing dollar signs (`$`) on specific ps2 registers on the extra assembly files generated by `make_full_disasm_for_code`.
|
|
18
|
+
* Pin versions of dependencies to avoid breaking because they broke.
|
|
19
|
+
* Add more checks for texture and palette segments to have a correct size in their yaml entries, ensuring their `width`/`height` or `size` attributes match the sizes relative to other segments.
|
|
20
|
+
* Fix `gfx` segments sometimes not picking up properly the corresponding typed reference.
|
|
21
|
+
* Fix sometimes picking a name symbol from a different segment instead of the owned segment when both symbols have the same address but are from completely different segments.
|
|
22
|
+
* Add PS2 compatibility to `create_config`.
|
|
23
|
+
|
|
3
24
|
### 0.36.3
|
|
4
25
|
|
|
5
26
|
* Fix not generating nonmatching `.s` files for quoted symbols.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: splat64
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.37.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
|
|
@@ -30,27 +30,27 @@ License-File: LICENSE
|
|
|
30
30
|
Classifier: License :: OSI Approved :: MIT License
|
|
31
31
|
Classifier: Programming Language :: Python :: 3
|
|
32
32
|
Requires-Python: >=3.9
|
|
33
|
-
Requires-Dist: colorama
|
|
34
|
-
Requires-Dist: intervaltree
|
|
35
|
-
Requires-Dist: pylibyaml
|
|
36
|
-
Requires-Dist: pyyaml
|
|
37
|
-
Requires-Dist: tqdm
|
|
33
|
+
Requires-Dist: colorama==0.4.6
|
|
34
|
+
Requires-Dist: intervaltree==3.1.0
|
|
35
|
+
Requires-Dist: pylibyaml==0.1.0
|
|
36
|
+
Requires-Dist: pyyaml==6.0.3
|
|
37
|
+
Requires-Dist: tqdm==4.67.1
|
|
38
38
|
Provides-Extra: dev
|
|
39
39
|
Requires-Dist: crunch64<1.0.0,>=0.5.1; extra == 'dev'
|
|
40
40
|
Requires-Dist: mypy; extra == 'dev'
|
|
41
41
|
Requires-Dist: n64img>=0.3.3; extra == 'dev'
|
|
42
|
-
Requires-Dist: pygfxd; extra == 'dev'
|
|
42
|
+
Requires-Dist: pygfxd>=1.0.5; extra == 'dev'
|
|
43
43
|
Requires-Dist: rabbitizer<2.0.0,>=1.12.0; extra == 'dev'
|
|
44
44
|
Requires-Dist: ruff; extra == 'dev'
|
|
45
|
-
Requires-Dist: spimdisasm<2.0.0,>=1.
|
|
45
|
+
Requires-Dist: spimdisasm<2.0.0,>=1.39.0; extra == 'dev'
|
|
46
46
|
Requires-Dist: types-colorama; extra == 'dev'
|
|
47
47
|
Requires-Dist: types-pyyaml; extra == 'dev'
|
|
48
48
|
Provides-Extra: mips
|
|
49
49
|
Requires-Dist: crunch64<1.0.0,>=0.5.1; extra == 'mips'
|
|
50
50
|
Requires-Dist: n64img>=0.3.3; extra == 'mips'
|
|
51
|
-
Requires-Dist: pygfxd; extra == 'mips'
|
|
51
|
+
Requires-Dist: pygfxd>=1.0.5; 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.39.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.
|
|
79
|
+
splat64[mips]>=0.37.0,<1.0.0
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
### Optional dependencies
|
|
@@ -21,7 +21,7 @@ The brackets corresponds to the optional dependencies to install while installin
|
|
|
21
21
|
If you use a `requirements.txt` file in your repository, then you can add this library with the following line:
|
|
22
22
|
|
|
23
23
|
```txt
|
|
24
|
-
splat64[mips]>=0.
|
|
24
|
+
splat64[mips]>=0.37.0,<1.0.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
### Optional dependencies
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
#! /usr/bin/env python3
|
|
2
2
|
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
|
|
5
3
|
import src.splat as splat
|
|
6
4
|
|
|
7
5
|
if __name__ == "__main__":
|
|
8
6
|
args = splat.scripts.create_config.parser.parse_args()
|
|
9
|
-
splat.scripts.create_config.
|
|
7
|
+
splat.scripts.create_config.process_arguments(args)
|
|
@@ -147,6 +147,12 @@ Allows configuring the style used by the generated `INCLUDE_ASM` macro. It curre
|
|
|
147
147
|
|
|
148
148
|
Defaults to `default`.
|
|
149
149
|
|
|
150
|
+
### generated_asm_macros_directory
|
|
151
|
+
|
|
152
|
+
Change the directory where the assembly macros files are written to.
|
|
153
|
+
|
|
154
|
+
Defaults to `include`.
|
|
155
|
+
|
|
150
156
|
### o_as_suffix
|
|
151
157
|
|
|
152
158
|
Used to determine the file extension of the built files that will be listed on the linker script.
|
|
@@ -932,3 +938,21 @@ use_legacy_include_asm: True
|
|
|
932
938
|
|
|
933
939
|
#### Default
|
|
934
940
|
`False`
|
|
941
|
+
|
|
942
|
+
## align_on_branch_labels
|
|
943
|
+
|
|
944
|
+
If enabled emit no-op alignment directives on all branch labels.
|
|
945
|
+
|
|
946
|
+
This is useful as a workaround for the "short loop bug" present in SN PS2 compilers, in which the compiler may decide to insert extra `nop` instructions due to a hardware defect, producing non-matching builds.
|
|
947
|
+
|
|
948
|
+
This option is enabled automatically if the selected compiler is known to have this issue, but this option allows to override the default selection in case this setting ends up producing problems.
|
|
949
|
+
|
|
950
|
+
#### Usage
|
|
951
|
+
|
|
952
|
+
```yaml
|
|
953
|
+
align_on_branch_labels: False
|
|
954
|
+
```
|
|
955
|
+
|
|
956
|
+
#### Default
|
|
957
|
+
|
|
958
|
+
`True` if [`compiler`](#compiler) is set to `EEGCC`, `False` otherwise
|
|
@@ -22,4 +22,4 @@ After scanning and splitting, **splat** will output a linker script that can be
|
|
|
22
22
|
|
|
23
23
|
### Sounds great, how do I get started?
|
|
24
24
|
|
|
25
|
-
Have a look at the [Quickstart](https://github.com/ethteck/splat/wiki/Quickstart), or check out the [Examples](https://github.com/ethteck/splat/wiki/Examples) page to see projects that are using **splat**.
|
|
25
|
+
Have a look at the [Quickstart](https://github.com/ethteck/splat/wiki/Quickstart), [Quickstart for PS2 ELFs](https://github.com/ethteck/splat/wiki/Quickstart-Elf), or check out the [Examples](https://github.com/ethteck/splat/wiki/Examples) page to see projects that are using **splat**.
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Quickstart Elf
|
|
2
|
+
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This quickstart is written with PS2 ELFs in mind, relocatable ELFs are not supported. It is also assumed that you are using Ubuntu 22.04 either natively, via WSL2 or via Docker.
|
|
5
|
+
|
|
6
|
+
For the purposes of this quickstart, we will assume that we are going to split a game called `mygame` and we have the ELF from the iso named `SLUS_XXX.YY`.
|
|
7
|
+
|
|
8
|
+
Create a directory for `~/mygame` and `cd` into it:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
mkdir -p ${HOME}/mygame && cd ${HOME}/mygame
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Copy the `SLUS_XXX.YY` file into the `mygame` directory inside your home directory.
|
|
15
|
+
|
|
16
|
+
## System packages
|
|
17
|
+
|
|
18
|
+
### Python 3.9
|
|
19
|
+
|
|
20
|
+
Ensure you are have **Python 3.9** or higher installed:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
$ python3 --version
|
|
24
|
+
Python 3.9.10
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If you get `bash: python3: command not found` install it with the following command:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
sudo apt update && sudo apt install -y python3 python3-pip
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### MIPS binutils
|
|
34
|
+
|
|
35
|
+
Ensure you have a MIPS binutils installed in your PC. Specifically we'll need a MIPS `objcopy`.
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
$ mips-linux-gnu-objcopy --version
|
|
39
|
+
GNU objcopy (GNU Binutils for Ubuntu) 2.38
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If you get an error then install it with the following command:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
sudo apt install binutils-mips-linux-gnu
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Install splat
|
|
49
|
+
|
|
50
|
+
We'll install `splat` using `pip` and enable its `mips` dependencies:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
python3 -m pip install -U splat64[mips]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Create a config file from your ELF
|
|
57
|
+
|
|
58
|
+
`splat` has a script that will generate a `yaml` file based in the ELF file.
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
python3 -m splat create_config SLUS_XXX.YY
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This command generates a few files, from which the most important ones are the `SLUS_XXX.YY.rom` and the `SLUS_XXX.YY.yaml`.
|
|
65
|
+
|
|
66
|
+
### The generated ROM
|
|
67
|
+
|
|
68
|
+
The original ELF file contains the game code and a lot of extra metadata which we don't care about.
|
|
69
|
+
|
|
70
|
+
To get rid of the extra metadata the `create_config` script generated a ROM that only contains the game code and data, and the generated `yaml` is used to split this ROM instead of splitting the original ELF, making the splitting and build process a lot more cleaner.
|
|
71
|
+
|
|
72
|
+
To generate this ROM the `create_config` script uses `objcopy`. You can (and should) integrate this ROM generation step into your setup script / configure script. `create_config` tells you exactly what command it used to generate the ROM, which should look similar to the following:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
mips-linux-gnu-objcopy -O binary --gap-fill=0x00 SLUS_XXX.YY SLUS_XXX.YY.rom
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This approach has a few pros and cons. The biggest pro is being able to generate an ELF with proper metadata as part of your build system, making a lot easier to achieve shiftability eventually. Note only this is not enough for shiftability, other factors must be worked out, like symbol alignment, fake symbols, etc.
|
|
79
|
+
|
|
80
|
+
### The generated `yaml`
|
|
81
|
+
|
|
82
|
+
`create_config` generates a `yaml` file which describes how the ROM is structured, what parts are code, data, etc. It also includes configuration values for splat.
|
|
83
|
+
|
|
84
|
+
Below is an example of what a generated yaml may look like:
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
# name: Your game name here!
|
|
88
|
+
sha1: 6da2d0a02aafe3bfba71ca8ba859174756ba3f5e
|
|
89
|
+
options:
|
|
90
|
+
basename: SLUS_206.24
|
|
91
|
+
target_path: SLUS_206.24.rom
|
|
92
|
+
elf_path: build/SLUS_206.24.elf
|
|
93
|
+
base_path: .
|
|
94
|
+
platform: ps2
|
|
95
|
+
compiler: EEGCC
|
|
96
|
+
|
|
97
|
+
gp_value: 0x003A0EF0
|
|
98
|
+
ld_gp_expression: cod_SBSS_START + 0x7FF0
|
|
99
|
+
|
|
100
|
+
# asm_path: asm
|
|
101
|
+
# src_path: src
|
|
102
|
+
# build_path: build
|
|
103
|
+
|
|
104
|
+
ld_script_path: SLUS_206.24.ld
|
|
105
|
+
ld_dependencies: True
|
|
106
|
+
ld_wildcard_sections: True
|
|
107
|
+
ld_bss_contains_common: True
|
|
108
|
+
|
|
109
|
+
create_asm_dependencies: True
|
|
110
|
+
|
|
111
|
+
find_file_boundaries: False
|
|
112
|
+
|
|
113
|
+
o_as_suffix: True
|
|
114
|
+
|
|
115
|
+
symbol_addrs_path:
|
|
116
|
+
- symbol_addrs.txt
|
|
117
|
+
reloc_addrs_path:
|
|
118
|
+
- reloc_addrs.txt
|
|
119
|
+
|
|
120
|
+
# undefined_funcs_auto_path: undefined_funcs_auto.txt
|
|
121
|
+
# undefined_syms_auto_path: undefined_syms_auto.txt
|
|
122
|
+
|
|
123
|
+
extensions_path: tools/splat_ext
|
|
124
|
+
|
|
125
|
+
string_encoding: ASCII
|
|
126
|
+
data_string_encoding: ASCII
|
|
127
|
+
rodata_string_guesser_level: 2
|
|
128
|
+
data_string_guesser_level: 2
|
|
129
|
+
|
|
130
|
+
named_regs_for_c_funcs: False
|
|
131
|
+
|
|
132
|
+
section_order:
|
|
133
|
+
- .text
|
|
134
|
+
# - .vutext
|
|
135
|
+
- .data
|
|
136
|
+
- .rodata
|
|
137
|
+
- .gcc_except_table
|
|
138
|
+
- .sbss
|
|
139
|
+
- .bss
|
|
140
|
+
|
|
141
|
+
auto_link_sections:
|
|
142
|
+
- .data
|
|
143
|
+
- .rodata
|
|
144
|
+
- .gcc_except_table
|
|
145
|
+
- .sbss
|
|
146
|
+
- .bss
|
|
147
|
+
|
|
148
|
+
segments:
|
|
149
|
+
- name: cod
|
|
150
|
+
type: code
|
|
151
|
+
start: 0x000000
|
|
152
|
+
vram: 0x00100000
|
|
153
|
+
bss_size: 0x6907C
|
|
154
|
+
subalign: null
|
|
155
|
+
subsegments:
|
|
156
|
+
- [0x000000, asm, cod/000000] # .text
|
|
157
|
+
- [0x3209C0, textbin, cod/3209C0] # .vutext
|
|
158
|
+
- [0x324680, data, cod/324680] # .data
|
|
159
|
+
- [0x350100, rodata, cod/350100] # .rodata
|
|
160
|
+
- [0x3B0780, gcc_except_table, cod/3B0780] # .gcc_except_table
|
|
161
|
+
- { type: sbss, vram: 0x004B0880, name: cod/004B0880 } # .sbss
|
|
162
|
+
- { type: bss, vram: 0x004B0F80, name: cod/004B0F80 } # .bss
|
|
163
|
+
- [0x3B0864]
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
This is a bare-bones configuration and there is a lot of work required to map out the different sections of the ROM.
|
|
167
|
+
|
|
168
|
+
## Run splat with your configuration
|
|
169
|
+
|
|
170
|
+
```sh
|
|
171
|
+
python3 -m splat split SLUS_XXX.YY.yaml
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The output will look something like this:
|
|
175
|
+
|
|
176
|
+
```plain_text
|
|
177
|
+
splat 0.36.2 (powered by spimdisasm 1.38.0)
|
|
178
|
+
Loading symbols (symbol_addrs): 100%|█████████████████████████| 2/2 [00:00<00:00, 9868.95it/s]
|
|
179
|
+
Scanning cod: 0%| | 0/1 [00:00<?, ?it/s]
|
|
180
|
+
Rodata segment 'cod/350100' may belong to the text segment 'cod/000000'
|
|
181
|
+
Based on the usage from the function func_00102E48 to the symbol D_00450308
|
|
182
|
+
Scanning cod: 100%|█████████████████████████████████████████████| 1/1 [00:26<00:00, 26.62s/it]
|
|
183
|
+
Splitting cod: 100%|████████████████████████████████████████████| 1/1 [00:14<00:00, 14.77s/it]
|
|
184
|
+
Linker script cod: 100%|███████████████████████████████████████| 1/1 [00:00<00:00, 447.54it/s]
|
|
185
|
+
Split 3 MB (85.17%) in defined segments
|
|
186
|
+
asm: 3 MB (84.76%) 1 split, 0 cached
|
|
187
|
+
textbin: 15 KB (0.40%) 1 split, 0 cached
|
|
188
|
+
unknown: 0 B (0.00%) from unknown bin files
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
It's up to you to figure out the layout of the ROM, finding proper file splits.
|
|
192
|
+
|
|
193
|
+
## Next Steps
|
|
194
|
+
|
|
195
|
+
The reassembly of the ROM is currently out of scope of this quickstart, as is switching out the `asm` segments for `c` or `cpp`.
|
|
196
|
+
|
|
197
|
+
You can find a general workflow for using `splat` at [General Workflow](https://github.com/ethteck/splat/wiki/General-Workflow)
|
|
198
|
+
|
|
199
|
+
Please feel free to improve this guide!
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Quickstart
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This quickstart is written with N64 ROMs in mind, and the assumption that you are using Ubuntu 20.04 either natively, via WSL2 or via Docker.
|
|
4
5
|
|
|
5
6
|
For the purposes of this quickstart, we will assume that we are going to split a game called `mygame` and we have the ROM in `.z64` format named `baserom.z64`.
|
|
6
7
|
|
|
@@ -19,7 +20,7 @@ Copy the `baserom.z64` file into the `mygame` directory inside your home directo
|
|
|
19
20
|
Ensure you are have **Python 3.9** or higher installed:
|
|
20
21
|
|
|
21
22
|
```sh
|
|
22
|
-
python3 --version
|
|
23
|
+
$ python3 --version
|
|
23
24
|
Python 3.9.10
|
|
24
25
|
```
|
|
25
26
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "splat64"
|
|
3
3
|
# Should be synced with src/splat/__init__.py
|
|
4
|
-
version = "0.
|
|
4
|
+
version = "0.37.0"
|
|
5
5
|
description = "A binary splitting tool to assist with decompilation and modding projects"
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
license = {file = "LICENSE"}
|
|
@@ -11,18 +11,18 @@ classifiers = [
|
|
|
11
11
|
"License :: OSI Approved :: MIT License",
|
|
12
12
|
]
|
|
13
13
|
dependencies = [
|
|
14
|
-
"PyYAML",
|
|
15
|
-
"pylibyaml",
|
|
16
|
-
"tqdm",
|
|
17
|
-
"intervaltree",
|
|
18
|
-
"colorama",
|
|
14
|
+
"PyYAML==6.0.3",
|
|
15
|
+
"pylibyaml==0.1.0",
|
|
16
|
+
"tqdm==4.67.1",
|
|
17
|
+
"intervaltree==3.1.0",
|
|
18
|
+
"colorama==0.4.6",
|
|
19
19
|
]
|
|
20
20
|
|
|
21
21
|
[project.optional-dependencies]
|
|
22
22
|
mips = [
|
|
23
|
-
"spimdisasm>=1.
|
|
23
|
+
"spimdisasm>=1.39.0,<2.0.0", # This value should be keep in sync with the version listed on disassembler/spimdisasm_disassembler.py
|
|
24
24
|
"rabbitizer>=1.12.0,<2.0.0",
|
|
25
|
-
"pygfxd",
|
|
25
|
+
"pygfxd>=1.0.5",
|
|
26
26
|
"n64img>=0.3.3",
|
|
27
27
|
"crunch64>=0.5.1,<1.0.0",
|
|
28
28
|
]
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
PyYAML
|
|
2
|
-
pylibyaml
|
|
3
|
-
tqdm
|
|
4
|
-
intervaltree
|
|
5
|
-
colorama
|
|
1
|
+
PyYAML==6.0.3
|
|
2
|
+
pylibyaml==0.1.0
|
|
3
|
+
tqdm==4.67.1
|
|
4
|
+
intervaltree==3.1.0
|
|
5
|
+
colorama==0.4.6
|
|
6
6
|
# This value should be keep in sync with the version listed on disassembler/spimdisasm_disassembler.py and pyproject.toml
|
|
7
|
-
spimdisasm>=1.
|
|
7
|
+
spimdisasm>=1.39.0
|
|
8
8
|
rabbitizer>=1.10.0
|
|
9
|
-
pygfxd
|
|
9
|
+
pygfxd>=1.0.5
|
|
10
10
|
n64img>=0.1.4
|
|
11
11
|
crunch64>=0.2.0
|
|
@@ -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, 39, 0)
|
|
11
11
|
|
|
12
12
|
def configure(self):
|
|
13
13
|
# Configure spimdisasm
|
|
@@ -74,6 +74,8 @@ class SpimdisasmDisassembler(disassembler.Disassembler):
|
|
|
74
74
|
spimdisasm.common.GlobalConfig.SYMBOL_FINDER_FILTERED_ADDRESSES_AS_HILO = (
|
|
75
75
|
False
|
|
76
76
|
)
|
|
77
|
+
if options.opts.align_on_branch_labels:
|
|
78
|
+
spimdisasm.common.GlobalConfig.ASM_EMIT_ALIGN_BRANCH_LABELS = True
|
|
77
79
|
rabbitizer.config.toolchainTweaks_treatJAsUnconditionalBranch = (
|
|
78
80
|
selected_compiler.j_as_branch
|
|
79
81
|
)
|