mirror of https://github.com/stella-emu/stella.git
Fixes, make sure that an error during reload is visible after the launcher starts.
This commit is contained in:
parent
14d2b50edd
commit
ee7190851e
|
@ -88,10 +88,10 @@ void CartridgeELFWidget::saveArmImage(const FSNode& node)
|
|||
const size_t sizeWritten = node.write(buffer, size);
|
||||
if (sizeWritten != size) throw runtime_error("failed to write arm image");
|
||||
|
||||
instance().frameBuffer().showTextMessage("Successfully exported ARM executable image");
|
||||
instance().frameBuffer().showTextMessage("Successfully exported ARM executable image", MessagePosition::MiddleCenter, true);
|
||||
}
|
||||
catch (...) {
|
||||
instance().frameBuffer().showTextMessage("Failed to export ARM executable image");
|
||||
instance().frameBuffer().showTextMessage("Failed to export ARM executable image", MessagePosition::MiddleCenter, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -461,7 +461,8 @@ void CartridgeELF::parseAndLinkElf()
|
|||
if (dump) dumpElf(myElfParser, cout);
|
||||
|
||||
myLinker = make_unique<ElfLinker>(ADDR_TEXT_BASE, ADDR_DATA_BASE, ADDR_RODATA_BASE, myElfParser);
|
||||
if (!mySettings.getBool("dev.thumb.trapfatal")) myLinker->setUndefinedSymbolDefault(0);
|
||||
if (!(mySettings.getBool("dev.settings") && mySettings.getBool("dev.thumb.trapfatal")))
|
||||
myLinker->setUndefinedSymbolDefault(0);
|
||||
|
||||
try {
|
||||
myLinker->link(externalSymbols(SystemType::ntsc));
|
||||
|
|
|
@ -1518,14 +1518,15 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
|
|||
return;
|
||||
|
||||
case Event::ReloadConsole:
|
||||
if(pressed && !repeated && !myOSystem.reloadConsole(true))
|
||||
exitEmulation(true);
|
||||
|
||||
return;
|
||||
|
||||
case Event::PreviousMultiCartRom:
|
||||
if(pressed && !repeated&& !myOSystem.reloadConsole(true))
|
||||
exitEmulation(true);
|
||||
if(pressed && !repeated) {
|
||||
const auto reloadError = myOSystem.reloadConsole(event == Event::ReloadConsole);
|
||||
|
||||
if (reloadError) {
|
||||
exitEmulation(true);
|
||||
myOSystem.frameBuffer().showTextMessage(reloadError.value(), MessagePosition::MiddleCenter, true);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
|
|
|
@ -582,11 +582,13 @@ string OSystem::createConsole(const FSNode& rom, string_view md5sum, bool newrom
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool OSystem::reloadConsole(bool nextrom)
|
||||
optional<string> OSystem::reloadConsole(bool nextrom)
|
||||
{
|
||||
mySettings->setValue("romloadprev", !nextrom);
|
||||
|
||||
return createConsole(myRomFile, myRomMD5, false) == EmptyString;
|
||||
const string result = createConsole(myRomFile, myRomMD5, false);
|
||||
|
||||
return result == EmptyString ? std::nullopt : optional<string>(result);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -377,7 +377,7 @@ class OSystem
|
|||
|
||||
@return True on successful creation, otherwise false
|
||||
*/
|
||||
bool reloadConsole(bool nextrom = true);
|
||||
optional<string> reloadConsole(bool nextrom = true);
|
||||
|
||||
/**
|
||||
Creates a new ROM launcher, to select a new ROM to emulate.
|
||||
|
|
Loading…
Reference in New Issue