splat64 0.36.1__tar.gz → 0.36.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.
Files changed (158) hide show
  1. splat64-0.36.3/.github/workflows/format.yml +27 -0
  2. splat64-0.36.3/.github/workflows/lint.yml +104 -0
  3. {splat64-0.36.1 → splat64-0.36.3}/CHANGELOG.md +12 -1
  4. {splat64-0.36.1 → splat64-0.36.3}/PKG-INFO +5 -5
  5. {splat64-0.36.1 → splat64-0.36.3}/README.md +1 -1
  6. {splat64-0.36.1 → splat64-0.36.3}/pyproject.toml +3 -3
  7. {splat64-0.36.1 → splat64-0.36.3}/requirements.txt +1 -1
  8. {splat64-0.36.1 → splat64-0.36.3}/src/splat/__init__.py +1 -1
  9. {splat64-0.36.1 → splat64-0.36.3}/src/splat/disassembler/__init__.py +0 -1
  10. {splat64-0.36.1 → splat64-0.36.3}/src/splat/disassembler/null_disassembler.py +0 -1
  11. {splat64-0.36.1 → splat64-0.36.3}/src/splat/disassembler/spimdisasm_disassembler.py +1 -1
  12. {splat64-0.36.1 → splat64-0.36.3}/src/splat/platforms/ps2.py +0 -2
  13. {splat64-0.36.1 → splat64-0.36.3}/src/splat/scripts/create_config.py +1 -1
  14. {splat64-0.36.1 → splat64-0.36.3}/src/splat/scripts/split.py +9 -9
  15. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/asm.py +1 -3
  16. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/bin.py +2 -1
  17. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/c.py +12 -10
  18. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/code.py +1 -1
  19. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/codesubsegment.py +1 -1
  20. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/databin.py +0 -1
  21. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/rodata.py +1 -1
  22. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/rodatabin.py +0 -1
  23. splat64-0.36.3/src/splat/segtypes/common/segment.py +5 -0
  24. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/linker_entry.py +21 -16
  25. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/gfx.py +0 -1
  26. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/segment.py +7 -7
  27. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/cache_handler.py +1 -1
  28. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/conf.py +5 -5
  29. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/file_presets.py +7 -6
  30. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/n64/rominfo.py +1 -1
  31. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/psx/psxexeinfo.py +2 -3
  32. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/relocs.py +3 -3
  33. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/symbols.py +10 -8
  34. splat64-0.36.3/src/splat/util/utils.py +9 -0
  35. {splat64-0.36.1 → splat64-0.36.3}/test.py +11 -8
  36. splat64-0.36.1/.github/workflows/black.yml +0 -23
  37. splat64-0.36.1/.github/workflows/mypy.yml +0 -55
  38. splat64-0.36.1/src/splat/segtypes/common/segment.py +0 -5
  39. splat64-0.36.1/src/splat/util/utils.py +0 -9
  40. {splat64-0.36.1 → splat64-0.36.3}/.gitattributes +0 -0
  41. {splat64-0.36.1 → splat64-0.36.3}/.github/workflows/publish_docs_to_wiki.yml +0 -0
  42. {splat64-0.36.1 → splat64-0.36.3}/.github/workflows/pypi.yml +0 -0
  43. {splat64-0.36.1 → splat64-0.36.3}/.github/workflows/test_lib.yml +0 -0
  44. {splat64-0.36.1 → splat64-0.36.3}/.github/workflows/unit_tests.yml +0 -0
  45. {splat64-0.36.1 → splat64-0.36.3}/.gitignore +0 -0
  46. {splat64-0.36.1 → splat64-0.36.3}/LICENSE +0 -0
  47. {splat64-0.36.1 → splat64-0.36.3}/create_config.py +0 -0
  48. {splat64-0.36.1 → splat64-0.36.3}/docs/Adding-Symbols.md +0 -0
  49. {splat64-0.36.1 → splat64-0.36.3}/docs/Advanced-Reloc.md +0 -0
  50. {splat64-0.36.1 → splat64-0.36.3}/docs/Advanced.md +0 -0
  51. {splat64-0.36.1 → splat64-0.36.3}/docs/Configuration.md +0 -0
  52. {splat64-0.36.1 → splat64-0.36.3}/docs/Examples.md +0 -0
  53. {splat64-0.36.1 → splat64-0.36.3}/docs/General-Workflow.md +0 -0
  54. {splat64-0.36.1 → splat64-0.36.3}/docs/Home.md +0 -0
  55. {splat64-0.36.1 → splat64-0.36.3}/docs/Quickstart.md +0 -0
  56. {splat64-0.36.1 → splat64-0.36.3}/docs/Segments.md +0 -0
  57. {splat64-0.36.1 → splat64-0.36.3}/docs/VramClasses.md +0 -0
  58. {splat64-0.36.1 → splat64-0.36.3}/mypy.ini +0 -0
  59. {splat64-0.36.1 → splat64-0.36.3}/split.py +0 -0
  60. {splat64-0.36.1 → splat64-0.36.3}/src/splat/__main__.py +0 -0
  61. {splat64-0.36.1 → splat64-0.36.3}/src/splat/disassembler/disassembler.py +0 -0
  62. {splat64-0.36.1 → splat64-0.36.3}/src/splat/disassembler/disassembler_instance.py +0 -0
  63. {splat64-0.36.1 → splat64-0.36.3}/src/splat/disassembler/disassembler_section.py +0 -0
  64. {splat64-0.36.1 → splat64-0.36.3}/src/splat/platforms/__init__.py +0 -0
  65. {splat64-0.36.1 → splat64-0.36.3}/src/splat/platforms/n64.py +0 -0
  66. {splat64-0.36.1 → splat64-0.36.3}/src/splat/platforms/psp.py +0 -0
  67. {splat64-0.36.1 → splat64-0.36.3}/src/splat/platforms/psx.py +0 -0
  68. {splat64-0.36.1 → splat64-0.36.3}/src/splat/py.typed +0 -0
  69. {splat64-0.36.1 → splat64-0.36.3}/src/splat/scripts/__init__.py +0 -0
  70. {splat64-0.36.1 → splat64-0.36.3}/src/splat/scripts/capy.py +0 -0
  71. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/__init__.py +0 -0
  72. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/__init__.py +0 -0
  73. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/asmtu.py +0 -0
  74. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/bss.py +0 -0
  75. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/cpp.py +0 -0
  76. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/data.py +0 -0
  77. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/eh_frame.py +0 -0
  78. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/gcc_except_table.py +0 -0
  79. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/group.py +0 -0
  80. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/hasm.py +0 -0
  81. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/header.py +0 -0
  82. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/lib.py +0 -0
  83. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/linker_offset.py +0 -0
  84. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/pad.py +0 -0
  85. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/rdata.py +0 -0
  86. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/sbss.py +0 -0
  87. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/sdata.py +0 -0
  88. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/common/textbin.py +0 -0
  89. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/__init__.py +0 -0
  90. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/ci.py +0 -0
  91. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/ci4.py +0 -0
  92. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/ci8.py +0 -0
  93. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/decompressor.py +0 -0
  94. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/header.py +0 -0
  95. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/i1.py +0 -0
  96. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/i4.py +0 -0
  97. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/i8.py +0 -0
  98. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/ia16.py +0 -0
  99. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/ia4.py +0 -0
  100. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/ia8.py +0 -0
  101. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/img.py +0 -0
  102. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/ipl3.py +0 -0
  103. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/mio0.py +0 -0
  104. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/palette.py +0 -0
  105. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/rgba16.py +0 -0
  106. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/rgba32.py +0 -0
  107. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/rsp.py +0 -0
  108. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/vtx.py +0 -0
  109. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/n64/yay0.py +0 -0
  110. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/ps2/__init__.py +0 -0
  111. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/ps2/ctor.py +0 -0
  112. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/ps2/lit4.py +0 -0
  113. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/ps2/lit8.py +0 -0
  114. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/ps2/vtables.py +0 -0
  115. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/psp/__init__.py +0 -0
  116. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/psx/__init__.py +0 -0
  117. {splat64-0.36.1 → splat64-0.36.3}/src/splat/segtypes/psx/header.py +0 -0
  118. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/__init__.py +0 -0
  119. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/color.py +0 -0
  120. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/compiler.py +0 -0
  121. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/log.py +0 -0
  122. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/n64/__init__.py +0 -0
  123. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/n64/find_code_length.py +0 -0
  124. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/options.py +0 -0
  125. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/palettes.py +0 -0
  126. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/progress_bar.py +0 -0
  127. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/psx/__init__.py +0 -0
  128. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/statistics.py +0 -0
  129. {splat64-0.36.1 → splat64-0.36.3}/src/splat/util/vram_classes.py +0 -0
  130. {splat64-0.36.1 → splat64-0.36.3}/test/Dockerfile +0 -0
  131. {splat64-0.36.1 → splat64-0.36.3}/test/README.md +0 -0
  132. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/.gitignore +0 -0
  133. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/Makefile +0 -0
  134. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/build/basic_app.bin +0 -0
  135. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/dummy_ipl3.s +0 -0
  136. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/.splache +0 -0
  137. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/asm/data/main.bss.s +0 -0
  138. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/asm/data/main.data.s +0 -0
  139. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/asm/data/main.rodata.s +0 -0
  140. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/asm/handwritten.s +0 -0
  141. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/asm/header.s +0 -0
  142. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/asm/main.s +0 -0
  143. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/asm/nonmatchings/main/D_80000510.s +0 -0
  144. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/asm/nonmatchings/main/func_80000400.s +0 -0
  145. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/asm/nonmatchings/main/func_800004A0.s +0 -0
  146. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/assets/dummy_ipl3.bin +0 -0
  147. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/basic_app.d +0 -0
  148. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/build/test/basic_app/split/src/main.asmproc.d +0 -0
  149. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/include/include_asm.h +0 -0
  150. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/include/labels.inc +0 -0
  151. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/include/macro.inc +0 -0
  152. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/src/main.c +0 -0
  153. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/undefined_funcs_auto.txt +0 -0
  154. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/expected/undefined_syms_auto.txt +0 -0
  155. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/handwritten.s +0 -0
  156. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/header.s +0 -0
  157. {splat64-0.36.1 → splat64-0.36.3}/test/basic_app/main.c +0 -0
  158. {splat64-0.36.1 → splat64-0.36.3}/test/test_gen_expected.sh +0 -0
@@ -0,0 +1,27 @@
1
+ name: Check code is formatted
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ black_checks:
9
+ runs-on: ubuntu-latest
10
+ name: Check format with Ruff
11
+ steps:
12
+ - name: Checkout repo
13
+ uses: actions/checkout@main
14
+
15
+ - name: Set up Python 3.9
16
+ uses: actions/setup-python@v5
17
+ with:
18
+ python-version: 3.9
19
+
20
+ - name: Install Dependencies
21
+ run: |
22
+ pip install ruff
23
+ pip install -r requirements.txt
24
+ pip install types-PyYAML
25
+
26
+ - name: Ruff format
27
+ run: ruff format --check .
@@ -0,0 +1,104 @@
1
+ name: Lint splat
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ ruff_splat_checks:
9
+ runs-on: ubuntu-latest
10
+ name: Ruff check splat lib
11
+ steps:
12
+ - name: Checkout repo
13
+ uses: actions/checkout@main
14
+
15
+ - name: Set up Python 3.9
16
+ uses: actions/setup-python@v5
17
+ with:
18
+ python-version: 3.9
19
+
20
+ - name: Install Dependencies
21
+ run: |
22
+ pip install ruff
23
+ pip install -r requirements.txt
24
+ pip install types-PyYAML
25
+ pip install -e .
26
+
27
+ - name: ruff splat lib
28
+ run: ruff check src/splat
29
+
30
+ ruff_lint_programs_checks:
31
+ runs-on: ubuntu-latest
32
+ name: Ruff check splat programs
33
+ steps:
34
+ - name: Checkout repo
35
+ uses: actions/checkout@main
36
+
37
+ - name: Set up Python 3.9
38
+ uses: actions/setup-python@v5
39
+ with:
40
+ python-version: 3.9
41
+
42
+ - name: Install Dependencies
43
+ run: |
44
+ pip install ruff
45
+ pip install -r requirements.txt
46
+ pip install types-PyYAML
47
+
48
+ - name: ruff split
49
+ run: ruff check split.py
50
+
51
+ - name: ruff create_config
52
+ run: ruff check create_config.py
53
+
54
+ - name: ruff test
55
+ run: ruff check test.py
56
+
57
+ mypy_splat_checks:
58
+ runs-on: ubuntu-latest
59
+ name: mypy splat lib
60
+ steps:
61
+ - name: Checkout repo
62
+ uses: actions/checkout@main
63
+
64
+ - name: Set up Python 3.9
65
+ uses: actions/setup-python@v5
66
+ with:
67
+ python-version: 3.9
68
+
69
+ - name: Install Dependencies
70
+ run: |
71
+ pip install mypy
72
+ pip install -r requirements.txt
73
+ pip install types-PyYAML
74
+ pip install -e .
75
+
76
+ - name: mypy splat lib
77
+ run: mypy --show-column-numbers --hide-error-context src/splat
78
+
79
+ mypy_programs_checks:
80
+ runs-on: ubuntu-latest
81
+ name: mypy splat programs
82
+ steps:
83
+ - name: Checkout repo
84
+ uses: actions/checkout@main
85
+
86
+ - name: Set up Python 3.9
87
+ uses: actions/setup-python@v5
88
+ with:
89
+ python-version: 3.9
90
+
91
+ - name: Install Dependencies
92
+ run: |
93
+ pip install mypy
94
+ pip install -r requirements.txt
95
+ pip install types-PyYAML
96
+
97
+ - name: mypy split
98
+ run: mypy --show-column-numbers --hide-error-context split.py
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
@@ -1,8 +1,19 @@
1
1
  # splat Release Notes
2
2
 
3
+ ### 0.36.3
4
+
5
+ * Fix not generating nonmatching `.s` files for quoted symbols.
6
+ * Symbol is automatically quoted if it contains in its name any of `@`, `<`, `\\`, `-` or `+`.
7
+ * `spimdisasm` 1.38.0 or above is now required.
8
+
9
+ ### 0.36.2
10
+
11
+ * Fix a regression on the R3000GTE `dpct` instruction on autogenerated the `gte_macros.s` file.
12
+
3
13
  ### 0.36.1
14
+
4
15
  * Files generated with `generate_asm_macros_files` will not be overwritten if they already exist on disk unchanged.
5
- * Updated GTE macros to better document opcode encodings
16
+ * Updated GTE macros to better document opcode encodings.
6
17
 
7
18
  ### 0.36.0
8
19
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: splat64
3
- Version: 0.36.1
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: spimdisasm<2.0.0,>=1.36.1; extra == 'dev'
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.36.1; extra == 'mips'
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.1,<1.0.0
79
+ splat64[mips]>=0.36.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.36.1,<1.0.0
24
+ splat64[mips]>=0.36.3,<1.0.0
25
25
  ```
26
26
 
27
27
  ### Optional dependencies
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "splat64"
3
3
  # Should be synced with src/splat/__init__.py
4
- version = "0.36.1"
4
+ version = "0.36.3"
5
5
  description = "A binary splitting tool to assist with decompilation and modding projects"
6
6
  readme = "README.md"
7
7
  license = {file = "LICENSE"}
@@ -20,7 +20,7 @@ dependencies = [
20
20
 
21
21
  [project.optional-dependencies]
22
22
  mips = [
23
- "spimdisasm>=1.36.1,<2.0.0", # This value should be keep in sync with the version listed on disassembler/spimdisasm_disassembler.py
23
+ "spimdisasm>=1.38.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
25
  "pygfxd",
26
26
  "n64img>=0.3.3",
@@ -28,8 +28,8 @@ mips = [
28
28
  ]
29
29
  dev = [
30
30
  "splat64[mips]",
31
+ "ruff",
31
32
  "mypy",
32
- "black",
33
33
  "types-PyYAML",
34
34
  "types-colorama",
35
35
  ]
@@ -4,7 +4,7 @@ tqdm
4
4
  intervaltree
5
5
  colorama
6
6
  # This value should be keep in sync with the version listed on disassembler/spimdisasm_disassembler.py and pyproject.toml
7
- spimdisasm>=1.36.1
7
+ spimdisasm>=1.38.0
8
8
  rabbitizer>=1.10.0
9
9
  pygfxd
10
10
  n64img>=0.1.4
@@ -1,7 +1,7 @@
1
1
  __package_name__ = __name__
2
2
 
3
3
  # Should be synced with pyproject.toml
4
- __version__ = "0.36.1"
4
+ __version__ = "0.36.3"
5
5
  __author__ = "ethteck"
6
6
 
7
7
  from . import util as util
@@ -1,4 +1,3 @@
1
1
  from . import disassembler as disassembler
2
2
  from . import spimdisasm_disassembler as spimdisasm_disassembler
3
3
  from . import disassembler_section as disassembler_section
4
- from . import disassembler_section as disassembler_section
@@ -1,5 +1,4 @@
1
1
  from . import disassembler
2
- from ..util.options import SplatOpts
3
2
  from typing import Set
4
3
 
5
4
 
@@ -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, 36, 1)
10
+ SPIMDISASM_MIN = (1, 38, 0)
11
11
 
12
12
  def configure(self):
13
13
  # Configure spimdisasm
@@ -1,8 +1,6 @@
1
1
  import spimdisasm
2
2
  import rabbitizer
3
3
 
4
- from ..util import compiler, options
5
-
6
4
 
7
5
  def init(target_bytes: bytes):
8
6
  rabbitizer.config.toolchainTweaks_treatJAsUnconditionalBranch = False
@@ -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"
@@ -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.paired_segment is None
143
- ), f"Somehow '{seg.name}' was already paired so something else? It is paired to '{seg.paired_segment.name}' instead of {other_seg.name}"
144
- assert (
145
- other_seg.paired_segment is None
146
- ), f"Somehow '{other_seg.name}' was already paired so something else? It is paired to '{other_seg.paired_segment.name}' instead of {seg.name}"
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
- vram_class
221
- ] += vram_class_to_segments[follows_class]
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
 
@@ -1,7 +1,5 @@
1
- from pathlib import Path
2
- from typing import Optional, List
1
+ from typing import Optional
3
2
 
4
- from ...util import options
5
3
 
6
4
  from .codesubsegment import CommonSegCodeSubsegment
7
5
 
@@ -3,7 +3,8 @@ from typing import Optional
3
3
 
4
4
  from ...util import log, options
5
5
 
6
- from .segment import CommonSegment, SegmentType
6
+ from .segment import CommonSegment
7
+ from ..segment import SegmentType
7
8
 
8
9
 
9
10
  class CommonSegBin(CommonSegment):
@@ -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, CommonSegRodata
182
- ), f"{rodata_sibling}, {rodata_sibling.type}"
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.getName() in self.global_asm_funcs
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.getName() not in self.global_asm_funcs
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.getName() in self.global_asm_rodata_syms
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.getName()}' (0x{func.vram:08X}), gap detected between '{rodata_sym.getName()}' (0x{rodata_sym.vram:08X}) and '{next_rodata_sym.getName()}' (0x{next_rodata_sym.vram:08X})"
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.getName()}(void) {{")
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.getName()
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.getName()
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")
@@ -1,5 +1,5 @@
1
1
  from collections import OrderedDict
2
- from typing import OrderedDict, List, Optional, Type, Tuple
2
+ from typing import List, Optional, Type, Tuple
3
3
 
4
4
  from ...util import log, options, utils
5
5
 
@@ -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 (
@@ -1,4 +1,3 @@
1
- from pathlib import Path
2
1
  from typing import Optional
3
2
 
4
3
  from ...util import log, options
@@ -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.getName()} to the symbol {symbol.getName()}"
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
 
@@ -1,4 +1,3 @@
1
- from pathlib import Path
2
1
  from typing import Optional
3
2
 
4
3
  from ...util import log, options
@@ -0,0 +1,5 @@
1
+ from ...segtypes.segment import Segment
2
+
3
+
4
+ class CommonSegment(Segment):
5
+ pass
@@ -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.object_path is not None
167
- ), f"{self.segment.name}, {self.segment.rom_start}"
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 l in segment.section_order:
241
- if l in options.opts.section_order:
242
- section_entries[l] = []
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
- l: False for l in options.opts.section_order
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 l in segment.section_order:
393
- if l not in options.opts.section_order:
392
+ for section_name in segment.section_order:
393
+ if section_name not in options.opts.section_order:
394
394
  continue
395
- if l == ".bss":
395
+ if section_name == ".bss":
396
396
  continue
397
397
 
398
398
  entry = LinkerEntry(
399
- segment, [], segments_path / f"{seg_name}.o", l, l, noload=False
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 l in segment.section_order:
443
- if l in options.opts.section_order:
444
- section_entries[l] = []
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 != None:
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 != None:
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)
@@ -36,7 +36,6 @@ from pygfxd import (
36
36
  gfxd_f3dexb,
37
37
  gfxd_f3dex2,
38
38
  )
39
- from ..segment import Segment
40
39
 
41
40
  from ...util import log, options
42
41
  from ...util.log import error
@@ -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 != None:
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 == None:
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 == None:
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 == None:
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
- self.parent is None
543
- ), f"subalign is not valid for non-top-level segments. ({self})"
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
@@ -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
- f"Not able to load cache file. Discarding old cache", status="warn"
23
+ "Not able to load cache file. Discarding old cache", status="warn"
24
24
  )
25
25
 
26
26
  # invalidate entire cache if options change
@@ -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 # pyright: ignore
13
+ import pylibyaml # noqa: F401
14
14
  import yaml
15
15
 
16
- from . import log, options, vram_classes
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]) != type(additional_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]) == list:
35
+ if type(main_config[curkey]) is list:
36
36
  main_config[curkey] += additional_config[curkey]
37
- elif type(main_config[curkey]) == dict:
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],