Skip to content

Implement main.dol replacements#94

Merged
Jacherr merged 2 commits into
Retro-Rewind-Team:mainfrom
y21:main_dol
May 8, 2026
Merged

Implement main.dol replacements#94
Jacherr merged 2 commits into
Retro-Rewind-Team:mainfrom
y21:main_dol

Conversation

@y21
Copy link
Copy Markdown
Collaborator

@y21 y21 commented May 5, 2026

Closes #81. Tested on Dolphin. This works by essentially overwriting the previously loaded main game DOL at 0x8090000 with the main.dol on the SD card.

This also changes the folder contents collection code to allocate the entries in a dynamic array first and then copy them into MEM1 (this will still not over-allocate MEM1 space as the previous version intended).
My reasoning for this is that while implementing main.dol replacements I initially only added the strcmp("main.dol") check in the second loop and not in the first one, and that resulted in a wrong count/corruption later on which was hard to debug, so IMO this is kinda error prone having to duplicate the checks in two places.

Although if thats controversial I can revert this and just have the strcmp() in both loops, it's not required for the main purpose of this PR

y21 added 2 commits May 5, 2026 02:22
also changes the folder content collection code to use a single loop + a dynamic array rather than two loops to avoid having to duplicate the checks in two loops
@Jacherr Jacherr merged commit 7eff559 into Retro-Rewind-Team:main May 8, 2026
1 check failed
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.

Support main.dol replacements

2 participants