mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-27 15:42:42 -04:00
First pink screen!
This commit is contained in:
Vendored
+1
-1
Submodule extern/aurora updated: 928834269d...a463669faa
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <dolphin/gx.h>
|
||||
#include <stdint.h>
|
||||
#include "dusk/endian.h"
|
||||
|
||||
class JUTPalette;
|
||||
|
||||
@@ -25,7 +26,7 @@ struct ResTIMG {
|
||||
/* 0x08 */ u8 indexTexture;
|
||||
/* 0x09 */ u8 colorFormat;
|
||||
/* 0x0A */ u16 numColors;
|
||||
/* 0x0C */ uintptr_t paletteOffset;
|
||||
/* 0x0C */ u32 paletteOffset;
|
||||
/* 0x10 */ u8 mipmapEnabled;
|
||||
/* 0x11 */ u8 doEdgeLOD;
|
||||
/* 0x12 */ u8 biasClamp;
|
||||
@@ -37,7 +38,7 @@ struct ResTIMG {
|
||||
/* 0x18 */ u8 mipmapCount;
|
||||
/* 0x19 */ u8 unknown;
|
||||
/* 0x1A */ s16 LODBias;
|
||||
/* 0x1C */ uintptr_t imageOffset;
|
||||
/* 0x1C */ u32 imageOffset;
|
||||
}; // Size: 0x20
|
||||
|
||||
/**
|
||||
@@ -71,8 +72,8 @@ public:
|
||||
const ResTIMG* getTexInfo() const { return mTexInfo; }
|
||||
s32 getFormat() const { return mTexInfo->format; }
|
||||
s32 getTransparency() const { return mTexInfo->alphaEnabled; }
|
||||
s32 getWidth() const { return mTexInfo->width; }
|
||||
s32 getHeight() const { return mTexInfo->height; }
|
||||
s32 getWidth() const { return RES_U16(mTexInfo->width); }
|
||||
s32 getHeight() const { return RES_U16(mTexInfo->height); }
|
||||
void setCaptureFlag(bool flag) { mFlags &= 2 | flag; }
|
||||
bool getCaptureFlag() const { return mFlags & 1; }
|
||||
bool getEmbPaletteDelFlag() const { return mFlags & 2; }
|
||||
|
||||
@@ -38,12 +38,12 @@ inline void fopCamM_SetAngleY(camera_class* i_camera, s16 angle) {
|
||||
i_camera->angle.y = angle;
|
||||
}
|
||||
|
||||
inline void fopCamM_SetNear(camera_class* i_this, f32 near) {
|
||||
i_this->near = near;
|
||||
inline void fopCamM_SetNear(camera_class* i_this, f32 near_) {
|
||||
i_this->near_ = near_;
|
||||
}
|
||||
|
||||
inline void fopCamM_SetFar(camera_class* i_this, f32 far) {
|
||||
i_this->far = far;
|
||||
inline void fopCamM_SetFar(camera_class* i_this, f32 far_) {
|
||||
i_this->far_ = far_;
|
||||
}
|
||||
|
||||
inline void fopCamM_SetFovy(camera_class* i_this, f32 fovy) {
|
||||
|
||||
@@ -43,8 +43,8 @@ struct view_class {
|
||||
/* 0x000 */ leafdraw_class base;
|
||||
/* 0x0C0 */ leafdraw_method_class* sub_method;
|
||||
/* 0x0C4 */ u8 field_0xc4;
|
||||
/* 0x0C8 */ f32 near;
|
||||
/* 0x0CC */ f32 far;
|
||||
/* 0x0C8 */ f32 near_;
|
||||
/* 0x0CC */ f32 far_;
|
||||
/* 0x0D0 */ f32 fovy;
|
||||
/* 0x0D4 */ f32 aspect;
|
||||
/* 0x0D8 */ lookat_class lookat;
|
||||
|
||||
@@ -93,7 +93,10 @@ public:
|
||||
}
|
||||
|
||||
static int startFadeOut(int param_0) { return JFWDisplay::getManager()->startFadeOut(param_0); }
|
||||
static int startFadeIn(int param_0) { return JFWDisplay::getManager()->startFadeIn(param_0); }
|
||||
static int startFadeIn(int param_0) {
|
||||
printf("[DIAG] mDoGph_gInf_c::startFadeIn START\n");
|
||||
fflush(stdout);
|
||||
return JFWDisplay::getManager()->startFadeIn(param_0); }
|
||||
static void setFadeColor(JUtility::TColor& color) { mFader->setColor(color); }
|
||||
static void setClearColor(JUtility::TColor color) { JFWDisplay::getManager()->setClearColor(color); }
|
||||
static void setBackColor(GXColor& color) { mBackColor = color; }
|
||||
|
||||
@@ -11,8 +11,8 @@ struct ResTIMG;
|
||||
struct mDoLib_clipper {
|
||||
static void setup(f32, f32, f32, f32);
|
||||
|
||||
static void changeFar(f32 far) {
|
||||
mClipper.setFar(far);
|
||||
static void changeFar(f32 far_) {
|
||||
mClipper.setFar(far_);
|
||||
mClipper.calcViewFrustum();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JFramework/JFWDisplay.h"
|
||||
#include <dolphin/gx.h>
|
||||
#include <dolphin/vi.h>
|
||||
#include <stdint.h>
|
||||
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
|
||||
#include "JSystem/JFramework/JFWDisplay.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JUtility/JUTConsole.h"
|
||||
#include "JSystem/JUtility/JUTDbPrint.h"
|
||||
#include "JSystem/JUtility/JUTProcBar.h"
|
||||
#include <dolphin/gx.h>
|
||||
#include <dolphin/vi.h>
|
||||
#include "global.h"
|
||||
#include <stdint.h>
|
||||
#include "aurora/aurora.h"
|
||||
|
||||
void JFWDisplay::ctor_subroutine(bool enableAlpha) {
|
||||
mEnableAlpha = enableAlpha;
|
||||
mClamp = GX_CLAMP_TOP | GX_CLAMP_BOTTOM;
|
||||
mClearColor = JUtility::TColor(0, 0, 0, 0);
|
||||
mClearColor = JUtility::TColor(255, 0, 128, 255);
|
||||
mZClear = 0xFFFFFF;
|
||||
mGamma = 0;
|
||||
mFader = NULL;
|
||||
@@ -199,10 +200,10 @@ void JFWDisplay::endGX() {
|
||||
|
||||
J2DOrthoGraph ortho(0.0f, 0.0f, width, height, -1.0f, 1.0f);
|
||||
|
||||
if (mFader != NULL) {
|
||||
ortho.setPort();
|
||||
mFader->control();
|
||||
}
|
||||
//if (mFader != NULL) {
|
||||
// ortho.setPort();
|
||||
// mFader->control();
|
||||
//}
|
||||
ortho.setPort();
|
||||
JUTDbPrint::getManager()->flush();
|
||||
|
||||
@@ -221,6 +222,7 @@ void JFWDisplay::endGX() {
|
||||
}
|
||||
|
||||
void JFWDisplay::beginRender() {
|
||||
//aurora_begin_frame();
|
||||
if (field_0x40) {
|
||||
JUTProcBar::getManager()->wholeLoopEnd();
|
||||
}
|
||||
@@ -298,6 +300,7 @@ void JFWDisplay::endRender() {
|
||||
|
||||
JUTProcBar::getManager()->cpuStart();
|
||||
calcCombinationRatio();
|
||||
//aurora_end_frame();
|
||||
}
|
||||
|
||||
void JFWDisplay::endFrame() {
|
||||
@@ -325,7 +328,8 @@ void JFWDisplay::endFrame() {
|
||||
}
|
||||
|
||||
if (field_0x40) {
|
||||
static u32 prevFrame = VIGetRetraceCount();;
|
||||
static u32 prevFrame = VIGetRetraceCount();
|
||||
;
|
||||
u32 retrace_cnt = VIGetRetraceCount();
|
||||
u32 r28 = retrace_cnt - prevFrame;
|
||||
JUTProcBar::getManager()->setCostFrame(retrace_cnt - prevFrame);
|
||||
@@ -340,7 +344,10 @@ void JFWDisplay::waitBlanking(int param_0) {
|
||||
}
|
||||
|
||||
static void waitForTick(u32 p1, u16 p2) {
|
||||
if (p1 != 0) {
|
||||
|
||||
|
||||
if (p1 != 0)
|
||||
{
|
||||
static OSTime nextTick = OSGetTime();
|
||||
OSTime time = OSGetTime();
|
||||
while (time < nextTick) {
|
||||
@@ -348,18 +355,19 @@ static void waitForTick(u32 p1, u16 p2) {
|
||||
time = OSGetTime();
|
||||
}
|
||||
nextTick = time + p1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
static u32 nextCount = VIGetRetraceCount();
|
||||
u32 uVar1 = (p2 == 0) ? 1 : p2;
|
||||
OSMessage msg;
|
||||
do {
|
||||
if (!OSReceiveMessage(JUTVideo::getManager()->getMessageQueue(), &msg, OS_MESSAGE_BLOCK)) {
|
||||
if (!OSReceiveMessage(JUTVideo::getManager()->getMessageQueue(), &msg,
|
||||
OS_MESSAGE_BLOCK))
|
||||
{
|
||||
msg = 0;
|
||||
}
|
||||
} while (((intptr_t)msg - (intptr_t)nextCount) < 0);
|
||||
nextCount = (intptr_t)msg + uVar1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSUList<JFWAlarm> JFWAlarm::sList(false);
|
||||
@@ -419,70 +427,24 @@ void JFWDisplay::clearEfb(GXColor color) {
|
||||
}
|
||||
|
||||
void JFWDisplay::clearEfb(int param_0, int param_1, int param_2, int param_3, GXColor color) {
|
||||
u16 width;
|
||||
u16 height;
|
||||
Mtx44 mtx;
|
||||
// --- FORCE PINK DEBUG ---
|
||||
// Das Spiel übergibt hier "Schwarz". Wir ignorieren das und erzwingen Pink.
|
||||
// So sehen wir sofort, ob dieser Code ausgeführt wird.
|
||||
GXColor debugPink = {255, 0, 128, 255};
|
||||
|
||||
// Setze Pink als Clear-Farbe und Z auf 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);
|
||||
|
||||
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);
|
||||
// State Reset
|
||||
GXSetZMode(GX_ENABLE, GX_LEQUAL, GX_ENABLE);
|
||||
GXSetZCompLoc(GX_ENABLE);
|
||||
if (mEnableAlpha) {
|
||||
GXSetDstAlpha(GX_DISABLE, color.a);
|
||||
}
|
||||
GXSetAlphaUpdate(GX_ENABLE);
|
||||
}
|
||||
|
||||
void JFWDisplay::calcCombinationRatio() {
|
||||
|
||||
@@ -20,6 +20,7 @@ JUTGraphFifo::JUTGraphFifo(u32 size) {
|
||||
mBase = JKRAllocFromSysHeap(mSize + 0xA0, 32);
|
||||
mBase = (void*)((intptr_t)mBase + 0x1F & ~0x1F);
|
||||
mFifo = GXInit(mBase, mSize);
|
||||
GXSetColorUpdate(GX_ENABLE);
|
||||
data_804514B8 = true;
|
||||
sCurrentFifo = this;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "JSystem/JUtility/JUTPalette.h"
|
||||
#include <dolphin/gx.h>
|
||||
#include <dolphin/os.h>
|
||||
#include "dusk/endian.h"
|
||||
|
||||
void JUTPalette::storeTLUT(GXTlut param_0, ResTLUT* tlut) {
|
||||
if (tlut == NULL) {
|
||||
@@ -11,8 +12,8 @@ void JUTPalette::storeTLUT(GXTlut param_0, ResTLUT* tlut) {
|
||||
mTlutName = param_0;
|
||||
mFormat = tlut->format;
|
||||
mTransparency = tlut->transparency;
|
||||
mNumColors = tlut->numColors;
|
||||
mColorTable = tlut + 8;
|
||||
mNumColors = RES_U16(tlut->numColors);
|
||||
mColorTable = (ResTLUT*)((u8*)tlut + 0x20);
|
||||
GXInitTlutObj(&mTlutObj, (void*)mColorTable, (GXTlutFmt)mFormat, mNumColors);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ JUTTexture::~JUTTexture() {
|
||||
void JUTTexture::storeTIMG(ResTIMG const* param_0, u8 param_1) {
|
||||
if (param_0 && param_1 < 0x10) {
|
||||
mTexInfo = param_0;
|
||||
mTexData = (void*)((intptr_t)mTexInfo + mTexInfo->imageOffset);
|
||||
u32 imgOffset = RES_U32(mTexInfo->imageOffset);
|
||||
mTexData = (void*)((intptr_t)mTexInfo + imgOffset);
|
||||
|
||||
if (mTexInfo->imageOffset == 0) {
|
||||
mTexData = (void*)((intptr_t)mTexInfo + 0x20);
|
||||
@@ -30,27 +31,33 @@ void JUTTexture::storeTIMG(ResTIMG const* param_0, u8 param_1) {
|
||||
mMagFilter = mTexInfo->magFilter;
|
||||
mMinLOD = (s8)mTexInfo->minLOD;
|
||||
mMaxLOD = (s8)mTexInfo->maxLOD;
|
||||
mLODBias = mTexInfo->LODBias;
|
||||
mLODBias = RES_S16(mTexInfo->LODBias);
|
||||
|
||||
if (mTexInfo->numColors == 0) {
|
||||
u16 numColors = RES_U16(mTexInfo->numColors);
|
||||
|
||||
if (numColors == 0) {
|
||||
initTexObj();
|
||||
} else {
|
||||
GXTlut tlut;
|
||||
if (mTexInfo->numColors > 0x100) {
|
||||
if (numColors > 0x100) {
|
||||
tlut = (GXTlut)((param_1 % 4) + GX_BIGTLUT0);
|
||||
} else {
|
||||
tlut = (GXTlut)param_1;
|
||||
}
|
||||
|
||||
u32 palOffset = RES_U32(mTexInfo->paletteOffset);
|
||||
|
||||
if (mEmbPalette == NULL || !getEmbPaletteDelFlag()) {
|
||||
mEmbPalette = new JUTPalette(tlut, (GXTlutFmt)mTexInfo->colorFormat,
|
||||
(JUTTransparency)mTexInfo->alphaEnabled, mTexInfo->numColors,
|
||||
(void*)(&mTexInfo->format + mTexInfo->paletteOffset));
|
||||
(JUTTransparency)mTexInfo->alphaEnabled,
|
||||
numColors,
|
||||
(void*)((intptr_t)mTexInfo + palOffset));
|
||||
setEmbPaletteDelFlag(true);
|
||||
} else {
|
||||
mEmbPalette->storeTLUT(tlut, (GXTlutFmt)mTexInfo->colorFormat,
|
||||
(JUTTransparency)mTexInfo->alphaEnabled, mTexInfo->numColors,
|
||||
(void*)(&mTexInfo->format + mTexInfo->paletteOffset));
|
||||
(JUTTransparency)mTexInfo->alphaEnabled,
|
||||
numColors,
|
||||
(void*)((intptr_t)mTexInfo + palOffset));
|
||||
}
|
||||
attachPalette(mEmbPalette);
|
||||
}
|
||||
@@ -139,12 +146,13 @@ void JUTTexture::initTexObj() {
|
||||
mipmapEnabled = 0;
|
||||
}
|
||||
u8* image = ((u8*)mTexInfo);
|
||||
image += (mTexInfo->imageOffset ? mTexInfo->imageOffset : 0x20);
|
||||
GXInitTexObj(&mTexObj, image, mTexInfo->width, mTexInfo->height,
|
||||
(GXTexFmt)mTexInfo->format, (GXTexWrapMode)mWrapS,
|
||||
(GXTexWrapMode)mWrapT, mipmapEnabled);
|
||||
GXInitTexObjLOD(&mTexObj, (GXTexFilter)mMinFilter, (GXTexFilter)mMagFilter,
|
||||
mMinLOD / 8.0f, mMaxLOD / 8.0f, mLODBias / 100.0f, mTexInfo->biasClamp,
|
||||
u32 imgOffset = RES_U32(mTexInfo->imageOffset);
|
||||
image += (imgOffset ? imgOffset : 0x20);
|
||||
GXInitTexObj(&mTexObj, image, RES_U16(mTexInfo->width), RES_U16(mTexInfo->height),
|
||||
(GXTexFmt)mTexInfo->format, (GXTexWrapMode)mWrapS, (GXTexWrapMode)mWrapT,
|
||||
mipmapEnabled);
|
||||
GXInitTexObjLOD(&mTexObj, (GXTexFilter)mMinFilter, (GXTexFilter)mMagFilter, mMinLOD / 8.0f,
|
||||
mMaxLOD / 8.0f, RES_S16(mLODBias) / 100.0f, mTexInfo->biasClamp,
|
||||
mTexInfo->doEdgeLOD, (GXAnisotropy)mTexInfo->maxAnisotropy);
|
||||
}
|
||||
|
||||
@@ -157,12 +165,13 @@ void JUTTexture::initTexObj(GXTlut param_0) {
|
||||
}
|
||||
mTlutName = param_0;
|
||||
u8* image = ((u8*)mTexInfo);
|
||||
image += (mTexInfo->imageOffset ? mTexInfo->imageOffset : 0x20);
|
||||
GXInitTexObjCI(&mTexObj, image, mTexInfo->width, mTexInfo->height,
|
||||
u32 imgOffset = RES_U32(mTexInfo->imageOffset); // Swap!
|
||||
image += (imgOffset ? imgOffset : 0x20);
|
||||
GXInitTexObjCI(&mTexObj, image, RES_U16(mTexInfo->width), RES_U16(mTexInfo->height),
|
||||
(GXCITexFmt)mTexInfo->format, (GXTexWrapMode)mWrapS,
|
||||
(GXTexWrapMode)mWrapT, mipmapEnabled, param_0);
|
||||
GXInitTexObjLOD(&mTexObj, (GXTexFilter)mMinFilter, (GXTexFilter)mMagFilter,
|
||||
mMinLOD / 8.0f, mMaxLOD / 8.0f, mLODBias / 100.0f, mTexInfo->biasClamp,
|
||||
GXInitTexObjLOD(&mTexObj, (GXTexFilter)mMinFilter, (GXTexFilter)mMagFilter, mMinLOD / 8.0f,
|
||||
mMaxLOD / 8.0f, RES_S16(mLODBias) / 100.0f, mTexInfo->biasClamp,
|
||||
mTexInfo->doEdgeLOD, (GXAnisotropy)mTexInfo->maxAnisotropy);
|
||||
}
|
||||
|
||||
|
||||
@@ -2095,6 +2095,10 @@ bool Z2SceneMgr::loadSceneWave(u32 wave, u32 bank) {
|
||||
#endif
|
||||
|
||||
bool Z2SceneMgr::loadSeWave(u32 wave) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* //lw stub lw
|
||||
JAUSectionHeap* sectionHeap = JASGlobalInstance<JAUSectionHeap>::getInstance();
|
||||
JUT_ASSERT(3030, sectionHeap);
|
||||
|
||||
@@ -2109,8 +2113,13 @@ bool Z2SceneMgr::loadSeWave(u32 wave) {
|
||||
JUT_WARN_DEVICE(3038, 1, "Z2SceneMgr::cannot load SE wave:%d\n", wave);
|
||||
return false;
|
||||
}
|
||||
|
||||
*/
|
||||
bool Z2SceneMgr::loadBgmWave(u32 wave) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* //lw stub lw
|
||||
|
||||
JAUSectionHeap* sectionHeap = JASGlobalInstance<JAUSectionHeap>::getInstance();
|
||||
JUT_ASSERT(3047, sectionHeap);
|
||||
|
||||
@@ -2124,4 +2133,4 @@ bool Z2SceneMgr::loadBgmWave(u32 wave) {
|
||||
|
||||
JUT_WARN_DEVICE(3055, 1, "Z2SceneMgr::cannot load BGM wave:%d\n", wave);
|
||||
return false;
|
||||
}
|
||||
} */
|
||||
|
||||
@@ -196,8 +196,8 @@ void daAlink_c::preKandelaarDraw() {
|
||||
field_0x32c8 = 0;
|
||||
}
|
||||
|
||||
f32 near = dComIfGd_getView()->near;
|
||||
f32 far = dComIfGd_getView()->far;
|
||||
f32 near_ = dComIfGd_getView()->near_;
|
||||
f32 far_ = dComIfGd_getView()->far_;
|
||||
|
||||
mDoLib_pos2camera(&mKandelaarFlamePos, &proj);
|
||||
proj.z += 30.0f;
|
||||
@@ -205,7 +205,7 @@ void daAlink_c::preKandelaarDraw() {
|
||||
proj.z = -0.01f;
|
||||
}
|
||||
|
||||
field_0x344c = ((near + (far * near) / proj.z) / (far - near) + 1.0f) * 1.6777215E7f;
|
||||
field_0x344c = ((near_ + (far_ * near_) / proj.z) / (far_ - near_) + 1.0f) * 1.6777215E7f;
|
||||
}
|
||||
|
||||
void daAlink_c::setKandelaarModel() {
|
||||
|
||||
@@ -3234,9 +3234,9 @@ int daMidna_c::execute() {
|
||||
if (!checkShadowModeTalkWait() || fopAcM_getTalkEventPartner(link) == this) {
|
||||
if (!checkStateFlg0(FLG0_UNK_8000)) {
|
||||
offStateFlg0((daMidna_FLG0)(FLG0_NPC_NEAR | FLG0_NPC_FAR));
|
||||
BOOL far;
|
||||
if (fopAcIt_Judge((fopAcIt_JudgeFunc)daMidna_searchNpc, &far)) {
|
||||
if (!far) {
|
||||
BOOL far_;
|
||||
if (fopAcIt_Judge((fopAcIt_JudgeFunc)daMidna_searchNpc, &far_)) {
|
||||
if (!far_) {
|
||||
onStateFlg0(FLG0_NPC_NEAR);
|
||||
} else {
|
||||
onStateFlg0(FLG0_NPC_FAR);
|
||||
|
||||
@@ -270,7 +270,7 @@ void dMirror_packet_c::mainDraw() {
|
||||
int prjPosNum = 4;
|
||||
|
||||
view_class* view = dComIfGd_getView();
|
||||
f32 temp_f22 = -view->near;
|
||||
f32 temp_f22 = -view->near_;
|
||||
cXyz* var_r21 = mQuad;
|
||||
cXyz* var_r22 = sp19C;
|
||||
int var_r23 = 0;
|
||||
@@ -427,12 +427,12 @@ void dMirror_packet_c::mainDraw() {
|
||||
|
||||
j3dSys.reinitGX();
|
||||
GXSetScissor(scissor[0], scissor[1], scissor[2], scissor[3]);
|
||||
mirrorZdraw(sp150, sp138, view->far, var_f31, var_f30, var_f29, var_f28, var_f27);
|
||||
mirrorZdraw(sp150, sp138, view->far_, var_f31, var_f30, var_f29, var_f28, var_f27);
|
||||
}
|
||||
}
|
||||
|
||||
void dMirror_packet_c::draw() {
|
||||
mDoLib_clipper::changeFar(dComIfGd_getView()->far);
|
||||
mDoLib_clipper::changeFar(dComIfGd_getView()->far_);
|
||||
if (!mDoLib_clipper::clip(j3dSys.getViewMtx(), &mMaxVal, &mMinVal)) {
|
||||
mainDraw();
|
||||
}
|
||||
|
||||
@@ -510,14 +510,14 @@ void daObjARI_c::Z_BufferChk() {
|
||||
dComIfGd_peekZ(vec2.x, vec2.y, &mBufferZ);
|
||||
}
|
||||
|
||||
f32 near = dComIfGd_getView()->near;
|
||||
f32 far = dComIfGd_getView()->far;
|
||||
f32 near_ = dComIfGd_getView()->near_;
|
||||
f32 far_ = dComIfGd_getView()->far_;
|
||||
mDoLib_pos2camera(&vec1, &vec2);
|
||||
vec2.z += 50.0f;
|
||||
if (vec2.z > 0.0f) {
|
||||
vec2.z = 0.0f;
|
||||
}
|
||||
mScreenZ = ((near + far * near / vec2.z) / (far - near) + 1.0f) * 0xffffff;
|
||||
mScreenZ = ((near_ + far_ * near_ / vec2.z) / (far_ - near_) + 1.0f) * 0xffffff;
|
||||
}
|
||||
|
||||
int daObjARI_c::Delete() {
|
||||
|
||||
@@ -300,14 +300,14 @@ void daObjCHO_c::Z_BufferChk() {
|
||||
dComIfGd_peekZ(vec2.x, vec2.y, &mBufferZ);
|
||||
}
|
||||
|
||||
f32 near = dComIfGd_getView()->near;
|
||||
f32 far = dComIfGd_getView()->far;
|
||||
f32 near_ = dComIfGd_getView()->near_;
|
||||
f32 far_ = dComIfGd_getView()->far_;
|
||||
mDoLib_pos2camera(&vec1, &vec2);
|
||||
vec2.z += 50.0f;
|
||||
if (vec2.z > 0.0f) {
|
||||
vec2.z = 0.0f;
|
||||
}
|
||||
mScreenZ = ((near + far * near / vec2.z) / (far - near) + 1.0f) * 0xffffff;
|
||||
mScreenZ = ((near_ + far_ * near_ / vec2.z) / (far_ - near_) + 1.0f) * 0xffffff;
|
||||
}
|
||||
|
||||
void daObjCHO_c::ParticleSet() {
|
||||
|
||||
@@ -278,14 +278,14 @@ void daObjDAN_c::Z_BufferChk() {
|
||||
dComIfGd_peekZ(vec2.x, vec2.y, &mBufferZ);
|
||||
}
|
||||
|
||||
f32 near = dComIfGd_getView()->near;
|
||||
f32 far = dComIfGd_getView()->far;
|
||||
f32 near_ = dComIfGd_getView()->near_;
|
||||
f32 far_ = dComIfGd_getView()->far_;
|
||||
mDoLib_pos2camera(&vec1, &vec2);
|
||||
vec2.z += 50.0f;
|
||||
if (vec2.z > 0.0f) {
|
||||
vec2.z = 0.0f;
|
||||
}
|
||||
mScreenZ = ((near + far * near / vec2.z) / (far - near) + 1.0f) * 0xffffff;
|
||||
mScreenZ = ((near_ + far_ * near_ / vec2.z) / (far_ - near_) + 1.0f) * 0xffffff;
|
||||
}
|
||||
|
||||
void daObjDAN_c::ParticleSet() {
|
||||
|
||||
@@ -444,14 +444,14 @@ void daObjKABUTO_c::Z_BufferChk() {
|
||||
dComIfGd_peekZ(vec2.x, vec2.y, &mBufferZ);
|
||||
}
|
||||
|
||||
f32 near = dComIfGd_getView()->near;
|
||||
f32 far = dComIfGd_getView()->far;
|
||||
f32 near_ = dComIfGd_getView()->near_;
|
||||
f32 far_ = dComIfGd_getView()->far_;
|
||||
mDoLib_pos2camera(&vec1, &vec2);
|
||||
vec2.z += 50.0f;
|
||||
if (vec2.z > 0.0f) {
|
||||
vec2.z = 0.0f;
|
||||
}
|
||||
mScreenZ = ((near + far * near / vec2.z) / (far - near) + 1.0f) * 0xffffff;
|
||||
mScreenZ = ((near_ + far_ * near_ / vec2.z) / (far_ - near_) + 1.0f) * 0xffffff;
|
||||
}
|
||||
|
||||
void daObjKABUTO_c::Action() {
|
||||
|
||||
@@ -536,14 +536,14 @@ void daObjKAM_c::Z_BufferChk() {
|
||||
{
|
||||
dComIfGd_peekZ(currentProj.x, currentProj.y, &field_0x9bc);
|
||||
}
|
||||
f32 near = dComIfGd_getView()->near;
|
||||
f32 far = dComIfGd_getView()->far;
|
||||
f32 near_ = dComIfGd_getView()->near_;
|
||||
f32 far_ = dComIfGd_getView()->far_;
|
||||
mDoLib_pos2camera(¤tOffset, ¤tProj);
|
||||
currentProj.z += 50.0f;
|
||||
if (currentProj.z > 0.0f) {
|
||||
currentProj.z = 0.0f;
|
||||
}
|
||||
field_0x9b8 = ((near + (far * near) / currentProj.z) / (far - near) + 1.0f) * 16777215.0f;
|
||||
field_0x9b8 = ((near_ + (far_ * near_) / currentProj.z) / (far_ - near_) + 1.0f) * 16777215.0f;
|
||||
}
|
||||
|
||||
void daObjKAM_c::ParticleSet() {
|
||||
|
||||
@@ -610,8 +610,8 @@ void daObjKAT_c::Z_BufferChk() {
|
||||
dComIfGd_peekZ(projected.x,projected.y, &field_0x804);
|
||||
}
|
||||
|
||||
f32 near = dComIfGd_getView()->near;
|
||||
f32 far = dComIfGd_getView()->far;
|
||||
f32 near_ = dComIfGd_getView()->near_;
|
||||
f32 far_ = dComIfGd_getView()->far_;
|
||||
mDoLib_pos2camera(&curWithOff, &projected);
|
||||
|
||||
projected.z += 50.0f;
|
||||
@@ -619,7 +619,7 @@ void daObjKAT_c::Z_BufferChk() {
|
||||
projected.z = 0.0f;
|
||||
}
|
||||
|
||||
field_0x800 = ((near + far * near / projected.z) / (far - near) + 1.0f) * 16777215.0f;
|
||||
field_0x800 = ((near_ + far_ * near_ / projected.z) / (far_ - near_) + 1.0f) * 16777215.0f;
|
||||
}
|
||||
|
||||
int daObjKAT_c::Delete() {
|
||||
|
||||
@@ -543,8 +543,8 @@ void daObjKUW_c::Z_BufferChk() {
|
||||
}
|
||||
|
||||
view_class* view = dComIfGd_getView();
|
||||
f32 nearPlane = view->near;
|
||||
f32 farPlane = view->far;
|
||||
f32 nearPlane = view->near_;
|
||||
f32 farPlane = view->far_;
|
||||
|
||||
mDoLib_pos2camera(&cStack_68, &local_5c);
|
||||
local_5c.z += 50.0f;
|
||||
|
||||
@@ -38,7 +38,7 @@ void dScissorBegin_packet_c::draw() {
|
||||
cXyz spEC[5];
|
||||
int sp60 = 4;
|
||||
view_class* view_p = dComIfGd_getView();
|
||||
f32 sp58 = -view_p->near;
|
||||
f32 sp58 = -view_p->near_;
|
||||
|
||||
cXyz* sp54 = mQuad;
|
||||
cXyz* var_r30 = spEC;
|
||||
|
||||
@@ -605,14 +605,14 @@ void daObjTEN_c::Z_BufferChk() {
|
||||
{
|
||||
dComIfGd_peekZ(local_5c.x, local_5c.y, &field_0x61c);
|
||||
}
|
||||
f32 near = dComIfGd_getView()->near;
|
||||
f32 far = dComIfGd_getView()->far;
|
||||
f32 near_ = dComIfGd_getView()->near_;
|
||||
f32 far_ = dComIfGd_getView()->far_;
|
||||
mDoLib_pos2camera(&cStack_68, &local_5c);
|
||||
local_5c.z += 50.0f;
|
||||
if (local_5c.z > 0.0f) {
|
||||
local_5c.z = 0.0f;
|
||||
}
|
||||
field_0x618 = ((near + ((far * near) / local_5c.z)) / (far - near) + 1.0f) * 16777215.0f;
|
||||
field_0x618 = ((near_ + ((far_ * near_) / local_5c.z)) / (far_ - near_) + 1.0f) * 16777215.0f;
|
||||
}
|
||||
|
||||
static u8 hio_set;
|
||||
|
||||
@@ -516,15 +516,15 @@ void daObjTOMBO_c::Z_BufferChk() {
|
||||
{
|
||||
dComIfGd_peekZ(local_5c.x, local_5c.y, &field_0x754);
|
||||
}
|
||||
f32 near = dComIfGd_getView()->near;
|
||||
f32 far = dComIfGd_getView()->far;
|
||||
f32 near_ = dComIfGd_getView()->near_;
|
||||
f32 far_ = dComIfGd_getView()->far_;
|
||||
mDoLib_pos2camera(&cStack_68, &local_5c);
|
||||
local_5c.z += 50.0f;
|
||||
if (local_5c.z > 0.0f) {
|
||||
local_5c.z = 0.0f;
|
||||
}
|
||||
field_0x750 =
|
||||
((near + ((far * near) / local_5c.z)) / (far - near) + 1.0f) * 16777215.0f;
|
||||
((near_ + ((far_ * near_) / local_5c.z)) / (far_ - near_) + 1.0f) * 16777215.0f;
|
||||
}
|
||||
|
||||
int daObjTOMBO_c::Delete() {
|
||||
|
||||
+5
-5
@@ -10763,10 +10763,10 @@ static void view_setup(camera_process_class* i_this) {
|
||||
dComIfGd_setViewport(viewport);
|
||||
dComIfGd_setView(view);
|
||||
|
||||
f32 far;
|
||||
f32 far_;
|
||||
f32 var_f30;
|
||||
if (getComStat(8)) {
|
||||
far = view->far;
|
||||
far_ = view->far_;
|
||||
} else {
|
||||
#if DEBUG
|
||||
if (g_envHIO.mOther.mAdjustCullFar != 0) {
|
||||
@@ -10776,10 +10776,10 @@ static void view_setup(camera_process_class* i_this) {
|
||||
{
|
||||
var_f30 = dStage_stagInfo_GetCullPoint(dComIfGp_getStageStagInfo());
|
||||
}
|
||||
far = var_f30;
|
||||
far_ = var_f30;
|
||||
}
|
||||
|
||||
mDoLib_clipper::setup(view->fovy, view->aspect, view->near, far);
|
||||
mDoLib_clipper::setup(view->fovy, view->aspect, view->near_, far_);
|
||||
}
|
||||
|
||||
static void store(camera_process_class* i_camera) {
|
||||
@@ -10990,7 +10990,7 @@ static int camera_draw(camera_process_class* i_this) {
|
||||
|
||||
int trim_height = body->TrimHeight();
|
||||
window->setScissor(0.0f, trim_height, FB_WIDTH, FB_HEIGHT - trim_height * 2.0f);
|
||||
C_MTXPerspective(process->projMtx, process->fovy, process->aspect, process->near, process->far);
|
||||
C_MTXPerspective(process->projMtx, process->fovy, process->aspect, process->near_, process->far_);
|
||||
mDoMtx_lookAt(process->viewMtx, &process->lookat.eye, &process->lookat.center,
|
||||
&process->lookat.up, process->bank);
|
||||
|
||||
|
||||
+2
-2
@@ -450,7 +450,7 @@ f32 dDemo_camera_c::JSGGetProjectionNear() const {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
return view->near;
|
||||
return view->near_;
|
||||
}
|
||||
|
||||
void dDemo_camera_c::JSGSetProjectionNear(f32 i_projNear) {
|
||||
@@ -465,7 +465,7 @@ f32 dDemo_camera_c::JSGGetProjectionFar() const {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
return view->far;
|
||||
return view->far_;
|
||||
}
|
||||
|
||||
void dDemo_camera_c::JSGSetProjectionFar(f32 i_projFar) {
|
||||
|
||||
+2
-2
@@ -98,8 +98,8 @@ void dInsect_c::CalcZBuffer(f32 param_0) {
|
||||
field_0x578 = 0;
|
||||
}
|
||||
|
||||
f32 view_near = dComIfGd_getView()->near;
|
||||
f32 view_far = dComIfGd_getView()->far;
|
||||
f32 view_near = dComIfGd_getView()->near_;
|
||||
f32 view_far = dComIfGd_getView()->far_;
|
||||
|
||||
mDoLib_pos2camera(&pos, &pos_projected);
|
||||
pos_projected.z += param_0;
|
||||
|
||||
+14
-14
@@ -4398,8 +4398,8 @@ static void setLightTevColorType_MAJI_sub(J3DMaterial* material_p, dKy_tevstr_c*
|
||||
fog_info->mEndZ = tevstr_p->mFogEndZ;
|
||||
|
||||
if (dComIfGd_getView() != NULL) {
|
||||
fog_info->mNearZ = dComIfGd_getView()->near;
|
||||
fog_info->mFarZ = dComIfGd_getView()->far;
|
||||
fog_info->mNearZ = dComIfGd_getView()->near_;
|
||||
fog_info->mFarZ = dComIfGd_getView()->far_;
|
||||
}
|
||||
|
||||
if (fog_info->mType == 7) {
|
||||
@@ -9326,10 +9326,10 @@ static void GxFogSet_Sub(GXColor* fog_col_p) {
|
||||
color = *fog_col_p;
|
||||
|
||||
if (dComIfGd_getView() != NULL) {
|
||||
if (dComIfGd_getView()->near >= 0.0f && dComIfGd_getView()->far >= 0.0f) {
|
||||
if (dComIfGd_getView()->near < dComIfGd_getView()->far) {
|
||||
near_z = dComIfGd_getView()->near;
|
||||
far_z = dComIfGd_getView()->far;
|
||||
if (dComIfGd_getView()->near_ >= 0.0f && dComIfGd_getView()->far_ >= 0.0f) {
|
||||
if (dComIfGd_getView()->near_ < dComIfGd_getView()->far_) {
|
||||
near_z = dComIfGd_getView()->near_;
|
||||
far_z = dComIfGd_getView()->far_;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9361,10 +9361,10 @@ void dKy_GxFog_tevstr_set(dKy_tevstr_c* tevstr_p) {
|
||||
color.b = tevstr_p->FogCol.b;
|
||||
|
||||
if (dComIfGd_getView() != NULL) {
|
||||
if (dComIfGd_getView()->near >= 0.0f && dComIfGd_getView()->far >= 0.0f) {
|
||||
if (dComIfGd_getView()->near < dComIfGd_getView()->far) {
|
||||
near_z = dComIfGd_getView()->near;
|
||||
far_z = dComIfGd_getView()->far;
|
||||
if (dComIfGd_getView()->near_ >= 0.0f && dComIfGd_getView()->far_ >= 0.0f) {
|
||||
if (dComIfGd_getView()->near_ < dComIfGd_getView()->far_) {
|
||||
near_z = dComIfGd_getView()->near_;
|
||||
far_z = dComIfGd_getView()->far_;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9383,10 +9383,10 @@ void dKy_GfFog_tevstr_set(dKy_tevstr_c* tevstr_p) {
|
||||
color.b = tevstr_p->FogCol.b;
|
||||
|
||||
if (dComIfGd_getView() != NULL) {
|
||||
if (dComIfGd_getView()->near >= 0.0f && dComIfGd_getView()->far >= 0.0f) {
|
||||
if (dComIfGd_getView()->near < dComIfGd_getView()->far) {
|
||||
near_z = dComIfGd_getView()->near;
|
||||
far_z = dComIfGd_getView()->far;
|
||||
if (dComIfGd_getView()->near_ >= 0.0f && dComIfGd_getView()->far_ >= 0.0f) {
|
||||
if (dComIfGd_getView()->near_ < dComIfGd_getView()->far_) {
|
||||
near_z = dComIfGd_getView()->near_;
|
||||
far_z = dComIfGd_getView()->far_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -96,8 +96,8 @@ s32 dScnName_c::create() {
|
||||
dDlst_window_c* window = dComIfGp_getWindow(0);
|
||||
dComIfGp_setCamera(0, (camera_class*)&mCamera);
|
||||
|
||||
mCamera.near = 1.0f;
|
||||
mCamera.far = 100000.0f;
|
||||
mCamera.near_ = 1.0f;
|
||||
mCamera.far_ = 100000.0f;
|
||||
mCamera.fovy = 45.0f;
|
||||
mCamera.aspect = mDoGph_gInf_c::getWidthF() / mDoGph_gInf_c::getHeightF();
|
||||
mCamera.lookat.eye.set(0.0f, 0.0f, -1000.0f);
|
||||
@@ -139,8 +139,8 @@ static const char* dummyString(int i) {
|
||||
#endif
|
||||
|
||||
void dScnName_c::setView() {
|
||||
C_MTXPerspective(mCamera.projMtx, mCamera.fovy, mCamera.aspect, mCamera.near,
|
||||
mCamera.far);
|
||||
C_MTXPerspective(mCamera.projMtx, mCamera.fovy, mCamera.aspect, mCamera.near_,
|
||||
mCamera.far_);
|
||||
mDoMtx_lookAt(mCamera.viewMtx, &mCamera.lookat.eye, &mCamera.lookat.center,
|
||||
mCamera.bank);
|
||||
MTXInverse(mCamera.viewMtx, mCamera.invViewMtx);
|
||||
|
||||
+13
-8
@@ -11,7 +11,7 @@
|
||||
#include <memory>
|
||||
#include <dusk/dvd_emu.h>
|
||||
|
||||
/*
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
@@ -35,9 +35,10 @@ static u64 MachToDolphinNum;
|
||||
static u64 MachToDolphinDenom;
|
||||
#elif _WIN32
|
||||
static LARGE_INTEGER PerfFrequency;
|
||||
static bool PerfInitialized = false;
|
||||
#endif
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// ==========================================================================
|
||||
// General OS
|
||||
@@ -45,7 +46,7 @@ static LARGE_INTEGER PerfFrequency;
|
||||
|
||||
|
||||
// Credits: Super Monkey Ball
|
||||
/*
|
||||
|
||||
static u64 GetGCTicks() {
|
||||
#if __APPLE__
|
||||
return mach_absolute_time() * MachToDolphinNum / MachToDolphinDenom;
|
||||
@@ -55,15 +56,21 @@ static u64 GetGCTicks() {
|
||||
|
||||
return ((tp.tv_sec * 1000000000ull) + tp.tv_nsec) * OS_CORE_CLOCK / 1000000000ull;
|
||||
#elif _WIN32
|
||||
if (!PerfInitialized) {
|
||||
QueryPerformanceFrequency(&PerfFrequency);
|
||||
PerfInitialized = true;
|
||||
}
|
||||
LARGE_INTEGER perf;
|
||||
QueryPerformanceCounter(&perf);
|
||||
|
||||
perf.QuadPart *= OS_CORE_CLOCK;
|
||||
perf.QuadPart /= PerfFrequency.QuadPart;
|
||||
|
||||
return perf.QuadPart;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
} */
|
||||
}
|
||||
|
||||
u32 OSGetConsoleType() {
|
||||
return OS_CONSOLE_RETAIL1;
|
||||
@@ -281,13 +288,11 @@ void OSTicksToCalendarTime(OSTime ticks, OSCalendarTime* td) {
|
||||
}
|
||||
|
||||
OSTime OSGetTime(void) {
|
||||
//return (OSTime)GetGCTicks();
|
||||
return 0;
|
||||
return (OSTime)GetGCTicks();
|
||||
}
|
||||
|
||||
OSTick OSGetTick(void) {
|
||||
//return (OSTick)GetGCTicks();
|
||||
return 0;
|
||||
return (OSTick)GetGCTicks();
|
||||
}
|
||||
|
||||
u16 OSGetFontEncode() { return 0; }
|
||||
|
||||
@@ -61,7 +61,9 @@ void mDoDvdErr_ThdCleanup() {
|
||||
|
||||
static void mDoDvdErr_Watch(void*) {
|
||||
#if PLATFORM_GCN
|
||||
#ifndef TARGET_PC
|
||||
OSDisableInterrupts();
|
||||
#endif
|
||||
#endif
|
||||
JKRThread(OSGetCurrentThread(), 0);
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "d/d_meter2_info.h"
|
||||
#include "d/d_s_play.h"
|
||||
#include "DynamicLink.h"
|
||||
#include "dusk/endian.h"
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
#include <revolution/sc.h>
|
||||
@@ -239,12 +240,12 @@ static ResTIMG* createTimg(u16 width, u16 height, u32 format) {
|
||||
cLib_memSet(timg, 0, bufferSize);
|
||||
timg->format = format;
|
||||
timg->alphaEnabled = false;
|
||||
timg->width = width;
|
||||
timg->height = height;
|
||||
timg->width = RES_U16(width);
|
||||
timg->height = RES_U16(height);
|
||||
timg->minFilter = GX_LINEAR;
|
||||
timg->magFilter = GX_LINEAR;
|
||||
timg->mipmapCount = 1;
|
||||
timg->imageOffset = 0x20;
|
||||
timg->imageOffset = RES_U32(0x20);
|
||||
return timg;
|
||||
}
|
||||
|
||||
@@ -467,7 +468,7 @@ void mDoGph_gInf_c::calcFade() {
|
||||
}
|
||||
|
||||
if (mFadeColor.a != 0) {
|
||||
darwFilter(mFadeColor);
|
||||
//darwFilter(mFadeColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,12 +38,12 @@ f32 mDoLib_clipper::mSystemFar;
|
||||
|
||||
f32 mDoLib_clipper::mFovyRate;
|
||||
|
||||
void mDoLib_clipper::setup(f32 fovy, f32 aspect, f32 near, f32 far) {
|
||||
void mDoLib_clipper::setup(f32 fovy, f32 aspect, f32 near_, f32 far_) {
|
||||
mClipper.setFovy(fovy);
|
||||
mClipper.setAspect(aspect);
|
||||
mClipper.setNear(near);
|
||||
mClipper.setFar(far);
|
||||
mSystemFar = far;
|
||||
mClipper.setNear(near_);
|
||||
mClipper.setFar(far_);
|
||||
mSystemFar = far_;
|
||||
mClipper.calcViewFrustum();
|
||||
|
||||
s16 tmp = DEG2S(fovy);
|
||||
|
||||
+53
-55
@@ -39,8 +39,8 @@
|
||||
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include "dusk/dvd_emu.h"
|
||||
#include "SSystem/SComponent/c_API.h"
|
||||
#include "dusk/dvd_emu.h"
|
||||
|
||||
#include <aurora/aurora.h>
|
||||
#include <aurora/event.h>
|
||||
@@ -52,6 +52,7 @@ OSTime mDoMain::sPowerOnTime;
|
||||
OSTime mDoMain::sHungUpTime;
|
||||
u32 mDoMain::memMargin = 0xFFFFFFFF;
|
||||
char mDoMain::COPYDATE_STRING[18] = "??/??/?? ??:??:??";
|
||||
const int audioHeapSize = 0x14D800;
|
||||
|
||||
// --- PC LOGGING CALLBACK ---
|
||||
void aurora_log_callback(AuroraLogLevel level, const char* module, const char* message,
|
||||
@@ -123,23 +124,14 @@ s32 LOAD_COPYDATE(void*) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// MAIN01 - THE GAME LOOP
|
||||
// =========================================================================
|
||||
void main01(void) {
|
||||
OS_REPORT("\x1b[m");
|
||||
|
||||
// 1. Setup heaps, RNG, Threads
|
||||
// Nutzt den Speicher, den wir in game_main() per OSSetArena gesetzt haben
|
||||
// 1. Setup
|
||||
mDoMch_Create();
|
||||
|
||||
// 2. Setup GFX (FrameBuffer, ZBuffer)
|
||||
mDoGph_Create();
|
||||
|
||||
// 3. Setup Pads
|
||||
//mDoCPd_c::create();
|
||||
|
||||
// 4. Console Setup
|
||||
// Console Setup
|
||||
JUTConsole* console = JFWSystem::getSystemConsole();
|
||||
if (console) {
|
||||
console->setOutput(mDoMain::developmentMode ? JUTConsole::OUTPUT_OSR_AND_CONSOLE :
|
||||
@@ -147,7 +139,7 @@ void main01(void) {
|
||||
console->setPosition(32, 42);
|
||||
}
|
||||
|
||||
// 5. Init Framework & Loader
|
||||
// Loader Init
|
||||
mDoDvdThd_callback_c::create((mDoDvdThd_callback_func)LOAD_COPYDATE, NULL);
|
||||
|
||||
OSReport("Calling fapGm_Create()...\n");
|
||||
@@ -159,39 +151,45 @@ void main01(void) {
|
||||
OSReport("Calling cDyl_InitAsync()...\n");
|
||||
cDyl_InitAsync();
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// THE GAME LOOP
|
||||
// -----------------------------------------------------------
|
||||
mDoAud_zelAudio_c::onInitFlag();
|
||||
|
||||
OSReport("Entering Main Loop (main01)...\n");
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// THE GAME LOOP (RESTORED)
|
||||
// -----------------------------------------------------------
|
||||
do {
|
||||
// --- Window Events & Frame Start ---
|
||||
// 1. Update Window Events
|
||||
const AuroraEvent* event = aurora_update();
|
||||
if (event && event->type == AURORA_EXIT)
|
||||
break;
|
||||
|
||||
static u32 frame = 0;
|
||||
frame++;
|
||||
|
||||
// 2. Start Frame (REQUIRED for Vulkan)
|
||||
if (!aurora_begin_frame()) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
continue;
|
||||
}
|
||||
|
||||
static u32 frame;
|
||||
frame++;
|
||||
// 3. Game Inputs
|
||||
mDoCPd_c::read();
|
||||
|
||||
mDoCPd_c::read(); // Read Controller
|
||||
|
||||
// Simulate VI retrace interrupt — fires post-retrace callback which sends
|
||||
// a message to JUTVideo's queue, unblocking waitForTick() in beginRender()
|
||||
// Simulate VI (can remain empty/stubbed for now if waitForTick is disabled)
|
||||
VIWaitForRetrace();
|
||||
|
||||
// --- EXECUTE GAME LOGIC & RENDER ---
|
||||
printf("[DIAG] main01: before fapGm_Execute (frame %d)\n", frame); fflush(stdout);
|
||||
// 4. EXECUTE GAME LOGIC & RENDER
|
||||
// This calls mDoGph_Painter -> JFWDisplay -> GX Functions
|
||||
fapGm_Execute();
|
||||
printf("[DIAG] main01: after fapGm_Execute\n"); fflush(stdout);
|
||||
|
||||
// --- Frame End & Limiter ---
|
||||
mDoAud_Execute();
|
||||
|
||||
// 5. Present Frame (REQUIRED to see anything)
|
||||
aurora_end_frame();
|
||||
printf("[DIAG] main01: after aurora_end_frame\n"); fflush(stdout);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(16)); // ~60 FPS Cap
|
||||
|
||||
// Limiter
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(16));
|
||||
|
||||
} while (true);
|
||||
}
|
||||
@@ -241,7 +239,7 @@ int game_main(int argc, char* argv[]) {
|
||||
|
||||
// Development Mode
|
||||
mDoMain::developmentMode = 1; // Force Dev Mode for Debugging
|
||||
|
||||
mDoDvdThd::SyncWidthSound = false;
|
||||
// START GAME
|
||||
OSReport("Starting main01 (Game Loop)...\n");
|
||||
|
||||
@@ -263,77 +261,77 @@ bool JKRHeap::dump_sort() {
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
template <typename T>
|
||||
JHIComPortManager<T>* JHIComPortManager<T>::instance = nullptr;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
JHIComPortManager<JHICmnMem>* JHIComPortManager<JHICmnMem>::instance = nullptr;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2WolfHowlMgr* JASGlobalInstance<Z2WolfHowlMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2EnvSeMgr* JASGlobalInstance<Z2EnvSeMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2FxLineMgr* JASGlobalInstance<Z2FxLineMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2Audience* JASGlobalInstance<Z2Audience>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2SoundObjMgr* JASGlobalInstance<Z2SoundObjMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2SoundInfo* JASGlobalInstance<Z2SoundInfo>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
JAUSoundInfo* JASGlobalInstance<JAUSoundInfo>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
JAUSoundNameTable* JASGlobalInstance<JAUSoundNameTable>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
JAUSoundTable* JASGlobalInstance<JAUSoundTable>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
JAISoundInfo* JASGlobalInstance<JAISoundInfo>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2SoundMgr* JASGlobalInstance<Z2SoundMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
JAIStreamMgr* JASGlobalInstance<JAIStreamMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
JAISeqMgr* JASGlobalInstance<JAISeqMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
JAISeMgr* JASGlobalInstance<JAISeMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2SpeechMgr2* JASGlobalInstance<Z2SpeechMgr2>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2SoundStarter* JASGlobalInstance<Z2SoundStarter>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
JAISoundStarter* JASGlobalInstance<JAISoundStarter>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2StatusMgr* JASGlobalInstance<Z2StatusMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2SceneMgr* JASGlobalInstance<Z2SceneMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2SeqMgr* JASGlobalInstance<Z2SeqMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
Z2SeMgr* JASGlobalInstance<Z2SeMgr>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
JASAudioThread* JASGlobalInstance<JASAudioThread>::sInstance;
|
||||
|
||||
template<>
|
||||
template <>
|
||||
JASDefaultBankTable* JASGlobalInstance<JASDefaultBankTable>::sInstance;
|
||||
|
||||
Reference in New Issue
Block a user