mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-03 04:52:14 +01:00
Clean up the memory partition ID enum
This commit is contained in:
1 parent
ca34a14fd8
commit
8cb1732564
3 files changed
+17
-9
No files matched your search
@@ -391,14 +391,14 @@ void __KernelMemoryShutdown()
|
||||
|
||||
BlockAllocator *BlockAllocatorFromID(int id) {
|
||||
switch (id) {
|
||||
case 1:
|
||||
case KERNEL_PARTITION_ID:
|
||||
case 3:
|
||||
case 4:
|
||||
if (hleIsKernelMode())
|
||||
return &kernelMemory;
|
||||
return nullptr;
|
||||
|
||||
case 2:
|
||||
case USER_PARTITION_ID:
|
||||
case 6:
|
||||
return &userMemory;
|
||||
|
||||
@@ -408,7 +408,7 @@ BlockAllocator *BlockAllocatorFromID(int id) {
|
||||
return &userMemory;
|
||||
return nullptr;
|
||||
|
||||
case 5:
|
||||
case VSHELL_PARTITION_ID:
|
||||
return &volatileMemory;
|
||||
|
||||
default:
|
||||
@@ -420,11 +420,11 @@ BlockAllocator *BlockAllocatorFromID(int id) {
|
||||
|
||||
int BlockAllocatorToID(const BlockAllocator *alloc) {
|
||||
if (alloc == &kernelMemory)
|
||||
return 1;
|
||||
return KERNEL_PARTITION_ID;
|
||||
if (alloc == &userMemory)
|
||||
return 2;
|
||||
return USER_PARTITION_ID;
|
||||
if (alloc == &volatileMemory)
|
||||
return 5;
|
||||
return VSHELL_PARTITION_ID;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user