From 29caf777510d73d1aacd921b117d6bdbfc2a849b Mon Sep 17 00:00:00 2001 From: byuu <2107894+byuu@users.noreply.github.com> Date: Tue, 10 Sep 2019 22:32:33 +0900 Subject: [PATCH] v109.2 Fixed alt-key menu activation on Windows. Removed 2160p HD mode 7 due to Direct3D limit of 2048x2048 textures. Reverted to safe ruby drivers when no configuration file is present. Removed ASIO driver because nobody is interested in improving it. Added macOS libretro target [rtretiakov] --- bsnes/emulator/emulator.hpp | 2 +- .../presentation/presentation.cpp | 4 ++-- bsnes/target-bsnes/settings/enhancements.cpp | 3 +-- bsnes/target-bsnes/settings/settings.cpp | 6 ++--- bsnes/target-libretro/GNUmakefile | 4 +++- bsnes/target-libretro/program.cpp | 23 +++++++++++++++++++ ruby/GNUmakefile | 2 +- 7 files changed, 34 insertions(+), 10 deletions(-) diff --git a/bsnes/emulator/emulator.hpp b/bsnes/emulator/emulator.hpp index e1474fbb..d57c21d5 100644 --- a/bsnes/emulator/emulator.hpp +++ b/bsnes/emulator/emulator.hpp @@ -29,7 +29,7 @@ using namespace nall; namespace Emulator { static const string Name = "bsnes"; - static const string Version = "109.1"; + static const string Version = "109.2"; static const string Author = "byuu"; static const string License = "GPLv3"; static const string Website = "https://byuu.org"; diff --git a/bsnes/target-bsnes/presentation/presentation.cpp b/bsnes/target-bsnes/presentation/presentation.cpp index 4fcd6d41..5b426142 100644 --- a/bsnes/target-bsnes/presentation/presentation.cpp +++ b/bsnes/target-bsnes/presentation/presentation.cpp @@ -206,8 +206,8 @@ auto Presentation::create() -> void { .show(); }); - viewport.setFocusable(); - viewport.setDroppable(); + viewport.setFocusable(false); //true would also capture Alt, which breaks keyboard menu navigation + viewport.setDroppable(true); viewport.onDrop([&](vector locations) { if(!locations) return; program.gameQueue = {}; diff --git a/bsnes/target-bsnes/settings/enhancements.cpp b/bsnes/target-bsnes/settings/enhancements.cpp index e34016b0..7904c834 100644 --- a/bsnes/target-bsnes/settings/enhancements.cpp +++ b/bsnes/target-bsnes/settings/enhancements.cpp @@ -62,8 +62,7 @@ auto EnhancementSettings::create() -> void { mode7Scale.append(ComboButtonItem().setText("1440p").setProperty("multiplier", 6)); mode7Scale.append(ComboButtonItem().setText("1680p").setProperty("multiplier", 7)); mode7Scale.append(ComboButtonItem().setText("1920p").setProperty("multiplier", 8)); - mode7Scale.append(ComboButtonItem().setText("2160p").setProperty("multiplier", 9)); - for(uint n = 1; n <= 9; n++) { + for(uint n = 1; n <= 8; n++) { if(settings.emulator.hack.ppu.mode7.scale == n) mode7Scale.item(n - 1).setSelected(); } mode7Scale.onChange([&] { diff --git a/bsnes/target-bsnes/settings/settings.cpp b/bsnes/target-bsnes/settings/settings.cpp index e7651505..f5bfda84 100644 --- a/bsnes/target-bsnes/settings/settings.cpp +++ b/bsnes/target-bsnes/settings/settings.cpp @@ -35,9 +35,9 @@ auto Settings::save() -> void { auto Settings::process(bool load) -> void { if(load) { //initialize non-static default settings - video.driver = ruby::Video::optimalDriver(); - audio.driver = ruby::Audio::optimalDriver(); - input.driver = ruby::Input::optimalDriver(); + video.driver = ruby::Video::safestDriver(); + audio.driver = ruby::Audio::safestDriver(); + input.driver = ruby::Input::safestDriver(); } #define bind(type, path, name) \ diff --git a/bsnes/target-libretro/GNUmakefile b/bsnes/target-libretro/GNUmakefile index 0d8b707c..4c4cf7fb 100644 --- a/bsnes/target-libretro/GNUmakefile +++ b/bsnes/target-libretro/GNUmakefile @@ -1,5 +1,5 @@ name := libretro.so -flags += -std=c++17 -fpermissive -Wno-narrowing -Wno-multichar -fopenmp -g -fPIC +flags += -Wno-narrowing -Wno-multichar -fopenmp -g -fPIC objects := libretro $(objects) objects := $(patsubst %,obj/%.o,$(objects)) @@ -11,4 +11,6 @@ ifeq ($(platform),linux) $(strip $(compiler) -o out/bsnes_libretro.so -shared $(objects) -Wl,--no-undefined -Wl,--version-script=target-libretro/link.T -Wl,-Bdynamic -lpthread -ldl -lgomp) else ifeq ($(platform),windows) $(strip $(compiler) -o out/bsnes_libretro.dll -shared $(objects) -Wl,--no-undefined -Wl,--version-script=target-libretro/link.T -static-libgcc -static-libstdc++ -Wl,-Bstatic -lws2_32 -lpthread -lgomp -Wl,-Bdynamic) +else ifeq ($(platform),macos) + $(strip $(compiler) -o out/bsnes_libretro.dylib -shared $(objects) -lpthread -ldl) endif diff --git a/bsnes/target-libretro/program.cpp b/bsnes/target-libretro/program.cpp index 8ad4a067..c07365c7 100644 --- a/bsnes/target-libretro/program.cpp +++ b/bsnes/target-libretro/program.cpp @@ -123,6 +123,29 @@ auto Program::open(uint id, string name, vfs::file::mode mode, bool required) -> auto Program::load() -> void { emulator->unload(); emulator->load(); + + // per-game hack overrides + auto title = superFamicom.title; + auto region = superFamicom.region; + + //relies on mid-scanline rendering techniques + if(title == "AIR STRIKE PATROL" || title == "DESERT FIGHTER") emulator->configure("Hacks/PPU/Fast", false); + + //stage 2 uses pseudo-hires in a way that's not compatible with the scanline-based renderer + if(title == "SFC クレヨンシンチャン") emulator->configure("Hacks/PPU/Fast", false); + + //relies on cycle-accurate writes to the echo buffer + if(title == "KOUSHIEN_2") emulator->configure("Hacks/DSP/Fast", false); + + //will hang immediately + if(title == "RENDERING RANGER R2") emulator->configure("Hacks/DSP/Fast", false); + + //will hang sometimes in the "Bach in Time" stage + if(title == "BUBSY II" && region == "PAL") emulator->configure("Hacks/DSP/Fast", false); + + //fixes an errant scanline on the title screen due to writing to PPU registers too late + if(title == "ADVENTURES OF FRANKEN" && region == "PAL") emulator->configure("Hacks/PPU/RenderCycle", 32); + emulator->power(); } diff --git a/ruby/GNUmakefile b/ruby/GNUmakefile index eaafbdac..e422014a 100755 --- a/ruby/GNUmakefile +++ b/ruby/GNUmakefile @@ -1,7 +1,7 @@ ifeq ($(ruby),) ifeq ($(platform),windows) ruby += video.wgl video.direct3d video.directdraw video.gdi - ruby += audio.asio audio.wasapi audio.xaudio2 audio.directsound audio.waveout + ruby += audio.wasapi audio.xaudio2 audio.directsound audio.waveout #audio.alsa ruby += input.windows else ifeq ($(platform),macos) ruby += video.cgl