Skip to content

Add hacks to fix PCH .data causing fake mismatches with decompctx#2606

Merged
TakaRikka merged 1 commit intozeldaret:mainfrom
caseif:decompctx-fix
Aug 31, 2025
Merged

Add hacks to fix PCH .data causing fake mismatches with decompctx#2606
TakaRikka merged 1 commit intozeldaret:mainfrom
caseif:decompctx-fix

Conversation

@caseif
Copy link
Copy Markdown
Contributor

@caseif caseif commented Aug 26, 2025

This PR adds some hacks to fix erroneous mismatches that are reported when compiling code generated by decompctx. These are caused by not using a PCH thereby causing constants that would normally end up in .data to be emitted in .rodata instead which then affects the final assembly and makes it difficult to tell whether code is matching or not in decomp.me. This basically just moves the static const items to static globals so that they're forced to go in .data. This isn't a perfect fix as the ordering ends up being wrong, but the important part is that 1) the .data size stays the same, and 2) the later .data and the .rodata offsets are what they should be (as they would be when using a PCH).

This also includes changes from encounter/dtk-template#62 to allow conditionally compiling code for decompctx (and also to fix including PCHs in general).

@decomp-dev
Copy link
Copy Markdown

decomp-dev bot commented Aug 26, 2025

Report for GZ2P01 (5d46f1f - 93f0d6a)

No changes

Report for GZ2E01 (5d46f1f - 93f0d6a)

No changes

Report for ShieldD (5d46f1f - 93f0d6a)

No changes

Report for GZ2J01 (5d46f1f - 93f0d6a)

No changes

@caseif caseif marked this pull request as draft August 26, 2025 00:56
@caseif caseif marked this pull request as ready for review August 30, 2025 17:35
@TakaRikka TakaRikka merged commit 8c94dc8 into zeldaret:main Aug 31, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants