diff --git a/Core/ControlManager.cpp b/Core/ControlManager.cpp index b6eb7a83..305e35f4 100644 --- a/Core/ControlManager.cpp +++ b/Core/ControlManager.cpp @@ -146,7 +146,7 @@ shared_ptr ControlManager::CreateExpansionDevice(ExpansionPor case ExpansionPortDevice::OekaKidsTablet: device.reset(new OekaKidsTablet()); break; case ExpansionPortDevice::FamilyTrainerMat: device.reset(new FamilyMatTrainer(EmulationSettings::GetControllerKeys(0))); break; case ExpansionPortDevice::KonamiHyperShot: device.reset(new KonamiHyperShot(EmulationSettings::GetControllerKeys(0), EmulationSettings::GetControllerKeys(1))); break; - case ExpansionPortDevice::FamilyBasicKeyboard: device.reset(new FamilyBasicKeyboard(EmulationSettings::GetControllerKeys(0))); break; //TODO: tape reader + case ExpansionPortDevice::FamilyBasicKeyboard: device.reset(new FamilyBasicKeyboard(EmulationSettings::GetControllerKeys(0))); break; case ExpansionPortDevice::PartyTap: device.reset(new PartyTap(EmulationSettings::GetControllerKeys(0))); break; case ExpansionPortDevice::Pachinko: device.reset(new PachinkoController(EmulationSettings::GetControllerKeys(0))); break; case ExpansionPortDevice::ExcitingBoxing: device.reset(new ExcitingBoxingController(EmulationSettings::GetControllerKeys(0))); break; diff --git a/Core/EmulationSettings.h b/Core/EmulationSettings.h index 0b509bd1..02cf423b 100644 --- a/Core/EmulationSettings.h +++ b/Core/EmulationSettings.h @@ -925,8 +925,10 @@ public: static void DisableOverclocking(bool disabled) { - _disableOverclocking = disabled; - UpdateEffectiveOverclockRate(); + if(_disableOverclocking != disabled) { + _disableOverclocking = disabled; + UpdateEffectiveOverclockRate(); + } } static uint32_t GetOverclockRateSetting() diff --git a/Core/VideoDecoder.cpp b/Core/VideoDecoder.cpp index 15a9f84d..698fc9ac 100644 --- a/Core/VideoDecoder.cpp +++ b/Core/VideoDecoder.cpp @@ -124,8 +124,9 @@ void VideoDecoder::DecodeFrame(bool synchronous) frameInfo = _scaleFilter->GetFrameInfo(frameInfo); } - VideoHud hud; - hud.DrawHud((uint8_t*)outputBuffer, frameInfo, _videoFilter->GetOverscan()); + if(_hud) { + _hud->DrawHud((uint8_t*)outputBuffer, frameInfo, _videoFilter->GetOverscan()); + } ScreenSize screenSize; GetScreenSize(screenSize, true); @@ -209,7 +210,7 @@ void VideoDecoder::StartThread() _frameChanged = false; _frameCount = 0; _waitForFrame.Reset(); - + _hud.reset(new VideoHud()); _decodeThread.reset(new thread(&VideoDecoder::DecodeThread, this)); } } @@ -223,6 +224,7 @@ void VideoDecoder::StopThread() _decodeThread.reset(); + _hud.reset(); _hdScreenTiles = nullptr; EmulationSettings::SetPpuModel(PpuModel::Ppu2C02); UpdateVideoFilter(); diff --git a/Core/VideoDecoder.h b/Core/VideoDecoder.h index 2c84ada5..c0f2e5f6 100644 --- a/Core/VideoDecoder.h +++ b/Core/VideoDecoder.h @@ -12,6 +12,7 @@ class BaseVideoFilter; class ScaleFilter; class RotateFilter; class IRenderingDevice; +class VideoHud; struct HdPpuPixelInfo; struct ScreenSize @@ -31,6 +32,7 @@ private: bool _hdFilterEnabled = false; unique_ptr _decodeThread; + unique_ptr _hud; AutoResetEvent _waitForFrame; diff --git a/Core/VideoHud.cpp b/Core/VideoHud.cpp index 80a552eb..8adb30af 100644 --- a/Core/VideoHud.cpp +++ b/Core/VideoHud.cpp @@ -13,7 +13,6 @@ void VideoHud::DrawHud(uint8_t *outputBuffer, FrameInfo frameInfo, OverscanDimen uint32_t displayCount = 0; InputDisplaySettings settings = EmulationSettings::GetInputDisplaySettings(); - //TODO: FIX vector states = ControlManager::GetPortStates(); for(int inputPort = 0; inputPort < 4; inputPort++) { if((settings.VisiblePorts >> inputPort) & 0x01) {