m_Do cleanup, d_resource, drawlist stuff (#145)

* d_resource / some d_stage

* setup dDlst_list_c / d_select_icon OK

* JUTXfb / some JUTVideo + various

* some J2D classes / JUTVideo/Fader attempts

* bunch of m_Do cleanup + matches / f_ap_game OK

* mDoLib_clipper::setup OK

* most of d_meter_HIO OK

* pane_class / kantera_icon_meter
This commit is contained in:
TakaRikka
2021-09-24 08:11:10 -07:00
committed by GitHub
parent 6dcfdaf8a3
commit 7374f5f2f7
261 changed files with 6757 additions and 10882 deletions
+34 -2
View File
@@ -34,7 +34,6 @@ extern "C" void setLookat__14J2DGrafContextFv();
//
extern "C" void __dl__FPv();
extern "C" void PSMTXIdentity();
extern "C" void GXSetVtxDesc();
extern "C" void GXClearVtxDesc();
extern "C" void GXSetVtxAttrFmt();
@@ -57,7 +56,7 @@ extern "C" void GXSetZCompLoc();
extern "C" void GXLoadPosMtxImm();
extern "C" void GXSetCurrentMtx();
extern "C" void GXLoadTexMtxImm();
extern "C" void GXSetViewport();
extern "C" void GXSetViewport(f32, f32, f32, f32, f32, f32);
extern "C" void GXSetScissor();
extern "C" void __cvt_fp2unsigned();
extern "C" void _savegpr_29();
@@ -84,6 +83,17 @@ SECTION_DATA extern void* __vt__14J2DGrafContext[10] = {
};
/* 802E8B08-802E8BB4 2E3448 00AC+00 0/0 2/2 0/0 .text __ct__14J2DGrafContextFffff */
// reversed stack
#ifdef NONMATCHING
J2DGrafContext::J2DGrafContext(f32 left, f32 top, f32 right, f32 bottom)
: mBounds(left, top, left + right, top + bottom),
mScissorBounds(left, top, left + right, top + bottom), field_0x24(-1), field_0x28(-1),
field_0x2c(-1), field_0x30(-1) {
JUtility::TColor color(-1);
setColor(color, color, color, color);
setLineWidth(6);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -92,6 +102,7 @@ asm J2DGrafContext::J2DGrafContext(f32 param_0, f32 param_1, f32 param_2, f32 pa
#include "asm/JSystem/J2DGraph/J2DGrafContext/__ct__14J2DGrafContextFffff.s"
}
#pragma pop
#endif
/* ############################################################################################## */
/* 80456148-8045614C 004748 0004+00 5/5 0/0 0/0 .sdata2 @627 */
@@ -106,6 +117,26 @@ SECTION_SDATA2 static u8 lit_627[4] = {
SECTION_SDATA2 static f32 lit_628 = 1.0f;
/* 802E8BB4-802E8C44 2E34F4 0090+00 1/0 1/1 0/0 .text setPort__14J2DGrafContextFv */
// matches with literal
#ifdef NONMATCHING
void J2DGrafContext::setPort() {
setScissor();
setup2D();
f32 x_origin = mBounds.i.x;
f32 y_origin = mBounds.i.y;
f32 width = mBounds.f.x;
f32 height = mBounds.f.y;
if (x_origin < 0.0f) {
x_origin = 0.0f;
}
if (y_origin < 0.0f) {
y_origin = 0.0f;
}
GXSetViewport(x_origin, y_origin, width - x_origin, height - y_origin, 0.0f, 1.0f);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -114,6 +145,7 @@ asm void J2DGrafContext::setPort() {
#include "asm/JSystem/J2DGraph/J2DGrafContext/setPort__14J2DGrafContextFv.s"
}
#pragma pop
#endif
/* 802E8C44-802E8E20 2E3584 01DC+00 1/0 1/0 0/0 .text setup2D__14J2DGrafContextFv */
#pragma push
-47
View File
@@ -7,52 +7,6 @@
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct JUtility {
struct TColor {};
};
struct JGeometry {
template <typename A1>
struct TBox2 {};
/* TBox2<f32> */
struct TBox2__template0 {};
template <typename A1>
struct TVec2 {};
/* TVec2<f32> */
struct TVec2__template1 {};
};
struct J2DOrthoGraph {
/* 8000B118 */ ~J2DOrthoGraph();
/* 802E9670 */ J2DOrthoGraph();
/* 802E96D0 */ J2DOrthoGraph(f32, f32, f32, f32, f32, f32);
/* 802E97B4 */ void setPort();
/* 802E980C */ void setOrtho(JGeometry::TBox2<f32> const&, f32, f32);
/* 802E9840 */ void setLookat();
/* 802E987C */ void scissorBounds(JGeometry::TBox2<f32>*, JGeometry::TBox2<f32> const*);
/* 802E9C88 */ bool getGrafType() const;
};
struct J2DGrafContext {
/* 802E8B08 */ J2DGrafContext(f32, f32, f32, f32);
/* 802E8BB4 */ void setPort();
/* 802E8C44 */ void setup2D();
/* 802E8E20 */ void setScissor();
/* 802E90E4 */ void place(JGeometry::TBox2<f32> const&);
/* 802E961C */ void place(f32, f32, f32, f32);
/* 802E9118 */ void setColor(JUtility::TColor, JUtility::TColor, JUtility::TColor,
JUtility::TColor);
/* 802E9234 */ void setLineWidth(u8);
/* 802E9260 */ void fillBox(JGeometry::TBox2<f32> const&);
/* 802E9368 */ void drawFrame(JGeometry::TBox2<f32> const&);
/* 802E9564 */ void lineTo(JGeometry::TVec2<f32>);
};
//
// Forward References:
//
@@ -87,7 +41,6 @@ extern "C" void func_802E9260();
extern "C" void func_802E9368();
extern "C" void func_802E9564();
extern "C" void place__14J2DGrafContextFffff();
extern "C" void PSMTXIdentity();
extern "C" void C_MTXOrtho();
extern "C" void GXSetProjection();
extern "C" void GXLoadPosMtxImm();
+7 -7
View File
@@ -515,14 +515,14 @@ asm void J2DPane::clip(JGeometry::TBox2<f32> const& param_0) {
#pragma pop
/* 802F72E0-802F7388 2F1C20 00A8+00 1/0 7/1 0/0 .text search__7J2DPaneFUx */
const J2DPane* J2DPane::search(u64 tag) {
J2DPane* J2DPane::search(u64 tag) {
if (tag == mInfoTag) {
return this;
}
JSUTreeIterator<J2DPane> iter;
for (iter = mPaneTree.getFirstChild(); iter != mPaneTree.getEndChild(); ++iter) {
if (const J2DPane* result = iter.getObject()->search(tag)) {
if (J2DPane* result = iter.getObject()->search(tag)) {
return result;
}
}
@@ -530,14 +530,14 @@ const J2DPane* J2DPane::search(u64 tag) {
}
/* 802F7388-802F7430 2F1CC8 00A8+00 1/0 7/1 0/0 .text searchUserInfo__7J2DPaneFUx */
const J2DPane* J2DPane::searchUserInfo(u64 tag) {
J2DPane* J2DPane::searchUserInfo(u64 tag) {
if (tag == mUserInfoTag) {
return this;
}
JSUTreeIterator<J2DPane> iter;
for (iter = mPaneTree.getFirstChild(); iter != mPaneTree.getEndChild(); ++iter) {
if (const J2DPane* result = iter.getObject()->searchUserInfo(tag)) {
if (J2DPane* result = iter.getObject()->searchUserInfo(tag)) {
return result;
}
}
@@ -653,7 +653,7 @@ const J2DPane* J2DPane::getFirstChildPane() {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm const J2DPane* J2DPane::getFirstChildPane() {
asm J2DPane* J2DPane::getFirstChildPane() {
nofralloc
#include "asm/JSystem/J2DGraph/J2DPane/getFirstChildPane__7J2DPaneFv.s"
}
@@ -661,7 +661,7 @@ asm const J2DPane* J2DPane::getFirstChildPane() {
#endif
/* 802F7AC4-802F7AFC 2F2404 0038+00 1/1 8/8 0/0 .text getNextChildPane__7J2DPaneFv */
const J2DPane* J2DPane::getNextChildPane() {
J2DPane* J2DPane::getNextChildPane() {
if (getPaneTree()->getNextChild() == NULL)
return NULL;
@@ -669,7 +669,7 @@ const J2DPane* J2DPane::getNextChildPane() {
}
/* 802F7AFC-802F7B18 2F243C 001C+00 6/6 11/11 0/0 .text getParentPane__7J2DPaneFv */
const J2DPane* J2DPane::getParentPane() {
J2DPane* J2DPane::getParentPane() {
if (getPaneTree()->getParent() == NULL)
return NULL;
+2 -2
View File
@@ -407,7 +407,7 @@ asm void J2DScreen::draw(f32 param_0, f32 param_1, J2DGrafContext const* param_2
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm const J2DPane* J2DScreen::search(u64 param_0) {
asm J2DPane* J2DScreen::search(u64 param_0) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DScreen/search__9J2DScreenFUx.s"
}
@@ -417,7 +417,7 @@ asm const J2DPane* J2DScreen::search(u64 param_0) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm const J2DPane* J2DScreen::searchUserInfo(u64 param_0) {
asm J2DPane* J2DScreen::searchUserInfo(u64 param_0) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DScreen/searchUserInfo__9J2DScreenFUx.s"
}
+2 -163
View File
@@ -7,150 +7,6 @@
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct _GXTlut {};
struct _GXTexMapID {};
struct _GXCullMode {};
struct ResTLUT {};
struct ResTIMG {};
struct ResFONT {};
struct JUtility {
struct TColor {};
};
struct JUTTexture {
/* 802DE234 */ ~JUTTexture();
/* 802DE2A8 */ void storeTIMG(ResTIMG const*, u8);
/* 802DE840 */ void load(_GXTexMapID);
};
struct JUTPalette {
/* 802DE890 */ void storeTLUT(_GXTlut, ResTLUT*);
};
struct JSUStreamSeekFrom {};
struct JSURandomInputStream {
/* 802DC458 */ void peek(void*, s32);
/* 802DC4DC */ void seek(s32, JSUStreamSeekFrom);
};
struct JSUInputStream {
/* 802DC298 */ void read(void*, s32);
};
struct JKRArchive {};
struct JGeometry {
template <typename A1>
struct TBox2 {};
/* TBox2<f32> */
struct TBox2__template0 {};
};
struct J2DAnmTexPattern {};
struct J2DAnmVisibilityFull {};
struct J2DAnmBase {};
struct J2DAnmColor {};
struct J2DAnmTevRegKey {};
struct J2DAnmTextureSRTKey {};
struct J2DAnmTransform {};
struct J2DAnmVtxColor {};
struct J2DPane {
/* 80053BC0 */ void calcMtx();
/* 80053C00 */ void makeMatrix(f32, f32);
/* 802F7540 */ void makeMatrix(f32, f32, f32, f32);
/* 80256018 */ void setAnimation(J2DAnmVtxColor*);
/* 8025601C */ void setAnimation(J2DAnmVisibilityFull*);
/* 80256020 */ void setAnimation(J2DAnmTexPattern*);
/* 8018BF28 */ void setAnimation(J2DAnmTextureSRTKey*);
/* 80126350 */ void setAnimation(J2DAnmTevRegKey*);
/* 80126354 */ void setAnimation(J2DAnmColor*);
/* 802F7EF4 */ void setAnimation(J2DAnmBase*);
/* 802F5BF8 */ J2DPane();
/* 802F60C4 */ void makePaneStream(J2DPane*, JSURandomInputStream*);
/* 802F658C */ ~J2DPane();
/* 802F6F60 */ void move(f32, f32);
/* 802F6FB4 */ void add(f32, f32);
/* 802F6FF8 */ void resize(f32, f32);
/* 802F7264 */ void clip(JGeometry::TBox2<f32> const&);
/* 802F72E0 */ void search(u64);
/* 802F7388 */ void searchUserInfo(u64);
/* 802F7430 */ void isUsed(ResTIMG const*);
/* 802F74B8 */ void isUsed(ResFONT const*);
/* 802F7680 */ void setCullBack(_GXCullMode);
/* 802F8428 */ void setCullBack(bool);
/* 802F7B18 */ void makePaneExStream(J2DPane*, JSURandomInputStream*);
/* 802F7DB8 */ void getPointer(JSURandomInputStream*, u32, JKRArchive*);
/* 802F8004 */ void clearAnmTransform();
/* 802F8080 */ void animationTransform(J2DAnmTransform const*);
/* 802F8118 */ void setVisibileAnimation(J2DAnmVisibilityFull*);
/* 802F81A0 */ void setVtxColorAnimation(J2DAnmVtxColor*);
/* 802F8228 */ void animationPane(J2DAnmTransform const*);
/* 802F83D0 */ void setAnimationVF(J2DAnmVisibilityFull*);
/* 802F83FC */ void setAnimationVC(J2DAnmVtxColor*);
/* 802F8464 */ void setConnectParent(bool);
/* 802F8474 */ void update();
};
struct J2DMaterial {};
struct J2DWindow {
struct TMaterial {};
/* 80254000 */ void getBlack() const;
/* 8025400C */ void getWhite() const;
/* 802543E0 */ void setWhite(JUtility::TColor);
/* 80254430 */ void setBlack(JUtility::TColor);
/* 80254568 */ void setBlackWhite(JUtility::TColor, JUtility::TColor);
/* 802F9C10 */ J2DWindow(J2DPane*, JSURandomInputStream*, J2DMaterial*);
/* 802F9B74 */ J2DWindow(J2DPane*, JSURandomInputStream*, JKRArchive*);
/* 802F9A7C */ J2DWindow();
/* 802FA118 */ void private_readStream(J2DPane*, JSURandomInputStream*, JKRArchive*);
/* 802FA604 */ void initinfo2();
/* 802FA880 */ ~J2DWindow();
/* 802FBFA0 */ void draw(f32, f32, f32, f32);
/* 802FA928 */ void draw(JGeometry::TBox2<f32> const&);
/* 802FAED0 */ void draw(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
/* 802FAA5C */ void draw_private(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
/* 802FB000 */ void resize(f32, f32);
/* 802FB12C */ void setContentsColor(JUtility::TColor, JUtility::TColor, JUtility::TColor,
JUtility::TColor);
/* 802FB240 */ void drawSelf(f32, f32, f32 (*)[3][4]);
/* 802FB1D8 */ void drawSelf(f32, f32);
/* 802FB338 */ void drawContents(JGeometry::TBox2<f32> const&);
/* 802FB634 */ void drawFrameTexture(JUTTexture*, f32, f32, f32, f32, u16, u16, u16, u16, bool);
/* 802FB7C8 */ void drawFrameTexture(JUTTexture*, f32, f32, bool, bool, bool);
/* 802FB868 */ void drawContentsTexture(f32, f32, f32, f32);
/* 802FBB90 */ void setTevMode(JUTTexture*, JUtility::TColor, JUtility::TColor);
/* 802FBE60 */ void getFrameTexture(u8, u8) const;
/* 802FC02C */ void isUsed(ResFONT const*);
/* 802FBEDC */ void isUsed(ResTIMG const*);
/* 802FBF98 */ s32 getTypeID() const;
/* 802FBFE8 */ void getContentsTexture(u8) const;
/* 802FC000 */ void getMaterial(J2DWindow::TMaterial&) const;
/* 802FC01C */ bool getFrameMaterial(u8) const;
/* 802FC024 */ bool getContentsMaterial() const;
/* 802FC04C */ void rewriteAlpha();
};
//
// Forward References:
//
@@ -239,27 +95,10 @@ extern "C" void setAnimationVC__7J2DPaneFP14J2DAnmVtxColor();
extern "C" void setCullBack__7J2DPaneFb();
extern "C" void setConnectParent__7J2DPaneFb();
extern "C" void update__7J2DPaneFv();
extern "C" void PSMTXIdentity();
extern "C" void PSMTXConcat();
extern "C" void GXSetVtxDesc();
extern "C" void GXClearVtxDesc();
extern "C" void GXSetVtxAttrFmt();
extern "C" void GXSetTexCoordGen2();
extern "C" void GXSetNumTexGens();
extern "C" void GXBegin();
extern "C" void GXSetNumChans();
extern "C" void GXSetChanCtrl();
extern "C" void GXSetNumIndStages();
extern "C" void GXSetTevDirect();
extern "C" void GXSetTevOp();
extern "C" void GXSetTevColorIn();
extern "C" void GXSetTevAlphaIn();
extern "C" void GXSetTevColorOp();
extern "C" void GXSetTevAlphaOp();
extern "C" void GXSetTevColor();
extern "C" void GXSetTevOrder();
extern "C" void GXSetNumTevStages();
extern "C" void GXSetBlendMode();
extern "C" void GXLoadPosMtxImm();
extern "C" void GXSetCurrentMtx();
extern "C" void _savegpr_25();
@@ -624,7 +463,7 @@ COMPILER_STRIP_GATE(0x803A1C40, &lit_3037);
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J2DWindow::isUsed(ResTIMG const* param_0) {
asm bool J2DWindow::isUsed(ResTIMG const* param_0) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DWindow/isUsed__9J2DWindowFPC7ResTIMG.s"
}
@@ -682,7 +521,7 @@ bool J2DWindow::getContentsMaterial() const {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J2DWindow::isUsed(ResFONT const* param_0) {
asm bool J2DWindow::isUsed(ResFONT const* param_0) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DWindow/isUsed__9J2DWindowFPC7ResFONT.s"
}