JUTAssert, JUTConsole, JUTException (#63)

* JUTAssert

* JUTConsole

* JUTException
This commit is contained in:
Jcw87
2023-09-20 21:07:19 -07:00
committed by GitHub
parent b2fc1d2683
commit 12ddfa5d00
9 changed files with 1455 additions and 158 deletions
+4 -1
View File
@@ -33,6 +33,9 @@ namespace JUTAssertion {
void setMessageCount(int);
};
extern bool sAssertVisible;
extern "C" {
void setWarningMessage_f_va(u32 device, const char* file, int line, const char* msg, va_list args);
void setLogMessage_f_va(u32 device, const char* file, int line, const char* msg, va_list args);
}
#endif /* JUTASSERT_H */
+8 -7
View File
@@ -67,6 +67,7 @@ public:
bool isVisible() const { return mVisible; }
void setVisible(bool visible) { mVisible = visible; }
u8 getLineAttr(int param_0) { return mBuf[(field_0x20 + 2) * param_0]; }
void setLineAttr(int param_0, u8 param_1) { mBuf[(field_0x20 + 2) * param_0] = param_1; }
u8* getLinePtr(int param_0) const { return &mBuf[(field_0x20 + 2) * param_0] + 1; }
int diffIndex(int param_0, int param_1) const {
@@ -77,13 +78,12 @@ public:
return diff += mMaxLines;
}
int nextIndex(int param_0) const {
int index = param_0 + 1;
if (mMaxLines <= index) {
index = 0;
}
int prevIndex(int index) const {
return --index < 0 ? index = mMaxLines - 1 : index;
}
return index;
int nextIndex(int index) const {
return ++index >= mMaxLines ? 0 : index;
}
void scrollToLastLine() { scroll(mMaxLines); }
@@ -94,7 +94,7 @@ private:
private:
/* 0x20 */ u32 field_0x20;
/* 0x24 */ u32 mMaxLines;
/* 0x24 */ int mMaxLines;
/* 0x28 */ u8* mBuf;
/* 0x2C */ bool field_0x2c;
/* 0x30 */ int field_0x30;
@@ -146,6 +146,7 @@ extern "C" JUTConsole* JUTGetWarningConsole();
extern "C" void JUTReportConsole_f_va(const char*, va_list);
extern "C" void JUTReportConsole_f(const char*, ...);
extern "C" void JUTWarningConsole(const char* message);
extern "C" void JUTWarningConsole_f_va(const char*, va_list);
extern "C" void JUTWarningConsole_f(const char* message, ...);
extern "C" void JUTReportConsole(const char* message);
@@ -21,8 +21,10 @@ public:
/* 802E4240 */ static JUTDirectPrint* start();
void* getFrameBuffer() { return field_0x00; }
bool isActive() const { return field_0x00 != 0; }
JUtility::TColor getCharColor() const { return mCharColor; }
void changeFrameBuffer(void *param_0) { changeFrameBuffer(param_0, mFrameBufferWidth, mFrameBufferHeight); }
static JUTDirectPrint* getManager() { return sDirectPrint; }
+3 -4
View File
@@ -56,7 +56,7 @@ public:
};
/* 802E1D5C */ JUTException(JUTDirectPrint*);
/* 802E40EC */ virtual ~JUTException();
/* 802E40EC */ virtual ~JUTException() {};
/* 802E22C4 */ void showFloatSub(int, f32);
/* 802E2454 */ void showFloat(OSContext*);
@@ -108,7 +108,7 @@ private:
static OSMessageQueue sMessageQueue;
static const char* sCpuExpName[17];
static JSUList<JUTException::JUTExMapFile> sMapFileList;
static u8 sMessageBuffer[4 + 4 /* padding */];
static OSMessage sMessageBuffer[1];
static JUTException* sErrorManager;
static OSErrorHandler sPreUserCallback;
static OSErrorHandler sPostUserCallback;
@@ -128,10 +128,9 @@ private:
/* 0x80 */ u32 mTraceSuppress;
/* 0x84 */ u32 field_0x98;
/* 0x88 */ u32 mPrintFlags;
/* 0x8C */ u32 mStackPointer;
};
STATIC_ASSERT(sizeof(JUTException) == 0x90);
STATIC_ASSERT(sizeof(JUTException) == 0x8C);
struct JUTWarn {
JUTWarn& operator<<(const char*) { return *this; }