mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-22 03:15:01 +00:00
printf implementation
This commit is contained in:
parent
cefd3d95ed
commit
551455e56e
6 changed files with 72 additions and 11 deletions
|
@ -56,6 +56,7 @@
|
|||
#include <cstdint>
|
||||
|
||||
#include "va_ctx.h"
|
||||
#include <stdio.h>
|
||||
|
||||
namespace Emulator::HLE::Libraries::LibC {
|
||||
// ntoa conversion buffer size, this must be big enough to hold
|
||||
|
@ -671,6 +672,14 @@ static inline int _vsnprintf(out_fct_type out, char* buffer, const size_t maxlen
|
|||
return (int)idx;
|
||||
}
|
||||
|
||||
static int printf_ctx(VaCtx* ctx) {
|
||||
const char* format = vaArgPtr<const char>(&ctx->va_list);
|
||||
char buffer[256];
|
||||
int result= _vsnprintf(_out_buffer, buffer, (size_t)-1, format, &ctx->va_list);
|
||||
puts(buffer);
|
||||
return result;
|
||||
}
|
||||
|
||||
#if 0
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue