Implemented sys_get_random_number

This commit is contained in:
Raul Tambre 2014-09-12 15:18:27 +03:00
parent 98c67389b0
commit 6d0fae09c5

View File

@ -24,7 +24,7 @@ Module *sysPrxForUser = nullptr;
extern u32 LoadSpuImage(vfsStream& stream, u32& spu_ep);
int _sys_heap_create_heap(const u32 heap_addr, const u32 align, const u32 size)
{
{
sysPrxForUser->Warning("_sys_heap_create_heap(heap_addr=0x%x, align=0x%x, size=0x%x)", heap_addr, align, size);
u32 heap_id = sysPrxForUser->GetNewId(new HeapInfo(heap_addr, align, size));
@ -149,6 +149,15 @@ int sys_raw_spu_image_load(int id, vm::ptr<sys_spu_image> img)
return CELL_OK;
}
int sys_get_random_number(u32 addr, u64 size)
{
sysPrxForUser->Warning("sys_get_random_number(addr=0x%x, size=%d)", addr, size);
addr = rand() % size;
return CELL_OK;
}
vm::ptr<void> _sys_memset(vm::ptr<void> dst, s32 value, u32 size)
{
sysPrxForUser->Log("_sys_memset(dst_addr=0x%x, value=%d, size=%d)", dst.addr(), value, size);
@ -319,6 +328,9 @@ s32 _unnamed_E75C40F2(u32 dest)
void sysPrxForUser_init()
{
// Setup random number generator
srand(time(NULL));
REG_FUNC(sysPrxForUser, sys_initialize_tls);
REG_FUNC(sysPrxForUser, sys_lwmutex_create);
@ -378,6 +390,8 @@ void sysPrxForUser_init()
sysPrxForUser->AddFunc(0x52aadadf, sys_lwcond_signal_to);
sysPrxForUser->AddFunc(0x2a6d9d51, sys_lwcond_wait);
sysPrxForUser->AddFunc(0x71a8472a, sys_get_random_number);
sysPrxForUser->AddFunc(0x8c2bb498, sys_spinlock_initialize);
sysPrxForUser->AddFunc(0xa285139d, sys_spinlock_lock);
sysPrxForUser->AddFunc(0x722a0254, sys_spinlock_trylock);