More demo work

This commit is contained in:
LagoLunatic
2025-05-31 23:53:05 -04:00
parent 05b211478a
commit 63a92eaa88
16 changed files with 259 additions and 39 deletions
+29
View File
@@ -2771,3 +2771,32 @@ extract:
- symbol: l_toonMat1DL
binary: assets/l_toonMat1DL.bin
header: assets/l_toonMat1DL.h
- symbol: l_matDL$4443
binary: assets/l_matDL__clearAlphaBuffer__FP10view_class.bin
header: assets/l_matDL__clearAlphaBuffer__FP10view_class.h
rename: l_matDL
- symbol: l_DL$4444
binary: assets/l_DL__clearAlphaBuffer__FP10view_class.bin
header: assets/l_DL__clearAlphaBuffer__FP10view_class.h
rename: l_DL
- symbol: l_matDL$4454
binary: assets/l_matDL__4454.bin
header: assets/l_matDL__4454.h
rename: l_matDL
- symbol: l_DL$4455
binary: assets/l_DL__4455.bin
header: assets/l_DL__4455.h
rename: l_DL
- symbol: l_matDL$4465
binary: assets/l_matDL__drawAlphaBuffer__FP10view_class8_GXColor.bin
header: assets/l_matDL__drawAlphaBuffer__FP10view_class8_GXColor.h
rename: l_matDL
- symbol: l_DL$4466
binary: assets/l_DL__drawAlphaBuffer__FP10view_class8_GXColor.bin
header: assets/l_DL__drawAlphaBuffer__FP10view_class8_GXColor.h
rename: l_DL
- symbol: l_DL$4479
binary: assets/l_DL__drawSpot__FP10view_class.bin
header: assets/l_DL__drawSpot__FP10view_class.h
rename: l_DL
+10
View File
@@ -0,0 +1,10 @@
#ifndef GF_H
#define GF_H
#include "dolphin/gf/GFGeometry.h" // IWYU pragma: export
#include "dolphin/gf/GFLight.h" // IWYU pragma: export
#include "dolphin/gf/GFPixel.h" // IWYU pragma: export
#include "dolphin/gf/GFTev.h" // IWYU pragma: export
#include "dolphin/gf/GFTransform.h" // IWYU pragma: export
#endif /* GF_H */
+1
View File
@@ -6,5 +6,6 @@
void GFSetFog(GXFogType type, f32 startZ, f32 endZ, f32 nearZ, f32 farZ, GXColor color);
void GFSetBlendModeEtc(GXBlendMode, GXBlendFactor, GXBlendFactor, GXLogicOp, u8, u8, u8);
void GFSetDstAlpha(u8, u8);
#endif /* GFPIXEL_H */
+4
View File
@@ -361,6 +361,10 @@ inline MtxP mDoMtx_getIdentity() {
return g_mDoMtx_identity;
}
inline MtxP cMtx_getIdentity() {
return mDoMtx_getIdentity();
}
class mDoMtx_quatStack_c {
public:
mDoMtx_quatStack_c() {
+1 -3
View File
@@ -11,9 +11,7 @@
#include "d/d_priority.h"
#include "d/actor/d_a_bwd.h"
#include "f_op/f_op_actor_mng.h"
#include "dolphin/gf/GFGeometry.h"
#include "dolphin/gf/GFTev.h"
#include "dolphin/gf/GFTransform.h"
#include "dolphin/gf/GF.h"
static bwd_class* boss;
+1 -1
View File
@@ -514,7 +514,7 @@ cPhs_State daObjFigure_c::createInit() {
attention_info.flags = fopAc_Attn_LOCKON_TALK_e | fopAc_Attn_ACTION_SPEAK_e | fopAc_Attn_TALKFLAG_CHECK_e;
shape_angle = current.angle;
dKy_tevstr_init(&mTevStrBG2, fopAcM_GetHomeRoomNo(this), 0xFF);
cMtx_copy(mDoMtx_getIdentity(), mMtx);
cMtx_copy(cMtx_getIdentity(), mMtx);
setMtx();
return cPhs_COMPLEATE_e;
+3 -6
View File
@@ -7,10 +7,7 @@
#include "d/d_com_inf_game.h"
#include "d/d_kankyo_rain.h"
#include "d/actor/d_a_sea.h"
#include "dolphin/gf/GFGeometry.h"
#include "dolphin/gf/GFLight.h"
#include "dolphin/gf/GFPixel.h"
#include "dolphin/gf/GFTransform.h"
#include "dolphin/gf/GF.h"
#include "f_op/f_op_camera.h"
#include "m_Do/m_Do_graphic.h"
#include "m_Do/m_Do_lib.h"
@@ -177,7 +174,7 @@ void dDlst_2DT2_c::draw() {
GXSetCullMode(GX_CULL_NONE);
GXSetDither(GX_TRUE);
GXSetClipMode(GX_CLIP_DISABLE);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
f32 x0 = mX, x1 = x0 + mW;
@@ -561,7 +558,7 @@ void dDlst_2Dm_c::draw() {
GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0);
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_SET);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
+1 -1
View File
@@ -45,7 +45,7 @@ void dDlst_Gameover_CAPTURE_c::draw() {
Mtx44 mtx;
C_MTXOrtho(mtx, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(0);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
+1 -2
View File
@@ -15,8 +15,7 @@
#include "m_Do/m_Do_lib.h"
#include "m_Do/m_Do_graphic.h"
#include "SSystem/SComponent/c_counter.h"
#include "dolphin/gf/GFGeometry.h"
#include "dolphin/gf/GFTev.h"
#include "dolphin/gf/GF.h"
#include "weak_data_1811.h" // IWYU pragma: keep
+1 -1
View File
@@ -13,7 +13,7 @@
#include "d/d_procname.h"
#include "d/d_s_play.h"
#include "d/d_stage.h"
#include "dolphin/gf/GFPixel.h"
#include "dolphin/gf/GF.h"
#include "f_op/f_op_actor_mng.h"
#include "f_op/f_op_camera.h"
#include "f_op/f_op_kankyo.h"
+1 -1
View File
@@ -40,7 +40,7 @@ void dOvlpFd2_dlst_c::draw() {
GXSetCullMode(GX_CULL_NONE);
GXSetDither(GX_TRUE);
GXSetClipMode(GX_CLIP_DISABLE);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
+1 -1
View File
@@ -138,7 +138,7 @@ void dDlst_2Dt_Sp_c::draw() {
GXSetCullMode(GX_CULL_NONE);
GXSetDither(GX_FALSE);
GXSetClipMode(GX_CLIP_DISABLE);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
f32 x1, y1;
+1 -1
View File
@@ -1919,7 +1919,7 @@ void dSnap_packet::ClearAlphaBuffer() {
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
+1 -3
View File
@@ -14,9 +14,7 @@
#include "d/d_procname.h"
#include "d/d_tree.h"
#include "d/d_cc_d.h"
#include "dolphin/gf/GFGeometry.h"
#include "dolphin/gf/GFTev.h"
#include "dolphin/gf/GFTransform.h"
#include "dolphin/gf/GF.h"
#include "dolphin/gx/GXAttr.h"
#include "dolphin/gx/GXDisplayList.h"
#include "dolphin/gx/GXStruct.h"
+3 -3
View File
@@ -14,7 +14,7 @@
#include "SSystem/SComponent/c_m3d.h"
#include "d/d_com_inf_game.h"
#include "d/d_s_play.h"
#include "dolphin/gf/GFPixel.h"
#include "dolphin/gf/GF.h"
#include "m_Do/m_Do_mtx.h"
#include "m_Do/m_Do_printf.h"
@@ -1856,7 +1856,7 @@ void mDoExt_3DlineMat0_c::setMaterial() {
GXCallDisplayList(l_matDL, 0x80);
}
GXLoadPosMtxImm(j3dSys.getViewMtx(), GX_PNMTX0);
GXLoadNrmMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadNrmMtxImm(cMtx_getIdentity(), GX_PNMTX0);
}
/* 80014798-800148B4 .text draw__19mDoExt_3DlineMat0_cFv */
@@ -2119,7 +2119,7 @@ void mDoExt_3DlineMat1_c::setMaterial() {
GXCallDisplayList(l_mat1DL, 0x80);
}
GXLoadPosMtxImm(j3dSys.getViewMtx(), GX_PNMTX0);
GXLoadNrmMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadNrmMtxImm(cMtx_getIdentity(), GX_PNMTX0);
}
/* 800155DC-80015764 .text draw__19mDoExt_3DlineMat1_cFv */
+200 -16
View File
@@ -9,6 +9,7 @@
#include "d/d_drawlist.h"
#include "d/d_meter.h"
#include "d/d_s_play.h"
#include "dolphin/gf/GF.h"
#include "f_ap/f_ap_game.h"
#include "f_op/f_op_camera.h"
#include "m_Do/m_Do_machine.h"
@@ -31,6 +32,9 @@
#include "JSystem/JUtility/JUTXfb.h"
#include "dolphin/base/PPCArch.h"
#include "weak_bss_936_to_1036.h" // IWYU pragma: keep
#include "weak_data_1811.h" // IWYU pragma: keep
JUTFader * mDoGph_gInf_c::mFader;
ResTIMG * mDoGph_gInf_c::mFrameBufferTimg;
GXTexObj mDoGph_gInf_c::mFrameBufferTexObj;
@@ -52,9 +56,13 @@ s16 mDoGph_gInf_c::mMonotoneRateSpeed;
mDoGph_gInf_c g_mDoGph_graphicInfo;
OSThread mCaptureThread;
#if VERSION > VERSION_DEMO
OSAlarm mCaptureTimeOutAlarm;
#endif
s16 mCaptureStep;
#if VERSION > VERSION_DEMO
bool mCaptureCansel;
#endif
bool mCaptureEnableGXSetCopyFilter;
u8* mCaptureThreadStackHead;
u8* mCaptureCaptureBuffer;
@@ -71,10 +79,15 @@ GXColor mDoGph_gInf_c::mFadeColor = {};
/* 80007BBC-80007DDC .text create__13mDoGph_gInf_cFv */
void mDoGph_gInf_c::create() {
JFWDisplay::createManager(JKRHeap::getCurrentHeap(), JUTXfb::Double, true);
#if VERSION == VERSION_DEMO
JKRHeap* heap = mDoExt_getZeldaHeap();
#else
JKRHeap* heap = JKRHeap::getCurrentHeap();
#endif
JFWDisplay::createManager(heap, JUTXfb::Double, true);
JFWDisplay::getManager()->setDrawDoneMethod(JFWDisplay::Async);
JUTFader* faderPtr = new JUTFader(0, 0, JUTVideo::getManager()->getRenderMode()->fb_width, JUTVideo::getManager()->getRenderMode()->efb_height, JUtility::TColor(0, 0, 0, 0));
JUT_ASSERT(0x1a0, faderPtr != NULL);
JUT_ASSERT(VERSION_SELECT(414, 416, 416, 416), faderPtr != NULL);
setFader(faderPtr);
JFWDisplay::getManager()->setFader(faderPtr);
JUTProcBar::getManager()->setVisibleHeapBar(false);
@@ -115,10 +128,10 @@ void mDoGph_gInf_c::createHeap() {
#endif
mHeap[0] = JKRSolidHeap::create(0x10000, parentHeap, false);
JUT_ASSERT(0x1eb, mHeap[0] != NULL);
JUT_ASSERT(VERSION_SELECT(488, 491, 491, 491), mHeap[0] != NULL);
mHeap[1] = JKRSolidHeap::create(0x10000, parentHeap, false);
JUT_ASSERT(0x1ed, mHeap[1] != NULL);
JUT_ASSERT(VERSION_SELECT(490, 493, 493, 493), mHeap[1] != NULL);
mCurrentHeap = 0;
}
@@ -143,7 +156,7 @@ void mDoGph_gInf_c::fadeOut(f32 speed, GXColor& color) {
/* 80007F6C-80007F94 .text onBlure__13mDoGph_gInf_cFv */
void mDoGph_gInf_c::onBlure() {
onBlure(mDoMtx_getIdentity());
onBlure(cMtx_getIdentity());
}
/* 80007F94-80007FC4 .text onBlure__13mDoGph_gInf_cFPA4_Cf */
@@ -204,7 +217,7 @@ void mDoGph_gInf_c::calcFade() {
Mtx44 mtx;
C_MTXOrtho(mtx, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
@@ -265,6 +278,10 @@ bool mDoGph_AfterOfDraw() {
JUTProcBar::getManager()->setVisibleHeapBar(false);
JUTDbPrint::getManager()->setVisible(true);
} else {
#if VERSION == VERSION_DEMO
BOOL procVisible = false;
BOOL printVisible = false;
#else
BOOL consoleVisible = JFWSystem::getSystemConsole()->isVisible();
BOOL pad3Connected = JUTGamePad::getPortStatus(JUTGamePad::Port_3).error == 0;
BOOL procVisible = pad3Connected && fapGmHIO_getMeter() && !consoleVisible;
@@ -273,6 +290,7 @@ bool mDoGph_AfterOfDraw() {
procVisible = FALSE;
printVisible = FALSE;
}
#endif
JUTProcBar::getManager()->setVisible(procVisible);
JUTProcBar::getManager()->setVisibleHeapBar(procVisible);
JUTDbPrint::getManager()->setVisible(printVisible);
@@ -286,7 +304,11 @@ bool mDoGph_AfterOfDraw() {
GXSetFogRangeAdj(GX_FALSE, 0, NULL);
GXSetCoPlanar(GX_FALSE);
GXSetZTexture(GX_ZT_DISABLE, GX_TF_Z8, 0);
#if VERSION == VERSION_DEMO
GXSetDither(GX_FALSE);
#else
GXSetDither(GX_TRUE);
#endif
GXSetClipMode(GX_CLIP_ENABLE);
GXSetCullMode(GX_CULL_NONE);
mDoMch_render_c::setFbWidth(fapGmHIO_getFbWidth());
@@ -297,6 +319,38 @@ bool mDoGph_AfterOfDraw() {
return true;
}
#if VERSION == VERSION_DEMO
void clearAlphaBuffer(view_class* view) {
#include "assets/l_matDL__clearAlphaBuffer__FP10view_class.h"
#include "assets/l_DL__clearAlphaBuffer__FP10view_class.h"
static s8 l_pos[][3] = {
{0x00, 0x00, 0xFB},
{0x01, 0x00, 0xFB},
{0x01, 0x01, 0xFB},
{0x00, 0x01, 0xFB},
};
static GXVtxDescList l_vtxDescList[] = {
{GX_VA_POS, GX_INDEX8},
{GX_VA_NULL, GX_NONE},
};
static GXVtxAttrFmtList l_vtxAttrFmtList[] = {
{GX_VA_POS, GX_POS_XYZ, GX_S8, 0x00},
{GX_VA_NULL, GX_POS_XYZ, GX_F32, 0x00},
};
GXCallDisplayList(l_matDL, 0x80);
Mtx44 mtx;
C_MTXOrtho(mtx, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GFSetVtxDescv(l_vtxDescList);
GFSetVtxAttrFmtv(GX_VTXFMT0, l_vtxAttrFmtList);
GFSetArray(GX_VA_POS, l_pos, sizeof(*l_pos));
GFLoadPosMtxImm(cMtx_getIdentity(), 0);
GXCallDisplayList(l_DL, 0x20);
GFSetBlendModeEtc(GX_BM_NONE, GX_BL_ZERO, GX_BL_ZERO, GX_LO_CLEAR, 1, 0, 1);
GXSetProjection(view->mProjMtx, GX_PERSPECTIVE);
}
#else
/* 80008600-80008880 .text clearAlphaBuffer__FP10view_classUc */
void clearAlphaBuffer(view_class* view, u8 alpha) {
GXSetNumChans(1);
@@ -325,7 +379,7 @@ void clearAlphaBuffer(view_class* view, u8 alpha) {
Mtx44 mtx;
C_MTXOrtho(mtx, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
@@ -340,9 +394,64 @@ void clearAlphaBuffer(view_class* view, u8 alpha) {
GXSetAlphaUpdate(GX_FALSE);
GXSetProjection(view->mProjMtx, GX_PERSPECTIVE);
}
#endif
#if VERSION == VERSION_DEMO
static void dummy() {
#include "assets/l_matDL__4454.h"
#include "assets/l_DL__4455.h"
static s8 l_pos[][3] = {
{0x00, 0x00, 0x9C},
{0x01, 0x00, 0x9C},
{0x01, 0x01, 0x9C},
{0x00, 0x01, 0x9C},
};
static GXVtxDescList l_vtxDescList[] = {
{GX_VA_POS, GX_INDEX8},
{GX_VA_NULL, GX_NONE},
};
static GXVtxAttrFmtList l_vtxAttrFmtList[] = {
{GX_VA_POS, GX_POS_XYZ, GX_S8, 0x00},
{GX_VA_NULL, GX_POS_XYZ, GX_F32, 0x00},
};
}
#endif
/* 80008880-80008B0C .text drawAlphaBuffer__FP10view_class8_GXColor */
void drawAlphaBuffer(view_class* view, GXColor color) {
#if VERSION == VERSION_DEMO
#include "assets/l_matDL__drawAlphaBuffer__FP10view_class8_GXColor.h"
#include "assets/l_DL__drawAlphaBuffer__FP10view_class8_GXColor.h"
static s8 l_pos[][3] = {
{0x00, 0x00, 0xFB},
{0x01, 0x00, 0xFB},
{0x01, 0x01, 0xFB},
{0x00, 0x01, 0xFB},
};
static GXVtxDescList l_vtxDescList[] = {
{GX_VA_POS, GX_INDEX8},
{GX_VA_NULL, GX_NONE},
};
static GXVtxAttrFmtList l_vtxAttrFmtList[] = {
{GX_VA_POS, GX_POS_XYZ, GX_S8, 0x00},
{GX_VA_NULL, GX_POS_XYZ, GX_F32, 0x00},
};
GXCallDisplayList(l_matDL, 0x80);
GFSetChanMatColor(GX_COLOR0, color);
GFSetDstAlpha(GX_TRUE, 0);
Mtx44 mtx;
C_MTXOrtho(mtx, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GFSetVtxDescv(l_vtxDescList);
GFSetVtxAttrFmtv(GX_VTXFMT0, l_vtxAttrFmtList);
GFSetArray(GX_VA_POS, l_pos, sizeof(*l_pos));
GFLoadPosMtxImm(cMtx_getIdentity(), 0);
GXCallDisplayList(l_DL, 0x20);
GFSetBlendModeEtc(GX_BM_NONE, GX_BL_ZERO, GX_BL_ZERO, GX_LO_CLEAR, 1, 0, 1);
GFSetDstAlpha(GX_FALSE, 0);
GXSetProjection(view->mProjMtx, GX_PERSPECTIVE);
#else
GXSetNumChans(1);
GXSetChanCtrl(GX_COLOR0A0, false, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_NONE, GX_AF_NONE);
GXSetChanMatColor(GX_COLOR0, color);
@@ -368,7 +477,7 @@ void drawAlphaBuffer(view_class* view, GXColor color) {
Mtx44 mtx;
C_MTXOrtho(mtx, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
@@ -383,10 +492,38 @@ void drawAlphaBuffer(view_class* view, GXColor color) {
GXSetAlphaUpdate(GX_FALSE);
GXSetDstAlpha(GX_FALSE, 0);
GXSetProjection(view->mProjMtx, GX_PERSPECTIVE);
#endif
}
/* 80008B0C-80008F34 .text drawSpot__FP10view_class */
void drawSpot(view_class* view) {
#if VERSION == VERSION_DEMO
#include "assets/l_DL__drawSpot__FP10view_class.h"
static s8 l_pos[][3] = {
{0x00, 0x00, 0xFB},
{0x01, 0x00, 0xFB},
{0x01, 0x01, 0xFB},
{0x00, 0x01, 0xFB},
};
static GXVtxDescList l_vtxDescList[] = {
{GX_VA_POS, GX_INDEX8},
{GX_VA_NULL, GX_NONE},
};
static GXVtxAttrFmtList l_vtxAttrFmtList[] = {
{GX_VA_POS, GX_POS_XYZ, GX_S8, 0x00},
{GX_VA_NULL, GX_POS_XYZ, GX_F32, 0x00},
};
GFSetVtxDescv(l_vtxDescList);
GFSetVtxAttrFmtv(GX_VTXFMT0, l_vtxAttrFmtList);
GFSetArray(GX_VA_POS, l_pos, sizeof(*l_pos));
Mtx44 mtx;
C_MTXOrtho(mtx, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GFLoadPosMtxImm(cMtx_getIdentity(), 0);
GXCallDisplayList(l_DL, 0xE0);
GXSetProjection(view->mProjMtx, GX_PERSPECTIVE);
#else
GXSetNumChans(1);
GXSetChanCtrl(GX_COLOR0A0, false, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_NONE, GX_AF_NONE);
GXSetChanAmbColor(GX_COLOR0A0, g_clearColor);
@@ -412,7 +549,7 @@ void drawSpot(view_class* view) {
Mtx44 mtx;
C_MTXOrtho(mtx, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
@@ -449,6 +586,7 @@ void drawSpot(view_class* view) {
GXPosition3s8(0, 1, -5);
GXEnd();
GXSetProjection(view->mProjMtx, GX_PERSPECTIVE);
#endif
}
/* 80008F34-8000990C .text drawDepth__FP10view_classP15view_port_classi */
@@ -586,7 +724,7 @@ void drawDepth(view_class* view, view_port_class* viewport, int depth) {
Mtx44 mtx;
C_MTXOrtho(mtx, viewport->mYOrig, viewport->mYOrig + viewport->mHeight, viewport->mXOrig, viewport->mXOrig + viewport->mWidth, 0.0, 10.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
@@ -673,7 +811,7 @@ void motionBlure(view_class* view) {
Mtx44 mtx;
C_MTXOrtho(mtx, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 10.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
@@ -736,6 +874,7 @@ void mDoGph_setCaptureCaptureFormat(u8 fmt) {
mCaptureCaptureFormat = fmt;
}
#if VERSION > VERSION_DEMO
/* 80009C08-80009C38 .text mDoGph_CaptureCansel__Fv */
void mDoGph_CaptureCansel() {
if (mCaptureStep < 0) {
@@ -745,6 +884,7 @@ void mDoGph_CaptureCansel() {
mCaptureCansel = true;
}
}
#endif
#define COLOR_SQUARE_MAG(r0, g0, b0, r1, g1, b1) (r0 - r1)*(r0 - r1) + (g0 - g1)*(g0 - g1) + (b0 - b1)*(b0 - b1)
@@ -1022,7 +1162,7 @@ void setUpRectangle() {
Mtx44 mtx;
C_MTXOrtho(mtx, -21.0f, 503.0f, -9.0f, 650.0f, 0.0f, 10.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GXLoadPosMtxImm(mDoMtx_getIdentity(), GX_PNMTX0);
GXLoadPosMtxImm(cMtx_getIdentity(), GX_PNMTX0);
GXSetCurrentMtx(GX_PNMTX0);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
@@ -1045,6 +1185,7 @@ void drawRectangle(int x0, int y0, int x1, int y1) {
GXEnd();
}
#if VERSION > VERSION_DEMO
/* 8000A7F0-8000A8B8 .text mDoGph_allocFromAny__FUli */
u8* mDoGph_allocFromAny(u32 size, int align) {
void* mem = JKRAllocFromHeap(mDoExt_getZeldaHeap(), size, align);
@@ -1059,6 +1200,7 @@ u8* mDoGph_allocFromAny(u32 size, int align) {
memset(mem, 0, size);
return (u8*)mem;
}
#endif
/* 8000A8B8-8000AAC4 .text mDoGph_screenCaptureDraw__Fv */
void mDoGph_screenCaptureDraw() {
@@ -1130,7 +1272,7 @@ void mCaptureGXDrawSyncCallback(u16) {
if (mCaptureStep == 2) {
#endif
void* oldcb = (void*)GXSetDrawSyncCallback(mCaptureOldCB);
JUT_ASSERT(0xa5f, oldcb == mCaptureGXDrawSyncCallback);
JUT_ASSERT(VERSION_SELECT(2580, 2655, 2655, 2655), oldcb == mCaptureGXDrawSyncCallback);
mCaptureOldCB = NULL;
mCaptureStep++;
#if VERSION > VERSION_DEMO
@@ -1139,6 +1281,7 @@ void mCaptureGXDrawSyncCallback(u16) {
#endif
}
#if VERSION > VERSION_DEMO
/* 8000ABC4-8000AC3C .text mCaptureGXDrawSyncTimeOut__FP7OSAlarmP9OSContext */
void mCaptureGXDrawSyncTimeOut(OSAlarm*, OSContext*) {
OSReport_Error("キャプチャタイムアウト\n");
@@ -1153,6 +1296,7 @@ void mCaptureGXDrawSyncTimeOut(OSAlarm*, OSContext*) {
}
mCaptureStep = -1;
}
#endif
/* 8000AC3C-8000AEA4 .text mDoGph_screenCapture__Fv */
bool mDoGph_screenCapture() {
@@ -1168,7 +1312,11 @@ bool mDoGph_screenCapture() {
u32 left, top, width, height;
mCaptureTextureSize = GXGetTexBufferSize(sizeW, sizeH, mCaptureTextureFormat, GX_FALSE, 0);
#if VERSION == VERSION_DEMO
mCaptureTextureBuffer = (u8*)JKRAlloc(mCaptureTextureSize, 0x20);
#else
mCaptureTextureBuffer = mDoGph_allocFromAny(mCaptureTextureSize, 0x20);
#endif
if (mCaptureTextureBuffer == NULL) {
mCaptureStep = -1;
return false;
@@ -1176,7 +1324,11 @@ bool mDoGph_screenCapture() {
if (mCaptureTextureFormat == GX_TF_CMPR) {
mCaptureCaptureSize = GXGetTexBufferSize(sizeW, sizeH, mCaptureCaptureFormat, GX_FALSE, 0);
#if VERSION == VERSION_DEMO
mCaptureCaptureBuffer = (u8*)JKRAlloc(mCaptureCaptureSize, 0x20);
#else
mCaptureCaptureBuffer = mDoGph_allocFromAny(mCaptureCaptureSize, 0x20);
#endif
if (mCaptureCaptureBuffer == NULL) {
JKRFreeToHeap(NULL, mCaptureTextureBuffer);
mCaptureTextureBuffer = NULL;
@@ -1205,7 +1357,7 @@ bool mDoGph_screenCapture() {
GXCopyTex(mCaptureCaptureBuffer, GX_FALSE);
GXPixModeSync();
JUT_ASSERT(0xac1, mCaptureOldCB == NULL);
JUT_ASSERT(VERSION_SELECT(2657, 2753, 2753, 2753), mCaptureOldCB == NULL);
mCaptureOldCB = GXSetDrawSyncCallback(mCaptureGXDrawSyncCallback);
#if VERSION > VERSION_DEMO
OSCreateAlarm(&mCaptureTimeOutAlarm);
@@ -1311,7 +1463,11 @@ bool mDoGph_Painter() {
dComIfGd_drawAlphaModel(camera->mViewMtx);
drawAlphaBuffer(camera, dComIfGd_getAlphaModelColor());
if (dComIfGd_getLightModelNum() != 0) {
#if VERSION == VERSION_DEMO
clearAlphaBuffer(camera);
#else
clearAlphaBuffer(camera, 0);
#endif
dComIfGd_drawLightModel(camera->mViewMtx);
drawAlphaBuffer(camera, dComIfGd_getLightModelColor());
}
@@ -1325,7 +1481,11 @@ bool mDoGph_Painter() {
dComIfGd_drawXluListBG();
if (dComIfGd_getSpotModelNum() != 0)
#if VERSION == VERSION_DEMO
clearAlphaBuffer(camera);
#else
clearAlphaBuffer(camera, dComIfGd_getSpotModelColor().a);
#endif
if (!dMenu_flag() && !dPa_control_c::isStatus(0x01))
dComIfGp_particle_drawShipTail(&jpaDrawInfo);
@@ -1356,8 +1516,10 @@ bool mDoGph_Painter() {
dComIfGd_drawOpaListFilter();
#if VERSION > VERSION_DEMO
j3dSys.reinitGX();
GXSetNumIndStages(0);
#endif
if (dComIfGd_getSpotModelNum() != 0) {
dComIfGd_drawAlphaModel(camera->mViewMtx);
@@ -1365,6 +1527,10 @@ bool mDoGph_Painter() {
drawSpot(camera);
}
#if VERSION == VERSION_DEMO
j3dSys.reinitGX();
#endif
GXSetClipMode(GX_CLIP_ENABLE);
dComIfGd_drawOpaListMaskOff();
dComIfGd_drawXluListMaskOff();
@@ -1386,7 +1552,11 @@ bool mDoGph_Painter() {
#endif
if (mDoGph_gInf_c::isMonotone()) {
#if VERSION == VERSION_DEMO
clearAlphaBuffer(camera);
#else
clearAlphaBuffer(camera, 0);
#endif
dComIfGd_drawOpaListP0();
dComIfGd_drawOpaListP1();
dComIfGd_drawXluListP1();
@@ -1394,6 +1564,12 @@ bool mDoGph_Painter() {
dComIfGp_particle_drawToonP1(&jpaDrawInfo);
}
#if VERSION == VERSION_DEMO
if (mCaptureStep == 1) {
mDoGph_screenCapture();
}
#endif
#if VERSION > VERSION_DEMO
mDoGph_gInf_c::calcFade();
if (mCaptureStep == 1) {
@@ -1423,16 +1599,24 @@ bool mDoGph_Painter() {
#endif
{
if (mCaptureTextureFormat == GX_TF_CMPR) {
#if VERSION == VERSION_DEMO
mCaptureThreadStackHead = (u8*)JKRAlloc(mCaptureThreadStackSize, 0x20);
#else
mCaptureThreadStackHead = mDoGph_allocFromAny(mCaptureThreadStackSize, 0x20);
#endif
if (mCaptureThreadStackHead == NULL) {
mCaptureProc(NULL);
if (mCaptureCaptureBuffer != NULL) {
#if VERSION > VERSION_DEMO
if (mCaptureCaptureBuffer != NULL)
#endif
{
JKRFreeToHeap(NULL, mCaptureCaptureBuffer);
mCaptureCaptureBuffer = NULL;
}
mCaptureStep = 5;
} else {
OSCreateThread(&mCaptureThread, (void*)mCaptureProc, NULL, mCaptureThreadStackHead + mCaptureThreadStackSize, mCaptureThreadStackSize, mCaptureThreadPriority, 0);
u8* captureThreadStackBase = mCaptureThreadStackHead + mCaptureThreadStackSize;
OSCreateThread(&mCaptureThread, (void*)mCaptureProc, NULL, captureThreadStackBase, mCaptureThreadStackSize, mCaptureThreadPriority, 0);
OSResumeThread(&mCaptureThread);
mCaptureStep++;
}