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 IPL crash when launching MIOS-patched games #9663

Merged
merged 2 commits into from Apr 23, 2021

Conversation

leoetlino
Copy link
Member

MIOS (the IPL code running on the PPC, not the ARM part) puts patch data in low MEM1 (0x1800-0x3000) for its own use. Overwriting data in this range can cause the IPL to crash when launching games that get patched by MIOS. See https://bugs.dolphin-emu.org/issues/11952 for more info.

Not applying the Gecko HLE patches means that Gecko codes will not work under MIOS, but this is better than the alternative of having specific games crash.


This also fixes an oversight from #9545, which moved the "new game has been loaded" logic to a separate OnNewTitleLoad function that has to be called explicitly after a title has loaded.

Those two changes fix Wind Waker and other MIOS-patched games when they are launched from the System Menu.

MIOS puts patch data in low MEM1 (0x1800-0x3000) for its own use.
Overwriting data in this range can cause the IPL to crash when
launching games that get patched by MIOS.
See https://bugs.dolphin-emu.org/issues/11952 for more info.

Not applying the Gecko HLE patches means that Gecko codes will not work
under MIOS, but this is better than the alternative of having specific
games crash.
Oversight from dolphin-emu#9545, which moved the "new game has been loaded" logic
to a separate OnNewTitleLoad function that has to be called explicitly
*after* a title has loaded.

Coupled with the commit that makes Dolphin not clobber 0x1800-0x3000
when using MIOS, this fixes Wind Waker and other MIOS-patched games
when they are launched from the System Menu.
@Pokechu22
Copy link
Contributor

On console, do Gecko codes work with MIOS-based games? (I'm not entirely sure how Gecko codes even work on console to be honest.)

@JMC47
Copy link
Contributor

JMC47 commented Apr 22, 2021

Gecko hooking does not work with MIOS on my Wii. You have to use a MIOS replacement.

Copy link
Contributor

@JMC47 JMC47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better than crashing regardless of what happens on console. Our emulation of MIOS is limited as it is.

@mimimi085181
Copy link
Contributor

Just throwing in some thoughts to consider:
The list of games that are patched through MIOS is very limited:
https://wiibrew.org/wiki/MIOS#After-read_patches
and it's a fixed list, that won't change in the future. On the other hand, if gecko codes were enabled for all the other games, users would be confused why codes don't work on those specific games. Especially when asking for help and not mentioning how they boot the games.

I don't really see a use case for gecko codes and running a game from the wii menu's disc channel. If there is, then it should be considered. Maybe even as a hard option even for the patched games, because the MIOS patches can be replaced with gecko codes or other forms of patching.

As far as i know, NeoGamma is the only software that can run gecko codes on retail gamecube discs on a wii. But it doesn't even work for wii games in Dolphin, at least last time i checked. And it requires cMIOS support, which i guess is not implemented in Dolphin. cMIOS basically does 2 things, if i remember correctly, allow reading DVD-Rs(which is irrelevant for Dolphin and there should be a cMIOS variant without it), and running homebrew software, that has been loaded into memory before starting MIOS(or BC). NeoGamma comes with its own gamecube executable that handles booting the gamecube games, and that one writes the gecko code handler into memory. So, even for NeoGamma this PR should be irrelevant, because the code from the PR would be executed before booting the homebrew software from memory, if i'm not mistaken.

@JMC47
Copy link
Contributor

JMC47 commented Apr 22, 2021

Gecko OS can also hook into GameCube games, but only if you've done a MIOS replacement I believe? the neogamma thing makes more sense though. I do remember that.

@JosJuice JosJuice merged commit f0bd6b1 into dolphin-emu:master Apr 23, 2021
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants