Skip to content

Improve game compatibility#60

Open
AetiasHax wants to merge 48 commits into
mainfrom
game-compatibility
Open

Improve game compatibility#60
AetiasHax wants to merge 48 commits into
mainfrom
game-compatibility

Conversation

@AetiasHax
Copy link
Copy Markdown
Owner

Tons of changes to function analysis and relocation analysis which makes more games compatible with dsd init, either by fixing errors or by making the generated dsd configs more sensible.

The generated output of dsd init will be slightly different compared to already established projects, but it's nothing major.

In some games these registers are used for local variables while not being callee-saved. If those local variables also happen to be used without an initial value, then dsd would assume the instruction is illegal. It is undefined behavior however, but not illegal.
It seems older versions of the compiler doesn't use `add pc, {offset}` for the branching instruction
The base address of a static overlay does not come directly after the end address of another overlay. Previously, we did not allow such gaps between overlays. But since some games have gaps, those overlays are now allowed and will be placed at an exact address by the LCF.
There was a duplicate error message since I copied over data analysis code from CLI to library
Some dsd projects complain here when checking locations of external labels, but label symbols aren't imported by SymbolMapsExt::from_object so there's no reason to check them
It was moved from CLI to library and that changed which error type we want to look for
AetiasHax added 18 commits May 16, 2026 09:58
By default, `object::Object::symbol_by_name` scans through all symbols until it finds a match. `dsd rom config` uses it to find section addresses for each module, so it ends up doing a lot of passes through all symbols.
Instead, we now pass through all symbols *once*, registering them in a HashMap so they can be queried much quicker later.
Some games have gaps between each overlay group, which seems to mean that they were manually placed at arbitrary addresses. Rather than add support for this in the current algorithm, I rewrote and shortened it.
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.

1 participant