rh-hideout / pokeemerald-expansion

Feature branche for the pokeemerald decompilation. See the wiki for more info.
364 stars 1.14k forks source link

Modern Compiler breaks Decomp Rom Hacks on Wii U Virtual Console #4896

Closed Aereon767455 closed 3 months ago

Aereon767455 commented 4 months ago

Description

To run Emerald rom hacks on a modded Wii U running Aroma, you have to inject them as virtual console titles using a program called UWUVCI and use Rockman EXE 4.5 Real Operation JP as a base. However, rom hacks using expansion made or updated in the past year don't boot up correctly, and instead boot into a white screen and go unresponsive. The last rom hack that I have tested that used expansion and works correctly / doesn't white screen was Pokemon Emerald Rogue v1.3.2a, released on April 7th, 2023. I asked the creators of UWUVCI if it was an issue with their program, and they confirmed it was an issue with expansion rom hacks specifically rather than their program. Upon asking in Team Aqua's Hideout, multiple people suggested it was an issue with the Modern Compiler. I'm not sure how Modern Compiler would need to be changed to fix the white screen issue on Wii U Virtual Console, but I would absolutely love to be able to play games that use expansion as a base on Wii U, especially since expansion has become very popular in modern rom hacks.

Version

1.8.4 (Latest release)

Upcoming/master Version

No response

Discord contact info

Aereon767455

mrgriffin commented 4 months ago

iirc booting into a white screen usually means that the emulator isn't providing a valid 1Mbit flash.

Do you know how your Wii U set-up is handling flash? At a guess for why somebody might blame a modern compiler, do you know if your Wii U set-up is searching the ROM for a particular sequence of bytes that corresponds to the Nintendo flash library and patching them? That would almost certainly fail with a modern compiler because the flash library is also being compiled with that compiler, and thus produces a different set of bytes (but with the same semantics—that is to say, a correct emulator would still work).

Bassoonian commented 3 months ago

Can we get some more information on this issue, please? If not, we'll have to close it as we're unable to investigate further. Thanks!

leo60228 commented 3 months ago

UWUVCI applies the long-documented binary patch to make the game "work" with 512KB flash saves: https://github.com/stuff-by-3-random-dudes/UWUVCI-AIO-WPF/blob/a7f0b8154e01f6f4bcc73db7ce1ff80f12ccbe47/UWUVCI%20AIO%20WPF/Classes/Injection.cs#L92

There are official VC releases with 1M saves, like Super Mario Advance 4. To properly fix this issue, someone probably needs to reverse-engineer the emulator's save type detection code.

tertu-m commented 3 months ago

I think this issue is out of scope for expansion. Effectively, this is a bug in the Wii U VC emulator that injectors will need to work around. That being said, outside of the scope of expansion, I plan to submit a version of that patch that would work with modern (the Wii U VC appears to emulate 1M flash always), but it’s not really feasible to support this within expansion itself and it’s not a bug in expansion.