mirror of
https://github.com/SourMesen/Mesen2.git
synced 2024-06-15 18:57:57 -04:00
NES: Fixed loading NES roms (+ improved behavior/error message display when this happens)
This commit is contained in:
parent
051dfadd76
commit
a5fa24a32e
|
@ -53,7 +53,7 @@ void EmuSettings::Serialize(Serializer& s)
|
|||
SV(_nes.DisableOamAddrBug); SV(_nes.DisablePaletteRead); SV(_nes.DisablePpu2004Reads);
|
||||
SV(_nes.DisableGameGenieBusConflicts); SV(_nes.DisablePpuReset); SV(_nes.EnableOamDecay);
|
||||
SV(_nes.EnablePpu2000ScrollGlitch); SV(_nes.EnablePpu2006ScrollGlitch); SV(_nes.EnablePpuOamRowCorruption);
|
||||
SV(_nes.RestrictPpuAccessOnFirstFrame); SV(_nes.DisableGameGenieBusConflicts);
|
||||
SV(_nes.RestrictPpuAccessOnFirstFrame);
|
||||
SV(_nes.PpuExtraScanlinesAfterNmi); SV(_nes.PpuExtraScanlinesBeforeNmi);
|
||||
SV(_nes.Region);
|
||||
SV(_nes.LightDetectionRadius);
|
||||
|
|
|
@ -346,6 +346,20 @@ void Emulator::PowerCycle()
|
|||
}
|
||||
|
||||
bool Emulator::LoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom, bool forPowerCycle)
|
||||
{
|
||||
try {
|
||||
return InternalLoadRom(romFile, patchFile, stopRom, forPowerCycle);
|
||||
} catch(std::exception& ex) {
|
||||
_videoDecoder->StartThread();
|
||||
_videoRenderer->StartThread();
|
||||
|
||||
MessageManager::DisplayMessage("Error", "UnexpectedError", ex.what());
|
||||
Stop(false, true, false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Emulator::InternalLoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom, bool forPowerCycle)
|
||||
{
|
||||
if(!romFile.IsValid()) {
|
||||
MessageManager::DisplayMessage("Error", "CouldNotLoadFile", romFile.GetFileName());
|
||||
|
|
|
@ -131,7 +131,8 @@ private:
|
|||
|
||||
template<typename T> void TryLoadRom(VirtualFile& romFile, LoadRomResult& result, unique_ptr<IConsole>& console);
|
||||
void InitConsole(unique_ptr<IConsole>& newConsole, ConsoleMemoryInfo originalConsoleMemory[], bool preserveRom);
|
||||
|
||||
|
||||
bool InternalLoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom = true, bool forPowerCycle = false);
|
||||
|
||||
public:
|
||||
Emulator();
|
||||
|
|
|
@ -73,6 +73,7 @@ std::unordered_map<string, string> MessageManager::_enResources = {
|
|||
{ "SoundRecorderStarted", u8"Recording to: %1" },
|
||||
{ "SoundRecorderStopped", u8"Recording saved to: %1" },
|
||||
{ "TestFileSavedTo", u8"Test file saved to: %1" },
|
||||
{ "UnexpectedError", u8"Unexpected error: %1" },
|
||||
{ "UnsupportedMapper", u8"Unsupported mapper (%1), cannot load game." },
|
||||
{ "VideoRecorderStarted", u8"Recording to: %1" },
|
||||
{ "VideoRecorderStopped", u8"Recording saved to: %1" },
|
||||
|
|
Loading…
Reference in a new issue