Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# splat Release Notes

### 0.35.1

* Fixes issues in the generated `macro.inc` and `labels.inc` files on psx projects.
* Change `jlabel`s to be global if the user has turned off rodata migration to functions.

### 0.35.0

* Add `pair_segment` option to segments.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The brackets corresponds to the optional dependencies to install while installin
If you use a `requirements.txt` file in your repository, then you can add this library with the following line:

```txt
splat64[mips]>=0.35.0,<1.0.0
splat64[mips]>=0.35.1,<1.0.0
```

### Optional dependencies
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "splat64"
# Should be synced with src/splat/__init__.py
version = "0.35.0"
version = "0.35.1"
description = "A binary splitting tool to assist with decompilation and modding projects"
readme = "README.md"
license = {file = "LICENSE"}
Expand Down
2 changes: 1 addition & 1 deletion src/splat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__package_name__ = __name__

# Should be synced with pyproject.toml
__version__ = "0.35.0"
__version__ = "0.35.1"
__author__ = "ethteck"

from . import util as util
Expand Down
19 changes: 14 additions & 5 deletions src/splat/util/file_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,26 @@ def write_assembly_inc_files():
options.opts.asm_jtbl_label_macro != ""
and options.opts.asm_jtbl_label_macro != options.opts.asm_function_macro
):
jlabel_macro_labelsinc = f"""
jlabel_macro_macroinc = f"""
# A label referenced by a jumptable.
.macro {options.opts.asm_jtbl_label_macro} label, visibility=global
.\\visibility \\label
.type \\label, @function
\\label:
.endm
"""
jlabel_macro_macroinc = f"""
if options.opts.migrate_rodata_to_functions:
jlabel_macro_labelsinc = f"""
# A label referenced by a jumptable.
.macro {options.opts.asm_jtbl_label_macro} label, visibility=global
.\\visibility \\label
.type \\label, @function
\\label:
.endm
"""
else:
# If the user doesn't migrate rodata, like jumptables, to functions
# then the user will need jlabels to be global instead of local,
# so we just reuse the definition from macro.inc
jlabel_macro_labelsinc = jlabel_macro_macroinc

data_macros = ""
if (
Expand Down Expand Up @@ -186,6 +192,9 @@ def write_assembly_inc_files():
if options.opts.compiler.uses_include_asm:
# File used by original assembler
preamble = "# This file is used by the original compiler/assembler.\n# Defines the expected assembly macros.\n"

if options.opts.platform == "psx":
preamble += '\n.include "gte_macros.inc"\n'
_write("include/labels.inc", f"{preamble}\n{labels_inc}")

if options.opts.platform in {"n64", "psx"}:
Expand Down Expand Up @@ -275,7 +284,7 @@ def write_assembly_inc_files():
.set $fs5f, $f31
"""
elif options.opts.platform == "psx":
gas += '\ninclude "gte_macros.inc"\n'
gas += '\n.include "gte_macros.inc"\n'
write_gte_macros()

if options.opts.generated_macro_inc_content is not None:
Expand Down
Loading