Split out some unused asm and documented main.c (#242)

* Splitting out unused asm

* Documented main.c
This commit is contained in:
MegaMech
2022-07-11 01:02:41 -06:00
committed by GitHub
parent a8e984d2fd
commit fd7941e841
101 changed files with 4287 additions and 4260 deletions
+4
View File
@@ -1709,6 +1709,10 @@ void func_8029AC18(Camera *camera, Mat4 arg1, struct Actor *arg2) {
GLOBAL_ASM("asm/non_matchings/actors/func_8029AC18.s")
#endif
UNUSED void func_8029AE14() {
}
void func_8029AE1C(Camera *arg0, struct PaddleWheelBoat *boat, Mat4 arg2, u16 arg3) {
s32 pad[3];
Vec3f sp120;
+55 -13
View File
@@ -1783,6 +1783,32 @@ void func_800C400C(void) {
GLOBAL_ASM("asm/non_matchings/audio/external/func_800C400C.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_800C4084(s32 arg0) {
s32 temp_at;
s32 temp_t1;
s32 var_a0;
s32 var_v0;
unksp-10.unk10 = arg0;
var_a0 = arg0 & 0xFFFF;
var_v0 = 0;
do {
if ((var_a0 & 1) != 0) {
*(&D_80192C3C + var_v0) = 1;
} else {
*(&D_80192C3C + var_v0) = 0;
}
temp_t1 = (var_v0 + 1) & 0xFF;
temp_at = temp_t1 < 6;
var_v0 = temp_t1;
var_a0 = (var_a0 >> 1) & 0xFFFF;
} while (temp_at != 0);
}
#else
GLOBAL_ASM("asm/non_matchings/audio/external/func_800C4084.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern u16 D_800EA1C4;
@@ -2730,6 +2756,20 @@ void func_800C5384(s32 arg0, s32 arg1) {
GLOBAL_ASM("asm/non_matchings/audio/external/func_800C5384.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_800C54B8(u8 arg0, s32 arg1) {
s32 sp54;
s32 sp30;
func_800C5384(arg0);
sp54 = arg0 << 0x1C;
sp30 = arg1;
func_800C41CC(1, &sp30);
}
#else
GLOBAL_ASM("asm/non_matchings/audio/external/func_800C54B8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800C41CC(?, s32 *); // extern
@@ -3115,16 +3155,17 @@ GLOBAL_ASM("asm/non_matchings/audio/external/func_800C5C40.s")
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800C2474(); // extern
? func_800C284C(?, ?, ?, ?); // extern
? func_800C3F70(); // extern
? func_800C5A3C(); // extern
void func_800C2474(); // extern
void func_800C284C(u8, u8, u8, s32); // extern
void func_800C3F70(); // extern
void func_800C5A3C(); // extern
// game_audio_init?
void func_800C5CB8(void) {
func_800C2474();
func_800C3F70();
func_800C5A3C();
func_800C284C(2, 0, 0xFF, 1);
func_800C284C(2, 0, 255, 1);
}
#else
GLOBAL_ASM("asm/non_matchings/audio/external/func_800C5CB8.s")
@@ -6328,15 +6369,16 @@ GLOBAL_ASM("asm/non_matchings/audio/external/func_800CB14C.s")
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800C1F8C(); // extern
? func_800C2274(?); // extern
? func_800C3478(); // extern
? func_800C3724(); // extern
? func_800C5848(); // extern
? func_800C59C4(); // extern
? func_800C8CCC(); // extern
? func_800CBC24(); // extern
//? func_800C1F8C(); // extern
//? func_800C2274(?); // extern
//? func_800C3478(); // extern
//? func_800C3724(); // extern
//? func_800C5848(); // extern
//? func_800C59C4(); // extern
//? func_800C8CCC(); // extern
//? func_800CBC24(); // extern
// run audio?
void func_800CB2C4(void) {
func_800C1F8C();
func_800C3724();
+59
View File
@@ -202,6 +202,17 @@ void func_800B90B0(void *arg0) {
#else
GLOBAL_ASM("asm/non_matchings/audio/heap/func_800B90B0.s")
#endif
struct struct_800B90E0 {
s32 unk0;
s32 unk4;
s32 unk8;
s32 unkC;
};
UNUSED void func_800B90E0(struct struct_800B90E0 *arg0) {
arg0->unkC = 0;
arg0->unk4 = arg0->unk0;
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
@@ -825,6 +836,54 @@ block_17:
GLOBAL_ASM("asm/non_matchings/audio/heap/func_800B9AD8.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_800B9BE4(f32 arg0, f32 arg1, void *arg2) {
? sp4C;
f32 sp30;
f32 sp2C;
? sp14;
f32 sp10;
f32 spC;
? *var_a0;
f32 *var_a0_2;
f32 temp_f0;
f32 temp_f10;
f32 temp_f6;
f32 temp_f8;
s16 *var_v1;
void *var_v1_2;
temp_f0 = D_800F2E80;
var_a0 = &sp14;
var_v1 = arg2 + 4;
spC = arg1 * temp_f0;
sp2C = arg0 * temp_f0;
sp10 = arg1 * arg0 * temp_f0;
sp30 = ((arg0 * arg0) + arg1) * temp_f0;
do {
*var_v1 = (s16) (u32) ((var_a0->unk-4 * arg0) + (arg1 * var_a0->unk-8));
temp_f8 = var_a0->unk18;
temp_f10 = var_a0->unk1C * arg0;
var_a0 += 4;
var_v1 += 2;
var_v1->unkE = (s16) (u32) (temp_f10 + (arg1 * temp_f8));
} while ((u32) var_a0 < (u32) &sp2C);
var_v1_2 = arg2;
var_a0_2 = &spC;
do {
var_v1_2->unk0 = (s16) (u32) var_a0_2->unk0;
var_v1_2->unk2 = (s16) (u32) var_a0_2->unk4;
var_v1_2->unk4 = (s16) (u32) var_a0_2->unk8;
temp_f6 = var_a0_2->unkC;
var_a0_2 += 0x10;
var_v1_2->unk6 = (s16) (u32) temp_f6;
var_v1_2 += 8;
} while (var_a0_2 != &sp4C);
}
#else
GLOBAL_ASM("asm/non_matchings/audio/heap/func_800B9BE4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_803AF790;
+153 -6
View File
@@ -1150,14 +1150,161 @@ block_16:
GLOBAL_ASM("asm/non_matchings/audio/load/func_800BBF44.s")
#endif
// L800BC170 is in a delay slot
// m2c may be inaccurate.
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
/*
Failed to decompile function audio_init:
void audio_init(void) {
s32 sp8C;
s32 sp60;
s32 **sp3C;
? *var_v0;
? *var_v0_2;
? *var_v0_3;
s16 temp_s3;
s16 temp_t1;
s32 **var_a2;
s32 *temp_v0_2;
s32 *temp_v0_3;
s32 *temp_v0_4;
s32 *temp_v0_5;
s32 temp_a1;
s32 temp_a1_2;
s32 temp_a1_3;
s32 temp_s0;
s32 temp_s0_2;
s32 temp_t7;
s32 temp_v0;
s32 var_s0_2;
s32 var_s1;
s32 var_v1;
s32 var_v1_2;
u32 var_s0;
void *temp_t3;
void *temp_t7_2;
Last instruction is missing a delay slot:
jr $ra
*/
D_800EA5DC = 0;
temp_t7 = (s32) D_800EA5D0 / 8;
if (temp_t7 > 0) {
var_v0 = &D_803B71B0;
do {
var_v0 += 8;
var_v0->unk-4 = 0;
var_v0->unk-8 = 0;
} while ((u32) var_v0 < (u32) ((temp_t7 * 8) + &D_803B71B0));
}
var_v0_2 = &gGfxSPTaskOutputBufferSize;
var_s0 = (u32) (&D_803B71A0 - &gGfxSPTaskOutputBufferSize) >> 3;
if ((s32) var_s0 >= 0) {
do {
var_s0 -= 1;
var_v0_2->unk4 = 0;
var_v0_2->unk0 = 0;
var_v0_2 += 8;
} while ((s32) var_s0 >= 0);
}
temp_v0 = osTvType;
switch (temp_v0) { /* irregular */
case 0:
D_803B7178 = D_800F2EA0;
D_803B717C = 0x32;
break;
case 2:
D_803B7178 = D_800F2EA4;
D_803B717C = 0x3C;
break;
default:
case 1:
D_803B7178 = D_800F2EA8;
D_803B717C = 0x3C;
break;
}
func_800CBF48(&gGfxSPTaskOutputBufferSize);
var_v0_3 = &D_803B718C;
do {
var_v0_3 += 2;
var_v0_3->unk-2 = 0xA0;
} while ((u32) var_v0_3 < (u32) &D_803B7192);
D_803B70B8 = 0;
D_803B70C0 = 0;
D_803B70C4 = 0;
D_803B70B6 = 0;
D_803B70D4 = 0;
D_803B70D8.unk34 = 0;
D_803B70D8.unk84 = 0;
osCreateMesgQueue(&D_803B6720, &D_803B6738, 1);
osCreateMesgQueue(&gCurrAudioFrameDmaQueue, &gCurrAudioFrameDmaMesgBufs, 0x40);
gCurrAudioFrameDmaCount = 0;
gSampleDmaNumListItems = 0;
func_800B90F0(D_800EA5D4);
var_a2 = &D_803B7180;
do {
sp3C = var_a2;
var_v1 = 0;
*var_a2 = soundAlloc(&D_803AFBD8, 0xA00, var_a2);
loop_16:
*(*var_a2 + var_v1) = 0;
(*var_a2 + var_v1)->unk2 = 0;
(*var_a2 + var_v1)->unk4 = 0;
temp_t7_2 = *var_a2 + var_v1;
var_v1 += 8;
temp_t7_2->unk6 = 0;
if (var_v1 != 0xA00) {
goto loop_16;
}
var_a2 += 4;
} while ((u32) var_a2 < (u32) &D_803B718C);
D_803B0501 = 0;
D_803B0500 = 1;
func_800BA00C();
D_803B706C = &sp60;
audio_dma_copy_immediate(&_sequencesSegmentRomStart, &sp60, 0x10);
temp_t1 = D_803B706C->unk2;
temp_a1 = (((temp_t1 & 0xFFFF) * 8) + 0x13) & ~0xF;
D_803B707C = temp_t1;
temp_v0_2 = soundAlloc(&D_803AFBD8, temp_a1);
D_803B706C = temp_v0_2;
audio_dma_copy_immediate(&_sequencesSegmentRomStart, temp_v0_2, temp_a1);
func_800BB43C(D_803B706C, &_sequencesSegmentRomStart);
D_803B7070 = &sp60;
audio_dma_copy_immediate(&_audio_banksSegmentRomStart, &sp60, 0x10);
temp_s3 = D_803B7070->unk2;
temp_a1_2 = ((temp_s3 * 8) + 0x13) & ~0xF;
temp_s0 = temp_a1_2;
temp_v0_3 = soundAlloc(&D_803AFBD8, temp_a1_2);
D_803B7070 = temp_v0_3;
audio_dma_copy_immediate(&_audio_banksSegmentRomStart, temp_v0_3, temp_s0);
func_800BB43C(D_803B7070, &_audio_banksSegmentRomStart);
D_803B7080 = soundAlloc(&D_803AFBD8, temp_s3 * 0xC);
var_v1_2 = 0;
if (temp_s3 > 0) {
var_s1 = 0;
var_s0_2 = 0;
do {
sp8C = var_v1_2;
audio_dma_copy_immediate((D_803B7070 + var_s1)->unk4, &sp60, 0x10, &D_803B7080);
(D_803B7080 + var_s0_2)->unk1 = (s8) sp60;
var_v1_2 = sp8C + 1;
temp_t3 = D_803B7080 + var_s0_2;
var_s0_2 += 0xC;
var_s1 += 8;
temp_t3->unk2 = (s8) sp64;
} while (var_v1_2 != temp_s3);
}
D_803B7074 = &sp60;
audio_dma_copy_immediate(&_audio_tablesSegmentRomStart, &sp60, 0x10, &D_803B7080);
temp_a1_3 = ((D_803B7074->unk2 * 8) + 0x13) & ~0xF;
temp_s0_2 = temp_a1_3;
temp_v0_4 = soundAlloc(&D_803AFBD8, temp_a1_3);
D_803B7074 = temp_v0_4;
audio_dma_copy_immediate(&_audio_tablesSegmentRomStart, temp_v0_4, temp_s0_2);
func_800BB43C(D_803B7074, &_audio_tablesSegmentRomStart);
temp_v0_5 = soundAlloc(&D_803AFBD8, 0x100);
D_803B7078 = temp_v0_5;
audio_dma_copy_immediate(&_instrument_setsSegmentRomStart, temp_v0_5, 0x100);
func_800B907C(&D_803B01B8, soundAlloc(&D_803AFBD8, D_800EA5D8), D_800EA5D8);
func_800C125C();
D_800EA5DC = 0x76557364;
}
#else
GLOBAL_ASM("asm/non_matchings/audio/load/audio_init.s")
#endif
+7 -5
View File
@@ -86,7 +86,7 @@ struct UnkStruct_800DC5EC *D_800DC5F0 = &D_8015F480[1];
struct UnkStruct_800DC5EC *D_800DC5F4 = &D_8015F480[2];
struct UnkStruct_800DC5EC *D_800DC5F8 = &D_8015F480[3];
u16 D_800DC5FC = 0;
u8 *D_800DC600 = &osAppNmiBuffer[0];
uintptr_t *pAppNmiBuffer = &osAppNmiBuffer;
s32 gIsMirrorMode = 0;
f32 D_800DC608 = 1.0f;
Lights1 D_800DC610[] = {
@@ -221,11 +221,13 @@ void func_80002DAC(void) {
}
}
void func_80003010(void) {
int i;
/**
* The nmi buffer allows developers to save 64 bytes of data through a soft reset.
*/
void clear_nmi_buffer(void) {
s32 i;
for (i = 0; i < 16; i++) {
((u32 *)osAppNmiBuffer)[i] = 0;
osAppNmiBuffer[i] = 0;
}
}
+32 -15
View File
@@ -8346,6 +8346,10 @@ void func_800151A4(void *arg0, s32 arg1) {
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_800151A4.s")
#endif
UNUSED void func_8001530C(void) {
}
#ifdef MIPS_TO_C
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
//? func_80015390(Camera *, Player *, ?, s32); /* extern */
@@ -11749,7 +11753,7 @@ GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001BE78.s")
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800010CC(); // extern
? init_seg_8028DF00(); // extern
? func_80014DE4(?); // extern
? func_8001BE78(); // extern
extern f32 D_800ED4B4;
@@ -11772,7 +11776,7 @@ extern s32 D_80163484;
void func_8001C05C(void) {
f32 temp_f0;
func_800010CC();
init_seg_8028DF00();
gCurrentCourseId = 0x14;
D_8016347C = 0;
D_8016347E = 0;
@@ -11873,24 +11877,37 @@ loop_8:
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001C14C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80057114(?); // extern
extern u16 D_80163E2A;
void func_8001C3C4(void) {
if (gCurrentCourseId == COURSE_AWARD_CEREMONY) {
if (D_80163E2A >= 0x10) {
if (D_80163E2A >= 16) {
func_80057114(3);
return;
}
// Duplicate return node #5. Try simplifying control flow for better match
return;
}
if (gModeSelection == VERSUS) {
func_80057114();
} else {
if (gModeSelection == VERSUS) {
func_80057114();
}
}
}
extern Gfx D_0D0076F8[];
extern struct Controller *gControllerThree;
extern Gfx *gDisplayListHead;
extern s32 D_800DDB20;
UNUSED void func_8001C42C(void) {
if (D_800DDB20 == 0) {
if ((gControllerThree->buttonPressed & 0x20) != 0) {
D_800DDB20 = 1;
}
} else {
if ((gControllerThree->buttonPressed & 0x20) != 0) {
D_800DDB20 = 0;
}
func_80057C60();
gSPDisplayList(gDisplayListHead++, D_0D0076F8);
func_80057CE4(&gDisplayListHead);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8001C3C4.s")
#endif
+14
View File
@@ -911,6 +911,12 @@ void func_80021E10(Mat4 arg0, f32 *arg1, s16 *arg2) {
GLOBAL_ASM("asm/non_matchings/code_8001F980/func_80021E10.s")
#endif
UNUSED void func_80021F50(Mat4 arg0, Vec3f arg1) {
arg0[3][0] += arg1[0];
arg0[3][1] += arg1[1];
arg0[3][2] += arg1[2];
}
void func_80021F84(Mat4 arg0, f32 arg1) {
arg0[0][0] *= arg1;
arg0[1][0] *= arg1;
@@ -3230,3 +3236,11 @@ void func_80026B4C(void *arg0, s8 arg1, s8 arg2, s8 arg3) {
#else
GLOBAL_ASM("asm/non_matchings/code_8001F980/func_80026B4C.s")
#endif
UNUSED void func_8002701C(void) {
}
UNUSED void func_80027024(s32 arg0, s32 arg1, s32 arg2) {
}
+117
View File
@@ -757,6 +757,10 @@ void func_80028E70(void *arg0, s32 arg1, s8 arg2, s8 arg3) {
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_80028E70.s")
#endif
UNUSED void func_80028F5C(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
}
void func_80028F70(void) {
D_80164AF0 = 0;
func_80028E70(gPlayerOneCopy, camera1, 0, 0);
@@ -1769,6 +1773,47 @@ block_33:
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002AE38.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_8002B218(void *arg0) {
s32 temp_t0;
s32 var_v0;
u16 temp_a1;
sp38[0].unk0 = (s32) D_800E3C70.unk0;
sp38[0].unk4 = (s32) D_800E3C70.unk4;
var_v0 = 0;
sp38[0].unk8 = (s32) D_800E3C70.unk8;
sp38[0].unkC = (s32) D_800E3C70.unkC;
sp38[0].unk10 = (s32) D_800E3C70.unk10;
sp24[0].unk0 = (s32) D_800E3C84.unk0;
sp24[0].unk4 = (s32) D_800E3C84.unk4;
sp24[0].unk8 = (s32) D_800E3C84.unk8;
sp24[0].unkC = (s32) D_800E3C84.unkC;
sp24[0].unk10 = (s32) D_800E3C84.unk10;
temp_a1 = arg0->unk6;
loop_1:
temp_t0 = (var_v0 + 1) & 0xFFFF;
if (temp_a1 == (&sp38[0])[var_v0]) {
arg0->unkBC = (s32) (arg0->unkBC | 0x10);
func_8002AA50(temp_a1, (u16 (*)[]) &sp38[0], (u16 (*)[]) &sp24[0]);
arg0->unk204 = 0;
return;
}
if (temp_a1 == (&sp24[0])[var_v0]) {
arg0->unkBC = (s32) (arg0->unkBC & ~0x10);
return;
}
var_v0 = temp_t0;
if (temp_t0 >= 0xA) {
return;
}
goto loop_1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002B218.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 90e635335cb052c4324a3aa7478e4761db19dfaf
? func_8002A704(Player *, s8); /* extern */
@@ -5569,6 +5614,78 @@ void func_80033884(void *arg0, s32 *arg1, s32 *arg2, s32 arg3, s32 arg4, s32 arg
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_80033884.s")
#endif
#if MIPS_TO_C
UNUSED void func_80033940(void *arg0, s32 *arg1, s32 arg2, s32 arg3, f32 arg4) {
s32 temp_at;
s32 temp_v0_2;
u32 temp_t6;
u32 temp_v0;
u32 temp_v1;
u32 var_v1;
temp_v1 = arg0->unk200;
temp_t6 = temp_v1 - 0x800;
temp_at = temp_t6 < 0xF0000000U;
temp_v0 = temp_v1;
arg0->unk200 = temp_t6;
var_v1 = temp_t6;
if (temp_at == 0) {
arg0->unk200 = temp_v0;
var_v1 = temp_v0;
}
if (arg3 >= (s32) var_v1) {
arg0->unk200 = (u32) arg3;
var_v1 = (u32) arg3;
}
temp_v0_2 = *arg1;
if (arg2 < temp_v0_2) {
*arg1 = temp_v0_2 - var_v1;
} else {
*arg1 = temp_v0_2 + var_v1;
}
if (arg0->unk90 < arg4) {
arg0->unk90 = (f32) -arg4;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_80033940.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_800339C4(void *arg0, s32 *arg1, s32 arg2, s32 arg3, s32 arg4) {
s32 temp_at;
s32 temp_v1_2;
u32 temp_t6;
u32 temp_v0;
u32 temp_v1;
u32 var_v0;
temp_v0 = arg0->unk200;
temp_t6 = temp_v0 - 0x800;
temp_at = temp_t6 < 0xF0000000U;
temp_v1 = temp_v0;
arg0->unk200 = temp_t6;
var_v0 = temp_t6;
if (temp_at == 0) {
arg0->unk200 = temp_v1;
var_v0 = temp_v1;
}
if (arg3 >= (s32) var_v0) {
arg0->unk200 = (u32) arg3;
var_v0 = (u32) arg3;
}
temp_v1_2 = *arg1;
if (arg2 < temp_v1_2) {
*arg1 = temp_v1_2 - var_v0;
} else {
*arg1 = temp_v1_2 + var_v0;
}
func_80033850(arg4);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_800339C4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80033850(s32); // extern
+651 -7
View File
@@ -3,6 +3,7 @@
#include <defines.h>
#include <common_structs.h>
#include <actor_types.h>
#include <config.h>
void func_80042330(s32 arg0, s32 arg1, u16 arg2, f32 arg3); // math_util extern
@@ -1056,6 +1057,65 @@ void func_8004544C(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004544C.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_80045614(s32 arg0, s32 arg1, s32 arg2) {
void *sp14;
void *sp10;
void *spC;
s32 sp0;
s32 temp_t0;
s32 temp_t2;
s32 temp_t5;
s32 temp_t7;
void *temp_v0;
void *temp_v0_2;
void *temp_v0_3;
void *temp_v0_4;
void *temp_v0_5;
void *temp_v0_6;
void *temp_v0_7;
temp_v0 = gDisplayListHead;
temp_t0 = arg1 - 1;
gDisplayListHead = temp_v0 + 8;
temp_v0->unk0 = (s32) ((temp_t0 & 0xFFF) | 0xFD480000);
temp_v0->unk4 = arg0;
temp_v0_2 = gDisplayListHead;
gDisplayListHead = temp_v0_2 + 8;
temp_t2 = ((((s32) (arg1 + 7) >> 3) & 0x1FF) << 9) | 0xF5480000;
temp_v0_2->unk4 = 0x07080200;
temp_v0_2->unk0 = temp_t2;
temp_v0_3 = gDisplayListHead;
gDisplayListHead = temp_v0_3 + 8;
temp_v0_3->unk4 = 0;
temp_v0_3->unk0 = 0xE6000000;
temp_v0_4 = gDisplayListHead;
gDisplayListHead = temp_v0_4 + 8;
temp_v0_4->unk0 = 0xF4000000;
temp_t5 = ((temp_t0 * 4) & 0xFFF) << 0xC;
temp_t7 = ((arg2 - 1) * 4) & 0xFFF;
sp0 = temp_t7;
temp_v0_4->unk4 = (s32) (temp_t5 | 0x07000000 | temp_t7);
temp_v0_5 = gDisplayListHead;
gDisplayListHead = temp_v0_5 + 8;
sp14 = temp_v0_5;
temp_v0_5->unk4 = 0;
temp_v0_5->unk0 = 0xE7000000;
temp_v0_6 = gDisplayListHead;
gDisplayListHead = temp_v0_6 + 8;
sp10 = temp_v0_6;
temp_v0_6->unk4 = 0x80200;
temp_v0_6->unk0 = temp_t2;
temp_v0_7 = gDisplayListHead;
gDisplayListHead = temp_v0_7 + 8;
spC = temp_v0_7;
temp_v0_7->unk0 = 0xF2000000;
temp_v0_7->unk4 = (s32) (temp_t5 | sp0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_80045614.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s32 *gDisplayListHead;
@@ -2179,7 +2239,98 @@ void func_800485C4(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5, s
gDPSetAlphaCompare(gDisplayListHead++, G_AC_NONE);
}
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_800486B0.s")
UNUSED void func_800486B0(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_8004788C(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 24, 48, 24, 48);
}
UNUSED void func_80048718(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_8004788C(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 32, 32, 32, 32);
}
UNUSED void func_80048780(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_80048540(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 48, 48, 48, 40);
}
UNUSED void func_800487DC(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_8004788C(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 48, 48, 48, 48);
}
UNUSED void func_80048844(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_8004788C(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 64, 32, 64, 32);
}
UNUSED void func_800488AC(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_8004788C(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 64, 64, 64, 32);
}
UNUSED void func_80048914(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_80047910(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 64, 64, 64, 32);
}
UNUSED void func_8004897C(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_80047994(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 64, 64, 64, 32);
}
UNUSED void func_800489E4(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_80047A18(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 64, 64, 64, 32);
}
UNUSED void func_80048A4C(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_80047A9C(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 64, 64, 64, 32);
}
UNUSED void func_80048AB4(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7) {
func_80047B9C(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, 64, 64, 64, 32);
}
UNUSED void func_80048B24(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7) {
func_80047CB4(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, 64, 64, 64, 32);
}
UNUSED void func_80048B94(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5) {
func_80047E48(arg0, arg1, arg2, arg3, arg4, arg5, 64, 64, 64, 32);
}
UNUSED void func_80048BE8(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5) {
func_80047F40(arg0, arg1, arg2, arg3, arg4, arg5, 64, 64, 64, 32);
}
UNUSED void func_80048C3C(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5) {
func_800480B4(arg0, arg1, arg2, arg3, arg4, arg5, 64, 64, 64, 32);
}
UNUSED void func_80048C90(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_800482AC(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 64, 64, 64, 32);
}
UNUSED void func_80048CEC(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_800483B4(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 64, 64, 64, 32);
}
UNUSED void func_80048D48(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_800484BC(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 64, 64, 64, 32);
}
UNUSED void func_80048DA4(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_80048540(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 64, 64, 64, 32);
}
UNUSED void func_80048E00(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_80047910(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 72, 48, 72, 24);
}
UNUSED void func_80048E68(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_80047A18(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 72, 48, 72, 24);
}
UNUSED void func_80048ED0(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) {
func_80047A9C(arg0, arg1, arg2, arg3, arg4, arg5, arg6, 72, 48, 72, 24);
}
UNUSED void func_80048F38(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5) {
func_800480B4(arg0, arg1, arg2, arg3, arg4, arg5, 72, 48, 72, 24);
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800441E0(s32, s32, s32); // extern
@@ -3014,13 +3165,86 @@ extern Vec3f D_80183E50;
extern Vec3f D_80183E70;
void func_80043050(Vec3f, Vec3f, f32);
void func_8004A9B8(f32 arg0) {
func_80043050(D_80183E50, D_80183E70, arg0);
gSPDisplayList(gDisplayListHead++, D_0D007C10);
}
// unused
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004A9B8.s")
extern s32 D_80165860;
extern s32 D_8016586C;
extern s32 D_80165878;
void func_8004B6C4(s32 arg0, s32 arg1, s32 arg2);
UNUSED void func_8004AA10(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8) {
func_80042E00(arg0, arg1, arg2);
gSPDisplayList(gDisplayListHead++, D_0D007AE0);
func_8004B6C4(D_80165860, D_8016586C, D_80165878);
func_800497CC(arg3, arg4, arg5, arg6, arg7, arg8);
}
UNUSED void func_8004AAA0(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049B20(arg0, arg1, arg2, arg3, arg4, arg5, 16, 16, 16, 16);
}
UNUSED void func_8004AB00(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049C18(arg0, arg1, arg2, arg3, arg4, arg5, 16, 16, 16, 16);
}
UNUSED void func_8004AB60(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_8004A0B0(arg0, arg1, arg2, arg3, arg4, arg5, 16, 16, 16, 16);
}
UNUSED void func_8004ABC0(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049B20(arg0, arg1, arg2, arg3, arg4, arg5, 32, 32, 32, 32);
}
UNUSED void func_8004AC20(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049C18(arg0, arg1, arg2, arg3, arg4, arg5, 32, 32, 32, 32);
}
UNUSED void func_8004AC80(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_8004A0B0(arg0, arg1, arg2, arg3, arg4, arg5, 32, 32, 32, 32);
}
UNUSED void func_8004ACE0(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4) {
func_8004A414(arg0, arg1, arg2, arg3, arg4, 32, 32, 32, 32);
}
UNUSED void func_8004AD2C(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049B20(arg0, arg1, arg2, arg3, arg4, arg5, 64, 32, 64, 32);
}
UNUSED void func_8004AD8C(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049C18(arg0, arg1, arg2, arg3, arg4, arg5, 64, 32, 64, 32);
}
UNUSED void func_8004ADEC(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049C94(arg0, arg1, arg2, arg3, arg4, arg5, 64, 32, 64, 32);
}
UNUSED void func_8004AE4C(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049D10(arg0, arg1, arg2, arg3, arg4, arg5, 64, 32, 64, 32);
}
UNUSED void func_8004AEAC(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049D8C(arg0, arg1, arg2, arg3, arg4, arg5, 64, 32, 64, 32);
}
UNUSED void func_8004AF0C(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049C18(arg0, arg1, arg2, arg3, arg4, arg5, 64, 64, 64, 64);
}
UNUSED void func_8004AF6C(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049B20(arg0, arg1, arg2, arg3, arg4, arg5, 64, 64, 64, 32);
}
UNUSED void func_8004AFCC(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 arg4, s32 arg5) {
func_80049C18(arg0, arg1, arg2, arg3, arg4, arg5, 64, 96, 64, 48);
}
UNUSED void func_8004B02C(void) {
gDPSetRenderMode(gDisplayListHead++, AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | ZMODE_XLU | CVG_X_ALPHA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
}
void func_8004B05C(u8 *texture) {
gDPLoadTLUT_pal256(gDisplayListHead++, texture);
@@ -3274,10 +3498,13 @@ void func_8004BA98(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004BA98.s")
#endif
UNUSED void func_8004BB34(void) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_8004BB3C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, f32 arg4) {
s32 temp_f18;
s32 temp_f18_2;
@@ -3336,6 +3563,141 @@ void func_8004BB3C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, f32 arg4) {
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004BB3C.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_8004BD14(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
void *sp70;
s32 sp3C;
s32 sp38;
s32 sp34;
s32 sp28;
s32 sp24;
s32 temp_ra;
s32 temp_t2;
s32 temp_t3;
s32 temp_t5;
s32 temp_t6;
s32 temp_t7;
s32 temp_t9;
void *temp_v0;
void *temp_v0_10;
void *temp_v0_11;
void *temp_v0_12;
void *temp_v0_13;
void *temp_v0_14;
void *temp_v0_15;
void *temp_v0_16;
void *temp_v0_17;
void *temp_v0_18;
void *temp_v0_19;
void *temp_v0_20;
void *temp_v0_2;
void *temp_v0_3;
void *temp_v0_4;
void *temp_v0_5;
void *temp_v0_6;
void *temp_v0_7;
void *temp_v0_8;
void *temp_v0_9;
temp_v0 = gDisplayListHead;
gDisplayListHead = temp_v0 + 8;
temp_v0->unk0 = 0x06000000;
temp_v0->unk4 = &D_0D007F38;
temp_v0_2 = gDisplayListHead;
gDisplayListHead = temp_v0_2 + 8;
temp_v0_2->unk0 = 0x06000000;
temp_v0_2->unk4 = &D_0D008138;
temp_v0_3 = gDisplayListHead;
gDisplayListHead = temp_v0_3 + 8;
temp_v0_3->unk4 = 0;
temp_v0_3->unk0 = 0xBA001001;
temp_v0_4 = gDisplayListHead;
gDisplayListHead = temp_v0_4 + 8;
temp_v0_4->unk0 = 0xFA000000;
temp_v0_4->unk4 = (s32) (arg4 & 0xFF);
temp_v0_5 = gDisplayListHead;
gDisplayListHead = temp_v0_5 + 8;
temp_v0_5->unk4 = 0x1FFC9238;
temp_v0_5->unk0 = 0xFC2527FF;
temp_v0_6 = gDisplayListHead;
temp_t7 = arg2 - 1;
gDisplayListHead = temp_v0_6 + 8;
temp_t9 = (temp_t7 & 0xFFF) | 0xFD100000;
sp38 = temp_t9;
sp3C = temp_t7;
temp_v0_6->unk0 = temp_t9;
temp_v0_6->unk4 = arg5;
temp_v0_7 = gDisplayListHead;
gDisplayListHead = temp_v0_7 + 8;
temp_t6 = ((((u32) ((sp3C * 2) + 9) >> 3) & 0x1FF) << 9) | 0xF5100000;
sp34 = temp_t6;
temp_v0_7->unk4 = 0x07080200;
temp_v0_7->unk0 = temp_t6;
temp_v0_8 = gDisplayListHead;
gDisplayListHead = temp_v0_8 + 8;
sp70 = temp_v0_8;
temp_v0_8->unk4 = 0;
temp_v0_8->unk0 = 0xE6000000;
temp_v0_9 = gDisplayListHead;
gDisplayListHead = temp_v0_9 + 8;
temp_v0_9->unk0 = 0xF4000000;
temp_t3 = sp34 | 0x100;
temp_t5 = ((sp3C * 4) & 0xFFF) << 0xC;
temp_ra = ((arg3 - 1) * 4) & 0xFFF;
temp_t2 = temp_t5 | 0x07000000 | temp_ra;
temp_v0_9->unk4 = temp_t2;
temp_v0_10 = gDisplayListHead;
gDisplayListHead = temp_v0_10 + 8;
temp_v0_10->unk4 = 0;
temp_v0_10->unk0 = 0xE7000000;
temp_v0_11 = gDisplayListHead;
gDisplayListHead = temp_v0_11 + 8;
temp_v0_11->unk4 = 0x80200;
temp_v0_11->unk0 = sp34;
temp_v0_12 = gDisplayListHead;
gDisplayListHead = temp_v0_12 + 8;
temp_v0_12->unk4 = (s32) (temp_t5 | temp_ra);
temp_v0_12->unk0 = 0xF2000000;
temp_v0_13 = gDisplayListHead;
gDisplayListHead = temp_v0_13 + 8;
temp_v0_13->unk0 = sp38;
temp_v0_13->unk4 = arg6;
temp_v0_14 = gDisplayListHead;
gDisplayListHead = temp_v0_14 + 8;
temp_v0_14->unk4 = 0x07080200;
temp_v0_14->unk0 = temp_t3;
temp_v0_15 = gDisplayListHead;
sp24 = temp_t3;
sp28 = temp_t2;
gDisplayListHead = temp_v0_15 + 8;
temp_v0_15->unk4 = 0;
temp_v0_15->unk0 = 0xE6000000;
temp_v0_16 = gDisplayListHead;
gDisplayListHead = temp_v0_16 + 8;
temp_v0_16->unk0 = 0xF4000000;
temp_v0_16->unk4 = sp28;
temp_v0_17 = gDisplayListHead;
gDisplayListHead = temp_v0_17 + 8;
temp_v0_17->unk4 = 0;
temp_v0_17->unk0 = 0xE7000000;
temp_v0_18 = gDisplayListHead;
gDisplayListHead = temp_v0_18 + 8;
temp_v0_18->unk4 = 0x01080200;
temp_v0_18->unk0 = sp24;
temp_v0_19 = gDisplayListHead;
gDisplayListHead = temp_v0_19 + 8;
temp_v0_19->unk0 = 0xF2000000;
temp_v0_19->unk4 = (s32) (temp_t5 | 0x01000000 | temp_ra);
func_8004B950(arg0, arg1, arg2, arg3, 2);
temp_v0_20 = gDisplayListHead;
gDisplayListHead = temp_v0_20 + 8;
temp_v0_20->unk0 = 0x06000000;
temp_v0_20->unk4 = &D_0D008120;
}
#else
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004BD14.s")
#endif
extern Gfx *gDisplayListHead;
void func_8004C024(s16 arg0, s16 arg1, s16 arg2, u16 arg3, u16 arg4, u16 arg5, u16 arg6) {
@@ -3390,12 +3752,17 @@ void func_8004C268(s32 arg0, s32 arg1, s32 arg2, u32 arg3, u32 arg4, u32 arg5, s
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004C268.s")
#endif
UNUSED void func_8004C354() {
}
UNUSED void func_8004C35C() {
}
extern Gfx D_0D007EF8[];
extern Gfx D_0D007EB8[];
extern Gfx D_0D008108[];
void func_8004C364(s32 arg0, s32 arg1, u32 arg2, u32 arg3, s32 arg4) {
gSPDisplayList(gDisplayListHead++, D_0D008108);
gSPDisplayList(gDisplayListHead++, D_0D007EF8);
gDPSetAlphaCompare(gDisplayListHead++, G_AC_THRESHOLD);
@@ -3520,7 +3887,6 @@ extern Gfx D_0D007EB8[];
extern Gfx D_0D007EF8[];
extern Gfx D_0D008108[];
void func_8004C268(s32 arg0, s32 arg1, s32 arg2, u32 arg3, u32 arg4, u32 arg5, s32 arg6);
void func_8004C91C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) {
gSPDisplayList(gDisplayListHead++, D_0D008108);
@@ -3740,6 +4106,38 @@ void *func_8004D0D4(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5)
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004D0D4.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_8004D210(s32 arg0, s32 arg1, s32 arg2, ? arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8, s32 argA) {
s32 temp_lo;
s32 var_s0;
s32 var_s3;
s32 var_s4;
void *temp_v1;
temp_v1 = gDisplayListHead;
gDisplayListHead = temp_v1 + 8;
temp_v1->unk0 = 0x06000000;
temp_v1->unk4 = &D_0D007FE0;
var_s3 = arg1 - (arg8 / 2);
var_s4 = arg2;
func_8004B35C(arg3, arg4, arg5, arg6);
var_s0 = 0;
temp_lo = arg8 / argA;
if (temp_lo > 0) {
do {
func_80044924(var_s4, arg7, argA);
func_8004B97C(arg0 - (arg7 / 2), var_s3, arg7, argA, 1);
var_s0 += 1;
var_s4 += (s32) (arg7 * argA) / 2;
var_s3 += argA;
} while (var_s0 != temp_lo);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004D210.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80044F34(s32, s32, s32); // extern
@@ -3820,6 +4218,34 @@ void func_8004D4E8(s32 arg0, s32 arg1, s32 arg2, ? arg3, s32 arg4, s32 arg5, s32
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004D4E8.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_8004D654(s32 arg0, s32 arg1, s32 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg8, s32 arg9, s32 argB) {
s32 temp_lo;
s32 var_s0;
s32 var_s2;
void *temp_v1;
temp_v1 = gDisplayListHead;
gDisplayListHead = temp_v1 + 8;
temp_v1->unk0 = 0x06000000;
temp_v1->unk4 = &D_0D008000;
var_s2 = arg2;
func_8004B480(arg4, arg5, arg6, arg2);
var_s0 = 0;
temp_lo = arg9 / argB;
if (temp_lo > 0) {
do {
func_80044F34(var_s2, arg8, argB);
func_8004BB3C(arg0, arg1, arg8, arg9, arg3);
var_s0 += 1;
var_s2 += (s32) (arg8 * argB) / 2;
} while (var_s0 != temp_lo);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004D654.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800441E0(s32, s32, ?); // extern
@@ -3984,6 +4410,70 @@ void func_8004DAB8(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004DAB8.s")
#endif
UNUSED void func_8004DC34(s32 arg0, s32 arg1, s32 arg2) {
func_8004CF9C(arg0, arg1, arg2, 8, 160, 8, 160);
}
UNUSED void func_8004DC6C(s32 arg0, s32 arg1, s32 arg2) {
func_8004CF9C(arg0, arg1, arg2, 12, 160, 12, 160);
}
UNUSED void func_8004DCA4(s32 arg0, s32 arg1, s32 arg2) {
func_8004CF9C(arg0, arg1, arg2, 12, 192, 12, 192);
}
UNUSED void func_8004DCDC(s32 arg0, s32 arg1, s32 arg2) {
func_8004CD48(arg0, arg1, arg2, 16, 16, 16);
}
UNUSED void func_8004DD0C(s32 arg0, s32 arg1, s32 arg2) {
func_8004CF9C(arg0, arg1, arg2, 16, 160, 16, 160);
}
UNUSED void func_8004DD44(s32 arg0, s32 arg1, s32 arg2) {
func_8004CD48(arg0, arg1, arg2, 32, 32, 32);
}
UNUSED void func_8004DD74(s32 arg0, s32 arg1, s32 arg2) {
func_8004CF9C(arg0, arg1, arg2, 32, 32, 32, 32);
}
UNUSED void func_8004DDAC(s32 arg0, s32 arg1, s32 arg2) {
func_8004D0D4(arg0, arg1, arg2, 32, 32, 32);
}
UNUSED void func_8004DDDC(s32 arg0, s32 arg1, s32 arg2) {
func_8004D7B4(arg0, arg1, arg2, 32, 32);
}
UNUSED void func_8004DE04(s32 arg0, s32 arg1, s32 arg2) {
func_8004D93C(arg0, arg1, arg2, 32, 32);
}
UNUSED void func_8004DE2C(s32 arg0, s32 arg1, s32 arg2) {
func_8004DAB8(arg0, arg1, arg2, 32, 32);
}
UNUSED void func_8004DE54(s32 arg0, s32 arg1, s32 arg2) {
func_8004CD48(arg0, arg1, arg2, 64, 32, 32);
}
UNUSED void func_8004DE84(s32 arg0, s32 arg1, s32 arg2) {
func_8004CD48(arg0, arg1, arg2, 64, 64, 32);
}
UNUSED void func_8004DEB4(s32 arg0, s32 arg1, s32 arg2) {
func_8004CF9C(arg0, arg1, arg2, 64, 96, 64, 48);
}
UNUSED void func_8004DEEC(s32 arg0, s32 arg1, s32 arg2) {
func_8004CF9C(arg0, arg1, arg2, 112, 32, 112, 32);
}
UNUSED void func_8004DF24(s32 arg0, s32 arg1, s32 arg2) {
func_8004CF9C(arg0, arg1, arg2, 128, 32, 128, 32);
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800452A4(s32, s32, s32); // extern
@@ -4062,6 +4552,9 @@ void func_8004E06C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004E06C.s")
#endif
UNUSED void func_8004E238(void) {
}
extern Gfx D_0D007CB8[];
@@ -4115,7 +4608,29 @@ void func_8004E4CC(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
func_8004E240(arg0, arg1, arg2, arg3, 40, 32, 32);
}
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8004E4CC.s")
UNUSED void func_8004E500(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
func_8004E240(arg0, arg1, arg2, arg3, 48, 48, 24);
}
UNUSED void func_8004E534(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
func_8004E240(arg0, arg1, arg2, arg3, 64, 32, 32);
}
UNUSED void func_8004E568(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
func_8004E240(arg0, arg1, arg2, arg3, 64, 64, 32);
}
UNUSED void func_8004E59C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
func_8004E2B8(arg0, arg1, arg2, arg3, arg4, 64, 64, 32);
}
UNUSED void func_8004E5D8(s32 arg0, s32 arg1, u8 *tlut, s32 arg3) {
func_8004E338(arg0, arg1, tlut, arg3, 64, 64);
}
UNUSED void func_8004E604(s32 arg0, s32 arg1, u8 *tlut, s32 arg3) {
func_8004E240(arg0, arg1, tlut, arg3, SCREEN_WIDTH, SCREEN_HEIGHT, 6);
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75
@@ -5290,6 +5805,73 @@ block_20:
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_800508C0.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_80050C68(void) {
s32 sp88;
s32 sp84;
? *var_s2;
f32 temp_f20;
s32 var_s1;
u16 temp_v0;
void *temp_v0_2;
void *temp_v0_3;
void *temp_v0_4;
void *temp_v0_5;
void *temp_v0_6;
void *temp_v0_7;
void *temp_v0_8;
void *temp_v0_9;
temp_f20 = D_800EE064;
var_s2 = &D_80163DE8;
var_s1 = 0;
do {
temp_v0 = var_s2->unk44;
if ((temp_v0 != 4) && (temp_v0 != 0)) {
func_800507D8(var_s1 & 0xFFFF, &sp88, &sp84);
temp_v0_2 = gDisplayListHead;
gDisplayListHead = temp_v0_2 + 8;
temp_v0_2->unk4 = &D_0D007DB8;
temp_v0_2->unk0 = 0x06000000;
temp_v0_3 = gDisplayListHead;
gDisplayListHead = temp_v0_3 + 8;
temp_v0_3->unk4 = &D_0D01B4D8;
temp_v0_3->unk0 = 0xFD100000;
temp_v0_4 = gDisplayListHead;
gDisplayListHead = temp_v0_4 + 8;
temp_v0_4->unk4 = 0;
temp_v0_4->unk0 = 0xE8000000;
temp_v0_5 = gDisplayListHead;
gDisplayListHead = temp_v0_5 + 8;
temp_v0_5->unk4 = 0x07000000;
temp_v0_5->unk0 = 0xF5000100;
temp_v0_6 = gDisplayListHead;
gDisplayListHead = temp_v0_6 + 8;
temp_v0_6->unk4 = 0;
temp_v0_6->unk0 = 0xE6000000;
temp_v0_7 = gDisplayListHead;
gDisplayListHead = temp_v0_7 + 8;
temp_v0_7->unk4 = 0x073FC000;
temp_v0_7->unk0 = 0xF0000000;
temp_v0_8 = gDisplayListHead;
gDisplayListHead = temp_v0_8 + 8;
temp_v0_8->unk4 = 0;
temp_v0_8->unk0 = 0xE7000000;
func_800452A4(&D_0D01D6D8, 0x20, 0x20);
func_80042330(sp88 + 0x20, sp84 + 0x12, 0, temp_f20);
temp_v0_9 = gDisplayListHead;
gDisplayListHead = temp_v0_9 + 8;
temp_v0_9->unk4 = &D_0D0069E0;
temp_v0_9->unk0 = 0x06000000;
}
var_s1 += 1;
var_s2 += 0x54;
} while (var_s1 != 7);
}
#else
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_80050C68.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80042330(s32, s32, ?, ?); // extern
@@ -8230,6 +8812,10 @@ void func_8005568C(s32 arg0) {
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_8005568C.s")
#endif
UNUSED void func_800557AC() {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80004DFC(s32, s32, u8, s8); // extern
@@ -8920,6 +9506,53 @@ void func_80056AC0(s32 arg0) {
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_80056AC0.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_80056BF0(s32 arg0) {
f32 sp40;
f32 *var_t6;
s32 *var_t9;
s32 temp_at;
s32 temp_s0;
s32 temp_v0;
s32 temp_v0_2;
void *temp_t3;
void *temp_v1;
var_t9 = (arg0 * 0x54) + &D_80163DE8;
temp_t3 = var_t9 + 0x54;
var_t6 = &sp40;
do {
temp_at = *var_t9;
var_t9 += 0xC;
var_t6 += 0xC;
var_t6->unk-C = temp_at;
var_t6->unk-8 = (s32) var_t9->unk-8;
var_t6->unk-4 = (s32) var_t9->unk-4;
} while (var_t9 != temp_t3);
D_80183E40.unk0 = sp40;
D_80183E40.unk4 = (f32) ((f64) sp44 + 1.0);
D_80183E40.unk8 = sp48;
func_800480B4(&D_80183E40, &D_80183E80, 0x3E800000, &D_0D02A858, (*(&D_800E471C + ((u32) D_801655CC % 6U)) << 0xA) + &D_0D029858, &D_0D005AE0, 0x20, 0x20, 0x20, 0x20);
temp_v1 = gDisplayListHead;
temp_s0 = D_8018D400;
gDisplayListHead = temp_v1 + 8;
temp_v1->unk0 = 0x06000000;
temp_v1->unk4 = &D_0D007B00;
func_8004B414(0, 0, 0, 0xFF);
D_80183E44 = (f32) ((f64) sp44 + 5.0);
D_80183E84 = 0;
func_800562E4(temp_s0 % 3, temp_s0 % 4, 0xFF);
temp_v0 = temp_s0 + 1;
D_80183E84 = 0x6000;
func_800562E4(temp_v0 % 3, temp_v0 % 4, 0xFF);
temp_v0_2 = temp_s0 + 2;
D_80183E84 = 0xA000;
func_800562E4(temp_v0_2 % 3, temp_v0_2 % 4, 0xFF);
}
#else
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_80056BF0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_800418AC(f32, f32, s32); // extern
@@ -9102,6 +9735,17 @@ void func_80057114(s32 arg0) {
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_80057114.s")
#endif
UNUSED void func_80057330(void) {
}
UNUSED void func_80057338(void) {
gSPDisplayList(gDisplayListHead++, D_0D0079C8);
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BOTH);
gSPDisplayList(gDisplayListHead++, D_0D007AE0);
gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF);
}
UNUSED void func_800573BC(void) {
+331
View File
@@ -3273,6 +3273,10 @@ void func_8005DA30(s32 arg0, s16 arg1, s32 arg2, s8 arg3, s8 arg4) {
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005DA30.s")
#endif
UNUSED void func_8005DAD0(void) {
}
void func_8005DAD8(UnkPlayerStruct258* arg0, s16 arg1, s16 arg2, s16 arg3) {
arg0->unk_038 = arg1;
arg0->unk_03E = arg3;
@@ -7034,6 +7038,105 @@ void func_800664E0(void *arg0, ? arg1, s16 arg2, s8 arg3) {
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800664E0.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_80066714(void *arg0, ? arg1, s16 arg2, s8 arg3) {
f32 sp64;
f32 sp60;
f32 sp5C;
s16 sp58;
s16 sp56;
s16 sp54;
s16 sp52;
s16 sp50;
s16 sp4E;
s16 sp4C;
void *sp2C;
void *sp28;
void *temp_v0;
void *temp_v0_10;
void *temp_v0_11;
void *temp_v0_12;
void *temp_v0_13;
void *temp_v0_2;
void *temp_v0_3;
void *temp_v0_4;
void *temp_v0_5;
void *temp_v0_6;
void *temp_v0_7;
void *temp_v0_8;
void *temp_v0_9;
temp_v0 = arg0 + (arg2 * 0x48);
if (temp_v0->unk544 == 1) {
sp52 = temp_v0->unk560;
sp50 = temp_v0->unk562;
sp4E = temp_v0->unk564;
sp4C = temp_v0->unk566;
sp5C = temp_v0->unk528;
sp60 = temp_v0->unk52C;
sp54 = 0;
sp64 = temp_v0->unk530;
sp58 = 0;
sp56 = (arg0 + (arg3 * 2))->unk48;
func_800652D4(&sp5C, &sp54, temp_v0->unk534 * arg0->unk224, arg3);
temp_v0_2 = gDisplayListHead;
gDisplayListHead = temp_v0_2 + 8;
temp_v0_2->unk0 = 0x06000000;
temp_v0_2->unk4 = &D_0D008C90;
temp_v0_3 = gDisplayListHead;
gDisplayListHead = temp_v0_3 + 8;
temp_v0_3->unk4 = 0;
temp_v0_3->unk0 = 0xBA000E02;
temp_v0_4 = gDisplayListHead;
gDisplayListHead = temp_v0_4 + 8;
temp_v0_4->unk0 = 0xFD100000;
temp_v0_4->unk4 = &D_0D000200;
temp_v0_5 = gDisplayListHead;
gDisplayListHead = temp_v0_5 + 8;
temp_v0_5->unk0 = 0xF5100000;
temp_v0_5->unk4 = 0x07080200;
temp_v0_6 = gDisplayListHead;
gDisplayListHead = temp_v0_6 + 8;
temp_v0_6->unk4 = 0;
temp_v0_6->unk0 = 0xE6000000;
temp_v0_7 = gDisplayListHead;
gDisplayListHead = temp_v0_7 + 8;
temp_v0_7->unk4 = 0x077FF100;
temp_v0_7->unk0 = 0xF3000000;
temp_v0_8 = gDisplayListHead;
gDisplayListHead = temp_v0_8 + 8;
temp_v0_8->unk4 = 0;
temp_v0_8->unk0 = 0xE7000000;
temp_v0_9 = gDisplayListHead;
gDisplayListHead = temp_v0_9 + 8;
sp2C = temp_v0_9;
temp_v0_9->unk0 = 0xF5101000;
temp_v0_9->unk4 = 0x80200;
temp_v0_10 = gDisplayListHead;
gDisplayListHead = temp_v0_10 + 8;
sp28 = temp_v0_10;
temp_v0_10->unk0 = 0xF2000000;
temp_v0_10->unk4 = 0x7C0FC;
func_8004B35C(sp52, sp50, sp4E, sp4C);
temp_v0_11 = gDisplayListHead;
gDisplayListHead = temp_v0_11 + 8;
temp_v0_11->unk0 = 0xB900031D;
temp_v0_11->unk4 = 0x504A50;
temp_v0_12 = gDisplayListHead;
gDisplayListHead = temp_v0_12 + 8;
temp_v0_12->unk4 = &D_800E8B00;
temp_v0_12->unk0 = 0x0400103F;
temp_v0_13 = gDisplayListHead;
gDisplayListHead = temp_v0_13 + 8;
temp_v0_13->unk0 = 0x06000000;
temp_v0_13->unk4 = &D_0D008DA0;
D_80164AF0 += 1;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80066714.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8004B35C(s16, s16, s16, s16); // extern
@@ -10443,6 +10546,234 @@ void func_8006BB34(struct UnkStruct_8028088C arg0*, s32 arg1, s16 arg2, s16 arg3
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006BB34.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_8006C0C8(void *arg0, ? arg1, s32 arg2, s16 arg3) {
f32 sp54;
f32 sp50;
f32 sp4C;
s16 sp48;
s16 sp46;
s16 sp44;
void *sp1C;
void *temp_v0;
void *temp_v0_2;
void *temp_v0_3;
void *temp_v0_4;
void *temp_v0_5;
void *temp_v0_6;
void *temp_v0_7;
void *temp_v0_8;
void *temp_v0_9;
sp4C = arg0->unk0;
sp50 = arg0->unk4;
sp44 = 0;
sp54 = arg0->unk8;
sp48 = 0;
sp46 = camera1->unk26;
func_800652D4(arg1, &sp4C, &sp44, arg1);
temp_v0 = gDisplayListHead;
gDisplayListHead = temp_v0 + 8;
temp_v0->unk0 = 0x06000000;
temp_v0->unk4 = &D_0D008DB8;
temp_v0_2 = gDisplayListHead;
gDisplayListHead = temp_v0_2 + 8;
temp_v0_2->unk0 = 0xFD700000;
temp_v0_2->unk4 = (s32) D_8018D48C;
temp_v0_3 = gDisplayListHead;
gDisplayListHead = temp_v0_3 + 8;
temp_v0_3->unk4 = 0x07000000;
temp_v0_3->unk0 = 0xF5700000;
temp_v0_4 = gDisplayListHead;
gDisplayListHead = temp_v0_4 + 8;
temp_v0_4->unk4 = 0;
temp_v0_4->unk0 = 0xE6000000;
temp_v0_5 = gDisplayListHead;
gDisplayListHead = temp_v0_5 + 8;
temp_v0_5->unk4 = 0x071FF200;
temp_v0_5->unk0 = 0xF3000000;
temp_v0_6 = gDisplayListHead;
gDisplayListHead = temp_v0_6 + 8;
temp_v0_6->unk4 = 0;
temp_v0_6->unk0 = 0xE7000000;
temp_v0_7 = gDisplayListHead;
gDisplayListHead = temp_v0_7 + 8;
temp_v0_7->unk4 = 0;
temp_v0_7->unk0 = 0xF5680800;
temp_v0_8 = gDisplayListHead;
gDisplayListHead = temp_v0_8 + 8;
sp1C = temp_v0_8;
temp_v0_8->unk4 = 0x7C07C;
temp_v0_8->unk0 = 0xF2000000;
func_8004B35C((s16) ((arg2 >> 0x10) & 0xFF), (s16) ((arg2 >> 8) & 0xFF), (s16) (arg2 & 0xFF), arg3);
temp_v0_9 = gDisplayListHead;
gDisplayListHead = temp_v0_9 + 8;
temp_v0_9->unk0 = 0x06000000;
temp_v0_9->unk4 = &D_0D008E48;
D_80164AF0 += 1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006C0C8.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_8006C294(void *arg0, ? arg1, s32 arg2, s16 arg3) {
f32 sp64;
f32 sp60;
f32 sp5C;
s16 sp58;
s16 sp56;
s16 sp54;
void *sp2C;
void *sp28;
void *temp_v0;
void *temp_v0_10;
void *temp_v0_11;
void *temp_v0_12;
void *temp_v0_2;
void *temp_v0_3;
void *temp_v0_4;
void *temp_v0_5;
void *temp_v0_6;
void *temp_v0_7;
void *temp_v0_8;
void *temp_v0_9;
sp5C = arg0->unk0;
sp60 = arg0->unk4;
sp54 = 0;
sp64 = arg0->unk8;
sp58 = 0;
sp56 = camera1->unk26;
func_800652D4(arg1, &sp5C, &sp54, arg1);
temp_v0 = gDisplayListHead;
gDisplayListHead = temp_v0 + 8;
temp_v0->unk0 = 0x06000000;
temp_v0->unk4 = &D_0D008D58;
temp_v0_2 = gDisplayListHead;
gDisplayListHead = temp_v0_2 + 8;
temp_v0_2->unk4 = 0;
temp_v0_2->unk0 = 0xBA000E02;
temp_v0_3 = gDisplayListHead;
gDisplayListHead = temp_v0_3 + 8;
temp_v0_3->unk0 = 0xFD700000;
temp_v0_3->unk4 = (s32) D_8018D488;
temp_v0_4 = gDisplayListHead;
gDisplayListHead = temp_v0_4 + 8;
temp_v0_4->unk4 = 0x07080200;
temp_v0_4->unk0 = 0xF5700000;
temp_v0_5 = gDisplayListHead;
gDisplayListHead = temp_v0_5 + 8;
temp_v0_5->unk4 = 0;
temp_v0_5->unk0 = 0xE6000000;
temp_v0_6 = gDisplayListHead;
gDisplayListHead = temp_v0_6 + 8;
temp_v0_6->unk4 = 0x071FF200;
temp_v0_6->unk0 = 0xF3000000;
temp_v0_7 = gDisplayListHead;
gDisplayListHead = temp_v0_7 + 8;
temp_v0_7->unk4 = 0;
temp_v0_7->unk0 = 0xE7000000;
temp_v0_8 = gDisplayListHead;
gDisplayListHead = temp_v0_8 + 8;
sp2C = temp_v0_8;
temp_v0_8->unk0 = 0xF5680800;
temp_v0_8->unk4 = 0x80200;
temp_v0_9 = gDisplayListHead;
gDisplayListHead = temp_v0_9 + 8;
sp28 = temp_v0_9;
temp_v0_9->unk0 = 0xF2000000;
temp_v0_9->unk4 = 0x7C07C;
func_8004B35C((s16) ((arg2 >> 0x10) & 0xFF), (s16) ((arg2 >> 8) & 0xFF), (s16) (arg2 & 0xFF), arg3);
temp_v0_10 = gDisplayListHead;
gDisplayListHead = temp_v0_10 + 8;
temp_v0_10->unk0 = 0xB900031D;
temp_v0_10->unk4 = 0x504B50;
temp_v0_11 = gDisplayListHead;
gDisplayListHead = temp_v0_11 + 8;
temp_v0_11->unk4 = &D_800E87C0;
temp_v0_11->unk0 = 0x0400103F;
temp_v0_12 = gDisplayListHead;
gDisplayListHead = temp_v0_12 + 8;
temp_v0_12->unk0 = 0x06000000;
temp_v0_12->unk4 = &D_0D008DA0;
D_80164AF0 += 1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006C294.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_8006C4D4(void *arg0, ? arg1, s32 arg2, s16 arg3, s16 arg4) {
f32 sp54;
f32 sp50;
f32 sp4C;
s16 sp48;
s16 sp46;
s16 sp44;
void *sp1C;
void *temp_v0;
void *temp_v0_2;
void *temp_v0_3;
void *temp_v0_4;
void *temp_v0_5;
void *temp_v0_6;
void *temp_v0_7;
void *temp_v0_8;
void *temp_v0_9;
sp4C = arg0->unk0;
sp50 = arg0->unk4;
sp44 = 0;
sp54 = arg0->unk8;
sp48 = 0;
sp46 = camera1->unk26;
func_800652D4(arg1, &sp4C, &sp44, arg1);
temp_v0 = gDisplayListHead;
gDisplayListHead = temp_v0 + 8;
temp_v0->unk0 = 0x06000000;
temp_v0->unk4 = &D_0D008DB8;
temp_v0_2 = gDisplayListHead;
gDisplayListHead = temp_v0_2 + 8;
temp_v0_2->unk0 = 0xFD900000;
temp_v0_2->unk4 = (void *) ((arg4 << 0xA) + &D_0D02AC58);
temp_v0_3 = gDisplayListHead;
gDisplayListHead = temp_v0_3 + 8;
temp_v0_3->unk4 = 0x07000000;
temp_v0_3->unk0 = 0xF5900000;
temp_v0_4 = gDisplayListHead;
gDisplayListHead = temp_v0_4 + 8;
temp_v0_4->unk4 = 0;
temp_v0_4->unk0 = 0xE6000000;
temp_v0_5 = gDisplayListHead;
gDisplayListHead = temp_v0_5 + 8;
temp_v0_5->unk4 = 0x071FF200;
temp_v0_5->unk0 = 0xF3000000;
temp_v0_6 = gDisplayListHead;
gDisplayListHead = temp_v0_6 + 8;
temp_v0_6->unk4 = 0;
temp_v0_6->unk0 = 0xE7000000;
temp_v0_7 = gDisplayListHead;
gDisplayListHead = temp_v0_7 + 8;
temp_v0_7->unk4 = 0;
temp_v0_7->unk0 = 0xF5880800;
temp_v0_8 = gDisplayListHead;
gDisplayListHead = temp_v0_8 + 8;
sp1C = temp_v0_8;
temp_v0_8->unk4 = 0x7C07C;
temp_v0_8->unk0 = 0xF2000000;
func_8004B414((s16) ((arg2 >> 0x10) & 0xFF), (s16) ((arg2 >> 8) & 0xFF), (s16) (arg2 & 0xFF), arg3);
temp_v0_9 = gDisplayListHead;
gDisplayListHead = temp_v0_9 + 8;
temp_v0_9->unk0 = 0x06000000;
temp_v0_9->unk4 = &D_0D008E48;
D_80164AF0 += 1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006C4D4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
? func_8005DA30(s16, s32, s8, s32); /* extern */
+141
View File
@@ -465,6 +465,11 @@ void func_800729EC(s32 arg0) {
#else
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_800729EC.s")
#endif
extern struct struct_E0 D_80165CEA[];
UNUSED void func_80072A78(s32 arg0, s32 arg1) {
D_80165CEA[arg0].unk00.s8 = arg1;
func_80072488(arg0);
}
s32 func_80072AAC(s32 arg0, s32 arg1, s32 arg2) {
s32 phi_v1;
@@ -2579,6 +2584,41 @@ s32 func_80076828(s32 arg0, s32 arg1) {
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80076828.s")
#endif
#ifdef MIPS_TO_C
UNUSED void func_80076884(s32 arg0) {
s32 temp_v0;
s32 var_s0;
void *var_s2;
temp_v0 = random_int(0xF);
switch (arg0) { /* irregular */
default:
var_s2 = sp28;
break;
case 0:
var_s2 = (temp_v0 * 6) + &D_800E5740;
break;
case 1:
var_s2 = (temp_v0 * 6) + &D_800E579C;
break;
case 2:
var_s2 = (temp_v0 * 6) + &D_800E57F8;
break;
}
var_s0 = 0;
loop_8:
var_s0 += 1;
if (func_80076828(var_s2, var_s0) != -1) {
if (var_s0 != 1) {
goto loop_8;
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80076884.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80072488(s32); // extern
@@ -2687,6 +2727,10 @@ void func_80076AEC(s32 arg0) {
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80076AEC.s")
#endif
void func_80076B7C(void) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_80072100(s32 *); // extern
@@ -4018,6 +4062,10 @@ void func_80078A44(s32 arg0, s32 arg1, s32 arg2) {
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80078A44.s")
#endif
UNUSED void func_80078C68() {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
? func_80078170(s32, s32, s32); /* extern */
@@ -5179,6 +5227,10 @@ void func_8007A778(s32 arg0, void *arg1, void *arg2) {
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007A778.s")
#endif
UNUSED void func_8007A884(void) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800790E4(); // extern
@@ -6364,6 +6416,10 @@ void func_8007C420(s32 arg0, void *arg1, s32 arg2) {
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007C420.s")
#endif
UNUSED void func_8007C49C(void) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800721C0(?, s32); // extern
@@ -6868,6 +6924,87 @@ block_6:
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007CEDC.s")
#endif
#ifdef MIPS_TO_C
void func_8007D070(void) {
f32 sp44;
? *var_s2;
f32 temp_f2;
f32 temp_f4;
f32 temp_f6;
s16 temp_s2;
s16 temp_v1;
s32 temp_s1;
s32 temp_s1_2;
s32 temp_s1_3;
s32 temp_s3;
s32 temp_t2;
s32 temp_t5;
s32 var_v0;
void *temp_a1;
void *temp_s0;
void *temp_s0_2;
var_v0 = 0;
if ((D_8016559C == 0) && (D_8018D2A4 != 0)) {
temp_v1 = D_8018CF68;
if ((temp_v1 < 0x1D) && (*(&D_800E5DB4 + temp_v1) == 1)) {
if ((&D_80165C18 + (D_8018C1D8 * 0xE0))->unkA6 != 0) {
loop_5:
var_v0 += 1;
if (var_v0 != 0x1E) {
if ((&D_80165C18 + ((&D_8018C1B0 + (var_v0 * 4))->unk28 * 0xE0))->unkA6 != 0) {
goto loop_5;
}
}
}
temp_s1 = (&D_8018C1B0 + (var_v0 * 4))->unk28;
if (var_v0 != 0x1E) {
temp_s0 = &D_80165C18 + (temp_s1 * 0xE0);
if (temp_s0->unkA6 == 0) {
func_800723A4(temp_s1, 1);
temp_s2 = random_int(0x12C);
temp_s3 = (random_int(0x1000) - 0x800) & 0xFFFF;
temp_t5 = (random_int(0xF) - 5) << 0x10;
temp_s0->unkC0 = (s16) (D_8018CF1C->unk2E + 0x8000);
temp_t2 = (D_8018CF14->unk26 + temp_s3) & 0xFFFF;
temp_s1_2 = temp_t2;
temp_f2 = (f32) temp_s2;
temp_f6 = sins(temp_t2 & 0xFFFF) * temp_f2;
sp44 = temp_f2;
temp_s0->unk14 = (f32) (temp_t5 >> 0x10);
temp_s0->unk10 = (f32) (temp_f6 + D_8018CF1C->unk14);
temp_f4 = coss(temp_s1_2 & 0xFFFF) * temp_f2;
temp_s0->unk80 = &D_800E5D54;
temp_s0->unk18 = (f32) (temp_f4 + D_8018CF1C->unk1C);
}
}
}
}
var_s2 = &D_8018C1B0;
do {
temp_s1_3 = var_s2->unk28;
temp_s0_2 = &D_80165C18 + (temp_s1_3 * 0xE0);
if (temp_s0_2->unkA6 != 0) {
func_8007CEDC(temp_s1_3);
func_8008B724(temp_s1_3);
temp_a1 = D_8018CF1C;
temp_s0_2->unk4 = (f32) (temp_s0_2->unk28 + temp_s0_2->unk10);
temp_s0_2->unk8 = (f32) (temp_s0_2->unk2C + (temp_a1->unk74 + temp_s0_2->unk14));
temp_s0_2->unkC = (f32) (temp_s0_2->unk30 + temp_s0_2->unk18);
func_8007C420(temp_s1_3, temp_a1, D_8018CF14);
if (func_8007223C(temp_s1_3, 0x80) != 0) {
temp_s0_2->unk74 = &D_800E44B0;
} else {
temp_s0_2->unk74 = &D_800E4470;
}
}
var_s2 += 4;
} while (var_s2 != &D_8018C228);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007D070.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_80041770(f32, f32, f32, f32); // extern
@@ -11923,6 +12060,10 @@ void func_80084D2C(s32 arg0, s32 arg1) {
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80084D2C.s")
#endif
void func_80085024(void) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800873F4(s32); // extern
+203 -22
View File
@@ -1667,6 +1667,29 @@ void func_8008A1D0(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008A1D0.s")
#endif
#ifdef MIPS_TO_C
void func_8008A2CC(s32 arg0, s32 arg1, u16 arg2) {
Camera sp1C;
u16 var_a2;
// camera1[arg1]? m2c said this, but makes no sense. camera1->unk000 = arg1? would make sense.
sp1C = cameras[arg1];
func_800721E8(0x40000);
if (sp18 < 0x2711U) {
var_a2 = 0x5555;
} else {
var_a2 = arg2;
if (sp18 < 0x9C41U) {
var_a2 = 0x4000;
}
}
if (func_8008A140(arg0, sp1C, var_a2) != 0) {
func_800721C0(arg0, 0x40000);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008A2CC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800721C0(s32, ?); // extern
@@ -1774,6 +1797,28 @@ void func_8008A4CC(s32 arg0) {
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008A4CC.s")
#endif
#ifdef MIPS_TO_C
void func_8008A610(s32 arg0) {
s32 var_s0;
s32 var_s1;
func_800721E8(0x40000);
var_s0 = camera1;
var_s1 = 0;
if (gPlayerCountSelection1 > 0) {
do {
if ((((arg0 * 0xE0) + &D_80165C18)->unkA6 != 0) && (func_8008A140(arg0, var_s0, 0x2AAB) != 0)) {
func_800721C0(arg0, 0x40000);
}
var_s1 += 1;
var_s0 += 0xB8;
} while (var_s1 < gPlayerCountSelection1);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008A610.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800721C0(s32, ?); // extern
@@ -1815,6 +1860,27 @@ void func_8008A6DC(s32 arg0, f32 arg1) {
#else
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008A6DC.s")
#endif
void func_8008A6DC(s32, f32);
UNUSED void func_8008A810(s32 arg0) {
func_8008A6DC(arg0, 500.0f);
}
UNUSED void func_8008A830(s32 arg0) {
func_8008A6DC(arg0, 1000.0f);
}
UNUSED void func_8008A850(s32 arg0) {
func_8008A6DC(arg0, 2000.0f);
}
struct struct_8008A870 {
s8 unk0[0x119];
u16 unk11A;
};
UNUSED s32 func_8008A870(struct struct_8008A870 *arg0) {
return func_802ABD40(arg0->unk11A);
}
s32 func_8008A890(struct UnkStruct8008A890 *arg0) {
return func_802ABD40(arg0->value);
@@ -1949,6 +2015,55 @@ void func_8008AB10(s32 arg0) {
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008AB10.s")
#endif
extern struct struct_E0 D_80165CC6[];
UNUSED void func_8008ABC0(s32 arg0) {
switch (D_80165CC6[arg0].unk00.s16) {
case 1:
func_8008AA3C();
break;
case 2:
func_8008AB10();
break;
case 3:
func_80086F60(arg0);
/* fallthrough */
case 0:
break;
}
}
UNUSED void func_8008AC40(s32 arg0) {
switch (D_80165CC6[arg0].unk00.s16) {
case 1:
func_8008AA3C();
break;
case 2:
func_8008AB10();
break;
case 3:
func_8008701C(arg0, 1);
/* fallthrough */
case 0:
break;
}
}
UNUSED void func_8008ACC0(void) {
}
UNUSED void func_8008ACC8(void) {
}
UNUSED void func_8008ACD0(void) {
}
UNUSED void func_8008ACD8(void) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f64 D_800EF4F8;
@@ -1975,6 +2090,14 @@ void func_8008ACE0(void *arg0, f32 arg1) {
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008ACE0.s")
#endif
UNUSED void func_8008ADC0(void) {
}
UNUSED void func_8008ADC8(void) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_8008ADD0(void *arg0, f32 arg1) {
@@ -1996,6 +2119,14 @@ void func_8008ADD0(void *arg0, f32 arg1) {
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008ADD0.s")
#endif
UNUSED void func_8008AE8C(void) {
}
UNUSED void func_8008AE94(void) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_80165760;
@@ -2024,19 +2155,28 @@ void func_8008AE9C(s32 arg0) {
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008AE9C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8008ADD0(?, ? *, ?); // extern
? func_8008AE9C(s32); // extern
extern ? D_80183DC8;
void func_8008AFE0(s32 arg0, ? arg1) {
func_8008ADD0(arg1, &D_80183DC8, arg1);
extern s32 D_80183DC8;
void func_8008ADD0(s32, f32);
void func_8008AFE0(s32 arg0, f32 arg1) {
func_8008ADD0(&D_80183DC8, arg1);
func_8008AE9C(arg0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008AFE0.s")
#endif
UNUSED void func_8008B018(void) {
}
UNUSED void func_8008B020(void) {
}
UNUSED void func_8008B028(void) {
}
UNUSED void func_8008B030(void) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
@@ -2066,19 +2206,28 @@ void func_8008B038(s32 arg0) {
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B038.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8008ACE0(?, ? *, ?); // extern
? func_8008B038(s32); // extern
extern ? D_80183DA8;
void func_8008B17C(s32 arg0, ? arg1) {
func_8008ACE0(arg1, &D_80183DA8, arg1);
extern s32 D_80183DA8;
void func_8008ACE0(s32,f32);
void func_8008B17C(s32 arg0, f32 arg1) {
func_8008ACE0(&D_80183DA8, arg1);
func_8008B038(arg0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008B17C.s")
#endif
UNUSED void func_8008B1B4(void) {
}
UNUSED void func_8008B1BC(void) {
}
UNUSED void func_8008B1C4(void) {
}
UNUSED void func_8008B1CC(void) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
@@ -2454,6 +2603,38 @@ void func_8008BAB4(s32 arg0, s16 arg1, u16 arg2) {
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008BAB4.s")
#endif
/*
UNUSED void func_8008BB28(s32 arg0, s16 arg1, u16 arg2) {
*(&D_80165C30 + (arg0 * 0xE0)) = (f32) (arg1 + (s16) (random_int(arg2) - ((s32) arg2 / 2)));
}
UNUSED void func_8008BB9C(s32 arg0, s16 arg1, s16 arg2, u16 arg3, u16 arg4) {
s16 sp1E;
s32 temp_v0;
void *temp_v1;
sp1E = random_int(arg3) - ((s32) arg3 / 2);
temp_v0 = random_int(arg4);
temp_v1 = (arg0 * 0xE0) + &D_80165C18;
temp_v1->unk10 = (f32) (arg1 + sp1E);
temp_v1->unk14 = (f32) (arg2 + (s16) (temp_v0 - ((s32) arg4 / 2)));
}
UNUSED void func_8008BC58(s32 arg0, s16 arg1, s16 arg2, u16 arg3, u16 arg4) {
s16 sp1E;
s32 temp_v0;
void *temp_v1;
sp1E = random_int(arg3) - ((s32) arg3 / 2);
temp_v0 = random_int(arg4);
temp_v1 = (arg0 * 0xE0) + &D_80165C18;
temp_v1->unk10 = (f32) (arg1 + sp1E);
temp_v1->unk18 = (f32) (arg2 + (s16) (temp_v0 - ((s32) arg4 / 2)));
}
*/
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008BB28.s")
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern ? D_80165C18;
+12 -12
View File
@@ -11575,8 +11575,8 @@ extern ? D_800E7380;
extern ? D_800E7720;
extern ? D_800F0C7C;
extern f32 D_800F1F24;
extern s32 D_8015F8B8;
extern s32 D_8015F8C4;
extern s32 gNmiUnknown1;
extern s32 gNmiUnknown4;
extern s32 gGlobalTimer;
void func_800A69C8(s32 arg0) {
@@ -11610,13 +11610,13 @@ void func_800A69C8(s32 arg0) {
if (phi_s0 != gPlayerWinningIndex) {
phi_v1 = 1;
}
phi_s4 = D_8015F8C4 + phi_s0;
phi_s4 = gNmiUnknown4 + phi_s0;
}
} else {
if (gPlayerPositions[phi_s0] != 0) {
phi_v1 = 1;
}
phi_s4 = D_8015F8B8 + phi_s0;
phi_s4 = gNmiUnknown1 + phi_s0;
}
temp_s3 = *(&D_800E7720 + (phi_v1 * 4));
if (phi_v1 != 0) {
@@ -11645,8 +11645,8 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A69C8.s")
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800A6D94(s32, s32, s32); // extern
? func_800A6E94(s32, s32, s32); // extern
extern s32 D_8015F8BC;
extern s32 D_8015F8C8;
extern s32 gNmiUnknown2;
extern s32 gNmiUnknown5;
void func_800A6BEC(s32 arg0) {
s32 temp_s0;
@@ -11665,11 +11665,11 @@ void func_800A6BEC(s32 arg0) {
if (temp_v0 != BATTLE) {
} else {
func_800A6D94(3, phi_s0, D_8015F8C8);
func_800A6D94(3, phi_s0, gNmiUnknown5);
goto block_7;
}
} else {
func_800A6E94(3, phi_s0, D_8015F8BC);
func_800A6E94(3, phi_s0, gNmiUnknown2);
block_7:
phi_v1 = D_8018EDF3;
}
@@ -11686,8 +11686,8 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_800A6BEC.s")
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800A6D94(?, s32, s32); // extern
? func_800A6E94(?, s32, s32); // extern
extern s32 D_8015F8C0;
extern s32 D_8015F8CC;
extern s32 gNmiUnknown3;
extern s32 gNmiUnknown6;
void func_800A6CC0(s32 arg0) {
s32 temp_s0;
@@ -11706,11 +11706,11 @@ void func_800A6CC0(s32 arg0) {
if (temp_v0 != BATTLE) {
} else {
func_800A6D94(4, phi_s0, D_8015F8CC);
func_800A6D94(4, phi_s0, gNmiUnknown6);
goto block_7;
}
} else {
func_800A6E94(4, phi_s0, D_8015F8C0);
func_800A6E94(4, phi_s0, gNmiUnknown3);
block_7:
phi_v1 = D_8018EDF3;
}
+223 -192
View File
@@ -38,7 +38,7 @@ struct VblankHandler *gVblankHandler2 = NULL;
struct SPTask *gActiveSPTask = NULL;
struct SPTask *sCurrentAudioSPTask = NULL;
struct SPTask* sCurrentDisplaySPTask = NULL;
struct SPTask* D_800DC4B4 = NULL;
struct SPTask* sNextAudioSPTask = NULL;
struct SPTask* sNextDisplaySPTask = NULL;
@@ -72,15 +72,15 @@ struct GfxPool gGfxPools[2];
struct GfxPool *gGfxPool;
s32 gfxPool_padding; // is this necessary?
struct VblankHandler D_8014EF48;
struct VblankHandler gGameVblankHandler;
struct VblankHandler sSoundVblankHandler;
OSMesgQueue gDmaMesgQueue, D_8014EF70, D_8014EF88, unused_gMsgQueue, gIntrMesgQueue, D_8014EFD0;
OSMesgQueue gDmaMesgQueue, gGameVblankQueue, gGfxVblankQueue, unused_gMsgQueue, gIntrMesgQueue, gSPTaskMesgQueue;
OSMesgQueue sSoundMesgQueue;
OSMesg sSoundMesgBuf;
OSMesg D_8014F004, D_8014F008;
OSMesg D_8014F00C[1];
OSMesg sSoundMesgBuf[1];
OSMesg gDmaMesgBuf[1], gGameMesgBuf;
OSMesg gGfxMesgBuf[1];
UNUSED OSMesg D_8014F010, D_8014F014;
OSMesg D_8014F018[16], D_8014F058[16];
OSMesg gIntrMesgBuf[16], gSPTaskMesgBuf[16];
OSMesg gMainReceivedMesg;
OSIoMesg gDmaIoMesg;
OSMesgQueue gSIEventMesgQueue;
@@ -96,7 +96,7 @@ u16 gNumActors;
u16 D_80150112;
s32 D_80150114;
f32 D_80150118;
u16 D_8015011C;
u16 wasSoftReset;
u16 D_8015011E;
s32 D_80150120;
@@ -138,19 +138,19 @@ OSThread gVideoThread;
ALIGNED8 u8 gVideoThreadStack[0x2000];
OSThread D_80156820;
ALIGNED8 u8 D_8015680_Stack[0x2000];
OSThread D_801589D0;
ALIGNED8 u8 D_801589D0_Stack[0x2000];
OSThread D_8015AB80;
ALIGNED8 u8 D_8015AB80_Stack[0x2000];
OSThread gGameLoopThread;
ALIGNED8 u8 gGameLoopThreadStack[0x2000];
OSThread gAudioThread;
ALIGNED8 u8 gAudioThreadStack[0x2000];
OSThread D_8015CD30;
ALIGNED8 u8 D_8015CD30_Stack[0x1000];
u8 gGfxSPTaskYieldBuffer[4352];
u32 gGfxSPTaskStack[256];
OSMesg D_8015F3E0[32];
OSMesgQueue D_8015F460;
OSMesg gPIMesgBuf[32];
OSMesgQueue gPIMesgQueue;
s32 D_800DC50C = 0xffff;
s32 D_800DC50C = 0xFFFF;
u16 D_800DC510 = 0;
u16 D_800DC514 = 0;
u16 D_800DC518 = 0;
@@ -239,12 +239,14 @@ void create_thread(OSThread *thread, OSId id, void (*entry)(void *), void *arg,
void main_func(void) {
osInitialize();
//! Why is this using the gVideoThread as idle stack?
create_thread(&gIdleThread, 1, thread1_idle, NULL, &gVideoThread, 100);
create_thread(&gIdleThread, 1, &thread1_idle, NULL, gIdleThreadStack + ARRAY_COUNT(gIdleThreadStack), 100);
osStartThread(&gIdleThread);
}
void thread1_idle(void *arg0) {
/**
* Initialize hardware, start main thread, then idle.
*/
void thread1_idle(void *arg) {
osCreateViManager(OS_PRIORITY_VIMGR);
if (osTvType == TV_TYPE_NTSC) {
osViSetMode(&osViModeTable[OS_VI_NTSC_LAN1]);
@@ -253,25 +255,25 @@ void thread1_idle(void *arg0) {
}
osViBlack(TRUE);
osViSetSpecialFeatures(OS_VI_GAMMA_OFF);
osCreatePiManager(OS_PRIORITY_PIMGR, &D_8015F460, &D_8015F3E0, 0x20);
D_8015011C = (s16) osResetType;
osCreatePiManager(OS_PRIORITY_PIMGR, &gPIMesgQueue, gPIMesgBuf, ARRAY_COUNT(gPIMesgBuf));
wasSoftReset = (s16) osResetType;
create_debug_thread();
start_debug_thread();
create_thread(&gVideoThread, 3, &thread3_video, arg0, &D_80156820, 100);
create_thread(&gVideoThread, 3, &thread3_video, arg, gVideoThreadStack + ARRAY_COUNT(gVideoThreadStack), 100);
osStartThread(&gVideoThread);
osSetThreadPri(NULL, 0);
// halt
while (1);
while (TRUE);
}
void setup_mesg_queues(void) {
osCreateMesgQueue(&gDmaMesgQueue, &D_8014F004, 1);
osCreateMesgQueue(&D_8014EFD0, &D_8014F058, 0x10);
osCreateMesgQueue(&gIntrMesgQueue, &D_8014F018, 0x10);
osViSetEvent(&gIntrMesgQueue, (OSMesg) 0x66, 1);
osSetEventMesg(4, &gIntrMesgQueue, (OSMesg) 0x64);
osSetEventMesg(9, &gIntrMesgQueue, (OSMesg) 0x65);
osCreateMesgQueue(&gDmaMesgQueue, gDmaMesgBuf, ARRAY_COUNT(gDmaMesgBuf));
osCreateMesgQueue(&gSPTaskMesgQueue, gSPTaskMesgBuf, ARRAY_COUNT(gSPTaskMesgBuf));
osCreateMesgQueue(&gIntrMesgQueue, gIntrMesgBuf, ARRAY_COUNT(gIntrMesgBuf));
osViSetEvent(&gIntrMesgQueue, (OSMesg) MESG_VI_VBLANK, 1);
osSetEventMesg(OS_EVENT_SP, &gIntrMesgQueue, (OSMesg) MESG_SP_COMPLETE);
osSetEventMesg(OS_EVENT_DP, &gIntrMesgQueue, (OSMesg) MESG_DP_COMPLETE);
}
void start_sptask(s32 taskType) {
@@ -285,10 +287,12 @@ void start_sptask(s32 taskType) {
gActiveSPTask->state = SPTASK_STATE_RUNNING;
}
// Most similar to create_task_structure from SM64, with additional provisions
// to load both F3DEX and F3DLX, depending on the number of players
void func_800006E8(void) {
gGfxSPTask->msgqueue = &D_8014EF88;
/**
* Initializes the Fast3D OSTask structure.
* Loads F3DEX or F3DLX based on the number of players
**/
void create_gfx_task_structure(void) {
gGfxSPTask->msgqueue = &gGfxVblankQueue;
gGfxSPTask->msg = (OSMesg) 2;
gGfxSPTask->task.t.type = M_GFXTASK;
gGfxSPTask->task.t.flags = (1 << 1);
@@ -321,58 +325,58 @@ void init_controllers(void) {
osSetEventMesg(OS_EVENT_SI, &gSIEventMesgQueue, (OSMesg) 0x33333333);
osContInit(&gSIEventMesgQueue, &gControllerBits, &gControllerStatuses);
if ((gControllerBits & 1) == 0) {
sController1Unplugged = TRUE;
return;
sIsController1Unplugged = TRUE;
} else {
sIsController1Unplugged = FALSE;
}
sController1Unplugged = FALSE;
}
void func_80000934(s32 arg0) {
struct Controller *controller = &gControllers[arg0];
u16 phi_a0;
void update_controller(s32 index) {
struct Controller *controller = &gControllers[index];
u16 stick;
if (sController1Unplugged != 0) {
if (sIsController1Unplugged) {
return;
}
controller->rawStickX = gControllerPads[arg0].stick_x;
controller->rawStickY = gControllerPads[arg0].stick_y;
controller->rawStickX = gControllerPads[index].stick_x;
controller->rawStickY = gControllerPads[index].stick_y;
if ((gControllerPads[arg0].button & 4) != 0) {
gControllerPads[arg0].button |= Z_TRIG;
if ((gControllerPads[index].button & 4) != 0) {
gControllerPads[index].button |= Z_TRIG;
}
controller->buttonPressed = gControllerPads[arg0].button & (gControllerPads[arg0].button ^ controller->button);
controller->buttonDepressed = controller->button & (gControllerPads[arg0].button ^ controller->button);
controller->button = gControllerPads[arg0].button;
controller->buttonPressed = gControllerPads[index].button & (gControllerPads[index].button ^ controller->button);
controller->buttonDepressed = controller->button & (gControllerPads[index].button ^ controller->button);
controller->button = gControllerPads[index].button;
phi_a0 = 0;
stick = 0;
if (controller->rawStickX < -50) {
phi_a0 |= L_JPAD;
stick |= L_JPAD;
}
if (controller->rawStickX > 50) {
phi_a0 |= R_JPAD;
stick |= R_JPAD;
}
if (controller->rawStickY < -50) {
phi_a0 |= D_JPAD;
stick |= D_JPAD;
}
if (controller->rawStickY > 50) {
phi_a0 |= U_JPAD;
stick |= U_JPAD;
}
controller->stickPressed = phi_a0 & (phi_a0 ^ controller->stickDirection);
controller->stickDepressed = controller->stickDirection & (phi_a0 ^ controller->stickDirection);
controller->stickDirection = phi_a0;
controller->stickPressed = stick & (stick ^ controller->stickDirection);
controller->stickDepressed = controller->stickDirection & (stick ^ controller->stickDirection);
controller->stickDirection = stick;
}
void read_controllers(void) {
OSMesg sp1C;
OSMesg msg;
osContStartReadData(&gSIEventMesgQueue);
osRecvMesg(&gSIEventMesgQueue, &sp1C, 1);
osRecvMesg(&gSIEventMesgQueue, &msg, OS_MESG_BLOCK);
osContGetReadData(&gControllerPads);
func_80000934(0);
func_80000934(1);
func_80000934(2);
func_80000934(3);
update_controller(0);
update_controller(1);
update_controller(2);
update_controller(3);
gControllerFive->button = (s16) (((gControllerOne->button | gControllerTwo->button) | gControllerThree->button) | gControllerFour->button);
gControllerFive->buttonPressed = (s16) (((gControllerOne->buttonPressed | gControllerTwo->buttonPressed) | gControllerThree->buttonPressed) | gControllerFour->buttonPressed);
gControllerFive->buttonDepressed = (s16) (((gControllerOne->buttonDepressed | gControllerTwo->buttonDepressed) | gControllerThree->buttonDepressed) | gControllerFour->buttonDepressed);
@@ -385,14 +389,12 @@ void func_80000BEC(void) {
D_801502B4 = VIRTUAL_TO_PHYSICAL(&gZBuffer);
}
// send_sp_task_message from SM64
void func_80000C0C(OSMesg arg0) {
void dispatch_audio_sptask(struct SPTask *spTask) {
osWritebackDCacheAll();
osSendMesg(&D_8014EFD0, arg0, OS_MESG_NOBLOCK);
osSendMesg(&gSPTaskMesgQueue, spTask, OS_MESG_NOBLOCK);
}
// similar to send_display_list from SM64
void send_display_list(struct SPTask *spTask) {
void exec_display_list(struct SPTask *spTask) {
osWritebackDCacheAll();
spTask->state = SPTASK_STATE_NOT_STARTED;
if (sCurrentDisplaySPTask == NULL) {
@@ -413,12 +415,13 @@ void func_80000CA8(void) {
func_802A3CB0();
}
// Similar to end_master_display_list in SM64
void func_80000CE8(void) {
/**
* End the master display list and initialize the graphics task structure for the next frame to be rendered.
*/
void end_master_display_list(void) {
gDPFullSync(gDisplayListHead++);
gSPEndDisplayList(gDisplayListHead++);
func_800006E8();
create_gfx_task_structure();
}
// clear_frame_buffer from SM64, with a few edits
@@ -445,8 +448,8 @@ void rendering_init(void) {
gDisplayListHead = gGfxPool->gfxPool;
func_80000CA8();
clear_framebuffer(0);
func_80000CE8();
send_display_list(&gGfxPool->spTask);
end_master_display_list();
exec_display_list(&gGfxPool->spTask);
sRenderingFramebuffer++;
gGlobalTimer++;
}
@@ -458,15 +461,21 @@ void config_gfx_pool(void) {
gGfxSPTask = &gGfxPool->spTask;
}
/**
* Send current master display list for rendering.
* Tell the VI which colour framebuffer to display.
* Yields to the VI framerate twice, locking the game at 30 FPS.
* Selects the next framebuffer to be rendered and displayed.
*/
void display_and_vsync(void) {
profiler_log_thread5_time(2);
osRecvMesg(&D_8014EF88, &gMainReceivedMesg, 1);
send_display_list(&gGfxPool->spTask);
profiler_log_thread5_time(3);
osRecvMesg(&D_8014EF70, &gMainReceivedMesg, 1);
profiler_log_thread5_time(BEFORE_DISPLAY_LISTS);
osRecvMesg(&gGfxVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
exec_display_list(&gGfxPool->spTask);
profiler_log_thread5_time(AFTER_DISPLAY_LISTS);
osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
osViSwapBuffer((void *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[sRenderedFramebuffer]));
profiler_log_thread5_time(4);
osRecvMesg(&D_8014EF70, &gMainReceivedMesg, 1);
profiler_log_thread5_time(THREAD5_END);
osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
crash_screen_set_framebuffer(gPhysicalFramebuffers[sRenderedFramebuffer]);
if (++sRenderedFramebuffer == 3) {
sRenderedFramebuffer = 0;
@@ -477,7 +486,7 @@ void display_and_vsync(void) {
gGlobalTimer++;
}
void func_8000105C(void) {
void init_seg_80280000(void) {
bzero(SEG_80280000, 0xDF00);
osWritebackDCacheAll();
dma_copy(SEG_80280000, &_code_80280000SegmentRomStart, ALIGN16((u32)&_code_80280000SegmentRomEnd - (u32)&_code_80280000SegmentRomStart));
@@ -485,7 +494,7 @@ void func_8000105C(void) {
osInvalDCache(SEG_80280000, 0xDF00);
}
void func_800010CC(void) {
void init_seg_8028DF00(void) {
bzero(SEG_8028DF00, 0x2C470);
osWritebackDCacheAll();
dma_copy(SEG_8028DF00, &_code_8028DF00SegmentRomStart, ALIGN16((u32)&_code_8028DF00SegmentRomEnd - (u32)&_code_8028DF00SegmentRomStart));
@@ -518,20 +527,20 @@ void init_game(void) {
s32 sp38;
UNUSED s32 unknown_padding;
func_800010CC();
init_seg_8028DF00();
gHeapEndPtr = SEG_8028DF00;
set_segment_base_addr(0, 0x80000000);
func_802A7CF0(&D_801978D0, 0x80242F00);
func_80000BEC();
osInvalDCache(SEG_802BA370, 0x5810);
osPiStartDma(&gDmaIoMesg, 0, 0, &_data_802BA370SegmentRomStart, SEG_802BA370, 0x5810, &gDmaMesgQueue);
osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1);
osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
set_segment_base_addr(2, func_802A7D70(&_data_segment2SegmentRomStart, &_data_segment2SegmentRomEnd));
sp2C = (u32)&_common_texturesSegmentRomEnd - (u32)&_common_texturesSegmentRomStart;
sp2C = ALIGN16(sp2C);
texture_seg = SEG_8028DF00-sp2C;
osPiStartDma(&gDmaIoMesg, 0, 0, &_common_texturesSegmentRomStart, texture_seg, sp2C, &gDmaMesgQueue);
osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, 1);
osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
sp40 = *(u32 *)(texture_seg + 4);
sp40 = ALIGN16(sp40);
@@ -597,7 +606,7 @@ void func_8000142C(void) {
}
func_8005A070();
sNumVBlanks = 0;
profiler_log_thread5_time(1);
profiler_log_thread5_time(LEVEL_SCRIPT_EXECUTE);
D_8015F788 = 0;
func_802A59A4();
if (gEnableDebugMode == 0) {
@@ -662,7 +671,7 @@ void func_8000142C(void) {
func_80022744();
}
func_8005A070();
profiler_log_thread5_time(1);
profiler_log_thread5_time(LEVEL_SCRIPT_EXECUTE);
sNumVBlanks = 0;
move_segment_table_to_dmem();
func_802A3E3C();
@@ -707,7 +716,7 @@ void func_8000142C(void) {
}
func_80022744();
}
profiler_log_thread5_time(1);
profiler_log_thread5_time(LEVEL_SCRIPT_EXECUTE);
sNumVBlanks = (u16)0;
func_8005A070();
move_segment_table_to_dmem();
@@ -780,7 +789,7 @@ void func_8000142C(void) {
}
func_8005A070();
sNumVBlanks = 0;
profiler_log_thread5_time(1);
profiler_log_thread5_time(LEVEL_SCRIPT_EXECUTE);
move_segment_table_to_dmem();
func_802A3E3C();
if (D_800DC5B0 != 0) {
@@ -870,42 +879,41 @@ void interrupt_gfx_sptask(void) {
}
}
void func_80001FAC(void) {
void receive_new_tasks(void) {
s32 pad;
struct SPTask *sp40;
struct SPTask *spTask;
while(osRecvMesg(&D_8014EFD0, &sp40, 0) != -1) {
sp40->state = 0;
switch(sp40->task.t.type) {
while(osRecvMesg(&gSPTaskMesgQueue, (OSMesg *) &spTask, OS_MESG_NOBLOCK) != -1) {
spTask->state = SPTASK_STATE_NOT_STARTED;
switch(spTask->task.t.type) {
case 2:
D_800DC4B4 = sp40;
sNextAudioSPTask = spTask;
break;
case 1:
sNextDisplaySPTask = sp40;
sNextDisplaySPTask = spTask;
break;
}
}
if (sCurrentAudioSPTask == 0 && D_800DC4B4 != 0) {
sCurrentAudioSPTask = D_800DC4B4;
D_800DC4B4 = 0;
if (sCurrentAudioSPTask == NULL && sNextAudioSPTask != NULL) {
sCurrentAudioSPTask = sNextAudioSPTask;
sNextAudioSPTask = NULL;
}
if (sCurrentDisplaySPTask == 0 && sNextDisplaySPTask != 0) {
if (sCurrentDisplaySPTask == NULL && sNextDisplaySPTask != NULL) {
sCurrentDisplaySPTask = sNextDisplaySPTask;
sNextDisplaySPTask = 0;
sNextDisplaySPTask = NULL;
}
}
// likely set_vblank_handler from SM64
void func_800020D8(s32 arg0, struct VblankHandler *arg1, OSMesgQueue *arg2, OSMesg *arg3) {
arg1->queue = arg2;
arg1->msg = arg3;
switch (arg0) {
void set_vblank_handler(s32 index, struct VblankHandler *handler, OSMesgQueue *queue, OSMesg *msg) {
handler->queue = queue;
handler->msg = msg;
switch (index) {
case 1:
gVblankHandler1 = arg1;
gVblankHandler1 = handler;
break;
case 2:
gVblankHandler2 = arg1;
gVblankHandler2 = handler;
break;
}
}
@@ -918,13 +926,17 @@ void start_gfx_sptask(void) {
}
}
// Similar to handle_vblank from SM64
void func_80002168(void) {
void handle_vblank(void) {
D_800DC594 += 0.01666666;
sNumVBlanks++;
func_80001FAC();
receive_new_tasks();
// First try to kick off an audio task. If the gfx task is currently
// running, we need to asynchronously interrupt it -- handle_sp_complete
// will pick up on what we're doing and start the audio task for us.
// If there is already an audio task running, there is nothing to do.
// If there is no audio task available, try a gfx task instead.
if (sCurrentAudioSPTask != NULL) {
if (gActiveSPTask != NULL) {
interrupt_gfx_sptask();
@@ -934,22 +946,28 @@ void func_80002168(void) {
}
} else {
if (gActiveSPTask == NULL && sCurrentDisplaySPTask != NULL
&& sCurrentDisplaySPTask->state != 3) {
profiler_log_gfx_time(0);
start_sptask(M_GFXTASK);
}
}
&& sCurrentDisplaySPTask->state != SPTASK_STATE_FINISHED) {
profiler_log_gfx_time(TASKS_QUEUED);
start_sptask(M_GFXTASK);
}
}
/* This is where I would put my rumble code... If I had any. */
#if ENABLE_RUMBLE
rumble_thread_update_vi();
#endif
if (gVblankHandler1 != NULL) {
osSendMesg(gVblankHandler1->queue, gVblankHandler1->msg, 0);
osSendMesg(gVblankHandler1->queue, gVblankHandler1->msg, OS_MESG_NOBLOCK);
}
if (gVblankHandler2 != NULL) {
osSendMesg(gVblankHandler2->queue, gVblankHandler2->msg, 0);
osSendMesg(gVblankHandler2->queue, gVblankHandler2->msg, OS_MESG_NOBLOCK);
}
}
// likely handle_dp_complete from SM64
void func_80002284(void) {
if (sCurrentDisplaySPTask->msgqueue != 0) {
void handle_dp_complete(void) {
// Gfx SP task is completely done.
if (sCurrentDisplaySPTask->msgqueue != NULL) {
osSendMesg(sCurrentDisplaySPTask->msgqueue, sCurrentDisplaySPTask->msg, OS_MESG_NOBLOCK);
}
profiler_log_gfx_time(RDP_COMPLETE);
@@ -957,76 +975,83 @@ void func_80002284(void) {
sCurrentDisplaySPTask = NULL;
}
void *func_800022DC(void) {
struct SPTask *temp_a3 = gActiveSPTask;
void handle_sp_complete(void) {
struct SPTask *curSPTask = gActiveSPTask;
gActiveSPTask = NULL;
if (temp_a3->state == 2) {
if (osSpTaskYielded(temp_a3) == 0) {
temp_a3->state = 3;
profiler_log_gfx_time(1);
if (curSPTask->state == SPTASK_STATE_INTERRUPTED) {
// handle_vblank tried to start an audio task while there was already a
// gfx task running, so it had to interrupt the gfx task. That interruption
// just finished.
if (osSpTaskYielded(curSPTask) == 0) {
// The gfx task completed before we had time to interrupt it.
// Mark it finished, just like below.
curSPTask->state = SPTASK_STATE_FINISHED;
profiler_log_gfx_time(RSP_COMPLETE);
}
// Start the audio task, as expected by handle_vblank.
profiler_log_vblank_time();
start_sptask(2);
start_sptask(M_AUDTASK);
} else {
temp_a3->state = 3;
if (temp_a3->task.t.type == 2) {
curSPTask->state = SPTASK_STATE_FINISHED;
if (curSPTask->task.t.type == M_AUDTASK) {
// After audio tasks come gfx tasks.
profiler_log_vblank_time();
if (sCurrentDisplaySPTask != 0) {
if (sCurrentDisplaySPTask->state != 3) {
if (sCurrentDisplaySPTask->state != 2) {
profiler_log_gfx_time(0);
if (sCurrentDisplaySPTask != NULL) {
if (sCurrentDisplaySPTask->state != SPTASK_STATE_FINISHED) {
if (sCurrentDisplaySPTask->state != SPTASK_STATE_INTERRUPTED) {
profiler_log_gfx_time(TASKS_QUEUED);
}
start_sptask(1);
start_sptask(M_GFXTASK);
}
}
sCurrentAudioSPTask = 0;
if (temp_a3->msgqueue != 0) {
osSendMesg(temp_a3->msgqueue, temp_a3->msg, 0);
sCurrentAudioSPTask = NULL;
if (curSPTask->msgqueue != NULL) {
osSendMesg(curSPTask->msgqueue, curSPTask->msg, OS_MESG_NOBLOCK);
}
} else {
profiler_log_gfx_time(1);
// The SP process is done, but there is still a Display Processor notification
// that needs to arrive before we can consider the task completely finished and
// null out sCurrentDisplaySPTask. That happens in handle_dp_complete.
profiler_log_gfx_time(RSP_COMPLETE);
}
};
}
void thread3_video(UNUSED void *arg0) {
s32 pad[2];
OSMesg msg;
u64 *temp_v0;
s32 i;
s32 pad2[2];
u64 *framebuffer1;
OSMesg msg;
s32 pad[4];
gPhysicalFramebuffers[0] = (uintptr_t *) &gFramebuffer0;
gPhysicalFramebuffers[1] = (uintptr_t *) &gFramebuffer1;
gPhysicalFramebuffers[2] = (uintptr_t *) &gFramebuffer2;
temp_v0 = &gFramebuffer1;
framebuffer1 = &gFramebuffer1;
for (i = 0; i < 19200; i++) {
temp_v0[i] = 0;
framebuffer1[i] = 0;
}
setup_mesg_queues();
init_game();
create_thread(&D_8015AB80, 4, &thread4_audio, 0, &D_8015AB80_Stack[8192], 0x14);
osStartThread(&D_8015AB80);
create_thread(&D_801589D0, 5, &thread5_game_logic, 0, &D_801589D0_Stack[8192], 0xA);
osStartThread(&D_801589D0);
create_thread(&gAudioThread, 4, &thread4_audio, 0, gAudioThreadStack + ARRAY_COUNT(gAudioThreadStack), 20);
osStartThread(&gAudioThread);
create_thread(&gGameLoopThread, 5, &thread5_game_loop, 0, gGameLoopThreadStack + ARRAY_COUNT(gGameLoopThreadStack), 10);
osStartThread(&gGameLoopThread);
while (1) {
while (TRUE) {
osRecvMesg(&gIntrMesgQueue, &msg, OS_MESG_BLOCK);
switch ((u32) msg) {
case MESG_VI_VBLANK:
func_80002168();
handle_vblank();
break;
case MESG_SP_COMPLETE:
func_800022DC();
handle_sp_complete();
break;
case MESG_DP_COMPLETE:
func_80002284();
handle_dp_complete();
break;
case MESG_START_GFX_SPTASK:
start_gfx_sptask();
@@ -1061,88 +1086,94 @@ void func_80002658(void) {
void func_80002684(void) {
switch (D_800DC50C) {
case 0:
case START_MENU_FROM_QUIT:
func_80002658();
gCurrentlyLoadedCourseId = 255;
gCurrentlyLoadedCourseId = COURSE_NULL;
break;
case 1:
case MAIN_MENU_FROM_QUIT:
func_800025D4();
gCurrentlyLoadedCourseId = 255;
gCurrentlyLoadedCourseId = COURSE_NULL;
break;
case 2:
case PLAYER_SELECT_MENU_FROM_QUIT:
func_80002600();
gCurrentlyLoadedCourseId = 255;
gCurrentlyLoadedCourseId = COURSE_NULL;
break;
case 3:
case COURSE_SELECT_MENU_FROM_QUIT:
func_8000262C();
gCurrentlyLoadedCourseId = 255;
gCurrentlyLoadedCourseId = COURSE_NULL;
break;
case 4:
func_800010CC();
case RACING:
init_seg_8028DF00();
func_80002A18();
break;
case 5:
gCurrentlyLoadedCourseId = 255;
func_8000105C();
case ENDING_SEQUENCE:
gCurrentlyLoadedCourseId = COURSE_NULL;
init_seg_80280000();
load_ending_sequence_royalraceway();
break;
case 9:
gCurrentlyLoadedCourseId = 255;
func_800010CC();
func_8000105C();
case CREDITS_SEQUENCE:
gCurrentlyLoadedCourseId = COURSE_NULL;
init_seg_8028DF00();
init_seg_80280000();
func_80280420();
break;
}
}
//extern u8 _networkSegmentRomStart;
void thread5_game_logic(s32 arg0) {
osCreateMesgQueue(&D_8014EF88, &D_8014F00C, 1);
osCreateMesgQueue(&D_8014EF70, &D_8014F008, 1);
void thread5_game_loop(UNUSED void *arg) {
osCreateMesgQueue(&gGfxVblankQueue, &gGfxMesgBuf, 1);
osCreateMesgQueue(&gGameVblankQueue, &gGameMesgBuf, 1);
init_controllers();
if (D_8015011C == 0) {
func_80003010();
if (!wasSoftReset) {
clear_nmi_buffer();
}
func_800020D8(2, &D_8014EF48, &D_8014EF70, (OSMesg) 1);
D_8015F8B8 = (s32) D_800DC600;
D_8015F8BC = (s32) (D_800DC600 + 2);
D_8015F8C0 = (s32) (D_800DC600 + 0xB);
D_8015F8C4 = (s32) (D_800DC600 + 0x17);
D_8015F8C8 = (s32) (D_800DC600 + 0x19);
D_8015F8CC = (s32) (D_800DC600 + 0x1C);
set_vblank_handler(2, &gGameVblankHandler, &gGameVblankQueue, (OSMesg) OS_EVENT_SW2);
// Potentially unused?
gNmiUnknown1 = (s32) pAppNmiBuffer;
gNmiUnknown2 = (s32) pAppNmiBuffer + 2;
gNmiUnknown3 = (s32) pAppNmiBuffer + 11;
gNmiUnknown4 = (s32) pAppNmiBuffer + 23;
gNmiUnknown5 = (s32) pAppNmiBuffer + 25;
gNmiUnknown6 = (s32) pAppNmiBuffer + 28;
rendering_init();
read_controllers();
func_800C5CB8();
while(1) {
while(TRUE) {
func_800CB2C4();
if (D_800DC524 != D_800DC50C) {
D_800DC50C = (s32) D_800DC524;
func_80002684();
}
profiler_log_thread5_time(0);
profiler_log_thread5_time(THREAD5_START);
config_gfx_pool();
read_controllers();
func_80001ECC();
func_80000CE8();
end_master_display_list();
display_and_vsync();
}
}
void thread4_audio(UNUSED s32 arg0) {
/**
* Sound processing thread. Runs at 50 or 60 FPS according to osTvType.
*/
void thread4_audio(UNUSED void *arg) {
UNUSED u32 unused[3];
audio_init();
osCreateMesgQueue(&sSoundMesgQueue, &sSoundMesgBuf, 1);
func_800020D8(1, &sSoundVblankHandler, &sSoundMesgQueue, (OSMesg) 0x200);
osCreateMesgQueue(&sSoundMesgQueue, &sSoundMesgBuf, ARRAY_COUNT(sSoundMesgBuf));
set_vblank_handler(1, &sSoundVblankHandler, &sSoundMesgQueue, (OSMesg) 512);
while (TRUE) {
OSMesg msg;
struct SPTask *spTask;
osRecvMesg(&sSoundMesgQueue, &msg, 1);
osRecvMesg(&sSoundMesgQueue, &msg, OS_MESG_BLOCK);
profiler_log_thread4_time();
spTask = create_next_audio_frame_task();
if (spTask != NULL) {
func_80000C0C(spTask);
dispatch_audio_sptask(spTask);
}
profiler_log_thread4_time();
}
+17 -17
View File
@@ -23,39 +23,39 @@ void main_func();
void thread1_idle(void*);
void setup_mesg_queues();
void start_sptask(s32);
void func_800006E8();
void create_gfx_task_structure();
void init_controllers();
void func_80000934(s32);
void update_controller(s32);
void read_controllers();
void func_80000BEC();
void func_80000C0C(OSMesg);
void send_display_list(struct SPTask*);
void dispatch_audio_sptask(struct SPTask*);
void exec_display_list(struct SPTask*);
void func_80000CA8();
void func_80000CE8();
void end_master_display_list();
void *clear_framebuffer(s32);
void rendering_init();
void config_gfx_pool();
void display_and_vsync();
void func_8000105C();
void func_800010CC();
void init_seg_80280000();
void init_seg_8028DF00();
void dma_copy(u8*, u8*, u32);
void init_game();
void func_80001ECC();
void interrupt_gfx_sptask();
void func_80001FAC();
void func_800020D8(s32, struct VblankHandler*, OSMesgQueue*, OSMesg*);
void receive_new_tasks();
void set_vblank_handler(s32, struct VblankHandler*, OSMesgQueue*, OSMesg*);
void start_gfx_sptask();
void func_80002168();
void func_80002284();
void *func_800022DC();
void handle_vblank();
void handle_dp_complete();
void handle_sp_complete();
void thread3_video(void*);
void func_800025D4();
void func_80002600();
void func_8000262C();
void func_80002658();
void func_80002684();
void thread5_game_logic(s32);
void thread4_audio(s32);
void thread5_game_loop(void*);
void thread4_audio(void*);
extern struct GfxPool *gGfxPool;
extern Gfx *gDisplayListHead;
@@ -67,10 +67,10 @@ extern OSMesgQueue gDmaMesgQueue;
extern s32 D_800DC524;
extern s32 gActiveScreenMode;
extern f32 D_800DC594;
extern s32 D_800DC600;
extern s32 D_8015F8B8, D_8015F8BC, D_8015F8C0, D_8015F8C4, D_8015F8C8, D_8015F8CC;
extern uintptr_t pAppNmiBuffer;
extern s32 gNmiUnknown1, gNmiUnknown2, gNmiUnknown3, gNmiUnknown4, gNmiUnknown5, gNmiUnknown6;
extern s32 gScreenModeSelection;
extern s16 sController1Unplugged;
extern s16 sIsController1Unplugged;
#endif
+21 -21
View File
@@ -27,12 +27,12 @@ extern struct UnkStruct_800DC5EC *D_800DC5F0;
extern struct UnkStruct_800DC5EC *D_800DC5F4;
extern struct UnkStruct_800DC5EC *D_800DC5F8;
extern u8 *D_8015F8BC;
extern u8 *D_8015F8B8;
extern u8 *D_8015F8C0;
extern u8 *D_8015F8C4;
extern u8 *D_8015F8C8;
extern u8 *D_8015F8CC;
extern u8 *gNmiUnknown2;
extern u8 *gNmiUnknown1;
extern u8 *gNmiUnknown3;
extern u8 *gNmiUnknown4;
extern u8 *gNmiUnknown5;
extern u8 *gNmiUnknown6;
extern s16 gPlayerBalloonCount[];
extern s16 D_8016348C;
@@ -149,13 +149,13 @@ void func_8028E028(void) {
switch(gPlayerCountSelection1) {
case 2:
*(D_8015F8C4 + gPlayerWinningIndex) += 1;
*(gNmiUnknown4 + gPlayerWinningIndex) += 1;
break;
case 3:
*(D_8015F8C8 + gPlayerWinningIndex) += 1;
*(gNmiUnknown5 + gPlayerWinningIndex) += 1;
break;
case 4:
*(D_8015F8CC + gPlayerWinningIndex) += 1;
*(gNmiUnknown6 + gPlayerWinningIndex) += 1;
break;
}
func_800CA118((u8) gPlayerWinningIndex);
@@ -648,10 +648,10 @@ void func_8028EF28(void) {
switch(gPlayerCountSelection1) {
case 2:
if (currentPosition == 0) {
*(D_8015F8B8 + i) += 1;
*(gNmiUnknown1 + i) += 1;
}
if (*(D_8015F8B8 + i) > 99) {
*(D_8015F8B8 + i) = 99;
if (*(gNmiUnknown1 + i) > 99) {
*(gNmiUnknown1 + i) = 99;
}
D_800DC510 = 5;
i = D_8015F8F2[0];
@@ -661,17 +661,17 @@ void func_8028EF28(void) {
break;
case 3:
if (currentPosition < 3) {
*(D_8015F8BC + i * 3 + currentPosition) += 1;
*(gNmiUnknown2 + i * 3 + currentPosition) += 1;
}
if (*(D_8015F8BC + i * 3 + currentPosition) > 99) {
*(D_8015F8BC + i * 3 + currentPosition) = 99;
if (*(gNmiUnknown2 + i * 3 + currentPosition) > 99) {
*(gNmiUnknown2 + i * 3 + currentPosition) = 99;
}
if (currentPosition == 1) {
D_800DC510 = 5;
i = D_8015F8F2[1];
*(D_8015F8BC + i * 3 + 2) += 1;
if (*(D_8015F8BC + i * 3 + 2) > 99) {
*(D_8015F8BC + i * 3 + 2) = 99;
*(gNmiUnknown2 + i * 3 + 2) += 1;
if (*(gNmiUnknown2 + i * 3 + 2) > 99) {
*(gNmiUnknown2 + i * 3 + 2) = 99;
}
gPlayers[i].unk_00C |= 0x200000;
gPlayers[i].unk_000 |= PLAYER_CPU;
@@ -680,10 +680,10 @@ void func_8028EF28(void) {
break;
case 4:
if (currentPosition < 3) {
*(D_8015F8C0 + i * 3 + currentPosition) += 1;
*(gNmiUnknown3 + i * 3 + currentPosition) += 1;
}
if (*(D_8015F8C0 + i * 3 + currentPosition) > 99) {
*(D_8015F8C0 + i * 3 + currentPosition) = 99;
if (*(gNmiUnknown3 + i * 3 + currentPosition) > 99) {
*(gNmiUnknown3 + i * 3 + currentPosition) = 99;
}
if (currentPosition == 2) {
D_800DC510 = 5;