Fix fixed-point matrix type being used in floating-point matrix instances

This commit is contained in:
Mr-Wiseguy
2024-09-13 17:56:28 -04:00
parent b77274c9ea
commit 8d918e3505
18 changed files with 236 additions and 204 deletions

View File

@@ -7,7 +7,7 @@ typedef struct {
}ActorLocal_Core2_3ECE0;
void chBubble_update(Actor *this);
extern void func_802F32C4(s32, f32[3], f32, ActorMarker *, void(*)(f32[3], f32, ActorMarker *));
extern void func_802F32C4(s32, f32[3], f32, ActorMarker *, s32(*)(f32[3], f32, ActorMarker *));
/* .data */
ActorInfo chBubble = {
@@ -17,7 +17,7 @@ ActorInfo chBubble = {
};
/* .code */
int __chBubble_func_802C5C70(f32 arg0[3], f32 arg1, ActorMarker *marker){
s32 __chBubble_func_802C5C70(f32 arg0[3], f32 arg1, ActorMarker *marker){
s32 pad2C;
Actor *this = marker_getActor(marker);
ActorLocal_Core2_3ECE0 *local = (ActorLocal_Core2_3ECE0 *) &this->local;

View File

@@ -2,11 +2,14 @@
#include "functions.h"
#include "variables.h"
#include "animation.h"
#include "ml/mtx.h"
void *defrag(void *);
void animMtxList_setBoneless(AnimMtxList **this_ptr, BKAnimationList *anim_list){
AnimMtxList * this;
Mtx *end_ptr;
Mtx *i_ptr;
MtxF *end_ptr;
MtxF *i_ptr;
this = *this_ptr;
if(this->capacity_44 < anim_list->cnt_4){
@@ -16,14 +19,14 @@ void animMtxList_setBoneless(AnimMtxList **this_ptr, BKAnimationList *anim_list)
}
this->size_40 = anim_list->cnt_4;
end_ptr = (Mtx *)(this->size_40*sizeof(Mtx) + (s32)this +sizeof(AnimMtxList));
end_ptr = (MtxF *)(this->size_40*sizeof(MtxF) + (s32)this +sizeof(AnimMtxList));
mlMtxIdent();
for(i_ptr = this->data; i_ptr < end_ptr; i_ptr++){
mlMtxGet(i_ptr);
}
}
Mtx *animMtxList_get(AnimMtxList *this, s32 arg1){
MtxF *animMtxList_get(AnimMtxList *this, s32 arg1){
if (arg1 == -1){
return &this->mtx_0;
}
@@ -40,7 +43,7 @@ AnimMtxList *animMtxList_new(void){
this->size_40 = 0;
this->capacity_44 = 0;
mlMtxIdent();
mlMtxGet(this);
mlMtxGet(&this->mtx_0);
return this;
}
@@ -50,14 +53,13 @@ s32 animMtxList_len(AnimMtxList* this){
return 1;
}
void mlMtxSet(Mtx*);
void func_8033A5B8(s32, s32, f32[4],f32[3], f32[3]);
void func_8033A5B8(BoneTransformList *this, s32 bone_id, f32 arg2[4], f32 scale[3], f32 arg4[3]);
void animMtxList_setBoned(AnimMtxList **this_ptr, BKAnimationList *anim_list, BoneTransformList *arg2){
AnimMtxList * this;
Mtx *start_ptr;
Mtx *end_ptr;
Mtx *i_ptr;
MtxF *start_ptr;
MtxF *end_ptr;
MtxF *i_ptr;
BKAnimation *s0;
f32 tmp_f0;
s32 pad94[1];

View File

@@ -1,13 +1,15 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
extern void func_80252C08(f32[3], f32[3], f32, f32[3]);
extern void func_80252CC4(f32[3], f32[3], f32, s32);
extern void func_80252CC4(f32[3], f32[3], f32, f32[3]);
extern void mlMtx_apply_f3(f32[3], f32, f32, f32);
extern s32 func_802EBAE0(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, s32 arg5, f32 arg6[3], f32 arg7, f32 arg8[3]);
extern s32 func_802EBAE0(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, f32 arg4[3], AnimMtxList* arg5, f32 arg6[3], f32 arg7, f32 arg8[3]);
extern MtxF *animMtxList_get(AnimMtxList *this, s32 arg1);
/* .bss */
Mtx D_80380880;
MtxF D_80380880;
/* .code */
bool func_802EA760(BKModelUnk14List *arg0, s32 arg1, f32 arg2[3], f32 rotation[3], f32 scale, f32 arg5[3], f32 arg6[3], f32 *arg7) {
@@ -18,7 +20,7 @@ bool func_802EA760(BKModelUnk14List *arg0, s32 arg1, f32 arg2[3], f32 rotation[3
return FALSE;
}
start = sizeof(BKModelUnk14List) + arg0->cnt0*sizeof(BKModelUnk14_0) + (s32)arg0;
temp_v0 = arg0->cnt2*sizeof(BKModelUnk14_1) + start + arg1 *sizeof(BKModelUnk14_2);
temp_v0 = (BKModelUnk14_2*)(arg0->cnt2*sizeof(BKModelUnk14_1) + start + arg1 *sizeof(BKModelUnk14_2));
arg6[0] = (f32) temp_v0->unk2[0];
arg6[1] = (f32) temp_v0->unk2[1];
@@ -67,7 +69,7 @@ s32 func_802EA864(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
mlMtxIdent();
func_80252EC8(spB0, sp8C);
func_80252CC4(position, rotation, scale, arg4);
func_8025235C(&sp78, arg5);
func_8025235C(sp78, arg5);
for(j = 0; j < 3; j++){
if (((sp78[j] + arg6 / scale) <= spA4[j]) || (sp98[j] <= (sp78[j] - arg6 / scale)))
break;
@@ -93,7 +95,7 @@ s32 func_802EAB34(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
// tmp = ;
tmp = (BKModelUnk14_0 *)(arg0 + 1);
iPtr = tmp + arg0->cnt0;
iPtr = (BKModelUnk14_1*)(tmp + arg0->cnt0);
end_ptr = iPtr + arg0->cnt2;
for(iPtr = iPtr; iPtr < end_ptr; iPtr++){
spA0[0] = (f32) iPtr->unk4[0];
@@ -108,7 +110,7 @@ s32 func_802EAB34(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
mlMtxIdent();
func_80252DDC(spA0, sp94);
func_80252CC4(position, rotation, scale, arg4);
func_8025235C(&sp78, arg5);
func_8025235C(sp78, arg5);
if (!(temp_f20 / 2 <= (sp78[2] - arg6 / scale)) && !((sp78[2] + arg6 / scale) <= -(temp_f20 / 2))) {
if (!(((arg6 / scale + temp_f24) * (arg6 / scale + temp_f24)) <= ((sp78[0] * sp78[0]) + (sp78[1] * sp78[1])))) {
return iPtr->unkD;
@@ -119,7 +121,7 @@ s32 func_802EAB34(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
return 0;
}
s32 func_802EAD5C(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, f32 arg5[3], f32 arg6) {
s32 func_802EAD5C(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, f32 arg4[3], f32 arg5[3], f32 arg6) {
BKModelUnk14_0 *t0_ptr;
BKModelUnk14_1 *t1_ptr;
f32 sp5C[3];
@@ -153,7 +155,7 @@ s32 func_802EAD5C(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
return 0;
}
s32 func_802EAED4(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, AnimMtxList *arg5, f32 arg6[3], f32 arg7) {
s32 func_802EAED4(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, f32 arg4[3], AnimMtxList *arg5, f32 arg6[3], f32 arg7) {
f32 spF4[3];
f32 spE8[3];
f32 spDC[3];
@@ -242,7 +244,7 @@ s32 func_802EAED4(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
return 0;
}
s32 func_802EB458(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, s32 arg5, f32 arg6[3], f32 arg7)
s32 func_802EB458(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, f32 arg4[3], AnimMtxList* arg5, f32 arg6[3], f32 arg7)
{
BKModelUnk14_0 *ptr_t0;
f32 spB8[3];
@@ -313,7 +315,7 @@ s32 func_802EB458(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
return 0;
}
s32 func_802EB8A0(BKModelUnk14List *arg0, f32 *position, f32 *rotation, f32 scale, s32 arg4, s32 arg5, f32 *arg6, f32 arg7) {
s32 func_802EB8A0(BKModelUnk14List *arg0, f32 *position, f32 *rotation, f32 scale, f32 arg4[3], AnimMtxList* arg5, f32 *arg6, f32 arg7) {
BKModelUnk14_0 *t0_ptr;
BKModelUnk14_1 *t1_ptr;
f32 sp74[3];
@@ -326,7 +328,7 @@ s32 func_802EB8A0(BKModelUnk14List *arg0, f32 *position, f32 *rotation, f32 scal
mlMtxIdent();
func_80252CC4(position, rotation, scale, arg4);
func_8025235C(&sp74, arg6);
func_8025235C(sp74, arg6);
t0_ptr = (BKModelUnk14_0 *)(arg0 + 1);
t1_ptr = (BKModelUnk14_1 *)(t0_ptr + arg0->cnt0);
i_ptr = (BKModelUnk14_2 *)(t1_ptr + arg0->cnt2);
@@ -353,11 +355,11 @@ s32 func_802EB8A0(BKModelUnk14List *arg0, f32 *position, f32 *rotation, f32 scal
return 0;
}
bool func_802EBA98(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scale, s32 arg4, f32 arg5[3], f32 arg6, f32 arg7[3]){
bool func_802EBA98(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scale, f32 arg4[3], f32 arg5[3], f32 arg6, f32 arg7[3]){
return func_802EBAE0(arg0, arg1, rotation, scale, arg4, NULL, arg5, arg6, arg7);
}
s32 func_802EBAE0(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, s32 arg5, f32 arg6[3], f32 arg7, f32 arg8[3])
s32 func_802EBAE0(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, f32 arg4[3], AnimMtxList* arg5, f32 arg6[3], f32 arg7, f32 arg8[3])
{
f32 sp3C[3];
f32 temp_f0;
@@ -467,7 +469,7 @@ s32 func_802EBD3C(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scal
return 0;
}
s32 func_802EC000(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scale, s32 arg4, f32 arg5[3], s32 arg6){
s32 func_802EC000(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scale, f32 arg4[3], f32 arg5[3], s32 arg6){
BKModelUnk14_1 *i_ptr;
f32 sp90[3];
f32 sp84[3];
@@ -492,9 +494,9 @@ s32 func_802EC000(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scal
temp_f20 = (f32) i_ptr->unk0;
temp_f22 = (f32) i_ptr->unk2;
mlMtxIdent();
func_80252DDC(&sp90, &sp84);
func_80252DDC(sp90, sp84);
func_80252CC4(arg1, rotation, scale, arg4);
func_8025235C(&sp68, arg5);
func_8025235C(sp68, arg5);
temp_f0 = (f32) (temp_f22 / 2.0);
if (!(temp_f0 <= sp68[2]) && !(sp68[2] <= -temp_f0) && !((temp_f20 * temp_f20) <= (sp68[0] * sp68[0] + sp68[1]*sp68[1]))) {
return i_ptr->unkD;
@@ -506,7 +508,7 @@ s32 func_802EC000(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scal
return 0;
}
s32 func_802EC238(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scale, f32 arg4[3], s32 arg5, s32 arg6){
s32 func_802EC238(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scale, f32 arg4[3], f32 arg5[3], s32 arg6){
BKModelUnk14_0 *t0_ptr;
BKModelUnk14_1 *t1_ptr;
f32 sp54[3];

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
extern s16 D_803A5D00[2][0xF660];
@@ -49,7 +51,7 @@ Struct_core2_6B030_1 D_80368B28[] = {
/* .bss */
f32 *D_80380A10;
Mtx D_80380A18;
MtxF D_80380A18;
s32 D_80380A58;
/* .code */
@@ -377,7 +379,7 @@ void func_802F2FCC(Struct64s *arg0, f32 arg1[3], s16 arg2, f32 arg3, ActorMarker
}
}
void func_802F32C4(Struct64s *arg0, f32 arg1[3], f32 arg2, ActorMarker *arg3, void(*arg4)(f32[3], f32, ActorMarker *)){
void func_802F32C4(Struct64s *arg0, f32 arg1[3], f32 arg2, ActorMarker *arg3, s32(*arg4)(f32[3], f32, ActorMarker *)){
func_802F2FCC(arg0, arg1, 8, arg2, arg3, arg4);
}

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
typedef struct {
u8 pad0[0xC];
@@ -10,10 +11,7 @@ typedef struct {
extern f32 viewport_get_yaw();
extern int func_8024DD34(f32, f32, f32);
extern void func_80251B5C(f32, f32, f32);
extern void mlMtx_rotate_pitch_deg(f32);
extern void mlMtx_rotate_yaw_deg(f32);
extern void func_80252A38(f32, f32, f32);
extern void mlMtxApply(Mtx *);
extern f32 vtxList_getGlobalNorm(BKVertexList *);
extern bool func_8024DB50(f32[3], f32);
@@ -202,17 +200,17 @@ void func_802F962C(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
if ((D_80369280 != NULL) && (D_80369284 != 0)) {
viewport_get_position_vec3f(D_80381050);
viewport_get_rotation_vec3f(D_80381060);
D_80381090 = (s32)D_80369288 + D_80369288->gfx_list_offset_C + sizeof(BKGfxList);
D_80381090 = (Gfx*)((s32)D_80369288 + D_80369288->gfx_list_offset_C + sizeof(BKGfxList));
temp_s3 = (BKVertexList *)((s32)D_80369288 + D_80369288->vtx_list_offset_10);
D_8038108C = vtxList_getGlobalNorm(temp_s3);
func_80349AD0();
gSPSegment((*gfx)++, 1, osVirtualToPhysical(temp_s3 + 1));
gSPSegment((*gfx)++, 0x02, osVirtualToPhysical((s32)D_80369288 + D_80369288->texture_list_offset_8 + sizeof(BKTextureList) + sizeof(BKTextureHeader)));
gSPSegment((*gfx)++, 0x02, osVirtualToPhysical((void*)((s32)D_80369288 + D_80369288->texture_list_offset_8 + sizeof(BKTextureList) + sizeof(BKTextureHeader))));
gSPSetGeometryMode((*gfx)++, G_ZBUFFER);
gSPDisplayList((*gfx)++, D_80369290);
gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(&D_803692B0));
D_80381094 = (BKGeoList *)((s32)D_80369288 + D_80369288->geo_list_offset_4);
D_80381094 = (Struct_core2_72060_0 *)((s32)D_80369288 + D_80369288->geo_list_offset_4);
for(phi_s0 = D_80369280->unk1C; phi_s0 < D_80369280->unk1C + D_80369284; phi_s0++) {
if ((func_802F989C(gfx, mtx, phi_s0) == 0) && (phi_s0->unk0[1] < D_8038104C)) {

View File

@@ -1,16 +1,15 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
Mtx *func_8024DD9C(void);
void mlMtxSet(Mtx *);
void func_80252330(f32, f32, f32);
void mlMtxApply(Mtx *);
void func_803382D8(s32 arg0);
void func_803382E4(s32 arg0);
void spriteRender_set1Primative(bool boolean);
void func_803382FC(s32 arg0);
void func_80338308(s32 arg0, s32 arg1);
BKSpriteTextureBlock *func_8033EFB0(Struct84s *arg0, s32 arg1);
/* .data */
Gfx D_80370260[] = {
@@ -263,17 +262,17 @@ void spriteRender_drawWithSegment(Gfx **gfx, Vtx **vtx, BKSprite *sprite, u32 fr
frame_ptr = spriteGetFramePtr(sprite, frame);
//load palette in indexed pixels
var_t2 = frame_ptr + 1;
var_t2 = (BKSpriteTextureBlock *)(frame_ptr + 1);
if (sprite->type & SPRITE_TYPE_CI4) {
gDPSetTextureLUT((*gfx)++, G_TT_RGBA16);
palette_mem = ALIGN(frame_ptr + 1, 8);
gDPLoadTLUT_pal16((*gfx)++, 0, palette_mem);
var_t2 = palette_mem + 0x20;
var_t2 = (BKSpriteTextureBlock *)(palette_mem + 0x20);
} else if (sprite->type & SPRITE_TYPE_CI8) {
gDPSetTextureLUT((*gfx)++, G_TT_RGBA16);
palette_mem = ALIGN(frame_ptr + 1, 8);
gDPLoadTLUT_pal256((*gfx)++, palette_mem);
var_t2 = palette_mem + 0x200;
var_t2 = (BKSpriteTextureBlock *)(palette_mem + 0x200);
}
//start new vtx seg
@@ -290,7 +289,7 @@ void spriteRender_drawWithSegment(Gfx **gfx, Vtx **vtx, BKSprite *sprite, u32 fr
// sp1B4 = sp1B4;
for(sp1BC = 0; sp1BC < frame_ptr->chunkCnt; sp1BC++){
temp_ra = var_t2->h;
tmem = ALIGN(var_t2 + 1, 8); //align
tmem = (u8*)ALIGN(var_t2 + 1, 8); //align
//load texture block
if (sprite->type & SPRITE_TYPE_RGBA16) {
@@ -342,7 +341,7 @@ void spriteRender_drawWithSegment(Gfx **gfx, Vtx **vtx, BKSprite *sprite, u32 fr
gSPVertex((*gfx)++, sp1B0, 0, 0);
}
}
var_t2 = tmem + ((s32) (var_t2->w * var_t2->h) * pixel_size_nibbles / 2);
var_t2 = (BKSpriteTextureBlock *)(tmem + ((s32) (var_t2->w * var_t2->h) * pixel_size_nibbles / 2));
}
// sp1B4 = reinterpret_cast(Gfx *,sp1B4);
*vtx = var_a3;

View File

@@ -1,10 +1,10 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
extern void mlMtxRotatePYR(f32, f32, f32);
extern void func_80252330(f32, f32, f32);
extern void mlMtxApply(Mtx *);
typedef struct {
BKSprite *sprite_0;

View File

@@ -1,11 +1,10 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
extern void spriteRender_drawWithSegment(Gfx**, Vtx**, BKSprite *, s32, s32);
extern void func_80252330(f32, f32, f32);
extern void mlMtxRotatePYR(f32, f32, f32);
extern void mlMtxApply(Mtx *);
extern void func_80252330(f32, f32, f32);\
extern void func_80349AD0(void);
extern void func_8024C5A8(f32[3]);

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
extern f32 func_80255D70(f32);
#define LENGTH_SQ_VEC4F(v) (v[0]*v[0] + v[1]*v[1] + v[2]*v[2] + v[3]*v[3])
@@ -160,7 +162,7 @@ void func_803458E4(f32 arg0[4], f32 arg1[4], f32 arg2[4], f32 arg3) {
}
void func_80345A44(f32 arg0[4], f32 arg1[4][4]) {
void func_80345A44(f32 arg0[4], MtxF* arg1) {
f32 temp_f0;
f32 temp_f2;
s32 temp_a0;
@@ -168,32 +170,32 @@ void func_80345A44(f32 arg0[4], f32 arg1[4][4]) {
s32 var_a0;
temp_f0 = arg1[0][0] + arg1[1][1] + arg1[2][2];
temp_f0 = arg1->m[0][0] + arg1->m[1][1] + arg1->m[2][2];
if (temp_f0 > 0.0) {
temp_f2 = gu_sqrtf(temp_f0 + 1.0);
arg0[3] = temp_f2 * 0.5;
temp_f2 = (0.5 / temp_f2);
arg0[0] = (arg1[1][2] - arg1[2][1]) * temp_f2;
arg0[1] = (arg1[2][0] - arg1[0][2]) * temp_f2;
arg0[2] = (arg1[0][1] - arg1[1][0]) * temp_f2;
arg0[0] = (arg1->m[1][2] - arg1->m[2][1]) * temp_f2;
arg0[1] = (arg1->m[2][0] - arg1->m[0][2]) * temp_f2;
arg0[2] = (arg1->m[0][1] - arg1->m[1][0]) * temp_f2;
}
else{
var_a0 = 0;
if (arg1[var_a0][var_a0] < arg1[1][1]) {
if (arg1->m[var_a0][var_a0] < arg1->m[1][1]) {
var_a0 = 1;
}
if (arg1[var_a0][var_a0] < arg1[2][2]) {
if (arg1->m[var_a0][var_a0] < arg1->m[2][2]) {
var_a0 = 2;
}
temp_a0 = D_80371ED0[var_a0];
temp_a2 = D_80371ED0[temp_a0];
temp_f2 = gu_sqrtf((arg1[var_a0][var_a0] - (arg1[temp_a0][temp_a0] + arg1[temp_a2][temp_a2])) + 1.0);
temp_f2 = gu_sqrtf((arg1->m[var_a0][var_a0] - (arg1->m[temp_a0][temp_a0] + arg1->m[temp_a2][temp_a2])) + 1.0);
arg0[var_a0] = temp_f2 * 0.5;
temp_f2 = (0.5 / temp_f2);
arg0[3] = (arg1[temp_a0][temp_a2] - arg1[temp_a2][temp_a0]) * temp_f2;
arg0[temp_a0] = (arg1[var_a0][temp_a0] + arg1[temp_a0][var_a0]) * temp_f2;
arg0[temp_a2] = (arg1[var_a0][temp_a2] + arg1[temp_a2][var_a0]) * temp_f2;
arg0[3] = (arg1->m[temp_a0][temp_a2] - arg1->m[temp_a2][temp_a0]) * temp_f2;
arg0[temp_a0] = (arg1->m[var_a0][temp_a0] + arg1->m[temp_a0][var_a0]) * temp_f2;
arg0[temp_a2] = (arg1->m[var_a0][temp_a2] + arg1->m[temp_a2][var_a0]) * temp_f2;
}
}

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "ml/mtx.h"
#include "zoombox.h"
@@ -26,7 +27,6 @@ extern void func_802C5994(void);
extern void func_802E412C(s32, s32);
void volatileFlag_set(s32, s32);
f32 func_8024DE1C(f32, f32, f32 *, f32 *);
void mlMtxApply(Mtx*);
void func_80310D2C(void);
s32 level_get(void);

View File

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "zoombox.h"
#include "ml/mtx.h"
extern f32 func_8024DE1C(f32, f32, f32[3], f32[3]);
void func_80252330(f32, f32, f32);
@@ -9,6 +10,8 @@ extern f32 func_8033DDB8(void);
extern void func_8024E60C(s32, void *);
extern void func_8024E640(s32, void *);
extern void func_8024E5A8(s32, void *);
extern void func_80344090(BKSpriteDisplayData *self, s32 frame, Gfx **gfx);
BKSprite *func_8033B6C4(enum asset_e sprite_id, BKSpriteDisplayData **arg1);
typedef struct struct_18_s{
s16 sfx_id; /* enum sfx_e */
@@ -838,7 +841,7 @@ void func_803163A8(GcZoombox *this, Gfx **gfx, Mtx **mtx) {
modelRender_draw(gfx, mtx, sp50, sp5C, this->unk198 * sp34, sp38, this->model);
}
void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, s32 arg5, f32 arg6) {
void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, BKSpriteDisplayData *arg5, f32 arg6) {
f32 sp2C[3];
f32 temp_f12;
@@ -1190,7 +1193,7 @@ void gczoombox_update(GcZoombox *this){
}//L803176C8
if(this->unk1A4_25 == 0){
if(this->unk166 - ((this->unk1A4_19)? 0xf : 0xc) >= this->unk16C){
func_803153A8(this->unk30, this->unk0, 0, 0x30);
func_803153A8(this->unk30, this->unk0, 0, sizeof(this->unk0));
_gczoombox_memClear(this->unk30, 0x30);
this->unk16C = this->unk166;
this->unk16E = ((this->unk1A4_19) ? 0xf : 0xc) + this->unk16C;
@@ -1459,9 +1462,9 @@ GcZoombox *gczoombox_new(s32 arg0, GcZoomboxSprite portrait_id, s32 arg2, s32 ar
func_80318760(this, 18000);
_gczoombox_memClear( this->unk0, 0x30);
_gczoombox_memClear( this->unk30, 0x30);
_gczoombox_memClear( &this->unk60, 0x30);
_gczoombox_memClear( &this->unk90, 0x20);
_gczoombox_memClear( &this->unkB0, 0x40);
_gczoombox_memClear( this->unk60, 0x30);
_gczoombox_memClear( this->unk90, 0x20);
_gczoombox_memClear( this->unkB0, 0x40);
return this;
}
@@ -1768,10 +1771,10 @@ void func_80318C48(GcZoombox *this, s32 arg1) {
if (this->unk0[0] == 0xFD) {
this->unk0[1] = 0x68;
} else {
func_803153A8(&this->unk0[0], &D_803830B0, 0, 0x30);
func_803153A8(&this->unk0[0], D_803830B0, 0, sizeof(D_803830B0));
this->unk0[0] = 0xFD;
this->unk0[1] = 0x68;
func_803153A8(&D_803830B0, &this->unk0[2], 0, 0x2E);
func_803153A8(D_803830B0, &this->unk0[2], 0, sizeof(this->unk0) - 2);
}
}
else if (this->unk0[0] == 0xFD) {
@@ -1785,10 +1788,10 @@ void func_80318C48(GcZoombox *this, s32 arg1) {
return;
}
else{
func_803153A8(&this->unk30[0], &D_803830B0, 0, 0x30);
func_803153A8(&this->unk30[0], D_803830B0, 0, sizeof(D_803830B0));
this->unk30[0] = 0xFD;
this->unk30[1] = 0x68;
func_803153A8(&D_803830B0, &this->unk30[2], 0, 0x2E);
func_803153A8(D_803830B0, &this->unk30[2], 0, sizeof(this->unk30) - 2);
}
}
else if (this->unk30[0] == 0xFD) {

View File

@@ -209,7 +209,7 @@ typedef struct {
void gczoombox_free(GcZoombox *this);
void func_803160A8(GcZoombox *this);
void func_803163A8(GcZoombox *this, Gfx **gfx, Mtx **mtx);
void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, s32 arg5, f32 arg6);
void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, BKSpriteDisplayData *arg5, f32 arg6);
void func_80316764(GcZoombox *this, s32 arg1);
void gczoombox_draw(GcZoombox *this, Gfx **gdl, Mtx ** mptr, void *vptr);
void func_80316E08(GcZoombox *this);

View File

@@ -3,6 +3,7 @@
#include "variables.h"
#include "core2/modelRender.h"
#include "animation.h"
#include "ml/mtx.h"
#define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0]))
@@ -17,11 +18,9 @@ extern void viewport_set_rotation_vec3f(f32[3]);
extern void viewport_update(void);
extern void func_8033BD4C(BKModelBin *);
extern s32 func_8024DB50(f32[3], f32);
extern void mlMtx_push_translation(f32, f32, f32);
extern void mlMtxScale(f32);
extern void mlMtxApply(Mtx* mtx);
extern AnimMtxList *animMtxList_new();
extern AnimMtxList *animMtxList_defrag(AnimMtxList *);
extern MtxF *animMtxList_get(AnimMtxList *this, s32 arg1);
typedef struct{
@@ -662,7 +661,7 @@ struct {
LookAt *lookat_buffer_end;
f32 eye_pos[3];
} D_803837E0;
Mtx D_80383BF8;
MtxF D_80383BF8;
f32 modelRenderCameraPosition[3];
f32 modelRenderCameraRotation[3];
BKModelBin *modelRenderModelBin;
@@ -909,9 +908,9 @@ void func_80338CD0(Gfx **gfx, Mtx **mtx, void *arg2){
if (0 < indx) {
if (indx <= cmd->unk8) {
s0 = cmd->unkC;
sub_cmd = cmd;
sub_cmd = (s32)cmd;
sub_cmd += *(s32*)(s0 + (indx - 1));
func_80339124(gfx, mtx, sub_cmd);
func_80339124(gfx, mtx, (BKGeoList*)sub_cmd);
}
} else {
s1 = indx * (-1);
@@ -919,9 +918,9 @@ void func_80338CD0(Gfx **gfx, Mtx **mtx, void *arg2){
for (s2 = 0; s2 < cmd->unk8; s2++) {
if (s1 & 1)
{
sub_cmd = cmd;
sub_cmd = (s32)cmd;
sub_cmd += s0[0];
func_80339124(gfx, mtx, sub_cmd);
func_80339124(gfx, mtx, (BKGeoList*)sub_cmd);
}
s1 >>= 1;
s0++;