From 9708f279e0b11eda2c9bcc2a33232cd61229832f Mon Sep 17 00:00:00 2001 From: sudonim1 Date: Tue, 25 May 2010 22:12:14 +0000 Subject: [PATCH] DECI2: correct NUL writing for logging to remove garbage IOP: Fix return value on ioman.write(1, str) (stdout) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3080 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/IopBios.cpp | 2 ++ pcsx2/R5900OpcodeImpl.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pcsx2/IopBios.cpp b/pcsx2/IopBios.cpp index d387a8a2e4..95773c553d 100644 --- a/pcsx2/IopBios.cpp +++ b/pcsx2/IopBios.cpp @@ -21,6 +21,7 @@ namespace R3000A { +#define v0 (psxRegs.GPR.n.v0) #define a0 (psxRegs.GPR.n.a0) #define a1 (psxRegs.GPR.n.a1) #define a2 (psxRegs.GPR.n.a2) @@ -42,6 +43,7 @@ namespace ioman { { Console.Write(ConColor_IOP, L"%s", ShiftJIS_ConvertString(Ra1, a2).c_str()); pc = ra; + v0 = a2; return 1; } #endif diff --git a/pcsx2/R5900OpcodeImpl.cpp b/pcsx2/R5900OpcodeImpl.cpp index 011b93314b..f688522ce8 100644 --- a/pcsx2/R5900OpcodeImpl.cpp +++ b/pcsx2/R5900OpcodeImpl.cpp @@ -200,7 +200,7 @@ static int __Deci2Call(int call, u32 *addr) const int copylen = std::min(255, d2ptr[1]-0xc); memcpy(deci2buffer, pdeciaddr, copylen ); - deci2buffer[255] = '\0'; + deci2buffer[copylen] = '\0'; if( EmuConfig.Log.Deci2 ) Console.Write( ConColor_EE, L"%s", ShiftJIS_ConvertString(deci2buffer).c_str() );