dolphin icon indicating copy to clipboard operation
dolphin copied to clipboard

Hacks to fix desert bus

Open Pokechu22 opened this issue 2 years ago • 3 comments

The desert bus homebrew, for whatever reason, contains anti-emulation code: it tries to determine how long sync and isync takes, and if it doesn't take long enough then it refuses to start. I have some messy notes on this.

This PR attempts to make isync take longer to run, but doesn't do so very well. See f692752ec3990f4f21513248736fb3a58c952a0f and 4e3bf696c2098f14b12ab5fd6e0044c906796c1c for details. I do think treating isync as taking 150 cycles is a reasonable enough solution (the exact amount of time it would take seems very complicate to predict) without negatively affecting other games, but the separate JIT block change is definitely a hack that should be avoided.

The first commit (7e9ce4d79c18ba763809e406d981966ff68d6ffc) is needed to boot the game from the game list or using open; because the code is compressed the heuristic for detecting Wii games fails. The symptom of launching Wii homebrew in GameCube mode is a lot of errors about nonexistent MMIOs in the log. Booting it via the homebrew channel already used Wii mode. Hardcoding the mode is not a good fix either, as it breaks actual gamecube homebrew. Ideally we'd get rid of the heuristic and require manually specifying if homebrew is for the gamecube or wii.

ARM code is untested.

Pokechu22 avatar Dec 18 '22 06:12 Pokechu22

Works on ARM!

Screen Shot 2022-12-17 at 23 04 03

MayImilae avatar Dec 18 '22 07:12 MayImilae

I was definitely hoping we'd get this into this upcoming Progress Report. Any updates?

MayImilae avatar Jan 17 '23 11:01 MayImilae

It's going to need some more complicated JIT work (#11400 was created while I was looking into this, although it's not a prerequisite). I'm also less sure that my hack is reasonable (a simple test didn't have isync take that long; the mtmsr instruction may actually be relevant, but I'll need to do more testing).

I'm currently focusing on a few other changes, so I don't know when I'll get this done.

Pokechu22 avatar Jan 17 '23 20:01 Pokechu22