This commit is contained in:
CreateSource 2024-06-05 14:07:55 -04:00
commit c115892b30
40 changed files with 17043 additions and 1195 deletions

View file

@ -2,6 +2,7 @@
#include "game/audio.h"
#include "game/frand.h"
#include "game/hsfman.h"
#include "game/hsfdraw.h"
#include "game/hsfmotion.h"
#include "game/memory.h"
#include "game/object.h"

View file

@ -1309,10 +1309,7 @@ void fn_1_5E74(AnimData *arg0, u16 arg1, u16 arg2, u16 arg3)
break;
}
var_r28 = (arg0->bmp->sizeX / var_r30) * ((arg2 / var_r29) << 5);
var_r31 = ((u8 *)arg0->bmp->data) + (var_r28 + ((arg0->bmp->pixSize * ((arg2 % var_r29) * 8)) / 8));
var_r31 += (arg1 % 8 * arg0->bmp->pixSize) / 8;
var_r31 += (arg1 / var_r30) << 5;
var_r31 = (void *)(((arg1/var_r30)*32)+(((arg1%8)*arg0->bmp->pixSize)/8)+(((arg0->bmp->sizeX / var_r30) * ((arg2 / var_r29) << 5))+((u32)arg0->bmp->data)+((arg0->bmp->pixSize * ((arg2 % var_r29) * 8)) / 8)));
switch (arg0->bmp->pixSize) {
case 4:
@ -1333,7 +1330,7 @@ void fn_1_5E74(AnimData *arg0, u16 arg1, u16 arg2, u16 arg3)
}
}
u16 fn_1_607C(AnimData *anim, u16 arg1, u16 arg2)
u16 fn_1_607C(AnimData *arg0, u16 arg1, u16 arg2)
{
u16 var_r31;
u16 var_r30;
@ -1343,8 +1340,8 @@ u16 fn_1_607C(AnimData *anim, u16 arg1, u16 arg2)
u32 temp_r6;
u8 temp_r0;
u8 temp_r0_3;
switch (anim->bmp->pixSize) {
switch (arg0->bmp->pixSize) {
case 4:
var_r31 = lbl_1_data_9F4[0];
var_r30 = lbl_1_data_9F4[1];
@ -1358,10 +1355,16 @@ u16 fn_1_607C(AnimData *anim, u16 arg1, u16 arg2)
var_r30 = lbl_1_data_9F4[5];
break;
}
var_r29 = ((u8 *)anim->bmp->data) + ((arg1 / var_r31) << 5) + (arg1 % 8 * anim->bmp->pixSize) / 8
+ (((anim->bmp->sizeX / var_r31) * ((arg2 / var_r30) << 5)) + ((anim->bmp->pixSize * ((arg2 % var_r30) * 8)) / 8));
switch (anim->bmp->pixSize) {
var_r29 = (void *)(((arg1/var_r31)*32)+(((arg1%8)*arg0->bmp->pixSize)/8)+(((arg0->bmp->sizeX / var_r31) * ((arg2 / var_r30) << 5))+((u32)arg0->bmp->data)+((arg0->bmp->pixSize * ((arg2 % var_r30) * 8)) / 8)));
(void)var_r31;
(void)var_r31;
(void)var_r31;
(void)var_r30;
(void)var_r30;
(void)var_r30;
switch (arg0->bmp->pixSize) {
case 4:
if ((arg1 & 1) == 0) {
var_r28 = *var_r29 >> 4;

828
src/REL/m408Dll/camera.c Normal file
View file

@ -0,0 +1,828 @@
#include "game/object.h"
#include "game/objsub.h"
#include "game/wipe.h"
#include "game/chrman.h"
#include "game/minigame_seq.h"
#include "game/pad.h"
#include "game/hsfman.h"
#include "game/hsfmotion.h"
#include "game/hsfanim.h"
#include "game/hsfdraw.h"
#include "game/sprite.h"
#include "game/audio.h"
#include "game/gamework_data.h"
#include "REL/m408Dll.h"
#include "math.h"
#include "ext_math.h"
omObjData *lbl_1_bss_110;
u32 lbl_1_bss_10C;
Vec lbl_1_bss_100;
Vec lbl_1_bss_F4;
HsfanimStruct01 *lbl_1_bss_A4[20];
u32 lbl_1_bss_A0;
HsfanimStruct01 *lbl_1_bss_94[3];
s32 lbl_1_bss_88[3];
s32 lbl_1_bss_84;
s32 lbl_1_bss_80;
void fn_1_8A20(omObjData *object);
void fn_1_9770(omObjData *object);
void fn_1_8958(Process *objman)
{
omObjData *object;
lbl_1_bss_10C = 0;
object = omAddObjEx(objman, 20, 9, 0, -1, fn_1_8A20);
object->work[0] = 0;
lbl_1_bss_110 = omAddObjEx(objman, 21, 2, 0, -1, fn_1_9770);
lbl_1_bss_110->work[0] = 0;
lbl_1_bss_84 = lbl_1_bss_80 = -1;
}
void fn_1_8FAC(omObjData *object);
void fn_1_A894(ModelData *model, ParticleData *particle, Mtx matrix);
void fn_1_B700(s16 arg0, u32 arg1);
void fn_1_BB94(void);
void fn_1_BDE0(void);
void fn_1_8A20(omObjData *object)
{
s16 temp_r31;
s32 temp_r29;
for(temp_r29=0; temp_r29<20; temp_r29++) {
lbl_1_bss_A4[temp_r29] = NULL;
}
lbl_1_bss_A0 = 0;
for(temp_r29=0; temp_r29<3; temp_r29++) {
lbl_1_bss_94[temp_r29] = NULL;
lbl_1_bss_88[temp_r29] = 0;
}
object->model[0] = Hu3DModelCreateFile(0x270000);
omSetSca(object, 0.1f, 0.1f, 0.1f);
object->model[1] = Hu3DModelCreateFile(0x270001);
Hu3DModelScaleSet(object->model[1], 0.1f, 0.1f, 0.1f);
Hu3DModelPosSet(object->model[1], 0, 11990, 0);
Hu3DModelShadowMapSet(object->model[1]);
temp_r31 = Hu3DParticleCreate(HuSprAnimReadFile(0x27000B), 1);
object->model[2] = temp_r31;
Hu3DModelLayerSet(temp_r31, 6);
Hu3DParticleColSet(temp_r31, 255, 255, 255);
Hu3DParticleHookSet(temp_r31, fn_1_A894);
Hu3DModelPosSet(temp_r31, 0, 0, 0);
Hu3DData[temp_r31].unk_120->unk_00 = 0;
Hu3DData[temp_r31].unk_120->unk_02 = 0;
temp_r31 = Hu3DParticleCreate(HuSprAnimReadFile(0x27000D), 1);
object->model[3] = temp_r31;
Hu3DParticleBlendModeSet(temp_r31, 1);
Hu3DModelLayerSet(temp_r31, 6);
Hu3DParticleColSet(temp_r31, 255, 255, 255);
Hu3DParticleHookSet(temp_r31, fn_1_A894);
Hu3DModelPosSet(temp_r31, 0, 0, 0);
Hu3DData[temp_r31].unk_120->unk_00 = 0;
Hu3DData[temp_r31].unk_120->unk_02 = 1;
temp_r31 = Hu3DParticleCreate(HuSprAnimReadFile(0x270011), 1);
object->model[5] = temp_r31;
Hu3DModelLayerSet(temp_r31, 7);
Hu3DParticleColSet(temp_r31, 255, 255, 255);
Hu3DParticleHookSet(temp_r31, fn_1_A894);
Hu3DModelPosSet(temp_r31, 0, 0, 0);
Hu3DData[temp_r31].unk_120->unk_00 = 0;
Hu3DData[temp_r31].unk_120->unk_02 = 2;
temp_r31 = Hu3DParticleCreate(HuSprAnimReadFile(0x270010), 8);
object->model[6] = temp_r31;
Hu3DParticleBlendModeSet(temp_r31, 1);
Hu3DModelLayerSet(temp_r31, 6);
Hu3DModelPosSet(temp_r31, 0, 0, 0);
fn_1_B700(temp_r31, 0);
temp_r31 = Hu3DParticleCreate(HuSprAnimReadFile(0x27000F), 6);
object->model[6] = temp_r31;
Hu3DParticleBlendModeSet(temp_r31, 1);
Hu3DModelLayerSet(temp_r31, 6);
Hu3DModelPosSet(temp_r31, 0, 0, 0);
fn_1_B700(temp_r31, 1);
temp_r31 = Hu3DParticleCreate(HuSprAnimReadFile(0x27000D), 5);
object->model[6] = temp_r31;
Hu3DParticleBlendModeSet(temp_r31, 1);
Hu3DModelLayerSet(temp_r31, 6);
Hu3DModelPosSet(temp_r31, 0, 0, 0);
fn_1_B700(temp_r31, 2);
fn_1_BB94();
lbl_1_bss_10C = 1;
object->func = fn_1_8FAC;
object->work[1] = 0;
}
void fn_1_9514(omObjData *object);
void fn_1_8FAC(omObjData *object)
{
object->work[1]++;
switch(lbl_1_bss_10C) {
case 1:
if(lbl_1_bss_110->work[0] == 4) {
lbl_1_bss_10C = 2;
fn_1_817C(&lbl_1_bss_100, &lbl_1_bss_F4);
object->work[1] = 0;
}
break;
case 2:
fn_1_817C(&lbl_1_bss_100, &lbl_1_bss_F4);
if(lbl_1_bss_80 < 0) {
lbl_1_bss_80 = HuAudFXPlay(1361);
}
lbl_1_bss_10C = 3;
object->work[1] = 0;
break;
case 3:
lbl_1_bss_F4.y += -6.666667f;
lbl_1_bss_F4.z += -0.5833334f;
lbl_1_bss_100.y += 20.0f/60.0f;
fn_1_817C(&lbl_1_bss_100, &lbl_1_bss_F4);
if(lbl_1_bss_F4.y > 12010) {
break;
}
if(lbl_1_bss_84 < 0) {
lbl_1_bss_84 = HuAudFXPlay(1357);
}
if(lbl_1_bss_80 >= 0) {
HuAudFXStop(lbl_1_bss_80);
lbl_1_bss_80 = -1;
}
lbl_1_bss_10C = 4;
object->work[1] = 0;
object->work[2] = 0;
break;
case 4:
if(object->work[1] < 24.0f) {
lbl_1_bss_100.y += 4.0f/12.0f;
fn_1_817C(&lbl_1_bss_100, &lbl_1_bss_F4);
} else {
if(object->work[2] == 0) {
if(!lbl_1_bss_40) {
WipeCreate(WIPE_MODE_OUT, WIPE_TYPE_NORMAL, -1);
lbl_1_bss_44 = 1;
}
object->work[2]++;
}
CZoom -= 2.5000002f;
if(object->work[1] < 90.0f) {
break;
}
lbl_1_bss_10C = 5;
object->work[1] = 0;
}
break;
default:
lbl_1_bss_10C = 5;
break;
}
omSetTra(object, Center.x+(sind(CRot.y)*cosd(CRot.x)*CZoom), Center.y+(-sind(CRot.x)*CZoom), Center.z+(cosd(CRot.y)*cosd(CRot.x)*CZoom));
fn_1_BDE0();
if(lbl_1_bss_10C == 5) {
Hu3DModelAttrSet(object->model[0], 1);
Hu3DModelAttrSet(object->model[1], 1);
lbl_1_bss_10C = 5;
object->func = fn_1_9514;
}
}
void fn_1_9514(omObjData *object)
{
if(!WipeStatGet() && object->work[2] != 0) {
if(!lbl_1_bss_40) {
WipeCreate(WIPE_MODE_IN, WIPE_TYPE_NORMAL, -1);
lbl_1_bss_44 = 0;
}
object->work[2] = 0;
}
if(fn_1_6878() >= 4) {
Hu3DModelAttrReset(object->model[0], 1);
}
omSetTra(object, Center.x+(sind(CRot.y)*cosd(CRot.x)*CZoom), Center.y+(-sind(CRot.x)*CZoom)-1000, Center.z+(cosd(CRot.y)*cosd(CRot.x)*CZoom));
}
typedef struct work_99C8 {
Vec unk0;
Vec unkC;
Vec unk18;
Vec unk24;
Vec unk30;
Vec unk3C;
s32 unk48[2];
} Work99C8;
void fn_1_99C8(omObjData *object);
void fn_1_A37C(ModelData *model, ParticleData *particle, Mtx matrix);
void fn_1_9770(omObjData *object)
{
Work99C8 *temp_r31;
s32 temp_r29;
object->data = HuMemDirectMallocNum(HEAP_SYSTEM, sizeof(Work99C8), MEMORY_DEFAULT_NUM);
temp_r31 = object->data;
object->model[0] = Hu3DModelCreateFile(0x27000A);
Hu3DModelAttrSet(object->model[0], 0x40000001);
Hu3DMotionSpeedSet(object->model[0], 3.0f);
Hu3DModelShadowSet(object->model[0]);
object->func = fn_1_99C8;
object->work[0] = 0;
object->work[1] = 0;
temp_r31->unk3C.x = temp_r31->unk3C.y = temp_r31->unk3C.z = 0;
temp_r31->unk0.x = temp_r31->unk0.y = temp_r31->unk0.z = 0;
temp_r31->unk0.z = 1000;
omSetTra(object, 0, 12080, -2*temp_r31->unk0.z);
omSetSca(object, 0.5f, 0.5f, 0.5f);
temp_r29 = Hu3DParticleCreate(HuSprAnimReadFile(0x270024), 1024);
object->model[1] = temp_r29;
Hu3DModelLayerSet(temp_r29, 6);
Hu3DParticleColSet(temp_r29, 255, 255, 255);
Hu3DParticleHookSet(temp_r29, fn_1_A37C);
Hu3DModelPosSet(temp_r29, 0, 0, 0);
Hu3DData[temp_r29].unk_120->unk_00 = 0;
temp_r31->unk30.y = -35;
temp_r31->unk30.z = 350;
temp_r31->unk18.y = 800+object->trans.y;
temp_r31->unk48[0] = temp_r31->unk48[1] = -1;
HuDataDirClose(0x27000A);
}
void fn_1_A334(omObjData *object);
void fn_1_A4E8(s32 arg0, Vec *arg1, u32 arg2);
void fn_1_99C8(omObjData *object)
{
float temp_f31;
float temp_f30;
Vec sp2C;
Vec sp20;
Vec sp14;
Vec sp8;
Work99C8 *temp_r31;
temp_r31 = object->data;
object->trans.x += temp_r31->unk0.x*(1.0f/60.0f);
object->trans.y += temp_r31->unk0.y*(1.0f/60.0f);
object->trans.z += temp_r31->unk0.z*(1.0f/60.0f);
object->work[1]++;
switch(object->work[0]) {
case 0:
if(object->work[1] < 120.0f) {
temp_f30 = (1.0f/60.0f)*(1.5f*(120.0f-object->work[1]));
if(temp_f30 > 1.0f) {
temp_f30 = 1.0f;
}
temp_f31 = temp_r31->unk18.z;
temp_r31->unk30.z -= (175.0f/60.0f)*temp_f30;
temp_r31->unk30.y += 1.1666667f*temp_f30;
temp_r31->unk18.x = object->trans.x+(temp_r31->unk30.z*sind(temp_r31->unk30.y));
temp_r31->unk18.z = object->trans.z+(temp_r31->unk30.z*cosd(temp_r31->unk30.y));
temp_r31->unk18.y -= 8.333334f*temp_f30;
temp_r31->unk24.x = 0;
temp_r31->unk24.y = 0;
temp_r31->unk24.z = 0.96f*temp_r31->unk0.z;
} else {
temp_r31->unk18.z += temp_r31->unk24.z*(1.0f/60.0f);
}
temp_r31->unkC.x = object->trans.x;
temp_r31->unkC.y = object->trans.y;
temp_r31->unkC.z = object->trans.z;
sp2C.x = object->trans.x;
sp2C.y = object->trans.y;
sp2C.z = object->trans.z;
if(temp_r31->unk48[0] < 0) {
temp_r31->unk48[0] = HuAudFXEmiterPlay(1362, &sp2C);
}
if(temp_r31->unk48[1] < 0) {
temp_r31->unk48[1] = HuAudFXEmiterPlay(1356, &sp2C);
}
if(object->work[1] < 180.0f) {
break;
}
object->work[0] = 1;
object->work[1] = 0;
break;
case 1:
temp_r31->unk24.z *= 0.6f;
temp_r31->unk18.z += (temp_r31->unk24.z*(1.0f/60.0f));
temp_r31->unk18.x += (temp_r31->unk24.z*(1.0f/60.0f));
temp_r31->unkC.x = object->trans.x;
temp_r31->unkC.y = object->trans.y;
temp_r31->unkC.z = object->trans.z;
if(object->work[1] < 60.0f) {
break;
}
object->work[0] = 2;
object->work[1] = 0;
break;
case 2:
temp_r31->unk3C.x += 1.5000001f;
temp_r31->unk0.z = 1000.0*cosd(temp_r31->unk3C.x);
temp_r31->unk0.y = 1000.0*sind(temp_r31->unk3C.x);
temp_r31->unkC.x = object->trans.x;
temp_r31->unkC.y = object->trans.y;
temp_r31->unkC.z = object->trans.z;
if(object->work[1] < 120.0f) {
break;
}
object->work[0] = 3;
object->work[1] = 0;
temp_r31->unk3C.x = 180;
break;
case 3:
temp_r31->unk3C.z += 3.0000002f;
temp_f31 = (1.0f/60.0f)*object->work[1];
temp_f31 = 1.0f-(temp_f31*temp_f31);
temp_r31->unkC.x += temp_f31*(object->trans.x-temp_r31->unkC.x);
temp_r31->unkC.y += temp_f31*(object->trans.y-temp_r31->unkC.y);
temp_r31->unkC.z += temp_f31*(object->trans.z-temp_r31->unkC.z);
if(object->work[1] < 60.0f) {
break;
}
lbl_1_bss_F4.x = temp_r31->unkC.x;
lbl_1_bss_F4.y = temp_r31->unkC.y;
lbl_1_bss_F4.z = temp_r31->unkC.z;
lbl_1_bss_100.x = temp_r31->unk18.x;
lbl_1_bss_100.y = temp_r31->unk18.y;
lbl_1_bss_100.z = temp_r31->unk18.z;
object->work[0] = 4;
object->work[1] = 0;
break;
case 4:
temp_r31->unk3C.z += 3.0000002f;
if(object->work[1] > 42.0f) {
if(temp_r31->unk48[0] >= 0) {
HuAudFXStop(temp_r31->unk48[0]);
temp_r31->unk48[0] = -1;
}
if(temp_r31->unk48[1] >= 0) {
HuAudFXStop(temp_r31->unk48[1]);
temp_r31->unk48[1] = -1;
}
}
if(object->work[1] < 240.0f) {
break;
}
object->work[0] = 5;
object->work[1] = 0;
break;
default:
object->work[0] = 5;
object->func = fn_1_A334;
break;
}
omSetRot(object, -temp_r31->unk3C.x, temp_r31->unk3C.y, temp_r31->unk3C.z);
if(object->trans.y < 12150.0f) {
sp20.x = object->trans.x;
sp20.y = object->trans.y;
sp20.z = object->trans.z+10;
fn_1_A4E8(object->model[1], &sp20, 4);
sp20.x = sp8.x = object->trans.x;
sp20.z = object->trans.z;
sp8.z = object->trans.z-10;
sp20.y = object->trans.y+250.0f;
sp8.y = object->trans.y;
sp14.x = 0;
sp14.y = 0;
sp14.z = 1;
Hu3DShadowPosSet(&sp20, &sp14, &sp8);
}
if(temp_r31->unk48[0] >= 0) {
sp2C.x = object->trans.x-30;
sp2C.y = object->trans.y;
sp2C.z = object->trans.z+25;
HuAudFXEmiterUpDate(temp_r31->unk48[0], &sp2C);
}
if(temp_r31->unk48[1] < 0) {
sp2C.x = object->trans.x+30;
sp2C.y = object->trans.y;
sp2C.z = object->trans.z+25;
HuAudFXEmiterUpDate(temp_r31->unk48[1], &sp2C);
}
if(object->work[0] < 4) {
fn_1_84C4(temp_r31->unk18.x, temp_r31->unk18.y, temp_r31->unk18.z, temp_r31->unkC.x, temp_r31->unkC.y, temp_r31->unkC.z);
}
if(fn_1_C43C() == 5) {
object->func = fn_1_A334;
}
}
void fn_1_A334(omObjData *object)
{
Hu3DModelAttrSet(object->model[1], 1);
Hu3DModelAttrSet(object->model[0], 1);
}
void fn_1_A37C(ModelData *model, ParticleData *particle, Mtx matrix)
{
HsfanimStruct01 *temp_r31;
s32 temp_r29;
if(particle->unk_00 == 0) {
particle->unk_00++;
temp_r31 = particle->unk_48;
for(temp_r29=0; temp_r29<particle->unk_30; temp_r29++, temp_r31++) {
temp_r31->unk00 = 0;
temp_r31->unk2C = 0;
temp_r31->unk40.a = 0;
}
} else {
temp_r31 = particle->unk_48;
for(temp_r29=0; temp_r29<particle->unk_30; temp_r29++, temp_r31++) {
if(temp_r31->unk00_s16) {
temp_r31->unk34.x += temp_r31->unk08.x;
temp_r31->unk34.y += temp_r31->unk08.y;
temp_r31->unk34.z += temp_r31->unk08.z;
temp_r31->unk2C += temp_r31->unk14.x;
temp_r31->unk14.y -= temp_r31->unk14.z;
temp_r31->unk40.a = temp_r31->unk14.y;
if(--temp_r31->unk00_s16 == 0) {
temp_r31->unk00_s16 = 0;
temp_r31->unk2C = 0;
temp_r31->unk40.a =0;
}
}
}
DCStoreRange(particle->unk_48, particle->unk_30*sizeof(HsfanimStruct01));
}
}
void fn_1_A4E8(s32 arg0, Vec *arg1, u32 arg2)
{
float temp_f31;
HsfanimStruct01 *temp_r31;
ParticleData *temp_r30;
s32 temp_r29;
temp_r30 = Hu3DData[arg0].unk_120;
if(temp_r30->unk_00) {
temp_r31 = temp_r30->unk_48;
for(temp_r29=0; temp_r29<temp_r30->unk_30; temp_r29++, temp_r31++) {
if(temp_r31->unk00_s16 != 0) {
continue;
}
temp_r31->unk00_s16 = 60.0f*(((1.5f/1000.0f)*frandmod(1000))+1.0f);
temp_r31->unk34.x = arg1->x;
temp_r31->unk34.y = 12000;
temp_r31->unk34.z = arg1->z;
temp_r31->unk08.x = (1.0f/60.0f)*((0.6f*frandmod(1000))-300.0f);
temp_r31->unk08.y = (1.0f/60.0f)*((0.04f*frandmod(1000))+10.0f);
temp_r31->unk08.z = 0;
temp_r31->unk14.x = 0.3f+((3.0f/1000.0f)*frandmod(1000));
temp_r31->unk2C = 10;
temp_r31->unk40.a = frandmod(127)+64;
temp_r31->unk14.y = temp_r31->unk40.a;
temp_r31->unk14.z = temp_r31->unk14.y*(1.0f/temp_r31->unk00_s16);
temp_f31 = frandmod(1000)*(1.0f/1000.0f);
temp_r31->unk40.r = (temp_f31*55)+200;
temp_r31->unk40.g = (temp_f31*50)+205;
temp_r31->unk40.b = (temp_f31*5)+250;
if(--arg2 == 0) {
break;
}
}
}
}
void fn_1_A894(ModelData *model, ParticleData *particle, Mtx matrix)
{
float temp_f31;
float temp_f30;
HsfanimStruct01 *temp_r31;
s32 temp_r29;
float sp14[][6] = {
{
600, 1, 0.95, 0.8, 1, 0
},
{
600, 1, 0.6, 0.9, 0.3, 0
},
{
13, 1, 1, 1, 0.5, 0
},
};
Vec sp8;
if(particle->unk_00 == 0) {
particle->unk_00++;
temp_r31 = particle->unk_48;
for(temp_r29=0; temp_r29<particle->unk_30; temp_r29++, temp_r31++) {
temp_r31->unk00 = 1;
temp_r31->unk2C = sp14[particle->unk_02][0];
temp_r31->unk40.r = 255*sp14[particle->unk_02][1];
temp_r31->unk40.g = 255*sp14[particle->unk_02][2];
temp_r31->unk40.b = 255*sp14[particle->unk_02][3];
temp_r31->unk40.a = 255*sp14[particle->unk_02][4];
temp_f31 = -70;
temp_f30 = -10;
temp_r31->unk08.x = sind(temp_f30)*cosd(temp_f31);
temp_r31->unk08.y = -sind(temp_f31);
temp_r31->unk08.z = cosd(temp_f30)*cosd(temp_f31);
}
} else {
particle->unk_00++;
if(particle->unk_00 < 339.0f) {
return;
}
if(particle->unk_00 >= 600.0f) {
particle->unk_00 = 601;
temp_r31 = particle->unk_48;
for(temp_r29=0; temp_r29<particle->unk_30; temp_r29++, temp_r31++) {
temp_r31->unk00 = 0;
temp_r31->unk2C = 0;
temp_r31->unk40.a = 0;
}
} else {
temp_r31 = particle->unk_48;
for(temp_r29=0; temp_r29<particle->unk_30; temp_r29++, temp_r31++) {
if(temp_r31->unk00_s16 == 0) {
continue;
}
sp8.x = sind(CRot.y)*cosd(CRot.x);
sp8.y = -sind(CRot.x);
sp8.z = cosd(CRot.y)*cosd(CRot.x);
if(particle->unk_02 < 2) {
temp_f31 = 4500;
temp_r31->unk34.x = (Center.x+(temp_r31->unk08.x*temp_f31))+(sp8.x*CZoom);
temp_r31->unk34.y = (Center.y+(temp_r31->unk08.y*temp_f31))+(sp8.y*CZoom);
temp_r31->unk34.z = (Center.z+(temp_r31->unk08.z*temp_f31))+(sp8.z*CZoom);
if(particle->unk_02 != 0) {
temp_f31 = -((sp8.x*temp_r31->unk08.x)+(sp8.y*temp_r31->unk08.y)+(sp8.z*temp_r31->unk08.z));
if(temp_f31 > 0.77f) {
temp_f30 = (1.0f/0.23f)*(temp_f31-0.77f);
temp_r31->unk2C = 1400*temp_f30;
temp_r31->unk40.a = (32.0f*temp_f30)+16.0f;
} else {
temp_r31->unk2C = 0;
}
}
} else {
temp_f31 = CZoom-10;
temp_r31->unk34.x = (sp8.x*temp_f31)+Center.x;
temp_r31->unk34.y = (sp8.y*temp_f31)+Center.y;
temp_r31->unk34.z = (sp8.z*temp_f31)+Center.z;
temp_f31 = -((sp8.x*temp_r31->unk08.x)+(sp8.y*temp_r31->unk08.y)+(sp8.z*temp_r31->unk08.z));
if(temp_f31 > 0.9f) {
temp_f30 = 10.0f*(temp_f31-0.9f);
temp_r31->unk40.a = temp_f30*210.0f;
} else {
temp_r31->unk40.a = 0;
}
}
}
DCStoreRange(particle->unk_48, particle->unk_30*sizeof(HsfanimStruct01));
}
}
}
void fn_1_AFF4(ModelData *model, ParticleData *particle, Mtx matrix)
{
float temp_f31;
float temp_f30;
HsfanimStruct01 *temp_r30;
s32 temp_r29;
Vec sp20;
Vec sp14;
Vec sp8;
if(particle->unk_00 == 0) {
particle->unk_00++;
temp_f31 = -70;
temp_f30 = -10;
particle->unk_04.x = sind(temp_f30)*cosd(temp_f31);
particle->unk_04.y = -sind(temp_f31);
particle->unk_04.z = cosd(temp_f30)*cosd(temp_f31);
temp_f31 = 0;
temp_r30 = particle->unk_48;
for(temp_r29=0; temp_r29<particle->unk_30; temp_r29++, temp_r30++) {
temp_r30->unk00 = 1;
temp_f31 += 1.0f/particle->unk_30;
temp_r30->unk2C = 40.0f+((1.0f-temp_f31)*(100.0f+frandmod(1000)));
temp_r30->unk40.r = frandmod(127)+128;
temp_r30->unk40.g = frandmod(127)+128;
temp_r30->unk40.b = frandmod(127)+128;
temp_r30->unk40.a = frandmod(16)+16;
}
} else {
particle->unk_00++;
if(particle->unk_00 < 339.0f) {
return;
}
if(particle->unk_00 >= 600.0f) {
particle->unk_00 = 601;
temp_r30 = particle->unk_48;
for(temp_r29=0; temp_r29<particle->unk_30; temp_r29++, temp_r30++) {
temp_r30->unk00 = 0;
temp_r30->unk2C = 0;
temp_r30->unk40.a = 0;
}
} else {
sp20.x = sind(CRot.y)*cosd(CRot.x);
sp20.y = -sind(CRot.x);
sp20.z = cosd(CRot.y)*cosd(CRot.x);
temp_f31 = -((-particle->unk_04.x*-sp20.x)+(-particle->unk_04.y*-sp20.y)+(-particle->unk_04.z*-sp20.z));
sp14.x = -sp20.x+(-2.0f*particle->unk_04.x*temp_f31);
sp14.y = -sp20.y+(-2.0f*particle->unk_04.y*temp_f31);
sp14.z = -sp20.z+(-2.0f*particle->unk_04.z*temp_f31);
temp_f31 = 4500;
sp8.x = (Center.x+(particle->unk_04.x*temp_f31))+(sp20.x*CZoom);
sp8.y = (Center.y+(particle->unk_04.y*temp_f31))+(sp20.y*CZoom);
sp8.z = (Center.z+(particle->unk_04.z*temp_f31))+(sp20.z*CZoom);
temp_r30 = particle->unk_48;
temp_f30 = 0;
for(temp_r29=0; temp_r29<particle->unk_30; temp_r29++, temp_r30++) {
if(temp_r30->unk00_s16 == 0) {
continue;
}
temp_f30 += 1.0f/particle->unk_30;
temp_f31 = 10.0f*(430.0f*(1.0f-((1.0f-temp_f30)*(1.0f-temp_f30))));
temp_r30->unk34.x = sp8.x+(sp14.x*temp_f31);
temp_r30->unk34.y = sp8.y+(sp14.y*temp_f31);
temp_r30->unk34.z = sp8.z+(sp14.z*temp_f31);
}
DCStoreRange(particle->unk_48, particle->unk_30*sizeof(HsfanimStruct01));
}
}
}
void fn_1_B700(s16 arg0, u32 arg1)
{
float temp_f31;
float temp_f30;
HsfanimStruct01 *temp_r31;
ParticleData *temp_r30;
s32 temp_r29;
s32 temp_r27;
float sp1C[] = {
0.4f, 0.21f, 0.16f, 1.0f
};
float spC[] = {
0.15f, 0.6f, 1.3f, 1.0f
};
s16 sp2C[] = {
1, 0,
2, 0,
0, 1,
2, 0,
0, 1,
2, 1,
0, 0,
1, 2,
0, 1,
2, -1
};
arg1 &= 0x3;
temp_r30 = Hu3DData[arg0].unk_120;
temp_r30->unk_00 = 1;
temp_f31 = -70;
temp_f30 = -10;
temp_r30->unk_04.x = sind(temp_f30)*cosd(temp_f31);
temp_r30->unk_04.y = -sind(temp_f31);
temp_r30->unk_04.z = cosd(temp_f30)*cosd(temp_f31);
temp_r31 = temp_r30->unk_48;
for(temp_r27=0; temp_r27<temp_r30->unk_30; temp_r27++, temp_r31++) {
temp_r31->unk00 = 1;
temp_r31->unk02 = arg1;
for(temp_r29=0; sp2C[temp_r29] >= 0; temp_r29++) {
if(arg1 != sp2C[temp_r29]) {
continue;
}
if(lbl_1_bss_A4[temp_r29] == NULL) {
break;
}
}
if(sp2C[temp_r29] < 0) {
temp_r31->unk2C = 0;
temp_r31->unk40.a = 0;
continue;
}
lbl_1_bss_A4[temp_r29] = temp_r31;
lbl_1_bss_A0++;
temp_r31->unk2C = 800.0f*(spC[arg1]*(1.0f+((0.7f/1000.0f)*frandmod(1000))));
temp_r31->unk40.r = frandmod(160)+32;
temp_r31->unk40.g = frandmod(160)+32;
temp_r31->unk40.b = frandmod(160)+32;
temp_r31->unk40.a = (255.0f*sp1C[arg1])-frandmod(16);
}
lbl_1_bss_94[arg1] = temp_r30->unk_48;
lbl_1_bss_88[arg1] = temp_r30->unk_30;
}
void fn_1_BB94(void)
{
float temp_f31;
float temp_f30;
HsfanimStruct01 *temp_r31;
s32 temp_r30;
float sp18[] = {
0.02f, 0.08f, 0.07f, 0.5f
};
float sp8[] = {
0.0009f, 0.00020000001f, 0.00001f, 0.0005f
};
temp_f31 = 0.1f;
for(temp_r30=0; temp_r30<lbl_1_bss_A0; temp_r30++) {
temp_r31 = lbl_1_bss_A4[temp_r30];
temp_f30 = 0.5f*(sp18[temp_r31->unk02]*(1.0f+(frandmod(1000)*sp8[temp_r31->unk02])));
temp_f31 += temp_f30;
temp_r31->unk14.x = temp_f31;
temp_f31 += temp_f30;
}
temp_f31 = 1.0f/temp_f31;
for(temp_r30=0; temp_r30<lbl_1_bss_A0; temp_r30++) {
temp_r31 = lbl_1_bss_A4[temp_r30];
temp_r31->unk14.x *= temp_f31;
temp_r31->unk2C *= (0.8f-(0.4f*temp_r31->unk14.x));
temp_r31->unk14.x = 10.0f*(400.0f*temp_r31->unk14.x);
}
for(temp_r30=0; temp_r30<3; temp_r30++) {
DCStoreRangeNoSync(lbl_1_bss_94[temp_r30], lbl_1_bss_88[temp_r30]*sizeof(HsfanimStruct01));
}
PPCSync();
}
void fn_1_BDE0(void)
{
float temp_f31;
float temp_f30;
HsfanimStruct01 *temp_r31;
s32 temp_r30;
Vec sp2C;
Vec sp20;
Vec sp14;
Vec sp8;
temp_r31 = lbl_1_bss_A4[0];
temp_r31->unk00_s16++;
if(temp_r31->unk00_s16 < 339.0f) {
return;
}
if(temp_r31->unk00_s16 >= 600.0f) {
temp_r31->unk00_s16 = 601;
for(temp_r30=0; temp_r30<lbl_1_bss_A0; temp_r30++) {
temp_r31 = lbl_1_bss_A4[temp_r30];
temp_r31->unk00_s16 = 0;
temp_r31->unk2C = 0;
temp_r31->unk40.a = 0;
}
return;
}
sp2C.x = sind(CRot.y)*cosd(CRot.x);
sp2C.y = -sind(CRot.x);
sp2C.z = cosd(CRot.y)*cosd(CRot.x);
temp_f31 = -70;
temp_f30 = -10;
sp20.x = sind(temp_f30)*cosd(temp_f31);
sp20.y = -sind(temp_f31);
sp20.z = cosd(temp_f30)*cosd(temp_f31);
temp_f31 = 4500;
sp8.x = (Center.x+(sp20.x*temp_f31))+(sp2C.x*CZoom);
sp8.y = (Center.y+(sp20.y*temp_f31))+(sp2C.y*CZoom);
sp8.z = (Center.z+(sp20.z*temp_f31))+(sp2C.z*CZoom);
temp_f31 = -((-sp20.x*-sp2C.x)+(-sp20.y*-sp2C.y)+(-sp20.z*-sp2C.z));
sp14.x = -sp2C.x+(-2.0f*sp20.x*temp_f31);
sp14.y = -sp2C.y+(-2.0f*sp20.y*temp_f31);
sp14.z = -sp2C.z+(-2.0f*sp20.z*temp_f31);
if(temp_f31 > 0.5f) {
temp_f30 = 3.0f-(2.0f*temp_f31);
} else {
temp_f30 = 1.0f;
}
for(temp_r30=0; temp_r30<lbl_1_bss_A0; temp_r30++) {
temp_r31 = lbl_1_bss_A4[temp_r30];
temp_r31->unk34.x = sp8.x+(temp_f30*(sp14.x*temp_r31->unk14.x));
temp_r31->unk34.y = sp8.y+(temp_f30*(sp14.y*temp_r31->unk14.x));
temp_r31->unk34.z = sp8.z+(temp_f30*(sp14.z*temp_r31->unk14.x));
}
for(temp_r30=0; temp_r30<3; temp_r30++) {
DCStoreRangeNoSync(lbl_1_bss_94[temp_r30], lbl_1_bss_88[temp_r30]*sizeof(HsfanimStruct01));
}
PPCSync();
}
void fn_1_C3C0(Vec *arg0, Vec *arg1)
{
arg0->x = lbl_1_bss_110->trans.x;
arg0->y = lbl_1_bss_110->trans.y;
arg0->z = lbl_1_bss_110->trans.z;
arg1->x = lbl_1_bss_110->rot.x;
arg1->y = lbl_1_bss_110->rot.y;
arg1->z = lbl_1_bss_110->rot.z;
}
u32 fn_1_C43C(void)
{
return lbl_1_bss_10C;
}

1683
src/REL/m408Dll/main.c Normal file

File diff suppressed because it is too large Load diff

1536
src/REL/m408Dll/object.c Normal file

File diff suppressed because it is too large Load diff

1327
src/REL/m408Dll/stage.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -1090,10 +1090,10 @@ void fn_1_7494(void)
void fn_1_7520(Vec *arg0)
{
ParticleData *var_r30; // no, custom struct
ParticleData *var_r30;
HsfanimStruct01 *var_r31;
var_r30 = Hu3DData[lbl_1_bss_38].unk_120; // unk_120 is not ParticleData
var_r30 = Hu3DData[lbl_1_bss_38].unk_120;
var_r31 = &var_r30->unk_48[var_r30->unk_02++];
var_r31->unk2C = 100.0f;
var_r31->unk34.x = arg0->x;

2366
src/REL/m414Dll/main.c Normal file

File diff suppressed because it is too large Load diff

1843
src/REL/m416Dll/main.c Normal file

File diff suppressed because it is too large Load diff

331
src/REL/m416Dll/map.c Normal file
View file

@ -0,0 +1,331 @@
#include "game/object.h"
#include "game/objsub.h"
#include "game/hsfman.h"
#include "game/hsfanim.h"
#include "game/hsfmotion.h"
#include "game/audio.h"
#include "game/wipe.h"
#include "game/sprite.h"
#include "game/chrman.h"
#include "game/pad.h"
#include "game/gamework_data.h"
#include "game/minigame_seq.h"
#include "game/frand.h"
#include "math.h"
#include "ext_math.h"
#include "REL/m416Dll.h"
GXColor lbl_1_data_268 = { 0, 0, 0, 255 };
Vec lbl_1_data_26C[8] = {
{ 70, 0, 70 },
{ 70, 0, -70 },
{ -70, 0, -70 },
{ -70, 0, 70 },
{ 70, 0, 70 },
{ 70, 0, -70 },
{ -70, 0, -70 },
{ -70, 0, 70 },
};
Vec lbl_1_data_2CC[2] = {
{ 370, 615, -245 },
{ -370, 615, -245 }
};
float lbl_1_data_2E4[2] = {
0, 1
};
omObjData *lbl_1_bss_118C;
omObjData *lbl_1_bss_1188;
u32 lbl_1_bss_1184;
void *lbl_1_bss_1180;
float lbl_1_bss_117C;
s16 lbl_1_bss_1174[4];
float lbl_1_bss_116C[2];
s16 lbl_1_bss_1168;
s16 lbl_1_bss_968[256][4];
void fn_1_7A74(omObjData *object);
void fn_1_7D74(omObjData *object);
void fn_1_7F30(omObjData *object);
void fn_1_83B4(omObjData *object);
void fn_1_89BC(ModelData *model, Mtx mtx);
void fn_1_8EA0(void);
void fn_1_8FF0(void);
void fn_1_79D0(Process *objman)
{
lbl_1_bss_118C = omAddObjEx(objman, 20, 2, 0, -1, fn_1_7A74);
lbl_1_bss_1188 = omAddObjEx(objman, 20, 10, 0, -1, fn_1_7F30);
fn_1_8EA0();
}
void fn_1_7A54(void)
{
fn_1_8FF0();
}
void fn_1_7A74(omObjData *object)
{
s16 i;
object->model[0] = Hu3DModelCreateFile(0x2F0000);
Hu3DModelShadowMapSet(object->model[0]);
Hu3DModelLayerSet(object->model[0], 0);
object->trans.x = 0;
object->trans.y = 0;
object->trans.z = 0;
fn_1_8EB4(object->model[0]);
for(i=0; i<2; i++) {
lbl_1_bss_1174[i+2] = Hu3DLLightCreate(object->model[0], 0, 0, 0, 0, 0, 0, 0, 0, 0);
Hu3DLLightStaticSet(object->model[0], lbl_1_bss_1174[i+2], 1);
Hu3DLLightPointSet(object->model[0], lbl_1_bss_1174[i+2], 45, 0.8, 3);
Hu3DLLightColorSet(object->model[0], lbl_1_bss_1174[i+2], 255, 160, 0, 255);
Hu3DLLightPosSet(object->model[0], lbl_1_bss_1174[i+2], lbl_1_data_2CC[i].x, 475, lbl_1_data_2CC[i].z, 0, 1, 0);
}
object->model[1] = Hu3DHookFuncCreate(fn_1_89BC);
Hu3DModelLayerSet(object->model[1], 1);
lbl_1_bss_1184 = GXGetTexBufferSize(640, 480, GX_TF_RGBA8, GX_FALSE, 0);
lbl_1_bss_1180 = HuMemDirectMallocNum(HEAP_DATA, lbl_1_bss_1184, MEMORY_DEFAULT_NUM);
memset(lbl_1_bss_1180, 0, lbl_1_bss_1184);
object->func = fn_1_7D74;
}
void fn_1_7D74(omObjData *object)
{
s32 i;
for(i=0; i<2; i++) {
Hu3DLLightPointSet(object->model[0], lbl_1_bss_1174[i+2], (15*sind(object->work[i]))+45, 0.8, 3);
object->work[i] += 8.0f;
if(object->work[i] > 360.0f) {
object->work[i] -= 360.0f;
}
}
}
void fn_1_7F30(omObjData *object)
{
Mtx sp68;
Mtx sp38;
Mtx sp8;
s32 temp_r30;
Vec *temp_r29;
s32 temp_r28;
s32 temp_r27;
s16 temp_r26;
s16 temp_r25;
s16 temp_r24;
AnimData *temp_r23;
object->stat |= 0x100;
for(temp_r30=0; temp_r30<2; temp_r30++) {
if(temp_r30 == 0) {
temp_r25 = Hu3DModelCreateFile(0x2F0001);
temp_r26 = temp_r25;
} else {
temp_r24 = Hu3DModelLink(temp_r25);
temp_r26 = temp_r24;
}
object->model[temp_r30] = temp_r26;
Hu3DModelLayerSet(temp_r26, 2);
fn_1_8EB4(object->model[temp_r30]);
Hu3DModelPosSet(object->model[temp_r30], lbl_1_data_2CC[temp_r30].x, lbl_1_data_2CC[temp_r30].y, lbl_1_data_2CC[temp_r30].z);
}
temp_r23 = HuSprAnimReadFile(0x2F0006);
temp_r29 = &lbl_1_data_26C[0];
for(temp_r30=0; temp_r30<2; temp_r30++) {
for(temp_r27=0; temp_r27<4; temp_r27++, temp_r29++) {
temp_r28 = (temp_r30*4)+2;
temp_r28 = temp_r27+temp_r28;
object->model[temp_r28] = Hu3DParticleCreate(temp_r23, 50);
Hu3DParticleHookSet(object->model[temp_r28], fn_1_613C);
Hu3DParticleBlendModeSet(object->model[temp_r28], 1);
Hu3DModelLayerSet(object->model[temp_r28], 6);
Hu3DModelScaleSet(object->model[temp_r28], 0.5f, 0.7f, 0.5f);
MTXTrans(sp68, lbl_1_data_2CC[temp_r30].x, lbl_1_data_2CC[temp_r30].y, lbl_1_data_2CC[temp_r30].z);
MTXTrans(sp38, 0, -150, 0);
MTXConcat(sp68, sp38, sp68);
MTXTrans(sp8, temp_r29->x, temp_r29->y, temp_r29->z);
MTXConcat(sp68, sp8, sp68);
Hu3DModelPosSet(object->model[temp_r28], sp68[0][3], sp68[1][3], sp68[2][3]);
}
}
for(temp_r30=0; temp_r30<2; temp_r30++) {
lbl_1_bss_1174[temp_r30] = Hu3DLLightCreate(object->model[temp_r30], 0, 0, 0, 0, 0, 0, 0, 0, 0);
Hu3DLLightStaticSet(object->model[temp_r30], lbl_1_bss_1174[temp_r30], 1);
Hu3DLLightPointSet(object->model[temp_r30], lbl_1_bss_1174[temp_r30], 1000, 0.8, 3);
Hu3DLLightColorSet(object->model[temp_r30], lbl_1_bss_1174[temp_r30], 255, 160, 0, 255);
Hu3DLLightPosSet(object->model[temp_r30], lbl_1_bss_1174[temp_r30], lbl_1_data_2CC[temp_r30].x, 475, lbl_1_data_2CC[temp_r30].z, 0, 1, 0);
}
object->work[0] = 0;
object->work[1] = 45;
lbl_1_bss_117C = 0;
object->func = fn_1_83B4;
}
void fn_1_83B4(omObjData *object)
{
float temp_f31;
s32 temp_r31;
Vec *temp_r29;
s32 temp_r28;
s32 temp_r27;
ModelData *temp_r26;
Mtx sp130[2];
Mtx sp100;
Mtx spD0;
Mtx spA0;
Mtx sp70;
Mtx sp40;
Mtx sp10;
float sp8[2];
MTXIdentity(sp100);
MTXIdentity(sp130[0]);
MTXIdentity(sp130[1]);
MTXIdentity(spD0);
MTXIdentity(spA0);
MTXIdentity(sp70);
MTXIdentity(sp40);
MTXIdentity(sp10);
lbl_1_bss_117C = fmod(1+lbl_1_bss_117C, 360);
sp8[0] = 20*sind(lbl_1_bss_117C);
sp8[1] = 20*cosd(lbl_1_bss_117C);
if(fn_1_1240() == 6) {
for(temp_r31=0; temp_r31<2; temp_r31++) {
temp_f31 = sp8[temp_r31]-lbl_1_bss_116C[temp_r31];
if(temp_f31*lbl_1_data_2E4[temp_r31] <= 0.0f) {
temp_r26 = &Hu3DData[object->model[temp_r31]];
HuAudFXEmiterPlay(1467, &temp_r26->pos);
}
lbl_1_data_2E4[temp_r31] = temp_f31;
}
}
lbl_1_bss_116C[0] = sp8[0];
lbl_1_bss_116C[1] = sp8[1];
temp_r29 = &lbl_1_data_26C[0];
for(temp_r31=0; temp_r31<2; temp_r31++) {
MTXRotDeg(sp130[temp_r31], 'y', lbl_1_bss_116C[temp_r31]);
for(temp_r28=0; temp_r28<4; temp_r28++, temp_r29++) {
temp_r27 = (temp_r31*4)+2;
temp_r27 = temp_r28+temp_r27;
MTXTrans(spA0, lbl_1_data_2CC[temp_r31].x, lbl_1_data_2CC[temp_r31].y, lbl_1_data_2CC[temp_r31].z);
MTXTrans(sp70, 0, -150, 0);
MTXConcat(spA0, sp70, spA0);
MTXTrans(sp40, temp_r29->x, temp_r29->y, temp_r29->z);
MTXConcat(sp130[temp_r31], sp40, sp10);
MTXConcat(spA0, sp10, spA0);
Hu3DModelPosSet(object->model[temp_r27], spA0[0][3], spA0[1][3], spA0[2][3]);
}
}
Hu3DModelRotSet(object->model[0], 0, lbl_1_bss_116C[0], 0);
Hu3DModelRotSet(object->model[1], 0, lbl_1_bss_116C[1], 0);
for(temp_r31=0; temp_r31<2; temp_r31++) {
Hu3DLLightPointSet(object->model[temp_r31], lbl_1_bss_1174[temp_r31], (15*sind(object->work[temp_r31]))+45, 0.9, 3);
object->work[temp_r31] += 8.0f;
if(object->work[temp_r31] > 360.0f) {
object->work[temp_r31] -= 360.0f;
}
}
}
void fn_1_8904(void *arg0, u8 arg1)
{
GXSetTexCopySrc(0, 0, 640, 480);
GXSetTexCopyDst(640, 480, GX_TF_RGBA8, GX_FALSE);
GXSetCopyClear(BGColor, 0xFFFFFF);
GXCopyTex(arg0, arg1);
DCFlushRange(arg0, lbl_1_bss_1184);
}
void fn_1_89BC(ModelData *model, Mtx mtx)
{
Mtx44 sp34;
GXTexObj sp14;
MTXOrtho(sp34, 0, 480, 0, 576, 0, 1000);
GXSetProjection(sp34, GX_ORTHOGRAPHIC);
MTXIdentity(mtx);
GXLoadPosMtxImm(mtx, GX_PNMTX0);
GXSetNumChans(1);
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_CLAMP, GX_AF_NONE);
GXSetChanAmbColor(GX_COLOR0A0, lbl_1_data_268);
GXSetChanMatColor(GX_COLOR0A0, lbl_1_data_268);
GXSetNumTexGens(1);
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
GXSetNumTevStages(1);
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD0, GX_TEXMAP1, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_TEXC);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_RASA);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXInitTexObj(&sp14, lbl_1_bss_1180, 640, 480, GX_TF_RGBA8, GX_CLAMP, GX_CLAMP, GX_FALSE);
GXLoadTexObj(&sp14, GX_TEXMAP0);
GXSetBlendMode(GX_BM_BLEND, GX_BL_INVSRCALPHA, GX_BL_SRCALPHA, GX_LO_NOOP);
GXSetZMode(GX_FALSE, GX_LEQUAL, GX_FALSE);
GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_AND, GX_ALWAYS, 0);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
GXPosition3f32(0, 0, -10);
GXTexCoord2f32(0, 0);
GXPosition3f32(576, 0, -10);
GXTexCoord2f32(1, 0);
GXPosition3f32(576, 480, -10);
GXTexCoord2f32(1, 1);
GXPosition3f32(0, 480, -10);
GXTexCoord2f32(0, 1);
GXEnd();
fn_1_8904(lbl_1_bss_1180, GX_FALSE);
}
void fn_1_8EA0(void)
{
lbl_1_bss_1168 = 0;
}
void fn_1_8EB4(s16 model)
{
HsfMaterial *temp_r31;
HsfData *temp_r30;
s32 temp_r29;
ModelData *temp_r28;
s16 *temp_r27;
s16 temp_r26;
temp_r28 = &Hu3DData[model];
temp_r30 = temp_r28->hsfData;
temp_r26 = temp_r30->materialCnt;
temp_r27 = &lbl_1_bss_968[lbl_1_bss_1168][0];
*temp_r27 = model;
temp_r31 = temp_r30->material;
for(temp_r29=0; temp_r29<temp_r26; temp_r31++, temp_r29++) {
temp_r31->vtxMode = 1;
}
lbl_1_bss_1168++;
}
void fn_1_8F60(float arg0)
{
s16 *temp_r31;
s32 temp_r30;
temp_r31 = &lbl_1_bss_968[0][0];
for(temp_r30=0; temp_r30<lbl_1_bss_1168; temp_r31 += 4, temp_r30++) {
ModelData *sp8 = &Hu3DData[*temp_r31];
Hu3DModelAmbSet(*temp_r31, arg0, arg0, arg0);
}
}
void fn_1_8FF0(void)
{
}
void fn_1_8FF4(float arg0)
{
lbl_1_data_268.a = arg0*255;
}

3438
src/REL/m426Dll/main.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -383,7 +383,7 @@ void fn_1_CA0(unkStruct* arg0) {
arg0->unk10 = 2;
case 2:
if (fn_1_5678(var_r30, &arg0->unk34, 0) == 0) {
if ((arg0->unkC-- % 60) == 0) {
if ((--arg0->unkC % 60) == 0) {
MGSeqParamSet(arg0->unk6, 1, arg0->unkC / 60);
}
if (arg0->unkC == 0) {
@ -423,7 +423,7 @@ void fn_1_CA0(unkStruct* arg0) {
} else break;
case 7:
if (fn_1_4088(arg0->unk20, var_r30->unk64, var_r30->unk66, arg0->unk1C == 1, &arg0->unk34, 0) == 0) {
if ((arg0->unkC-- % 60) == 0) {
if ((--arg0->unkC % 60) == 0) {
MGSeqParamSet(arg0->unk6, 1, arg0->unkC / 60);
}
if (arg0->unkC <= 0) {

1418
src/REL/m451Dll/m451.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -228,7 +228,4 @@ void fn_1_46F0(void)
// -------------------------------------------------------------------------- //
const Point3d lbl_1_rodata_1C8 = {0.0f, 0.0f, 0.0f};
const Point3d lbl_1_rodata_1D4 = {0.0f, 0.0f, -1.0f};
// -------------------------------------------------------------------------- //

View file

@ -0,0 +1,753 @@
#include "game/object.h"
#include "game/hsfman.h"
#include "game/hsfload.h"
#include "game/hsfdraw.h"
#include "game/printfunc.h"
#include "game/hsfmotion.h"
#include "game/wipe.h"
#include "game/audio.h"
#include "game/msm.h"
#include "game/pad.h"
#include "game/process.h"
#include "game/gamework_data.h"
#include "math.h"
#include "ext_math.h"
typedef struct unk_bss_a18 {
u32 unk0;
Vec unk4;
Vec unk10;
u8 unk1C[0x88];
} UnkBssA18;
omObjData *lbl_1_bss_AC4;
omObjData *lbl_1_bss_AC0;
omObjData *lbl_1_bss_ABC;
UnkBssA18 lbl_1_bss_A18;
s32 lbl_1_bss_A14;
float lbl_1_bss_A10;
float lbl_1_bss_A0C;
s16 lbl_1_bss_A08;
Process *lbl_1_bss_A04;
Process *lbl_1_bss_A00;
void fn_1_4DF8(omObjData *object);
void fn_1_5A60(omObjData *object);
void fn_1_5DA8(void);
void fn_1_6AE0(ModelData *model, Mtx mtx);
void fn_1_83B4(void);
static const Vec lbl_1_rodata_1C8 = {0.0f, 0.0f, 0.0f};
static const Vec lbl_1_rodata_1D4 = {0.0f, 0.0f, -1.0f};
void fn_1_4AC8(void)
{
Vec sp14;
Vec sp8;
Process *objman;
OSReport("******* MODELTESTObjectSetup *********\n");
objman = omInitObjMan(50, 8192);
CRot.x = -22;
CRot.y = 0;
CRot.z = 0;
Center.x = 0;
Center.y = 100;
Center.z = 0;
CZoom = 400;
Hu3DCameraCreate(1);
lbl_1_bss_A0C = 45;
Hu3DCameraPerspectiveSet(1, lbl_1_bss_A0C, 20, 5000, 1.2f);
Hu3DCameraViewportSet(1, 0, 0, 640, 480, 0, 1);
Hu3DCameraScissorSet(1, 0, 0, 640, 480);
lbl_1_bss_ABC = omAddObjEx(objman, 0, 32, 32, -1, fn_1_4DF8);
lbl_1_bss_AC0 = omAddObjEx(objman, 32730, 0, 0, -1, fn_1_5A60);
lbl_1_bss_A00 = HuPrcCreate(fn_1_5DA8, 100, 8192, 0);
Hu3DBGColorSet(16, 16, 16);
Hu3DHookFuncCreate(fn_1_6AE0);
HuPrcChildCreate(fn_1_83B4, 100, 12288, 0, objman);
WipeCreate(WIPE_MODE_IN, WIPE_TYPE_NORMAL, 30);
sp14 = lbl_1_rodata_1C8;
sp8 = lbl_1_rodata_1D4;
lbl_1_bss_A18.unk0 = 64;
lbl_1_bss_A18.unk10.x = 0;
lbl_1_bss_A18.unk10.y = 0;
lbl_1_bss_A18.unk10.z = 0;
msmSeSetListener(&sp14, &sp8, 2000, 1000, 0);
}
void fn_1_4DF8(omObjData *object)
{
float temp_f31;
Vec pos;
Vec offset;
Vec dir;
Vec y_offset;
s8 temp_r31;
if(HuPadBtnDown[0] & PAD_BUTTON_START) {
if(lbl_1_bss_A00) {
HuPrcKill(lbl_1_bss_A00);
}
if(lbl_1_bss_A04) {
HuPrcKill(lbl_1_bss_A04);
}
HuAudFXListnerKill();
omOvlReturnEx(1, 1);
return;
}
CRot.y += 0.1f*HuPadStkX[0];
CRot.x += 0.1f*HuPadStkY[0];
CZoom += HuPadTrigL[0]/2;
CZoom -= HuPadTrigR[0]/2;
if(CZoom < 100) {
CZoom = 100;
}
if(CZoom > 2000) {
CZoom = 2000;
}
pos.x = Center.x + (CZoom * (sind(CRot.y) * cosd(CRot.x)));
pos.y = (Center.y + (CZoom * -sind(CRot.x)));
pos.z = (Center.z + (CZoom * (cosd(CRot.y) * cosd(CRot.x))));
offset.x = Center.x - pos.x;
offset.y = Center.y - pos.y;
offset.z = Center.z - pos.z;
dir.x = (sind(CRot.y) * sind(CRot.x));
dir.y = cosd(CRot.x);
dir.z = (cosd(CRot.y) * sind(CRot.x));
temp_f31 = CRot.z;
y_offset.x = dir.x * (offset.x * offset.x + (1.0f - offset.x * offset.x) * cosd(temp_f31))
+ dir.y * (offset.x * offset.y * (1.0f - cosd(temp_f31)) - offset.z * sind(temp_f31))
+ dir.z * (offset.x * offset.z * (1.0f - cosd(temp_f31)) + offset.y * sind(temp_f31));
y_offset.y = dir.y * (offset.y * offset.y + (1.0f - offset.y * offset.y) * cosd(temp_f31))
+ dir.x * (offset.x * offset.y * (1.0f - cosd(temp_f31)) + offset.z * sind(temp_f31))
+ dir.z * (offset.y * offset.z * (1.0f - cosd(temp_f31)) - offset.x * sind(temp_f31));
y_offset.z = dir.z * (offset.z * offset.z + (1.0f - offset.z * offset.z) * cosd(temp_f31))
+ (dir.x * (offset.x * offset.z * (1.0 - cosd(temp_f31)) - offset.y * sind(temp_f31))
+ dir.y * (offset.y * offset.z * (1.0 - cosd(temp_f31)) + offset.x * sind(temp_f31)));
VECCrossProduct(&dir, &offset, &offset);
VECNormalize(&offset, &offset);
temp_r31 = (HuPadSubStkX[0] & 0xF8);
if (temp_r31 != 0) {
Center.x += 0.05f * (offset.x * temp_r31);
Center.y += 0.05f * (offset.y * temp_r31);
Center.z += 0.05f * (offset.z * temp_r31);
}
PSVECNormalize(&y_offset, &offset);
temp_r31 = -(HuPadSubStkY[0] & 0xF8);
if (temp_r31 != 0) {
Center.x += 0.05f * (offset.x * temp_r31);
Center.y += 0.05f * (offset.y * temp_r31);
Center.z += 0.05f * (offset.z * temp_r31);
}
Hu3DCameraPerspectiveSet(1, lbl_1_bss_A0C, 20, 5000, 1.2f);
}
void fn_1_5A60(omObjData *object)
{
Mtx rotAxis;
Vec pos, target, up;
float x, y, z;
x = CRot.x;
y = CRot.y;
z = CRot.z;
pos.x = (((sind(y)*cosd(x))*CZoom)+Center.x);
pos.y = (-sind(x)*CZoom)+Center.y;
pos.z = ((cosd(y)*cosd(x))*CZoom)+Center.z;
target.x = Center.x;
target.y = Center.y;
target.z = Center.z;
up.x = sind(y)*sind(x);
up.y = cosd(x);
up.z = cosd(y)*sind(x);
Hu3DCameraPosSet(1, pos.x, pos.y, pos.z, up.x, up.y, up.z, target.x, target.y, target.z);
MTXRotDeg(rotAxis, 'y', -y);
MTXMultVec(rotAxis, &pos, &up);
VECSubtract(&target, &pos, &up);
VECNormalize(&up, &up);
HuAudFXListnerUpdate(&pos, &up);
}
u32 lbl_1_data_3B0[] = {
0x005D0000, 0x00000000,
0x005E0000, 0x00000000,
0x005E0001, 0x00000000,
0x005F0006, 0x00000001,
0x005F0000, 0x00000001,
0x005F0002, 0x00000001,
0x005F0003, 0x00000001,
0x005F0005, 0x00000000,
0x005F0017, 0x00000000,
0x005F0018, 0x00000000,
0x00000000, 0x00000000
};
u32 lbl_1_data_408[] = {
0x00170000, 0x00000000,
0x00170002, 0x00000000,
0x00170003, 0x00000000,
0x0017000D, 0x00000001,
0x00170005, 0x00000001,
0x00170007, 0x00000001,
0x00170008, 0x00000001,
0x0017000C, 0x00000000,
0x00170028, 0x00000000,
0x00170029, 0x00000000,
0x00000000, 0x00000000
};
u32 lbl_1_data_460[] = {
0x006A0000, 0x00000000,
0x006A0002, 0x00000000,
0x006A0003, 0x00000000,
0x006A000D, 0x00000001,
0x006A0005, 0x00000001,
0x006A0007, 0x00000001,
0x006A0008, 0x00000001,
0x006A000C, 0x00000000,
0x006A0028, 0x00000000,
0x006A0029, 0x00000000,
0x00000000, 0x00000000
};
u32 lbl_1_data_4B8[] = {
0x00870000, 0x00000000,
0x00870002, 0x00000000,
0x00870003, 0x00000000,
0x0087000D, 0x00000001,
0x00870005, 0x00000001,
0x00870007, 0x00000001,
0x00870008, 0x00000001,
0x0087000C, 0x00000000,
0x00870028, 0x00000000,
0x00870029, 0x00000000,
0x00000000, 0x00000000
};
u32 lbl_1_data_510[] = {
0x00820000, 0x00000000,
0x00820002, 0x00000000,
0x00820003, 0x00000000,
0x0082000D, 0x00000001,
0x00820005, 0x00000001,
0x00820007, 0x00000001,
0x00820008, 0x00000001,
0x0082000C, 0x00000000,
0x00820028, 0x00000000,
0x00820029, 0x00000000,
0x00000000, 0x00000000
};
u32 lbl_1_data_568[] = {
0x000E0000, 0x00000000,
0x000E0002, 0x00000000,
0x000E0003, 0x00000000,
0x000E000D, 0x00000001,
0x000E0005, 0x00000001,
0x000E0007, 0x00000001,
0x000E0008, 0x00000001,
0x000E000C, 0x00000000,
0x000E0028, 0x00000000,
0x000E0029, 0x00000000,
0x00000000, 0x00000000
};
u32 lbl_1_data_5C0[] = {
0x000A0000, 0x00000000,
0x000A0002, 0x00000000,
0x000A0003, 0x00000000,
0x000A000D, 0x00000001,
0x000A0005, 0x00000001,
0x000A0007, 0x00000001,
0x000A0008, 0x00000001,
0x000A000C, 0x00000000,
0x000A0028, 0x00000000,
0x000A0029, 0x00000000,
0x00000000, 0x00000000
};
u32 lbl_1_data_618[] = {
0x007E0000, 0x00000000,
0x007E0002, 0x00000000,
0x007E0003, 0x00000000,
0x007E000D, 0x00000001,
0x007E0005, 0x00000001,
0x007E0007, 0x00000001,
0x007E0008, 0x00000001,
0x007E000C, 0x00000000,
0x007E0028, 0x00000000,
0x007E0029, 0x00000000,
0x00000000, 0x00000000
};
u32 *lbl_1_data_670[] = {
lbl_1_data_3B0,
lbl_1_data_408,
lbl_1_data_460,
lbl_1_data_4B8,
lbl_1_data_510,
lbl_1_data_568,
lbl_1_data_5C0,
lbl_1_data_618
};
void fn_1_69C8(s16 arg0, s16 arg1, s16 arg2);
void fn_1_5DA8(void)
{
u32 *temp_r31;
s16 temp_r30;
s16 temp_r29;
s16 temp_r28;
s16 temp_r27;
s16 temp_r26;
s16 temp_r25;
s32 temp_r24 = 0;
s16 sp40[3][32];
Vec sp34;
Vec sp28 = { 0, 0, 0 };
Vec sp1C = { 0, 1, 0 };
s16 sp16[3];
s16 sp10[3];
float spC;
s16 sp8 = 0;
Hu3DGLightCreate(0, 500, 1000, 0, -0.5, -1, 255, 255, 255);
temp_r28 = GWPlayerCfg[0].character;
temp_r31 = lbl_1_data_670[temp_r28];
sp16[0] = Hu3DModelCreateFile(temp_r31[0]);
sp16[1] = Hu3DModelCreateFile(temp_r31[2]);
sp16[2] = Hu3DModelCreateFile(temp_r31[4]);
HuDataDirClose(temp_r31[0]);
HuDataDirClose(temp_r31[2]);
HuDataDirClose(temp_r31[4]);
temp_r27 = 0;
temp_r29 = 0;
while(1) {
if(temp_r31[(temp_r29*2)+8] == 0) {
if(temp_r27 == 0) {
temp_r27 = temp_r29;
}
break;
}
if(temp_r31[(temp_r29*2)+8] == 0xFFFFFFFF) {
temp_r27 = temp_r29;
} else {
sp40[0][temp_r29] = Hu3DJointMotionFile(sp16[0], temp_r31[(temp_r29*2)+8]);
sp40[1][temp_r29] = Hu3DJointMotionFile(sp16[1], temp_r31[(temp_r29*2)+8]);
sp40[2][temp_r29] = Hu3DJointMotionFile(sp16[2], temp_r31[(temp_r29*2)+8]);
}
temp_r29++;
}
sp10[0] = Hu3DJointMotionFile(sp16[0], temp_r31[6]);
sp10[1] = Hu3DJointMotionFile(sp16[1], temp_r31[6]);
sp10[2] = Hu3DJointMotionFile(sp16[2], temp_r31[6]);
temp_r26 = 0;
temp_r30 = 0;
Hu3DMotionSet(sp16[0], sp40[0][temp_r30]);
Hu3DModelAttrSet(sp16[0], 0x40000001);
Hu3DMotionSet(sp16[1], sp40[1][temp_r30]);
Hu3DModelAttrSet(sp16[1], 0x40000001);
Hu3DMotionSet(sp16[2], sp40[2][temp_r30]);
Hu3DModelAttrSet(sp16[2], 0x40000001);
Hu3DModelAttrSet(sp16[1], 0x1);
Hu3DModelAttrSet(sp16[2], 0x1);
while(1) {
temp_r25 = 0;
if(HuPadBtnDown[0] & PAD_BUTTON_X) {
temp_r30++;
if(temp_r30 >= temp_r27) {
temp_r30 = 0;
}
Hu3DMotionSet(sp16[0], sp40[0][temp_r30]);
Hu3DMotionSet(sp16[1], sp40[1][temp_r30]);
Hu3DMotionSet(sp16[2], sp40[2][temp_r30]);
if(temp_r31[(temp_r30*2)+9] != 0) {
Hu3DModelAttrSet(sp16[0], 0x40000001);
Hu3DModelAttrSet(sp16[1], 0x40000001);
Hu3DModelAttrSet(sp16[2], 0x40000001);
} else {
Hu3DModelAttrReset(sp16[0], 0x40000001);
Hu3DModelAttrReset(sp16[1], 0x40000001);
Hu3DModelAttrReset(sp16[2], 0x40000001);
}
fn_1_69C8(temp_r28, sp16[0], 0);
fn_1_69C8(temp_r28, sp16[1], 1);
fn_1_69C8(temp_r28, sp16[2], 2);
temp_r25 = 1;
}
if(HuPadBtnDown[0] & PAD_BUTTON_Y) {
temp_r30--;
if(temp_r30 < 0) {
temp_r30 = temp_r27-1;
}
Hu3DMotionSet(sp16[0], sp40[0][temp_r30]);
Hu3DMotionSet(sp16[1], sp40[1][temp_r30]);
Hu3DMotionSet(sp16[2], sp40[2][temp_r30]);
if(temp_r31[(temp_r30*2)+9] != 0) {
Hu3DModelAttrSet(sp16[0], 0x40000001);
Hu3DModelAttrSet(sp16[1], 0x40000001);
Hu3DModelAttrSet(sp16[2], 0x40000001);
} else {
Hu3DModelAttrReset(sp16[0], 0x40000001);
Hu3DModelAttrReset(sp16[1], 0x40000001);
Hu3DModelAttrReset(sp16[2], 0x40000001);
}
fn_1_69C8(temp_r28, sp16[0], 0);
fn_1_69C8(temp_r28, sp16[1], 1);
fn_1_69C8(temp_r28, sp16[2], 2);
temp_r25 = 1;
}
if(temp_r31[(temp_r30*2)+9] == 0) {
if(HuPadBtn[0] & PAD_BUTTON_A) {
Hu3DModelAttrSet(sp16[0], 0x40000001);
Hu3DModelAttrSet(sp16[1], 0x40000001);
Hu3DModelAttrSet(sp16[2], 0x40000001);
temp_r25 = 1;
} else {
if(temp_r30 != 3 && temp_r30 != 2) {
Hu3DModelAttrReset(sp16[0], 0x40000001);
Hu3DModelAttrReset(sp16[1], 0x40000001);
Hu3DModelAttrReset(sp16[2], 0x40000001);
}
}
}
if(temp_r25 != 0) {
if(temp_r30 == 3) {
Hu3DMotionSet(sp16[0], sp40[0][temp_r30]);
Hu3DMotionSet(sp16[1], sp40[1][temp_r30]);
Hu3DMotionSet(sp16[2], sp40[2][temp_r30]);
Hu3DModelAttrReset(sp16[0], 0x40000001);
Hu3DModelAttrReset(sp16[1], 0x40000001);
Hu3DModelAttrReset(sp16[2], 0x40000001);
for(temp_r29=0; temp_r29<=30; temp_r29++) {
Hu3DModelPosSet(sp16[0], 0, sind(temp_r29*6.0f)*150, 0);
Hu3DModelPosSet(sp16[1], 0, sind(temp_r29*6.0f)*150, 0);
Hu3DModelPosSet(sp16[2], 0, sind(temp_r29*6.0f)*150, 0);
if(temp_r29 == 25) {
Hu3DMotionSet(sp16[0], sp10[0]);
Hu3DMotionSet(sp16[1], sp10[1]);
Hu3DMotionSet(sp16[2], sp10[2]);
}
HuPrcVSleep();
}
while(!Hu3DMotionEndCheck(sp16[0])) {
HuPrcVSleep();
}
fn_1_69C8(temp_r28, sp16[0], 0);
fn_1_69C8(temp_r28, sp16[1], 1);
fn_1_69C8(temp_r28, sp16[2], 2);
Hu3DMotionShiftSet(sp16[0], sp40[0][0], 0, 16, 0x40000001);
Hu3DMotionShiftSet(sp16[1], sp40[1][0], 0, 16, 0x40000001);
Hu3DMotionShiftSet(sp16[2], sp40[2][0], 0, 16, 0x40000001);
}
temp_r24 = 0;
}
sp34.x = Center.x + (CZoom * (sind(CRot.y) * cosd(CRot.x)));
sp34.y = (Center.y + (CZoom * -sind(CRot.x)));
sp34.z = (Center.z + (CZoom * (cosd(CRot.y) * cosd(CRot.x))));
spC = VECMag(&sp34);
if(HuPadBtnDown[0] & PAD_BUTTON_B) {
temp_r26++;
if(temp_r26 >= 3) {
temp_r26 = 0;
}
}
Hu3DModelAttrSet(sp16[0], 1);
Hu3DModelAttrSet(sp16[1], 1);
Hu3DModelAttrSet(sp16[2], 1);
switch(temp_r26) {
case 0:
Hu3DModelAttrReset(sp16[0], 1);
break;
case 1:
Hu3DModelAttrReset(sp16[1], 1);
break;
case 2:
Hu3DModelAttrReset(sp16[2], 1);
break;
}
HuPrcVSleep();
}
}
char *lbl_1_data_6F4[] = {
"s3_mario_eyes_1",
"mario_eyes_2",
"mario_eyes_2",
"S3c001m0_eye",
"S3c001m1_eye",
"c001m3_eye",
"GC-eyes",
"s3tc_GC-eyes_2",
"s3tc_GC-eyes_2",
"S3c003m1",
"S3c003m1",
"S3c003m1",
"GC-eyes",
"s3tc_GC-eyes_2",
"s3tc_GC-eyes_2",
"GC-eyes",
"s3tc_GC-eyes_2",
"s3tc_GC-eyes_2",
"GC-eyes",
"s3tc_GC-eyes_2",
"s3tc_GC-eyes_2",
"GC-eyes",
"s3tc_GC-eyes_2",
"s3tc_GC-eyes_2",
};
void fn_1_69C8(s16 arg0, s16 arg1, s16 arg2)
{
HsfdrawStruct01 *temp_r31;
HsfAttribute *temp_r30;
ModelData *temp_r29;
s16 temp_r28;
char *temp_r27;
temp_r29 = &Hu3DData[arg1];
temp_r30 = temp_r29->hsfData->attribute;
temp_r27 = MakeObjectName(lbl_1_data_6F4[arg2+(arg0*3)]);
for(temp_r28=0; temp_r28<temp_r29->hsfData->attributeCnt; temp_r28++, temp_r30++) {
if(temp_r30->bitmap->name[0] == temp_r27[0] && strcmp(temp_r30->bitmap->name, temp_r27) == 0 && temp_r30->unk04) {
temp_r31 = temp_r30->unk04;
temp_r31->unk08 = temp_r31->unk0C = temp_r31->unk10 = 0;
temp_r31->unk14 = temp_r31->unk18 = temp_r31->unk1C = 0;
}
}
}
s32 lbl_1_data_754 = 20;
void fn_1_6AE0(ModelData *model, Mtx mtx)
{
s32 temp_r31;
u8 temp_r30, temp_r29, temp_r28;
s32 sp84 = 0;
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGB, GX_RGB8, 0);
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0);
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_RASC, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO);
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_KONST, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO);
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetNumTexGens(0);
GXSetNumTevStages(1);
GXSetNumChans(1);
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, 0, GX_DF_CLAMP, GX_AF_NONE);
GXLoadPosMtxImm(mtx, GX_PNMTX0);
GXBegin(GX_LINES, GX_VTXFMT0, (lbl_1_data_754+1)*4);
for(temp_r31=0; temp_r31<=lbl_1_data_754; temp_r31++) {
temp_r30 = temp_r29 = temp_r28 = 255;
GXPosition3f32((temp_r31*100)-((lbl_1_data_754/2)*100), 0, (-(lbl_1_data_754/2))*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32((temp_r31*100)-((lbl_1_data_754/2)*100), 0, (lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32(-(lbl_1_data_754/2)*100, 0, (temp_r31*100)-((lbl_1_data_754/2)*100));
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32((lbl_1_data_754/2)*100, 0, (temp_r31*100)-((lbl_1_data_754/2)*100));
GXColor3u8(temp_r30, temp_r29, temp_r28);
}
GXBegin(GX_LINES, GX_VTXFMT0, (lbl_1_data_754+1)*4);
for(temp_r31=0; temp_r31<=lbl_1_data_754; temp_r31++) {
temp_r30 = temp_r29 = temp_r28 = 255;
GXPosition3f32((temp_r31*100)-((lbl_1_data_754/2)*100), lbl_1_data_754*100, (-(lbl_1_data_754/2))*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32((temp_r31*100)-((lbl_1_data_754/2)*100), 0, -(lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32(-(lbl_1_data_754/2)*100, temp_r31*100, -(lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32((lbl_1_data_754/2)*100, temp_r31*100, -(lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
}
GXBegin(GX_LINES, GX_VTXFMT0, (lbl_1_data_754+1)*4);
for(temp_r31=0; temp_r31<=lbl_1_data_754; temp_r31++) {
temp_r30 = temp_r29 = temp_r28 = 255;
GXPosition3f32((temp_r31*100)-((lbl_1_data_754/2)*100), lbl_1_data_754*100, (lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32((temp_r31*100)-((lbl_1_data_754/2)*100), 0, (lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32(-(lbl_1_data_754/2)*100, temp_r31*100, (lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32((lbl_1_data_754/2)*100, temp_r31*100, (lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
}
GXBegin(GX_LINES, GX_VTXFMT0, (lbl_1_data_754+1)*4);
for(temp_r31=0; temp_r31<=lbl_1_data_754; temp_r31++) {
temp_r30 = temp_r29 = temp_r28 = 255;
GXPosition3f32((lbl_1_data_754/2)*100, lbl_1_data_754*100, (temp_r31*100)-((lbl_1_data_754/2)*100));
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32((lbl_1_data_754/2)*100, 0, (temp_r31*100)-((lbl_1_data_754/2)*100));
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32((lbl_1_data_754/2)*100, temp_r31*100, -(lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32((lbl_1_data_754/2)*100, temp_r31*100, (lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
}
GXBegin(GX_LINES, GX_VTXFMT0, (lbl_1_data_754+1)*4);
for(temp_r31=0; temp_r31<=lbl_1_data_754; temp_r31++) {
temp_r30 = temp_r29 = temp_r28 = 255;
GXPosition3f32(-(lbl_1_data_754/2)*100, lbl_1_data_754*100, (temp_r31*100)-((lbl_1_data_754/2)*100));
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32(-(lbl_1_data_754/2)*100, 0, (temp_r31*100)-((lbl_1_data_754/2)*100));
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32(-(lbl_1_data_754/2)*100, temp_r31*100, -(lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
GXPosition3f32(-(lbl_1_data_754/2)*100, temp_r31*100, (lbl_1_data_754/2)*100);
GXColor3u8(temp_r30, temp_r29, temp_r28);
}
}
s16 lbl_1_data_758[] = {
1,
3,
2,
13,
14,
15,
16,
68,
-1
};
s16 lbl_1_data_76A[] = {
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
-1
};
void fn_1_814C(void)
{
s16 temp_r31 = 0;
s16 temp_r30 = 0;
s16 temp_r29 = 0;
s16 temp_r28;
Vec sp8 = { 0, 0, 0 };
while(1) {
lbl_1_bss_A14 = HuAudFXEmiterPlay(1282, &sp8);
HuPrcSleep(60);
if(HuPadBtnDown[1] & PAD_BUTTON_A) {
HuAudSeqFadeOut(temp_r28, 60);
temp_r28 = HuAudSeqPlay(lbl_1_data_758[temp_r31]);
temp_r31++;
if(lbl_1_data_758[temp_r31] == -1) {
temp_r31 = 0;
}
temp_r29 = 30;
}
if(HuPadBtnDown[1] & PAD_BUTTON_B) {
HuAudFXPlay(lbl_1_data_76A[temp_r30]);
temp_r30++;
if(lbl_1_data_76A[temp_r30] == -1) {
temp_r30 = 0;
}
temp_r29 = 30;
}
if(temp_r29) {
temp_r29--;
print8(16, 430, 2.0f, "MusicNo:%d SENo:%d", temp_r31, temp_r30);
}
HuPrcVSleep();
}
}
s16 lbl_1_data_7AC = -1;
u32 fn_1_82C8(void)
{
s16 temp_r31;
temp_r31 = HuPadBtn[0];
if(lbl_1_bss_A08) {
lbl_1_bss_A08--;
if(!temp_r31) {
lbl_1_bss_A08 = 0;
} else {
temp_r31 = 0;
}
} else if(temp_r31) {
if(lbl_1_data_7AC == temp_r31) {
lbl_1_bss_A08 = 3;
} else {
lbl_1_bss_A08 = 20;
}
lbl_1_data_7AC = temp_r31;
} else {
lbl_1_data_7AC = 0;
}
return temp_r31;
}
void fn_1_83B4(void)
{
u32 temp_r29;
Process *temp_r28;
temp_r28 = HuPrcCurrentGet();
HuPrcSetStat(temp_r28, 0xC);
while(1) {
temp_r29 = fn_1_82C8();
if(HuPadBtn[0] & PAD_BUTTON_RIGHT) {
while(1) {
temp_r29 = fn_1_82C8();
if(HuPadBtn[0] & PAD_BUTTON_LEFT) {
break;
}
if(!temp_r29) {
HuPrcAllPause(1);
Hu3DPauseSet(1);
} else {
HuPrcAllPause(0);
Hu3DPauseSet(0);
}
HuPrcVSleep();
}
HuPrcAllPause(0);
Hu3DPauseSet(0);
}
if(temp_r29 & PAD_BUTTON_UP) {
if(lbl_1_bss_A0C < 120.0f) {
lbl_1_bss_A0C++;
}
}
if(temp_r29 & PAD_BUTTON_DOWN) {
if(lbl_1_bss_A0C > 5.0f) {
lbl_1_bss_A0C--;
}
}
HuPrcVSleep();
}
}

228
src/REL/w02Dll/dice.c Normal file
View file

@ -0,0 +1,228 @@
#include "REL/w02Dll.h"
/* DATA */
extern char lbl_1_data_2A8[0x12];
extern char lbl_1_data_2BA[0x0D];
extern char lbl_1_data_2C8[0x10];
/* RODATA*/
extern f32 lbl_1_rodata_38;
extern f32 lbl_1_rodata_3C;
extern f32 lbl_1_rodata_40;
extern f32 lbl_1_rodata_44;
extern f32 lbl_1_rodata_48;
extern f32 lbl_1_rodata_4C;
/* STRUCTS*/
typedef struct {
/* 0x00 */ s16 unk00;
/* 0x02 */ s16 unk02;
/* 0x04 */ s32 unk04;
/* 0x08 */ u8 unk08[0x04];
/* 0x0C */ Vec unk0C;
/* 0x18 */ s16 unk18;
/* 0x1A */ s16 unk1A;
/* 0x1C */ u8 unk1C[0x6];
/* 0x22 */ s16 unk22;
/* 0x24 */ f32 unk24;
/* 0x28 */ s16 unk28;
/* 0x2A */ u8 unk2A[0x2];
/* 0x2C */ Process* unk2C;
/* 0x30 */ s16 unk30[3];
/* 0x36 */ s16 unk36[3];
/* 0x3C */ omObjData* unk3C[3];
/* 0x48 */ s16 unk48[3];
/* 0x4E */ u8 unk4E[0x2];
/* 0x50 */ s32 unk50[3];
/* 0x5C */ u8 unk5C[0x08];
/* 0x64 */ Vec unk64;
/* 0x70 */ Vec unk70;
/* 0x7C */ Vec unk7C;
/* 0x88 */ s32 unk88[3];
/* 0x94 */ s16 unk94;
/* 0x96 */ s16 unk96;
/* 0x98 */ f32 unk98;
/* 0x9C */ s16 unk9C;
} unkW02Dice;
typedef struct {
union {
/* 0x00 */ struct {
u8 unk7 : 1;
u8 unk6 : 1;
u8 unk3 : 3;
u8 unk1 : 2;
u8 unk0 : 1;
};
u8 unk00;
};
/* 0x01 */ u8 unk01;
/* 0x02 */ u8 unk02;
/* 0x03 */ u8 unk03;
/* 0x04 */ u16 unk04;
} unkW02DiceBitfields;
/* EXTERN FUNCTIONS */
void fn_1_13D0(void);
void fn_1_1574(unkW02Dice*); /* extern */
void fn_1_1794(unkW02Dice*); /* extern */
void fn_1_1850(omObjData*); /* extern */
void fn_1_2030(unkW02Dice*); /* extern */
void fn_1_2220(unkW02Dice*); /* extern */
s32 fn_1_233C(unkW02Dice*); /* extern */
void fn_1_23B4(unkW02Dice*, s32 i); /* extern */
void fn_1_272C(unkW02Dice*); /* extern */
/* LOCAL FUNCTIONS */
void fn_1_1254(unkW02Dice* arg0) {
Vec sp8;
s32 i;
OSReport(lbl_1_data_2A8);
arg0->unk2C = HuPrcChildCreate(&fn_1_13D0, 0x2005, 0x2000, 0, boardMainProc);
arg0->unk2C->user_data = arg0;
arg0->unk94 = 0;
arg0->unk9C = 0;
arg0->unk28 = 0;
Hu3D3Dto2D(&arg0->unk0C, 1, &sp8);
/* Initialize Matrix */
arg0->unk64 = arg0->unk70 = arg0->unk7C = sp8;
arg0->unk7C.y = arg0->unk70.y = arg0->unk64.y = lbl_1_rodata_38;
arg0->unk7C.z = arg0->unk70.z = arg0->unk64.z = lbl_1_rodata_3C;
arg0->unk96 = -1;
for (i = 0; i < 3; i++) {
arg0->unk3C[i] = 0;
arg0->unk50[i] = 0;
arg0->unk30[i] = -1;
arg0->unk48[i] = -1;
arg0->unk88[i] = -1;
}
}
void fn_1_13D0(void) {
s32 var_r29;
s32 i;
s32 var_r30_2;
unkW02Dice* temp_r31;
temp_r31 = HuPrcCurrentGet()->user_data;
temp_r31->unk36[0] = temp_r31->unk36[1] = temp_r31->unk36[2] = 0;
var_r29 = 0;
temp_r31->unk96 = 0;
while (temp_r31->unk96 < temp_r31->unk00) {
fn_1_1574(temp_r31);
fn_1_1794(temp_r31);
while (temp_r31->unk9C == 0) {
HuPrcVSleep();
}
fn_1_2220(temp_r31);
while (temp_r31->unk9C != 0) {
HuPrcVSleep();
}
temp_r31->unk96 += 1;
}
for ( i = 0; i < temp_r31->unk00; i++) {
var_r29 += temp_r31->unk36[i];
}
OSReport(lbl_1_data_2BA, var_r29);
while (fn_1_233C(temp_r31) == 0) {
HuPrcVSleep();
}
temp_r31->unk94 = (s16) var_r29;
temp_r31->unk28 = 1;
if (temp_r31->unk22 != 0) {
for (i = 0; i < temp_r31->unk00; i++) {
fn_1_23B4(temp_r31, i);
}
temp_r31->unk2C = NULL;
HuPrcEnd();
}
while (TRUE) {
HuPrcVSleep();
}
}
void fn_1_1518(unkW02Dice* arg0) {
OSReport(lbl_1_data_2C8);
if (arg0->unk2C) {
HuPrcKill(arg0->unk2C);
}
fn_1_2030(arg0);
fn_1_272C(arg0);
}
void fn_1_1574(unkW02Dice* arg0) {
Vec sp8;
f32 temp_f0;
omObjData* temp_r3;
s32 temp_r28;
unkW02DiceBitfields* temp_r29;
temp_r28 = arg0->unk96;
arg0->unk30[temp_r28] = BoardModelCreate(arg0->unk04, NULL, 0);
arg0->unk98 = lbl_1_rodata_40 + BoardRandMod(arg0->unk1A);
BoardModelMotionStart(arg0->unk30[temp_r28], 0, 0x40000001U);
BoardModelMotionSpeedSet(arg0->unk30[temp_r28], lbl_1_rodata_44);
BoardModelMotionTimeSet(arg0->unk30[temp_r28], arg0->unk98);
temp_r3 = omAddObjEx(boardObjMan, 0x102, 0U, 0U, -1, fn_1_1850);
temp_r29 = (unkW02DiceBitfields*) temp_r3->work;
temp_r29->unk7 = 0;
temp_r29->unk6 = 0;
temp_r29->unk3 = 0;
temp_r29->unk1 = temp_r28;
temp_r29->unk04 = 0;
temp_r29->unk01 = 3;
temp_r29->unk02 = 0;
temp_r3->unk10 = (u32) arg0;
arg0->unk3C[temp_r28] = temp_r3;
sp8 = arg0->unk0C;
sp8.y += (lbl_1_rodata_48 * arg0->unk24);
temp_r3->trans.x = sp8.x;
temp_r3->trans.y = sp8.y;
temp_r3->trans.z = sp8.z;
temp_r3->scale.x = lbl_1_rodata_44;
temp_r3->scale.y = lbl_1_rodata_44;
temp_r3->scale.z = lbl_1_rodata_44;
sp8.z += lbl_1_rodata_4C;
HuAudFXPlay(0x302);
}
void fn_1_1794(unkW02Dice* arg0) {
unkW02DiceBitfields* temp_r30;
temp_r30 = (unkW02DiceBitfields*) arg0->unk3C[arg0->unk96]->work;
while (temp_r30->unk3 != 1) {
HuPrcVSleep();
}
}
s32 fn_1_17F4(unkW02Dice* arg0) {
unkW02DiceBitfields* temp;
if ( arg0->unk96 < 0) {
return 0;
}
temp = (unkW02DiceBitfields*) arg0->unk3C[arg0->unk96]->work;
if (temp->unk3 != 1) {
return 0;
}
return 1;
}
void fn_1_1F94(unkW02Dice* arg0, s32 arg1) {
if (arg0->unk30[arg1] != -1) {
BoardModelKill(arg0->unk30[arg1]);
arg0->unk30[arg1] = -1;
}
if (arg0->unk48[arg1] != -1) {
Hu3DParManKill(arg0->unk48[arg1]);
arg0->unk48[arg1] = -1;
}
}

View file

@ -68,7 +68,7 @@ void HuAudInit(void) {
musicOffF = 0;
}
s32 HuAudStreamPlay(void) {
s32 HuAudStreamPlay(char *name, s32 arg1) {
return 0;
}

View file

@ -1943,7 +1943,7 @@ static void LampParticleUpdate(ModelData *model, ParticleData *particle, Mtx mat
var_r31->unk2C = 0.0f;
var_r31->unk40.a = 0;
}
particle->unk_04 = 0.0f;
particle->unk_04.x = 0.0f;
particle->unk_00 = 0;
}
if (particle->unk_00 == 0) {

View file

@ -827,7 +827,7 @@ static void _Hu3DParticleAttrReset(ModelData *arg0, Mtx arg1) {
GXSetArray(GX_VA_POS, temp_r31->unk_4C, 0xC);
GXSetVtxDesc(GX_VA_CLR0, GX_INDEX16);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
GXSetArray(GX_VA_CLR0, (u8*) temp_r31->unk_48 + 0x40, 0x44);
GXSetArray(GX_VA_CLR0, &temp_r31->unk_48->unk40, 0x44);
GXSetVtxDesc(GX_VA_TEX0, GX_INDEX16);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_RGBA6, 0);
GXSetArray(GX_VA_TEX0, baseST, 8);

View file

@ -6,42 +6,34 @@
#include "ext_math.h"
#include "string.h"
typedef struct {
/* 0x00 */ ModelData *unk00;
/* 0x04 */ HsfObject *unk04;
/* 0x08 */ float unk08;
/* 0x0C */ Mtx unk0C;
/* 0x3C */ Vec unk3C;
} HsfdrawStruct00; // Size 0x48
typedef struct {
s32 unk00;
s32 unk04;
u16 unk08;
char unk0A[2];
u32 unk0C;
} DrawDataStruct; // Size 0x10
typedef struct hsf_draw_object {
/* 0x00 */ ModelData *model;
/* 0x04 */ HsfObject *object;
/* 0x08 */ float z;
/* 0x0C */ Mtx matrix;
/* 0x3C */ Vec scale;
} HsfDrawObject;
static void objCall(ModelData *arg0, HsfObject *arg1);
static void objMesh(ModelData *arg0, HsfObject *arg1);
static void FaceDraw(HsfdrawStruct00 *arg0, HsfFace *arg1);
static void SetTevStageNoTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1);
static void SetTevStageTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1);
static void FaceDraw(HsfDrawObject *arg0, HsfFace *arg1);
static void SetTevStageNoTex(HsfDrawObject *arg0, HsfMaterial *arg1);
static void SetTevStageTex(HsfDrawObject *arg0, HsfMaterial *arg1);
static GXTevKColorSel SetKColor(GXTevStageID arg0, u8 arg1);
static GXTevKColorSel SetKColorRGB(GXTevStageID arg0, GXColor *arg1);
static void FlushKColor(void);
static void SetReflect(HsfdrawStruct00 *arg0, s16 arg1, s16 arg2, u8 arg3);
static void SetProjection(HsfdrawStruct00 *arg0, s16 arg1, s16 arg2, s16 arg3, GXTexMapID arg4, u32 arg5);
static void SetReflect(HsfDrawObject *arg0, s16 arg1, s16 arg2, u8 arg3);
static void SetProjection(HsfDrawObject *arg0, s16 arg1, s16 arg2, s16 arg3, GXTexMapID arg4, u32 arg5);
static void SetShadowTex(void);
static void SetShadow(HsfdrawStruct00 *arg0, s16 arg1, s16 arg2);
static void FaceDrawShadow(HsfdrawStruct00 *arg0, HsfFace *arg1);
static void SetShadow(HsfDrawObject *arg0, s16 arg1, s16 arg2);
static void FaceDrawShadow(HsfDrawObject *arg0, HsfFace *arg1);
static void LoadTexture(ModelData *arg0, HsfBitmap *arg1, HsfAttribute *arg2, s16 arg3);
static void objNull(ModelData *arg0, HsfObject *arg1);
static void objRoot(ModelData *arg0, HsfObject *arg1);
static void objJoint(ModelData *arg0, HsfObject *arg1);
static void objMap(ModelData *arg0, HsfObject *arg1);
static void objReplica(ModelData *arg0, HsfObject *arg1);
static void ObjDraw(HsfdrawStruct00 *arg0);
static void ObjDraw(HsfDrawObject *arg0);
static void MDObjCall(HsfData *arg0, HsfObject *arg1);
static void MDObjMesh(HsfData *arg0, HsfObject *arg1);
static void MDFaceDraw(HsfObject *arg0, HsfFace *arg1);
@ -53,7 +45,7 @@ void GXResetWriteGatherPipe(void);
static const Vec lbl_8011DD20 = { 0.0f, 0.0f, -1.0f };
static HsfdrawStruct00 DrawObjData[512];
static HsfDrawObject DrawObjData[512];
static HsfAttribute *BmpPtrBak[8];
static Mtx MTXBuf[96];
static Vec scaleBuf[96];
@ -71,7 +63,7 @@ static u8 polyTypeBak;
static s32 shadingBak;
static void *DLBufP;
static void *DLBufStartP;
static DrawDataStruct *DrawData;
static HsfDrawData *DrawData;
static s32 drawCnt;
static s16 lightBit;
static s16 DrawObjIdx;
@ -134,7 +126,7 @@ void Hu3DDrawPreInit(void) {
}
void Hu3DDraw(ModelData *arg0, Mtx arg1, Vec *arg2) {
HsfdrawStruct00 *temp_r31;
HsfDrawObject *temp_r31;
HsfData *temp_r28;
float temp_f31;
Vec sp8;
@ -143,13 +135,13 @@ void Hu3DDraw(ModelData *arg0, Mtx arg1, Vec *arg2) {
temp_r28 = arg0->hsfData;
if (arg0->attr & 0x10) {
temp_r31 = &DrawObjData[DrawObjIdx];
PSMTXCopy(arg1, temp_r31->unk0C);
sp8.x = temp_r31->unk0C[0][3];
sp8.y = temp_r31->unk0C[1][3];
sp8.z = temp_r31->unk0C[2][3];
PSMTXCopy(arg1, temp_r31->matrix);
sp8.x = temp_r31->matrix[0][3];
sp8.y = temp_r31->matrix[1][3];
sp8.z = temp_r31->matrix[2][3];
temp_f31 = PSVECMag(&sp8);
temp_r31->unk08 = temp_f31;
temp_r31->unk00 = arg0;
temp_r31->z = temp_f31;
temp_r31->model = arg0;
DrawObjIdx++;
return;
}
@ -209,7 +201,7 @@ static void objCall(ModelData *arg0, HsfObject *arg1) {
}
static void objMesh(ModelData *arg0, HsfObject *arg1) {
HsfdrawStruct00 *temp_r29;
HsfDrawObject *temp_r29;
HsfConstData *temp_r25;
HsfTransform *var_r30;
HsfData *temp_r20;
@ -252,14 +244,14 @@ static void objMesh(ModelData *arg0, HsfObject *arg1) {
temp_r28->x = temp_r24->x * var_r30->scale.x;
temp_r28->y = temp_r24->y * var_r30->scale.y;
temp_r28->z = temp_r24->z * var_r30->scale.z;
temp_r29->unk3C = *temp_r28;
temp_r29->scale = *temp_r28;
if (arg1->flags & 1) {
PSMTXInverse(MTXBuf[MTXIdx], sp1C);
sp1C[0][3] = sp1C[1][3] = sp1C[2][3] = 0.0f;
PSMTXConcat(MTXBuf[MTXIdx], sp1C, temp_r29->unk0C);
mtxScaleCat(temp_r29->unk0C, temp_r28->x, temp_r28->y, temp_r28->z);
PSMTXConcat(MTXBuf[MTXIdx], sp1C, temp_r29->matrix);
mtxScaleCat(temp_r29->matrix, temp_r28->x, temp_r28->y, temp_r28->z);
} else {
PSMTXCopy(MTXBuf[MTXIdx], temp_r29->unk0C);
PSMTXCopy(MTXBuf[MTXIdx], temp_r29->matrix);
}
MTXIdx++;
var_r18 = 1;
@ -267,16 +259,16 @@ static void objMesh(ModelData *arg0, HsfObject *arg1) {
if (arg1->flags & 1) {
PSMTXInverse(MTXBuf[MTXIdx - 1], sp1C);
sp1C[0][3] = sp1C[1][3] = sp1C[2][3] = 0.0f;
PSMTXConcat(MTXBuf[MTXIdx - 1], sp1C, temp_r29->unk0C);
mtxScaleCat(temp_r29->unk0C, scaleBuf[MTXIdx - 1].x, scaleBuf[MTXIdx - 1].y, scaleBuf[MTXIdx - 1].z);
PSMTXConcat(MTXBuf[MTXIdx - 1], sp1C, temp_r29->matrix);
mtxScaleCat(temp_r29->matrix, scaleBuf[MTXIdx - 1].x, scaleBuf[MTXIdx - 1].y, scaleBuf[MTXIdx - 1].z);
} else {
PSMTXCopy(MTXBuf[MTXIdx - 1], temp_r29->unk0C);
PSMTXCopy(MTXBuf[MTXIdx - 1], temp_r29->matrix);
}
temp_r29->unk3C = scaleBuf[MTXIdx - 1];
temp_r29->scale = scaleBuf[MTXIdx - 1];
CancelTRXF = 0;
var_r18 = 0;
}
PSMTXCopy(temp_r29->unk0C, temp_r25->unk10);
PSMTXCopy(temp_r29->matrix, temp_r25->matrix);
if (temp_r25->hook != -1) {
temp_r31 = &Hu3DData[temp_r25->hook];
if (!(temp_r31->attr & 1)) {
@ -292,7 +284,7 @@ static void objMesh(ModelData *arg0, HsfObject *arg1) {
mtxRotCat(sp1C, temp_r31->rot.x, temp_r31->rot.y, temp_r31->rot.z);
mtxTransCat(sp1C, temp_r31->pos.x, temp_r31->pos.y, temp_r31->pos.z);
PSMTXConcat(sp1C, temp_r31->unk_F0, sp1C);
PSMTXConcat(temp_r29->unk0C, sp1C, MTXBuf[MTXIdx]);
PSMTXConcat(temp_r29->matrix, sp1C, MTXBuf[MTXIdx]);
temp_r28 = &scaleBuf[MTXIdx];
temp_r24 = temp_r28 - 1;
temp_r28->x = temp_r24->x * temp_r31->scale.x;
@ -306,7 +298,7 @@ static void objMesh(ModelData *arg0, HsfObject *arg1) {
}
} else {
if (arg0->attr & 0x4000) {
var_r19 = ObjCullCheck(arg0->hsfData, arg1, temp_r29->unk0C);
var_r19 = ObjCullCheck(arg0->hsfData, arg1, temp_r29->matrix);
} else {
var_r19 = 1;
}
@ -314,17 +306,17 @@ static void objMesh(ModelData *arg0, HsfObject *arg1) {
var_r19 = 0;
}
if (var_r19 != 0 && (var_r30->scale.x != 0.0f || var_r30->scale.y != 0.0f || var_r30->scale.z != 0.0f)) {
temp_r29->unk00 = arg0;
temp_r29->unk04 = arg1;
temp_r29->model = arg0;
temp_r29->object = arg1;
if ((temp_r25->flags & 0x10801) && shadowModelDrawF == 0) {
sp10.x = temp_r29->unk0C[0][3];
sp10.y = temp_r29->unk0C[1][3];
sp10.z = temp_r29->unk0C[2][3];
sp10.x = temp_r29->matrix[0][3];
sp10.y = temp_r29->matrix[1][3];
sp10.z = temp_r29->matrix[2][3];
temp_f31 = PSVECMag(&sp10);
if (temp_r25->flags & 0x10000) {
temp_r29->unk08 = -(900000.0f - temp_f31);
temp_r29->z = -(900000.0f - temp_f31);
} else {
temp_r29->unk08 = -(1000000.0f - temp_f31);
temp_r29->z = -(1000000.0f - temp_f31);
}
DrawObjIdx++;
if (DrawObjIdx > 0x200) {
@ -332,7 +324,7 @@ static void objMesh(ModelData *arg0, HsfObject *arg1) {
DrawObjIdx--;
}
} else if (arg0->attr & 0x400000) {
temp_r29->unk08 = -1000000.0f;
temp_r29->z = -1000000.0f;
DrawObjIdx++;
if (DrawObjIdx > 0x200) {
OSReport("Error: DrawObjIdx Over\n");
@ -418,7 +410,7 @@ s32 ObjCullCheck(HsfData *arg0, HsfObject *arg1, Mtx arg2) {
}
// TODO: not matching (https://decomp.me/scratch/54Pjw)
static void FaceDraw(HsfdrawStruct00 *arg0, HsfFace *arg1) {
static void FaceDraw(HsfDrawObject *arg0, HsfFace *arg1) {
GXColor sp2C;
void *sp28;
Hu3DTexAnimDataStruct *sp24;
@ -438,8 +430,8 @@ static void FaceDraw(HsfdrawStruct00 *arg0, HsfFace *arg1) {
ModelData *temp_r29;
HsfdrawStruct01 *temp_r23;
temp_r28 = arg0->unk04;
temp_r29 = arg0->unk00;
temp_r28 = arg0->object;
temp_r29 = arg0->model;
temp_r20 = temp_r28->constData;
kColorIdx = 0;
temp_r30 = &temp_r28->data.material[arg1->mat & 0xFFF];
@ -554,7 +546,7 @@ static void FaceDraw(HsfdrawStruct00 *arg0, HsfFace *arg1) {
hiliteMapNo = 3;
}
if ((temp_r29->attr & 0x20000) || (temp_r19 & 0x100)) {
if (temp_r20->hilite_map == 0) {
if (temp_r20->hiliteMap == 0) {
if (temp_r30->flags != 0) {
var_r18 = (temp_r30->pass >> 4) & 0xF;
} else {
@ -562,14 +554,14 @@ static void FaceDraw(HsfdrawStruct00 *arg0, HsfFace *arg1) {
}
HuSprTexLoad(hiliteAnim[var_r18], 0, hiliteMapNo, GX_CLAMP, GX_CLAMP, GX_LINEAR);
} else {
HuSprTexLoad(temp_r20->hilite_map, 0, hiliteMapNo, GX_CLAMP, GX_CLAMP, GX_LINEAR);
HuSprTexLoad(temp_r20->hiliteMap, 0, hiliteMapNo, GX_CLAMP, GX_CLAMP, GX_LINEAR);
}
BmpPtrBak[hiliteMapNo] = (HsfAttribute*) -1;
}
SetTevStageNoTex(arg0, temp_r30);
} else {
var_r22 = (temp_r30->vtxMode == 5) ? 5 : 1;
if (DrawData[drawCnt].unk0C & 2) {
if (DrawData[drawCnt].flags & 2) {
var_r22 |= 2;
}
if (var_r22 != vtxModeBak) {
@ -610,7 +602,7 @@ static void FaceDraw(HsfdrawStruct00 *arg0, HsfFace *arg1) {
temp_r23 = temp_r26->unk04;
sp24 = &Hu3DTexAnimData[temp_r23->unk02];
if ((temp_r23->unk00 & 1) && !(sp24->unk00 & 4)) {
if (Hu3DAnimSet(arg0->unk00, temp_r26, (s16) var_r31) != 0) {
if (Hu3DAnimSet(arg0->model, temp_r26, (s16) var_r31) != 0) {
BmpPtrBak[var_r31] = (HsfAttribute*) -1;
totalTexCnt++;
continue;
@ -618,10 +610,10 @@ static void FaceDraw(HsfdrawStruct00 *arg0, HsfFace *arg1) {
} else if (temp_r23->unk00 & 8) {
temp_r27 = temp_r23->unk3C;
if (temp_r27->dataFmt != 0xB) {
LoadTexture(arg0->unk00, temp_r27, temp_r26, (s16) var_r31);
LoadTexture(arg0->model, temp_r27, temp_r26, (s16) var_r31);
} else {
LoadTexture(arg0->unk00, temp_r23->unk3C, temp_r26, (s16) var_r31);
LoadTexture(arg0->unk00, temp_r23->unk3C, temp_r26, var_r21 | 0x8000);
LoadTexture(arg0->model, temp_r23->unk3C, temp_r26, (s16) var_r31);
LoadTexture(arg0->model, temp_r23->unk3C, temp_r26, var_r21 | 0x8000);
texCol[var_r31].r = (s16) var_r21;
texCol[var_r31].a = 2;
var_r21++;
@ -646,10 +638,10 @@ static void FaceDraw(HsfdrawStruct00 *arg0, HsfFace *arg1) {
} else {
texCol[var_r31].a = 0;
if (temp_r27->dataFmt != 0xB) {
LoadTexture(arg0->unk00, temp_r27, temp_r26, (s16) var_r31);
LoadTexture(arg0->model, temp_r27, temp_r26, (s16) var_r31);
} else {
LoadTexture(arg0->unk00, temp_r27, temp_r26, (s16) var_r31);
LoadTexture(arg0->unk00, temp_r27, temp_r26, var_r21 | 0x8000);
LoadTexture(arg0->model, temp_r27, temp_r26, (s16) var_r31);
LoadTexture(arg0->model, temp_r27, temp_r26, var_r21 | 0x8000);
texCol[var_r31].r = (s16) var_r21;
texCol[var_r31].a = 2;
var_r21++;
@ -706,7 +698,7 @@ static void FaceDraw(HsfdrawStruct00 *arg0, HsfFace *arg1) {
hiliteMapNo = projectionMapNo;
}
if ((temp_r29->attr & 0x20000) || (temp_r19 & 0x100)) {
if (temp_r20->hilite_map == 0) {
if (temp_r20->hiliteMap == 0) {
if (temp_r30->flags != 0) {
var_r18 = (temp_r30->pass >> 4) & 0xF;
} else {
@ -714,22 +706,22 @@ static void FaceDraw(HsfdrawStruct00 *arg0, HsfFace *arg1) {
}
HuSprTexLoad(hiliteAnim[var_r18], 0, hiliteMapNo, GX_CLAMP, GX_CLAMP, GX_LINEAR);
} else {
HuSprTexLoad(temp_r20->hilite_map, 0, hiliteMapNo, GX_CLAMP, GX_CLAMP, GX_LINEAR);
HuSprTexLoad(temp_r20->hiliteMap, 0, hiliteMapNo, GX_CLAMP, GX_CLAMP, GX_LINEAR);
}
BmpPtrBak[toonMapNo] = (HsfAttribute*) -1;
}
SetTevStageTex(arg0, temp_r30);
}
sp28 = (u8*) DLBufStartP + DrawData[drawCnt].unk00;
GXCallDisplayList(sp28, DrawData[drawCnt].unk04);
sp28 = (u8*) DLBufStartP + DrawData[drawCnt].dlOfs;
GXCallDisplayList(sp28, DrawData[drawCnt].dlSize);
} else {
sp28 = (u8*) DLBufStartP + DrawData[drawCnt].unk00;
GXCallDisplayList(sp28, DrawData[drawCnt].unk04);
sp28 = (u8*) DLBufStartP + DrawData[drawCnt].dlOfs;
GXCallDisplayList(sp28, DrawData[drawCnt].dlSize);
}
drawCnt++;
}
static void SetTevStageNoTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1) {
static void SetTevStageNoTex(HsfDrawObject *arg0, HsfMaterial *arg1) {
GXColor sp1C;
ModelData *temp_r28;
HsfObject *var_r21;
@ -750,8 +742,8 @@ static void SetTevStageNoTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1) {
var_r30 = 1;
var_r29 = 0;
var_r21 = arg0->unk04;
temp_r28 = arg0->unk00;
var_r21 = arg0->object;
temp_r28 = arg0->model;
sp18 = var_r21->flags | arg1->flags;
if (arg1->vtxMode == 2 || arg1->vtxMode == 3) {
var_r26 = 1;
@ -859,7 +851,7 @@ static void SetTevStageNoTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1) {
} else {
var_f30 = 0.0f;
}
lightBit = Hu3DLightSet(arg0->unk00, &Hu3DCameraMtx, &Hu3DCameraMtxXPose, var_f30);
lightBit = Hu3DLightSet(arg0->model, &Hu3DCameraMtx, &Hu3DCameraMtxXPose, var_f30);
}
if (var_r26 != 0) {
GXSetNumChans(2);
@ -902,11 +894,7 @@ static Mtx refMtx = {
{ 0.0f, 0.0f, 0.25f, -0.5f }
};
static inline void SetTevStageTexInlineFunc(u16 arg0, u32 arg1) {
GXSetTexCoordGen2(arg0, GX_TG_MTX2x4, GX_TG_TEX0, arg1, GX_FALSE, GX_PTIDENTITY);
}
static void SetTevStageTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1) {
static void SetTevStageTex(HsfDrawObject *arg0, HsfMaterial *arg1) {
GXColor sp50;
GXTexMapID sp4C;
GXTevStageID sp48;
@ -934,8 +922,8 @@ static void SetTevStageTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1) {
sp8 = 0;
var_r20 = -1;
temp_r19 = arg0->unk04;
temp_r25 = arg0->unk00;
temp_r19 = arg0->object;
temp_r25 = arg0->model;
sp40 = temp_r19->flags | arg1->flags;
if (arg1->vtxMode == 2 || arg1->vtxMode == 3) {
var_r21 = 1;
@ -963,11 +951,11 @@ static void SetTevStageTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1) {
PSMTXScale(sp54, 1.0f / temp_r29->unk28, 1.0f / temp_r29->unk2C, 1.0f);
mtxTransCat(sp54, -temp_r29->unk30, -temp_r29->unk34, 0.0f);
GXLoadTexMtxImm(sp54, texMtxTbl[var_r30], GX_MTX2x4);
SetTevStageTexInlineFunc(GX_TEXCOORD0, texMtxTbl[var_r30]);
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, texMtxTbl[var_r30]);
} else if (temp_r29->unk30 != 0.0f || temp_r29->unk34 != 0.0f) {
PSMTXTrans(sp54, -temp_r29->unk30, -temp_r29->unk34, 0.0f);
GXLoadTexMtxImm(sp54, texMtxTbl[var_r30], GX_MTX2x4);
SetTevStageTexInlineFunc(GX_TEXCOORD0, texMtxTbl[var_r30]);
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, texMtxTbl[var_r30]);
} else {
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY);
}
@ -1152,7 +1140,7 @@ static void SetTevStageTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1) {
temp_r28 = temp_r29->unk04;
if (temp_r28->unk00 & 2) {
GXLoadTexMtxImm(Hu3DTexScrData[temp_r28->unk04].unk3C, texMtxTbl[var_r30], GX_MTX2x4);
SetTevStageTexInlineFunc(var_r30, texMtxTbl[var_r30]);
GXSetTexCoordGen(var_r30, GX_TG_MTX2x4, GX_TG_TEX0, texMtxTbl[var_r30]);
temp_r23 = (u16) var_r30;
var_r30++;
} else if (temp_r28->unk00 & 4) {
@ -1160,14 +1148,14 @@ static void SetTevStageTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1) {
mtxRotCat(sp54, temp_r28->unk14, temp_r28->unk18, temp_r28->unk1C);
mtxTransCat(sp54, -temp_r28->unk08, -temp_r28->unk0C, -temp_r28->unk10);
GXLoadTexMtxImm(sp54, texMtxTbl[var_r30], GX_MTX2x4);
SetTevStageTexInlineFunc(var_r30, texMtxTbl[var_r30]);
GXSetTexCoordGen(var_r30, GX_TG_MTX2x4, GX_TG_TEX0, texMtxTbl[var_r30]);
temp_r23 = (u16) var_r30;
var_r30++;
} else if (temp_r28->unk00 & 1) {
PSMTXScale(sp54, temp_r28->unk2C, temp_r28->unk30, 1.0f);
mtxTransCat(sp54, temp_r28->unk34, temp_r28->unk38, 0.0f);
GXLoadTexMtxImm(sp54, texMtxTbl[var_r30], GX_MTX2x4);
SetTevStageTexInlineFunc(var_r30, texMtxTbl[var_r30]);
GXSetTexCoordGen(var_r30, GX_TG_MTX2x4, GX_TG_TEX0, texMtxTbl[var_r30]);
temp_r23 = (u16) var_r30;
var_r30++;
} else {
@ -1180,11 +1168,11 @@ static void SetTevStageTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1) {
PSMTXScale(sp54, 1.0f / temp_r29->unk28, 1.0f / temp_r29->unk2C, 1.0f);
mtxTransCat(sp54, -temp_r29->unk30, -temp_r29->unk34, 0.0f);
GXLoadTexMtxImm(sp54, texMtxTbl[var_r30], GX_MTX2x4);
SetTevStageTexInlineFunc(var_r30, texMtxTbl[var_r30]);
GXSetTexCoordGen(var_r30, GX_TG_MTX2x4, GX_TG_TEX0, texMtxTbl[var_r30]);
} else if (temp_r29->unk30 != 0.0f || temp_r29->unk34 != 0.0f) {
PSMTXTrans(sp54, -temp_r29->unk30, -temp_r29->unk34, 0.0f);
GXLoadTexMtxImm(sp54, texMtxTbl[var_r30], GX_MTX2x4);
SetTevStageTexInlineFunc(var_r30, texMtxTbl[var_r30]);
GXSetTexCoordGen(var_r30, GX_TG_MTX2x4, GX_TG_TEX0, texMtxTbl[var_r30]);
} else {
GXSetTexCoordGen2(var_r30, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY);
}
@ -1323,8 +1311,8 @@ static void SetTevStageTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1) {
GXSetTevAlphaIn(var_r31, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV);
GXSetTevAlphaOp(var_r31, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_FALSE, GX_TEVPREV);
}
PSMTXScale(sp54, 1.0f / arg0->unk3C.x, 1.0f / arg0->unk3C.y, 1.0f / arg0->unk3C.z);
PSMTXConcat(arg0->unk0C, sp54, sp54);
PSMTXScale(sp54, 1.0f / arg0->scale.x, 1.0f / arg0->scale.y, 1.0f / arg0->scale.z);
PSMTXConcat(arg0->matrix, sp54, sp54);
sp54[0][3] = sp54[1][3] = sp54[2][3] = 0.0f;
PSMTXConcat(sp54, Hu3DCameraMtxXPose, sp54);
PSMTXConcat(refMtx, sp54, sp54);
@ -1423,7 +1411,7 @@ static void SetTevStageTex(HsfdrawStruct00 *arg0, HsfMaterial *arg1) {
} else {
var_f30 = 0.0f;
}
lightBit = Hu3DLightSet(arg0->unk00, &Hu3DCameraMtx, &Hu3DCameraMtxXPose, var_f30);
lightBit = Hu3DLightSet(arg0->model, &Hu3DCameraMtx, &Hu3DCameraMtxXPose, var_f30);
}
if (var_r21 != 0) {
GXSetNumChans(2);
@ -1545,7 +1533,7 @@ static void FlushKColor(void) {
}
}
static void SetReflect(HsfdrawStruct00 *arg0, s16 arg1, s16 arg2, u8 arg3) {
static void SetReflect(HsfDrawObject *arg0, s16 arg1, s16 arg2, u8 arg3) {
GXTevKColorSel var_r27;
Mtx sp3C;
Mtx spC;
@ -1576,15 +1564,15 @@ static void SetReflect(HsfdrawStruct00 *arg0, s16 arg1, s16 arg2, u8 arg3) {
GXSetTevColorOp(arg1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
GXSetTevAlphaIn(arg1, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV);
GXSetTevAlphaOp(arg1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_FALSE, GX_TEVPREV);
PSMTXScale(sp3C, 1.0f / arg0->unk3C.x, 1.0f / arg0->unk3C.y, 1.0f / arg0->unk3C.z);
PSMTXConcat(arg0->unk0C, sp3C, spC);
PSMTXScale(sp3C, 1.0f / arg0->scale.x, 1.0f / arg0->scale.y, 1.0f / arg0->scale.z);
PSMTXConcat(arg0->matrix, sp3C, spC);
spC[0][3] = spC[1][3] = spC[2][3] = 0.0f;
PSMTXConcat(spC, Hu3DCameraMtxXPose, sp3C);
PSMTXConcat(refMtx, sp3C, spC);
GXLoadTexMtxImm(spC, GX_TEXMTX8, GX_MTX2x4);
}
static void SetProjection(HsfdrawStruct00 *arg0, s16 arg1, s16 arg2, s16 arg3, GXTexMapID arg4, u32 arg5) {
static void SetProjection(HsfDrawObject *arg0, s16 arg1, s16 arg2, s16 arg3, GXTexMapID arg4, u32 arg5) {
GXTevKColorSel var_r26;
u8 temp_r30;
@ -1631,7 +1619,7 @@ static void SetShadowTex(void) {
GXLoadTexObj(&sp8, shadowMapNo);
}
static void SetShadow(HsfdrawStruct00 *arg0, s16 arg1, s16 arg2) {
static void SetShadow(HsfDrawObject *arg0, s16 arg1, s16 arg2) {
GXSetTexCoordGen2(arg2, GX_TG_MTX3x4, GX_TG_POS, GX_TEXMTX9, GX_FALSE, GX_PTIDENTITY);
GXSetTevOrder(arg1, arg2, shadowMapNo, GX_COLOR0A0);
GXSetTevColorIn(arg1, GX_CC_CPREV, GX_CC_ZERO, GX_CC_TEXC, GX_CC_ZERO);
@ -1640,7 +1628,7 @@ static void SetShadow(HsfdrawStruct00 *arg0, s16 arg1, s16 arg2) {
GXSetTevAlphaOp(arg1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_FALSE, GX_TEVPREV);
}
static void FaceDrawShadow(HsfdrawStruct00 *arg0, HsfFace *arg1) {
static void FaceDrawShadow(HsfDrawObject *arg0, HsfFace *arg1) {
HsfObject *temp_r31;
ModelData *temp_r28;
HsfConstData *temp_r27;
@ -1649,8 +1637,8 @@ static void FaceDrawShadow(HsfdrawStruct00 *arg0, HsfFace *arg1) {
GXColor spC;
s16 var_r30;
temp_r31 = arg0->unk04;
temp_r28 = arg0->unk00;
temp_r31 = arg0->object;
temp_r28 = arg0->model;
temp_r27 = temp_r31->constData;
temp_r29 = &temp_r31->data.material[arg1->mat & 0xFFF];
if (temp_r29 != materialBak) {
@ -1694,7 +1682,7 @@ static void FaceDrawShadow(HsfdrawStruct00 *arg0, HsfFace *arg1) {
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
} else {
var_r30 = (temp_r29->vtxMode == 5) ? 5 : 1;
if (DrawData[drawCnt].unk0C & 2) {
if (DrawData[drawCnt].flags & 2) {
var_r30 |= 2;
}
if (var_r30 != vtxModeBak) {
@ -1736,15 +1724,15 @@ static void FaceDrawShadow(HsfdrawStruct00 *arg0, HsfFace *arg1) {
}
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE);
GXSetChanCtrl(GX_COLOR1A1, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE);
var_r26 = (u8*) DLBufStartP + DrawData[drawCnt].unk00;
GXCallDisplayList(var_r26, DrawData[drawCnt].unk04);
var_r26 = (u8*) DLBufStartP + DrawData[drawCnt].dlOfs;
GXCallDisplayList(var_r26, DrawData[drawCnt].dlSize);
} else {
if (!(temp_r27->flags & 0x400)) {
drawCnt++;
return;
}
var_r26 = (u8*) DLBufStartP + DrawData[drawCnt].unk00;
GXCallDisplayList(var_r26, DrawData[drawCnt].unk04);
var_r26 = (u8*) DLBufStartP + DrawData[drawCnt].dlOfs;
GXCallDisplayList(var_r26, DrawData[drawCnt].dlSize);
}
drawCnt++;
}
@ -2053,7 +2041,7 @@ void Hu3DDrawPost(void) {
s16 spA;
s16 sp8;
HsfBuffer *temp_r24;
HsfdrawStruct00 *temp_r28;
HsfDrawObject *temp_r28;
s16 var_r21;
s16 var_r20;
s16 var_r19;
@ -2089,10 +2077,10 @@ void Hu3DDrawPost(void) {
while ((var_r25 /= 3) >= 1) {
for (i = var_r25; i < DrawObjIdx; i++) {
var_r20 = DrawObjNum[i];
temp_f29 = DrawObjData[DrawObjNum[i]].unk08;
temp_f29 = DrawObjData[DrawObjNum[i]].z;
var_r26 = i - var_r25;
while (var_r26 >= 0) {
if (DrawObjData[DrawObjNum[var_r26]].unk08 < temp_f29) {
if (DrawObjData[DrawObjNum[var_r26]].z < temp_f29) {
DrawObjNum[var_r26 + var_r25] = DrawObjNum[var_r26];
var_r26 -= var_r25;
} else {
@ -2104,7 +2092,7 @@ void Hu3DDrawPost(void) {
}
for (i = 0; i < DrawObjIdx - 1; i++) {
for (var_r26 = i + 1; var_r26 < DrawObjIdx; var_r26++) {
if (DrawObjData[DrawObjNum[i]].unk08 != DrawObjData[DrawObjNum[var_r26]].unk08) {
if (DrawObjData[DrawObjNum[i]].z != DrawObjData[DrawObjNum[var_r26]].z) {
break;
}
if (DrawObjNum[var_r26] < DrawObjNum[i]) {
@ -2124,24 +2112,24 @@ void Hu3DDrawPost(void) {
GXSetCullMode(GX_CULL_BACK);
for (var_r23 = 0; var_r23 < DrawObjIdx; var_r23++) {
temp_r28 = &DrawObjData[DrawObjNum[var_r23]];
if (temp_r28->unk00->attr & 0x10) {
sp28 = (void*) temp_r28->unk00->hsfData;
sp28(temp_r28->unk00, temp_r28->unk0C);
if (temp_r28->model->attr & 0x10) {
sp28 = (void*) temp_r28->model->hsfData;
sp28(temp_r28->model, temp_r28->matrix);
for (i = 0; i < 8; i++) {
BmpPtrBak[i] = (HsfAttribute*) -1;
}
materialBak = (HsfMaterial*) -1;
Hu3DCameraSet(Hu3DCameraNo, Hu3DCameraMtx);
} else {
Hu3DObjInfoP = temp_r28->unk04->constData;
DLBufStartP = Hu3DObjInfoP->unk0C;
DrawData = Hu3DObjInfoP->unk08;
GXLoadPosMtxImm(temp_r28->unk0C, GX_PNMTX0);
PSMTXInvXpose(temp_r28->unk0C, sp120);
Hu3DObjInfoP = temp_r28->object->constData;
DLBufStartP = Hu3DObjInfoP->dlBuf;
DrawData = Hu3DObjInfoP->drawData;
GXLoadPosMtxImm(temp_r28->matrix, GX_PNMTX0);
PSMTXInvXpose(temp_r28->matrix, sp120);
GXLoadNrmMtxImm(sp120, 0);
if (Hu3DShadowF != 0 && Hu3DShadowCamBit != 0 && (Hu3DObjInfoP->flags & 8)) {
PSMTXInverse(Hu3DCameraMtx, spF0);
PSMTXConcat(spF0, temp_r28->unk0C, sp120);
PSMTXConcat(spF0, temp_r28->matrix, sp120);
PSMTXConcat(Hu3DShadowData.unk_68, Hu3DShadowData.unk_38, sp150);
PSMTXConcat(sp150, sp120, sp120);
GXLoadTexMtxImm(sp120, GX_TEXMTX9, GX_MTX3x4);
@ -2149,22 +2137,22 @@ void Hu3DDrawPost(void) {
} else {
var_r19 = 0;
}
if (temp_r28->unk00->unk_02 != 0) {
if (temp_r28->model->unk_02 != 0) {
if (var_r19 == 0) {
PSMTXInverse(Hu3DCameraMtx, spF0);
}
for (i = 0, var_r21 = 1; i < 4; i++, var_r21 <<= 1) {
if (var_r21 & temp_r28->unk00->unk_02) {
PSMTXConcat(spF0, temp_r28->unk0C, sp120);
if (var_r21 & temp_r28->model->unk_02) {
PSMTXConcat(spF0, temp_r28->matrix, sp120);
PSMTXConcat(Hu3DProjection[i].unk_68, Hu3DProjection[i].unk_38, sp150);
PSMTXConcat(sp150, sp120, sp120);
GXLoadTexMtxImm(sp120, texMtxTbl[i + 3], GX_MTX3x4);
}
}
}
if ((temp_r28->unk00->attr & 0x20000) || (Hu3DObjInfoP->flags & 0x8000)) {
if ((temp_r28->model->attr & 0x20000) || (Hu3DObjInfoP->flags & 0x8000)) {
sp54 = lbl_8011DD20;
temp_r22 = &Hu3DGlobalLight[temp_r28->unk00->unk_03];
temp_r22 = &Hu3DGlobalLight[temp_r28->model->unk_03];
sp30 = temp_r22->unk_28;
if (temp_r22->unk_00 & 0x8000) {
PSMTXMultVecSR(Hu3DCameraMtx, &sp30, &sp30);
@ -2179,8 +2167,8 @@ void Hu3DDrawPost(void) {
sp3C.x = -sp3C.x;
sp3C.y = -sp3C.y;
sp3C.z = -sp3C.z;
PSMTXScale(sp60, 1.0f / temp_r28->unk3C.x, 1.0f / temp_r28->unk3C.y, 1.0f / temp_r28->unk3C.z);
PSMTXConcat(temp_r28->unk0C, sp60, spC0);
PSMTXScale(sp60, 1.0f / temp_r28->scale.x, 1.0f / temp_r28->scale.y, 1.0f / temp_r28->scale.z);
PSMTXConcat(temp_r28->matrix, sp60, spC0);
spC0[0][3] = spC0[1][3] = spC0[2][3] = 0.0f;
PSMTXInvXpose(spC0, sp90);
if (sp8 == 10000) {
@ -2198,7 +2186,7 @@ void Hu3DDrawPost(void) {
PSMTXConcat(spC0, sp60, hiliteMtx);
}
}
temp_r24 = temp_r28->unk04->data.face;
temp_r24 = temp_r28->object->data.face;
var_r27 = temp_r24->data;
drawCnt = 0;
shadingBak = -1;
@ -2208,13 +2196,13 @@ void Hu3DDrawPost(void) {
for (i = 0; i < temp_r24->count;) {
FaceDraw(temp_r28, var_r27);
if (var_r27->type == 4) {
totalPolyCnt += DrawData[drawCnt - 1].unk08;
totalPolyCnt += DrawData[drawCnt - 1].polyCnt;
i++;
var_r27++;
} else {
totalPolyCnt += DrawData[drawCnt - 1].unk08 * ((var_r27->type & 7) == 3 ? 2 : 1);
i += DrawData[drawCnt - 1].unk08;
var_r27 += DrawData[drawCnt - 1].unk08;
totalPolyCnt += DrawData[drawCnt - 1].polyCnt * ((var_r27->type & 7) == 3 ? 2 : 1);
i += DrawData[drawCnt - 1].polyCnt;
var_r27 += DrawData[drawCnt - 1].polyCnt;
}
}
} else {
@ -2230,8 +2218,8 @@ void Hu3DDrawPost(void) {
i++;
var_r27++;
} else {
i += DrawData[drawCnt - 1].unk08;
var_r27 += DrawData[drawCnt - 1].unk08;
i += DrawData[drawCnt - 1].polyCnt;
var_r27 += DrawData[drawCnt - 1].polyCnt;
}
}
}
@ -2247,7 +2235,7 @@ void Hu3DDrawPost(void) {
(void)var_r19; // required to match
}
static void ObjDraw(HsfdrawStruct00 *arg0) {
static void ObjDraw(HsfDrawObject *arg0) {
Vec sp44;
Vec sp38;
Vec sp2C;
@ -2265,7 +2253,7 @@ static void ObjDraw(HsfdrawStruct00 *arg0) {
float temp_f27;
float temp_f26;
LightData *temp_r24;
DrawDataStruct *temp_r25;
HsfDrawData *temp_r25;
HsfFace *var_r27;
Mtx sp140;
Mtx sp110;
@ -2274,16 +2262,16 @@ static void ObjDraw(HsfdrawStruct00 *arg0) {
Mtx sp80;
Mtx sp50;
Hu3DObjInfoP = arg0->unk04->constData;
DLBufStartP = Hu3DObjInfoP->unk0C;
DrawData = Hu3DObjInfoP->unk08;
GXLoadPosMtxImm(arg0->unk0C, GX_PNMTX0);
PSMTXInvXpose(arg0->unk0C, sp110);
Hu3DObjInfoP = arg0->object->constData;
DLBufStartP = Hu3DObjInfoP->dlBuf;
DrawData = Hu3DObjInfoP->drawData;
GXLoadPosMtxImm(arg0->matrix, GX_PNMTX0);
PSMTXInvXpose(arg0->matrix, sp110);
GXLoadNrmMtxImm(sp110, 0);
GXInvalidateVtxCache();
if (Hu3DShadowF != 0 && Hu3DShadowCamBit != 0 && (Hu3DObjInfoP->flags & 8)) {
PSMTXInverse(Hu3DCameraMtx, spE0);
PSMTXConcat(spE0, arg0->unk0C, sp110);
PSMTXConcat(spE0, arg0->matrix, sp110);
PSMTXConcat(Hu3DShadowData.unk_68, Hu3DShadowData.unk_38, sp140);
PSMTXConcat(sp140, sp110, sp110);
GXLoadTexMtxImm(sp110, GX_TEXMTX9, GX_MTX3x4);
@ -2291,22 +2279,22 @@ static void ObjDraw(HsfdrawStruct00 *arg0) {
} else {
var_r22 = 0;
}
if (arg0->unk00->unk_02 != 0) {
if (arg0->model->unk_02 != 0) {
if (var_r22 == 0) {
PSMTXInverse(Hu3DCameraMtx, spE0);
}
for (i = 0, var_r23 = 1; i < 4; i++, var_r23 <<= 1) {
if (var_r23 & arg0->unk00->unk_02) {
PSMTXConcat(spE0, arg0->unk0C, sp110);
if (var_r23 & arg0->model->unk_02) {
PSMTXConcat(spE0, arg0->matrix, sp110);
PSMTXConcat(Hu3DProjection[i].unk_68, Hu3DProjection[i].unk_38, sp140);
PSMTXConcat(sp140, sp110, sp110);
GXLoadTexMtxImm(sp110, texMtxTbl[i + 3], GX_MTX3x4);
}
}
}
if ((arg0->unk00->attr & 0x20000) || (Hu3DObjInfoP->flags & 0x8000)) {
if ((arg0->model->attr & 0x20000) || (Hu3DObjInfoP->flags & 0x8000)) {
sp44 = lbl_8011DD20;
temp_r24 = &Hu3DGlobalLight[arg0->unk00->unk_03];
temp_r24 = &Hu3DGlobalLight[arg0->model->unk_03];
sp20 = temp_r24->unk_28;
if (temp_r24->unk_00 & 0x8000) {
PSMTXMultVecSR(Hu3DCameraMtx, &sp20, &sp20);
@ -2321,8 +2309,8 @@ static void ObjDraw(HsfdrawStruct00 *arg0) {
sp2C.x = -sp2C.x;
sp2C.y = -sp2C.y;
sp2C.z = -sp2C.z;
PSMTXScale(sp50, 1.0f / arg0->unk3C.x, 1.0f / arg0->unk3C.y, 1.0f / arg0->unk3C.z);
PSMTXConcat(arg0->unk0C, sp50, spB0);
PSMTXScale(sp50, 1.0f / arg0->scale.x, 1.0f / arg0->scale.y, 1.0f / arg0->scale.z);
PSMTXConcat(arg0->matrix, sp50, spB0);
spB0[0][3] = spB0[1][3] = spB0[2][3] = 0.0f;
PSMTXInvXpose(spB0, sp80);
if (var_r21 == 10000) {
@ -2340,7 +2328,7 @@ static void ObjDraw(HsfdrawStruct00 *arg0) {
PSMTXConcat(spB0, sp50, hiliteMtx);
}
}
temp_r26 = arg0->unk04->data.face;
temp_r26 = arg0->object->data.face;
var_r27 = temp_r26->data;
drawCnt = 0;
shadingBak = -1;
@ -2350,7 +2338,7 @@ static void ObjDraw(HsfdrawStruct00 *arg0) {
for (i = 0; i < temp_r26->count;) {
FaceDraw(arg0, var_r27);
if (var_r27->type == 4) {
totalPolyCnt += DrawData[drawCnt - 1].unk08;
totalPolyCnt += DrawData[drawCnt - 1].polyCnt;
i++;
var_r27++;
} else {
@ -2360,9 +2348,9 @@ static void ObjDraw(HsfdrawStruct00 *arg0) {
} else {
var_r20 = 1;
}
totalPolyCnt += temp_r25->unk08 * var_r20;
i += temp_r25->unk08;
var_r27 += temp_r25->unk08;
totalPolyCnt += temp_r25->polyCnt * var_r20;
i += temp_r25->polyCnt;
var_r27 += temp_r25->polyCnt;
}
}
} else {
@ -2378,8 +2366,8 @@ static void ObjDraw(HsfdrawStruct00 *arg0) {
i++;
var_r27++;
} else {
i += DrawData[drawCnt - 1].unk08;
var_r27 += DrawData[drawCnt - 1].unk08;
i += DrawData[drawCnt - 1].polyCnt;
var_r27 += DrawData[drawCnt - 1].polyCnt;
}
}
}
@ -2446,8 +2434,8 @@ static void MDObjMesh(HsfData *arg0, HsfObject *arg1) {
}
DLTotalNum = (DLTotalNum + 0x40) & ~0x1F;
Hu3DObjInfoP = ObjConstantMake(arg1, mallocNo);
Hu3DObjInfoP->unk08 = DrawData = HuMemDirectMallocNum(HEAP_DATA, matChgCnt * sizeof(DrawDataStruct), mallocNo);
memset(DrawData, 0, matChgCnt * sizeof(DrawDataStruct));
Hu3DObjInfoP->drawData = DrawData = HuMemDirectMallocNum(HEAP_DATA, matChgCnt * sizeof(HsfDrawData), mallocNo);
memset(DrawData, 0, matChgCnt * sizeof(HsfDrawData));
DLBufP = DLBufStartP = HuMemDirectMallocNum(HEAP_DATA, DLTotalNum, mallocNo);
DCInvalidateRange(DLBufStartP, DLTotalNum);
DLFirstF = 0;
@ -2471,10 +2459,10 @@ static void MDObjMesh(HsfData *arg0, HsfObject *arg1) {
for (i = 0; i < temp_r29->count; i++, var_r28++) {
MDFaceDraw(arg1, var_r28);
}
Hu3DObjInfoP->unk0C = DLBufStartP;
Hu3DObjInfoP->dlBuf = DLBufStartP;
if (DLTotalNum < totalSize) {
OSReport("DLBuf Over >>>>>>>>>>>>>");
OSReport("%x:%x:%x\n", Hu3DObjInfoP->unk0C, totalSize, DLTotalNum);
OSReport("%x:%x:%x\n", Hu3DObjInfoP->dlBuf, totalSize, DLTotalNum);
}
for (i = 0; i < arg1->data.childrenCount; i++) {
MDObjCall(arg0, arg1->data.children[i]);
@ -2488,7 +2476,7 @@ HsfConstData *ObjConstantMake(HsfObject *arg0, u32 arg1) {
arg0->constData = temp_r3;
temp_r3->flags = 0;
temp_r3->hook = -1;
temp_r3->hilite_map = NULL;
temp_r3->hiliteMap = NULL;
return temp_r3;
}
@ -2507,7 +2495,7 @@ static void MDFaceDraw(HsfObject *arg0, HsfFace *arg1) {
if (temp_r30 != materialBak || polyTypeBak != (arg1->type & 7) || (arg1->type & 7) == 4) {
polyTypeBak = arg1->type & 7;
materialBak = temp_r30;
DrawData[drawCnt].unk00 = (u32) DLBufP - (u32) DLBufStartP;
DrawData[drawCnt].dlOfs = (u32) DLBufP - (u32) DLBufStartP;
GXBeginDisplayList(DLBufP, 0x20000);
GXResetWriteGatherPipe();
if (temp_r30->numAttrs == 0) {
@ -2517,7 +2505,7 @@ static void MDFaceDraw(HsfObject *arg0, HsfFace *arg1) {
for (var_r27 = 0; var_r27 < temp_r30->numAttrs; var_r27++) {
if (arg0->data.attribute[temp_r30->attrs[var_r27]].unk14 != 0.0) {
Hu3DObjInfoP->flags |= 2;
DrawData[drawCnt].unk0C |= 2;
DrawData[drawCnt].flags |= 2;
var_r26 = var_r27;
}
}
@ -2748,8 +2736,8 @@ static void MDFaceDraw(HsfObject *arg0, HsfFace *arg1) {
break;
}
temp_r3 = GXEndDisplayList();
DrawData[drawCnt].unk04 = temp_r3;
DrawData[drawCnt].unk08 = faceCnt;
DrawData[drawCnt].dlSize = temp_r3;
DrawData[drawCnt].polyCnt = faceCnt;
totalSize += temp_r3;
drawCnt++;
DLBufP = (u8*) DLBufP + temp_r3;
@ -3232,14 +3220,14 @@ void Hu3DModelObjDrawInit(void) {
}
void Hu3DModelObjDraw(s16 arg0, char *arg1, Mtx arg2) {
HsfdrawStruct00 sp14;
HsfDrawObject sp14;
HsfConstData *sp10;
HsfObject *temp_r3;
sp14.unk00 = &Hu3DData[arg0];
sp14.unk04 = temp_r3 = Hu3DModelObjPtrGet(arg0, arg1);
sp14.model = &Hu3DData[arg0];
sp14.object = temp_r3 = Hu3DModelObjPtrGet(arg0, arg1);
sp10 = temp_r3->constData;
PSMTXCopy(arg2, sp14.unk0C);
sp14.unk3C.x = sp14.unk3C.y = sp14.unk3C.z = 1.0f;
PSMTXCopy(arg2, sp14.matrix);
sp14.scale.x = sp14.scale.y = sp14.scale.z = 1.0f;
ObjDraw(&sp14);
}

View file

@ -824,7 +824,7 @@ void Hu3DModelHiliteMapSet(s16 arg0, AnimData *arg1) {
copy->flags |= 0x100;
temp_r25 = copy->constData;
temp_r25->flags |= 0x8000;
temp_r25->hilite_map = arg1;
temp_r25->hiliteMap = arg1;
}
}
}