Merge remote-tracking branch 'Upstream/master'

This commit is contained in:
jdflyer
2022-01-16 15:20:32 -07:00
203 changed files with 4278 additions and 8902 deletions
+43 -104
View File
@@ -4,57 +4,11 @@
//
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTDbPrint.h"
#include "JSystem/JUtility/JUTDirectPrint.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct JUtility {
struct TColor {};
};
struct JUTFont {
/* 802DED70 */ void setCharColor(JUtility::TColor);
/* 802DEE28 */ void drawString_size_scale(f32, f32, f32, f32, char const*, u32, bool);
};
struct JUTDirectPrint {
/* 802E46D8 */ void drawString(u16, u16, char*);
/* 802E4798 */ void setCharColor(JUtility::TColor);
static u8 sDirectPrint[4 + 4 /* padding */];
};
struct JUTDbPrint {
static u8 sDebugPrint[4 + 4 /* padding */];
};
//
// Forward References:
//
extern "C" void create__12JUTAssertionFv();
extern "C" void flush_subroutine__12JUTAssertionFv();
extern "C" void flushMessage__12JUTAssertionFv();
extern "C" void flushMessage_dbPrint__12JUTAssertionFv();
extern "C" void setVisible__12JUTAssertionFb();
extern "C" void setMessageCount__12JUTAssertionFi();
//
// External References:
//
extern "C" void setCharColor__7JUTFontFQ28JUtility6TColor();
extern "C" void drawString_size_scale__7JUTFontFffffPCcUlb();
extern "C" void drawString__14JUTDirectPrintFUsUsPc();
extern "C" void setCharColor__14JUTDirectPrintFQ28JUtility6TColor();
extern "C" void VIGetRetraceCount();
extern "C" void strlen();
extern "C" extern u8 data_804508F8[8];
extern "C" u8 sDebugPrint__10JUTDbPrint[4 + 4 /* padding */];
extern "C" u8 sDirectPrint__14JUTDirectPrint[4 + 4 /* padding */];
#include "dolphin/vi/vi.h"
//
// Declarations:
@@ -68,82 +22,67 @@ void JUTAssertion::create() {
/* ############################################################################################## */
/* 80451530-80451538 000A30 0004+04 2/2 0/0 0/0 .sbss
* sMessageLife__Q212JUTAssertion23@unnamed@JUTAssert_cpp@ */
static s32 data_80451530;
static u32 sMessageLife;
/* 802E4960-802E499C 2DF2A0 003C+00 2/2 0/0 0/0 .text flush_subroutine__12JUTAssertionFv
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JUTAssertion::flush_subroutine() {
nofralloc
#include "asm/JSystem/JUtility/JUTAssert/flush_subroutine__12JUTAssertionFv.s"
u32 JUTAssertion::flush_subroutine() {
if (sMessageLife == 0) {
return 0;
}
if (sMessageLife != -1) {
sMessageLife--;
}
if (sMessageLife >= 5) {
return sMessageLife;
}
return 0;
}
#pragma pop
/* ############################################################################################## */
/* 80434870-804348B0 061590 0040+00 2/2 0/0 0/0 .bss
* sMessageFileLine__Q212JUTAssertion23@unnamed@JUTAssert_cpp@ */
static u8 data_80434870[64];
static char sMessageFileLine[64];
/* 804348B0-804349B0 0615D0 0100+00 2/2 0/0 0/0 .bss
* sMessageString__Q212JUTAssertion23@unnamed@JUTAssert_cpp@ */
static u8 data_804348B0[256];
static char sMessageString[256];
/* 802E499C-802E4A54 2DF2DC 00B8+00 0/0 1/1 0/0 .text flushMessage__12JUTAssertionFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JUTAssertion::flushMessage() {
nofralloc
#include "asm/JSystem/JUtility/JUTAssert/flushMessage__12JUTAssertionFv.s"
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);
}
}
#pragma pop
/* ############################################################################################## */
/* 804560B8-804560BC 0046B8 0004+00 1/1 0/0 0/0 .sdata2 @724 */
SECTION_SDATA2 static f32 lit_724 = 30.0f;
/* 804560BC-804560C0 0046BC 0004+00 1/1 0/0 0/0 .sdata2 @725 */
SECTION_SDATA2 static f32 lit_725 = 36.0f;
/* 804560C0-804560C8 0046C0 0004+04 1/1 0/0 0/0 .sdata2 @726 */
SECTION_SDATA2 static f32 lit_726[1 + 1 /* padding */] = {
54.0f,
/* padding */
0.0f,
};
/* 804560C8-804560D0 0046C8 0008+00 1/1 0/0 0/0 .sdata2 @728 */
SECTION_SDATA2 static f64 lit_728 = 4503601774854144.0 /* cast s32 to float */;
/* 802E4A54-802E4C34 2DF394 01E0+00 0/0 1/1 0/0 .text flushMessage_dbPrint__12JUTAssertionFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JUTAssertion::flushMessage_dbPrint() {
nofralloc
#include "asm/JSystem/JUtility/JUTAssert/flushMessage_dbPrint__12JUTAssertionFv.s"
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);
}
}
}
#pragma pop
/* 802E4C34-802E4C3C 2DF574 0008+00 0/0 2/2 0/0 .text setVisible__12JUTAssertionFb */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JUTAssertion::setVisible(bool param_0) {
nofralloc
#include "asm/JSystem/JUtility/JUTAssert/setVisible__12JUTAssertionFb.s"
void JUTAssertion::setVisible(bool visible) {
sAssertVisible = visible;
}
#pragma pop
/* 802E4C3C-802E4C54 2DF57C 0018+00 0/0 2/2 0/0 .text setMessageCount__12JUTAssertionFi
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JUTAssertion::setMessageCount(int param_0) {
nofralloc
#include "asm/JSystem/JUtility/JUTAssert/setMessageCount__12JUTAssertionFi.s"
void JUTAssertion::setMessageCount(int msg_count) {
sMessageLife = msg_count <= 0 ? 0 : msg_count;
}
#pragma pop
-1
View File
@@ -90,7 +90,6 @@ extern "C" void _restgpr_20();
extern "C" void _restgpr_27();
extern "C" void _restgpr_28();
extern "C" void _restgpr_29();
extern "C" void strlen();
extern "C" extern void* __vt__14J2DGrafContext[10];
extern "C" extern void* __vt__13J2DOrthoGraph[10];
extern "C" u8 sCurrentHeap__7JKRHeap[4];
+3 -5
View File
@@ -7,10 +7,10 @@
#include "JSystem/JUtility/JUTConsole.h"
#include "JSystem/JUtility/JUTDirectPrint.h"
#include "MSL_C.PPCEABI.bare.H/MSL_Common/Src/float.h"
#include "MSL_C.PPCEABI.bare.H/MSL_Common/Src/printf.h"
#include "Runtime.PPCEABI.H/__va_arg.h"
#include "dol2asm.h"
#include "dolphin/types.h"
#include "msl_c/string.h"
//
// Forward References:
@@ -1126,7 +1126,7 @@ void JUTException::createConsole(void* console_buffer, u32 console_buffer_size)
sConsole->setPosition(15, 26);
sConsole->setHeight(23);
sConsole->setVisible(true);
sConsole->setOutput(3);
sConsole->setOutput(JUTConsole::OUTPUT_OSREPORT | JUTConsole::OUTPUT_CONSOLE);
}
}
@@ -1146,8 +1146,6 @@ JUTException::~JUTException() {}
/* ##############################################################################################
*/
/* 804508F8-80450900 000378 0008+00 0/0 3/3 0/0 .sdata None */
SECTION_SDATA extern u8 data_804508F8[8] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
SECTION_SDATA extern bool sAssertVisible = true;
/* 8039D490-8039D490 029AF0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
+28 -71
View File
@@ -4,93 +4,50 @@
//
#include "JSystem/JUtility/JUTGraphFifo.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct JUTGraphFifo {
/* 802DEB58 */ JUTGraphFifo(u32);
/* 802DEC34 */ ~JUTGraphFifo();
static u8 sCurrentFifo[4];
static u8 mGpStatus[5 + 3 /* padding */];
};
struct JKRHeap {
/* 802CE4D4 */ void alloc(u32, int);
/* 802CE548 */ void free(void*);
static u8 sSystemHeap[4];
};
//
// Forward References:
//
extern "C" void __ct__12JUTGraphFifoFUl();
extern "C" void __dt__12JUTGraphFifoFv();
extern "C" u8 sCurrentFifo__12JUTGraphFifo[4];
extern "C" u8 mGpStatus__12JUTGraphFifo[5 + 3 /* padding */];
//
// External References:
//
extern "C" void alloc__7JKRHeapFUli();
extern "C" void free__7JKRHeapFPv();
extern "C" void __dl__FPv();
extern "C" void GXInit();
extern "C" void GXInitFifoBase();
extern "C" void GXInitFifoPtrs();
extern "C" void GXSaveCPUFifo();
extern "C" void GXGetGPStatus();
extern "C" void _savegpr_26();
extern "C" void _restgpr_26();
extern "C" u8 sSystemHeap__7JKRHeap[4];
//
// Declarations:
//
/* ############################################################################################## */
/* 803CC590-803CC5A0 0296B0 000C+04 2/2 0/0 0/0 .data __vt__12JUTGraphFifo */
SECTION_DATA extern void* __vt__12JUTGraphFifo[3 + 1 /* padding */] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)__dt__12JUTGraphFifoFv,
/* padding */
NULL,
};
/* 804514B8-804514BC 0009B8 0004+00 1/1 0/0 0/0 .sbss None */
static u8 data_804514B8[4];
static bool data_804514B8;
/* 804514BC-804514C0 0009BC 0004+00 2/2 0/0 0/0 .sbss sCurrentFifo__12JUTGraphFifo */
u8 JUTGraphFifo::sCurrentFifo[4];
JUTGraphFifo* JUTGraphFifo::sCurrentFifo;
/* 802DEB58-802DEC34 2D9498 00DC+00 0/0 1/1 0/0 .text __ct__12JUTGraphFifoFUl */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JUTGraphFifo::JUTGraphFifo(u32 param_0) {
nofralloc
#include "asm/JSystem/JUtility/JUTGraphFifo/__ct__12JUTGraphFifoFUl.s"
JUTGraphFifo::JUTGraphFifo(u32 size) {
mSize = size + 0x1F & ~0x1F;
if (data_804514B8) {
mFifo = (GXFifoObj*)JKRAllocFromSysHeap(mSize + 0x80, 32);
mBase = mFifo + 1;
GXInitFifoBase(mFifo, mBase, mSize);
GXInitFifoPtrs(mFifo, mBase, mBase);
} else {
mBase = JKRAllocFromSysHeap(mSize + 0xA0, 32);
mBase = (void*)((int)mBase + 0x1F & ~0x1F);
mFifo = GXInit(mBase, mSize);
data_804514B8 = true;
sCurrentFifo = this;
}
}
#pragma pop
/* ############################################################################################## */
/* 804514C0-804514C8 0009C0 0005+03 1/1 0/0 0/0 .sbss mGpStatus__12JUTGraphFifo */
u8 JUTGraphFifo::mGpStatus[5 + 3 /* padding */];
bool JUTGraphFifo::mGpStatus[5];
/* 802DEC34-802DECF8 2D9574 00C4+00 1/0 0/0 0/0 .text __dt__12JUTGraphFifoFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JUTGraphFifo::~JUTGraphFifo() {
nofralloc
#include "asm/JSystem/JUtility/JUTGraphFifo/__dt__12JUTGraphFifoFv.s"
JUTGraphFifo::~JUTGraphFifo() {
sCurrentFifo->save();
do {
} while (isGPActive());
if (sCurrentFifo == this) {
sCurrentFifo = NULL;
}
JKRFreeToSysHeap(mBase);
}
#pragma pop
+1 -39
View File
@@ -11,47 +11,10 @@
// Types:
//
struct JUtility {
struct TColor {};
};
struct JUTVideo {
static u8 sManager[4];
};
struct JUTProcBar {
struct CTime {
/* 802E7340 */ CTime();
};
/* 802E5888 */ JUTProcBar();
/* 802E599C */ ~JUTProcBar();
/* 802E59E0 */ void create();
/* 802E5A28 */ void destroy();
/* 802E5A60 */ void clear();
/* 802E5B30 */ void bar_subroutine(int, int, int, int, int, int, int, JUtility::TColor,
JUtility::TColor);
/* 802E5CC4 */ void adjustMeterLength(u32, f32*, f32, f32, int*);
/* 802E5E08 */ void draw();
/* 802E5E3C */ void drawProcessBar();
/* 802E6FA0 */ void drawHeapBar();
static u8 sManager[4];
};
struct JKRHeap {
/* 802CE784 */ void getTotalFreeSize();
static u8 sSystemHeap[4];
static u8 sCurrentHeap[4];
static u8 sRootHeap[4];
static u8 mCodeStart[4];
static u8 mCodeEnd[4];
static u8 mUserRamStart[4];
static u8 mUserRamEnd[4];
static u8 mMemorySize[4];
};
//
// Forward References:
//
@@ -82,7 +45,6 @@ extern "C" void __dl__FPv();
extern "C" void J2DDrawLine__FffffQ28JUtility6TColori();
extern "C" void J2DFillBox__FffffQ28JUtility6TColor();
extern "C" void J2DDrawFrame__FffffQ28JUtility6TColorUc();
extern "C" void OSGetTick();
extern "C" void __construct_array();
extern "C" void _savegpr_21();
extern "C" void _savegpr_25();
@@ -118,7 +80,7 @@ asm JUTProcBar::JUTProcBar() {
/* ############################################################################################## */
/* 80451558-8045155C 000A58 0004+00 4/4 6/6 0/0 .sbss sManager__10JUTProcBar */
u8 JUTProcBar::sManager[4];
JUTProcBar* JUTProcBar::sManager;
/* 802E599C-802E59E0 2E02DC 0044+00 1/1 0/0 0/0 .text __dt__10JUTProcBarFv */
#pragma push
+1 -2
View File
@@ -15,7 +15,6 @@
//
extern "C" void GXSetDrawDone();
extern "C" void GXCopyDisp(void*, BOOL);
//
// Declarations:
@@ -156,7 +155,7 @@ void JUTVideo::preRetraceProc(u32 retrace_count) {
s16 index = xfb->getDrawnXfbIndex();
if (index >= 0) {
xfb->setDisplayingXfbIndex(index);
GXCopyDisp(xfb->getDisplayingXfb(), 1);
GXCopyDisp(xfb->getDisplayingXfb(), GX_TRUE);
GXFlush();
xfb->setSDrawingFlag(2);
frameBuffer = xfb->getDisplayingXfb();