audio_core: Remove global state
This commit is contained in:
parent
dca5fd291f
commit
ab3d53131a
34 changed files with 711 additions and 650 deletions
|
@ -4,7 +4,8 @@
|
|||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include "audio_core/audio_core.h"
|
||||
#include "audio_core/dsp_interface.h"
|
||||
#include "audio_core/hle/hle.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/arm/arm_interface.h"
|
||||
#ifdef ARCHITECTURE_x86_64
|
||||
|
@ -149,6 +150,8 @@ void System::Reschedule() {
|
|||
System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
|
||||
LOG_DEBUG(HW_Memory, "initialized OK");
|
||||
|
||||
CoreTiming::Init();
|
||||
|
||||
if (Settings::values.use_cpu_jit) {
|
||||
#ifdef ARCHITECTURE_x86_64
|
||||
cpu_core = std::make_unique<ARM_Dynarmic>(USER32MODE);
|
||||
|
@ -160,13 +163,15 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
|
|||
cpu_core = std::make_unique<ARM_DynCom>(USER32MODE);
|
||||
}
|
||||
|
||||
dsp_core = std::make_unique<AudioCore::DspHle>();
|
||||
dsp_core->SetSink(Settings::values.sink_id);
|
||||
dsp_core->EnableStretching(Settings::values.enable_audio_stretching);
|
||||
|
||||
telemetry_session = std::make_unique<Core::TelemetrySession>();
|
||||
|
||||
CoreTiming::Init();
|
||||
HW::Init();
|
||||
Kernel::Init(system_mode);
|
||||
Service::Init();
|
||||
AudioCore::Init();
|
||||
GDBStub::Init();
|
||||
Movie::GetInstance().Init();
|
||||
|
||||
|
@ -196,15 +201,16 @@ void System::Shutdown() {
|
|||
// Shutdown emulation session
|
||||
Movie::GetInstance().Shutdown();
|
||||
GDBStub::Shutdown();
|
||||
AudioCore::Shutdown();
|
||||
VideoCore::Shutdown();
|
||||
Service::Shutdown();
|
||||
Kernel::Shutdown();
|
||||
HW::Shutdown();
|
||||
CoreTiming::Shutdown();
|
||||
cpu_core = nullptr;
|
||||
app_loader = nullptr;
|
||||
telemetry_session = nullptr;
|
||||
dsp_core = nullptr;
|
||||
cpu_core = nullptr;
|
||||
CoreTiming::Shutdown();
|
||||
app_loader = nullptr;
|
||||
|
||||
if (auto room_member = Network::GetRoomMember().lock()) {
|
||||
Network::GameInfo game_info{};
|
||||
room_member->SendGameInfo(game_info);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue