mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-08 19:49:32 -04:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user