UI: Fixed input hud being shown behind game select screen after using power off

This commit is contained in:
Souryo 2017-11-28 22:44:06 -05:00
parent ff95758a87
commit dc3202fbfc
5 changed files with 12 additions and 7 deletions

View file

@ -146,7 +146,7 @@ shared_ptr<BaseControlDevice> ControlManager::CreateExpansionDevice(ExpansionPor
case ExpansionPortDevice::OekaKidsTablet: device.reset(new OekaKidsTablet()); break; case ExpansionPortDevice::OekaKidsTablet: device.reset(new OekaKidsTablet()); break;
case ExpansionPortDevice::FamilyTrainerMat: device.reset(new FamilyMatTrainer(EmulationSettings::GetControllerKeys(0))); 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::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::PartyTap: device.reset(new PartyTap(EmulationSettings::GetControllerKeys(0))); break;
case ExpansionPortDevice::Pachinko: device.reset(new PachinkoController(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; case ExpansionPortDevice::ExcitingBoxing: device.reset(new ExcitingBoxingController(EmulationSettings::GetControllerKeys(0))); break;

View file

@ -925,9 +925,11 @@ public:
static void DisableOverclocking(bool disabled) static void DisableOverclocking(bool disabled)
{ {
if(_disableOverclocking != disabled) {
_disableOverclocking = disabled; _disableOverclocking = disabled;
UpdateEffectiveOverclockRate(); UpdateEffectiveOverclockRate();
} }
}
static uint32_t GetOverclockRateSetting() static uint32_t GetOverclockRateSetting()
{ {

View file

@ -124,8 +124,9 @@ void VideoDecoder::DecodeFrame(bool synchronous)
frameInfo = _scaleFilter->GetFrameInfo(frameInfo); frameInfo = _scaleFilter->GetFrameInfo(frameInfo);
} }
VideoHud hud; if(_hud) {
hud.DrawHud((uint8_t*)outputBuffer, frameInfo, _videoFilter->GetOverscan()); _hud->DrawHud((uint8_t*)outputBuffer, frameInfo, _videoFilter->GetOverscan());
}
ScreenSize screenSize; ScreenSize screenSize;
GetScreenSize(screenSize, true); GetScreenSize(screenSize, true);
@ -209,7 +210,7 @@ void VideoDecoder::StartThread()
_frameChanged = false; _frameChanged = false;
_frameCount = 0; _frameCount = 0;
_waitForFrame.Reset(); _waitForFrame.Reset();
_hud.reset(new VideoHud());
_decodeThread.reset(new thread(&VideoDecoder::DecodeThread, this)); _decodeThread.reset(new thread(&VideoDecoder::DecodeThread, this));
} }
} }
@ -223,6 +224,7 @@ void VideoDecoder::StopThread()
_decodeThread.reset(); _decodeThread.reset();
_hud.reset();
_hdScreenTiles = nullptr; _hdScreenTiles = nullptr;
EmulationSettings::SetPpuModel(PpuModel::Ppu2C02); EmulationSettings::SetPpuModel(PpuModel::Ppu2C02);
UpdateVideoFilter(); UpdateVideoFilter();

View file

@ -12,6 +12,7 @@ class BaseVideoFilter;
class ScaleFilter; class ScaleFilter;
class RotateFilter; class RotateFilter;
class IRenderingDevice; class IRenderingDevice;
class VideoHud;
struct HdPpuPixelInfo; struct HdPpuPixelInfo;
struct ScreenSize struct ScreenSize
@ -31,6 +32,7 @@ private:
bool _hdFilterEnabled = false; bool _hdFilterEnabled = false;
unique_ptr<thread> _decodeThread; unique_ptr<thread> _decodeThread;
unique_ptr<VideoHud> _hud;
AutoResetEvent _waitForFrame; AutoResetEvent _waitForFrame;

View file

@ -13,7 +13,6 @@ void VideoHud::DrawHud(uint8_t *outputBuffer, FrameInfo frameInfo, OverscanDimen
uint32_t displayCount = 0; uint32_t displayCount = 0;
InputDisplaySettings settings = EmulationSettings::GetInputDisplaySettings(); InputDisplaySettings settings = EmulationSettings::GetInputDisplaySettings();
//TODO: FIX
vector<ControlDeviceState> states = ControlManager::GetPortStates(); vector<ControlDeviceState> states = ControlManager::GetPortStates();
for(int inputPort = 0; inputPort < 4; inputPort++) { for(int inputPort = 0; inputPort < 4; inputPort++) {
if((settings.VisiblePorts >> inputPort) & 0x01) { if((settings.VisiblePorts >> inputPort) & 0x01) {