veikkos / omega-kernel

EZ-FLASH OMEGA Kernel
Apache License 2.0
34 stars 3 forks source link

Goomba emulator : deactivate color on classic GB games #2

Closed thefaboss closed 4 years ago

thefaboss commented 4 years ago

Hi, As you know, when you launch a classic GB game, it is automatically colorized and Super Game Boy frame appears on few games.

Manipulations to deactivate it are too long and... not saved :\

On Dwedit's board, he explain us how to modify his code to do so : http://www.dwedit.org/dwedit_board/viewtopic.php?pid=3564#p3564

How about bring these modifications in your alternative kernel ?

BjornB2 commented 4 years ago

Would love this as well!

veikkos commented 4 years ago

Thanks for the feedback.

We need to think about all the users, so simply defaulting to GB (as opposed to CGB) isn't viable solution as many players, including myself, want to play mainly in Color mode.

Default "Wario Blast" palette isn't very good default one in my opinion, so that might be ok to default to "None" instead - but it doesn't yet solve the GB mode.

Then SGB border. I ain't fan of it but some might prefer it.

It would be best if settings could be saved persistently but I'm not sure if it's possible without access to FPGA code. Maybe it is, I need to try to look into it a bit.

Separate "GB mode" release could be done but it isn't very flexible solution. But we could try that. I'll think about this a bit.

Other ideas?

BjornB2 commented 4 years ago

I think it would be the best if you could set defaults for GB games in the goomba emulator as a user. I very well understand that everyone has his own preference in border, color palette etc. If it is not possible to set it in Goomba, maybe an option to add a configuration file where you can set the defaults? Or add the same option as in the actual gameboy color: Press dpad left and B while the gameboy logo appears to switch to a default grayscale color palette.

veikkos commented 4 years ago

It would be bit tricky to have some of these settings as configurable as Goomba first sets up much of the emulator in assembly and only then loads configuration from file. Saving the config file is disabled in Omega because users might not understand when to wait for the SD-card write to complete. Failure to do so might corrupt the save.

I experimented a bit with changing the default configuration in Goomba. Always GB-mode, no SGB border and Grayscale palette.

It cannot be pushed to mainline like this but here is a binary if you want to try it out: k1.06_fw7-veikkos4-gb1.zip

BjornB2 commented 4 years ago

Very awesome. Will try it tonight.

BjornB2 commented 4 years ago

Works great!

One minor issue: I have the DX hacked version of Super Mario Land and Super Mario Land 2 and they don't work with this setting. The image is completely scrambled. I tried to change some settings with these roms opened, but couldn't find anything that fixed it.

veikkos commented 4 years ago

One minor issue: I have the DX hacked version of Super Mario Land and Super Mario Land 2 and they don't work with this setting. The image is completely scrambled. I tried to change some settings with these roms opened, but couldn't find anything that fixed it.

I guess it's because these games don't support non-color mode as they are hacked. Real CBG games have to keep the compatibility with regular GB through special handling.

Issue should fix itself if you re-enable CGB support via "Prefer GBC over SGB" and select Restart from Goomba.

BjornB2 commented 4 years ago

Ah yes the restarting did the trick! Awesome. Very happy with this! Thank you very much. Maybe publish this version next to the standard version?

BjornB2 commented 4 years ago

Ah I see now that actual GBC games are not working ("This game can only be played on Game Boy Color"). I think the GB mode in stead of prefer GBC is not needed. Only a default palette on grayscale and borders off would suffice I think. If I open a GB game, set it to prefer GBC and restart it is still in grayscale since the palette is also available in GBC (in the real thing by pressing dpad left and B while the game boy logo shows).

veikkos commented 4 years ago

Ah I see now that actual GBC games are not working ("This game can only be played on Game Boy Color"). I think the GB mode in stead of prefer GBC is not needed. Only a default palette on grayscale and borders off would suffice I think. If I open a GB game, set it to prefer GBC and restart it is still in grayscale since the palette is also available in GBC (in the real thing by pressing dpad left and B while the game boy logo shows).

Here is a version with GB mode reverted to "Prefer GBC over SGB".

k1.06_fw7-veikkos4-gb2.zip

Need to do some thinking if I could find a solution which I'd be willing to mainline.

BjornB2 commented 4 years ago

Thanks this works great now. I really appreciate your work!

I don't know if it is possible, but maybe a switch in the EZ flash settings tab for "GB mode" or something. Maybe just use 2 preconfigured goomba's and make this switch determine which one is used.

veikkos commented 4 years ago

Thanks 👍

I considered that but having two binaries would be bit too hacky and slightly painful to maintain. Also the Settings tab is already full (I could have used a spare setting already for the backup feature) so it would need scrolling or then another tab. Separate tab for custom kernel configuration could be nice thou.

I'll think about it.

thefaboss commented 4 years ago

Thanks a lot for your excellent and fast work !!! It works for me too for non Super GB games :)

I don't know if it's possible but, can you send to goomba 2 different profiles ? One for .gb files with GB mod only and one for .gbc files with prefer GBC mod.

Secondly, is it possible to extend game screen to fit GBA's screen verticaly (keeping aspect ratio of course) for gb and gbc games without sgb ?

Thanks again !

BjornB2 commented 4 years ago

You don't want to upscale it.. now it is displayed in native resolution afaik and if you make it a bit larger the pixels will get ugly. What does the GB mode do? For me all works fine in GBC mode. GB games still have the grayscale palette.

veikkos commented 4 years ago

What does the GB mode do? For me all works fine in GBC mode. GB games still have the grayscale palette.

GB mode makes the emulator to set CPU accumulator to different value at startup than what is is with CGB hardware. It allows the code in the cartridge to recognize that no CGB features are available in the HW. In case you try to play CGB-only game with such setup the cartridge can show that you cannot play it because you don't have CGB. Or in case the CGB-game supports black and white mode it then knows not to try to render colors.

In other words if you set GB mode e.g. Pokemon Gold/Yellow are rendered black and white and Mario Tennis won't start but says that you need CGB to play it.

veikkos commented 4 years ago

Thanks a lot for your excellent and fast work !!! It works for me too for non Super GB games :)

Thanks 👍

I don't know if it's possible but, can you send to goomba 2 different profiles ? One for .gb files with GB mod only and one for .gbc files with prefer GBC mod.

There is no profile/config sent to Goomba but it can only use the raw SRAM which is stored in the disk. SRAM holds the saves and partial config. But Goomba doesn't read the config at very early stage so it would need some refactoring to support that. The init is partially assembly which isn't the easiest thing to work with. Need to think about the options.

Secondly, is it possible to extend game screen to fit GBA's screen verticaly (keeping aspect ratio of course) for gb and gbc games without sgb ?

Thanks again !

Goomba author made it clear once that he ain't implementing it, so I guess there are good reasons why not to. 😃 As mentioned above it would make the image unsharp/skewed and I don't know if it's feasible performance wise. Probably not going to happen anyway.

thefaboss commented 4 years ago

Indeed, in game boy emulator on DS, fit screen option does deterior the image... So let's forgot that idea :/

@BjornB2: GBC mod still colorizes gb games which are compatible super game boy and sgb frame still appears too for those games. For example Donkey Kong, or Donkey Kong Land.

veikkos commented 4 years ago

I was looking into this a bit that why is the SGB border shown for some games despite disabling Auto Border but no breakthrough. Unfortunately the code is in assembly which is bit hard to understand. But I'm not completely given up with it yet. :)

veikkos commented 4 years ago

I added "Prefer GBC over GB" mode to Goomba as a default mode now [source]. It disables SGB completely. It fixes the borders appearing issue in games which don't support GBC but do support SGB. "Grayscale" palette is kept as a default one.

This way GB games appear black and white, CGB games have their colors as they should and neither of them have SGB borders.

What do you think?

k1.06_fw7-veikkos4-gb3.zip

BjornB2 commented 4 years ago

Ha awesome! I installed it right away and it seems to work as intended. Thanks!

veikkos commented 4 years ago

Thanks for testing! I'll test this for a while and see if there are any adjustments to do but I think this approach is good for mainline.

veikkos commented 4 years ago

Fix released in version 5. Thanks for the suggestion. Feel free to open follow-up suggestions/issues.