diff --git a/Assets/dll/bsnes.wbx.zst b/Assets/dll/bsnes.wbx.zst index e316f9fe09..aba33e4676 100644 Binary files a/Assets/dll/bsnes.wbx.zst and b/Assets/dll/bsnes.wbx.zst differ diff --git a/Assets/dll/snes9x.wbx.zst b/Assets/dll/snes9x.wbx.zst index 7325ac5b52..5860293fa5 100644 Binary files a/Assets/dll/snes9x.wbx.zst and b/Assets/dll/snes9x.wbx.zst differ diff --git a/waterbox/bsnescore/bsnes/sfc/controller/justifier/justifier.cpp b/waterbox/bsnescore/bsnes/sfc/controller/justifier/justifier.cpp index b8955a02d1..2f7567fa20 100644 --- a/waterbox/bsnescore/bsnes/sfc/controller/justifier/justifier.cpp +++ b/waterbox/bsnescore/bsnes/sfc/controller/justifier/justifier.cpp @@ -93,16 +93,16 @@ auto Justifier::latch() -> void { if(!active) { int nx = platform->inputPoll(port, device, 0 + X); int ny = platform->inputPoll(port, device, 0 + Y); - player1.x = max(-16, min(256 + 16, nx + player1.x)); - player1.y = max(-16, min((int)ppu.vdisp() + 16, ny + player1.y)); + player1.x = max(-16, min(256 + 16, nx)); + player1.y = max(-16, min((int)ppu.vdisp() + 16, ny)); bool offscreen = (player1.x < 0 || player1.y < 0 || player1.x >= 256 || player1.y >= (int)ppu.vdisp()); if(!offscreen) ppu.latchCounters(player1.x, player1.y); } else { int nx = platform->inputPoll(port, device, 4 + X); int ny = platform->inputPoll(port, device, 4 + Y); - player2.x = max(-16, min(256 + 16, nx + player2.x)); - player2.y = max(-16, min((int)ppu.vdisp() + 16, ny + player2.y)); + player2.x = max(-16, min(256 + 16, nx)); + player2.y = max(-16, min((int)ppu.vdisp() + 16, ny)); bool offscreen = (player2.x < 0 || player2.y < 0 || player2.x >= 256 || player2.y >= (int)ppu.vdisp()); if(!offscreen) ppu.latchCounters(player2.x, player2.y); } diff --git a/waterbox/bsnescore/bsnes/sfc/controller/super-scope/super-scope.cpp b/waterbox/bsnescore/bsnes/sfc/controller/super-scope/super-scope.cpp index 5b4455f51a..f232dcedf8 100644 --- a/waterbox/bsnescore/bsnes/sfc/controller/super-scope/super-scope.cpp +++ b/waterbox/bsnescore/bsnes/sfc/controller/super-scope/super-scope.cpp @@ -92,8 +92,8 @@ auto SuperScope::latch(bool data) -> void { auto SuperScope::latch() -> void { int nx = platform->inputPoll(port, ID::Device::SuperScope, X); int ny = platform->inputPoll(port, ID::Device::SuperScope, Y); - x = max(-16, min(256 + 16, nx + x)); - y = max(-16, min((int)ppu.vdisp() + 16, ny + y)); + x = max(-16, min(256 + 16, nx)); + y = max(-16, min((int)ppu.vdisp() + 16, ny)); offscreen = (x < 0 || y < 0 || x >= 256 || y >= (int)ppu.vdisp()); if(!offscreen) ppu.latchCounters(x, y); } diff --git a/waterbox/bsnescore/bsnes/sfc/interface/configuration.cpp b/waterbox/bsnescore/bsnes/sfc/interface/configuration.cpp index 769b8b0c48..cc6c62638b 100644 --- a/waterbox/bsnescore/bsnes/sfc/interface/configuration.cpp +++ b/waterbox/bsnescore/bsnes/sfc/interface/configuration.cpp @@ -16,6 +16,7 @@ auto Configuration::process(Markup::Node document, bool load) -> void { bind(boolean, "Video/BlurEmulation", video.blurEmulation); bind(boolean, "Video/ColorEmulation", video.colorEmulation); + bind(boolean, "Video/DrawCursor", video.drawCursor); bind(boolean, "Hacks/Hotfixes", hacks.hotfixes); bind(text, "Hacks/Entropy", hacks.entropy); diff --git a/waterbox/bsnescore/bsnes/sfc/interface/configuration.hpp b/waterbox/bsnescore/bsnes/sfc/interface/configuration.hpp index 5f4bd683c2..60b803cb0b 100644 --- a/waterbox/bsnescore/bsnes/sfc/interface/configuration.hpp +++ b/waterbox/bsnescore/bsnes/sfc/interface/configuration.hpp @@ -25,6 +25,7 @@ struct Configuration { struct Video { bool blurEmulation = true; bool colorEmulation = true; + bool drawCursor = true; } video; struct Hacks { diff --git a/waterbox/bsnescore/bsnes/sfc/ppu-fast/ppu.cpp b/waterbox/bsnescore/bsnes/sfc/ppu-fast/ppu.cpp index 75bd092587..70988286e4 100644 --- a/waterbox/bsnescore/bsnes/sfc/ppu-fast/ppu.cpp +++ b/waterbox/bsnescore/bsnes/sfc/ppu-fast/ppu.cpp @@ -166,7 +166,7 @@ auto PPU::refresh() -> void { } } - if(auto device = controllerPort2.device) device->draw(output, pitch * sizeof(uint16), width, height); + if(configuration.video.drawCursor) if(auto device = controllerPort2.device) device->draw(output, pitch * sizeof(uint16), width, height); platform->videoFrame(output, pitch * sizeof(uint16), width, height, hd() ? hdScale() : 1); frame.pitch = pitch; diff --git a/waterbox/bsnescore/bsnes/sfc/ppu/ppu.cpp b/waterbox/bsnescore/bsnes/sfc/ppu/ppu.cpp index 028457ee5e..0431f5e989 100644 --- a/waterbox/bsnescore/bsnes/sfc/ppu/ppu.cpp +++ b/waterbox/bsnescore/bsnes/sfc/ppu/ppu.cpp @@ -209,7 +209,7 @@ auto PPU::refresh() -> void { } } } - if(auto device = controllerPort2.device) device->draw(output, pitch * sizeof(uint16), width, height); + if(configuration.video.drawCursor) if(auto device = controllerPort2.device) device->draw(output, pitch * sizeof(uint16), width, height); platform->videoFrame(output, pitch * sizeof(uint16), width, height, /* scale = */ 1); } diff --git a/waterbox/bsnescore/bsnes/target-bsnescore/bsnescore.cpp b/waterbox/bsnescore/bsnes/target-bsnescore/bsnescore.cpp index dabd237e22..90fa74e757 100644 --- a/waterbox/bsnescore/bsnes/target-bsnescore/bsnescore.cpp +++ b/waterbox/bsnescore/bsnes/target-bsnescore/bsnescore.cpp @@ -291,6 +291,11 @@ EXPORT void snes_set_overscan_enabled(bool enabled) program->overscan = enabled; } +EXPORT void snes_set_cursor_enabled(bool enabled) +{ + emulator->configure("Video/DrawCursor", enabled); +} + uint8_t* snes_get_effective_saveram(int* ram_size) { if (cartridge.has.SA1) { diff --git a/waterbox/snes9x b/waterbox/snes9x index 172f73b711..1887cd2567 160000 --- a/waterbox/snes9x +++ b/waterbox/snes9x @@ -1 +1 @@ -Subproject commit 172f73b7111e50a58aa081fb2ad0fc55f911936f +Subproject commit 1887cd256785fc69646d417ca4956fe03e7c2a87