From 2bde61558da5340938e9fdf46585e3bb0c6ef666 Mon Sep 17 00:00:00 2001 From: stephena Date: Thu, 7 Mar 2013 17:41:19 +0000 Subject: [PATCH] Fixed "new console created" messages appearing when loading a ROM from the launcher. This message should only appear when *reloading* a ROM, not creating a new one completely. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2662 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- Changes.txt | 3 +++ src/emucore/OSystem.cxx | 10 +++++----- src/emucore/OSystem.hxx | 8 +++++--- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Changes.txt b/Changes.txt index ee51842ef..7bccd2eb9 100644 --- a/Changes.txt +++ b/Changes.txt @@ -16,6 +16,9 @@ * Disassembly from debugger ... + * Fixed redundant "New console created" message when entering the same + ROM multiple times from the ROM launcher. + -Have fun! diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index bfb3b7b3e..b38d260a7 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -501,17 +501,16 @@ void OSystem::createSound() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool OSystem::createConsole(const FilesystemNode& rom, const string& md5sum) +bool OSystem::createConsole(const FilesystemNode& rom, const string& md5sum, + bool newrom) { - ostringstream buf; - // Do a little error checking; it shouldn't be necessary if(myConsole) deleteConsole(); bool showmessage = false; // If same ROM has been given, we reload the current one (assuming one exists) - if(rom == myRomFile) + if(!newrom && rom == myRomFile) { showmessage = true; // we show a message if a ROM is being reloaded } @@ -527,6 +526,7 @@ bool OSystem::createConsole(const FilesystemNode& rom, const string& md5sum) } // Create an instance of the 2600 game console + ostringstream buf; string type, id; myConsole = openConsole(myRomFile, myRomMD5, type, id); if(myConsole) @@ -617,7 +617,7 @@ void OSystem::deleteConsole() bool OSystem::reloadConsole() { deleteConsole(); - return createConsole(myRomFile); + return createConsole(myRomFile, myRomMD5, false); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/OSystem.hxx b/src/emucore/OSystem.hxx index 03560d1a2..6617e17e5 100644 --- a/src/emucore/OSystem.hxx +++ b/src/emucore/OSystem.hxx @@ -373,12 +373,14 @@ class OSystem Creates a new game console from the specified romfile, and correctly initializes the system state to start emulation of the Console. - @param rom The FSNode of the ROM to use (contains path, etc) - @param md5 The MD5sum of the ROM + @param rom The FSNode of the ROM to use (contains path, etc) + @param md5 The MD5sum of the ROM + @param newrom Whether this is a new ROM, or a reload of current one @return True on successful creation, otherwise false */ - bool createConsole(const FilesystemNode& rom, const string& md5 = ""); + bool createConsole(const FilesystemNode& rom, const string& md5 = "", + bool newrom = true); /** Deletes the currently defined console, if it exists.