From d19ee07ebfb41f6e5a78ee32b72d52ce153ed5bb Mon Sep 17 00:00:00 2001 From: sum2012 Date: Sun, 14 Jun 2020 09:42:24 +0800 Subject: [PATCH 1/2] Some work in sceKernelPartitionTotalFreeMemSize,sceKernelPartitionMaxFreeMemSize jpcsp ref: https://github.com/jpcsp/jpcsp/commit/6d28d8799ce03e926ad8c764fd5deb8de165dc3b We ignore ePartition now --- Core/HLE/sceKernelHeap.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/Core/HLE/sceKernelHeap.cpp b/Core/HLE/sceKernelHeap.cpp index 1fc08f1a57aa..a7385d537c5b 100644 --- a/Core/HLE/sceKernelHeap.cpp +++ b/Core/HLE/sceKernelHeap.cpp @@ -83,13 +83,29 @@ static int sceKernelDeleteHeap(int heapId) { } } +static u32 sceKernelPartitionTotalFreeMemSize(int partitionId) { + ERROR_LOG(SCEKERNEL, "UNIMP sceKernelPartitionTotalFreeMemSize(%d)", partitionId); + //Need more work #13021 + ///We ignore partitionId for now + return userMemory.GetTotalFreeBytes(); +} + +static u32 sceKernelPartitionMaxFreeMemSize(int partitionId) { + ERROR_LOG(SCEKERNEL, "UNIMP sceKernelPartitionMaxFreeMemSize(%d)", partitionId); + //Need more work #13021 + ///We ignore partitionId for now + return userMemory.GetLargestFreeBlockSize(); +} + const HLEFunction SysMemForKernel[] = { - { 0X636C953B, &WrapI_II, "sceKernelAllocHeapMemory", 'x', "ii" }, - { 0XC9805775, &WrapI_I, "sceKernelDeleteHeap", 'i', "i" }, - { 0X1C1FBFE7, &WrapI_IIIC, "sceKernelCreateHeap", 'i', "iixs" }, - { 0X237DBD4F, &WrapI_ICIUU, "sceKernelAllocPartitionMemory", 'i', "isixx",HLE_KERNEL_SYSCALL }, - { 0XB6D61D02, &WrapI_I, "sceKernelFreePartitionMemory", 'i', "i",HLE_KERNEL_SYSCALL }, - { 0X9D9A5BA1, &WrapU_I, "sceKernelGetBlockHeadAddr", 'x', "i",HLE_KERNEL_SYSCALL }, + { 0X636C953B, &WrapI_II, "sceKernelAllocHeapMemory", 'x', "ii", HLE_KERNEL_SYSCALL }, + { 0XC9805775, &WrapI_I, "sceKernelDeleteHeap", 'i', "i" , HLE_KERNEL_SYSCALL }, + { 0X1C1FBFE7, &WrapI_IIIC, "sceKernelCreateHeap", 'i', "iixs", HLE_KERNEL_SYSCALL }, + { 0X237DBD4F, &WrapI_ICIUU, "sceKernelAllocPartitionMemory", 'i', "isixx", HLE_KERNEL_SYSCALL }, + { 0XB6D61D02, &WrapI_I, "sceKernelFreePartitionMemory", 'i', "i", HLE_KERNEL_SYSCALL }, + { 0X9D9A5BA1, &WrapU_I, "sceKernelGetBlockHeadAddr", 'x', "i", HLE_KERNEL_SYSCALL }, + { 0x9697CD32, &WrapU_I, "sceKernelPartitionTotalFreeMemSize", 'x', "i",HLE_KERNEL_SYSCALL }, + { 0xE6581468, &WrapU_I, "sceKernelPartitionMaxFreeMemSize", 'x', "i",HLE_KERNEL_SYSCALL }, }; void Register_SysMemForKernel() { From adf8d5e831bd21098856957e1c786603ee743ba7 Mon Sep 17 00:00:00 2001 From: sum2012 Date: Sun, 14 Jun 2020 09:43:08 +0800 Subject: [PATCH 2/2] Real support Code Geass: Lost Colors chinese patched version --- Core/PSPLoaders.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index eb910487f273..d29f1b3b8985 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -212,7 +212,7 @@ static const char *altBootNames[] = { "disc0:/PSP_GAME/SYSDIR/EBOOT.LEI", "disc0:/PSP_GAME/SYSDIR/EBOOT.DNR", "disc0:/PSP_GAME/SYSDIR/DBZ2.BIN", - "disc0:/PSP_GAME/SYSDIR/ss.RAW", + //"disc0:/PSP_GAME/SYSDIR/ss.RAW",//Code Geass: Lost Colors chinese version }; bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string) {