Added game hotfix for Rendering Ranger R2.
This commit is contained in:
byuu 2019-10-31 09:13:37 +09:00
parent f2978247c1
commit 1c1cfd086b
5 changed files with 18 additions and 10 deletions

View File

@ -29,7 +29,7 @@ using namespace nall;
namespace Emulator { namespace Emulator {
static const string Name = "bsnes"; 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 Author = "byuu";
static const string License = "GPLv3"; static const string License = "GPLv3";
static const string Website = "https://byuu.org"; static const string Website = "https://byuu.org";

View File

@ -14,9 +14,10 @@ auto SMP::idle() -> void {
} }
auto SMP::read(uint16 address) -> uint8 { auto SMP::read(uint16 address) -> uint8 {
wait(address); wait(address, 0);
uint8 data = readRAM(address); uint8 data = readRAM(address);
if((address & 0xfff0) == 0x00f0) data = readIO(address); if((address & 0xfff0) == 0x00f0) data = readIO(address);
//wait(address, 0);
return data; return data;
} }

View File

@ -90,8 +90,8 @@ private:
Timer<128> timer1; Timer<128> timer1;
Timer< 16> timer2; Timer< 16> timer2;
inline auto wait(maybe<uint16> address = nothing) -> void; inline auto wait(maybe<uint16> address = nothing, bool half = false) -> void;
inline auto waitIdle(maybe<uint16> address = nothing) -> void; inline auto waitIdle(maybe<uint16> address = nothing, bool half = false) -> void;
inline auto step(uint clocks) -> void; inline auto step(uint clocks) -> void;
inline auto stepIdle(uint clocks) -> void; inline auto stepIdle(uint clocks) -> void;
inline auto stepTimers(uint clocks) -> void; inline auto stepTimers(uint clocks) -> void;

View File

@ -6,7 +6,7 @@
//sometimes the SMP will run far slower than expected //sometimes the SMP will run far slower than expected
//other times (and more likely), the SMP will deadlock until the system is reset //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 //the timers are not affected by this and advance by their expected values
auto SMP::wait(maybe<uint16> addr) -> void { auto SMP::wait(maybe<uint16> addr, bool half) -> void {
static const uint cycleWaitStates[4] = {2, 4, 10, 20}; static const uint cycleWaitStates[4] = {2, 4, 10, 20};
static const uint timerWaitStates[4] = {2, 4, 8, 16}; static const uint timerWaitStates[4] = {2, 4, 8, 16};
@ -15,11 +15,11 @@ auto SMP::wait(maybe<uint16> addr) -> void {
else if((*addr & 0xfff0) == 0x00f0) waitStates = io.internalWaitStates; //IO registers else if((*addr & 0xfff0) == 0x00f0) waitStates = io.internalWaitStates; //IO registers
else if(*addr >= 0xffc0 && io.iplromEnable) waitStates = io.internalWaitStates; //IPLROM else if(*addr >= 0xffc0 && io.iplromEnable) waitStates = io.internalWaitStates; //IPLROM
step(cycleWaitStates[waitStates]); step(cycleWaitStates[waitStates] >> half);
stepTimers(timerWaitStates[waitStates]); stepTimers(timerWaitStates[waitStates] >> half);
} }
auto SMP::waitIdle(maybe<uint16> addr) -> void { auto SMP::waitIdle(maybe<uint16> addr, bool half) -> void {
static const uint cycleWaitStates[4] = {2, 4, 10, 20}; static const uint cycleWaitStates[4] = {2, 4, 10, 20};
static const uint timerWaitStates[4] = {2, 4, 8, 16}; static const uint timerWaitStates[4] = {2, 4, 8, 16};
@ -28,8 +28,8 @@ auto SMP::waitIdle(maybe<uint16> addr) -> void {
else if((*addr & 0xfff0) == 0x00f0) waitStates = io.internalWaitStates; //IO registers else if((*addr & 0xfff0) == 0x00f0) waitStates = io.internalWaitStates; //IO registers
else if(*addr >= 0xffc0 && io.iplromEnable) waitStates = io.internalWaitStates; //IPLROM else if(*addr >= 0xffc0 && io.iplromEnable) waitStates = io.internalWaitStates; //IPLROM
stepIdle(cycleWaitStates[waitStates]); stepIdle(cycleWaitStates[waitStates] >> half);
stepTimers(timerWaitStates[waitStates]); stepTimers(timerWaitStates[waitStates] >> half);
} }
auto SMP::step(uint clocks) -> void { auto SMP::step(uint clocks) -> void {

View File

@ -126,6 +126,13 @@ auto System::load(Emulator::Interface* interface) -> bool {
information.cpuFrequency = Emulator::Constants::Colorburst::PAL * 4.8; 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(cartridge.has.ICD) {
if(!icd.load()) return false; if(!icd.load()) return false;
} }