Skip to content

Commit 6ddd0c9

Browse files
authored
Fix missing dot at .include in generated macro.inc file (#471)
* Fix missing dot * version bump * Include gte_macros.inc in labels.inc too * Conditionally define jlabel depending on if the user migrates rodata to functions or not
1 parent 52d33b1 commit 6ddd0c9

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# splat Release Notes
22

3+
### 0.35.1
4+
5+
* Fixes issues in the generated `macro.inc` and `labels.inc` files on psx projects.
6+
* Change `jlabel`s to be global if the user has turned off rodata migration to functions.
7+
38
### 0.35.0
49

510
* Add `pair_segment` option to segments.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The brackets corresponds to the optional dependencies to install while installin
2121
If you use a `requirements.txt` file in your repository, then you can add this library with the following line:
2222

2323
```txt
24-
splat64[mips]>=0.35.0,<1.0.0
24+
splat64[mips]>=0.35.1,<1.0.0
2525
```
2626

2727
### Optional dependencies

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "splat64"
33
# Should be synced with src/splat/__init__.py
4-
version = "0.35.0"
4+
version = "0.35.1"
55
description = "A binary splitting tool to assist with decompilation and modding projects"
66
readme = "README.md"
77
license = {file = "LICENSE"}

src/splat/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__package_name__ = __name__
22

33
# Should be synced with pyproject.toml
4-
__version__ = "0.35.0"
4+
__version__ = "0.35.1"
55
__author__ = "ethteck"
66

77
from . import util as util

src/splat/util/file_presets.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,26 @@ def write_assembly_inc_files():
122122
options.opts.asm_jtbl_label_macro != ""
123123
and options.opts.asm_jtbl_label_macro != options.opts.asm_function_macro
124124
):
125-
jlabel_macro_labelsinc = f"""
125+
jlabel_macro_macroinc = f"""
126126
# A label referenced by a jumptable.
127127
.macro {options.opts.asm_jtbl_label_macro} label, visibility=global
128+
.\\visibility \\label
129+
.type \\label, @function
128130
\\label:
129131
.endm
130132
"""
131-
jlabel_macro_macroinc = f"""
133+
if options.opts.migrate_rodata_to_functions:
134+
jlabel_macro_labelsinc = f"""
132135
# A label referenced by a jumptable.
133136
.macro {options.opts.asm_jtbl_label_macro} label, visibility=global
134-
.\\visibility \\label
135-
.type \\label, @function
136137
\\label:
137138
.endm
138139
"""
140+
else:
141+
# If the user doesn't migrate rodata, like jumptables, to functions
142+
# then the user will need jlabels to be global instead of local,
143+
# so we just reuse the definition from macro.inc
144+
jlabel_macro_labelsinc = jlabel_macro_macroinc
139145

140146
data_macros = ""
141147
if (
@@ -186,6 +192,9 @@ def write_assembly_inc_files():
186192
if options.opts.compiler.uses_include_asm:
187193
# File used by original assembler
188194
preamble = "# This file is used by the original compiler/assembler.\n# Defines the expected assembly macros.\n"
195+
196+
if options.opts.platform == "psx":
197+
preamble += '\n.include "gte_macros.inc"\n'
189198
_write("include/labels.inc", f"{preamble}\n{labels_inc}")
190199

191200
if options.opts.platform in {"n64", "psx"}:
@@ -275,7 +284,7 @@ def write_assembly_inc_files():
275284
.set $fs5f, $f31
276285
"""
277286
elif options.opts.platform == "psx":
278-
gas += '\ninclude "gte_macros.inc"\n'
287+
gas += '\n.include "gte_macros.inc"\n'
279288
write_gte_macros()
280289

281290
if options.opts.generated_macro_inc_content is not None:

0 commit comments

Comments
 (0)