diff --git a/src/Core/PS4/HLE/Kernel/MemMngCodes.h b/src/Core/PS4/HLE/Kernel/MemMngCodes.h index fde25a08..056c0d2a 100644 --- a/src/Core/PS4/HLE/Kernel/MemMngCodes.h +++ b/src/Core/PS4/HLE/Kernel/MemMngCodes.h @@ -6,6 +6,9 @@ constexpr u64 SCE_KERNEL_MAIN_DMEM_SIZE = 5376_MB; // ~ 6GB // memory types -constexpr int SCE_KERNEL_WB_ONION = 0; // write - back mode (Onion bus) -constexpr int SCE_KERNEL_WC_GARLIC = 3; // write - combining mode (Garlic bus) -constexpr int SCE_KERNEL_WB_GARLIC = 10; // write - back mode (Garlic bus) + +typedef enum : int { + SCE_KERNEL_WB_ONION = 0, // write - back mode (Onion bus) + SCE_KERNEL_WC_GARLIC = 3, // write - combining mode (Garlic bus) + SCE_KERNEL_WB_GARLIC = 10 // write - back mode (Garlic bus) +} memory_types; \ No newline at end of file diff --git a/src/Core/PS4/HLE/Kernel/MemoryManagement.cpp b/src/Core/PS4/HLE/Kernel/MemoryManagement.cpp index 8950105c..38e58837 100644 --- a/src/Core/PS4/HLE/Kernel/MemoryManagement.cpp +++ b/src/Core/PS4/HLE/Kernel/MemoryManagement.cpp @@ -1,6 +1,7 @@ #include "MemoryManagement.h" #include +#include #include "../../../../Debug.h" #include "../../../../Util/Log.h" @@ -41,11 +42,13 @@ int PS4_SYSV_ABI sceKernelAllocateDirectMemory(s64 searchStart, s64 searchEnd, u // TODO debug logging return SCE_KERNEL_ERROR_EINVAL; } + auto memtype = magic_enum::enum_cast(memoryType); + LOG_INFO_IF(true, "search_start = {:#018x}\n", searchStart); LOG_INFO_IF(true, "search_end = {:#018x}\n", searchEnd); LOG_INFO_IF(true, "len = {:#018x}\n", len); LOG_INFO_IF(true, "alignment = {:#018x}\n", alignment); - LOG_INFO_IF(true, "memory_type = {}\n", memoryType); + LOG_INFO_IF(true, "memory_type = {}\n", magic_enum::enum_name(memtype.value())); u64 physical_addr = 0; auto* physical_memory = Singleton::Instance();