log: Rework NGAGE logging. (#14321)

This moves the NGAGE file logging into SDL_LogOutput(), following the pattern of the 3DS, VITA, PSP, etc.
This commit is contained in:
Eddy Jansson
2025-10-27 16:48:04 +01:00
committed by GitHub
parent 8ca8887885
commit f773da2273
3 changed files with 16 additions and 37 deletions

View File

@@ -36,13 +36,13 @@ bool NGAGE_IsClassicModel()
return (0x101f8c19 == phone_id);
}
void NGAGE_printf(const char *fmt, ...)
void NGAGE_DebugPrintf(const char *fmt, ...)
{
char buffer[512] = { 0 };
va_list ap;
va_start(ap, fmt);
vsprintf(buffer, fmt, ap);
(void)SDL_vsnprintf(buffer, sizeof(buffer), fmt, ap);
va_end(ap);
TBuf<512> buf;
@@ -51,21 +51,6 @@ void NGAGE_printf(const char *fmt, ...)
RDebug::Print(_L("%S"), &buf);
}
void NGAGE_vnprintf(char *buf, size_t size, const char *fmt, va_list ap)
{
char buffer[512] = { 0 };
vsprintf(buffer, fmt, ap);
TBuf<512> tbuf;
tbuf.Copy(TPtrC8((TText8 *)buffer));
RDebug::Print(_L("%S"), &tbuf);
strncpy(buf, buffer, size - 1);
buf[size - 1] = '\0';
}
TInt NGAGE_GetFreeHeapMemory()
{
TInt free = 0;

View File

@@ -28,6 +28,7 @@ extern "C" {
#endif
bool NGAGE_IsClassicModel();
void NGAGE_DebugPrintf(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
#ifdef __cplusplus
}