Merge branch 'Rainchus:main' into main

This commit is contained in:
CreateSource 2024-06-05 09:32:18 -04:00 committed by GitHub
commit 41e92f7811
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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;
}
}