diff --git a/ares/ms/vdp/color.cpp b/ares/ms/vdp/color.cpp index d3175fd4aa..453bb69b9d 100644 --- a/ares/ms/vdp/color.cpp +++ b/ares/ms/vdp/color.cpp @@ -7,6 +7,12 @@ auto VDP::colorMasterSystem(n32 color) -> n64 { n64 g = image::normalize(G, 2, 16); n64 b = image::normalize(B, 2, 16); + //master system has non-linear blue output + if(colorEmulation->value()) { + u8 values[4] = {0, 104, 170, 255}; + b = image::normalize(values[B], 8, 16); + } + return r << 32 | g << 16 | b << 0; } diff --git a/ares/ms/vdp/vdp.cpp b/ares/ms/vdp/vdp.cpp index a803aa39e8..464e609ae5 100644 --- a/ares/ms/vdp/vdp.cpp +++ b/ares/ms/vdp/vdp.cpp @@ -36,6 +36,11 @@ auto VDP::load(Node::Object parent) -> void { if(value == 1) screen->setSize(256, 240); }); overscan->setDynamic(true); + + colorEmulation = screen->append("Color Emulation", true, [&](auto value) { + screen->resetPalette(); + }); + colorEmulation->setDynamic(true); } if(Display::LCD()) { diff --git a/ares/ms/vdp/vdp.hpp b/ares/ms/vdp/vdp.hpp index 3379d5d1fb..02e97cfe04 100644 --- a/ares/ms/vdp/vdp.hpp +++ b/ares/ms/vdp/vdp.hpp @@ -6,6 +6,7 @@ struct VDP : Thread { Node::Object node; Node::Video::Screen screen; Node::Setting::Boolean overscan; + Node::Setting::Boolean colorEmulation; Node::Setting::Natural revision; Node::Setting::Boolean interframeBlending; //Game Gear only Memory::Writable vram; //16KB