Imp sceUtilsBufferCopyWithRange and sceUtilsBufferCopyByPollingWithRange (#13206)

* Imp sceUtilsBufferCopyWithRange

Used in Shin Sangoku Musou 6 Special chinese patach #13205

* Fix sceUtilsBufferCopyByPollingWithRange

* Add logging and reporting

* Fix logging and remove report by @hrydgard
This commit is contained in:
sum 2020-08-01 20:15:12 +08:00 committed by GitHub
parent 70802e61de
commit a897be92c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 0 deletions

View file

@ -303,6 +303,7 @@ void RegisterAllModules() {
Register_sceUsbAcc();
Register_sceUsbMic();
Register_sceOpenPSID_driver();
Register_semaphore();
// add new modules here.
}

View file

@ -26,6 +26,7 @@
#include "Core/HLE/sceKernelThread.h"
#include "Core/HLE/sceKernelSemaphore.h"
#include "Core/HLE/KernelWaitHelpers.h"
#include "Core/HLE/FunctionWrappers.h"
#define PSP_SEMA_ATTR_FIFO 0
#define PSP_SEMA_ATTR_PRIORITY 0x100
@ -457,3 +458,28 @@ int sceKernelPollSema(SceUID id, int wantedCount)
}
}
static u32 hleUtilsBufferCopyWithRange(u32 outAddr, int outSize, u32 inAddr, int inSize, int cmd)
{
int temp = sceUtilsBufferCopyWithRange((u8*)outAddr, outSize, (u8*)inAddr, inSize, cmd);
if (temp != 0) {
ERROR_LOG(SCEKERNEL, "hleUtilsBufferCopyWithRange: Failed with %d", temp);
}
return 0;
}
static int sceUtilsBufferCopyByPollingWithRange(u32 outAddr, int outSize, u32 inAddr, int inSize, int cmd)
{
return sceUtilsBufferCopyWithRange((u8*)outAddr, outSize, (u8*)inAddr, inSize, cmd);
}
const HLEFunction semaphore[] = {
{0x4C537C72, &WrapU_UIUII<hleUtilsBufferCopyWithRange>, "sceUtilsBufferCopyWithRange", 'x', "xixii" },
{0x77E97079, &WrapI_UIUII<sceUtilsBufferCopyByPollingWithRange>, "sceUtilsBufferCopyByPollingWithRange", 'i', "xixii" },
};
void Register_semaphore() {
RegisterModule("semaphore", ARRAY_SIZE(semaphore), semaphore);
}

View file

@ -31,3 +31,10 @@ void __KernelSemaTimeout(u64 userdata, int cycleslate);
void __KernelSemaInit();
void __KernelSemaDoState(PointerWrap &p);
KernelObject *__KernelSemaphoreObject();
void Register_semaphore();
extern "C"
{
#include "ext/libkirk/kirk_engine.h"
}