summaryrefslogtreecommitdiffstats
path: root/src/core/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/core.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index c5004b7b4..d3e84c4ef 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <array>
+#include <atomic>
#include <memory>
#include <utility>
@@ -34,9 +35,9 @@
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/physical_core.h"
#include "core/hle/service/am/applets/applets.h"
-#include "core/hle/service/apm/controller.h"
+#include "core/hle/service/apm/apm_controller.h"
#include "core/hle/service/filesystem/filesystem.h"
-#include "core/hle/service/glue/manager.h"
+#include "core/hle/service/glue/glue_manager.h"
#include "core/hle/service/hid/hid.h"
#include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h"
@@ -215,9 +216,9 @@ struct System::Impl {
}
ResultStatus Load(System& system, Frontend::EmuWindow& emu_window, const std::string& filepath,
- std::size_t program_index) {
+ u64 program_id, std::size_t program_index) {
app_loader = Loader::GetLoader(system, GetGameFileFromPath(virtual_filesystem, filepath),
- program_index);
+ program_id, program_index);
if (!app_loader) {
LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath);
@@ -262,17 +263,16 @@ struct System::Impl {
if (Settings::values.gamecard_inserted) {
if (Settings::values.gamecard_current_game) {
fs_controller.SetGameCard(GetGameFileFromPath(virtual_filesystem, filepath));
- } else if (!Settings::values.gamecard_path.empty()) {
- fs_controller.SetGameCard(
- GetGameFileFromPath(virtual_filesystem, Settings::values.gamecard_path));
+ } else if (!Settings::values.gamecard_path.GetValue().empty()) {
+ const auto gamecard_path = Settings::values.gamecard_path.GetValue();
+ fs_controller.SetGameCard(GetGameFileFromPath(virtual_filesystem, gamecard_path));
}
}
- u64 title_id{0};
- if (app_loader->ReadProgramId(title_id) != Loader::ResultStatus::Success) {
+ if (app_loader->ReadProgramId(program_id) != Loader::ResultStatus::Success) {
LOG_ERROR(Core, "Failed to find title id for ROM (Error {})", load_result);
}
- perf_stats = std::make_unique<PerfStats>(title_id);
+ perf_stats = std::make_unique<PerfStats>(program_id);
// Reset counters and set time origin to current frame
GetAndResetPerfStats();
perf_stats->BeginSystemFrame();
@@ -377,7 +377,7 @@ struct System::Impl {
std::unique_ptr<Core::DeviceMemory> device_memory;
Core::Memory::Memory memory;
CpuManager cpu_manager;
- bool is_powered_on = false;
+ std::atomic_bool is_powered_on{};
bool exit_lock = false;
Reporter reporter;
@@ -411,7 +411,7 @@ struct System::Impl {
std::string status_details = "";
std::unique_ptr<Core::PerfStats> perf_stats;
- Core::FrameLimiter frame_limiter;
+ Core::SpeedLimiter speed_limiter;
bool is_multicore{};
bool is_async_gpu{};
@@ -458,12 +458,12 @@ void System::Shutdown() {
}
System::ResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath,
- std::size_t program_index) {
- return impl->Load(*this, emu_window, filepath, program_index);
+ u64 program_id, std::size_t program_index) {
+ return impl->Load(*this, emu_window, filepath, program_id, program_index);
}
bool System::IsPoweredOn() const {
- return impl->is_powered_on;
+ return impl->is_powered_on.load(std::memory_order::relaxed);
}
void System::PrepareReschedule() {
@@ -606,12 +606,12 @@ const Core::PerfStats& System::GetPerfStats() const {
return *impl->perf_stats;
}
-Core::FrameLimiter& System::FrameLimiter() {
- return impl->frame_limiter;
+Core::SpeedLimiter& System::SpeedLimiter() {
+ return impl->speed_limiter;
}
-const Core::FrameLimiter& System::FrameLimiter() const {
- return impl->frame_limiter;
+const Core::SpeedLimiter& System::SpeedLimiter() const {
+ return impl->speed_limiter;
}
Loader::ResultStatus System::GetGameName(std::string& out) const {