core2/code_B9090.c done
This commit is contained in:
@@ -50,6 +50,8 @@ typedef void (* GenMethod_5)(s32, s32, s32, s32, s32);
|
|||||||
out##_z = a##_z op b##_z;\
|
out##_z = a##_z op b##_z;\
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define LENGTH_SQ_VEC3F(v) (v[0]*v[0] + v[1]*v[1] + v[2]*v[2])
|
||||||
|
|
||||||
//known it uses "+" instead of "|" for fight/code_9D40.c, func_8039049C, case 6
|
//known it uses "+" instead of "|" for fight/code_9D40.c, func_8039049C, case 6
|
||||||
#define FUNC_8030E624(sfx_e, vol, sample_rate) func_8030E624(\
|
#define FUNC_8030E624(sfx_e, vol, sample_rate) func_8030E624(\
|
||||||
_SHIFTL((vol*1023), 21, 11) + _SHIFTL(sample_rate >> 5, 11, 10) + _SHIFTL(sfx_e, 0, 11)\
|
_SHIFTL((vol*1023), 21, 11) + _SHIFTL(sample_rate >> 5, 11, 10) + _SHIFTL(sfx_e, 0, 11)\
|
||||||
|
@@ -877,4 +877,21 @@ typedef struct {
|
|||||||
struct actor_marker_s *unk18;
|
struct actor_marker_s *unk18;
|
||||||
}Struct81s;
|
}Struct81s;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
enum actor_e actor_id;
|
||||||
|
struct actor_marker_s *marker;
|
||||||
|
f32 position[3];
|
||||||
|
void (*unk14)(struct actor_s *, struct actor_marker_s *);
|
||||||
|
struct actor_marker_s *unk18;
|
||||||
|
}Struct82s;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
f32 unk0;
|
||||||
|
f32 unk4;
|
||||||
|
f32 unk8[3];
|
||||||
|
s16 unk14[3];
|
||||||
|
u8 unk1A;
|
||||||
|
u8 pad1B[1];
|
||||||
|
}Struct83s;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
</mask>
|
</mask>
|
||||||
<g mask="url(#anybadge_1)">
|
<g mask="url(#anybadge_1)">
|
||||||
<path fill="#555" d="M0 0h44v20H0z"/>
|
<path fill="#555" d="M0 0h44v20H0z"/>
|
||||||
<path fill="#61e000" d="M44 0h67v20H44z"/>
|
<path fill="#60e000" d="M44 0h67v20H44z"/>
|
||||||
<path fill="url(#b)" d="M0 0h111v20H0z"/>
|
<path fill="url(#b)" d="M0 0h111v20H0z"/>
|
||||||
</g>
|
</g>
|
||||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<text x="22.0" y="14">core2</text>
|
<text x="22.0" y="14">core2</text>
|
||||||
</g>
|
</g>
|
||||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
||||||
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">78.2801%</text>
|
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">78.4831%</text>
|
||||||
<text x="77.5" y="14">78.2801%</text>
|
<text x="77.5" y="14">78.4831%</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
@@ -17,7 +17,7 @@
|
|||||||
<text x="75.0" y="14">Banjo-Kazooie (us.v10)</text>
|
<text x="75.0" y="14">Banjo-Kazooie (us.v10)</text>
|
||||||
</g>
|
</g>
|
||||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
||||||
<text x="184.5" y="15" fill="#010101" fill-opacity=".3">82.3300%</text>
|
<text x="184.5" y="15" fill="#010101" fill-opacity=".3">82.4464%</text>
|
||||||
<text x="183.5" y="14">82.3300%</text>
|
<text x="183.5" y="14">82.4464%</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -2,13 +2,142 @@
|
|||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
|
|
||||||
|
#define ABS(s) (((s) >= 0) ? (s) : -(s))
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9090/func_80340020.s")
|
extern void func_80252CC4(f32[3], f32[3], f32, f32[3]);
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9090/func_80340200.s")
|
/* .code */
|
||||||
|
bool func_80340020(Struct83s *self, f32 position[3], f32 arg2[3], f32 arg3, f32 *arg4, BKVertexList *arg5, f32 arg6[3], f32 arg7[3]) {
|
||||||
|
f32 sp6C[3];
|
||||||
|
f32 sp60[3];
|
||||||
|
s32 i;
|
||||||
|
s32 j;
|
||||||
|
f32 sp34[3][3];
|
||||||
|
Vtx *var_a0;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9090/func_80340690.s")
|
if (!self->unk1A) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
self->unk1A = FALSE;
|
||||||
|
if (0.1 < ml_vec3f_distance(arg6, self->unk8)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
for(i = 0; i < 3; i++){
|
||||||
|
var_a0 = arg5->vtx_18 + self->unk14[i];
|
||||||
|
for(j = 0; j < 3; j++){
|
||||||
|
sp34[i][j] = var_a0->v.ob[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sp6C[0] = sp34[1][0] - sp34[0][0];
|
||||||
|
sp6C[1] = sp34[1][1] - sp34[0][1];
|
||||||
|
sp6C[2] = sp34[1][2] - sp34[0][2];
|
||||||
|
sp60[0] = sp34[2][0] - sp34[0][0];
|
||||||
|
sp60[1] = sp34[2][1] - sp34[0][1];
|
||||||
|
sp60[2] = sp34[2][2] - sp34[0][2];
|
||||||
|
arg7[0] = sp34[0][0] + (self->unk0 * sp6C[0]) + (self->unk4*sp60[0]);
|
||||||
|
arg7[1] = sp34[0][1] + (self->unk0 * sp6C[1]) + (self->unk4*sp60[1]);
|
||||||
|
arg7[2] = sp34[0][2] + (self->unk0 * sp6C[2]) + (self->unk4*sp60[2]);
|
||||||
|
mlMtxIdent();
|
||||||
|
func_80252C08(position, arg2, arg3, arg4);
|
||||||
|
func_8025235C(arg7, arg7);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9090/func_803406B0.s")
|
void func_80340200(Struct83s *self, f32 position[3], f32 arg2[3], f32 arg3, f32 arg4[3], s16 arg5[3], BKVertexList *arg6, f32 arg7[3]) {
|
||||||
|
f32 spAC[3];
|
||||||
|
f32 spA0[3];
|
||||||
|
f32 sp94[3];
|
||||||
|
f32 sp88[3];
|
||||||
|
f32 sp7C[3];
|
||||||
|
s32 j;
|
||||||
|
s32 var_v0;
|
||||||
|
Vtx *var_a0;
|
||||||
|
s32 temp_hi;
|
||||||
|
s32 temp_hi_2;
|
||||||
|
s32 var_a0_2;
|
||||||
|
f32 sp58[3];
|
||||||
|
f32 sp34[3][3];
|
||||||
|
f32 temp_f0_3;
|
||||||
|
f32 var_f0;
|
||||||
|
f32 var_f12;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9090/func_803406D4.s")
|
self->unk8[0] = arg7[0];
|
||||||
|
self->unk8[1] = arg7[1];
|
||||||
|
self->unk8[2] = arg7[2];
|
||||||
|
mlMtxIdent();
|
||||||
|
func_80252CC4(position, arg2, arg3, arg4);
|
||||||
|
func_8025235C(sp94, arg7);
|
||||||
|
for(j = 0; j < 3; j++){
|
||||||
|
self->unk14[j] = arg5[j];
|
||||||
|
}
|
||||||
|
|
||||||
|
for(j = 0; j < 3; j++){
|
||||||
|
var_a0 = arg6->vtx_18 + self->unk14[j];
|
||||||
|
for(var_v0 = 0; var_v0 < 3; var_v0++){
|
||||||
|
sp34[j][var_v0] = (f32)var_a0->v.ob[var_v0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spAC[0] = sp34[1][0] - sp34[0][0];
|
||||||
|
spAC[1] = sp34[1][1] - sp34[0][1];
|
||||||
|
spAC[2] = sp34[1][2] - sp34[0][2];
|
||||||
|
|
||||||
|
spA0[0] = sp34[2][0] - sp34[0][0];
|
||||||
|
spA0[1] = sp34[2][1] - sp34[0][1];
|
||||||
|
spA0[2] = sp34[2][2] - sp34[0][2];
|
||||||
|
|
||||||
|
sp58[0] = (spAC[1] * spA0[2]) - (spAC[2] * spA0[1]);
|
||||||
|
sp58[1] = (spAC[2] * spA0[0]) - (spAC[0] * spA0[2]);
|
||||||
|
sp58[2] = (spAC[0] * spA0[1]) - (spAC[1] * spA0[0]);
|
||||||
|
|
||||||
|
if ((100000.0f < sp58[0]) || (100000.0f < sp58[1]) || (100000.0f < sp58[2])
|
||||||
|
|| ((sp58[0] < -100000.0f)) || (sp58[1] < -100000.0f) || (sp58[2] < -100000.0f)
|
||||||
|
) {
|
||||||
|
sp58[0] /= 100000.0f;
|
||||||
|
sp58[1] /= 100000.0f;
|
||||||
|
sp58[2] /= 100000.0f;
|
||||||
|
}
|
||||||
|
if (gu_sqrtf(LENGTH_SQ_VEC3F(sp58)) < 0.001) {
|
||||||
|
self->unk1A = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var_a0_2 = 1;
|
||||||
|
|
||||||
|
var_f12 = ABS(sp58[0]);
|
||||||
|
var_f0 = ABS(sp58[1]);
|
||||||
|
var_a0_2 = (var_f0 < var_f12) ? 0 : 1;
|
||||||
|
|
||||||
|
var_f12 = ABS(sp58[2]);
|
||||||
|
var_f0 = ABS(sp58[var_a0_2]);
|
||||||
|
var_a0_2 = (var_f0 < var_f12) ? 2 : var_a0_2;
|
||||||
|
|
||||||
|
temp_hi = (var_a0_2 + 1) % 3;
|
||||||
|
temp_hi_2 = (var_a0_2 + 2) % 3;
|
||||||
|
sp88[0] = sp94[temp_hi] - sp34[0][temp_hi];
|
||||||
|
sp88[1] = spAC[temp_hi];
|
||||||
|
sp88[2] = spA0[temp_hi];
|
||||||
|
|
||||||
|
sp7C[0] = sp94[temp_hi_2] - sp34[0][temp_hi_2];
|
||||||
|
sp7C[1] = spAC[temp_hi_2];
|
||||||
|
sp7C[2] = spA0[temp_hi_2];
|
||||||
|
|
||||||
|
temp_f0_3 = (sp88[1] * sp7C[2]) - (sp7C[1]*sp88[2]);
|
||||||
|
self->unk0 = ((sp88[0] * sp7C[2]) - (sp7C[0] * sp88[2])) / temp_f0_3;
|
||||||
|
self->unk4 = ((sp88[1] * sp7C[0]) - (sp7C[1] * sp88[0])) / temp_f0_3;
|
||||||
|
self->unk1A = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void func_80340690(Struct83s *self){
|
||||||
|
free(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
Struct83s * func_803406B0(void){
|
||||||
|
Struct83s *self = malloc(sizeof(Struct83s));
|
||||||
|
self->unk1A = 0;
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
Struct83s * func_803406D4(Struct83s *self){
|
||||||
|
return (Struct83s *)defrag(self);
|
||||||
|
}
|
||||||
|
@@ -17,9 +17,12 @@ extern s32 D_80371E7C;
|
|||||||
/* .bss */
|
/* .bss */
|
||||||
s16 *D_803858A0;
|
s16 *D_803858A0;
|
||||||
|
|
||||||
|
/* .code */
|
||||||
f32 func_80340700(f32, f32, f32);
|
f32 func_80340700(f32 value, f32 min, f32 max) {
|
||||||
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80340700.s")
|
return (value < min) ? min
|
||||||
|
: (max < value) ? max
|
||||||
|
: value;
|
||||||
|
}
|
||||||
|
|
||||||
bool func_80340748(s32 arg0, s32 arg1, s32 arg2, s32 arg3){
|
bool func_80340748(s32 arg0, s32 arg1, s32 arg2, s32 arg3){
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@@ -345,7 +345,7 @@ segments:
|
|||||||
- [0xB8070, c, code_B8070] #DONE
|
- [0xB8070, c, code_B8070] #DONE
|
||||||
- [0xB8080, c, code_B8080]
|
- [0xB8080, c, code_B8080]
|
||||||
- [0xB8860, c, code_B8860] #DONE
|
- [0xB8860, c, code_B8860] #DONE
|
||||||
- [0xB9090, c, code_B9090]
|
- [0xB9090, c, code_B9090] #DONE
|
||||||
- [0xB9770, c, code_B9770]
|
- [0xB9770, c, code_B9770]
|
||||||
- [0xBD100, c, code_BD100] #DONE
|
- [0xBD100, c, code_BD100] #DONE
|
||||||
- [0xBDCC0, c, code_BDCC0] #DONE
|
- [0xBDCC0, c, code_BDCC0] #DONE
|
||||||
@@ -768,7 +768,8 @@ segments:
|
|||||||
- [0xF1FD0, .rodata, string]
|
- [0xF1FD0, .rodata, string]
|
||||||
- [0xF1FF0, bin, code_B6C60]
|
- [0xF1FF0, bin, code_B6C60]
|
||||||
- [0xF2000, .rodata, code_B6CE0]
|
- [0xF2000, .rodata, code_B6CE0]
|
||||||
- [0xF2030, bin, data_F2030]
|
- [0xF2030, .rodata, code_B9090]
|
||||||
|
- [0xF2060, bin, data_F2060]
|
||||||
- [0xF20F0, .rodata, code_BD100]
|
- [0xF20F0, .rodata, code_BD100]
|
||||||
- [0xF2110, .rodata, code_BDCC0]
|
- [0xF2110, .rodata, code_BDCC0]
|
||||||
- [0xF2130, .rodata, code_BE2C0]
|
- [0xF2130, .rodata, code_BE2C0]
|
||||||
|
@@ -452,6 +452,8 @@ D_80378F48 = 0x80378F48;
|
|||||||
D_80378F60 = 0x80378F60;
|
D_80378F60 = 0x80378F60;
|
||||||
D_80378F64 = 0x80378F64;
|
D_80378F64 = 0x80378F64;
|
||||||
D_80378F68 = 0x80378F68;
|
D_80378F68 = 0x80378F68;
|
||||||
|
D_80378FC8 = 0x80378FC8;
|
||||||
|
D_80378FCC = 0x80378FCC;
|
||||||
D_80379080 = 0x80379080;
|
D_80379080 = 0x80379080;
|
||||||
D_80379084 = 0x80379084;
|
D_80379084 = 0x80379084;
|
||||||
D_80379088 = 0x80379088;
|
D_80379088 = 0x80379088;
|
||||||
|
Reference in New Issue
Block a user