dmnt: update for new-ipc

This commit is contained in:
Michael Scire authored and SciresM committed 2019-12-07 12:41:28 -08:00
1 parent 89c6fc6437
commit e5d62025d3
13 files changed
+326 -248

No files matched your search

@@ -16,7 +16,9 @@
#pragma once
#include "../os/os_common_types.hpp"
#include "../ncm/ncm_types.hpp"
#include "../sf/sf_buffer_tags.hpp"
namespace sts::dmnt::cheat {
@@ -26,7 +28,7 @@ namespace sts::dmnt::cheat {
u64 size;
};
u64 process_id;
os::ProcessId process_id;
ncm::TitleId title_id;
MemoryRegionExtents main_nso_extents;
MemoryRegionExtents heap_extents;
@@ -37,18 +39,21 @@ namespace sts::dmnt::cheat {
static_assert(std::is_pod<CheatProcessMetadata>::value && sizeof(CheatProcessMetadata) == 0x70, "CheatProcessMetadata definition!");
struct CheatDefinition {
struct CheatDefinition : sf::LargeData, sf::PrefersMapAliasTransferMode {
char readable_name[0x40];
uint32_t num_opcodes;
uint32_t opcodes[0x100];
};
struct CheatEntry {
struct CheatEntry : sf::LargeData, sf::PrefersMapAliasTransferMode {
bool enabled;
uint32_t cheat_id;
CheatDefinition definition;
};
static_assert(std::is_pod<CheatDefinition>::value, "CheatDefinition");
static_assert(std::is_pod<CheatEntry>::value, "CheatEntry");
struct FrozenAddressValue {
u64 value;
u8 width;
@@ -46,10 +46,14 @@ namespace sts::os {
inline constexpr const ProcessId InvalidProcessId = ProcessId::Invalid;
NX_INLINE Result GetProcessId(os::ProcessId *out, ::Handle process_handle) {
return svcGetProcessId(&out->value, process_handle);
}
NX_INLINE ProcessId GetCurrentProcessId() {
u64 current_process_id = 0;
R_ASSERT(svcGetProcessId(&current_process_id, CUR_PROCESS_HANDLE));
return os::ProcessId{current_process_id};
os::ProcessId current_process_id;
R_ASSERT(GetProcessId(&current_process_id, CUR_PROCESS_HANDLE));
return current_process_id;
}
inline constexpr bool operator==(const ProcessId &lhs, const ProcessId &rhs) {
@@ -52,4 +52,10 @@ namespace sts::os {
}
};
NX_INLINE u32 GetCurrentThreadPriority() {
u32 prio;
R_ASSERT(svcGetThreadPriority(&prio, CUR_THREAD_HANDLE));
return prio;
}
}