HW: Pass System to functions.
This commit is contained in:
parent
137b9d1da1
commit
026b6a3e0f
|
@ -531,13 +531,14 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
|||
AudioCommon::InitSoundStream(system);
|
||||
Common::ScopeGuard audio_guard([&system] { AudioCommon::ShutdownSoundStream(system); });
|
||||
|
||||
HW::Init(NetPlay::IsNetPlayRunning() ? &(boot_session_data.GetNetplaySettings()->sram) : nullptr);
|
||||
HW::Init(system,
|
||||
NetPlay::IsNetPlayRunning() ? &(boot_session_data.GetNetplaySettings()->sram) : nullptr);
|
||||
|
||||
Common::ScopeGuard hw_guard{[&system] {
|
||||
// We must set up this flag before executing HW::Shutdown()
|
||||
s_hardware_initialized = false;
|
||||
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(false, "Shutting down HW"));
|
||||
HW::Shutdown();
|
||||
HW::Shutdown(system);
|
||||
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(false, "HW shutdown"));
|
||||
|
||||
// Clear on screen messages that haven't expired
|
||||
|
|
|
@ -31,9 +31,8 @@
|
|||
|
||||
namespace HW
|
||||
{
|
||||
void Init(const Sram* override_sram)
|
||||
void Init(Core::System& system, const Sram* override_sram)
|
||||
{
|
||||
auto& system = Core::System::GetInstance();
|
||||
system.GetCoreTiming().Init();
|
||||
SystemTimers::PreInit();
|
||||
|
||||
|
@ -62,10 +61,8 @@ void Init(const Sram* override_sram)
|
|||
}
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
void Shutdown(Core::System& system)
|
||||
{
|
||||
auto& system = Core::System::GetInstance();
|
||||
|
||||
// IOS should always be shut down regardless of bWii because it can be running in GC mode (MIOS).
|
||||
IOS::HLE::Shutdown(); // Depends on Memory
|
||||
IOS::Shutdown();
|
||||
|
@ -86,9 +83,8 @@ void Shutdown()
|
|||
system.GetCoreTiming().Shutdown();
|
||||
}
|
||||
|
||||
void DoState(PointerWrap& p)
|
||||
void DoState(Core::System& system, PointerWrap& p)
|
||||
{
|
||||
auto& system = Core::System::GetInstance();
|
||||
system.GetMemory().DoState(p);
|
||||
p.DoMarker("Memory");
|
||||
system.GetMemoryInterface().DoState(p);
|
||||
|
|
|
@ -5,10 +5,14 @@
|
|||
|
||||
class PointerWrap;
|
||||
struct Sram;
|
||||
namespace Core
|
||||
{
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace HW
|
||||
{
|
||||
void Init(const Sram* override_sram);
|
||||
void Shutdown();
|
||||
void DoState(PointerWrap& p);
|
||||
void Init(Core::System& system, const Sram* override_sram);
|
||||
void Shutdown(Core::System& system);
|
||||
void DoState(Core::System& system, PointerWrap& p);
|
||||
} // namespace HW
|
||||
|
|
|
@ -230,7 +230,7 @@ static void DoState(PointerWrap& p)
|
|||
p.DoMarker("CoreTiming");
|
||||
|
||||
// HW needs to be restored before PowerPC because the data cache might need to be flushed.
|
||||
HW::DoState(p);
|
||||
HW::DoState(system, p);
|
||||
p.DoMarker("HW");
|
||||
|
||||
PowerPC::DoState(p);
|
||||
|
|
Loading…
Reference in New Issue