Merge pull request #302 from abnormalhare/main

m446Dll/card.c
This commit is contained in:
Liam Coleman 2024-05-21 10:04:28 -05:00 committed by GitHub
commit 7f29533b7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 721 additions and 95 deletions

View file

@ -133,23 +133,23 @@ lbl_1_rodata_18 = .rodata:0x00000018; // type:object size:0x30 data:4byte
lbl_1_rodata_48 = .rodata:0x00000048; // type:object size:0x4 data:float
lbl_1_rodata_4C = .rodata:0x0000004C; // type:object size:0x4 data:float
lbl_1_rodata_50 = .rodata:0x00000050; // type:object size:0x8 data:float
lbl_1_rodata_58 = .rodata:0x00000058; // type:object size:0x14
lbl_1_rodata_6C = .rodata:0x0000006C; // type:object size:0x14
lbl_1_rodata_80 = .rodata:0x00000080; // type:object size:0x8 data:double
lbl_1_rodata_88 = .rodata:0x00000088; // type:object size:0x4 data:float
lbl_1_rodata_90 = .rodata:0x00000090; // type:object size:0x8 data:double
lbl_1_rodata_98 = .rodata:0x00000098; // type:object size:0x4 data:float
lbl_1_rodata_9C = .rodata:0x0000009C; // type:object size:0x4 data:float
lbl_1_rodata_A0 = .rodata:0x000000A0; // type:object size:0x4 data:float
lbl_1_rodata_A8 = .rodata:0x000000A8; // type:object size:0x8 data:double
lbl_1_rodata_B0 = .rodata:0x000000B0; // type:object size:0x4 data:float
lbl_1_rodata_B4 = .rodata:0x000000B4; // type:object size:0x4 data:float
lbl_1_rodata_B8 = .rodata:0x000000B8; // type:object size:0x4 data:float
lbl_1_rodata_BC = .rodata:0x000000BC; // type:object size:0x4 data:float
lbl_1_rodata_C0 = .rodata:0x000000C0; // type:object size:0x4 data:float
lbl_1_rodata_C4 = .rodata:0x000000C4; // type:object size:0x4 data:float
lbl_1_rodata_C8 = .rodata:0x000000C8; // type:object size:0x4 data:float
lbl_1_rodata_CC = .rodata:0x000000CC; // type:object size:0x4 data:float
lbl_1_rodata_58 = .rodata:0x00000058; // type:object size:0x14 scope:local
lbl_1_rodata_6C = .rodata:0x0000006C; // type:object size:0x14 scope:local
lbl_1_rodata_80 = .rodata:0x00000080; // type:object size:0x8 scope:local data:double
lbl_1_rodata_88 = .rodata:0x00000088; // type:object size:0x4 scope:local data:float
lbl_1_rodata_90 = .rodata:0x00000090; // type:object size:0x8 scope:local data:double
lbl_1_rodata_98 = .rodata:0x00000098; // type:object size:0x4 scope:local data:float
lbl_1_rodata_9C = .rodata:0x0000009C; // type:object size:0x4 scope:local data:float
lbl_1_rodata_A0 = .rodata:0x000000A0; // type:object size:0x4 scope:local data:float
lbl_1_rodata_A8 = .rodata:0x000000A8; // type:object size:0x8 scope:local data:double
lbl_1_rodata_B0 = .rodata:0x000000B0; // type:object size:0x4 scope:local data:float
lbl_1_rodata_B4 = .rodata:0x000000B4; // type:object size:0x4 scope:local data:float
lbl_1_rodata_B8 = .rodata:0x000000B8; // type:object size:0x4 scope:local data:float
lbl_1_rodata_BC = .rodata:0x000000BC; // type:object size:0x4 scope:local data:float
lbl_1_rodata_C0 = .rodata:0x000000C0; // type:object size:0x4 scope:local data:float
lbl_1_rodata_C4 = .rodata:0x000000C4; // type:object size:0x4 scope:local data:float
lbl_1_rodata_C8 = .rodata:0x000000C8; // type:object size:0x4 scope:local data:float
lbl_1_rodata_CC = .rodata:0x000000CC; // type:object size:0x4 scope:local data:float
lbl_1_rodata_D0 = .rodata:0x000000D0; // type:object size:0x28
lbl_1_rodata_F8 = .rodata:0x000000F8; // type:object size:0x4 data:float
lbl_1_rodata_FC = .rodata:0x000000FC; // type:object size:0x4 data:float
@ -257,7 +257,7 @@ lbl_1_data_A0 = .data:0x000000A0; // type:object size:0x14
jumptable_1_data_B4 = .data:0x000000B4; // type:object size:0x30 scope:local
jumptable_1_data_E4 = .data:0x000000E4; // type:object size:0x68 scope:local
lbl_1_data_150 = .data:0x00000150; // type:object size:0xC
lbl_1_data_15C = .data:0x0000015C; // type:object size:0x20
lbl_1_data_15C = .data:0x0000015C; // type:object size:0x20 scope:local
jumptable_1_data_17C = .data:0x0000017C; // type:object size:0x2C scope:local
lbl_1_data_1A8 = .data:0x000001A8; // type:object size:0x1F data:string
lbl_1_data_1C7 = .data:0x000001C7; // type:object size:0x1F

View file

@ -1168,7 +1168,7 @@ config.libs = [
objects={
Object(Matching, "REL/executor.c"),
Object(NonMatching, "REL/m446dll/main.c"),
Object(NonMatching, "REL/m446dll/card.c"),
Object(Matching, "REL/m446dll/card.c"),
Object(NonMatching, "REL/m446dll/deck.c"),
Object(NonMatching, "REL/m446dll/table.c"),
Object(NonMatching, "REL/m446dll/player.c"),

166
include/REL/m446Dll.h Normal file
View file

@ -0,0 +1,166 @@
#include "dolphin/types.h"
#include "game/process.h"
#include "game/object.h"
typedef struct _unkSubStruct {
s32 unk0;
char unk4[0x20];
s32 unk24;
char unk28[0x3C];
u8 unk64;
u8 unk65;
u8 unk66;
s32 unk68;
char unk6C[0x4];
} unkSubStruct;
typedef struct _unkSubStruct2 {
s32 unk0;
s32 unk4;
char unk8[0x68];
s32 unk70;
s32 unk74;
s32 unk78;
} unkSubStruct2;
typedef struct _unkStruct {
s32 unk0;
s16 unk4;
s16 unk6;
char unk8[0x4];
s32 unkC;
s32 unk10;
s32 unk14;
s32 unk18;
s32 unk1C;
unkSubStruct *unk20;
s32 unk24;
s32 unk28;
unkSubStruct *unk2C[2];
unkSubStruct2 *unk34;
s32 unk38[23];
s32 unk94;
Process *unk98;
} unkStruct;
typedef struct _unkStruct2 {
s32 *unk0;
s32 unk4;
s32 unk8;
} unkStruct2;
typedef struct _unkStruct3 {
struct _unkStruct4 *unk0;
struct _unkStruct3 *unk4;
struct _unkStruct3 *unk8;
} unkStruct3;
typedef struct _unkStruct4 {
s32 unk0;
s32 unk4;
u8 unk8;
u8 unk9;
s16 unkA;
s16 unkC;
s16 unkE;
Vec unk10;
Vec unk1C;
Vec unk28;
Vec unk34;
Vec unk40;
Vec unk4C;
f32 unk58;
f32 unk5C;
f32 unk60;
s32 unk64;
s32 unk68;
s32 unk6C;
s32 unk70;
s32 unk74;
s32 unk78;
s32 unk7C;
f32 unk80;
f32 unk84;
f32 unk88;
f32 unk8C;
f32 unk90;
f32 unk94;
} unkStruct4;
typedef void (*m446Func1)(unkStruct *);
typedef void (*m446Func4)(unkStruct4 *);
// bss
extern unkStruct3* lbl_1_bss_18;
extern s32 lbl_1_bss_14;
extern s32 lbl_1_bss_10;
extern Process* lbl_1_bss_C;
extern omObjData *lbl_1_bss_8;
extern s32 lbl_1_bss_4;
extern unkStruct* lbl_1_bss_0;
// data
extern Vec lbl_1_data_0;
extern Vec lbl_1_data_C;
extern f32 lbl_1_data_18;
extern Vec lbl_1_data_1C;
extern Vec lbl_1_data_28;
extern f32 lbl_1_data_34;
extern Vec lbl_1_data_38[2];
extern Vec lbl_1_data_50[2];
extern f32 lbl_1_data_68[2];
extern m446Func1 lbl_1_data_A0[5];
extern m446Func4 lbl_1_data_150[3];
// prototypes
extern void ModuleProlog(void);
extern void fn_1_13C(omObjData*);
extern unkStruct* m446FlowCreate(void);
extern void fn_1_3FC(unkStruct*);
extern void fn_1_4B4(unkStruct*);
extern void fn_1_53C(unkStruct*);
extern void fn_1_958(unkStruct*);
extern void fn_1_B78(unkStruct*);
extern void fn_1_C0C(unkStruct*);
extern void fn_1_CA0(unkStruct*);
extern s32 fn_1_17FC(unkStruct*);
extern void fn_1_183C(unkStruct*);
extern void fn_1_1874(unkStruct*);
extern void fn_1_18B0(unkStruct*);
extern void fn_1_19D4(void);
extern unkStruct2* fn_1_1C64(s32);
extern void fn_1_1CF8(unkStruct2*);
extern s32 fn_1_1D30(unkStruct2*, s32);
extern s32 fn_1_1D6C(unkStruct2*, s32*);
extern s32 fn_1_1DA8(unkStruct2*, s32*);
extern BOOL fn_1_1DDC(unkStruct2*);
extern s32 fn_1_1DEC(unkStruct2*);
extern unkStruct3* fn_1_1DF4(unkStruct4*);
extern void fn_1_1E5C(unkStruct3*);
extern void fn_1_1E84(unkStruct3**);
extern void fn_1_1EC8(unkStruct3*, unkStruct3*);
extern void fn_1_1F04(unkStruct3*);
extern void fn_1_1F38(u8*, u8*, s32);
extern void fn_1_1F84(u8*, s8, s32);
extern void fn_1_1FC0(u8*, s32);
extern s32 fn_1_1FFC(s8*, s8*, s32);
extern s32 fn_1_2064(void);
extern void fn_1_207C(void);
extern void fn_1_20D4(void);
extern unkStruct4* fn_1_240C(s32);
extern void fn_1_2688(unkStruct4*);
extern void fn_1_272C(unkStruct4*);
extern void fn_1_2794(unkStruct4*);
extern void fn_1_27FC(unkStruct4*, Vec*, s32);
extern void fn_1_2890(unkStruct4*, Vec*, s32, s32);
extern void fn_1_2928(unkStruct4*, Vec*, s32);
extern void fn_1_29B4(unkStruct4*, s32, f32);
extern void fn_1_2A1C(unkStruct4*);
extern void fn_1_2A58(unkStruct4*);
extern void fn_1_2A94(unkStruct4*);
extern void fn_1_2AA8(unkStruct4*);
extern void fn_1_2D94(unkStruct4*);
extern void fn_1_2DA8(unkStruct4*);
extern void fn_1_2EC0(unkStruct4*, s32);
extern void fn_1_2F64(unkStruct4*);

View file

@ -0,0 +1,526 @@
#include "REL/m446Dll.h"
#include "game/hsfman.h"
#include "math.h"
// data
m446Func4 lbl_1_data_150[3] = {NULL, fn_1_2AA8, fn_1_2DA8};
static const s32 lbl_1_rodata_58[5] = {0x4D0001, 0x4D0002, 0x4D0003, 0x4D0004, 0x4D0000};
static const s32 lbl_1_rodata_6C[5] = {0x4D001B, 0x4D001C, 0x4D001D, 0x4D001E, 0x4D001E};
// bss
unkStruct3* lbl_1_bss_18;
unkStruct2* fn_1_1C64(s32 arg0) {
unkStruct2* temp_r3;
temp_r3 = HuMemDirectMallocNum(HEAP_SYSTEM, 0xC, 0x10000000U);
if (!temp_r3) {
return NULL;
}
temp_r3->unk0 = HuMemDirectMallocNum(HEAP_SYSTEM, arg0 * 4, 0x10000000U);
if (!temp_r3->unk0) {
HuMemDirectFree(temp_r3);
return NULL;
}
temp_r3->unk4 = arg0;
temp_r3->unk8 = 0;
return temp_r3;
}
void fn_1_1CF8(unkStruct2* arg0) {
HuMemDirectFree(arg0->unk0);
HuMemDirectFree(arg0);
}
s32 fn_1_1D30(unkStruct2* arg0, s32 arg1) {
if (arg0->unk4 <= arg0->unk8) {
return 0;
} else {
arg0->unk0[arg0->unk8] = arg1;
arg0->unk8++;
return 1;
}
}
s32 fn_1_1D6C(unkStruct2* arg0, s32* arg1) {
if (arg0->unk8 <= 0) {
return 0;
} else {
arg0->unk8--;
arg1[0] = arg0->unk0[arg0->unk8];
return 1;
}
}
s32 fn_1_1DA8(unkStruct2* arg0, s32* arg1) {
if (arg0->unk8 <= 0) {
return 0;
} else {
arg1[0] = *(&arg0->unk0[arg0->unk8] - 1);
return 1;
}
}
BOOL fn_1_1DDC(unkStruct2* arg0) {
return arg0->unk8 == 0;
}
s32 fn_1_1DEC(unkStruct2* arg0) {
return arg0->unk8;
}
#pragma dont_inline on
unkStruct3* fn_1_1DF4(unkStruct4* arg0) {
unkStruct3* temp_r3;
temp_r3 = HuMemDirectMallocNum(HEAP_SYSTEM, 0xC, 0x10000000);
if (!temp_r3) {
return NULL;
}
temp_r3->unk4 = NULL;
temp_r3->unk8 = NULL;
temp_r3->unk0 = arg0;
return temp_r3;
}
void fn_1_1E5C(unkStruct3* arg0) {
HuMemDirectFree(arg0);
}
void fn_1_1E84(unkStruct3** arg0) {
unkStruct3 *temp = *arg0;
HuMemDirectFree(temp);
*arg0 = NULL;
}
void fn_1_1EC8(unkStruct3* arg0, unkStruct3* 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(unkStruct3* 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) {
unkStruct4* var_r30;
unkStruct3* 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;
unkStruct4* temp_r31;
unkStruct3* 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);
}
}
unkStruct4* fn_1_240C(s32 arg0) {
unkStruct4* temp_r31;
unkStruct3* 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 = temp_r30;
}
return temp_r31;
}
void fn_1_2688(unkStruct4* arg0) {
unkStruct3* 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;
}
}
void fn_1_272C(unkStruct4* arg0) {
Vec sp8;
sp8 = arg0->unk34;
sp8.z = 0.0f;
arg0->unk64 = 1;
fn_1_2928(arg0, &sp8, 0x1E);
}
void fn_1_2794(unkStruct4* arg0) {
Vec sp8;
sp8 = arg0->unk34;
sp8.z = 180.0f;
arg0->unk64 = 0;
fn_1_2928(arg0, &sp8, 0x3C);
}
void fn_1_27FC(unkStruct4* arg0, Vec* arg1, s32 arg2) {
arg0->unk7C = 0;
arg0->unk28 = *arg1;
arg0->unk1C = arg0->unk10;
arg0->unk80 = 0.0f;
arg0->unk84 = (1.0f / arg2);
arg0->unk70 = 1;
}
void fn_1_2890(unkStruct4* arg0, Vec* arg1, s32 arg2, s32 arg3) {
arg0->unk7C = 0;
arg0->unk28 = *arg1;
arg0->unk1C = arg0->unk10;
arg0->unk80 = 0.0f;
arg0->unk84 = (1.0f / arg2);
arg0->unk70 = 1;
arg0->unk7C = arg3;
}
void fn_1_2928(unkStruct4* arg0, Vec* arg1, s32 arg2) {
arg0->unk4C = *arg1;
arg0->unk40 = arg0->unk34;
arg0->unk88 = 0.0f;
arg0->unk8C = (1.0f / arg2);
arg0->unk74 = 1;
}
void fn_1_29B4(unkStruct4* arg0, s32 arg1, f32 arg8) {
arg0->unk60 = arg8;
arg0->unk5C = arg0->unk58;
arg0->unk90 = 0.0f;
arg0->unk94 = (1.0f / arg1);
arg0->unk78 = 1;
}
void fn_1_2A1C(unkStruct4* arg0) {
Hu3DModelAttrReset(arg0->unkC, 1);
arg0->unk6C = 1;
}
void fn_1_2A58(unkStruct4* arg0) {
Hu3DModelAttrSet(arg0->unkC, 1);
arg0->unk6C = 0;
}
void fn_1_2A94(unkStruct4* arg0) {
arg0->unk4 = 1;
arg0->unk8 = 0;
}
void fn_1_2AA8(unkStruct4* arg0) {
Vec sp8;
switch (arg0->unk8) {
case 0:
arg0->unk8 = 1;
Hu3DModelAttrReset(arg0->unkC, 1);
arg0->unk6C = 1;
arg0->unk8 = 1; // ?
case 1:
arg0->unk60 = 2.5f;
arg0->unk5C = arg0->unk58;
arg0->unk90 = 0.0f;
arg0->unk94 = 0.055555556f;
arg0->unk78 = 1;
arg0->unk8 = 2; // ?????
break;
case 2:
if (arg0->unk78 != 0) break;
arg0->unk8 = 3; // ??????????
case 3:
arg0->unk60 = 1.5f;
arg0->unk5C = arg0->unk58;
arg0->unk90 = 0.0f;
arg0->unk94 = 0.055555556f;
arg0->unk78 = 1;
arg0->unk8 = 4;
break;
case 4:
if (arg0->unk78 != 0) break;
arg0->unk8 = 5;
case 5:
arg0->unk60 = 2.5f;
arg0->unk5C = arg0->unk58;
arg0->unk90 = 0.0f;
arg0->unk94 = 0.055555556f;
arg0->unk78 = 1;
arg0->unk8 = 6;
break;
case 6:
if (arg0->unk78 != 0) break;
arg0->unk8 = 8;
case 7:
arg0->unk60 = 1.5f;
arg0->unk5C = arg0->unk58;
arg0->unk90 = 0.0f;
arg0->unk94 = 0.055555556f;
arg0->unk78 = 1;
arg0->unk8 = 8;
case 8:
if (arg0->unk78 != 0) break;
arg0->unk8 = 9;
case 9:
sp8 = arg0->unk34;
sp8.y = 720.0f;
arg0->unk4C = sp8;
arg0->unk40 = arg0->unk34;
arg0->unk88 = 0.0f;
arg0->unk8C = 0.016666668f;
arg0->unk74 = 1;
arg0->unk60 = 0.0f;
arg0->unk5C = arg0->unk58;
arg0->unk90 = 0.0f;
arg0->unk94 = 0.016666668f;
arg0->unk78 = 1;
arg0->unk8 = 10;
break;
case 10:
if (arg0->unk78 != 0) break;
arg0->unk4 = 0;
arg0->unk8 = 0;
Hu3DModelAttrSet(arg0->unkC, 1);
arg0->unk6C = 0;
return;
}
}
void fn_1_2D94(unkStruct4* arg0) {
arg0->unk4 = 2;
arg0->unk8 = 0;
}
void fn_1_2DA8(unkStruct4* arg0) {
f32 var_f31;
f32 var_f30;
switch (arg0->unk8) {
case 0:
arg0->unk8 = 1;
case 1:
if (arg0->unk78 == 0) {
var_f31 = arg0->unk58 + 0.25f;
arg0->unk60 = var_f31;
arg0->unk5C = arg0->unk58;
arg0->unk90 = 0.0f;
arg0->unk94 = 0.033333335f;
arg0->unk78 = 1;
arg0->unk8 = 2U;
}
break;
case 2:
if (arg0->unk78 == 0) {
var_f30 = arg0->unk58 - 0.25f;
arg0->unk60 = var_f30;
arg0->unk5C = arg0->unk58;
arg0->unk90 = 0.0f;
arg0->unk94 = 0.033333335f;
arg0->unk78 = 1;
arg0->unk8 = 1;
}
break;
}
}
void fn_1_2EC0(unkStruct4* arg0, s32 arg1) {
if (arg1 != 0) {
Hu3DModelShadowDispOn(arg0->unkA);
Hu3DModelAmbSet(arg0->unkA, 0.0f, 0.0f, 0.0f);
return;
}
Hu3DModelShadowDispOff(arg0->unkA);
Hu3DModelAmbSet(arg0->unkA, 1.0f, 1.0f, 1.0f);
}
void fn_1_2F64(unkStruct4* arg0) {
if ((arg0->unk58 > 1.0f) || (arg0->unk58 < 1.0f)) {
Hu3DModelLayerSet(arg0->unkA, 1);
Hu3DModelLayerSet(arg0->unkC, 1);
} else {
Hu3DModelLayerSet(arg0->unkA, 0);
Hu3DModelLayerSet(arg0->unkC, 0);
}
Hu3DModelPosSet(arg0->unkA, arg0->unk10.x, arg0->unk10.y, arg0->unk10.z);
Hu3DModelPosSet(arg0->unkC, arg0->unk10.x, 0.1f + arg0->unk10.y, arg0->unk10.z);
Hu3DModelScaleSet(arg0->unkA, arg0->unk58, arg0->unk58, arg0->unk58);
Hu3DModelScaleSet(arg0->unkC, arg0->unk58, arg0->unk58, arg0->unk58);
Hu3DModelRotSet(arg0->unkA, arg0->unk34.x, arg0->unk34.y, arg0->unk34.z);
}

View file

@ -1,86 +1,37 @@
#include "dolphin/types.h"
#include "REL/m446Dll.h"
#include "rel_sqrt_consts.h"
#include "game/gamework_data.h"
#include "game/hsfman.h"
#include "game/audio.h"
#include "game/jmp.h"
#include "game/process.h"
#include "game/window.h"
#include "game/wipe.h"
#include "game/frand.h"
#include "game/object.h"
#include "game/minigame_seq.h"
typedef struct _unkSubStruct {
s32 unk0;
char unk4[0x20];
s32 unk24;
char unk28[0x3C];
u8 unk64;
u8 unk65;
u8 unk66;
s32 unk68;
char unk6C[0x4];
} unkSubStruct;
typedef struct _unkSubStruct2 {
char unk0;
} unkSubStruct2;
typedef struct _unkSubStruct3 {
s32 unk0;
s32 unk4;
char unk8[0x68];
s32 unk70;
s32 unk74;
s32 unk78;
} unkSubStruct3;
typedef struct _unkStruct {
s32 unk0;
s16 unk4;
s16 unk6;
char unk8[0x4];
s32 unkC;
s32 unk10;
s32 unk14;
s32 unk18;
s32 unk1C;
unkSubStruct *unk20;
s32 unk24;
s32 unk28;
unkSubStruct *unk2C[2];
unkSubStruct3 *unk34;
s32 unk38[23];
s32 unk94;
Process *unk98;
} unkStruct;
typedef void (*m446Func)(unkStruct *);
// card.c
extern s32 fn_1_2064(void);
extern void fn_1_207C(void);
extern void fn_1_20D4(void);
extern void fn_1_2EC0(unkSubStruct3*, s32);
extern void fn_1_2EC0(unkSubStruct2*, s32);
// deck.c
extern void fn_1_3180(s32);
extern void fn_1_31D8(s32, s32*, s32*, s32);
extern s32 fn_1_38E0(void);
extern s32 fn_1_3064(void);
extern void fn_1_34A0(s32, s32*, s32, s32);
extern void fn_1_3700(s32, unkSubStruct3*, s32);
extern void fn_1_3700(s32, unkSubStruct2*, s32);
// table.c
extern s32 fn_1_3924(void);
extern void fn_1_393C(void);
extern void fn_1_3994(void);
extern unkSubStruct *fn_1_39D0(void);
extern void fn_1_3B4C(unkSubStruct*);
extern s32 fn_1_3BF0(unkSubStruct*, unkSubStruct3*, s32);
extern s32 fn_1_3EB4(unkSubStruct*, unkSubStruct3*, s32);
extern s32 fn_1_3BF0(unkSubStruct*, unkSubStruct2*, s32);
extern s32 fn_1_3EB4(unkSubStruct*, unkSubStruct2*, s32);
extern void fn_1_4000(unkSubStruct*, s32);
extern s32 fn_1_4088(unkSubStruct*, u8, u8, s32, unkSubStruct3**, s32);
extern s32 fn_1_4088(unkSubStruct*, u8, u8, s32, unkSubStruct2**, s32);
extern void fn_1_46D0(unkSubStruct*);
// player.c
extern s32 fn_1_480C(void);
@ -88,9 +39,9 @@ extern void fn_1_4824(void);
extern void fn_1_487C(void);
extern unkSubStruct *fn_1_4B00(s32, unkSubStruct*);
extern void fn_1_509C(unkSubStruct*);
extern s32 fn_1_5504(unkSubStruct*, unkSubStruct3*, s32);
extern unkSubStruct *fn_1_5648(unkSubStruct*, s32, unkSubStruct3**);
extern s32 fn_1_5678(unkSubStruct*, unkSubStruct3**, s32);
extern s32 fn_1_5504(unkSubStruct*, unkSubStruct2*, s32);
extern unkSubStruct *fn_1_5648(unkSubStruct*, s32, unkSubStruct2**);
extern s32 fn_1_5678(unkSubStruct*, unkSubStruct2**, s32);
extern void fn_1_5B34(unkSubStruct*);
extern void fn_1_5C10(unkSubStruct*);
extern void fn_1_5CEC(unkSubStruct*);
@ -115,23 +66,6 @@ extern s32 fn_1_80C0(void);
extern void fn_1_83F0(s32);
extern void fn_1_84AC(s32);
// prototypes
void ModuleProlog(void);
void fn_1_13C(omObjData*);
unkStruct* m446FlowCreate(void);
void fn_1_3FC(unkStruct*);
void fn_1_4B4(unkStruct*);
void fn_1_53C(unkStruct*);
void fn_1_958(unkStruct*);
void fn_1_B78(unkStruct*);
void fn_1_C0C(unkStruct*);
void fn_1_CA0(unkStruct*);
s32 fn_1_17FC(unkStruct*);
void fn_1_183C(unkStruct*);
void fn_1_1874(unkStruct*);
void fn_1_18B0(unkStruct*);
void fn_1_19D4(void);
// bss
s32 lbl_1_bss_14;
s32 lbl_1_bss_10;
@ -271,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]) {