papermario/src/code_303c0_len_3e10.c

271 lines
5.4 KiB
C
Raw Normal View History

2020-08-04 08:49:11 +02:00
#include "common.h"
2020-12-02 00:23:26 +01:00
#include "audio.h"
// TODO: rodata
2020-10-29 01:29:30 +01:00
extern u16 D_80078DB4;
2020-12-02 01:13:24 +01:00
INCLUDE_ASM(void, "code_303c0_len_3e10", al_LoadBKHeaders, UnkAl19E0* arg0, ALHeap* arg1);
#ifdef NON_MATCHING
// Delay slot (probably needs rodata)
2020-10-29 01:29:30 +01:00
void func_80055050(void) {
D_80078DB4 = 1;
D_80078DB0 = 0;
}
#else
INCLUDE_ASM(void, "code_303c0_len_3e10", func_80055050, void);
2020-10-29 01:29:30 +01:00
#endif
2020-08-04 08:49:11 +02:00
INCLUDE_ASM(void, "code_303c0_len_3e10", func_80055068, u32 arg0);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055110);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_8005513C);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_800551E0);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055240);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_800552D0);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055330);
2020-08-04 08:49:11 +02:00
2020-12-02 05:50:32 +01:00
void func_800553C0(s32 arg0) {
func_8004B6D8(D_8009A640, arg0 | 0x8000, 0, 0, 0);
}
2020-08-04 08:49:11 +02:00
2020-12-02 01:13:24 +01:00
void func_800553F4(void) {
D_8009A640->unk_168 = 1;
}
2020-09-24 05:16:13 +02:00
2020-12-02 05:50:32 +01:00
void func_80055408(s32 arg0, s16 arg1, s16 arg2, s32 arg3) {
func_8004B6D8(D_8009A640, arg0, arg1, arg2, arg3);
}
s32 func_80055448(s32 arg0) {
return func_80053F80(arg0);
}
s32 func_80055464(s32 arg0, s32 arg1) {
if (func_80050C30(arg0) == 0) {
func_80050CA0(arg0, arg1);
}
}
2020-09-24 05:16:13 +02:00
2020-12-02 05:50:32 +01:00
s32 func_800554A4(s32 arg0, s32 arg1) {
s32 ret = func_80050C30(arg0);
2020-08-04 08:49:11 +02:00
2020-12-02 05:50:32 +01:00
if (ret == 0) {
func_80050EF0(arg0);
}
2020-08-04 08:49:11 +02:00
2020-12-02 05:50:32 +01:00
return ret;
}
2020-08-04 08:49:11 +02:00
2020-12-02 05:50:32 +01:00
s32 func_800554E8(s32 arg0, s32 arg1) {
s32 ret = func_80050C30(arg0);
2020-08-04 08:49:11 +02:00
2020-12-02 05:50:32 +01:00
if (ret == 0) {
func_80050F64(arg0, arg1);
}
2020-08-04 08:49:11 +02:00
2020-12-02 05:50:32 +01:00
return ret;
}
2020-08-04 08:49:11 +02:00
2020-12-02 05:50:32 +01:00
s32 func_8005553C(s32 arg0, s32 arg1) {
s32 ret = func_80050C30(arg0);
2020-08-04 08:49:11 +02:00
2020-12-02 05:50:32 +01:00
if (ret == 0) {
func_80050E18(arg0, arg1);
}
return ret;
}
2020-09-24 05:16:13 +02:00
2020-12-02 05:50:32 +01:00
s32 func_80055590(s32 arg0, s32 arg1) {
s32 ret = func_80050C30(arg0);
if (ret == 0) {
func_80050E84(arg0, arg1);
}
return ret;
}
void func_800555E4(s32 arg0) {
if (func_80050C30(arg0) == 0) {
func_80051050(arg0);
}
}
s32 func_80055618(s32 arg0, s32 arg1) {
s32 ret = func_80050C30(arg0);
if (ret == 0) {
func_80050C54(arg0, arg1);
}
return ret;
}
2020-08-04 08:49:11 +02:00
2020-12-02 05:50:32 +01:00
s32 func_8005566C(s32 arg0, s32 arg1, s32 arg2) {
s32 ret = func_80050C30(arg0);
2020-08-04 08:49:11 +02:00
2020-12-02 05:50:32 +01:00
if (ret == 0) {
func_80050FD0(arg0, arg1, arg2);
}
return ret;
}
s32 func_800556D0(s32 arg0) {
s32 ret = func_80050C30(arg0);
if (ret == 0) {
func_80050C64(arg0, 1);
}
return ret;
}
s32 func_80055718(s32 arg0) {
s32 ret = func_80050C30(arg0);
if (ret == 0) {
func_80050C64(arg0, 0);
}
return ret;
}
void func_80055848(s32);
void func_80055760(s32 arg0) {
u32 i;
s32 lim = 4;
D_80078DB6 = 0xFF;
for (i = 0; i < lim; i++) {
if (func_80055464(i, 0) != 0) {
return;
}
}
func_80055848(arg0);
}
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_800557CC);
2020-09-24 05:16:13 +02:00
2020-12-02 05:50:32 +01:00
INCLUDE_ASM(void, "code_303c0_len_3e10", func_80055848, s32 arg1);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_800558D4);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_8005591C);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055970);
2020-08-04 08:49:11 +02:00
2020-10-29 22:35:59 +01:00
s32 func_800559C4(UNK_TYPE arg0) {
return func_8004DA0C(arg0);
}
2020-08-04 08:49:11 +02:00
2020-12-02 05:50:32 +01:00
void func_800559E0(void) {
func_8004DA74();
}
2020-09-24 05:16:13 +02:00
2020-12-02 05:50:32 +01:00
void func_800559FC(void) {
func_8004DAE0();
}
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055A18);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055A6C);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055ABC);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055AF0);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055B28);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055B80);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055BB8);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055BF0);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055C2C);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055C64);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055C94);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055CC4);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055CE8);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055D38);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055D8C);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055DDC);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055E48);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055EB4);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055F58);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055FD4);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055FF0);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_8005600C);
2020-09-24 05:16:13 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80056028);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80056044);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80056068);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_8005608C);
2020-08-04 08:49:11 +02:00
2020-12-02 01:13:24 +01:00
void func_800560A8(void) {
D_8009A5C0->unk_9C = 1;
}
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_800560BC);
2020-08-04 08:49:11 +02:00
2020-12-01 05:45:05 +01:00
INCLUDE_ASM(void, "code_303c0_len_3e10", func_8005610C, void);
2020-08-04 08:49:11 +02:00
2020-09-25 23:18:09 +02:00
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80056144);
2020-09-24 05:16:13 +02:00
2020-12-02 01:13:24 +01:00
void func_8005615C(void) {
func_80056D5C(1);
func_80054DA8(0);
}
2020-12-02 00:23:26 +01:00
2020-12-02 01:13:24 +01:00
void func_80056180(void) {
func_80056D5C(0);
func_80054DA8(1);
2020-12-02 00:23:26 +01:00
}
2020-08-04 08:49:11 +02:00
2020-12-02 01:13:24 +01:00
void func_800561A4(s32 arg0) {
func_80054CE0(1, arg0);
}
2020-08-04 08:49:11 +02:00
2020-12-02 01:13:24 +01:00
void func_800561C4(s32 arg0) {
func_80054CE0(16, arg0);
}
2020-08-04 08:49:11 +02:00
2020-12-02 01:13:24 +01:00
void func_800561E4(s32 arg0) {
func_80054D74(16, arg0);
}
2020-08-04 08:49:11 +02:00
2020-12-02 01:13:24 +01:00
void func_80056204(void) {
func_8004BA54(D_8009A640, 0);
}
2020-08-04 08:49:11 +02:00
2020-12-02 01:13:24 +01:00
void func_80056228(void) {
func_8004BA54(D_8009A640, 1);
}