diff --git a/.vscode/settings.json b/.vscode/settings.json index 857d47127..768dc0b74 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,5 +12,19 @@ "editor.trimAutoWhitespace": true, "editor.useTabStops": false, "C_Cpp.intelliSenseEngine": "Default", - "files.insertFinalNewline": true + "files.insertFinalNewline": true, + "files.associations": { + "__split_buffer": "cpp", + "__tree": "cpp", + "atomic": "cpp", + "deque": "cpp", + "ios": "cpp", + "list": "cpp", + "map": "cpp", + "set": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "vector": "cpp" + } } diff --git a/src/common/FrameBufferSDL2.cxx b/src/common/FrameBufferSDL2.cxx index bfd6dbaae..64f93945d 100644 --- a/src/common/FrameBufferSDL2.cxx +++ b/src/common/FrameBufferSDL2.cxx @@ -298,3 +298,10 @@ void FrameBufferSDL2::readPixels(uInt8* pixels, uInt32 pitch, SDL_RenderReadPixels(myRenderer, &r, 0, pixels, pitch); } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void FrameBufferSDL2::clear() +{ + invalidate(); + postFrameUpdate(); +} diff --git a/src/common/FrameBufferSDL2.hxx b/src/common/FrameBufferSDL2.hxx index 42e3161e8..cbe248068 100644 --- a/src/common/FrameBufferSDL2.hxx +++ b/src/common/FrameBufferSDL2.hxx @@ -95,6 +95,11 @@ class FrameBufferSDL2 : public FrameBuffer */ void readPixels(uInt8* buffer, uInt32 pitch, const GUI::Rect& rect) const override; + /** + Clear the frame buffer + */ + void clear() override; + protected: ////////////////////////////////////////////////////////////////////// // The following are derived from protected methods in FrameBuffer.hxx diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index bc13fe7d9..0651cbae1 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -117,8 +117,9 @@ Console::Console(OSystem& osystem, unique_ptr& cart, const string& md5 = myProperties.get(Cartridge_MD5); setControllers(md5); - // Mute audio while autodetection runs + // Mute audio and clear framebuffer while autodetection runs myOSystem.sound().mute(1); + myOSystem.frameBuffer().clear(); if(myDisplayFormat == "AUTO" || myOSystem.settings().getBool("rominfo")) { diff --git a/src/emucore/FrameBuffer.hxx b/src/emucore/FrameBuffer.hxx index 3200b5d97..12f0e038d 100644 --- a/src/emucore/FrameBuffer.hxx +++ b/src/emucore/FrameBuffer.hxx @@ -304,6 +304,11 @@ class FrameBuffer */ virtual void readPixels(uInt8* buffer, uInt32 pitch, const GUI::Rect& rect) const = 0; + /** + Clear the framebuffer. + */ + virtual void clear() = 0; + protected: /** This method is called to query and initialize the video hardware