zeta0134 / LuaGB

A gameboy emulator written in pure Lua. Work in progress.
BSD 3-Clause "New" or "Revised" License
410 stars 33 forks source link

LCD / Gamma Color Correction #22

Open zeta0134 opened 5 years ago

zeta0134 commented 5 years ago

The default DMG palettes give us a way to mimic the washed out green of the original gameboy, but Gameboy Color games are much less accurate. LuaGB's colors would charitably be described as "VGA Poppy Bright" and while this can look cheery and colorful for some games, it doesn't at all match what a real Gameboy Color would do.

It should be straightforward to run GBC colors through a conversion when the game writes to the palette registers, which should keep things performant. One of the better color correction strategies can be found in libretro, the result of Pokefan531's research: https://github.com/libretro/gambatte-libretro/blob/5ee8b1e9da0835be8e526e9e4ff73346eef20fd1/libgambatte/src/video_libretro.cpp#L195

I'd like to implement this as a user-configurable option. It might also be neat to research other color correction strategies, since the various Gameboy Advance models have different characteristics and those can (mostly) play GBC games.