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:
parent
656999d4c2
commit
3d80d454ce
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue