FP/code_45D0.c done

This commit is contained in:
Banjo Kazooie
2022-09-23 15:43:44 -05:00
parent 20e086e554
commit fcc47a2f7d
5 changed files with 6316 additions and 13 deletions

View File

@@ -39,10 +39,69 @@ Actor *func_80387DD0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
return func_80325888(marker, gfx, mtx, vtx);
}
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_19E0/func_80387EE4.s")
#else
bool func_80387EE4(Actor *this) {
ActorLocal_FP_19E0 *local = (ActorLocal_FP_19E0 *)&this->local;
f32 temp_f2;
f32 temp_f0;
f32 temp_f20;
f32 temp_f22;
f32 sp38[3];
f32 sp34;
f32 temp_f12;
f32 temp_f14;
s32 var_v1;
player_getPosition(sp38);
temp_f22 = (this->unk1C[0] - this->position[0]);
temp_f20 = (this->position[2] - this->unk1C[2]);
temp_f2 = ((temp_f20 * this->position[0]) + (temp_f22* this->position[2]));
temp_f0 = ((temp_f20 * sp38[0]) + (temp_f22*sp38[2]));
sp34 = ((sp38[0] - this->position[0]) * temp_f22) + ((sp38[2] - this->position[2])*(this->unk1C[2] - this->position[2]));
var_v1 = (temp_f0 < temp_f2) ? 1 : 0;
if (!(this->initialized) || (local->unk0 == var_v1) || !(sp34 >= 0.0f) || !(sp34 <= ((temp_f20 * temp_f20) + (temp_f22 * temp_f22)))) {
local->unk0 = var_v1;
this->initialized = TRUE;
return 0;
}
local->unk0 = var_v1;
return 1;
}
#endif
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_19E0/func_80388000.s")
#else
bool func_80388000(Actor *this) {
ActorLocal_FP_19E0 *local = (ActorLocal_FP_19E0 *)&this->local;
f32 sp38[3];
f32 sp34;
f32 temp_f0;
f32 temp_f12;
f32 temp_f20;
f32 temp_f22;
f32 temp_f2;
s32 var_v1;
func_8038A09C(sp38, this);
temp_f22 = (this->unk1C[0] - this->position[0]);
temp_f20 = (this->position[2] - this->unk1C[2]);
temp_f2 = ((temp_f20 * this->position[0]) + (temp_f22* this->position[2]));
temp_f0 = ((temp_f20 * sp38[0]) + (temp_f22*sp38[2]));
sp34 = ((sp38[0] - this->position[0]) * temp_f22) + ((sp38[2] - this->position[2])*(this->unk1C[2] - this->position[2]));
var_v1 = ((temp_f0 < temp_f2)? 1 : 0) ;
if ((this->velocity[2] == 0.0f) || (local->unk1 == var_v1) || !(sp34 >= 0.0f) || !(sp34 <= ((temp_f20 * temp_f20) + (temp_f22 * temp_f22)))) {
local->unk1 = var_v1;
this->velocity[2] = 1.0f;
return FALSE;
}
local->unk1 = var_v1;
return TRUE;
}
#endif
void func_8038811C(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);

View File

@@ -33,15 +33,12 @@ void func_8038A9C0(void){
void func_8038AA58(void){}
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_45D0/func_8038AA60.s")
#else
void func_8038AA60(void){
switch(D_80392F50.unk0){
case 1:
if(D_80392F50.unk4 <= 0){
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
D_80392F50.unk0 = 2;
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
D_80392F50.unk8 = 0;
}
break;
@@ -64,16 +61,11 @@ void func_8038AA60(void){
D_80392F50.unk8++;
}
break;
default:
case 0:
case 3://L8038A96C
break;
}
}
#endif
void func_8038AB40(void){
D_80392F50.unk4--;