This commit is contained in:
Bl00D4NGEL
2024-09-29 17:37:20 +02:00
23 changed files with 240 additions and 171 deletions

View File

@@ -516,8 +516,8 @@ segments:
- [0xF7FD00, c, code_6B30] - [0xF7FD00, c, code_6B30]
- [0xF7FFA0, c, ba/carriedobj] - [0xF7FFA0, c, ba/carriedobj]
- [0xF80230, c, code_7060] - [0xF80230, c, code_7060]
- [0xF81F70, bin, core2_untouched_text] - [0xF81F70, c, ba/flap]
# - [0xF5E700, c, code_8DA0] #DONE - [0xF822B0, bin, core2_untouched_text]
# - [0xF5EA40, c, code_90E0] #DONE # - [0xF5EA40, c, code_90E0] #DONE
# - [0xF5EBF0, c, code_9290] #DONE # - [0xF5EBF0, c, code_9290] #DONE
# - [0xF5EDB0, c, code_9450] #DONE # - [0xF5EDB0, c, code_9450] #DONE
@@ -1383,7 +1383,7 @@ segments:
- [0x0106C980, .bss, ba/marker] - [0x0106C980, .bss, ba/marker]
- [0x0106C980, .bss, code_6B30] - [0x0106C980, .bss, code_6B30]
- [0x0106C980, .bss, code_7060] - [0x0106C980, .bss, code_7060]
# - [0x0106C980, .bss, code_8DA0] - [0x0106C980, .bss, ba/flap]
# - [0x0106C980, .bss, code_90E0] # - [0x0106C980, .bss, code_90E0]
# - [0x0106C980, .bss, code_9290] # - [0x0106C980, .bss, code_9290]
# - [0x0106C980, .bss, code_9450] # - [0x0106C980, .bss, code_9450]

View File

@@ -517,7 +517,7 @@ segments:
- [0xF5C490, c, code_6B30] #DONE - [0xF5C490, c, code_6B30] #DONE
- [0xF5C730, c, ba/carriedobj] #DONE - [0xF5C730, c, ba/carriedobj] #DONE
- [0xF5C9C0, c, code_7060] #DONE - [0xF5C9C0, c, code_7060] #DONE
- [0xF5E700, c, code_8DA0] #DONE - [0xF5E700, c, ba/flap] #DONE
- [0xF5EA40, c, code_90E0] #DONE - [0xF5EA40, c, code_90E0] #DONE
- [0xF5EBF0, c, code_9290] #DONE - [0xF5EBF0, c, code_9290] #DONE
- [0xF5EDB0, c, code_9450] #DONE - [0xF5EDB0, c, code_9450] #DONE
@@ -1381,7 +1381,7 @@ segments:
- [0x1048560, .bss, ba/marker] - [0x1048560, .bss, ba/marker]
- [0x1048560, .bss, code_6B30] - [0x1048560, .bss, code_6B30]
- [0x1048560, .bss, code_7060] - [0x1048560, .bss, code_7060]
- [0x1048560, .bss, code_8DA0] - [0x1048560, .bss, ba/flap]
- [0x1048560, .bss, code_90E0] - [0x1048560, .bss, code_90E0]
- [0x1048560, .bss, code_9290] - [0x1048560, .bss, code_9290]
- [0x1048560, .bss, code_9450] - [0x1048560, .bss, code_9450]

View File

@@ -3,7 +3,7 @@
#include "core1/mem.h" #include "core1/mem.h"
void func_8025235C(f32[3], f32[3]); void mlMtx_apply_vec3f(f32[3], f32[3]);
void func_80252C08(f32 arg0[3], f32 arg1[3], f32 scale, f32 arg3[3]); void func_80252C08(f32 arg0[3], f32 arg1[3], f32 scale, f32 arg3[3]);
#endif #endif

13
include/core2/ba/flap.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef __BA_FLAP_H__
#define __BA_FLAP_H__
#include <ultra64.h>
s32 baflap_getCount(void);
bool baflap_add(f32 duration);
void baflap_reset(void);
void baflap_activate(bool active);
void baflap_update(void);
#endif // __BA_FLAP_H__

View File

@@ -128,7 +128,7 @@ void CC_func_80387A40(Struct_CC_13C0_1* arg0, Struct68s* arg1, f32 arg2) {
sp44[2] = 1.0f; sp44[2] = 1.0f;
mlMtxIdent(); mlMtxIdent();
func_80252C08(NULL, sp2C, 1.0f, NULL); func_80252C08(NULL, sp2C, 1.0f, NULL);
func_8025235C(sp44, sp44); mlMtx_apply_vec3f(sp44, sp44);
player_getPosition(sp50); player_getPosition(sp50);
sp50[1] += 50.0f; sp50[1] += 50.0f;
sp50[0] -= sp38[0]; sp50[0] -= sp38[0];

View File

@@ -95,7 +95,7 @@ void __chScarfSled_func_80386630(Actor *this){
sp70[0] = 0.0f; sp70[0] = 0.0f;
sp70[1] = 18.0f; sp70[1] = 18.0f;
sp70[2] = 0.0f; sp70[2] = 0.0f;
func_8025235C(sp70, sp70); mlMtx_apply_vec3f(sp70, sp70);
sp70[0] += this->position[0]; sp70[0] += this->position[0];
sp70[1] += this->position[1]; sp70[1] += this->position[1];

View File

@@ -407,29 +407,41 @@ void func_80252330(f32 x, f32 y, f32 z){
s_mtx_stack->m[3][2] = z; s_mtx_stack->m[3][2] = z;
} }
void func_8025235C(f32 arg0[3], f32 arg1[3]) { /**
* @brief Applies top mtxStack mtx to vec3f.
*
* @param dst destination vec3f
* @param src source vec3f
*/
void mlMtx_apply_vec3f(f32 dst[3], f32 src[3]) {
s32 i; s32 i;
f32 sp0[3]; f32 sp0[3];
sp0[0] = arg1[0]; sp0[0] = src[0];
sp0[1] = arg1[1]; sp0[1] = src[1];
sp0[2] = arg1[2]; sp0[2] = src[2];
for(i = 0; i < 3; i++){ for(i = 0; i < 3; i++){
arg0[i] = sp0[0]*s_mtx_stack->m[0][i] dst[i] = sp0[0]*s_mtx_stack->m[0][i]
+ sp0[1]*s_mtx_stack->m[1][i] + sp0[1]*s_mtx_stack->m[1][i]
+ sp0[2]*s_mtx_stack->m[2][i] + sp0[2]*s_mtx_stack->m[2][i]
+ s_mtx_stack->m[3][i]; + s_mtx_stack->m[3][i];
} }
} }
void func_80252434(f32 arg0[3], f32 arg1[3]) { /**
* @brief Applies top mtxStack mtx to vec3f. `dst` can not equal `src`.
*
* @param dst destination vec3f
* @param src source vec3f
*/
void mlMtx_apply_vec3f_restricted(f32 dst[3], f32 src[3]) {
s32 i; s32 i;
for(i = 0; i < 3; i++){ for(i = 0; i < 3; i++){
arg0[i] = arg1[0]*s_mtx_stack->m[0][i] dst[i] = src[0]*s_mtx_stack->m[0][i]
+ arg1[1]*s_mtx_stack->m[1][i] + src[1]*s_mtx_stack->m[1][i]
+ arg1[2]*s_mtx_stack->m[2][i] + src[2]*s_mtx_stack->m[2][i]
+ s_mtx_stack->m[3][i]; + s_mtx_stack->m[3][i];
} }
} }
@@ -473,7 +485,7 @@ void func_8025276C(s32 arg0[3], s32 arg1[3], s32 arg2[3], s32 arg3[3]) {
} }
for(var_t0 = 0; var_t0 < 8; var_t0++){ for(var_t0 = 0; var_t0 < 8; var_t0++){
func_8025235C(sp48[var_t0], sp48[var_t0]); mlMtx_apply_vec3f(sp48[var_t0], sp48[var_t0]);
} }
for(var_t0 = 0; var_t0< 3; var_t0++){ for(var_t0 = 0; var_t0< 3; var_t0++){

View File

@@ -242,7 +242,7 @@ void viewport_update(void) {
sViewportLookVector[1] = 0.0f; sViewportLookVector[1] = 0.0f;
sViewportLookVector[2] = -1.0f; sViewportLookVector[2] = -1.0f;
func_8025235C(sViewportLookVector, sViewportLookVector); mlMtx_apply_vec3f(sViewportLookVector, sViewportLookVector);
} }
void viewport_getFrustumPlanes(f32 arg0[4], f32 arg1[4], f32 arg2[4], f32 arg3[4]) { void viewport_getFrustumPlanes(f32 arg0[4], f32 arg1[4], f32 arg2[4], f32 arg3[4]) {

103
src/core2/ba/flap.c Normal file
View File

@@ -0,0 +1,103 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
/* .bss */
u8 s_active;
f32 s_flap_max_timer;
f32 s_flap_list[5];
/* .code */
/**
* @brief returns the number of nonzero flap timers in `s_flap_list`
*
* @return s32 number of active flaps
*/
s32 baflap_getCount(void) {
s32 i;
s32 cnt;
cnt = 0;
for(i = 0; i < 5; i++){
if(s_flap_list[i] != 0.0f){
cnt++;
}
}
return cnt;
}
/**
* @brief add a flap duration to the flap list
*
* @param duration duration of flap in seconds
* @return true if baflap duration was extended
* @return false if baflap does not extend duration or all timers in flap queue are occupied
*/
bool baflap_add(f32 duration) {
s32 i;
// check that timer is far enough away from any value
for(i = 0; i < 5; i++){
if(duration - 0.25 < s_flap_list[i]){
s_flap_max_timer = duration;
return FALSE;
}
}
// add to list
for(i = 0; i < 5; i++){
if (s_flap_list[i] == 0.0f) {
s_flap_list[i] = duration;
return TRUE;
}
}
s_flap_max_timer = duration;
return FALSE;
}
/**
* @brief zeros all flap timers and sets as inactive
*
*/
void baflap_reset(void) {
s32 i;
for(i = 0; i < 5; i++){
s_flap_list[i] = 0.0f;
}
s_active = s_flap_max_timer = 0.0f;
}
/**
* @brief activates or deactivates flap timers
*
* @param active false (0) or true (!0)
*/
void baflap_activate(bool active){
s_active = active;
if(!s_active){
baflap_reset();
}
}
/**
* @brief updates flap timers if active
*
*/
void baflap_update(void) {
f32 temp_f0;
s32 i;
if (s_active != 0) {
//update timers
for(i = 0; i < 5; i++){
func_80259430(&s_flap_list[i]);
}
if (s_flap_max_timer != 0.0f) {
temp_f0 = s_flap_max_timer;
s_flap_max_timer = 0.0f;
baflap_add(temp_f0);
}
}
}

View File

@@ -3,8 +3,8 @@
#include "variables.h" #include "variables.h"
#include <core1/viewport.h> #include <core1/viewport.h>
#include "core2/ba/physics.h" #include "core2/ba/physics.h"
#include "core2/ba/flap.h"
extern void func_8028FDC8(f32);
extern void baModel_setYDisplacement(f32); extern void baModel_setYDisplacement(f32);
extern f32 func_8029B2D0(void); extern f32 func_8029B2D0(void);
extern void ncDynamicCam4_func_802BFE50(f32, f32, f32); extern void ncDynamicCam4_func_802BFE50(f32, f32, f32);
@@ -56,8 +56,8 @@ void func_802A3430(void){
func_802A33D8(); func_802A33D8();
func_80293D48(60.0f, 45.0f); func_80293D48(60.0f, 45.0f);
func_80294378(4); func_80294378(4);
func_8028FEF0(); baflap_reset();
func_8028FFBC(1); baflap_activate(1);
} }
void func_802A34C8(void){ void func_802A34C8(void){
@@ -71,7 +71,7 @@ void func_802A34C8(void){
func_80291548(); func_80291548();
func_80293D74(); func_80293D74();
func_80294378(1); func_80294378(1);
func_8028FFBC(0); baflap_activate(0);
} }
} }
@@ -230,13 +230,13 @@ void bsbfly_update(void){
} }
if(D_8037D346){ if(D_8037D346){
D_8037D346 = 0; D_8037D346 = 0;
func_8028FDC8(0.35f); baflap_add(0.35f);
}else{ }else{
func_8028FDC8(1.0f); baflap_add(1.0f);
} }
}//L802A3BB4 }//L802A3BB4
sp30 = func_8028FD30(); sp30 = baflap_getCount();
switch(D_8037D344){ switch(D_8037D344){
case 0: case 0:
if(sp30) if(sp30)
@@ -306,7 +306,7 @@ void bsbfly_update(void){
if(func_802A3350()) if(func_802A3350())
sp54 = BS_1_IDLE; sp54 = BS_1_IDLE;
func_8028FFF0(); baflap_update();
bs_setState(sp54); bs_setState(sp54);
} }

View File

@@ -3,6 +3,7 @@
#include "variables.h" #include "variables.h"
#include "core2/ba/physics.h" #include "core2/ba/physics.h"
#include "core2/ba/flap.h"
void func_80354030(f32*, f32); void func_80354030(f32*, f32);
@@ -14,7 +15,6 @@ void ncDynamicCam4_func_802BFE50(f32, f32, f32);
void yaw_setVelocityBounded(f32, f32); void yaw_setVelocityBounded(f32, f32);
f32 func_8029B2D0(void); f32 func_8029B2D0(void);
f32 func_8029B2DC(void); f32 func_8029B2DC(void);
void func_8028FDC8(f32);
void func_80290B40(f32); void func_80290B40(f32);
void func_80290A6C(void); void func_80290A6C(void);
@@ -98,7 +98,7 @@ void _bsbeefly_end(void){
func_80291548(); func_80291548();
baphysics_reset_gravity(); baphysics_reset_gravity();
baphysics_reset_terminal_velocity(); baphysics_reset_terminal_velocity();
func_8028FFBC(0); baflap_activate(0);
func_8029099C(); func_8029099C();
} }
@@ -111,8 +111,8 @@ void func_802A07F8(void){
func_802A0724(); func_802A0724();
baphysics_set_gravity(-300.0f); baphysics_set_gravity(-300.0f);
baphysics_set_terminal_velocity(-99.9f); baphysics_set_terminal_velocity(-99.9f);
func_8028FEF0(); baflap_reset();
func_8028FFBC(1); baflap_activate(1);
func_802909C4(); func_802909C4();
} }
@@ -161,7 +161,7 @@ void bsbeefly_enter(void){
func_802914CC(4); func_802914CC(4);
func_802A07F8(); func_802A07F8();
if(mvmnt != 0x8b){ if(mvmnt != 0x8b){
func_8028FDC8(1.0f); baflap_add(1.0f);
D_8037D2C0 = 0; D_8037D2C0 = 0;
} }
else { else {
@@ -186,12 +186,12 @@ void bsbeefly_update(void){
_bsBeeFly_updatePitch(); _bsBeeFly_updatePitch();
pitch_get(); //return value never used pitch_get(); //return value never used
if(button_pressed(BUTTON_A) && (player_getYPosition() < 7500.0)){ if(button_pressed(BUTTON_A) && (player_getYPosition() < 7500.0)){
func_8028FDC8(1.0f); baflap_add(1.0f);
} }
if(!func_8028FD30() && player_inWater()){ if((baflap_getCount() == 0) && player_inWater()){
func_8028FDC8(1.0f); baflap_add(1.0f);
} }
sp44 = func_8028FD30(); sp44 = baflap_getCount();
animctrl_setDuration(sp48, D_803649B0[sp44]); animctrl_setDuration(sp48, D_803649B0[sp44]);
sp24 = &D_803649C4[sp44]; sp24 = &D_803649C4[sp44];
sp40 = 0.9f; sp40 = 0.9f;
@@ -255,7 +255,7 @@ void bsbeefly_update(void){
baphysics_set_target_horizontal_velocity(sp38); baphysics_set_target_horizontal_velocity(sp38);
if(player_isStable() && !player_inWater()) if(player_isStable() && !player_inWater())
sp4C = BS_85_BEE_IDLE; sp4C = BS_85_BEE_IDLE;
func_8028FFF0(); baflap_update();
bs_setState(sp4C); bs_setState(sp4C);
} }

View File

@@ -270,7 +270,7 @@ bool func_80360198(Actor *this) {
this->position[1] += this->velocity[0]; this->position[1] += this->velocity[0];
} }
if (this->state == 4) { if (this->state == CH_BAT_STATE_ROAM) {
if (func_8035FF5C(this) == 0) { if (func_8035FF5C(this) == 0) {
return FALSE; return FALSE;
} }

View File

@@ -420,8 +420,8 @@ int func_802E805C(BKCollisionList *collision_list, BKVertexList *vtxList, f32 ar
else{ else{
mlMtxIdent(); mlMtxIdent();
func_80252CC4(arg2, arg3, arg4, 0); func_80252CC4(arg2, arg3, arg4, 0);
func_8025235C(sp44, arg5); mlMtx_apply_vec3f(sp44, arg5);
func_8025235C(sp38, arg6); mlMtx_apply_vec3f(sp38, arg6);
sp34 = func_802E76B0(collision_list, vtxList, sp44, sp38, arg7, arg8); sp34 = func_802E76B0(collision_list, vtxList, sp44, sp38, arg7, arg8);
if(!sp34){ if(!sp34){
return 0; return 0;
@@ -429,17 +429,17 @@ int func_802E805C(BKCollisionList *collision_list, BKVertexList *vtxList, f32 ar
else{ else{
mlMtxIdent(); mlMtxIdent();
func_80252C08(arg2, arg3, arg4, NULL); func_80252C08(arg2, arg3, arg4, NULL);
func_8025235C(arg6, sp38); mlMtx_apply_vec3f(arg6, sp38);
mlMtxIdent(); mlMtxIdent();
func_80252C08(NULL, arg3, 1.0f, 0); func_80252C08(NULL, arg3, 1.0f, 0);
func_8025235C(arg7, arg7); mlMtx_apply_vec3f(arg7, arg7);
mlMtxIdent(); mlMtxIdent();
func_80252C08(arg2, arg3, arg4, 0); func_80252C08(arg2, arg3, arg4, 0);
for(i = 0; i < 3; i++){ for(i = 0; i < 3; i++){
func_8025235C(D_8037EAA8[i], D_8037EAA8[i]); mlMtx_apply_vec3f(D_8037EAA8[i], D_8037EAA8[i]);
} }
} }
@@ -750,22 +750,22 @@ s32 func_802E9118(BKCollisionList * collision_list, BKVertexList *vtx_list, f32
} }
mlMtxIdent(); mlMtxIdent();
func_80252CC4(arg2, arg3, arg4, 0); func_80252CC4(arg2, arg3, arg4, 0);
func_8025235C(&sp4C, arg5); mlMtx_apply_vec3f(&sp4C, arg5);
func_8025235C(&sp40, arg6); mlMtx_apply_vec3f(&sp40, arg6);
sp3C = func_802E8E88(collision_list, vtx_list, &sp4C, &sp40, arg7 / arg4, arg8, arg9, flagFilter); sp3C = func_802E8E88(collision_list, vtx_list, &sp4C, &sp40, arg7 / arg4, arg8, arg9, flagFilter);
if (sp3C == 0) { if (sp3C == 0) {
return 0; return 0;
} }
mlMtxIdent(); mlMtxIdent();
func_80252C08(arg2, arg3, arg4, 0); func_80252C08(arg2, arg3, arg4, 0);
func_8025235C(arg6, &sp40); mlMtx_apply_vec3f(arg6, &sp40);
mlMtxIdent(); mlMtxIdent();
func_80252C08(NULL, arg3, 1.0f, 0); func_80252C08(NULL, arg3, 1.0f, 0);
func_8025235C(arg8, arg8); mlMtx_apply_vec3f(arg8, arg8);
mlMtxIdent(); mlMtxIdent();
func_80252C08(arg2, arg3, arg4, 0); func_80252C08(arg2, arg3, arg4, 0);
for(i = 0; i < 3; i++){ for(i = 0; i < 3; i++){
func_8025235C(D_8037EAA8[i], D_8037EAA8[i]); mlMtx_apply_vec3f(D_8037EAA8[i], D_8037EAA8[i]);
} }
return sp3C; return sp3C;
} }
@@ -987,22 +987,22 @@ s32 func_802E9DD8(BKCollisionList *collisionList, BKVertexList *vtxList, f32 pos
} }
mlMtxIdent(); mlMtxIdent();
func_80252CC4(posA, rotA, scaleA, NULL); func_80252CC4(posA, rotA, scaleA, NULL);
func_8025235C(sp34, posB); mlMtx_apply_vec3f(sp34, posB);
sp30 = func_802E92AC(collisionList, vtxList, &sp34, radB / scaleA, arg7, arg8); sp30 = func_802E92AC(collisionList, vtxList, &sp34, radB / scaleA, arg7, arg8);
if (sp30 == 0) { if (sp30 == 0) {
return 0; return 0;
} }
mlMtxIdent(); mlMtxIdent();
func_80252C08(posA, rotA, scaleA, NULL); func_80252C08(posA, rotA, scaleA, NULL);
func_8025235C(posB, sp34); mlMtx_apply_vec3f(posB, sp34);
mlMtxIdent(); mlMtxIdent();
func_80252C08(NULL, rotA, 1.0f, NULL); func_80252C08(NULL, rotA, 1.0f, NULL);
func_8025235C(arg7, arg7); mlMtx_apply_vec3f(arg7, arg7);
mlMtxIdent(); mlMtxIdent();
func_80252C08(posA, rotA, scaleA, NULL); func_80252C08(posA, rotA, scaleA, NULL);
for(i = 0; i < 3; i++){ for(i = 0; i < 3; i++){
func_8025235C(D_8037EAA8[i], D_8037EAA8[i]); mlMtx_apply_vec3f(D_8037EAA8[i], D_8037EAA8[i]);
} }
return sp30; return sp30;
} }

View File

@@ -28,7 +28,7 @@ bool func_802EA760(BKModelUnk14List *arg0, s32 arg1, f32 arg2[3], f32 rotation[3
*arg7 = (f32) temp_v0->unk0; *arg7 = (f32) temp_v0->unk0;
mlMtxIdent(); mlMtxIdent();
func_80252C08(arg2, rotation, scale, arg5); func_80252C08(arg2, rotation, scale, arg5);
func_8025235C(arg6, arg6); mlMtx_apply_vec3f(arg6, arg6);
*arg7 /= scale; *arg7 /= scale;
return TRUE; return TRUE;
} }
@@ -69,7 +69,7 @@ s32 func_802EA864(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
mlMtxIdent(); mlMtxIdent();
func_80252EC8(spB0, sp8C); func_80252EC8(spB0, sp8C);
func_80252CC4(position, rotation, scale, arg4); func_80252CC4(position, rotation, scale, arg4);
func_8025235C(sp78, arg5); mlMtx_apply_vec3f(sp78, arg5);
for(j = 0; j < 3; j++){ for(j = 0; j < 3; j++){
if (((sp78[j] + arg6 / scale) <= spA4[j]) || (sp98[j] <= (sp78[j] - arg6 / scale))) if (((sp78[j] + arg6 / scale) <= spA4[j]) || (sp98[j] <= (sp78[j] - arg6 / scale)))
break; break;
@@ -110,7 +110,7 @@ s32 func_802EAB34(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
mlMtxIdent(); mlMtxIdent();
func_80252DDC(spA0, sp94); func_80252DDC(spA0, sp94);
func_80252CC4(position, rotation, scale, arg4); func_80252CC4(position, rotation, scale, arg4);
func_8025235C(sp78, arg5); mlMtx_apply_vec3f(sp78, arg5);
if (!(temp_f20 / 2 <= (sp78[2] - arg6 / scale)) && !((sp78[2] + arg6 / scale) <= -(temp_f20 / 2))) { 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])))) { if (!(((arg6 / scale + temp_f24) * (arg6 / scale + temp_f24)) <= ((sp78[0] * sp78[0]) + (sp78[1] * sp78[1])))) {
return iPtr->unkD; return iPtr->unkD;
@@ -134,7 +134,7 @@ s32 func_802EAD5C(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32
mlMtxIdent(); mlMtxIdent();
func_80252CC4(position, rotation, scale, arg4); func_80252CC4(position, rotation, scale, arg4);
func_8025235C(sp5C, arg5); mlMtx_apply_vec3f(sp5C, arg5);
t0_ptr = (BKModelUnk14_0 *)(arg0 + 1); t0_ptr = (BKModelUnk14_0 *)(arg0 + 1);
t1_ptr = (BKModelUnk14_1 *)(t0_ptr + arg0->cnt0); t1_ptr = (BKModelUnk14_1 *)(t0_ptr + arg0->cnt0);
i_ptr = (BKModelUnk14_2 *)(t1_ptr + arg0->cnt2); i_ptr = (BKModelUnk14_2 *)(t1_ptr + arg0->cnt2);
@@ -328,7 +328,7 @@ s32 func_802EB8A0(BKModelUnk14List *arg0, f32 *position, f32 *rotation, f32 scal
mlMtxIdent(); mlMtxIdent();
func_80252CC4(position, rotation, scale, arg4); func_80252CC4(position, rotation, scale, arg4);
func_8025235C(sp74, arg6); mlMtx_apply_vec3f(sp74, arg6);
t0_ptr = (BKModelUnk14_0 *)(arg0 + 1); t0_ptr = (BKModelUnk14_0 *)(arg0 + 1);
t1_ptr = (BKModelUnk14_1 *)(t0_ptr + arg0->cnt0); t1_ptr = (BKModelUnk14_1 *)(t0_ptr + arg0->cnt0);
i_ptr = (BKModelUnk14_2 *)(t1_ptr + arg0->cnt2); i_ptr = (BKModelUnk14_2 *)(t1_ptr + arg0->cnt2);
@@ -342,8 +342,8 @@ s32 func_802EB8A0(BKModelUnk14List *arg0, f32 *position, f32 *rotation, f32 scal
sp5C[1] = sp68[1]; sp5C[1] = sp68[1];
sp5C[2] = sp68[2]; sp5C[2] = sp68[2];
mlMtxSet(animMtxList_get(arg5, i_ptr->unk9)); mlMtxSet(animMtxList_get(arg5, i_ptr->unk9));
func_8025235C(sp68, sp68); mlMtx_apply_vec3f(sp68, sp68);
func_8025235C(sp5C, sp5C); mlMtx_apply_vec3f(sp5C, sp5C);
sp44[0] = sp5C[0] - sp68[0]; sp44[0] = sp5C[0] - sp68[0];
sp44[1] = sp5C[1] - sp68[1]; sp44[1] = sp5C[1] - sp68[1];
sp44[2] = sp5C[2] - sp68[2]; sp44[2] = sp5C[2] - sp68[2];
@@ -449,7 +449,7 @@ s32 func_802EBD3C(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scal
mlMtxIdent(); mlMtxIdent();
func_80252EC8(i_position, i_rotation); //derotate about point func_80252EC8(i_position, i_rotation); //derotate about point
func_80252CC4(arg1, rotation, scale, arg4); func_80252CC4(arg1, rotation, scale, arg4);
func_8025235C(sp68, arg5); //apply matrix to arg5 mlMtx_apply_vec3f(sp68, arg5); //apply matrix to arg5
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
if (1); if (1);
@@ -496,7 +496,7 @@ s32 func_802EC000(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scal
mlMtxIdent(); mlMtxIdent();
func_80252DDC(sp90, sp84); func_80252DDC(sp90, sp84);
func_80252CC4(arg1, rotation, scale, arg4); func_80252CC4(arg1, rotation, scale, arg4);
func_8025235C(sp68, arg5); mlMtx_apply_vec3f(sp68, arg5);
temp_f0 = (f32) (temp_f22 / 2.0); 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]))) { 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; return i_ptr->unkD;
@@ -523,7 +523,7 @@ s32 func_802EC238(BKModelUnk14List *arg0, f32 arg1[3], f32 rotation[3], f32 scal
end_ptr = i_ptr + arg0->unk4; end_ptr = i_ptr + arg0->unk4;
mlMtxIdent(); mlMtxIdent();
func_80252CC4(arg1, rotation, scale, arg4); func_80252CC4(arg1, rotation, scale, arg4);
func_8025235C(sp54, arg5); mlMtx_apply_vec3f(sp54, arg5);
for (i_ptr = i_ptr; i_ptr < end_ptr; i_ptr++) { for (i_ptr = i_ptr; i_ptr < end_ptr; i_ptr++) {
if ((i_ptr->unk8 != 0) && ((arg6 == 0) || (arg6 == i_ptr->unk8))) { if ((i_ptr->unk8 != 0) && ((arg6 == 0) || (arg6 == i_ptr->unk8))) {
sp40[0] = i_ptr->unk2[0]; sp40[0] = i_ptr->unk2[0];

View File

@@ -52,7 +52,7 @@ void vtxList_getBoundsMlMtxTransformed(BKVertexList *self, f32 min[3], f32 max[3
min[0] = (f32) start_vtx->v.ob[0]; min[0] = (f32) start_vtx->v.ob[0];
min[1] = (f32) start_vtx->v.ob[1]; min[1] = (f32) start_vtx->v.ob[1];
min[2] = (f32) start_vtx->v.ob[2]; min[2] = (f32) start_vtx->v.ob[2];
func_8025235C(min, min); mlMtx_apply_vec3f(min, min);
max[0] = min[0]; max[0] = min[0];
max[1] = min[1]; max[1] = min[1];
max[2] = min[2]; max[2] = min[2];
@@ -61,7 +61,7 @@ void vtxList_getBoundsMlMtxTransformed(BKVertexList *self, f32 min[3], f32 max[3
i_coord[0] = (f32) i_vtx->v.ob[0]; i_coord[0] = (f32) i_vtx->v.ob[0];
i_coord[1] = (f32) i_vtx->v.ob[1]; i_coord[1] = (f32) i_vtx->v.ob[1];
i_coord[2] = (f32) i_vtx->v.ob[2]; i_coord[2] = (f32) i_vtx->v.ob[2];
func_8025235C(i_coord, i_coord); mlMtx_apply_vec3f(i_coord, i_coord);
for(i = 0; i < 3; i++){ for(i = 0; i < 3; i++){
if( i_coord[i] < min[i]){ if( i_coord[i] < min[i]){
@@ -88,7 +88,7 @@ void func_802EC680(BKVertexList *self, s32 arg1, f32 arg2[3], f32 arg3[3]) {
i_coord[0] = (f32) i_vtx->v.ob[0]; i_coord[0] = (f32) i_vtx->v.ob[0];
i_coord[1] = (f32) i_vtx->v.ob[1]; i_coord[1] = (f32) i_vtx->v.ob[1];
i_coord[2] = (f32) i_vtx->v.ob[2]; i_coord[2] = (f32) i_vtx->v.ob[2];
func_8025235C(i_coord, i_coord); mlMtx_apply_vec3f(i_coord, i_coord);
if ((i_vtx == start_vtx) || (i_coord[1] < arg2[1])) { if ((i_vtx == start_vtx) || (i_coord[1] < arg2[1])) {
arg2[1] = i_coord[1]; arg2[1] = i_coord[1];
} }
@@ -100,7 +100,7 @@ void func_802EC680(BKVertexList *self, s32 arg1, f32 arg2[3], f32 arg3[3]) {
i_coord[0] = (f32) i_vtx->v.ob[0]; i_coord[0] = (f32) i_vtx->v.ob[0];
i_coord[1] = (f32) i_vtx->v.ob[1]; i_coord[1] = (f32) i_vtx->v.ob[1];
i_coord[2] = (f32) i_vtx->v.ob[2]; i_coord[2] = (f32) i_vtx->v.ob[2];
func_8025235C(i_coord, i_coord); mlMtx_apply_vec3f(i_coord, i_coord);
if (i_coord[1] < arg3[1]) { if (i_coord[1] < arg3[1]) {
arg2[0] = i_coord[0]; arg2[0] = i_coord[0];
@@ -116,7 +116,7 @@ void func_802EC680(BKVertexList *self, s32 arg1, f32 arg2[3], f32 arg3[3]) {
i_coord[0] = (f32) i_vtx->v.ob[0]; i_coord[0] = (f32) i_vtx->v.ob[0];
i_coord[1] = (f32) i_vtx->v.ob[1]; i_coord[1] = (f32) i_vtx->v.ob[1];
i_coord[2] = (f32) i_vtx->v.ob[2]; i_coord[2] = (f32) i_vtx->v.ob[2];
func_8025235C(i_coord, i_coord); mlMtx_apply_vec3f(i_coord, i_coord);
if (i_coord[1] < arg3[1]) { if (i_coord[1] < arg3[1]) {
for(i = 0; i < 3; i+=2){ for(i = 0; i < 3; i+=2){
if (i_coord[i] < arg2[i]) { if (i_coord[i] < arg2[i]) {
@@ -204,9 +204,18 @@ void vtxList_tint(BKVertexList *dst, s32 target_color[3], f32 amount, BKVertexLi
osWritebackDCache(start_ptr, ((s32)(end_ptr - start_ptr)) * sizeof(Vtx)); osWritebackDCache(start_ptr, ((s32)(end_ptr - start_ptr)) * sizeof(Vtx));
} }
void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 arg2[3], f32 rotation[3], f32 arg4[4]) { /**
f32 sp74[3]; * @note Seems Recolor vtx based on how "in view" a vtx is
f32 sp68[3]; *
* @param dst vertexList to recolor
* @param src vertexList to tak colors from
* @param position vertexlist world position
* @param rotation vertexlist world rotation
* @param arg4 Step function definition
*/
void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 position[3], f32 rotation[3], f32 arg4[4]) {
f32 vp_position[3];
f32 vp_look[3];
Vtx *dst_vtx; Vtx *dst_vtx;
Vtx *start_vtx; Vtx *start_vtx;
Vtx *end_vtx; Vtx *end_vtx;
@@ -216,23 +225,21 @@ void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 arg2[3], f32 rotati
f32 temp_f0; f32 temp_f0;
s32 pad40; s32 pad40;
viewport_getPosition_vec3f(sp74); viewport_getPosition_vec3f(vp_position);
viewport_getLookVector(sp68); viewport_getLookVector(vp_look);
mlMtxIdent(); mlMtxIdent();
func_80252CC4(arg2, rotation, 1.0f, NULL); func_80252CC4(position, rotation, 1.0f, NULL);
func_8025235C(sp74, sp74); mlMtx_apply_vec3f(vp_position, vp_position);
mlMtxIdent(); mlMtxIdent();
func_80252CC4(NULL, rotation, 1.0f, NULL); func_80252CC4(NULL, rotation, 1.0f, NULL);
func_8025235C(sp68, sp68); mlMtx_apply_vec3f(vp_look, vp_look);
start_vtx = (Vtx *)(dst + 1); start_vtx = (Vtx *)(dst + 1);
end_vtx = start_vtx + dst->count; end_vtx = start_vtx + dst->count;
for(dst_vtx = start_vtx, src_vtx = (Vtx *)(src + 1); dst_vtx < end_vtx; dst_vtx++, src_vtx++){ for(dst_vtx = start_vtx, src_vtx = (Vtx *)(src + 1); dst_vtx < end_vtx; dst_vtx++, src_vtx++){
sp4C[0] = dst_vtx->v.ob[0] - sp74[0]; TUPLE_DIFF_COPY(sp4C, dst_vtx->v.ob, vp_position);
sp4C[1] = dst_vtx->v.ob[1] - sp74[1]; temp_f0 = TUPLE_DOT_PRODUCT(vp_look, sp4C);
sp4C[2] = dst_vtx->v.ob[2] - sp74[2];
temp_f0 = sp68[0]*sp4C[0] + sp68[1]*sp4C[1] + sp68[2]*sp4C[2];
temp_f0 = func_8034A9D0(arg4, temp_f0); temp_f0 = func_8034A9D0(arg4, temp_f0);
for(i = 0; i < 3; i++){ for(i = 0; i < 3; i++){
dst_vtx->v.cn[i] = temp_f0*src_vtx->v.cn[i]; dst_vtx->v.cn[i] = temp_f0*src_vtx->v.cn[i];
@@ -333,8 +340,8 @@ void func_802ED180(BKVertexList *self, f32 arg1[3], f32 arg2[3], f32 arg3, f32 a
mlMtxIdent(); mlMtxIdent();
func_80252CC4(arg1, arg2, arg3, arg4); func_80252CC4(arg1, arg2, arg3, arg4);
func_8025235C(sp88, D_803808C0.unk10); mlMtx_apply_vec3f(sp88, D_803808C0.unk10);
func_8025235C(sp7C, D_803808C0.unk4); mlMtx_apply_vec3f(sp7C, D_803808C0.unk4);
temp_f20 = D_803808C0.unk1C / arg3; temp_f20 = D_803808C0.unk1C / arg3;
temp_f20 = temp_f20*temp_f20; temp_f20 = temp_f20*temp_f20;
start = (Vtx*)(self + 1); start = (Vtx*)(self + 1);
@@ -353,7 +360,7 @@ void func_802ED180(BKVertexList *self, f32 arg1[3], f32 arg2[3], f32 arg3, f32 a
D_803808C0.unk0 = 1; D_803808C0.unk0 = 1;
mlMtxIdent(); mlMtxIdent();
func_80252C08(arg1, arg2, arg3, arg4); func_80252C08(arg1, arg2, arg3, arg4);
func_8025235C(D_803808C0.unk20, sp70); mlMtx_apply_vec3f(D_803808C0.unk20, sp70);
} }
} }
} }

View File

@@ -84,7 +84,7 @@ void func_802F1FC0(Struct65s *self, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
spBC = (s32) ((f32)self->unk20 * (1.0f + temp_f2)); spBC = (s32) ((f32)self->unk20 * (1.0f + temp_f2));
temp_s5 = (s32) ((f32)self->unk20 * ((1.0f - (self->unk25 / 255.0f)) + ((self->unk25 / 255.0f) - temp_f2))); temp_s5 = (s32) ((f32)self->unk20 * ((1.0f - (self->unk25 / 255.0f)) + ((self->unk25 / 255.0f) - temp_f2)));
mlMtxSet(&D_80380A18); mlMtxSet(&D_80380A18);
func_8025235C(spD0, spD0); mlMtx_apply_vec3f(spD0, spD0);
spD0[0] = (-297.0f * spD0[0]) / spD0[2]; spD0[0] = (-297.0f * spD0[0]) / spD0[2];
spD0[1] = (297.0f * spD0[1]) / spD0[2]; spD0[1] = (297.0f * spD0[1]) / spD0[2];
spC4 = (s32) (spD0[0] + (f32) (framebuffer_width / 2)); spC4 = (s32) (spD0[0] + (f32) (framebuffer_width / 2));

View File

@@ -231,7 +231,7 @@ bool func_802F989C(Gfx **gfx, Mtx **mtx, f32 arg2[3]) {
) { ) {
func_80251B5C(D_80381070[0], D_80381070[1], D_80381070[2]); func_80251B5C(D_80381070[0], D_80381070[1], D_80381070[2]);
mlMtxApply(*mtx); mlMtxApply(*mtx);
func_80252434(&D_80381080, D_80381094->unkC); mlMtx_apply_vec3f_restricted(&D_80381080, D_80381094->unkC);
func_80251B5C(D_80381080[0], D_80381080[1], D_80381080[2]); func_80251B5C(D_80381080[0], D_80381080[1], D_80381080[2]);
mlMtx_rotate_yaw_deg(D_80381060[1]); mlMtx_rotate_yaw_deg(D_80381060[1]);
mlMtx_rotate_pitch_deg(D_80381060[0]); mlMtx_rotate_pitch_deg(D_80381060[0]);

View File

@@ -1,74 +0,0 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
/* .bss */
u8 D_8037BFE0;
f32 D_8037BFE4;
f32 D_8037BFE8[5];
/* .code */
s32 func_8028FD30(void) {
s32 i;
s32 cnt;
cnt = 0;
for(i = 0; i < 5; i++){
if(D_8037BFE8[i] != 0.0f){
cnt++;
}
}
return cnt;
}
bool func_8028FDC8(f32 arg0) {
s32 i;
for(i = 0; i < 5; i++){
if(arg0 - 0.25 < D_8037BFE8[i]){
D_8037BFE4 = arg0;
return FALSE;
}
}
for(i = 0; i < 5; i++){
if (D_8037BFE8[i] == 0.0f) {
D_8037BFE8[i] = arg0;
return TRUE;
}
}
D_8037BFE4 = arg0;
return FALSE;
}
void func_8028FEF0(void) {
s32 i;
for(i = 0; i < 5; i++){
D_8037BFE8[i] = 0.0f;
}
D_8037BFE0 = D_8037BFE4 = 0.0f;
}
void func_8028FFBC(bool arg0){
D_8037BFE0 = arg0;
if(!D_8037BFE0){
func_8028FEF0();
}
}
void func_8028FFF0(void) {
f32 temp_f0;
s32 i;
if (D_8037BFE0 != 0) {
for(i = 0; i < 5; i++){
func_80259430(&D_8037BFE8[i]);
}
if (D_8037BFE4 != 0.0f) {
temp_f0 = D_8037BFE4;
D_8037BFE4 = 0.0f;
func_8028FDC8(temp_f0);
}
}
}

View File

@@ -45,7 +45,7 @@ extern void func_803334B0(f32 position[3], f32 rotation[3], f32 scale, f32 arg3[
iPtr = start_ptr; iPtr = start_ptr;
for(; iPtr < end_ptr && D_80383570.unk44 < D_80383570.unk48; iPtr++){ for(; iPtr < end_ptr && D_80383570.unk44 < D_80383570.unk48; iPtr++){
if(iPtr->unk34 && ml_distance_vec3f(position, iPtr->unk0) < iPtr->unk1C + arg4){ if(iPtr->unk34 && ml_distance_vec3f(position, iPtr->unk0) < iPtr->unk1C + arg4){
func_8025235C(iPtr->unkC, iPtr->unk0); mlMtx_apply_vec3f(iPtr->unkC, iPtr->unk0);
iPtr->unk20 = iPtr->unk18/scale; iPtr->unk20 = iPtr->unk18/scale;
iPtr->unk24 = iPtr->unk1C/scale; iPtr->unk24 = iPtr->unk1C/scale;
*D_80383570.unk44 = iPtr; *D_80383570.unk44 = iPtr;

View File

@@ -40,7 +40,7 @@ bool func_80340020(Struct83s *self, f32 position[3], f32 arg2[3], f32 arg3, f32
arg7[2] = sp34[0][2] + (self->unk0 * sp6C[2]) + (self->unk4*sp60[2]); arg7[2] = sp34[0][2] + (self->unk0 * sp6C[2]) + (self->unk4*sp60[2]);
mlMtxIdent(); mlMtxIdent();
func_80252C08(position, arg2, arg3, arg4); func_80252C08(position, arg2, arg3, arg4);
func_8025235C(arg7, arg7); mlMtx_apply_vec3f(arg7, arg7);
return TRUE; return TRUE;
} }
@@ -67,7 +67,7 @@ void func_80340200(Struct83s *self, f32 position[3], f32 arg2[3], f32 arg3, f32
self->unk8[2] = arg7[2]; self->unk8[2] = arg7[2];
mlMtxIdent(); mlMtxIdent();
func_80252CC4(position, arg2, arg3, arg4); func_80252CC4(position, arg2, arg3, arg4);
func_8025235C(sp94, arg7); mlMtx_apply_vec3f(sp94, arg7);
for(j = 0; j < 3; j++){ for(j = 0; j < 3; j++){
self->unk14[j] = arg5[j]; self->unk14[j] = arg5[j];
} }

View File

@@ -3,6 +3,14 @@
#include "variables.h" #include "variables.h"
/* .code */ /* .code */
/*
1.0| ,----.
| / \
| / \
0.0|______/ \_____ arg1
| | | |
[2] [3] [0] [1]
*/
f32 func_8034A9D0(f32 arg0[4], f32 arg1) { f32 func_8034A9D0(f32 arg0[4], f32 arg1) {
if (arg0[1] <= arg1) { if (arg0[1] <= arg1) {
return 0.0f; return 0.0f;

View File

@@ -451,7 +451,7 @@ void func_80351C48(void) {
player_getPosition(sp4C); player_getPosition(sp4C);
mlMtxIdent(); mlMtxIdent();
func_80252CC4(D_80386180.unk2C->unk14, D_80386180.unk2C->unk20, D_80386180.unk2C->unk2C, 0); func_80252CC4(D_80386180.unk2C->unk14, D_80386180.unk2C->unk20, D_80386180.unk2C->unk2C, 0);
func_8025235C(D_80386180.unk14, sp4C); mlMtx_apply_vec3f(D_80386180.unk14, sp4C);
if (func_8029FC4C() != 0) { if (func_8029FC4C() != 0) {
D_80386180.unk0 = D_80386180.unk2C; D_80386180.unk0 = D_80386180.unk2C;
} else { } else {
@@ -470,7 +470,7 @@ void func_80351C48(void) {
if (D_80386180.unk2C != NULL) { if (D_80386180.unk2C != NULL) {
mlMtxIdent(); mlMtxIdent();
func_80252C08(D_80386180.unk2C->unk14, D_80386180.unk2C->unk20, D_80386180.unk2C->unk2C, NULL); func_80252C08(D_80386180.unk2C->unk14, D_80386180.unk2C->unk20, D_80386180.unk2C->unk2C, NULL);
func_8025235C(&sp4C, &D_80386180.unk14); mlMtx_apply_vec3f(&sp4C, &D_80386180.unk14);
func_8028FAB0(&sp4C); func_8028FAB0(&sp4C);
} }
D_80386180.unk2C = NULL; D_80386180.unk2C = NULL;

View File

@@ -710,7 +710,7 @@ void func_803384A8(Gfx **gfx, Mtx **mtx, void *arg2){
f32 sp30[3]; f32 sp30[3];
if(cmd->unk8){ if(cmd->unk8){
func_8025235C(sp30, cmd->unkC); mlMtx_apply_vec3f(sp30, cmd->unkC);
mlMtx_push_translation(sp30[0], sp30[1], sp30[2]); mlMtx_push_translation(sp30[0], sp30[1], sp30[2]);
mlMtxRotYaw(modelRenderCameraRotation[1]); mlMtxRotYaw(modelRenderCameraRotation[1]);
if(!cmd->unkA){ if(!cmd->unkA){
@@ -732,8 +732,8 @@ void func_803385BC(Gfx **gfx, Mtx **mtx, void *arg2){
f32 f14; f32 f14;
s32 tmp_v0; s32 tmp_v0;
func_8025235C(D_80383C78, cmd->unk8); mlMtx_apply_vec3f(D_80383C78, cmd->unk8);
func_8025235C(D_80383C88, cmd->unk14); mlMtx_apply_vec3f(D_80383C88, cmd->unk14);
D_80383C68[0] = D_80383C88[0] - D_80383C78[0]; D_80383C68[0] = D_80383C88[0] - D_80383C78[0];
D_80383C68[1] = D_80383C88[1] - D_80383C78[1]; D_80383C68[1] = D_80383C88[1] - D_80383C78[1];
@@ -857,7 +857,7 @@ void func_80338B50(Gfx **gfx, Mtx **mtx, void *arg2){
f32 dist; f32 dist;
if(cmd->subgeo_offset_1C){ if(cmd->subgeo_offset_1C){
func_8025235C(D_80383C98, cmd->unk10); mlMtx_apply_vec3f(D_80383C98, cmd->unk10);
dist = gu_sqrtf(D_80383C98[0]*D_80383C98[0] + D_80383C98[1]*D_80383C98[1] + D_80383C98[2]*D_80383C98[2]); dist = gu_sqrtf(D_80383C98[0]*D_80383C98[0] + D_80383C98[1]*D_80383C98[1] + D_80383C98[2]*D_80383C98[2]);
if(cmd->min_C < dist && dist <= cmd->max_8){ if(cmd->min_C < dist && dist <= cmd->max_8){
func_80339124(gfx, mtx, (BKGeoList*)((s32)cmd + cmd->subgeo_offset_1C)); func_80339124(gfx, mtx, (BKGeoList*)((s32)cmd + cmd->subgeo_offset_1C));
@@ -873,11 +873,11 @@ void func_80338BFC(Gfx **gfx, Mtx **mtx, void *arg2){
if(D_80383650){ if(D_80383650){
if(D_8038371C){ if(D_8038371C){
mlMtx_push_multiplied_2(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unkA)); mlMtx_push_multiplied_2(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unkA));
func_8025235C(sp20, cmd->unkC); mlMtx_apply_vec3f(sp20, cmd->unkC);
mlMtxPop(); mlMtxPop();
} }
else{ else{
func_8025235C(sp20, cmd->unkC); mlMtx_apply_vec3f(sp20, cmd->unkC);
} }
sp20[0] += modelRenderCameraPosition[0]; sp20[0] += modelRenderCameraPosition[0];
sp20[1] += modelRenderCameraPosition[1]; sp20[1] += modelRenderCameraPosition[1];
@@ -968,11 +968,11 @@ void func_80338EB8(Gfx ** gfx, Mtx ** mtx, void *arg2){
sp30 = (f32)cmd->unkE*modelRenderScale; sp30 = (f32)cmd->unkE*modelRenderScale;
if(D_8038371C){ if(D_8038371C){
mlMtx_push_multiplied_2(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unk12)); mlMtx_push_multiplied_2(&D_80383BF8, animMtxList_get(D_8038371C, cmd->unk12));
func_8025235C(sp34, sp34); mlMtx_apply_vec3f(sp34, sp34);
mlMtxPop(); mlMtxPop();
} }
else{ else{
func_8025235C(sp34, sp34); mlMtx_apply_vec3f(sp34, sp34);
} }
sp34[0] += modelRenderCameraPosition[0]; sp34[0] += modelRenderCameraPosition[0];