core1/gu/rotate.c done

This commit is contained in:
Banjo Kazooie
2022-10-26 15:00:50 -05:00
parent a6934f7205
commit 7ee1bdf312
25 changed files with 253 additions and 157 deletions

View File

@@ -590,37 +590,35 @@ void * func_80303800(f32 volume_p1[3], f32 volume_p2[3], f32 arg2[3], u32 arg3)
return NULL;
}
//BKCollisionTri *
#ifndef NONMATCHING
BKCollisionTri * func_80303960(f32 volume_p1[3], f32 volume_p2[3], f32 radius, f32 arg3[3], s32 arg4, u32 flags);
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80303960.s")
#else
BKCollisionTri * func_80303960(f32 volume_p1[3], f32 volume_p2[3], f32 radius, f32 arg3[3], s32 arg4, u32 flags) {
s32 cube_indx[3];
s32 min[3];
s32 max[3];
BKCollisionTri *temp_v0;
BKCollisionTri *var_s5;
Cube *cube;
var_s5 = NULL;
cube_volumeToIndices(min, max, volume_p1, volume_p2, radius + D_80381FA0.unk4);
if(cube_indx);
for(cube_indx[0] = min[0]; cube_indx[0] <= max[0]; cube_indx[0]++){
for(cube_indx[1] = min[1]; cube_indx[1] <= max[1]; cube_indx[1]++){
for(cube_indx[2] = min[2]; cube_indx[2] <= max[2]; cube_indx[2]++){
temp_v0 = func_80331638(cube_atIndices(cube_indx), volume_p1, volume_p2, radius, arg3, arg4, flags);
cube = cube_atIndices(cube_indx);
temp_v0 = func_80331638(cube, volume_p1, volume_p2, radius, arg3, arg4, flags);
if (temp_v0 != NULL) {
var_s5 = temp_v0;
}
}
}
}
temp_v0 = func_80331638(func_8030364C(), volume_p1, volume_p2, radius, arg3, arg4, flags);
cube = func_8030364C();
temp_v0 = func_80331638(cube, volume_p1, volume_p2, radius, arg3, arg4, flags);
if (temp_v0 != NULL) {
var_s5 = temp_v0;
}
return var_s5;
}
#endif
//BKCollisionTri *
BKCollisionTri * func_80303AF0(f32 position[3], f32 radius, f32 arg2[3], u32 arg3) {
@@ -1777,13 +1775,57 @@ s32 func_80307164(Struct_core2_7AF80_2 *arg0) {
return -1;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80307258.s")
s32 func_80307258(f32 arg0[3], s32 arg1, s32 arg2) {
f32 temp_f14;
f32 temp_f2;
Struct_core2_7AF80_2 * temp_a0;
Struct_core2_7AF80_2 *temp_a3;
Struct_core2_7AF80_2 *var_v1;
Struct_core2_7AF80_1 *temp_v0;
temp_v0 = &D_8036A9BC[arg1];
var_v1 = temp_v0->unk8 + arg2;
if (((arg0[0] - var_v1->unk0[0]) * (arg0[0] - var_v1->unk0[0])) + (((arg0[2] - var_v1->unk0[2]) * (arg0[2] - var_v1->unk0[2]))) < (var_v1->unkC * var_v1->unkC)) {
return arg2;
}
temp_a0 = temp_v0->unk8 + temp_v0->unk0;
for (var_v1 = temp_v0->unk8; var_v1 < temp_a0; var_v1++) {
temp_f2 = arg0[2] - var_v1->unk0[2];
temp_f14 = arg0[0] - var_v1->unk0[0];
if (((temp_f2 * temp_f2) + (temp_f14 * temp_f14)) < (var_v1->unkC * var_v1->unkC)) {
return var_v1 - temp_v0->unk8;
}
}
return -1;
}
bool func_80307390(s32 arg0, s32 arg1) {
return (D_8036A9BC + arg0)->unk8[arg1].unk10_0;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803073CC.s")
s32 func_803073CC(f32 arg0[3], s32 arg1, s32 arg2) {
f32 temp_f14;
f32 temp_f2;
Struct_core2_7AF80_2 * temp_a0;
Struct_core2_7AF80_2 *temp_a3;
Struct_core2_7AF80_2 *var_v1;
Struct_core2_7AF80_1 *temp_v0;
temp_v0 = &D_8036A9D4[arg1];
var_v1 = temp_v0->unk8 + arg2;
if (((arg0[0] - var_v1->unk0[0]) * (arg0[0] - var_v1->unk0[0])) + (((arg0[2] - var_v1->unk0[2]) * (arg0[2] - var_v1->unk0[2]))) < (var_v1->unkC * var_v1->unkC)) {
return arg2;
}
temp_a0 = temp_v0->unk8 + temp_v0->unk0;
for (var_v1 = temp_v0->unk8; var_v1 < temp_a0; var_v1++) {
temp_f2 = arg0[2] - var_v1->unk0[2];
temp_f14 = arg0[0] - var_v1->unk0[0];
if (((temp_f2 * temp_f2) + (temp_f14 * temp_f14)) < (var_v1->unkC * var_v1->unkC)) {
return var_v1 - temp_v0->unk8;
}
}
return -1;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80307504.s")
// s32 func_80307504(f32 arg0[3], s32 arg1, s32 arg2, s32 arg3, s32 arg4) {

View File

@@ -42,6 +42,7 @@ typedef union{
typedef bool( *Method_Core2_A5BC0)(NodeProp *, s32);
s32 func_80330974(ActorMarker *marker, s32 arg1, f32 arg2, s32 arg3);
s32 func_80320DB0(f32[3], f32, f32[3], u32);
extern void func_80320EB0(ActorMarker *, f32, s32);
extern void func_80320ED8(ActorMarker *, f32, s32);
@@ -51,13 +52,15 @@ void func_8032CD60(Prop *);
f32 func_8033A244(f32);
void func_8032F64C(f32 *pos, ActorMarker * marker);
/* .data */
extern s32 D_8036E7B0;
extern ModelCache *modelCache; //D_8036E7C0 //model pointer array pointer
extern u8 *D_8036E7C4;
extern ActorMarker *D_8036E7C8;
extern s16 D_8036E7E0[];
extern s16 D_8036E7FC[];
extern Struct6Cs D_8036E7D0; //= {NULL, NULL, NULL, func_80330974};
extern s16 D_8036E7E0[];//= {0x2D2, 0x2DD, 0x580, 0x6D1, 0x6D6, 0x6D7, 0x364, 0x2E8, 0x309, 0x30A, 0x704, 0x30D, 0x6C7, -1};
extern s16 D_8036E7FC[]; //={-1};
//extern s32 D_8036E800;
// extern u32 D_8036E804[8];
@@ -969,12 +972,8 @@ void func_8032F194(ActorMarker *marker, s32 position[3], Cube *cube) {
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_8032F21C.s")
#else
s32 func_8032F21C(Cube *cube, s32 position[3], ActorMarker *marker, bool arg3) {
void func_8032F21C(Cube *cube, s32 position[3], ActorMarker *marker, bool arg3) {
ActorProp *sp1C;
u8 temp_t0;
u8 temp_t2;
u8 temp_t6;
u8 temp_t8;
sp1C = func_8032D80C(cube);
sp1C->unk8_0 = TRUE;
@@ -982,8 +981,8 @@ s32 func_8032F21C(Cube *cube, s32 position[3], ActorMarker *marker, bool arg3) {
sp1C->y = (s16) position[1];
sp1C->z = (s16) position[2];
sp1C->marker = marker;
sp1C->unk8_15 = 0;
sp1C->unk8_1 = arg3;
sp1C->unk8_15 = 0;
sp1C->unk8_5 = FALSE;
sp1C->unk8_10 = (func_802E4A08(position)) ? 0xF : (u8)(randf() * 32);
@@ -1460,8 +1459,9 @@ s32 func_80330974(ActorMarker *marker, s32 arg1, f32 arg2, s32 arg3) {
return 0;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_80330B10.s")
Struct6Cs *func_80330B10(void){
return &D_8036E7D0;
}
//marker_loadModelBin
BKModelBin *func_80330B1C(ActorMarker *this){
@@ -1589,6 +1589,7 @@ s32 func_80330F94(NodeProp *arg0, s32 arg1[3]){
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_80330FC4.s")
void func_80330FCC(ActorMarker *marker, s32 arg1[3]){
arg1[0] = marker->propPtr->x;
arg1[1] = marker->propPtr->y;

View File

@@ -7,7 +7,7 @@
typedef s32 (*FuncUnk40)(ActorMarker *, s32, f32[3]);
typedef struct particle_struct_0_s{
typedef struct particle_struct_1_s{
f32 unk0[3];
f32 unkC[3];
u8 pad18[8];
@@ -24,6 +24,29 @@ typedef struct particle_struct_0_s{
u8 unk45;
u8 unk46;
u8 unk47;
} ParticleStruct1s;
typedef struct particle_struct_0_s{
f32 unk0;
f32 unk4;
f32 unk8;
f32 unkC;
f32 unk10;
f32 unk14;
u8 pad18[8];
s32 unk20;
s32 unk24;
s32 unk28;
u8 pad24[0x4];
ActorMarker *marker_30;
struct54s *unk34;
ActorMarker *unk38;
s32 unk3C;
FuncUnk40 unk40;
u8 unk44;
u8 unk45;
u8 unk46;
u8 unk47;
} ParticleStruct0s;
ActorMarker *func_8033E864(void);

View File

@@ -30,7 +30,7 @@ void func_803546E8(void) {
u8 sp4F;
struct54s* sp48;
u8 sp47;
ParticleStruct0s* temp_s0;
ParticleStruct1s* temp_s0;
f32 sp34[3];
f32 sp28[3];
@@ -64,7 +64,7 @@ void func_803546E8(void) {
}
void func_8035489C(void) {
ParticleStruct0s* temp_s0;
ParticleStruct1s* temp_s0;
u8 temp_v0;
f32 playerVelocity[3];
f32 playerPosition[3];
@@ -98,7 +98,7 @@ void func_80354998(void) {
ActorMarker *sp50;
struct54s *sp4C;
u8 sp4B;
ParticleStruct0s *temp_s0;
ParticleStruct1s *temp_s0;
f32 sp38[3];
f32 sp2C[3];
s32 sp28;
@@ -170,7 +170,7 @@ void func_80354998(void) {
}
void func_80354C18(void) {
ParticleStruct0s* temp_s0;
ParticleStruct1s* temp_s0;
s32 pad;
ActorMarker *sp4C;
u8 sp4B;
@@ -221,7 +221,7 @@ void func_80354C18(void) {
void func_80354DC8(void){}
void func_80354DD0(void) {
ParticleStruct0s* temp_s0;
ParticleStruct1s* temp_s0;
struct54s* sp40;
u8 sp3F;
u8 pad3C[3];
@@ -253,7 +253,7 @@ void func_80354DD0(void) {
}
void func_80354EEC(void) {
ParticleStruct0s* temp_s0;
ParticleStruct1s* temp_s0;
s32 pad;
ActorMarker *sp3C;
FuncUnk40 sp38;
@@ -293,7 +293,7 @@ void func_8035500C(void) {
u8 sp47;
struct54s* sp40;
u8 sp3F;
ParticleStruct0s* temp_s0;
ParticleStruct1s* temp_s0;
f32 sp2C[3];
f32 sp20[3];
@@ -322,7 +322,7 @@ void func_8035500C(void) {
}
void func_80355134(void) {
ParticleStruct0s* temp_s0;
ParticleStruct1s* temp_s0;
u8 temp_s1;
ActorMarker *sp3C;
FuncUnk40 sp38;
@@ -364,7 +364,7 @@ void func_8035529C(void) {
u8 sp4F;
struct54s* sp48;
u8 sp47;
ParticleStruct0s* sp40;
ParticleStruct1s* sp40;
f32 sp34[3];
f32 sp28[3];
@@ -393,7 +393,7 @@ void func_8035529C(void) {
}
void func_803553E8(void) {
ParticleStruct0s* temp_s0;
ParticleStruct1s* temp_s0;
u8 temp_s1;
ActorMarker *sp3C;
FuncUnk40 sp38;
@@ -436,7 +436,7 @@ void func_80355550(void) {
u8 sp3F;
struct54s *sp38;
u8 sp37;
ParticleStruct0s *sp30;
ParticleStruct1s *sp30;
f32 sp24[3];
f32 sp18[3];
@@ -474,7 +474,7 @@ void func_80355550(void) {
}
void func_8035570C(void) {
ParticleStruct0s* temp_s0;
ParticleStruct1s* temp_s0;
u8 temp_s1;
ActorMarker *sp3C;
FuncUnk40 sp38;
@@ -517,7 +517,7 @@ void func_80355864(void) {
static s32 D_803863E4;
f32 var_f2;
Actor *sp4C;
ParticleStruct0s *sp48;
ParticleStruct1s *sp48;
s32 sp44;
f32 sp38[3];
f32 sp2C[3];
@@ -559,7 +559,7 @@ void func_80355864(void) {
}
void func_80355B00(void) {
ParticleStruct0s *sp44;
ParticleStruct1s *sp44;
u8 sp43;
ActorMarker *pad40;
Actor *sp38;

View File

@@ -802,24 +802,17 @@ s32 gcpausemenu_getMaxPage(void){
return D_80383010.page_cnt;
}
#ifndef NONMATCHING
void gcpausemenu_getNextPage(s32);
#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/gcpausemenu_getNextPage.s")
#else
void gcpausemenu_getNextPage(s32 arg0) {
D_80383010.unk9 = D_80383010.selection;
do{
D_80383010.unk9 += arg0;
if((D_80383010.unk39 != 0) && (D_80383010.unk9 == 0xC))
break;
}
while(((D_80383010.unk39 == 0) || (D_80383010.unk9 != 0xC))
&& (D_80383010.unk9 != 0)
&& itemscore_timeScores_get(D_8036C58C[D_80383010.unk9].level_id) == 0
);
while( (D_80383010.unk9 != 0) && itemscore_timeScores_get(D_8036C58C[D_80383010.unk9].level_id) == 0);
gcPauseMenu_setState((D_80383010.unk9 == 0xC) ? 0xA : 0xC);
D_80383010.unk7 = 6;
}
#endif
void gcpausemenu_updateBButtonAndJoystickSprites(void) {
f32 temp_f12;