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

Loader: Support HI16/16 pairs, not just LO16 #17602

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

unknownbrackets
Copy link
Collaborator

@unknownbrackets unknownbrackets commented Jun 19, 2023

#17561 tripped in Motorstorm: Arctic Edge, but initially making sure pairs matched didn't make any obvious impact.

https://report.ppsspp.org/logs/kind/1185

After some testing and comparing with PSP relocation behavior (mostly via RAM dumps), it seems that R_MIPS_16 (and maybe any other type) is paired with the R_MIPS_HI16 relocation for the purposes of the carry.

After matching that behavior, the shadows in the game appear to be fixed. Fixes #7552.

-[Unknown]

Motorstorm: Arctic Edge US uses these pairs for some VFPU loads.
Without relocating these, strange shadows show underneath vehicles.

It appears as if actual firmware pairs with any non-HI16 relocation.
@unknownbrackets unknownbrackets added this to the v1.16.0 milestone Jun 19, 2023
@hrydgard
Copy link
Owner

Oh wow, talk about a non-obvious cause of a graphical issue! Great find!

Could you link to the report on report.ppsspp.org in this PR description?

@hrydgard hrydgard merged commit 56e5cbe into hrydgard:master Jun 19, 2023
@unknownbrackets unknownbrackets deleted the elf-reloc branch June 19, 2023 13:47
@kotcrab
Copy link
Contributor

kotcrab commented Sep 16, 2024

Looking at loadcore behavior it indeed uses the first non HI16 relocation after finding HI16. I implemented this now in ghidra-allegrex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MotorStorm Arctic Edge USA - Abnormal Shadow
3 participants