Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix $gp calculation when addiu value is negative #393

Merged
merged 4 commits into from
Aug 10, 2024
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# splat Release Notes

### 0.25.3

* Fix incorrect calculation for `$gp` value in create_config.py for PSX when immediate value is negative.

### 0.25.2

* Two new yaml options: `use_gp_rel_macro_nonmatching` and `use_gp_rel_macro`
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.25.2,<1.0.0
splat64[mips]>=0.25.3,<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.25.2"
version = "0.25.3"
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
Expand Up @@ -3,7 +3,7 @@
__package_name__ = __name__

# Should be synced with pyproject.toml
__version__ = "0.25.2"
__version__ = "0.25.3"
__author__ = "ethteck"

from . import util as util
Expand Down
4 changes: 2 additions & 2 deletions src/splat/util/psx/psxexeinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def try_get_gp(rom_bytes, start_offset, max_instructions=50) -> int:
break
insn = rabbitizer.Instruction(word)
if insn.getOpcodeName() == "lui" and insn.rt.name == "gp":
gp = insn.getImmediate() << 16
gp = insn.getProcessedImmediate() << 16
elif insn.getOpcodeName() == "addiu" and insn.rt.name == "gp":
gp += insn.getImmediate()
gp += insn.getProcessedImmediate()
break
return gp

Expand Down