diff --git a/src/debugger/gui/CartELFWidget.cxx b/src/debugger/gui/CartELFWidget.cxx index 48887bd08..ffa4bfe12 100644 --- a/src/debugger/gui/CartELFWidget.cxx +++ b/src/debugger/gui/CartELFWidget.cxx @@ -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); } } diff --git a/src/emucore/CartELF.cxx b/src/emucore/CartELF.cxx index d211e0064..e94909a25 100644 --- a/src/emucore/CartELF.cxx +++ b/src/emucore/CartELF.cxx @@ -461,7 +461,8 @@ void CartridgeELF::parseAndLinkElf() if (dump) dumpElf(myElfParser, cout); myLinker = make_unique(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)); diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index f632d7119..7641284cb 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -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; diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index b669d2300..3166847f7 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -582,11 +582,13 @@ string OSystem::createConsole(const FSNode& rom, string_view md5sum, bool newrom } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool OSystem::reloadConsole(bool nextrom) +optional 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(result); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/OSystem.hxx b/src/emucore/OSystem.hxx index 93437cfb7..e39ef3759 100644 --- a/src/emucore/OSystem.hxx +++ b/src/emucore/OSystem.hxx @@ -377,7 +377,7 @@ class OSystem @return True on successful creation, otherwise false */ - bool reloadConsole(bool nextrom = true); + optional reloadConsole(bool nextrom = true); /** Creates a new ROM launcher, to select a new ROM to emulate.