diff --git a/CHANGELOG.md b/CHANGELOG.md index b465a0f9..b59387da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/README.md b/README.md index 1d57bfc7..edb59d4b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 549f1b3e..65a25d3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"} diff --git a/src/splat/__init__.py b/src/splat/__init__.py index 087d28d9..88bea3e9 100644 --- a/src/splat/__init__.py +++ b/src/splat/__init__.py @@ -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 diff --git a/src/splat/util/file_presets.py b/src/splat/util/file_presets.py index a875f444..447b4fb9 100644 --- a/src/splat/util/file_presets.py +++ b/src/splat/util/file_presets.py @@ -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 ( @@ -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"}: @@ -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: