mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 12:05:23 +00:00
Implemented _sys_memchr
This commit is contained in:
parent
8202352452
commit
4a512694d9
1 changed files with 20 additions and 2 deletions
|
@ -97,9 +97,27 @@ s32 _sys_memcmp(vm::cptr<void> buf1, vm::cptr<void> buf2, u32 size)
|
|||
return std::memcmp(buf1.get_ptr(), buf2.get_ptr(), size);
|
||||
}
|
||||
|
||||
s32 _sys_memchr()
|
||||
vm::ptr<u8> _sys_memchr(vm::ptr<u8> buf, u8 ch, s32 size)
|
||||
{
|
||||
fmt::throw_exception("Unimplemented" HERE);
|
||||
sysPrxForUser.trace("_sys_memchr(buf=*0x%x, ch=0x%x, size=0x%x)", buf, ch, size);
|
||||
|
||||
if (!buf)
|
||||
{
|
||||
return vm::null;
|
||||
}
|
||||
|
||||
while (size > 0)
|
||||
{
|
||||
if (*buf == ch)
|
||||
{
|
||||
return buf;
|
||||
}
|
||||
|
||||
buf++;
|
||||
size--;
|
||||
}
|
||||
|
||||
return vm::null;
|
||||
}
|
||||
|
||||
vm::ptr<void> _sys_memmove(vm::ptr<void> dst, vm::cptr<void> src, u32 size)
|
||||
|
|
Loading…
Add table
Reference in a new issue