mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
Removed external functions from SysCalls.h
* Replace `int` with `s32` as return type for syscalls. * Renamed `SC_Something.*` files with the proper lv2 name `sys_something.*`. * Moving away from the lv2, those functions and folders that doesn't correspond to lv2 functions. E.g. module functions from sys_io, sysPrxForUser, cellGcmSys. * Splitted some files (memory -> memory+mmapper) and merged other ones (event+event_flag ->event, spu+spu_thread -> spu), according to common sense, PSDevWiki docs, and checking firmware files. * Removed external functions from `SysCalls.h`. NOTE: What should we do about: cellGcmCallback? It's not a lv2 syscall but it appears on the sc_table and it is actually called in games. Is this some kind of hack?
This commit is contained in:
parent
7218ccfe66
commit
08d61163ea
73 changed files with 2243 additions and 968 deletions
37
rpcs3/Emu/SysCalls/lv2/sys_tty.cpp
Normal file
37
rpcs3/Emu/SysCalls/lv2/sys_tty.cpp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#include "stdafx.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
|
||||
s32 sys_tty_read(u32 ch, u64 buf_addr, u32 len, u64 preadlen_addr)
|
||||
{
|
||||
//we currently do not support reading from the Console
|
||||
LOG_WARNING(HLE, "sys_tty_read: ch: %d, buf addr: %llx, len: %d", ch, buf_addr, len);
|
||||
Memory.Write32NN(preadlen_addr, len);
|
||||
Emu.Pause();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sys_tty_write(u32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr)
|
||||
{
|
||||
if(ch > 15 || (s32)len <= 0) return CELL_EINVAL;
|
||||
if(!Memory.IsGoodAddr(buf_addr)) return CELL_EFAULT;
|
||||
|
||||
//ch 0 seems to be stdout and ch 1 stderr
|
||||
if (ch == 1)
|
||||
{
|
||||
LOG_ERROR(TTY, Memory.ReadString(buf_addr, len));
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_NOTICE(TTY, Memory.ReadString(buf_addr, len));
|
||||
}
|
||||
|
||||
if(!Memory.IsGoodAddr(pwritelen_addr)) return CELL_EFAULT;
|
||||
|
||||
Memory.Write32(pwritelen_addr, len);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue