HLE_OS: Implement %n in GetStringVA

%n writes to a pointer that's provided as a parameter.
We didn't have a custom implementation of this before,
meaning that %n would trigger a write to the host
memory instead of the emulated memory!
This commit is contained in:
JosJuice 2016-11-12 16:19:10 +01:00
parent 656999d4c2
commit 3d80d454ce
1 changed files with 5 additions and 0 deletions

View File

@ -137,6 +137,11 @@ std::string GetStringVA(u32 strReg)
result += StringFromFormat("%x", (u32)Parameter);
break;
case 'n':
PowerPC::HostWrite_U32(static_cast<u32>(result.size()), static_cast<u32>(Parameter));
// %n doesn't output anything, so the result variable is untouched
break;
default:
result += StringFromFormat(ArgumentBuffer.c_str(), Parameter);
break;