From 9870de26000c3761d1f7b72c38ff7beb31f895e7 Mon Sep 17 00:00:00 2001 From: raven02 Date: Thu, 31 Jan 2013 11:14:03 +0800 Subject: [PATCH] Implement sceKernelDevkitVersion --- Core/HLE/sceKernel.cpp | 13 +++++++++---- Core/HLE/sceKernel.h | 2 +- Core/HLE/sceKernelMemory.cpp | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index 362b36818..ca8571be2 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -215,11 +215,16 @@ u32 sceKernelRegisterExitCallback(u32 cbId) return 0; } -// TODO: What? -void sceKernelDevkitVersion() + +u32 sceKernelDevkitVersion() { - ERROR_LOG(HLE,"unimpl sceKernelDevkitVersion"); - RETURN(1); + int firmwareVersion = 150; + int major = firmwareVersion / 100; + int minor = (firmwareVersion / 10) % 10; + int revision = firmwareVersion % 10; + int devkitVersion = (major << 24) | (minor << 16) | (revision << 8) | 0x10; + DEBUG_LOG(HLE,"sceKernelDevkitVersion (%i) ", devkitVersion); + return devkitVersion; } u32 sceKernelRegisterKprintfHandler() diff --git a/Core/HLE/sceKernel.h b/Core/HLE/sceKernel.h index 96d597a71..6d3d85922 100644 --- a/Core/HLE/sceKernel.h +++ b/Core/HLE/sceKernel.h @@ -286,7 +286,7 @@ void sceKernelExitGame(); void sceKernelSleepThread(); void sceKernelSleepThreadCB(); -void sceKernelDevkitVersion(); +u32 sceKernelDevkitVersion(); u32 sceKernelRegisterKprintfHandler(); void sceKernelRegisterDefaultExceptionHandler(); diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index b94b27cdd..187021224 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -1125,9 +1125,9 @@ u32 GetMemoryBlockPtr(u32 uid, u32 addr) { } const HLEFunction SysMemUserForUser[] = { - {0xA291F107,sceKernelMaxFreeMemSize, "sceKernelMaxFreeMemSize"}, + {0xA291F107,sceKernelMaxFreeMemSize,"sceKernelMaxFreeMemSize"}, {0xF919F628,sceKernelTotalFreeMemSize,"sceKernelTotalFreeMemSize"}, - {0x3FC9AE6A,sceKernelDevkitVersion, "sceKernelDevkitVersion"}, + {0x3FC9AE6A,WrapU_V,"sceKernelDevkitVersion"}, {0x237DBD4F,sceKernelAllocPartitionMemory,"sceKernelAllocPartitionMemory"}, //(int size) ? {0xB6D61D02,sceKernelFreePartitionMemory,"sceKernelFreePartitionMemory"}, //(void *ptr) ? {0x9D9A5BA1,sceKernelGetBlockHeadAddr,"sceKernelGetBlockHeadAddr"}, //(void *ptr) ?