From c696c493cb2682f1664d1136c1854cd54612f513 Mon Sep 17 00:00:00 2001 From: Sour Date: Mon, 30 Jan 2023 20:40:54 -0500 Subject: [PATCH] UI: Fixed screen size/aspect issues when using power off and then loading another game for the same console (except snes) --- Core/Shared/Emulator.cpp | 4 ++-- Core/Shared/Emulator.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/Shared/Emulator.cpp b/Core/Shared/Emulator.cpp index ce38c316..62382367 100644 --- a/Core/Shared/Emulator.cpp +++ b/Core/Shared/Emulator.cpp @@ -513,6 +513,7 @@ void Emulator::InitConsole(unique_ptr& newConsole, ConsoleMemoryInfo o } _console.reset(newConsole); + _consoleType = _console->GetConsoleType(); _notificationManager->RegisterNotificationListener(_console.lock()); } @@ -594,8 +595,7 @@ IConsole* Emulator::GetConsoleUnsafe() ConsoleType Emulator::GetConsoleType() { - shared_ptr console = GetConsole(); - return console ? console->GetConsoleType() : ConsoleType::Snes; + return _consoleType; } vector Emulator::GetCpuTypes() diff --git a/Core/Shared/Emulator.h b/Core/Shared/Emulator.h index 84ceaf8a..14e21033 100644 --- a/Core/Shared/Emulator.h +++ b/Core/Shared/Emulator.h @@ -105,6 +105,7 @@ private: bool _frameRunning = false; RomInfo _rom; + ConsoleType _consoleType = {}; ConsoleMemoryInfo _consoleMemory[DebugUtilities::GetMemoryTypeCount()] = {};