JUtility matching for debug (#3074)

* Jut cleanup work

* data section fix

* match the last of JUtility

* added more helpful comment

* Add missed null terminator

* do while -> while loop

* replace more do whiles

* Fix wii regression

* Add suggestions

* fix null check

---------

Co-authored-by: roeming <roeming@users.noreply.github.com>
This commit is contained in:
roeming
2026-01-28 22:38:20 -05:00
committed by GitHub
parent 13d3ae312a
commit 4e8adeef59
19 changed files with 341 additions and 251 deletions
+12 -13
View File
@@ -6,15 +6,6 @@
#include "JSystem/JUtility/JUTVideo.h"
#include <cstdio>
inline void enter_(int param_0, int param_1, int param_2, const char* fmt, va_list args) {
char buf[0x100];
int ret = vsnprintf(buf, 0x100, fmt, args);
if (ret < 0) {
return;
}
JUTDbPrint::getManager()->enter(param_0, param_1, param_2, buf, ret < 0x100 ? ret : 0xFF);
}
JUTDbPrint::JUTDbPrint(JUTFont* pFont, JKRHeap* pHeap) {
mFont = pFont;
mFirst = NULL;
@@ -59,9 +50,13 @@ void JUTDbPrint::enter(int param_0, int param_1, int param_2, const char* param_
}
}
static void dummy() {
va_list args;
enter_(0, 0, 0, 0, args);
static inline void enter_(int param_0, int param_1, int param_2, const char* fmt, va_list args) {
char buf[0x100];
int ret = vsnprintf(buf, 0x100, fmt, args);
if (ret >= 0) {
JUTDbPrint::getManager()->enter(param_0, param_1, param_2, buf, ret < 0x100 ? ret : 0xFF);
}
}
void JUTDbPrint::flush() {
@@ -101,13 +96,17 @@ void JUTDbPrint::drawString(int posX, int posY, int len, const u8* str) {
}
void JUTReport(int param_0, int param_1, char const* fmt, ...) {
UNUSED(fmt); // although not really unused
va_list args;
va_start(args, fmt);
enter_(param_0, param_1, 1, fmt, args);
enter_(param_0, param_1, TRUE, fmt, args);
va_end(args);
}
void JUTReport(int param_0, int param_1, int param_2, char const* fmt, ...) {
UNUSED(fmt); // although not really unused
va_list args;
va_start(args, fmt);
enter_(param_0, param_1, param_2, fmt, args);