Qt: Log machine caps on startup

This commit is contained in:
Connor McLaughlin 2022-03-16 21:03:24 +10:00 committed by refractionpcsx2
parent 1927896442
commit 80cc2f0cb7
4 changed files with 24 additions and 14 deletions

View File

@ -236,7 +236,7 @@ void EmuThread::run()
m_event_loop = new QEventLoop();
m_started_semaphore.release();
if (!VMManager::InitializeMemory())
if (!VMManager::Internal::InitializeMemory())
pxFailRel("Failed to allocate memory map");
// we need input sources ready for binding
@ -258,7 +258,7 @@ void EmuThread::run()
stopBackgroundControllerPollTimer();
destroyBackgroundControllerPollTimer();
InputManager::CloseSources();
VMManager::ReleaseMemory();
VMManager::Internal::ReleaseMemory();
PerformanceMetrics::SetCPUThreadTimer(Common::ThreadCPUTimer());
moveToThread(m_ui_thread);
deleteLater();

View File

@ -82,6 +82,9 @@ bool QtHost::Initialize()
return false;
}
if (!VMManager::Internal::InitializeGlobals())
return false;
HookSignals();
return true;
}

View File

@ -173,16 +173,20 @@ std::string VMManager::GetGameName()
return s_game_name;
}
bool VMManager::InitializeMemory()
bool VMManager::Internal::InitializeGlobals()
{
pxAssert(!s_vm_memory && !s_cpu_provider_pack);
#ifdef _M_X86
x86caps.Identify();
x86caps.CountCores();
x86caps.SIMD_EstablishMXCSRmask();
x86caps.CalculateMHz();
#endif
SysLogMachineCaps();
return true;
}
bool VMManager::Internal::InitializeMemory()
{
pxAssert(!s_vm_memory && !s_cpu_provider_pack);
s_vm_memory = std::make_unique<SysMainMemory>();
s_cpu_provider_pack = std::make_unique<SysCpuProviderPack>();
@ -191,7 +195,7 @@ bool VMManager::InitializeMemory()
return true;
}
void VMManager::ReleaseMemory()
void VMManager::Internal::ReleaseMemory()
{
std::vector<u8>().swap(s_widescreen_cheats_data);
s_widescreen_cheats_loaded = false;

View File

@ -72,12 +72,6 @@ namespace VMManager
/// Returns the name of the disc/executable currently running.
std::string GetGameName();
/// Reserves memory for the virtual machines.
bool InitializeMemory();
/// Completely releases all memory for the virtual machine.
void ReleaseMemory();
/// Initializes all system components.
bool Initialize(const VMBootParameters& boot_params);
@ -149,6 +143,15 @@ namespace VMManager
/// Internal callbacks, implemented in the emu core.
namespace Internal
{
/// Performs early global initialization.
bool InitializeGlobals();
/// Reserves memory for the virtual machines.
bool InitializeMemory();
/// Completely releases all memory for the virtual machine.
void ReleaseMemory();
const std::string& GetElfOverride();
bool IsExecutionInterrupted();
void GameStartingOnCPUThread();