138 lines
3.7 KiB
C
138 lines
3.7 KiB
C
#include "common.h"
|
|
|
|
void __load_song(void*);
|
|
|
|
extern void Mus__unknown_80081DB4(const void* arg0, const void* arg1);
|
|
|
|
extern u8 D_8010A760[];
|
|
extern u8 D_80164770[];
|
|
extern u8 D_80104710[];
|
|
|
|
extern void func_80081A54(s32, s32);
|
|
extern s32 func_80081B08(s32);
|
|
extern s32 func_80081770(s32);
|
|
extern void func_80081DF0(const void*);
|
|
|
|
extern s32 D_800EB0E8;
|
|
|
|
/* 3F1B0 800E9C20 */
|
|
void func_800E9C20(void)
|
|
{
|
|
romCopy_512(SEGMENT_ROM_START(n64_ptr_tables_v2_00), D_80164770, SEGMENT_ROM_SIZE(n64_ptr_tables_v2_00));
|
|
romCopy_512(SEGMENT_ROM_START(n64_ptr_tables_v2_01), D_80104710, SEGMENT_ROM_SIZE(n64_ptr_tables_v2_01));
|
|
romCopy_512(SEGMENT_ROM_START(n64_wave_data), &D_8010A760, SEGMENT_ROM_SIZE(n64_wave_data));
|
|
|
|
MusPtrBankInitialize(D_80164770, SEGMENT_ROM_START(n64_wave_table_00));
|
|
MusPtrBankInitialize(D_80104710, SEGMENT_ROM_START(n64_wave_table_01));
|
|
|
|
MusFxBankInitialize(D_8010A760);
|
|
MusFxBankSetPtrBank(D_8010A760, D_80104710);
|
|
}
|
|
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800E9CEC);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800E9E34);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA0E4);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA1C8);
|
|
|
|
/* 3F94C 800EA3BC */
|
|
void func_800EA3BC(SomethingMusic* arg0) {
|
|
s32 temp_a1;
|
|
s32 temp_v0;
|
|
s32 temp_v1;
|
|
|
|
temp_v0 = arg0->field_0x4;
|
|
temp_v1 = arg0->field_0x8;
|
|
temp_a1 = arg0->field_0xc;
|
|
|
|
arg0->field_0x4 = 0;
|
|
arg0->field_0x8 = 0;
|
|
arg0->field_0xc = 0;
|
|
|
|
arg0->field_0x2c = temp_v0;
|
|
arg0->field_0x30 = temp_v1;
|
|
arg0->field_0x34 = temp_a1;
|
|
}
|
|
|
|
|
|
/* 3F974 800EA3E4 */
|
|
void func_800EA3E4(SomethingMusic* arg0) {
|
|
s32 var_v0;
|
|
|
|
if (func_80081B08(arg0->handle) == 0) {
|
|
D_800EB0E8 = 0;
|
|
__load_song(arg0);
|
|
return;
|
|
}
|
|
if (arg0->field_0x38 == 0) {
|
|
if (arg0->field_0x34 != 0) {
|
|
func_80081A54(arg0->handle, arg0->field_0x34);
|
|
arg0->field_0x3c = arg0->field_0x34 + 3;
|
|
} else {
|
|
func_80081A54(arg0->handle, 1);
|
|
arg0->field_0x3c = 3;
|
|
}
|
|
arg0->field_0x38 = 2;
|
|
arg0->field_0x40 = arg0->field_0x2c;
|
|
return;
|
|
}
|
|
arg0->field_0x40 = arg0->field_0x2c;
|
|
}
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", __load_song);
|
|
|
|
/* 3FAF8 800EA568 */
|
|
void func_800EA568(SomethingMusic* arg0) {
|
|
|
|
if (arg0->field_0x18 != 0) {
|
|
if (func_80081B08(arg0->handle) != 0) {
|
|
func_80081A54(arg0->handle, 0);
|
|
}
|
|
} else {
|
|
if ((arg0->field_0x28 != -1) && (func_80081B08(arg0->field_0x28) != 0)) {
|
|
func_80081A54(arg0->field_0x28, 0);
|
|
}
|
|
}
|
|
|
|
arg0->field_0x28 = arg0->handle;
|
|
func_80081DF0(&D_80104710);
|
|
arg0->handle = func_80081770(arg0->field_0x2c - 1);
|
|
arg0->field_0x20 = arg0->field_0x2c;
|
|
}
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA604);
|
|
|
|
/* 3FC40 800EA6B0 */
|
|
void func_800EA6B0(SomethingMusic* arg0, s32 arg1, s32 arg2) {
|
|
arg0->field_0x4 = arg1 + 1;
|
|
arg0->field_0xc = arg2;
|
|
arg0->field_0x4c = 1;
|
|
}
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA6C8);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA714);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA76C);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA7AC);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA7E4);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA838);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA850);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA86C);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA884);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA89C);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA8B4);
|
|
|
|
INCLUDE_ASM(const s32, "ob_knotty_chess", func_800EA8CC);
|