diff --git a/bsnes/emulator/emulator.hpp b/bsnes/emulator/emulator.hpp index 474c761e..3379e0fa 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 = "112.4"; + static const string Version = "112.5"; static const string Author = "byuu"; static const string License = "GPLv3"; static const string Website = "https://byuu.org"; diff --git a/bsnes/sfc/smp/memory.cpp b/bsnes/sfc/smp/memory.cpp index 1ed03bb1..8a39c74b 100644 --- a/bsnes/sfc/smp/memory.cpp +++ b/bsnes/sfc/smp/memory.cpp @@ -14,9 +14,10 @@ auto SMP::idle() -> void { } auto SMP::read(uint16 address) -> uint8 { - wait(address); + wait(address, 0); uint8 data = readRAM(address); if((address & 0xfff0) == 0x00f0) data = readIO(address); +//wait(address, 0); return data; } diff --git a/bsnes/sfc/smp/smp.hpp b/bsnes/sfc/smp/smp.hpp index b23bfaae..4b13dc6a 100644 --- a/bsnes/sfc/smp/smp.hpp +++ b/bsnes/sfc/smp/smp.hpp @@ -90,8 +90,8 @@ private: Timer<128> timer1; Timer< 16> timer2; - inline auto wait(maybe address = nothing) -> void; - inline auto waitIdle(maybe address = nothing) -> void; + inline auto wait(maybe address = nothing, bool half = false) -> void; + inline auto waitIdle(maybe address = nothing, bool half = false) -> void; inline auto step(uint clocks) -> void; inline auto stepIdle(uint clocks) -> void; inline auto stepTimers(uint clocks) -> void; diff --git a/bsnes/sfc/smp/timing.cpp b/bsnes/sfc/smp/timing.cpp index 00b4f296..0b8c35e5 100644 --- a/bsnes/sfc/smp/timing.cpp +++ b/bsnes/sfc/smp/timing.cpp @@ -6,7 +6,7 @@ //sometimes the SMP will run far slower than expected //other times (and more likely), the SMP will deadlock until the system is reset //the timers are not affected by this and advance by their expected values -auto SMP::wait(maybe addr) -> void { +auto SMP::wait(maybe addr, bool half) -> void { static const uint cycleWaitStates[4] = {2, 4, 10, 20}; static const uint timerWaitStates[4] = {2, 4, 8, 16}; @@ -15,11 +15,11 @@ auto SMP::wait(maybe addr) -> void { else if((*addr & 0xfff0) == 0x00f0) waitStates = io.internalWaitStates; //IO registers else if(*addr >= 0xffc0 && io.iplromEnable) waitStates = io.internalWaitStates; //IPLROM - step(cycleWaitStates[waitStates]); - stepTimers(timerWaitStates[waitStates]); + step(cycleWaitStates[waitStates] >> half); + stepTimers(timerWaitStates[waitStates] >> half); } -auto SMP::waitIdle(maybe addr) -> void { +auto SMP::waitIdle(maybe addr, bool half) -> void { static const uint cycleWaitStates[4] = {2, 4, 10, 20}; static const uint timerWaitStates[4] = {2, 4, 8, 16}; @@ -28,8 +28,8 @@ auto SMP::waitIdle(maybe addr) -> void { else if((*addr & 0xfff0) == 0x00f0) waitStates = io.internalWaitStates; //IO registers else if(*addr >= 0xffc0 && io.iplromEnable) waitStates = io.internalWaitStates; //IPLROM - stepIdle(cycleWaitStates[waitStates]); - stepTimers(timerWaitStates[waitStates]); + stepIdle(cycleWaitStates[waitStates] >> half); + stepTimers(timerWaitStates[waitStates] >> half); } auto SMP::step(uint clocks) -> void { diff --git a/bsnes/sfc/system/system.cpp b/bsnes/sfc/system/system.cpp index f6bcad51..27897f50 100644 --- a/bsnes/sfc/system/system.cpp +++ b/bsnes/sfc/system/system.cpp @@ -126,6 +126,13 @@ auto System::load(Emulator::Interface* interface) -> bool { information.cpuFrequency = Emulator::Constants::Colorburst::PAL * 4.8; } + if(configuration.hacks.hotfixes) { + //due to poor programming, Rendering Ranger R2 will rarely lock up at 32040 * 768hz. + if(cartridge.headerTitle() == "RENDERING RANGER R2") { + information.apuFrequency = 32000.0 * 768.0; + } + } + if(cartridge.has.ICD) { if(!icd.load()) return false; }