splat64 0.37.2__tar.gz → 0.37.3__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.37.2 → splat64-0.37.3}/.github/workflows/lint.yml +4 -16
- {splat64-0.37.2 → splat64-0.37.3}/CHANGELOG.md +6 -0
- {splat64-0.37.2 → splat64-0.37.3}/PKG-INFO +2 -2
- {splat64-0.37.2 → splat64-0.37.3}/README.md +1 -1
- {splat64-0.37.2 → splat64-0.37.3}/pyproject.toml +1 -1
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/__init__.py +1 -1
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/scripts/create_config.py +26 -21
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/n64/rominfo.py +20 -3
- {splat64-0.37.2 → splat64-0.37.3}/test_n64_entrypoints.py +460 -61
- {splat64-0.37.2 → splat64-0.37.3}/.gitattributes +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/.github/workflows/format.yml +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/.github/workflows/publish_docs_to_wiki.yml +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/.github/workflows/pypi.yml +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/.github/workflows/test_lib.yml +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/.github/workflows/unit_tests.yml +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/.gitignore +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/LICENSE +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/create_config.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/docs/Adding-Symbols.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/docs/Advanced-Reloc.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/docs/Advanced.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/docs/Configuration.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/docs/Examples.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/docs/General-Workflow.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/docs/Home.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/docs/Quickstart-Elf.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/docs/Quickstart.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/docs/Segments.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/docs/VramClasses.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/mypy.ini +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/requirements.txt +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/split.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/__main__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/disassembler/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/disassembler/disassembler.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/disassembler/disassembler_instance.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/disassembler/disassembler_section.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/disassembler/null_disassembler.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/disassembler/spimdisasm_disassembler.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/platforms/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/platforms/n64.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/platforms/ps2.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/platforms/psp.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/platforms/psx.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/py.typed +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/scripts/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/scripts/capy.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/scripts/split.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/asm.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/asmtu.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/bin.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/bss.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/c.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/code.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/codesubsegment.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/cpp.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/data.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/databin.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/eh_frame.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/gcc_except_table.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/group.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/hasm.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/header.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/lib.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/linker_offset.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/pad.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/rdata.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/rodata.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/rodatabin.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/sbss.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/sdata.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/segment.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/common/textbin.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/linker_entry.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/ci.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/ci4.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/ci8.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/decompressor.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/gfx.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/header.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/i1.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/i4.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/i8.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/ia16.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/ia4.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/ia8.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/img.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/ipl3.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/mio0.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/palette.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/rgba16.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/rgba32.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/rsp.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/vtx.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/n64/yay0.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/ps2/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/ps2/ctor.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/ps2/lit4.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/ps2/lit8.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/ps2/vtables.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/psp/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/psx/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/psx/header.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/segtypes/segment.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/cache_handler.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/color.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/compiler.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/conf.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/file_presets.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/log.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/n64/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/n64/find_code_length.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/options.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/palettes.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/progress_bar.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/ps2/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/ps2/ps2elfinfo.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/psx/__init__.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/psx/psxexeinfo.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/relocs.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/statistics.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/symbols.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/utils.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/src/splat/util/vram_classes.py +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/Dockerfile +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/README.md +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/.gitignore +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/Makefile +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/build/basic_app.bin +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/dummy_ipl3.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/.splache +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/asm/data/main.bss.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/asm/data/main.data.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/asm/data/main.rodata.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/asm/handwritten.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/asm/header.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/asm/main.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/asm/nonmatchings/main/D_80000510.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/asm/nonmatchings/main/func_80000400.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/asm/nonmatchings/main/func_800004A0.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/assets/dummy_ipl3.bin +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/basic_app.d +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/build/test/basic_app/split/src/main.asmproc.d +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/include/include_asm.h +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/include/labels.inc +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/include/macro.inc +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/src/main.c +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/undefined_funcs_auto.txt +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/expected/undefined_syms_auto.txt +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/handwritten.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/header.s +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/basic_app/main.c +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test/test_gen_expected.sh +0 -0
- {splat64-0.37.2 → splat64-0.37.3}/test.py +0 -0
|
@@ -45,14 +45,8 @@ jobs:
|
|
|
45
45
|
pip install -r requirements.txt
|
|
46
46
|
pip install types-PyYAML
|
|
47
47
|
|
|
48
|
-
- name: ruff
|
|
49
|
-
run: ruff check
|
|
50
|
-
|
|
51
|
-
- name: ruff create_config
|
|
52
|
-
run: ruff check create_config.py
|
|
53
|
-
|
|
54
|
-
- name: ruff test
|
|
55
|
-
run: ruff check test.py
|
|
48
|
+
- name: ruff
|
|
49
|
+
run: ruff check .
|
|
56
50
|
|
|
57
51
|
mypy_splat_checks:
|
|
58
52
|
runs-on: ubuntu-latest
|
|
@@ -94,11 +88,5 @@ jobs:
|
|
|
94
88
|
pip install -r requirements.txt
|
|
95
89
|
pip install types-PyYAML
|
|
96
90
|
|
|
97
|
-
- name: mypy
|
|
98
|
-
run: mypy --show-column-numbers --hide-error-context
|
|
99
|
-
|
|
100
|
-
- name: mypy create_config
|
|
101
|
-
run: mypy --show-column-numbers --hide-error-context create_config.py
|
|
102
|
-
|
|
103
|
-
- name: mypy test
|
|
104
|
-
run: mypy --show-column-numbers --hide-error-context test.py
|
|
91
|
+
- name: mypy
|
|
92
|
+
run: mypy --show-column-numbers --hide-error-context *.py
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# splat Release Notes
|
|
2
2
|
|
|
3
|
+
### 0.37.3
|
|
4
|
+
|
|
5
|
+
* create_config: Avoid emitting relocations for addresses paired by using `ori`
|
|
6
|
+
|
|
3
7
|
### 0.37.2
|
|
8
|
+
|
|
4
9
|
* Add new option `sort_segments_by_vram_dependency` to help with non-matching builds for binaries with complicated memory layouts. See the wiki for details.
|
|
5
10
|
* Fix create_config missing bss segments due to unsigned LO instructions.
|
|
6
11
|
|
|
@@ -9,6 +14,7 @@
|
|
|
9
14
|
* Fix `make_full_disasm_for_code` not extracting data-only TUs.
|
|
10
15
|
* Fix `make_full_disasm_for_code` and `disassemble_all` combo
|
|
11
16
|
* Fixes not writing other sections to asm file when both options are enabled.
|
|
17
|
+
* Add UTF-8 encoding to file reads in c.py.
|
|
12
18
|
|
|
13
19
|
### 0.37.0
|
|
14
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: splat64
|
|
3
|
-
Version: 0.37.
|
|
3
|
+
Version: 0.37.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
|
|
@@ -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.37.
|
|
79
|
+
splat64[mips]>=0.37.3,<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.37.
|
|
24
|
+
splat64[mips]>=0.37.3,<1.0.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
### Optional dependencies
|
|
@@ -193,32 +193,37 @@ segments:
|
|
|
193
193
|
file_presets.write_all_files()
|
|
194
194
|
|
|
195
195
|
# Write reloc_addrs.txt file
|
|
196
|
-
reloc_addrs = []
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
196
|
+
reloc_addrs: list[str] = []
|
|
197
|
+
|
|
198
|
+
addresses_info: list[tuple[Optional[rominfo.EntryAddressInfo], str]] = [
|
|
199
|
+
(rom.entrypoint_info.main_address, "main"),
|
|
200
|
+
(rom.entrypoint_info.bss_start_address, "main_BSS_START"),
|
|
201
|
+
(rom.entrypoint_info.bss_size, "main_BSS_SIZE"),
|
|
202
|
+
(rom.entrypoint_info.bss_end_address, "main_BSS_END"),
|
|
203
|
+
]
|
|
204
|
+
|
|
205
|
+
for addr_info, sym_name in addresses_info:
|
|
206
|
+
if addr_info is None:
|
|
207
|
+
continue
|
|
208
|
+
if addr_info.ori:
|
|
209
|
+
# Avoid emitting relocations for `ori`s since `%lo` doesn't support it.
|
|
210
|
+
continue
|
|
211
|
+
if addr_info.rom_hi == addr_info.rom_lo:
|
|
212
|
+
# hi and lo may be the same for the "main" address, i.e. a direct jal.
|
|
213
|
+
continue
|
|
214
|
+
|
|
214
215
|
reloc_addrs.append(
|
|
215
|
-
f"rom:0x{
|
|
216
|
+
f"rom:0x{addr_info.rom_hi:06X} reloc:MIPS_HI16 symbol:{sym_name}"
|
|
216
217
|
)
|
|
217
218
|
reloc_addrs.append(
|
|
218
|
-
f"rom:0x{
|
|
219
|
+
f"rom:0x{addr_info.rom_lo:06X} reloc:MIPS_LO16 symbol:{sym_name}"
|
|
219
220
|
)
|
|
220
221
|
reloc_addrs.append("")
|
|
221
|
-
|
|
222
|
+
|
|
223
|
+
if (
|
|
224
|
+
rom.entrypoint_info.stack_top is not None
|
|
225
|
+
and not rom.entrypoint_info.stack_top.ori
|
|
226
|
+
):
|
|
222
227
|
reloc_addrs.append(
|
|
223
228
|
'// This entry corresponds to the "stack top", which is the end of the array used as the stack for the main segment.'
|
|
224
229
|
)
|
|
@@ -74,13 +74,14 @@ class EntryAddressInfo:
|
|
|
74
74
|
value: int
|
|
75
75
|
rom_hi: int
|
|
76
76
|
rom_lo: int
|
|
77
|
+
ori: bool
|
|
77
78
|
|
|
78
79
|
@staticmethod
|
|
79
80
|
def new(
|
|
80
|
-
value: Optional[int], hi: Optional[int], lo: Optional[int]
|
|
81
|
+
value: Optional[int], hi: Optional[int], lo: Optional[int], ori: Optional[int]
|
|
81
82
|
) -> Optional["EntryAddressInfo"]:
|
|
82
83
|
if value is not None and hi is not None and lo is not None:
|
|
83
|
-
return EntryAddressInfo(value, hi, lo)
|
|
84
|
+
return EntryAddressInfo(value, hi, lo, ori == lo)
|
|
84
85
|
return None
|
|
85
86
|
|
|
86
87
|
|
|
@@ -94,6 +95,7 @@ class N64EntrypointInfo:
|
|
|
94
95
|
main_address: Optional[EntryAddressInfo]
|
|
95
96
|
stack_top: Optional[EntryAddressInfo]
|
|
96
97
|
traditional_entrypoint: bool
|
|
98
|
+
ori_entrypoint: bool
|
|
97
99
|
|
|
98
100
|
def segment_size(self) -> int:
|
|
99
101
|
if self.data_size is not None:
|
|
@@ -120,6 +122,10 @@ class N64EntrypointInfo:
|
|
|
120
122
|
completed_pair = [False for _ in range(32)]
|
|
121
123
|
hi_assignments: List[Optional[int]] = [None for _ in range(32)]
|
|
122
124
|
lo_assignments: List[Optional[int]] = [None for _ in range(32)]
|
|
125
|
+
# We need to track if something was paired using an ori instead of an
|
|
126
|
+
# addiu or similar, because if that's the case we can't emit normal
|
|
127
|
+
# relocations in the generated symbol_addrs file for it.
|
|
128
|
+
ori_assignments: List[Optional[int]] = [None for _ in range(32)]
|
|
123
129
|
|
|
124
130
|
register_bss_address: Optional[int] = None
|
|
125
131
|
register_bss_size: Optional[int] = None
|
|
@@ -130,6 +136,7 @@ class N64EntrypointInfo:
|
|
|
130
136
|
bss_end_address: Optional[EntryAddressInfo] = None
|
|
131
137
|
|
|
132
138
|
traditional_entrypoint = True
|
|
139
|
+
ori_entrypoint = False
|
|
133
140
|
decrementing_bss_routine = True
|
|
134
141
|
data_size: Optional[int] = None
|
|
135
142
|
func_call_target: Optional[EntryAddressInfo] = None
|
|
@@ -163,6 +170,9 @@ class N64EntrypointInfo:
|
|
|
163
170
|
)
|
|
164
171
|
completed_pair[insn.rt.value] = True
|
|
165
172
|
lo_assignments[insn.rt.value] = current_rom
|
|
173
|
+
if insn.isUnsigned():
|
|
174
|
+
ori_assignments[insn.rt.value] = current_rom
|
|
175
|
+
ori_entrypoint = True
|
|
166
176
|
elif insn.doesStore():
|
|
167
177
|
if insn.rt == rabbitizer.RegGprO32.zero:
|
|
168
178
|
# Try to detect the zero-ing bss algorithm
|
|
@@ -208,11 +218,13 @@ class N64EntrypointInfo:
|
|
|
208
218
|
register_values[insn.rs.value],
|
|
209
219
|
hi_assignments[insn.rs.value],
|
|
210
220
|
lo_assignments[insn.rs.value],
|
|
221
|
+
ori_assignments[insn.rs.value],
|
|
211
222
|
)
|
|
212
223
|
bss_end_address = EntryAddressInfo.new(
|
|
213
224
|
register_values[insn.rt.value],
|
|
214
225
|
hi_assignments[insn.rt.value],
|
|
215
226
|
lo_assignments[insn.rt.value],
|
|
227
|
+
ori_assignments[insn.rt.value],
|
|
216
228
|
)
|
|
217
229
|
|
|
218
230
|
elif insn.isFunctionCall():
|
|
@@ -221,7 +233,7 @@ class N64EntrypointInfo:
|
|
|
221
233
|
# entrypoint to actual code.
|
|
222
234
|
traditional_entrypoint = False
|
|
223
235
|
func_call_target = EntryAddressInfo(
|
|
224
|
-
insn.getInstrIndexAsVram(), current_rom, current_rom
|
|
236
|
+
insn.getInstrIndexAsVram(), current_rom, current_rom, False
|
|
225
237
|
)
|
|
226
238
|
|
|
227
239
|
elif insn.uniqueId == rabbitizer.InstrId.cpu_break:
|
|
@@ -254,12 +266,14 @@ class N64EntrypointInfo:
|
|
|
254
266
|
register_values[register_bss_address],
|
|
255
267
|
hi_assignments[register_bss_address],
|
|
256
268
|
lo_assignments[register_bss_address],
|
|
269
|
+
ori_assignments[register_bss_address],
|
|
257
270
|
)
|
|
258
271
|
if register_bss_size is not None:
|
|
259
272
|
bss_size = EntryAddressInfo.new(
|
|
260
273
|
register_values[register_bss_size],
|
|
261
274
|
hi_assignments[register_bss_size],
|
|
262
275
|
lo_assignments[register_bss_size],
|
|
276
|
+
ori_assignments[register_bss_size],
|
|
263
277
|
)
|
|
264
278
|
|
|
265
279
|
if register_main_address is not None:
|
|
@@ -267,6 +281,7 @@ class N64EntrypointInfo:
|
|
|
267
281
|
register_values[register_main_address],
|
|
268
282
|
hi_assignments[register_main_address],
|
|
269
283
|
lo_assignments[register_main_address],
|
|
284
|
+
ori_assignments[register_main_address],
|
|
270
285
|
)
|
|
271
286
|
else:
|
|
272
287
|
main_address = None
|
|
@@ -275,6 +290,7 @@ class N64EntrypointInfo:
|
|
|
275
290
|
register_values[rabbitizer.RegGprO32.sp.value],
|
|
276
291
|
hi_assignments[rabbitizer.RegGprO32.sp.value],
|
|
277
292
|
lo_assignments[rabbitizer.RegGprO32.sp.value],
|
|
293
|
+
ori_assignments[rabbitizer.RegGprO32.sp.value],
|
|
278
294
|
)
|
|
279
295
|
|
|
280
296
|
if not traditional_entrypoint:
|
|
@@ -299,6 +315,7 @@ class N64EntrypointInfo:
|
|
|
299
315
|
main_address,
|
|
300
316
|
stack_top,
|
|
301
317
|
traditional_entrypoint,
|
|
318
|
+
ori_entrypoint,
|
|
302
319
|
)
|
|
303
320
|
|
|
304
321
|
|