mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 06:26:49 +00:00
Partial commit: Syscalls
This commit is contained in:
parent
5637c22363
commit
42e1d4d752
50 changed files with 677 additions and 874 deletions
42
rpcs3/Emu/Cell/lv2/sys_tty.cpp
Normal file
42
rpcs3/Emu/Cell/lv2/sys_tty.cpp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#include "stdafx.h"
|
||||
#include "Utilities/Config.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
#include "Emu/Cell/ErrorCodes.h"
|
||||
#include "sys_tty.h"
|
||||
|
||||
LOG_CHANNEL(sys_tty);
|
||||
|
||||
s32 sys_tty_read(s32 ch, vm::ptr<char> buf, u32 len, vm::ptr<u32> preadlen)
|
||||
{
|
||||
sys_tty.todo("sys_tty_read(ch=%d, buf=*0x%x, len=%d, preadlen=*0x%x)", ch, buf, len, preadlen);
|
||||
|
||||
// We currently do not support reading from the Console
|
||||
*preadlen = 0;
|
||||
Emu.Pause();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_tty_write(s32 ch, vm::cptr<char> buf, u32 len, vm::ptr<u32> pwritelen)
|
||||
{
|
||||
sys_tty.notice("sys_tty_write(ch=%d, buf=*0x%x, len=%d, pwritelen=*0x%x)", ch, buf, len, pwritelen);
|
||||
|
||||
if (ch > 15)
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
if ((s32)len <= 0)
|
||||
{
|
||||
*pwritelen = 0;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
_log::g_tty_file.log({ buf.get_ptr(), len });
|
||||
|
||||
*pwritelen = len;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue