Movies: Fixed issue with disable PPU reset option
This commit is contained in:
parent
0c1bb49402
commit
bcdc2522d3
6 changed files with 5 additions and 26 deletions
|
@ -238,7 +238,7 @@ uint16_t CPU::FetchOperand()
|
|||
|
||||
if(NsfMapper::GetInstance()) {
|
||||
//Don't stop emulation on CPU crash when playing NSFs, reset cpu instead
|
||||
Console::RequestReset();
|
||||
Console::Reset(true);
|
||||
return 0;
|
||||
} else {
|
||||
throw std::runtime_error("Invalid OP code - CPU crashed");
|
||||
|
|
|
@ -43,7 +43,6 @@ shared_ptr<Console> Console::Instance(new Console());
|
|||
|
||||
Console::Console()
|
||||
{
|
||||
_resetRequested = false;
|
||||
}
|
||||
|
||||
Console::~Console()
|
||||
|
@ -324,12 +323,7 @@ void Console::Reset(bool softReset)
|
|||
{
|
||||
if(Instance->_initialized) {
|
||||
if(softReset) {
|
||||
if(EmulationSettings::CheckFlag(EmulationFlags::DisablePpuReset)) {
|
||||
//Allow mid-frame resets to allow the PPU to get out-of-sync
|
||||
RequestReset();
|
||||
} else {
|
||||
Instance->_systemActionManager->Reset();
|
||||
}
|
||||
Instance->_systemActionManager->Reset();
|
||||
} else {
|
||||
Instance->_systemActionManager->PowerCycle();
|
||||
}
|
||||
|
@ -427,14 +421,6 @@ void Console::Run()
|
|||
while(true) {
|
||||
_cpu->Exec();
|
||||
|
||||
if(_resetRequested) {
|
||||
//Used by NSF player to reset console after changing track
|
||||
//Also used with DisablePpuReset option to reset mid-frame
|
||||
MovieManager::Stop();
|
||||
ResetComponents(true);
|
||||
_resetRequested = false;
|
||||
}
|
||||
|
||||
uint32_t currentFrameNumber = PPU::GetFrameCount();
|
||||
if(currentFrameNumber != lastFrameNumber) {
|
||||
_rewindManager->ProcessEndOfFrame();
|
||||
|
@ -685,11 +671,6 @@ void Console::StopDebugger()
|
|||
_debugger.reset();
|
||||
}
|
||||
|
||||
void Console::RequestReset()
|
||||
{
|
||||
Instance->_resetRequested = true;
|
||||
}
|
||||
|
||||
std::thread::id Console::GetEmulationThreadId()
|
||||
{
|
||||
return Instance->_emulationThreadId;
|
||||
|
|
|
@ -58,8 +58,6 @@ class Console
|
|||
|
||||
bool _disableOcNextFrame = false;
|
||||
|
||||
atomic<bool> _resetRequested;
|
||||
|
||||
bool _initialized = false;
|
||||
std::thread::id _emulationThreadId;
|
||||
|
||||
|
@ -95,7 +93,6 @@ class Console
|
|||
|
||||
static std::thread::id GetEmulationThreadId();
|
||||
|
||||
static void RequestReset();
|
||||
static void Reset(bool softReset = true);
|
||||
void PowerCycle();
|
||||
void ResetComponents(bool softReset);
|
||||
|
|
|
@ -407,7 +407,7 @@ int LuaApi::Reset(lua_State *lua)
|
|||
{
|
||||
LuaCallHelper l(lua);
|
||||
checkparams();
|
||||
Console::RequestReset();
|
||||
Console::Reset(true);
|
||||
return l.ReturnCount();
|
||||
}
|
||||
|
||||
|
|
|
@ -232,6 +232,7 @@ void MesenMovie::ApplySettings()
|
|||
EmulationSettings::SetFlagState(EmulationFlags::DisableOamAddrBug, LoadBool(_settings, MovieKeys::DisableOamAddrBug));
|
||||
EmulationSettings::SetFlagState(EmulationFlags::UseNes101Hvc101Behavior, LoadBool(_settings, MovieKeys::UseNes101Hvc101Behavior));
|
||||
EmulationSettings::SetFlagState(EmulationFlags::EnableOamDecay, LoadBool(_settings, MovieKeys::EnableOamDecay));
|
||||
EmulationSettings::SetFlagState(EmulationFlags::DisablePpuReset, LoadBool(_settings, MovieKeys::DisablePpuReset));
|
||||
|
||||
//VS System flags
|
||||
EmulationSettings::SetPpuModel(FromString(LoadString(_settings, MovieKeys::PpuModel), PpuModelNames, PpuModel::Ppu2C02));
|
||||
|
|
|
@ -402,7 +402,7 @@ void NsfMapper::InternalSelectTrack(uint8_t trackNumber, bool requestReset)
|
|||
//Need to change track while running
|
||||
//Some NSFs keep the interrupt flag on at all times, preventing us from triggering an IRQ to change tracks
|
||||
//Forcing the console to reset ensures changing tracks always works, even with a bad NSF file
|
||||
Console::RequestReset();
|
||||
Console::Reset(true);
|
||||
} else {
|
||||
//Selecting tracking after a reset
|
||||
SoundMixer::SetFadeRatio(1.0);
|
||||
|
|
Loading…
Add table
Reference in a new issue