From 5142d7c01122cae0872c6d76234e5bad9a578ede Mon Sep 17 00:00:00 2001 From: Eladash Date: Fri, 6 Dec 2019 08:34:30 +0200 Subject: [PATCH] Minor fixup after #7068 --- rpcs3/Emu/Cell/lv2/sys_tty.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_tty.cpp b/rpcs3/Emu/Cell/lv2/sys_tty.cpp index fd6e2e6561..f74756ee67 100644 --- a/rpcs3/Emu/Cell/lv2/sys_tty.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_tty.cpp @@ -100,12 +100,19 @@ error_code sys_tty_write(s32 ch, vm::cptr buf, u32 len, vm::ptr pwrit } } - sys_tty.notice("sys_tty_write(ch=%d, buf=*0x%x(%s), len=%d, pwritelen=*0x%x)", ch, buf, msg, len, pwritelen); + sys_tty.notice("sys_tty_write(ch=%d, buf=*0x%x (ā€œ%sā€), len=%d, pwritelen=*0x%x)", ch, buf, msg, len, pwritelen); // Hack: write to tty even on CEX mode, but disable all error checks - if ((ch < 0 || ch > 15) && g_cfg.core.debug_console_mode) + if (ch < 0 || ch > 15) { - return CELL_EINVAL; + if (g_cfg.core.debug_console_mode) + { + return CELL_EINVAL; + } + else + { + msg.clear(); + } } if (g_cfg.core.debug_console_mode) @@ -128,13 +135,13 @@ error_code sys_tty_write(s32 ch, vm::cptr buf, u32 len, vm::ptr pwrit } else if (g_cfg.core.debug_console_mode) { - return CELL_EFAULT; + return {CELL_EFAULT, buf.addr()}; } } if (!pwritelen.try_write(len)) { - return CELL_EFAULT; + return {CELL_EFAULT, pwritelen}; } return CELL_OK;