Added a bunch of Diag functions to diagnose the black screen issue (was a bug in GXGeometry.h). Resumed to old ClearEfb function, no pink screen anymore.

Updated aurora with local changes for TP
This commit is contained in:
Lurs
2026-02-23 14:33:29 +01:00
parent 43ea7786b9
commit f710f30702
8 changed files with 98 additions and 14 deletions
+1 -1
+5
View File
@@ -28,6 +28,10 @@ static inline void GXSetTexCoordGen(GXTexCoordID dst_coord, GXTexGenType func, G
void GXBegin(GXPrimitive type, GXVtxFmt vtxfmt, u16 nverts);
#ifndef TARGET_PC
// On GameCube, GXEnd is a no-op (hardware reads FIFO directly).
// On PC, Aurora provides an extern GXEnd() that drains the software FIFO
// (declared in extern/aurora/include/dolphin/gx/GXVert.h).
static inline void GXEnd(void) {
#if DEBUG
extern GXBool __GXinBegin;
@@ -38,6 +42,7 @@ static inline void GXEnd(void) {
__GXinBegin = GX_FALSE;
#endif
}
#endif
void GXSetLineWidth(u8 width, GXTexOffset texOffsets);
void GXSetPointSize(u8 pointSize, GXTexOffset texOffsets);
+60 -12
View File
@@ -427,22 +427,70 @@ void JFWDisplay::clearEfb(GXColor color) {
}
void JFWDisplay::clearEfb(int param_0, int param_1, int param_2, int param_3, GXColor color) {
// --- FORCE PINK DEBUG ---
GXColor debugPink = {255, 0, 128, 255};
u16 width;
u16 height;
Mtx44 mtx;
// Set pink as Clear-Farbe and Z to max
GXSetCopyClear(debugPink, 0x00FFFFFF);
// Viewport Safety
u16 width, height;
JUTVideo::getManager()->getBounds(width, height);
GXSetViewport(0.0f, 0.0f, 640.0f, 480.0f, 0.0f, 1.0f);
GXSetScissor(0, 0, 640, 480);
// State Reset
GXSetZMode(GX_ENABLE, GX_LEQUAL, GX_ENABLE);
C_MTXOrtho(mtx, 0.0f, height, 0.0f, width, 0.0f, 1.0f);
GXSetProjection(mtx, GX_ORTHOGRAPHIC);
GXSetViewport(0.0f, 0.0f, width, height, 0.0f, 1.0f);
GXSetScissor(0, 0, width, height);
GXLoadPosMtxImm(e_mtx, GX_PNMTX0);
GXSetCurrentMtx(0);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGB, GX_RGBX8, 0);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGB565, 0);
GXSetNumChans(0);
GXSetChanCtrl(GX_COLOR0A0, GX_DISABLE, GX_SRC_REG, GX_SRC_REG, GX_LIGHT_NULL, GX_DF_NONE,
GX_AF_NONE);
GXSetChanCtrl(GX_COLOR1A1, GX_DISABLE, GX_SRC_REG, GX_SRC_REG, GX_LIGHT_NULL, GX_DF_NONE,
GX_AF_NONE);
GXSetNumTexGens(1);
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60);
GXLoadTexObj(&clear_z_tobj, GX_TEXMAP0);
GXSetNumTevStages(1);
GXSetTevColor(GX_TEVREG0, color);
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_ENABLE, GX_TEVPREV);
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A0);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_ENABLE, GX_TEVPREV);
GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_OR, GX_ALWAYS, 0);
GXSetZTexture(GX_ZT_REPLACE, GX_TF_Z24X8, 0);
GXSetZCompLoc(GX_DISABLE);
GXSetBlendMode(GX_BM_NONE, GX_BL_ZERO, GX_BL_ZERO, GX_LO_NOOP);
if (mEnableAlpha) {
GXSetAlphaUpdate(GX_ENABLE);
GXSetDstAlpha(GX_ENABLE, color.a);
}
GXSetZMode(GX_ENABLE, GX_ALWAYS, GX_ENABLE);
GXSetCullMode(GX_CULL_BACK);
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
GXPosition2u16(param_0, param_1);
GXTexCoord2u8(0, 0);
GXPosition2u16(param_0 + param_2, param_1);
GXTexCoord2u8(1, 0);
GXPosition2u16(param_0 + param_2, param_1 + param_3);
GXTexCoord2u8(1, 1);
GXPosition2u16(param_0, param_1 + param_3);
GXTexCoord2u8(0, 1);
GXEnd();
GXSetZTexture(GX_ZT_DISABLE, GX_TF_Z24X8, 0);
GXSetZCompLoc(GX_ENABLE);
GXSetAlphaUpdate(GX_ENABLE);
if (mEnableAlpha) {
GXSetDstAlpha(GX_DISABLE, color.a);
}
}
void JFWDisplay::calcCombinationRatio() {
+3
View File
@@ -166,6 +166,9 @@ void JUTTexture::initTexObj(GXTlut param_0) {
mTlutName = param_0;
u8* image = ((u8*)mTexInfo);
u32 imgOffset = RES_U32(mTexInfo->imageOffset); // Swap!
printf("[DIAG] initTexObj: Offset=%u, W=%u, H=%u, Ptr=%p\n", imgOffset, mTexInfo->width,
mTexInfo->height,
mTexInfo);
image += (imgOffset ? imgOffset : 0x20);
GXInitTexObjCI(&mTexObj, image, RES_U16(mTexInfo->width), RES_U16(mTexInfo->height),
(GXCITexFmt)mTexInfo->format, (GXTexWrapMode)mWrapS,
+8
View File
@@ -1,5 +1,6 @@
#include "d/dolzel.h" // IWYU pragma: keep
#include <cstdio>
#include "JSystem/J2DGraph/J2DAnimation.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DScreen.h"
@@ -865,6 +866,13 @@ dDlst_2D_c::dDlst_2D_c(ResTIMG* i_timg, s16 i_posX, s16 i_posY, s16 i_sizeX, s16
}
void dDlst_2D_c::draw() {
static int s2DDrawLogCount = 0;
if (s2DDrawLogCount < 10) {
printf("[DIAG] dDlst_2D_c::draw: pos=(%d,%d) size=(%d,%d) alpha=%d\n",
mPosX, mPosY, mSizeX, mSizeY, mAlpha);
fflush(stdout);
s2DDrawLogCount++;
}
mpPicture.setAlpha(mAlpha);
mpPicture.draw(mPosX, mPosY, mSizeX, mSizeY, false, false, false);
}
+6
View File
@@ -107,8 +107,14 @@ void dScnLogo_c::checkProgSelect() {
}
int dScnLogo_c::draw() {
static int sDrawLogCount = 0;
if (sDrawLogCount < 10) {
printf("[DIAG] dScnLogo_c::draw: mExecCommand=%d mTimer=%d\n", mExecCommand, mTimer);
fflush(stdout);
}
cLib_calcTimer<u16>(&mTimer);
(this->*l_execFunc[mExecCommand])();
sDrawLogCount++;
return 1;
}
+2 -1
View File
@@ -1640,10 +1640,11 @@ f32 GXGetYScaleFactor(u16 efbHeight, u16 xfbHeight) {
puts("GXGetYScaleFactor is a stub");
return 0.0f;
}
void GXInitTexCacheRegion(GXTexRegion* region, u8 is_32b_mipmap, u32 tmem_even,
GXTexCacheSize size_even, u32 tmem_odd, GXTexCacheSize size_odd) {
puts("GXInitTexCacheRegion is a stub");
}
}
// XXX, this should be some struct?
// GXRenderModeObj GXNtsc480IntDf;
GXRenderModeObj GXNtsc480Int;
+13
View File
@@ -2090,6 +2090,19 @@ int mDoGph_Painter() {
dComIfGp_particle_draw2DmenuFore(&draw_info3);
j3dSys.setViewMtx(m4);
} else {
// No camera window active — still draw 2D display lists
// (needed for logo scene, which has no 3D camera)
static int sElseLogCount = 0;
if (sElseLogCount < 10) {
printf("[DIAG] mDoGph_Painter else: drawing 2D lists (frame %d)\n", sElseLogCount);
fflush(stdout);
sElseLogCount++;
}
ortho.setPort();
dComIfGd_draw2DOpa();
dComIfGd_draw2DOpaTop();
dComIfGd_draw2DXlu();
}
#if DEBUG