From a85debea63c4017fb4948e0fda6ed65e7f1403b5 Mon Sep 17 00:00:00 2001 From: stephena Date: Mon, 18 Jan 2016 16:03:22 +0000 Subject: [PATCH] Fixed bug in ROM launcher; hasConsole() would be true even when the console is closed (since it's not deleted until the next console is created). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3249 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- Changes.txt | 4 ++++ src/emucore/OSystem.cxx | 7 +++++++ src/emucore/OSystem.hxx | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Changes.txt b/Changes.txt index 4eaa4f120..570dee040 100644 --- a/Changes.txt +++ b/Changes.txt @@ -23,6 +23,10 @@ issues in (for example) Kaboom, where there was a huge 'deadzone' when moving to the left. + * Fixed bug in ROM launcher; selecting 'Options -> Game Properties' after + loading a ROM would always point to the last opened ROM, not to the one + currently selected. + * Added more C++11 updates all over the codebase, and ran Stella through Coverity for the first time. I'm proud to say that Stella now has a 0.00 defect rate! diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index 3259f5fae..241bb9f2a 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -405,6 +405,13 @@ bool OSystem::reloadConsole() return createConsole(myRomFile, myRomMD5, false) == EmptyString; } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool OSystem::hasConsole() const +{ + return myConsole != nullptr && + myEventHandler->state() != EventHandler::S_LAUNCHER; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool OSystem::createLauncher(const string& startdir) { diff --git a/src/emucore/OSystem.hxx b/src/emucore/OSystem.hxx index 1ec647053..496faef58 100644 --- a/src/emucore/OSystem.hxx +++ b/src/emucore/OSystem.hxx @@ -128,7 +128,7 @@ class OSystem @return The console object */ Console& console() const { return *myConsole; } - bool hasConsole() const { return myConsole != nullptr; } + bool hasConsole() const; /** Get the serial port of the system.