Skip to content
Permalink
Browse files

hacks: force ntsc option

  • Loading branch information
JaCzekanski committed Sep 5, 2019
1 parent eeccbfa commit 1a4bc86e3a27145f572739fce3773950d2795164
Showing with 34 additions and 9 deletions.
  1. +2 −1 src/config.cpp
  2. +2 −1 src/device/gpu/gpu.cpp
  3. +1 −0 src/device/gpu/gpu.h
  4. +29 −7 src/platform/windows/gui/options.cpp
@@ -159,7 +159,8 @@ const json defaultConfig = {
{"width", 640u},
{"height", 480u}
}},
{"vsync", false}
{"vsync", false},
{"forceNtsc", false},
}}
}},
{"debug", {
@@ -17,6 +17,7 @@ GPU::GPU() {
GPU::~GPU() { bus.unlistenAll(busToken); }

void GPU::reload() {
forceNtsc = config["options"]["graphics"]["forceNtsc"];
auto mode = config["options"]["graphics"]["rendering_mode"].get<RenderingMode>();
softwareRendering = (mode & RenderingMode::SOFTWARE) != 0;
hardwareRendering = (mode & RenderingMode::HARDWARE) != 0;
@@ -746,7 +747,7 @@ bool GPU::insideDrawingArea(int x, int y) const {
&& (y < VRAM_HEIGHT);
}

bool GPU::isNtsc() { return gp1_08.videoMode == GP1_08::VideoMode::ntsc; }
bool GPU::isNtsc() { return forceNtsc || gp1_08.videoMode == GP1_08::VideoMode::ntsc; }

void GPU::dumpVram() {
std::vector<uint8_t> vram;
@@ -92,6 +92,7 @@ class GPU {
// Hardware rendering
std::vector<Vertex> vertices;

bool forceNtsc;
bool softwareRendering;
bool hardwareRendering;

@@ -120,20 +120,42 @@ void graphicsOptionsWindow() {
bus.notify(Event::Config::Gte{});
}

bool vsync = config["options"]["graphics"]["vsync"];
if (ImGui::Checkbox("VSync", &vsync)) {
config["options"]["graphics"]["vsync"] = vsync;
bus.notify(Event::Config::Graphics{});
}

ImGui::Separator();
ImGui::Text("Hacks");

bool forceNtsc = config["options"]["graphics"]["forceNtsc"];
if (ImGui::Checkbox("Force NTSC", &forceNtsc)) {
config["options"]["graphics"]["forceNtsc"] = forceNtsc;
bus.notify(Event::Config::Graphics{});
}

ImGui::SameLine();
ImGui::TextDisabled("(?)");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
ImGui::TextUnformatted(
"Force 60Hz mode for PAL games (50Hz)\n"
"Since some PAL games are slowed down versions of NTSC equivalent,\n"
"this option might be useful to bring back such titles to the original speed.");
ImGui::PopTextWrapPos();
ImGui::EndTooltip();
}

if (widescreen) {
bool forceWidescreen = config["options"]["graphics"]["forceWidescreen"];
if (ImGui::Checkbox("Force widescreen in 3d (hack)", &forceWidescreen)) {
if (ImGui::Checkbox("Force widescreen in 3d", &forceWidescreen)) {
config["options"]["graphics"]["forceWidescreen"] = forceWidescreen;
bus.notify(Event::Config::Gte{});
}
}

bool vsync = config["options"]["graphics"]["vsync"];
if (ImGui::Checkbox("VSync", &vsync)) {
config["options"]["graphics"]["vsync"] = vsync;
bus.notify(Event::Config::Graphics{});
}

ImGui::End();
}

0 comments on commit 1a4bc86

Please sign in to comment.
You can’t perform that action at this time.