card.c progress
This commit is contained in:
parent
d282dfef4e
commit
9ab1548adb
3 changed files with 327 additions and 8 deletions
|
|
@ -1,6 +1,37 @@
|
|||
#include "REL/m446Dll.h"
|
||||
|
||||
#include "game/hsfman.h"
|
||||
#include "math.h"
|
||||
|
||||
// data
|
||||
m446Func5 lbl_1_data_150[3] = {0};
|
||||
const s32 lbl_1_rodata_58[5] = {0x4D0001, 0x4D0002, 0x4D0003, 0x4D0004, 0x4D0000};
|
||||
const s32 lbl_1_rodata_6C[5] = {0x4D001B, 0x4D001C, 0x4D001D, 0x4D001E, 0x4D001E};
|
||||
|
||||
// bss
|
||||
unkStruct4* lbl_1_bss_18;
|
||||
|
||||
// prototype
|
||||
unkStruct2* fn_1_1C64(s32);
|
||||
void fn_1_1CF8(unkStruct2*);
|
||||
s32 fn_1_1D30(unkStruct2*, s32);
|
||||
s32 fn_1_1D6C(unkStruct2*, s32*);
|
||||
s32 fn_1_1DA8(unkStruct2*, s32*);
|
||||
BOOL fn_1_1DDC(unkStruct2*);
|
||||
s32 fn_1_1DEC(unkStruct2*);
|
||||
unkStruct4* fn_1_1DF4(unkStruct5*);
|
||||
void fn_1_1E5C(unkStruct4*);
|
||||
void fn_1_1E84(unkStruct3**);
|
||||
void fn_1_1EC8(unkStruct4*, unkStruct4*);
|
||||
void fn_1_1F04(unkStruct4*);
|
||||
void fn_1_1F38(u8*, u8*, s32);
|
||||
void fn_1_1F84(u8*, s8, s32);
|
||||
void fn_1_1FC0(u8*, s32);
|
||||
s32 fn_1_1FFC(s8*, s8*, s32);
|
||||
s32 fn_1_2064(void);
|
||||
void fn_1_207C(void);
|
||||
// ...
|
||||
void fn_1_2688(unkStruct5*);
|
||||
|
||||
unkStruct2* fn_1_1C64(s32 arg0) {
|
||||
unkStruct2* temp_r3;
|
||||
|
|
@ -61,19 +92,247 @@ s32 fn_1_1DEC(unkStruct2* arg0) {
|
|||
return arg0->unk8;
|
||||
}
|
||||
|
||||
unkStruct3* fn_1_1DF4(s32 arg0) {
|
||||
unkStruct3* temp_r3;
|
||||
#pragma dont_inline on
|
||||
|
||||
unkStruct4* fn_1_1DF4(unkStruct5* arg0) {
|
||||
unkStruct4* temp_r3;
|
||||
|
||||
temp_r3 = HuMemDirectMallocNum(HEAP_SYSTEM, 0xC, 0x10000000);
|
||||
if (!temp_r3) {
|
||||
return NULL;
|
||||
}
|
||||
temp_r3->unk4 = 0;
|
||||
temp_r3->unk8 = 0;
|
||||
temp_r3->unk4 = NULL;
|
||||
temp_r3->unk8 = NULL;
|
||||
temp_r3->unk0 = arg0;
|
||||
return temp_r3;
|
||||
}
|
||||
|
||||
void fn_1_1E5C(unkStruct3* arg0) {
|
||||
void fn_1_1E5C(unkStruct4* arg0) {
|
||||
HuMemDirectFree(arg0);
|
||||
}
|
||||
|
||||
void fn_1_1E84(unkStruct3** arg0) {
|
||||
unkStruct3 *temp = *arg0;
|
||||
HuMemDirectFree(temp);
|
||||
*arg0 = NULL;
|
||||
}
|
||||
|
||||
void fn_1_1EC8(unkStruct4* arg0, unkStruct4* arg1) {
|
||||
if (arg0) {
|
||||
arg1->unk8 = arg0->unk8;
|
||||
arg1->unk4 = arg0;
|
||||
arg0->unk8 = arg1;
|
||||
if (arg1->unk8) {
|
||||
arg1->unk8->unk4 = arg1;
|
||||
}
|
||||
} else {
|
||||
arg1->unk4 = arg1;
|
||||
arg1->unk8 = arg1;
|
||||
}
|
||||
}
|
||||
|
||||
void fn_1_1F04(unkStruct4* arg0) {
|
||||
if (arg0->unk8) {
|
||||
arg0->unk8->unk4 = arg0->unk4;
|
||||
}
|
||||
if (arg0->unk4) {
|
||||
arg0->unk4->unk8 = arg0->unk8;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
void fn_1_1F38(u8* arg0, u8* arg1, s32 arg2) {
|
||||
u8* var_r30 = arg0;
|
||||
u8* var_r31 = arg1;
|
||||
if (arg2 <= 0) {
|
||||
return;
|
||||
}
|
||||
while (arg2-- != 0) {
|
||||
*var_r30 = *var_r31++;
|
||||
*var_r30++;
|
||||
}
|
||||
}
|
||||
|
||||
void fn_1_1F84(u8* arg0, s8 arg1, s32 arg2) {
|
||||
u8* var_r30 = arg0;
|
||||
if (arg2 <= 0) {
|
||||
return;
|
||||
}
|
||||
while (arg2-- != 0) {
|
||||
*var_r30 = arg1;
|
||||
*var_r30++;
|
||||
}
|
||||
}
|
||||
|
||||
void fn_1_1FC0(u8* arg0, s32 arg1) {
|
||||
u8* var_r30 = arg0;
|
||||
if (arg1 <= 0) {
|
||||
return;
|
||||
}
|
||||
while (arg1-- != 0) {
|
||||
*var_r30 = 0;
|
||||
*var_r30++;
|
||||
}
|
||||
}
|
||||
|
||||
s32 fn_1_1FFC(s8* arg0, s8* arg1, s32 arg2) {
|
||||
s8* var_r30 = arg0;
|
||||
s8* var_r31 = arg1;
|
||||
|
||||
if (arg2 <= 0) {
|
||||
return 0;
|
||||
}
|
||||
while (*var_r30 == *var_r31) {
|
||||
var_r30++;
|
||||
var_r31++;
|
||||
}
|
||||
return *var_r30 - *var_r31;
|
||||
}
|
||||
|
||||
s32 fn_1_2064(void) {
|
||||
lbl_1_bss_18 = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void fn_1_207C(void) {
|
||||
unkStruct5* var_r30;
|
||||
unkStruct4* var_r31;
|
||||
|
||||
var_r31 = lbl_1_bss_18;
|
||||
if (var_r31) {
|
||||
do {
|
||||
var_r30 = var_r31->unk0;
|
||||
fn_1_2688(var_r30);
|
||||
var_r31 = var_r31->unk8;
|
||||
} while (var_r31);
|
||||
}
|
||||
}
|
||||
|
||||
void fn_1_20D4(void) {
|
||||
m446Func1 *temp_r4;
|
||||
f32 temp_f31;
|
||||
s32 temp_r5;
|
||||
unkStruct5* temp_r31;
|
||||
unkStruct4* var_r30;
|
||||
|
||||
var_r30 = lbl_1_bss_18;
|
||||
if (var_r30) {
|
||||
do {
|
||||
temp_r31 = var_r30->unk0;
|
||||
if (lbl_1_data_150[temp_r31->unk4]) {
|
||||
lbl_1_data_150[temp_r31->unk4](temp_r31);
|
||||
}
|
||||
if (temp_r31->unk70 != 0) {
|
||||
if (temp_r31->unk7C > 0) {
|
||||
temp_r31->unk7C--;
|
||||
} else {
|
||||
temp_f31 = sin((M_PI * (90.0f * temp_r31->unk80)) / 180.0);
|
||||
temp_r31->unk10.x = temp_r31->unk1C.x + (temp_f31 * (temp_r31->unk28.x - temp_r31->unk1C.x));
|
||||
temp_r31->unk10.y = temp_r31->unk1C.y + (temp_f31 * (temp_r31->unk28.y - temp_r31->unk1C.y));
|
||||
temp_r31->unk10.z = temp_r31->unk1C.z + (temp_f31 * (temp_r31->unk28.z - temp_r31->unk1C.z));
|
||||
temp_r31->unk80 = temp_r31->unk80 + temp_r31->unk84;
|
||||
if (temp_r31->unk80 >= 1.0f) {
|
||||
temp_r31->unk10.x = temp_r31->unk28.x;
|
||||
temp_r31->unk10.y = temp_r31->unk28.y;
|
||||
temp_r31->unk10.z = temp_r31->unk28.z;
|
||||
temp_r31->unk70 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (temp_r31->unk74 != 0) {
|
||||
temp_f31 = sin((M_PI * (90.0f * temp_r31->unk88)) / 180.0);
|
||||
temp_r31->unk34.x = (temp_r31->unk40.x + (temp_f31 * (temp_r31->unk4C.x - temp_r31->unk40.x)));
|
||||
temp_r31->unk34.y = (temp_r31->unk40.y + (temp_f31 * (temp_r31->unk4C.y - temp_r31->unk40.y)));
|
||||
temp_r31->unk34.z = (temp_r31->unk40.z + (temp_f31 * (temp_r31->unk4C.z - temp_r31->unk40.z)));
|
||||
temp_r31->unk88 = (temp_r31->unk88 + temp_r31->unk8C);
|
||||
if (temp_r31->unk88 >= 1.0f) {
|
||||
temp_r31->unk34.x = temp_r31->unk4C.x;
|
||||
temp_r31->unk34.y = temp_r31->unk4C.y;
|
||||
temp_r31->unk34.z = temp_r31->unk4C.z;
|
||||
temp_r31->unk74 = 0;
|
||||
}
|
||||
}
|
||||
if (temp_r31->unk78 != 0) {
|
||||
temp_f31 = sin((M_PI * (90.0f * temp_r31->unk90)) / 180.0);
|
||||
temp_r31->unk58 = (temp_r31->unk5C + (temp_f31 * (temp_r31->unk60 - temp_r31->unk5C)));
|
||||
temp_r31->unk90 = (temp_r31->unk90 + temp_r31->unk94);
|
||||
if (temp_r31->unk90 >= 1.0f) {
|
||||
temp_r31->unk58 = temp_r31->unk60;
|
||||
temp_r31->unk78 = 0;
|
||||
}
|
||||
}
|
||||
fn_1_2F64(temp_r31);
|
||||
var_r30 = var_r30->unk8;
|
||||
} while (var_r30);
|
||||
}
|
||||
}
|
||||
|
||||
unkStruct5* fn_1_240C(s32 arg0) {
|
||||
unkStruct5* temp_r31;
|
||||
unkStruct4* temp_r30;
|
||||
|
||||
temp_r31 = HuMemDirectMallocNum(HEAP_SYSTEM, 0x98, 0x10000000U);
|
||||
if (!temp_r31) {
|
||||
OSReport("[!] m446CardCreate ERROR\n");
|
||||
return NULL;
|
||||
}
|
||||
temp_r31->unk0 = arg0;
|
||||
temp_r31->unk4 = 0;
|
||||
temp_r31->unk10.x = 0.0f;
|
||||
temp_r31->unk10.y = 0.0f;
|
||||
temp_r31->unk10.z = 0.0f;
|
||||
temp_r31->unk34.x = 0.0f;
|
||||
temp_r31->unk34.y = 0.0f;
|
||||
temp_r31->unk34.z = 180.0f;
|
||||
temp_r31->unk58 = 1.0f;
|
||||
temp_r31->unk64 = 0;
|
||||
temp_r31->unk68 = 1;
|
||||
temp_r31->unk6C = 0;
|
||||
temp_r31->unk70 = 0;
|
||||
temp_r31->unk74 = 0;
|
||||
temp_r31->unk78 = 0;
|
||||
temp_r31->unk7C = 0;
|
||||
temp_r31->unkA = Hu3DModelCreate(HuDataSelHeapReadNum(lbl_1_rodata_58[arg0], 0x10000000, HEAP_DATA));
|
||||
Hu3DModelAmbSet(temp_r31->unkA, 0.0f, 0.0f, 0.0f);
|
||||
Hu3DModelShadowSet(temp_r31->unkA);
|
||||
Hu3DModelLayerSet(temp_r31->unkA, 0);
|
||||
temp_r31->unkC = Hu3DModelCreate(HuDataSelHeapReadNum(lbl_1_rodata_6C[arg0], 0x10000000, HEAP_DATA));
|
||||
Hu3DModelAmbSet(temp_r31->unkC, 1.0f, 1.0f, 1.0f);
|
||||
Hu3DModelAttrSet(temp_r31->unkC, 0x40000001U);
|
||||
Hu3DModelLayerSet(temp_r31->unkA, 0);
|
||||
fn_1_2A58(temp_r31);
|
||||
fn_1_2EC0(temp_r31, 1);
|
||||
temp_r30 = fn_1_1DF4(temp_r31);
|
||||
if (!temp_r30) {
|
||||
OSReport("[!] m446CardCreate ERROR\n");
|
||||
HuMemDirectFree(temp_r31);
|
||||
return NULL;
|
||||
}
|
||||
if (lbl_1_bss_18) {
|
||||
fn_1_1EC8(lbl_1_bss_18, temp_r30);
|
||||
} else {
|
||||
lbl_1_bss_18 = (unkStruct4*)temp_r30;
|
||||
}
|
||||
return temp_r31;
|
||||
}
|
||||
|
||||
void fn_1_2688(unkStruct5* arg0) {
|
||||
unkStruct4* var_r31 = lbl_1_bss_18;
|
||||
loop_1:
|
||||
if (arg0 == var_r31->unk0) {
|
||||
if (var_r31 == lbl_1_bss_18) {
|
||||
lbl_1_bss_18 = var_r31->unk8;
|
||||
}
|
||||
fn_1_1F04(var_r31);
|
||||
fn_1_1E5C(var_r31);
|
||||
Hu3DModelKill(arg0->unkA);
|
||||
Hu3DModelKill(arg0->unkC);
|
||||
HuMemDirectFree(arg0);
|
||||
return;
|
||||
}
|
||||
var_r31 = var_r31->unk8;
|
||||
if (var_r31) {
|
||||
goto loop_1;
|
||||
}
|
||||
}
|
||||
|
|
@ -205,7 +205,7 @@ void fn_1_3FC(unkStruct* arg0) {
|
|||
HuMemDirectFree(arg0);
|
||||
}
|
||||
|
||||
m446Func lbl_1_data_A0[5] = {fn_1_53C, fn_1_B78, fn_1_CA0, fn_1_C0C, fn_1_958};
|
||||
m446Func1 lbl_1_data_A0[5] = {fn_1_53C, fn_1_B78, fn_1_CA0, fn_1_C0C, fn_1_958};
|
||||
|
||||
void fn_1_4B4(unkStruct* arg0) {
|
||||
if (lbl_1_data_A0[arg0->unk0]) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue