diff --git a/src/Core/PS4/HLE/Kernel/MemMngCodes.h b/src/Core/PS4/HLE/Kernel/MemMngCodes.h index 3888dd7e..5ba52545 100644 --- a/src/Core/PS4/HLE/Kernel/MemMngCodes.h +++ b/src/Core/PS4/HLE/Kernel/MemMngCodes.h @@ -3,7 +3,7 @@ // constants -constexpr u64 SCE_KERNEL_MAIN_DMEM_SIZE = (5637144576); // ~ 6GB +constexpr u64 SCE_KERNEL_MAIN_DMEM_SIZE = 5376_MB; // ~ 6GB //memory types constexpr int SCE_KERNEL_WB_ONION = 0; // write - back mode (Onion bus) diff --git a/src/Core/PS4/HLE/Kernel/MemoryManagement.cpp b/src/Core/PS4/HLE/Kernel/MemoryManagement.cpp index 59110c56..4fd7943a 100644 --- a/src/Core/PS4/HLE/Kernel/MemoryManagement.cpp +++ b/src/Core/PS4/HLE/Kernel/MemoryManagement.cpp @@ -7,7 +7,7 @@ namespace HLE::Libs::LibKernel::MemoryManagement { bool isPowerOfTwo(u64 n) { return std::popcount(n) == 1; } -bool is16KBmultiply(u64 n) { return ((n % (static_cast(16) * 1024) == 0)); } +bool is16KBAligned(u64 n) { return ((n % (static_cast(16) * 1024) == 0)); } u64 PS4_SYSV_ABI sceKernelGetDirectMemorySize() { return SCE_KERNEL_MAIN_DMEM_SIZE; } diff --git a/src/types.h b/src/types.h index d749b8f1..ce0190c6 100644 --- a/src/types.h +++ b/src/types.h @@ -13,4 +13,10 @@ using u64 = unsigned long long; using f32 = float; using f64 = double; -#define PS4_SYSV_ABI __attribute__((sysv_abi)) \ No newline at end of file +#define PS4_SYSV_ABI __attribute__((sysv_abi)) + + +// UDLs for memory size values +constexpr u64 operator""_KB(u64 x) { return 1024ULL * x; } +constexpr u64 operator""_MB(u64 x) { return 1024_KB * x; } +constexpr u64 operator""_GB(u64 x) { return 1024_MB * x; } \ No newline at end of file