mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-20 17:36:10 +00:00
@@ -967,12 +967,16 @@ Kernel::KHardwareTimer& KernelCore::HardwareTimer() {
|
||||
return *impl->hardware_timer;
|
||||
}
|
||||
|
||||
KAutoObjectWithListContainer& KernelCore::ObjectListContainer() {
|
||||
return *impl->global_object_list_container;
|
||||
KAutoObjectWithListContainer* KernelCore::ObjectListContainer() {
|
||||
if (!impl->global_object_list_container)
|
||||
return nullptr;
|
||||
return std::addressof(*impl->global_object_list_container);
|
||||
}
|
||||
|
||||
const KAutoObjectWithListContainer& KernelCore::ObjectListContainer() const {
|
||||
return *impl->global_object_list_container;
|
||||
const KAutoObjectWithListContainer* KernelCore::ObjectListContainer() const {
|
||||
if (!impl->global_object_list_container)
|
||||
return nullptr;
|
||||
return std::addressof(*impl->global_object_list_container);
|
||||
}
|
||||
|
||||
void KernelCore::PrepareReschedule(std::size_t id) {
|
||||
@@ -1001,16 +1005,10 @@ void KernelCore::UnregisterInUseObject(KAutoObject* object) {
|
||||
|
||||
void KernelCore::RunServer(std::unique_ptr<Service::ServerManager>&& server_manager) {
|
||||
auto* manager = server_manager.get();
|
||||
|
||||
{
|
||||
if (!impl->is_shutting_down) {
|
||||
std::scoped_lock lk{impl->server_lock};
|
||||
if (impl->is_shutting_down) {
|
||||
return;
|
||||
}
|
||||
|
||||
impl->server_managers.emplace_back(std::move(server_manager));
|
||||
}
|
||||
|
||||
manager->LoopProcess();
|
||||
}
|
||||
|
||||
|
||||
@@ -175,9 +175,8 @@ public:
|
||||
/// Stops execution of 'id' core, in order to reschedule a new thread.
|
||||
void PrepareReschedule(std::size_t id);
|
||||
|
||||
KAutoObjectWithListContainer& ObjectListContainer();
|
||||
|
||||
const KAutoObjectWithListContainer& ObjectListContainer() const;
|
||||
KAutoObjectWithListContainer* ObjectListContainer();
|
||||
const KAutoObjectWithListContainer* ObjectListContainer() const;
|
||||
|
||||
/// Registers all kernel objects with the global emulation state, this is purely for tracking
|
||||
/// leaks after emulation has been shutdown.
|
||||
|
||||
@@ -151,7 +151,8 @@ public:
|
||||
const bool is_initialized = this->IsInitialized();
|
||||
uintptr_t arg = 0;
|
||||
if (is_initialized) {
|
||||
kernel.ObjectListContainer().Unregister(this);
|
||||
if (auto const olc = kernel.ObjectListContainer(); olc)
|
||||
olc->Unregister(this);
|
||||
arg = this->GetPostDestroyArgument();
|
||||
this->Finalize(kernel);
|
||||
}
|
||||
@@ -175,7 +176,7 @@ public:
|
||||
public:
|
||||
static void InitializeSlabHeap(KernelCore& kernel, void* memory, size_t memory_size) {
|
||||
kernel.SlabHeap<Derived>().Initialize(memory, memory_size);
|
||||
kernel.ObjectListContainer().Initialize();
|
||||
kernel.ObjectListContainer()->Initialize();
|
||||
}
|
||||
|
||||
static Derived* Create(KernelCore& kernel) {
|
||||
@@ -186,7 +187,7 @@ public:
|
||||
}
|
||||
|
||||
static void Register(KernelCore& kernel, Derived* obj) {
|
||||
return kernel.ObjectListContainer().Register(obj);
|
||||
return kernel.ObjectListContainer()->Register(obj);
|
||||
}
|
||||
|
||||
static size_t GetObjectSize(KernelCore& kernel) {
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
// gcc14 bug
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/scope_exit.h"
|
||||
#include "core/memory/dmnt_cheat_types.h"
|
||||
@@ -223,7 +229,10 @@ DmntCheatVm::Callbacks::~Callbacks() = default;
|
||||
bool DmntCheatVm::DecodeNextOpcode(CheatVmOpcode& out) {
|
||||
// If we've ever seen a decode failure, return false.
|
||||
bool valid = decode_success;
|
||||
CheatVmOpcode opcode = {};
|
||||
CheatVmOpcode opcode = {
|
||||
.begin_conditional_block = false,
|
||||
.opcode = {}
|
||||
};
|
||||
SCOPE_EXIT {
|
||||
decode_success &= valid;
|
||||
if (valid) {
|
||||
@@ -1266,3 +1275,8 @@ void DmntCheatVm::Execute(const CheatProcessMetadata& metadata) {
|
||||
}
|
||||
|
||||
} // namespace Core::Memory
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
@@ -254,14 +254,16 @@ struct UnrecognizedInstruction {
|
||||
|
||||
struct CheatVmOpcode {
|
||||
bool begin_conditional_block{};
|
||||
std::variant<StoreStaticOpcode, BeginConditionalOpcode, EndConditionalOpcode, ControlLoopOpcode,
|
||||
LoadRegisterStaticOpcode, LoadRegisterMemoryOpcode, StoreStaticToAddressOpcode,
|
||||
PerformArithmeticStaticOpcode, BeginKeypressConditionalOpcode,
|
||||
PerformArithmeticRegisterOpcode, StoreRegisterToAddressOpcode,
|
||||
BeginRegisterConditionalOpcode, SaveRestoreRegisterOpcode,
|
||||
SaveRestoreRegisterMaskOpcode, ReadWriteStaticRegisterOpcode, PauseProcessOpcode,
|
||||
ResumeProcessOpcode, DebugLogOpcode, UnrecognizedInstruction>
|
||||
opcode{};
|
||||
std::variant<
|
||||
std::monostate,
|
||||
StoreStaticOpcode, BeginConditionalOpcode, EndConditionalOpcode, ControlLoopOpcode,
|
||||
LoadRegisterStaticOpcode, LoadRegisterMemoryOpcode, StoreStaticToAddressOpcode,
|
||||
PerformArithmeticStaticOpcode, BeginKeypressConditionalOpcode,
|
||||
PerformArithmeticRegisterOpcode, StoreRegisterToAddressOpcode,
|
||||
BeginRegisterConditionalOpcode, SaveRestoreRegisterOpcode,
|
||||
SaveRestoreRegisterMaskOpcode, ReadWriteStaticRegisterOpcode, PauseProcessOpcode,
|
||||
ResumeProcessOpcode, DebugLogOpcode, UnrecognizedInstruction
|
||||
> opcode{};
|
||||
};
|
||||
|
||||
class DmntCheatVm {
|
||||
|
||||
Reference in New Issue
Block a user