diff --git a/rpcs3/Emu/Cell/lv2/sys_tty.cpp b/rpcs3/Emu/Cell/lv2/sys_tty.cpp index 4a9b62ca72..bb991d3d82 100644 --- a/rpcs3/Emu/Cell/lv2/sys_tty.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_tty.cpp @@ -1,25 +1,21 @@ #include "stdafx.h" -#include "Emu/Memory/Memory.h" -#include "Emu/System.h" - -#include "Emu/Cell/ErrorCodes.h" #include "sys_tty.h" +namespace vm { using namespace ps3; } + logs::channel sys_tty("sys_tty", logs::level::notice); extern fs::file g_tty; -s32 sys_tty_read(s32 ch, vm::ptr buf, u32 len, vm::ptr preadlen) +ppu_error_code sys_tty_read(s32 ch, vm::ptr buf, u32 len, vm::ptr preadlen) { - sys_tty.todo("sys_tty_read(ch=%d, buf=*0x%x, len=%d, preadlen=*0x%x)", ch, buf, len, preadlen); + sys_tty.fatal("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; + throw std::runtime_error("Unimplemented" HERE); } -s32 sys_tty_write(s32 ch, vm::cptr buf, u32 len, vm::ptr pwritelen) +ppu_error_code sys_tty_write(s32 ch, vm::cptr buf, u32 len, vm::ptr pwritelen) { sys_tty.notice("sys_tty_write(ch=%d, buf=*0x%x, len=%d, pwritelen=*0x%x)", ch, buf, len, pwritelen); @@ -28,7 +24,7 @@ s32 sys_tty_write(s32 ch, vm::cptr buf, u32 len, vm::ptr pwritelen) return CELL_EINVAL; } - if ((s32)len <= 0) + if (static_cast(len) <= 0) { *pwritelen = 0; diff --git a/rpcs3/Emu/Cell/lv2/sys_tty.h b/rpcs3/Emu/Cell/lv2/sys_tty.h index 7c7f7ddba0..4eb8f092d8 100644 --- a/rpcs3/Emu/Cell/lv2/sys_tty.h +++ b/rpcs3/Emu/Cell/lv2/sys_tty.h @@ -1,6 +1,7 @@ #pragma once -namespace vm { using namespace ps3; } +#include "Emu/Memory/Memory.h" +#include "Emu/Cell/ErrorCodes.h" // TTY channels enum @@ -25,5 +26,5 @@ enum }; // SysCalls -s32 sys_tty_read(s32 ch, vm::ptr buf, u32 len, vm::ptr preadlen); -s32 sys_tty_write(s32 ch, vm::cptr buf, u32 len, vm::ptr pwritelen); +ppu_error_code sys_tty_read(s32 ch, vm::ps3::ptr buf, u32 len, vm::ps3::ptr preadlen); +ppu_error_code sys_tty_write(s32 ch, vm::ps3::cptr buf, u32 len, vm::ps3::ptr pwritelen);