mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #84 from tmaul/master
add sceKernelMemcpy & sceRtcSetTick
This commit is contained in:
commit
d78bd1bdb4
2 changed files with 27 additions and 4 deletions
|
@ -418,7 +418,17 @@ void sceKernelMemset()
|
|||
DEBUG_LOG(HLE, "sceKernelMemset(ptr = %08x, c = %02x, n = %08x)", addr, c, n);
|
||||
for (size_t i = 0; i < n; i++)
|
||||
Memory::Write_U8((u8)c, addr + i);
|
||||
RETURN(addr); /* TODO: verify it should return this */
|
||||
RETURN(0); /* TODO: verify it should return this */
|
||||
}
|
||||
|
||||
u32 sceKernelMemcpy(u32 dst, u32 src, u32 size)
|
||||
{
|
||||
DEBUG_LOG(HLE, "sceKernelMemcpy(dest=%08x, src=%08x, size=%i)", dst, src, size);
|
||||
if (Memory::IsValidAddress(dst) && Memory::IsValidAddress(src+size)) // a bit of bound checking. Wrong??
|
||||
{
|
||||
memcpy(Memory::GetPointer(dst), Memory::GetPointer(src), size);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const HLEFunction Kernel_Library[] =
|
||||
|
@ -435,8 +445,7 @@ const HLEFunction Kernel_Library[] =
|
|||
{0x1FC64E09,&WrapV_UIU<sceKernelLockLwMutexCB>, "sceKernelLockLwMutexCB"},
|
||||
{0x15b6446b,&WrapV_UI<sceKernelUnlockLwMutex>, "sceKernelUnlockLwMutex"},
|
||||
{0x293b45b8,sceKernelGetThreadId, "sceKernelGetThreadId"},
|
||||
{0x1839852A,0,"sce_paf_private_memcpy"},
|
||||
{0xA089ECA4,0,"sce_paf_private_memset"},
|
||||
{0x1839852A,&WrapU_UUU<sceKernelMemcpy>,"sce_paf_private_memcpy"},
|
||||
};
|
||||
|
||||
void Register_Kernel_Library()
|
||||
|
|
|
@ -138,6 +138,20 @@ u32 sceRtcGetCurrentClockLocalTime(u32 pspTimePtr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
u32 sceRtcSetTick(u32 pspTimePtr, u32 tickPtr)
|
||||
{
|
||||
DEBUG_LOG(HLE, "HACK sceRtcSetTick(%08x, %08x)", pspTimePtr, tickPtr);
|
||||
if (Memory::IsValidAddress(pspTimePtr) && Memory::IsValidAddress(tickPtr))
|
||||
{
|
||||
time_t sec = (time_t)Memory::Read_U64(tickPtr);
|
||||
tm *local = localtime(&sec);
|
||||
ScePspDateTime ret;
|
||||
__RtcTmToPspTime(ret, local);
|
||||
Memory::WriteStruct(pspTimePtr, &ret);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 sceRtcGetTick(u32 pspTimePtr, u32 tickPtr)
|
||||
{
|
||||
DEBUG_LOG(HLE, "sceRtcGetTick(%08x, %08x)", pspTimePtr, tickPtr);
|
||||
|
@ -235,7 +249,7 @@ const HLEFunction sceRtc[] =
|
|||
{0x36075567, 0, "sceRtcGetDosTime"},
|
||||
{0x7ACE4C04, 0, "sceRtcSetWin32FileTime"},
|
||||
{0xCF561893, 0, "sceRtcGetWin32FileTime"},
|
||||
{0x7ED29E40, 0, "sceRtcSetTick"},
|
||||
{0x7ED29E40, WrapU_UU<sceRtcSetTick>, "sceRtcSetTick"},
|
||||
{0x6FF40ACC, WrapU_UU<sceRtcGetTick>, "sceRtcGetTick"},
|
||||
{0x9ED0AE87, 0, "sceRtcCompareTick"},
|
||||
{0x44F45E05, 0, "sceRtcTickAddTicks"},
|
||||
|
|
Loading…
Add table
Reference in a new issue