mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-07 13:23:27 -04:00
JUT cleanup
This commit is contained in:
+2
-2
@@ -943,7 +943,7 @@ config.libs = [
|
||||
Object(Matching, "JSystem/JUtility/JUTResFont.cpp"),
|
||||
Object(Matching, "JSystem/JUtility/JUTDbPrint.cpp"),
|
||||
Object(Matching, "JSystem/JUtility/JUTGamePad.cpp"),
|
||||
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "JSystem/JUtility/JUTException.cpp"),
|
||||
Object(Matching, "JSystem/JUtility/JUTException.cpp"),
|
||||
Object(Matching, "JSystem/JUtility/JUTDirectPrint.cpp"),
|
||||
Object(Matching, "JSystem/JUtility/JUTAssert.cpp"),
|
||||
Object(Matching, "JSystem/JUtility/JUTVideo.cpp"),
|
||||
@@ -952,7 +952,7 @@ config.libs = [
|
||||
Object(Matching, "JSystem/JUtility/JUTProcBar.cpp"),
|
||||
Object(Matching, "JSystem/JUtility/JUTConsole.cpp"),
|
||||
Object(Matching, "JSystem/JUtility/JUTDirectFile.cpp"),
|
||||
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "JSystem/JUtility/JUTGba.cpp"),
|
||||
Object(Matching, "JSystem/JUtility/JUTGba.cpp"),
|
||||
Object(Matching, "JSystem/JUtility/JUTFontData_Ascfont_fix12.cpp"), # Originally a .s file
|
||||
],
|
||||
),
|
||||
|
||||
@@ -24,9 +24,12 @@
|
||||
#define JUT_LOG(LINE, ...) \
|
||||
JUTAssertion::setLogMessage_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__)
|
||||
|
||||
#define JUT_CONFIRM(LINE, COND) \
|
||||
#define JUT_SET_CONFIRM(LINE, COND) \
|
||||
JUTAssertion::setConfirmMessage(JUTAssertion::getSDevice(), __FILE__, LINE, COND, #COND)
|
||||
|
||||
#define JUT_CONFIRM(LINE, COND) \
|
||||
JUT_SET_CONFIRM(LINE, COND)
|
||||
|
||||
namespace JUTAssertion {
|
||||
u32 getSDevice();
|
||||
void showAssert(u32 device, const char * file, int line, const char * assertion);
|
||||
|
||||
@@ -75,7 +75,7 @@ JFWDisplay::~JFWDisplay() {
|
||||
|
||||
/* 80255354-802553EC .text createManager__10JFWDisplayFP7JKRHeapQ26JUTXfb10EXfbNumberb */
|
||||
JFWDisplay* JFWDisplay::createManager(JKRHeap* p_heap, JUTXfb::EXfbNumber xfb_num, bool enableAlpha) {
|
||||
JUT_CONFIRM(VERSION_SELECT(244, 244, 243, 243), sManager == 0);
|
||||
JUT_CONFIRM(VERSION_SELECT(244, 244, 243, 243), sManager == NULL);
|
||||
if(sManager == 0) {
|
||||
sManager = new JFWDisplay(0, p_heap, xfb_num, enableAlpha);
|
||||
}
|
||||
|
||||
@@ -164,25 +164,25 @@ void TObject::process_sequence_() {
|
||||
switch (type) {
|
||||
case 0:
|
||||
JUT_EXPECT(u32Value == 0);
|
||||
JUT_EXPECT(pContent == 0);
|
||||
JUT_EXPECT(pContent == NULL);
|
||||
break;
|
||||
case 1:
|
||||
JUT_EXPECT(pContent == 0);
|
||||
JUT_EXPECT(pContent == NULL);
|
||||
setFlag_operation_(u32Value);
|
||||
break;
|
||||
case 2:
|
||||
JUT_EXPECT(pContent == 0);
|
||||
JUT_EXPECT(pContent == NULL);
|
||||
setWait(u32Value);
|
||||
break;
|
||||
case 3: {
|
||||
JUT_EXPECT(pContent == 0);
|
||||
JUT_EXPECT(pContent == NULL);
|
||||
s32 off = toInt32FromUInt24_(u32Value);
|
||||
void* nextseq = (void*)getSequence_offset(off);
|
||||
setSequence_next(nextseq);
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
JUT_EXPECT(pContent == 0);
|
||||
JUT_EXPECT(pContent == NULL);
|
||||
u32 val = toInt32FromUInt24_(u32Value);
|
||||
suspend(val);
|
||||
break;
|
||||
|
||||
@@ -124,7 +124,11 @@ u32 JUTException::fpscr;
|
||||
void JUTException::errorHandler(OSError error, OSContext* context, u32 param_3, u32 param_4) {
|
||||
if (error == 0x10) {
|
||||
OSReport("\x1b[41;37m");
|
||||
#if VERSION == VERSION_DEMO
|
||||
OSReport(" FPE: 浮動小数点例外が発生しました。アドレスは %08x\n", context->srr0);
|
||||
#else
|
||||
OSReport(" FPE: 浮動小数点例外が発生しました。アドレスは %08x fpscr=%08x\n", context->srr0, context->fpscr);
|
||||
#endif
|
||||
u8 stack_38[0x20];
|
||||
u32 stack_3c;
|
||||
u32 stack_40;
|
||||
@@ -993,7 +997,11 @@ void JUTException::createConsole(void* console_buffer, u32 console_buffer_size)
|
||||
manager->setDirectConsole(sConsole);
|
||||
|
||||
sConsole->setFontSize(10.0, 6.0);
|
||||
#if VERSION == VERSION_DEMO
|
||||
sConsole->setPosition(15, 26);
|
||||
#else
|
||||
sConsole->setPosition(12, 40);
|
||||
#endif
|
||||
sConsole->setHeight(23);
|
||||
sConsole->setVisible(true);
|
||||
sConsole->setOutput(JUTConsole::OUTPUT_OSREPORT | JUTConsole::OUTPUT_CONSOLE);
|
||||
|
||||
@@ -224,7 +224,9 @@ BOOL JUTGba::resultGetStatus(int param_1, u8* param_2) {
|
||||
void* JUTGba::gbaThreadMain(void* param_1) {
|
||||
JUTGbaParam* param = (JUTGbaParam*)param_1;
|
||||
{ JKRThread jkrThread(OSGetCurrentThread(), 0); }
|
||||
#if VERSION > VERSION_DEMO
|
||||
JKRSetCurrentHeap(NULL);
|
||||
#endif
|
||||
JUTGbaThreadVar threadVar;
|
||||
threadVar.field_0x0 = param;
|
||||
while (true) {
|
||||
@@ -279,7 +281,7 @@ void* JUTGba::gbaThreadMain(void* param_1) {
|
||||
sManager->gbaThread_GetStatus(&threadVar);
|
||||
break;
|
||||
default:
|
||||
OSPanic(__FILE__, 623, "UNKNOWN GBA COMMAND.");
|
||||
OSPanic(__FILE__, VERSION_SELECT(622, 623, 623, 623), "UNKNOWN GBA COMMAND.");
|
||||
break;
|
||||
}
|
||||
if (threadVar.field_0x14) {
|
||||
|
||||
@@ -63,7 +63,7 @@ void JUTXfb::delXfb(int xfbIdx) {
|
||||
|
||||
/* 802C837C-802C8410 .text createManager__6JUTXfbFPC16_GXRenderModeObjP7JKRHeapQ26JUTXfb10EXfbNumber */
|
||||
JUTXfb* JUTXfb::createManager(const GXRenderModeObj* pObj, JKRHeap* pHeap, JUTXfb::EXfbNumber xfbNum) {
|
||||
JUT_CONFIRM(VERSION_SELECT(198, 198, 203, 203), sManager == 0);
|
||||
JUT_CONFIRM(VERSION_SELECT(198, 198, 203, 203), sManager == NULL);
|
||||
if (sManager == NULL) {
|
||||
sManager = new JUTXfb(pObj, pHeap, xfbNum);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ cXyz cXyz::outprod(const Vec& vec) const {
|
||||
/* 80245874-80245918 .text norm__4cXyzCFv */
|
||||
cXyz cXyz::norm(void) const {
|
||||
Vec ret;
|
||||
JUT_CONFIRM(233, isNearZeroSquare() == 0);
|
||||
JUT_CONFIRM(233, isNearZeroSquare() == FALSE);
|
||||
VECNormalize(this, &ret);
|
||||
return cXyz(ret);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user