Misc cleanup

This commit is contained in:
LagoLunatic
2025-12-27 17:03:26 -05:00
parent 47ce38557b
commit 48dcebd9e8
10 changed files with 34 additions and 35 deletions
@@ -625,8 +625,6 @@ struct J3DBlend : public J3DBlendInfo {
// void operator==(J3DBlend&) {}
};
extern const J3DFogInfo j3dDefaultFogInfo;
struct J3DFog : public J3DFogInfo {
// J3DFog() { *getFogInfo() = j3dDefaultFogInfo; } // Produces the wrong codegen for mDoExt_backupMatBlock_c's constructor
J3DFog() { J3DFogInfo::operator=(j3dDefaultFogInfo); }
@@ -641,17 +639,6 @@ struct J3DFog : public J3DFogInfo {
void setType(u8 type) { mType = type; }
};
struct J3DAlphaCompInfo {
/* 0x0 */ u8 mComp0;
/* 0x1 */ u8 mRef0;
/* 0x2 */ u8 mOp;
/* 0x3 */ u8 mComp1;
/* 0x4 */ u8 mRef1;
/* 0x5 */ u8 field_0x5;
/* 0x6 */ u8 field_0x6;
/* 0x7 */ u8 field_0x7;
};
inline u16 calcAlphaCmpID(u8 comp0, u8 op, u8 comp1) {
return (comp0 << 5) + (op << 3) + (comp1);
}
+11
View File
@@ -240,4 +240,15 @@ struct J3DZModeInfo {
/* 0x03 */ u8 pad;
};
struct J3DAlphaCompInfo {
/* 0x0 */ u8 mComp0;
/* 0x1 */ u8 mRef0;
/* 0x2 */ u8 mOp;
/* 0x3 */ u8 mComp1;
/* 0x4 */ u8 mRef1;
/* 0x5 */ u8 field_0x5;
/* 0x6 */ u8 field_0x6;
/* 0x7 */ u8 field_0x7;
};
#endif /* J3DSTRUCT_H */
+5 -2
View File
@@ -369,9 +369,12 @@ template<> struct TBox<TVec2<f32> > {
};
template <typename T>
struct TBox2 : TBox<TVec2<T> > {
struct TBox2 : public TBox<TVec2<T> > {
TBox2() {}
TBox2(const TVec2<f32>& i, const TVec2<f32> f) { set(i, f); }
TBox2(const TVec2<f32>& _i, const TVec2<f32>& _f) {
TBox<TVec2<T> >::i.set(_i);
TBox<TVec2<T> >::f.set(_f);
}
TBox2(f32 x0, f32 y0, f32 x1, f32 y1) { set(x0, y0, x1, y1); }
void absolute() {
-3
View File
@@ -10,11 +10,8 @@
class JKRHeap;
class JPABaseEmitter;
class JPABaseParticle;
class JPAEmitterCallBack;
class JPAEmitterManager;
class JPAParticleCallBack;
class JPAResourceManager;
struct JPAEmitterWorkData;
template<typename T>
class JPACallBackBase;
+1 -2
View File
@@ -7,8 +7,7 @@ class csXyz : public SVec {
public:
static const csXyz Zero;
~csXyz() {}
/* inline */ csXyz() {}
/* inline */ csXyz(const csXyz& other) : SVec(other){};
csXyz() {}
csXyz(s16, s16, s16);
csXyz operator+(csXyz&);
void operator+=(csXyz&);
+1 -1
View File
@@ -111,7 +111,7 @@ static BOOL daObj_PbcoExecute(void* i_this) {
bool daObj_Pbco_c::_draw() {
dKy_tevstr_c* pTevStr;
g_env_light.settingTevStruct(TEV_TYPE_BG0, &current.pos, pTevStr = &tevStr);
g_env_light.settingTevStruct(TEV_TYPE_BG0, &current.pos, pTevStr = &tevStr); // fakematch
g_env_light.setLightTevColorType(mpModel, pTevStr);
mDoExt_modelUpdateDL(mpModel);
return TRUE;
+1 -1
View File
@@ -77,7 +77,7 @@ static BOOL daObjPbka_Delete(void* i_this) {
bool daObjPbka_c::_draw() {
dKy_tevstr_c * pTevStr;
g_env_light.settingTevStruct(TEV_TYPE_BG0, &current.pos, pTevStr = &tevStr);
g_env_light.settingTevStruct(TEV_TYPE_BG0, &current.pos, pTevStr = &tevStr); // fakematch
g_env_light.setLightTevColorType(mpModel, pTevStr);
dComIfGd_setListBG();
mDoExt_modelUpdateDL(mpModel);
+1 -1
View File
@@ -1180,7 +1180,7 @@ u8 dSv_event_c::getEventReg(u16 i_reg) {
/* 8005CB94-8005CBB0 .text init__13dSv_reserve_cFv */
void dSv_reserve_c::init() {
for (int i = 0; i < sizeof(dSv_reserve_c); i++) {
for (int i = 0; i < ARRAY_SIZE(mReserve); i++) {
mReserve[i] = 0;
}
}
+2 -2
View File
@@ -276,9 +276,9 @@ s32 fopAcM_createHeap(fopAc_ac_c* i_this, u32 size, u32 align) {
align = 0x20;
i_this->heap = mDoExt_createSolidHeapFromGameToCurrent(size, align);
if (i_this->heap == 0) {
if (i_this->heap == NULL) {
OSReport_Error("fopAcM_createHeap 確保失敗\n");
JUT_CONFIRM(0x34c, i_this->heap != 0);
JUT_CONFIRM(0x34c, i_this->heap != NULL);
return FALSE;
}
+12 -10
View File
@@ -15,6 +15,14 @@
#include <string.h>
#include <stdio.h>
#if VERSION <= VERSION_JPN
#define HEADER_TITLE "ゼルダの伝説~風のタクト~"
#define HEADER_COMMENT "%d月%d日のセーブデータです"
#else
#define HEADER_TITLE "Zelda: The Wind Waker"
#define HEADER_COMMENT "%d/%d Save Data"
#endif
static u8 sTmpBuf[0x2000] ALIGN_DECL(32);
static u8 sTmpBuf2[0x2000] ALIGN_DECL(32);
static u32 sSaveCount;
@@ -197,19 +205,11 @@ s32 mDoMemCdRWm_Restore2(CARDFileInfo* card) {
/* 80019F4C-8001A0A8 .text mDoMemCdRWm_BuildHeader__FP22mDoMemCdRWm_HeaderData */
void mDoMemCdRWm_BuildHeader(mDoMemCdRWm_HeaderData* header) {
#if VERSION <= VERSION_JPN
snprintf(header->comment, sizeof(header->comment), "ゼルダの伝説~風のタクト~");
#else
snprintf(header->comment, sizeof(header->comment), "Zelda: The Wind Waker");
#endif
snprintf(header->comment, sizeof(header->comment), HEADER_TITLE);
OSTime time = OSGetTime();
OSCalendarTime cal;
OSTicksToCalendarTime(time, &cal);
#if VERSION <= VERSION_JPN
snprintf(header->info, sizeof(header->info), "%d月%d日のセーブデータです", cal.month + 1, cal.day_of_month);
#elif VERSION == VERSION_USA
snprintf(header->info, sizeof(header->info), "%d/%d Save Data", cal.month + 1, cal.day_of_month);
#else
#if VERSION == VERSION_PAL
switch (dComIfGs_getPalLanguage()) {
case 0:
snprintf(header->info, sizeof(header->info), "%d/%d Save Data", cal.month + 1, cal.day_of_month);
@@ -227,6 +227,8 @@ void mDoMemCdRWm_BuildHeader(mDoMemCdRWm_HeaderData* header) {
snprintf(header->info, sizeof(header->info), "Dati salvati: %d/%d", cal.day_of_month, cal.month + 1);
break;
}
#else
snprintf(header->info, sizeof(header->info), HEADER_COMMENT, cal.month + 1, cal.day_of_month);
#endif
mDoDvdThd_mountArchive_c* cmd = mDoDvdThd_mountArchive_c::create("/res/CardIcon/cardicon.arc", 0, NULL);
while (!cmd->sync()) ;