mgba-emu / mgba

mGBA Game Boy Advance Emulator
https://mgba.io/
Mozilla Public License 2.0
5.75k stars 794 forks source link

Game overrides don't work consistently #1537

Open LimitCrown opened 5 years ago

LimitCrown commented 5 years ago

I use the standalone version of mGBA. While trying to enable the GBA mode in The Legend of Zelda: Oracle of Seasons through two ways, I noticed that neither work correctly.

If I try to set the Game Boy Color model from Autodetect to Game Boy Advance in the Tools > Settings menu, then what happens is that GBA mode isn't triggered and instead the colors are dimmed, with for example the color white changing from rgb(255, 255, 255) to rgb(240, 240, 240). The colors appear to be scaled incorrectly. Changing this setting back to Autodetect makes it return to normal.

However, if I instead change the setting in Tools > Game overrides, GBA mode is enabled in the game the first time, but closing the game and running it again causes the above issue and the mode doesn't seem to be triggered. Unlike the other case, the option appears to be reverted back to Autodetect, but trying to save that option doesn't work and the colors remain muted until I clear my settings. I haven't checked what exactly changes in the files after changing the settings yet.

endrift commented 5 years ago

I don't seem to be able to reproduce on latest dev.

LimitCrown commented 5 years ago

Hmm. I downloaded the newest build of mGBA, but I'm running into the same issues still. If it helps, I've been using the .7z archive one and the x64 build. This is the muting of the colors that I'm referring to that occurs when I change the Game Boy Color model from Autodetect to Game Boy Advance in Tools > Settings: mGBA_2019-09-28_23-51-26

When trying to change the game override setting, the config file does initially change to add the line and the game does recognize that it's being run on a GBA the first time that it's run, but afterwards it doesn't and the muting of colors occurs instead. Changing the game override setting back to autodetect doesn't actually remove the line from the config file, so I need to manually remove it to make the colors go back to their ordinary appearance.

endrift commented 5 years ago

I can reproduce the muting (it is indeed incorrect color scaling--mGBA uses a different color scaling for AGB mode but it doesn't scale up to 255), but I can't reproduce the Advance Shop not being open at the same time as the color muting being present.

LimitCrown commented 5 years ago

Ah. It seems it does make the Advance Shop still appear correctly, although the game still looks muted. The muting of the colors had confused me a bit and I should have checked every relevant location beforehand.

LimitCrown commented 5 years ago

Trying out the newest developmental build of mGBA, the colors initially appeared to be scaled correctly now at first when I used the option in Tools > Settings, but I now notice another discrepancy that may have been occurring along with the previous muting of color. When I compare the pictures that I take, the colors are overall darker than they normally should be. The first picture is how the game should look when being run in GBA mode and the second is how it does when repeating the steps in my first post for finding the first error:

mGBA_2019-10-03_11-12-20 mGBA_2019-10-03_11-08-36

Using the game overrides option makes the game appear correctly when it's first run, but not when it's run in subsequent attempts similarly to the first error until the line in the config file is manually removed and the option is used again. My guess is that the emulator is performing its own gamma correction, which causes this discrepancy. However, I usually use color emulation shaders and this messes up the results. Speaking of which, the gba-color shader was updated some time ago and there is a gbc-color one as well, so I've needed to edit the provided one for it to match.

Edit: I think I see what may be going on. The individual raw RGB values are being multiplied by themselves then they're downscaled. I think having them instead be multiplied by 33 and then downscaling normally should make them properly upscaled without affecting the general brightness of the colors.

bentley commented 5 years ago

Oracle of Ages and Oracle of Seasons themselves detect at runtime which system they’re on and select different palettes for Game Boy Color and Game Boy Advance.

LimitCrown commented 5 years ago

Yes, but the last two pictures are of the GBA palette being used. The first picture is with the values being scaled how they'd be expected to and the second is how mGBA currently displays them because of the different scaling that it does with Game Boy Advance being selected as the Game Boy Color model. The ordinary GBC palette looks different from the last two pictures and looks like this: mGBA_2019-09-28_12-12-38

The colors are scaled the normal way when GBC games are played in GBC mode, so it's only when a GBC game is played in GBA mode in mGBA where there is different scaling.

RunisDauphin commented 5 years ago

If you find it useful, you can use these romhacks to enable the GBA mode: Oracle of Ages: http://www.romhacking.net/hacks/3580/ Oracle of Seasons: http://www.romhacking.net/hacks/3583/

Runis Dauphin