tp/libs/JSystem/JUtility/JUTAssert.cpp

89 lines
2.9 KiB
C++

//
// Generated By: dol2asm
// Translation Unit: JUTAssert
//
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTDbPrint.h"
#include "JSystem/JUtility/JUTDirectPrint.h"
#include "dol2asm.h"
#include "dolphin/types.h"
#include "dolphin/vi/vi.h"
//
// Declarations:
//
/* 802E495C-802E4960 2DF29C 0004+00 0/0 1/1 0/0 .text create__12JUTAssertionFv */
void JUTAssertion::create() {
/* empty function */
}
/* ############################################################################################## */
/* 80451530-80451538 000A30 0004+04 2/2 0/0 0/0 .sbss
* sMessageLife__Q212JUTAssertion23@unnamed@JUTAssert_cpp@ */
static u32 sMessageLife;
/* 802E4960-802E499C 2DF2A0 003C+00 2/2 0/0 0/0 .text flush_subroutine__12JUTAssertionFv
*/
u32 JUTAssertion::flush_subroutine() {
if (sMessageLife == 0) {
return 0;
}
if (sMessageLife != -1) {
sMessageLife--;
}
if (sMessageLife >= 5) {
return sMessageLife;
}
return 0;
}
/* ############################################################################################## */
/* 80434870-804348B0 061590 0040+00 2/2 0/0 0/0 .bss
* sMessageFileLine__Q212JUTAssertion23@unnamed@JUTAssert_cpp@ */
static char sMessageFileLine[64];
/* 804348B0-804349B0 0615D0 0100+00 2/2 0/0 0/0 .bss
* sMessageString__Q212JUTAssertion23@unnamed@JUTAssert_cpp@ */
static char sMessageString[256];
/* 802E499C-802E4A54 2DF2DC 00B8+00 0/0 1/1 0/0 .text flushMessage__12JUTAssertionFv */
void JUTAssertion::flushMessage() {
if (flush_subroutine() && sAssertVisible == true) {
JUTDirectPrint* manager = JUTDirectPrint::getManager();
JUtility::TColor color = manager->getCharColor();
manager->setCharColor(JUtility::TColor(255, 200, 200, 255));
manager->drawString(16, 16, sMessageFileLine);
manager->drawString(16, 24, sMessageString);
manager->setCharColor(color);
}
}
/* 802E4A54-802E4C34 2DF394 01E0+00 0/0 1/1 0/0 .text flushMessage_dbPrint__12JUTAssertionFv */
void JUTAssertion::flushMessage_dbPrint() {
if (flush_subroutine() && sAssertVisible == true && JUTDbPrint::getManager() != NULL) {
JUTFont* font = JUTDbPrint::getManager()->getFont();
if (font != NULL) {
u8 tmp = ((VIGetRetraceCount() & 0x3C) << 2) | 0xF;
font->setGX();
font->setCharColor(JUtility::TColor(255, tmp, tmp, 255));
font->drawString(30, 36, sMessageFileLine, true);
font->drawString(30, 54, sMessageString, true);
}
}
}
/* 802E4C34-802E4C3C 2DF574 0008+00 0/0 2/2 0/0 .text setVisible__12JUTAssertionFb */
void JUTAssertion::setVisible(bool visible) {
sAssertVisible = visible;
}
/* 802E4C3C-802E4C54 2DF57C 0018+00 0/0 2/2 0/0 .text setMessageCount__12JUTAssertionFi
*/
void JUTAssertion::setMessageCount(int msg_count) {
sMessageLife = msg_count <= 0 ? 0 : msg_count;
}