mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
Some memory functions removed
This commit is contained in:
parent
d0e532e7ce
commit
1337cf4f04
20 changed files with 344 additions and 374 deletions
|
|
@ -8,31 +8,31 @@
|
|||
|
||||
SysCallBase sys_tty("sys_tty");
|
||||
|
||||
s32 sys_tty_read(u32 ch, u64 buf_addr, u32 len, u64 preadlen_addr)
|
||||
s32 sys_tty_read(s32 ch, vm::ptr<void> buf, u32 len, vm::ptr<u32> preadlen)
|
||||
{
|
||||
sys_tty.Error("sys_tty_read(ch=%d, buf_addr=%llx, len=%d, preadlen_addr=0x%llx)", ch, buf_addr, len, preadlen_addr);
|
||||
sys_tty.Error("sys_tty_read(ch=%d, buf_addr=0x%x, len=%d, preadlen_addr=0x%x)", ch, buf.addr(), len, preadlen.addr());
|
||||
|
||||
// We currently do not support reading from the Console
|
||||
Memory.Write32(preadlen_addr, len);
|
||||
*preadlen = 0;
|
||||
Emu.Pause();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_tty_write(u32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr)
|
||||
s32 sys_tty_write(s32 ch, vm::ptr<const void> buf, u32 len, vm::ptr<u32> pwritelen)
|
||||
{
|
||||
sys_tty.Log("sys_tty_write(ch=%d, buf_addr=%llx, len=%d, preadlen_addr=0x%llx)", ch, buf_addr, len, pwritelen_addr);
|
||||
sys_tty.Log("sys_tty_write(ch=%d, buf_addr=0x%x, len=%d, preadlen_addr=0x%x)", ch, buf.addr(), len, pwritelen.addr());
|
||||
|
||||
if(ch > 15 || (s32)len <= 0) return CELL_EINVAL;
|
||||
|
||||
const std::string data((const char*)buf.get_ptr(), len);
|
||||
|
||||
if (ch == SYS_TTYP_PPU_STDOUT || ch == SYS_TTYP_SPU_STDOUT || (ch >= SYS_TTYP_USER1 && ch <= SYS_TTYP_USER13)) {
|
||||
LOG_NOTICE(TTY, "%s", Memory.ReadString(buf_addr, len).c_str());
|
||||
LOG_NOTICE(TTY, "%s", data.c_str());
|
||||
}
|
||||
if (ch == SYS_TTYP_PPU_STDERR) {
|
||||
LOG_ERROR(TTY, "%s", Memory.ReadString(buf_addr, len).c_str());
|
||||
LOG_ERROR(TTY, "%s", data.c_str());
|
||||
}
|
||||
|
||||
Memory.Write32(pwritelen_addr, len);
|
||||
|
||||
*pwritelen = data.size();
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue