mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 23:15:18 +00:00
vm::ptr<char> formatting
This commit is contained in:
parent
8c8242345e
commit
fc56e70172
23 changed files with 198 additions and 165 deletions
|
|
@ -201,25 +201,20 @@ namespace sce_libc_func
|
|||
|
||||
void printf(ARMv7Thread& cpu, vm::cptr<char> fmt, arm_va_args_t va_args)
|
||||
{
|
||||
sceLibc.warning("printf(fmt=*0x%x)", fmt);
|
||||
sceLibc.trace("*** *fmt = '%s'", fmt.get_ptr());
|
||||
|
||||
const std::string& result = arm_fmt(cpu, fmt, va_args.count);
|
||||
sceLibc.trace("*** -> '%s'", result);
|
||||
sceLibc.warning("printf(fmt=%s, ...)", fmt);
|
||||
|
||||
if (g_tty)
|
||||
{
|
||||
g_tty.write(result);
|
||||
g_tty.write(arm_fmt(cpu, fmt, va_args.count));
|
||||
}
|
||||
}
|
||||
|
||||
void sprintf(ARMv7Thread& cpu, vm::ptr<char> str, vm::cptr<char> fmt, arm_va_args_t va_args)
|
||||
{
|
||||
sceLibc.warning("sprintf(str=*0x%x, fmt=*0x%x)", str, fmt);
|
||||
sceLibc.trace("*** *fmt = '%s'", fmt.get_ptr());
|
||||
sceLibc.warning("sprintf(str=*0x%x, fmt=%s, ...)", str, fmt);
|
||||
|
||||
const std::string& result = arm_fmt(cpu, fmt, va_args.count);
|
||||
sceLibc.trace("*** -> '%s'", result);
|
||||
sceLibc.trace("sprintf() -> '%s'", result);
|
||||
|
||||
::memcpy(str.get_ptr(), result.c_str(), result.size() + 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue