early-access version 2820
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "audio_core/audio_core.h"
|
||||
#include "common/fs/fs.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/microprofile.h"
|
||||
@@ -141,6 +142,8 @@ struct System::Impl {
|
||||
cpu_manager.Pause(false);
|
||||
is_paused = false;
|
||||
|
||||
audio_core->PauseSinks(false);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -148,6 +151,8 @@ struct System::Impl {
|
||||
std::unique_lock<std::mutex> lk(suspend_guard);
|
||||
status = SystemResultStatus::Success;
|
||||
|
||||
audio_core->PauseSinks(true);
|
||||
|
||||
core_timing.SyncPause(true);
|
||||
kernel.Suspend(true);
|
||||
cpu_manager.Pause(true);
|
||||
@@ -156,6 +161,11 @@ struct System::Impl {
|
||||
return status;
|
||||
}
|
||||
|
||||
bool IsPaused() const {
|
||||
std::unique_lock lk(suspend_guard);
|
||||
return is_paused;
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> StallProcesses() {
|
||||
std::unique_lock<std::mutex> lk(suspend_guard);
|
||||
kernel.Suspend(true);
|
||||
@@ -219,6 +229,8 @@ struct System::Impl {
|
||||
return SystemResultStatus::ErrorVideoCore;
|
||||
}
|
||||
|
||||
audio_core = std::make_unique<AudioCore::AudioCore>(system);
|
||||
|
||||
service_manager = std::make_shared<Service::SM::ServiceManager>(kernel);
|
||||
services = std::make_unique<Service::Services>(service_manager, system);
|
||||
|
||||
@@ -294,7 +306,7 @@ struct System::Impl {
|
||||
if (Settings::values.gamecard_current_game) {
|
||||
fs_controller.SetGameCard(GetGameFileFromPath(virtual_filesystem, filepath));
|
||||
} else if (!Settings::values.gamecard_path.GetValue().empty()) {
|
||||
const auto gamecard_path = Settings::values.gamecard_path.GetValue();
|
||||
const auto& gamecard_path = Settings::values.gamecard_path.GetValue();
|
||||
fs_controller.SetGameCard(GetGameFileFromPath(virtual_filesystem, gamecard_path));
|
||||
}
|
||||
}
|
||||
@@ -312,6 +324,8 @@ struct System::Impl {
|
||||
}
|
||||
|
||||
void Shutdown() {
|
||||
SetShuttingDown(true);
|
||||
|
||||
// Log last frame performance stats if game was loded
|
||||
if (perf_stats) {
|
||||
const auto perf_results = GetAndResetPerfStats();
|
||||
@@ -335,6 +349,7 @@ struct System::Impl {
|
||||
}
|
||||
|
||||
debugger.reset();
|
||||
kernel.CloseServices();
|
||||
services.reset();
|
||||
service_manager.reset();
|
||||
cheat_engine.reset();
|
||||
@@ -343,6 +358,7 @@ struct System::Impl {
|
||||
time_manager.Shutdown();
|
||||
core_timing.Shutdown();
|
||||
app_loader.reset();
|
||||
audio_core.reset();
|
||||
gpu_core.reset();
|
||||
host1x_core.reset();
|
||||
perf_stats.reset();
|
||||
@@ -353,6 +369,14 @@ struct System::Impl {
|
||||
LOG_DEBUG(Core, "Shutdown OK");
|
||||
}
|
||||
|
||||
bool IsShuttingDown() const {
|
||||
return is_shutting_down;
|
||||
}
|
||||
|
||||
void SetShuttingDown(bool shutting_down) {
|
||||
is_shutting_down = shutting_down;
|
||||
}
|
||||
|
||||
Loader::ResultStatus GetGameName(std::string& out) const {
|
||||
if (app_loader == nullptr)
|
||||
return Loader::ResultStatus::ErrorNotInitialized;
|
||||
@@ -395,8 +419,9 @@ struct System::Impl {
|
||||
return perf_stats->GetAndResetStats(core_timing.GetGlobalTimeUs());
|
||||
}
|
||||
|
||||
std::mutex suspend_guard;
|
||||
mutable std::mutex suspend_guard;
|
||||
bool is_paused{};
|
||||
std::atomic<bool> is_shutting_down{};
|
||||
|
||||
Timing::CoreTiming core_timing;
|
||||
Kernel::KernelCore kernel;
|
||||
@@ -406,10 +431,11 @@ struct System::Impl {
|
||||
std::unique_ptr<FileSys::ContentProviderUnion> content_provider;
|
||||
Service::FileSystem::FileSystemController fs_controller;
|
||||
/// AppLoader used to load the current executing application
|
||||
std::unique_ptr<Tegra::Host1x::Host1x> host1x_core;
|
||||
std::unique_ptr<Loader::AppLoader> app_loader;
|
||||
std::unique_ptr<Tegra::GPU> gpu_core;
|
||||
std::unique_ptr<Tegra::Host1x::Host1x> host1x_core;
|
||||
std::unique_ptr<Core::DeviceMemory> device_memory;
|
||||
std::unique_ptr<AudioCore::AudioCore> audio_core;
|
||||
Core::Memory::Memory memory;
|
||||
Core::HID::HIDCore hid_core;
|
||||
CpuManager cpu_manager;
|
||||
@@ -482,6 +508,10 @@ SystemResultStatus System::Pause() {
|
||||
return impl->Pause();
|
||||
}
|
||||
|
||||
bool System::IsPaused() const {
|
||||
return impl->IsPaused();
|
||||
}
|
||||
|
||||
void System::InvalidateCpuInstructionCaches() {
|
||||
impl->kernel.InvalidateAllInstructionCaches();
|
||||
}
|
||||
@@ -494,6 +524,14 @@ void System::Shutdown() {
|
||||
impl->Shutdown();
|
||||
}
|
||||
|
||||
bool System::IsShuttingDown() const {
|
||||
return impl->IsShuttingDown();
|
||||
}
|
||||
|
||||
void System::SetShuttingDown(bool shutting_down) {
|
||||
impl->SetShuttingDown(shutting_down);
|
||||
}
|
||||
|
||||
void System::DetachDebugger() {
|
||||
if (impl->debugger) {
|
||||
impl->debugger->NotifyShutdown();
|
||||
@@ -603,14 +641,6 @@ const Core::Memory::Memory& System::Memory() const {
|
||||
return impl->memory;
|
||||
}
|
||||
|
||||
Tegra::GPU& System::GPU() {
|
||||
return *impl->gpu_core;
|
||||
}
|
||||
|
||||
const Tegra::GPU& System::GPU() const {
|
||||
return *impl->gpu_core;
|
||||
}
|
||||
|
||||
Tegra::Host1x::Host1x& System::Host1x() {
|
||||
return *impl->host1x_core;
|
||||
}
|
||||
@@ -619,6 +649,14 @@ const Tegra::Host1x::Host1x& System::Host1x() const {
|
||||
return *impl->host1x_core;
|
||||
}
|
||||
|
||||
Tegra::GPU& System::GPU() {
|
||||
return *impl->gpu_core;
|
||||
}
|
||||
|
||||
const Tegra::GPU& System::GPU() const {
|
||||
return *impl->gpu_core;
|
||||
}
|
||||
|
||||
VideoCore::RendererBase& System::Renderer() {
|
||||
return impl->gpu_core->Renderer();
|
||||
}
|
||||
@@ -643,6 +681,14 @@ const HID::HIDCore& System::HIDCore() const {
|
||||
return impl->hid_core;
|
||||
}
|
||||
|
||||
AudioCore::AudioCore& System::AudioCore() {
|
||||
return *impl->audio_core;
|
||||
}
|
||||
|
||||
const AudioCore::AudioCore& System::AudioCore() const {
|
||||
return *impl->audio_core;
|
||||
}
|
||||
|
||||
Timing::CoreTiming& System::CoreTiming() {
|
||||
return impl->core_timing;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user