misc cleanup

This commit is contained in:
LagoLunatic
2023-11-12 01:19:58 -05:00
parent 90c6b4df9f
commit 1778dea96c
8 changed files with 35 additions and 32 deletions
@@ -67,6 +67,8 @@ public:
J3DFog* getFog() { return mPEBlock->getFog(); }
J3DZMode* getZMode() { return mPEBlock->getZMode(); }
J3DBlend* getBlend() { return mPEBlock->getBlend(); }
J3DAlphaComp* getAlphaComp() { return mPEBlock->getAlphaComp(); }
u8 getZCompLoc() { return mPEBlock->getZCompLoc(); }
J3DTexMtx* getTexMtx(u32 idx) { return mTexGenBlock->getTexMtx(idx); }
u16 getIndex() { return mIndex; }
bool isDrawModeOpaTexEdge() { return (mMaterialMode & 3) == 0; }
+1 -1
View File
@@ -233,7 +233,7 @@ struct J3DColorChanInfo {
};
struct J3DZModeInfo {
/* 0x0 */ u8 mCompareEnable __attribute__((aligned(4)));
/* 0x0 */ u8 mCompareEnable;
/* 0x1 */ u8 mFunc;
/* 0x2 */ u8 mUpdateEnable;
};
+1 -1
View File
@@ -860,7 +860,7 @@ public:
BOOL checkStatusFlag(int i_roomNo, u8 flag) const { return cLib_checkBit(mStatus[i_roomNo].mFlags, flag); }
void offStatusFlag(int i_roomNo, u8 flag) { cLib_offBit(mStatus[i_roomNo].mFlags, flag); }
void onStatusFlag(int i_roomNo, u8 flag) { return cLib_onBit(mStatus[i_roomNo].mFlags, flag); }
void onStatusFlag(int i_roomNo, u8 flag) { cLib_onBit(mStatus[i_roomNo].mFlags, flag); }
static JKRExpHeap* mMemoryBlock[16];
static dStage_roomStatus_c mStatus[64];
+5 -5
View File
@@ -262,18 +262,18 @@ void makeAlphaCmpTable() {
}
}
u8 j3dZModeTable[96];
J3DZModeInfo j3dZModeTable[0x20];
/* 802EC69C-802EC708 .text makeZModeTable__Fv */
void makeZModeTable() {
u8* table = j3dZModeTable;
J3DZModeInfo* table = j3dZModeTable;
for (int i = 0; i < 2; i++) {
for (u32 j = 0; j < 8; j++) {
for (int k = 0; k < 2; k++) {
u32 idx = j * 2 + i * 16 + k;
table[idx * 3 + 0] = i;
table[idx * 3 + 1] = j;
table[idx * 3 + 2] = k;
table[idx].mCompareEnable = i;
table[idx].mFunc = j;
table[idx].mUpdateEnable = k;
}
}
}
+1 -1
View File
@@ -42,7 +42,7 @@ public:
/* 0x3D4 */ u32 field_0x3d4;
};
static const char daHot_Floor_c::M_arcname[8] = "Ylesr00";
const char daHot_Floor_c::M_arcname[8] = "Ylesr00";
/* 00000078-00000108 .text set_mtx_init__13daHot_Floor_cFv */
void daHot_Floor_c::set_mtx_init() {
+17 -17
View File
@@ -178,7 +178,7 @@ namespace daObjMknjD {
Mtx daObjMknjD::Act_c::M_tmp_mtx;
/* 00000078-0000012C .text nodeCallBackL__FP7J3DNodei */
static u32 nodeCallBackL(J3DNode* i_node, int i_param2) {
static BOOL nodeCallBackL(J3DNode* i_node, int i_param2) {
if (i_param2 == 0) {
int jntNo = static_cast<J3DJoint*>(i_node)->getJntNo();
@@ -195,11 +195,11 @@ static u32 nodeCallBackL(J3DNode* i_node, int i_param2) {
}
}
return 1;
return TRUE;
}
/* 0000012C-000001E0 .text nodeCallBackR__FP7J3DNodei */
static u32 nodeCallBackR(J3DNode* i_node, int i_param2) {
static BOOL nodeCallBackR(J3DNode* i_node, int i_param2) {
if (i_param2 == 0) {
int jntNo = static_cast<J3DJoint*>(i_node)->getJntNo();
@@ -216,11 +216,11 @@ static u32 nodeCallBackR(J3DNode* i_node, int i_param2) {
}
}
return 1;
return TRUE;
}
/* 000001E0-000002B0 .text nodeCallBack_Hahen__FP7J3DNodei */
static s32 nodeCallBack_Hahen(J3DNode* i_node, int i_param2) {
static BOOL nodeCallBack_Hahen(J3DNode* i_node, int i_param2) {
if (i_param2 == 0) {
int jntNo = static_cast<J3DJoint*>(i_node)->getJntNo();
u16 shardIdx = joint_number_table[jntNo - 1];
@@ -238,7 +238,7 @@ static s32 nodeCallBack_Hahen(J3DNode* i_node, int i_param2) {
}
}
return 1;
return TRUE;
}
/* 000002B0-000002D0 .text daObjMknjD_XyCheckCB__FPvi */
@@ -287,10 +287,10 @@ int daObjMknjD::Act_c::CreateHeap() {
const char* jntName = nameTable->getName(i);
if (strcmp("MknjL", jntName) == 0) {
mMainMdl->getModelData()->getJointNodePointer(i)->setCallBack((J3DNodeCallBack)nodeCallBackL);
mMainMdl->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBackL);
}
else if (strcmp("MknjR", jntName) == 0) {
mMainMdl->getModelData()->getJointNodePointer(i)->setCallBack((J3DNodeCallBack)nodeCallBackR);
mMainMdl->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBackR);
}
}
@@ -304,7 +304,7 @@ int daObjMknjD::Act_c::CreateHeap() {
for (u16 j = 0; j < 20; j++) {
if (strcmp(daObjMknjD_jointName[j], jntName) == 0) {
mBreakMdl->getModelData()->getJointNodePointer(i)->setCallBack((J3DNodeCallBack)nodeCallBack_Hahen);
mBreakMdl->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack_Hahen);
joint_number_table[curTblIdx++] = j;
break;
@@ -1029,20 +1029,20 @@ void daObjMknjD::setMaterial(J3DMaterial* i_mat, u8 i_alpha) {
if (i_alpha == 0xFF) {
i_mat->setMaterialMode(1);
i_mat->getPEBlock()->getZMode()->setUpdateEnable(1);
i_mat->getPEBlock()->getZMode()->setCompareEnable(1);
i_mat->getZMode()->setUpdateEnable(1);
i_mat->getZMode()->setCompareEnable(1);
i_mat->getPEBlock()->getBlend()->setType(0);
i_mat->getBlend()->setType(0);
}
else {
i_mat->setMaterialMode(1);
i_mat->getPEBlock()->getZMode()->setUpdateEnable(0);
i_mat->getPEBlock()->getZMode()->setCompareEnable(0);
i_mat->getZMode()->setUpdateEnable(0);
i_mat->getZMode()->setCompareEnable(0);
i_mat->getPEBlock()->getBlend()->setType(1);
i_mat->getPEBlock()->getBlend()->setSrcFactor(4);
i_mat->getPEBlock()->getBlend()->setDstFactor(5);
i_mat->getBlend()->setType(1);
i_mat->getBlend()->setSrcFactor(4);
i_mat->getBlend()->setDstFactor(5);
}
i_mat->getTevKColor(3)->mColor.a = i_alpha;
+5 -5
View File
@@ -174,7 +174,7 @@ BOOL daVrbox2_color_set(vrbox2_class* i_this) {
modelData = i_this->mpBackCloud->getModelData();
mat = modelData->getMaterialNodePointer(0);
mat->setCullMode(GX_CULL_NONE);
mat->getPEBlock()->getZMode()->setZModeInfo(l_zmodeInfo);
mat->getZMode()->setZModeInfo(l_zmodeInfo);
mat->change();
mtx = mat->getTexMtx(0);
@@ -192,7 +192,7 @@ BOOL daVrbox2_color_set(vrbox2_class* i_this) {
mat = modelData->getMaterialNodePointer(1);
mat->setCullMode(GX_CULL_NONE);
mat->getPEBlock()->getZMode()->setZModeInfo(l_zmodeInfo);
mat->getZMode()->setZModeInfo(l_zmodeInfo);
mat->change();
mtx = mat->getTexMtx(0);
@@ -205,7 +205,7 @@ BOOL daVrbox2_color_set(vrbox2_class* i_this) {
mat = modelData->getMaterialNodePointer(2);
mat->setCullMode(GX_CULL_NONE);
mat->getPEBlock()->getZMode()->setZModeInfo(l_zmodeInfo);
mat->getZMode()->setZModeInfo(l_zmodeInfo);
mat->change();
mtx = mat->getTexMtx(0);
@@ -219,7 +219,7 @@ BOOL daVrbox2_color_set(vrbox2_class* i_this) {
if (i_this->mpKasumiMae != NULL) {
mat = i_this->mpKasumiMae->getModelData()->getMaterialNodePointer(0);
mat->getPEBlock()->getZMode()->setZModeInfo(l_zmodeInfo);
mat->getZMode()->setZModeInfo(l_zmodeInfo);
mat->change();
c0.r = g_env_light.mVrKasumiMaeColor.r;
@@ -235,7 +235,7 @@ BOOL daVrbox2_color_set(vrbox2_class* i_this) {
if (i_this->mpUsoUmi != NULL) {
mat = i_this->mpUsoUmi->getModelData()->getMaterialNodePointer(0);
mat->getPEBlock()->getZMode()->setZModeInfo(l_zmodeInfo);
mat->getZMode()->setZModeInfo(l_zmodeInfo);
mat->change();
k0.r = g_env_light.mVrUsoUmiColor.r;
+3 -2
View File
@@ -1399,10 +1399,11 @@ u8 dShop_BoughtErrorStatus(ShopItems_c* shopItems, int param_2, int param_3) {
/* 800606A8-80060830 .text __ct__12ShopCursor_cFP12J3DModelDataP15J3DAnmTevRegKeyf */
ShopCursor_c::ShopCursor_c(J3DModelData* modelData, J3DAnmTevRegKey* brkData, f32 param_2) {
static J3DZModeInfo ZModeInfo = {GX_TRUE, GX_ALWAYS, GX_TRUE};
// TODO: this should be a J3DZModeInfo, but that's 3 bytes when inside arrays, while this is supposed to be 4 bytes, with 1-byte alignment.
static u8 ZModeInfo[4] = {GX_TRUE, GX_ALWAYS, GX_TRUE};
for (u16 i = 0; i < modelData->getMaterialNum(); i++) {
J3DMaterial* mat = modelData->getMaterialNodePointer(i);
mat->getPEBlock()->getZMode()->setZModeInfo(ZModeInfo);
mat->getZMode()->setZModeInfo(*(J3DZModeInfo*)&ZModeInfo);
}
for (int i = 0; i < (int)ARRAY_SIZE(mpModels); i++) {