{"id":46791,"date":"2018-10-25T06:51:36","date_gmt":"2018-10-25T06:51:36","guid":{"rendered":"https:\/\/www.libretro.com\/?p=46791"},"modified":"2019-02-24T20:02:18","modified_gmt":"2019-02-24T20:02:18","slug":"gambatte-progress-report","status":"publish","type":"post","link":"https:\/\/www.libretro.com\/index.php\/gambatte-progress-report\/","title":{"rendered":"Gambatte Progress Report"},"content":{"rendered":"<p>Written by J.D. G. Leaver<\/p>\n<h1>Gambatte Updates<\/h1>\n<h2>Palette Additions<\/h2>\n<p>The Gambatte core has long been able to colourise greyscale Game Boy games using the default built-in palettes of the Game Boy Color:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/gbc_palettes-1024x851.png\" alt=\"\" width=\"750\" height=\"623\" class=\"aligncenter size-large wp-image-46803\" srcset=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/gbc_palettes-1024x851.png 1024w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/gbc_palettes-300x249.png 300w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/gbc_palettes-768x638.png 768w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/p>\n<p>Thanks to the assimilation of original work by [TRIFORCE89](https:\/\/github.com\/TRIFORCE89\/Gambatte-Core), we now also have access to the 32 default palettes of the Super Game Boy:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/sgb_palettes-464x1024.png\" alt=\"\" width=\"464\" height=\"1024\" class=\"aligncenter size-large wp-image-46802\" srcset=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/sgb_palettes-464x1024.png 464w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/sgb_palettes-136x300.png 136w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/sgb_palettes-768x1695.png 768w\" sizes=\"(max-width: 464px) 100vw, 464px\" \/><\/p>\n<p>To complete the set, three additional palettes have been created to simulate the display characteristics of the various Game Boy hardware revisions: DMG, Pocket and Light. You want pea soup green? You got it!<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/gb_palettes-1024x358.png\" alt=\"\" width=\"750\" height=\"262\" class=\"aligncenter size-large wp-image-46805\" srcset=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/gb_palettes-1024x358.png 1024w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/gb_palettes-300x105.png 300w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/gb_palettes-768x268.png 768w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/gb_palettes.png 1827w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/p>\n<p>All available palettes may be cycled via the usual &#8216;Internal Palette&#8217; core option. Better still, the automatic Game Boy colorisation setting has been updated to automagically select the &#8216;best&#8217; (most colourful\/appropriate) palette for each game, using an internal database with the following order of preference:<\/p>\n<p>1. Game-specific Super Game Boy palette, if defined and more colorful than game-specific Game Boy Color palette.<\/p>\n<p>2. Game-specific Game Boy Color palette, if defined.<\/p>\n<p>3. Game-specific Super Game Boy palette, if defined.<\/p>\n<p>4. Palette specified by &#8216;Internal Palette&#8217; core option.<\/p>\n<p>(Of course, automatic selection may be overridden to force the use of either Game Boy Color or Super Game Boy palettes, or any specific palette that is desired)<\/p>\n<h2>Colour Correction Improvements<\/h2>\n<p>Game Boy Color games are designed to be viewed on a dim, low contrast LCD panel. Transfer these games to a modern high quality display and a proliferation of over-saturated colours will assault your eyeballs.<\/p>\n<p>The Gambatte core has a long standing &#8216;Color correction&#8217; option which tries to improve the generated image. This works after a fashion, but it tends to make everything too dark and has some unpleasant colour mangling side effects (e.g. it give Pikachu an orange perma-tan). Fortunately, the mighty Pokefan531 (<a href=\"https:\/\/forums.libretro.com\/t\/real-gba-and-ds-phat-colors\/1540\/159\">https:\/\/forums.libretro.com\/t\/real-gba-and-ds-phat-colors\/1540\/159<\/a>) provides a much better solution via an external gbc-color shader (<a href=\"https:\/\/github.com\/libretro\/glsl-shaders\/blob\/master\/handheld\/gbc-color.glslp\">https:\/\/github.com\/libretro\/glsl-shaders\/blob\/master\/handheld\/gbc-color.glslp<\/a>). Now this same functionality has been added to the core itself.<\/p>\n<p>Setting the new &#8216;Color correction mode&#8217; core option to &#8216;accurate&#8217; enables the Pokefan531 &#8216;gold standard&#8217; colour correction method. The old Gambatte default can still be used by setting the mode to &#8216;fast&#8217; (this slightly reduces CPU load and so may be useful on garbage-tier hardware &#8211; although the &#8216;accurate&#8217; method is confirmed to run at full speed even on an o3DS). Here are some screenshots showing the difference in output image quality:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/colour_correction-799x1024.png\" alt=\"\" width=\"750\" height=\"961\" class=\"aligncenter size-large wp-image-46796\" srcset=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/colour_correction-799x1024.png 799w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/colour_correction-234x300.png 234w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/colour_correction-768x984.png 768w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/colour_correction.png 1827w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/p>\n<p>Care has also been taken to ensure that colour correction is only applied when appropriate. The new Super Game Boy and hardware-mimicking GB DMG\/Pocket\/Light palettes are intended for display on a standard television, *not* on a Game Boy Color LCD panel, and attempting to &#8216;correct&#8217; them is a mistake. The &#8216;Color correction&#8217; core option is therefore no longer a simple toggle: it may now be set to &#8216;GBC only&#8217;, which disables correction unless explicitly running a Game Boy Color game or using a Game Boy Color palette. (Of course, if you *want* broken Super Game Boy palettes, you can change the setting to &#8216;always&#8217;&#8230;)<\/p>\n<p>These updates, along with the improvements to automatic colourisation, should make the core much easier to work with. Instead of generating core\/shader overrides to deal with some games running in colour, and some not, you can now essentially set the following:<\/p>\n<p>&#8211; GB Colorization: auto<\/p>\n<p>&#8211; Internal Palette: GB &#8211; DMG\/Pocket (or whatever)<\/p>\n<p>&#8211; Color correction: GBC only<\/p>\n<p>&#8211; Color correction mode: accurate<\/p>\n<p>&#8211; Emulated hardware (restart): Auto<\/p>\n<p>&#8230;and pretty much every game will look correct.<\/p>\n<h2>Dark Filter (a.k.a. Eye Saver Mode)<\/h2>\n<p>In addition to having over-saturated colours, it is not uncommon for games targeting early non-backlit handheld systems to make use of white backgrounds. While these look fine on original hardware, they are simply too bright when viewed on a modern backlit display. Staring at a strong blue-spectrum backlight is a recognised cause of asthenopic symptoms. These games are a health hazard!<\/p>\n<p>On most platforms, this can be mitigated easily and effectively by the use of an appropriate LCD shader. Indeed, the simpletex_lcd shader (<a href=\"https:\/\/github.com\/libretro\/glsl-shaders\/blob\/master\/handheld\/simpletex_lcd.glslp\">https:\/\/github.com\/libretro\/glsl-shaders\/blob\/master\/handheld\/simpletex_lcd.glslp<\/a>) was written for this express purpose:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/simpletex_lcd-1024x922.png\" alt=\"\" width=\"750\" height=\"675\" class=\"aligncenter size-large wp-image-46798\" srcset=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/simpletex_lcd-1024x922.png 1024w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/simpletex_lcd-300x270.png 300w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/simpletex_lcd-768x691.png 768w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/simpletex_lcd.png 1120w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/p>\n<p>Unfortunately, shaders are not always an option: weak hardware may not be able to run them at full speed, and devices like the 3DS have no shader support whatsoever&#8230;<\/p>\n<p>A more inclusive solution has therefore been added to the Gambatte core in the form of an adjustable &#8216;dark filter&#8217;. This is somewhat analogous to the filtering used in Nintendo Virtual Console titles, only less awful. Instead of a uniform brightness reduction, the &#8216;darkening&#8217; is roughly proportional to pixel luminosity; this gets rid of harsh glare without (completely) butchering image quality.<\/p>\n<p>The filter may be enabled by setting the new &#8216;Dark Filter Level&#8217; core option from 5-50%. Here are some screenshots showing the effect at 30%:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/dark_filter-445x1024.png\" alt=\"\" width=\"445\" height=\"1024\" class=\"aligncenter size-large wp-image-46800\" srcset=\"https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/dark_filter-445x1024.png 445w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/dark_filter-130x300.png 130w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/dark_filter-768x1768.png 768w, https:\/\/www.libretro.com\/wp-content\/uploads\/2018\/10\/dark_filter.png 1247w\" sizes=\"(max-width: 445px) 100vw, 445px\" \/><\/p>\n<p>Give it a try &#8211; your eyes will thank you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Written by J.D. G. Leaver Gambatte Updates Palette Additions The Gambatte core has long been able to colourise greyscale Game Boy games using the default built-in palettes of the Game Boy Color: Thanks to the assimilation of original work by [TRIFORCE89](https:\/\/github.com\/TRIFORCE89\/Gambatte-Core), we now also have access to the 32 default palettes of the Super Game [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[28,221,179,2,5],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts\/46791"}],"collection":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/comments?post=46791"}],"version-history":[{"count":10,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts\/46791\/revisions"}],"predecessor-version":[{"id":46807,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts\/46791\/revisions\/46807"}],"wp:attachment":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/media?parent=46791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/categories?post=46791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/tags?post=46791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}