Couple small matches and m2c refreshing (#282)

* Moved stuff into header files to
 make m2c_helper a more useful

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
Tyler McGavran
2022-12-25 20:56:35 -05:00
committed by GitHub
parent e1976267f3
commit 3e3561bbf1
15 changed files with 1519 additions and 3226 deletions
@@ -1,68 +0,0 @@
glabel func_800A90D4
/* 0A9CD4 800A90D4 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 0A9CD8 800A90D8 AFBF002C */ sw $ra, 0x2c($sp)
/* 0A9CDC 800A90DC AFA40030 */ sw $a0, 0x30($sp)
/* 0A9CE0 800A90E0 AFA50034 */ sw $a1, 0x34($sp)
/* 0A9CE4 800A90E4 8CAD001C */ lw $t5, 0x1c($a1)
/* 0A9CE8 800A90E8 3C038015 */ lui $v1, %hi(gDisplayListHead) # $v1, 0x8015
/* 0A9CEC 800A90EC 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298
/* 0A9CF0 800A90F0 29A10020 */ slti $at, $t5, 0x20
/* 0A9CF4 800A90F4 10200034 */ beqz $at, .L800A91C8
/* 0A9CF8 800A90F8 000D4180 */ sll $t0, $t5, 6
/* 0A9CFC 800A90FC 8FB80034 */ lw $t8, 0x34($sp)
/* 0A9D00 800A9100 8C620000 */ lw $v0, ($v1)
/* 0A9D04 800A9104 010D4021 */ addu $t0, $t0, $t5
/* 0A9D08 800A9108 8F09000C */ lw $t1, 0xc($t8)
/* 0A9D0C 800A910C 8F060010 */ lw $a2, 0x10($t8)
/* 0A9D10 800A9110 24590008 */ addiu $t9, $v0, 8
/* 0A9D14 800A9114 AC790000 */ sw $t9, ($v1)
/* 0A9D18 800A9118 3C0EE700 */ lui $t6, 0xe700
/* 0A9D1C 800A911C AC4E0000 */ sw $t6, ($v0)
/* 0A9D20 800A9120 AC400004 */ sw $zero, 4($v0)
/* 0A9D24 800A9124 8C620000 */ lw $v0, ($v1)
/* 0A9D28 800A9128 05010003 */ bgez $t0, .L800A9138
/* 0A9D2C 800A912C 00087983 */ sra $t7, $t0, 6
/* 0A9D30 800A9130 2501003F */ addiu $at, $t0, 0x3f
/* 0A9D34 800A9134 00017983 */ sra $t7, $at, 6
.L800A9138:
/* 0A9D38 800A9138 01E04025 */ move $t0, $t7
/* 0A9D3C 800A913C 244F0008 */ addiu $t7, $v0, 8
/* 0A9D40 800A9140 AC6F0000 */ sw $t7, ($v1)
/* 0A9D44 800A9144 3C190F0A */ lui $t9, (0x0F0A4000 >> 16) # lui $t9, 0xf0a
/* 0A9D48 800A9148 3C18B900 */ lui $t8, (0xB900031D >> 16) # lui $t8, 0xb900
/* 0A9D4C 800A914C 3718031D */ ori $t8, (0xB900031D & 0xFFFF) # ori $t8, $t8, 0x31d
/* 0A9D50 800A9150 37394000 */ ori $t9, (0x0F0A4000 & 0xFFFF) # ori $t9, $t9, 0x4000
/* 0A9D54 800A9154 AC590004 */ sw $t9, 4($v0)
/* 0A9D58 800A9158 AC580000 */ sw $t8, ($v0)
/* 0A9D5C 800A915C 8C620000 */ lw $v0, ($v1)
/* 0A9D60 800A9160 3C18FFFC */ lui $t8, (0xFFFCF279 >> 16) # lui $t8, 0xfffc
/* 0A9D64 800A9164 3C0FFCFF */ lui $t7, (0xFCFFFFFF >> 16) # lui $t7, 0xfcff
/* 0A9D68 800A9168 244E0008 */ addiu $t6, $v0, 8
/* 0A9D6C 800A916C AC6E0000 */ sw $t6, ($v1)
/* 0A9D70 800A9170 35EFFFFF */ ori $t7, (0xFCFFFFFF & 0xFFFF) # ori $t7, $t7, 0xffff
/* 0A9D74 800A9174 3718F279 */ ori $t8, (0xFFFCF279 & 0xFFFF) # ori $t8, $t8, 0xf279
/* 0A9D78 800A9178 AC580004 */ sw $t8, 4($v0)
/* 0A9D7C 800A917C AC4F0000 */ sw $t7, ($v0)
/* 0A9D80 800A9180 24D90027 */ addiu $t9, $a2, 0x27
/* 0A9D84 800A9184 AFB90010 */ sw $t9, 0x10($sp)
/* 0A9D88 800A9188 241900FF */ li $t9, 255
/* 0A9D8C 800A918C 240F0001 */ li $t7, 1
/* 0A9D90 800A9190 24180001 */ li $t8, 1
/* 0A9D94 800A9194 240E0001 */ li $t6, 1
/* 0A9D98 800A9198 01283823 */ subu $a3, $t1, $t0
/* 0A9D9C 800A919C 24E70040 */ addiu $a3, $a3, 0x40
/* 0A9DA0 800A91A0 AFAE0014 */ sw $t6, 0x14($sp)
/* 0A9DA4 800A91A4 AFB8001C */ sw $t8, 0x1c($sp)
/* 0A9DA8 800A91A8 AFAF0018 */ sw $t7, 0x18($sp)
/* 0A9DAC 800A91AC AFB90020 */ sw $t9, 0x20($sp)
/* 0A9DB0 800A91B0 8C640000 */ lw $a0, ($v1)
/* 0A9DB4 800A91B4 0C026306 */ jal func_80098C18
/* 0A9DB8 800A91B8 01282821 */ addu $a1, $t1, $t0
/* 0A9DBC 800A91BC 3C038015 */ lui $v1, %hi(gDisplayListHead) # $v1, 0x8015
/* 0A9DC0 800A91C0 24630298 */ addiu $v1, %lo(gDisplayListHead) # addiu $v1, $v1, 0x298
/* 0A9DC4 800A91C4 AC620000 */ sw $v0, ($v1)
.L800A91C8:
/* 0A9DC8 800A91C8 8FBF002C */ lw $ra, 0x2c($sp)
/* 0A9DCC 800A91CC 27BD0030 */ addiu $sp, $sp, 0x30
/* 0A9DD0 800A91D0 03E00008 */ jr $ra
/* 0A9DD4 800A91D4 00000000 */ nop
File diff suppressed because it is too large Load Diff
+3 -36
View File
@@ -13,9 +13,6 @@
void func_800C13F0(void) {
}
extern OSMesgQueue *D_800EA3B0;
extern OSMesgQueue *D_800EA3B4;
void func_800C13FC(OSMesg presetId) {
OSMesg mesg;
osRecvMesg(D_800EA3B4, &mesg, 0);
@@ -377,7 +374,7 @@ GLOBAL_ASM("asm/non_matchings/audio/external/func_800C1F8C.s")
#ifdef NEEDS_RODATA
// data/rodata_audio_2.s
extern f32 D_800F35E4;// = 100000.0f;
f32 *func_800C21E8(f32 *arg0, u32 arg1) {
f32 *func_800C21E8(Vec3f arg0, u32 arg1) {
u8 var_v0;
f32 *ret;
// Only here to force a match
@@ -4228,8 +4225,6 @@ void func_800C8CCC(void) {
GLOBAL_ASM("asm/non_matchings/audio/external/func_800C8CCC.s")
#endif
extern u8 D_800EA1D4;
void play_sound2(s32 soundBits) {
if ((soundBits == SOUND_ACTION_REV_ENGINE) && (gCurrentCourseId == 0x12)) {
@@ -4242,25 +4237,16 @@ void play_sound2(s32 soundBits) {
play_sound(soundBits, &D_800EA1C8, 4, &D_800EA1D4, &D_800EA1D4, &D_800EA1DC);
}
void func_800C3448(s32);
extern u16 D_800EA15C;
void func_800C8EAC(u16 arg0) {
func_800C3448(arg0 | 0x10000);
D_800EA15C = arg0;
}
void func_800C3448(s32);
extern u16 D_800EA160;
void func_800C8EF8(u16 arg0) {
func_800C3448(arg0 | 0x1010000);
D_800EA160 = arg0;
}
void func_800C36C4(s32 arg0, s32 arg1, u8 arg2, s8 arg3);
void func_800C8F44(u8 arg0) {
func_800C36C4(0, 0, arg0, 1);
}
@@ -4789,17 +4775,13 @@ void func_800C9D80(Vec3f position, Vec3f velocity, u32 soundBits) {
GLOBAL_ASM("asm/non_matchings/audio/external/func_800C9D80.s")
#endif
f32 *func_800C21E8(s32, s32);
void func_800C5578(s32, s32);
void func_800C9EF4(s32 arg0, s32 arg1) {
void func_800C9EF4(Vec3f arg0, u32 arg1) {
f32 *temp;
u8 i;
for (i = 0; i < D_800EA1C0 + 1; i++) {
temp = func_800C21E8(arg0, arg1);
if (temp != 0) {
if (temp != NULL) {
func_800C5578(temp, arg1);
}
}
@@ -4930,8 +4912,6 @@ void func_800CA118(s32 arg0) {
GLOBAL_ASM("asm/non_matchings/audio/external/func_800CA118.s")
#endif
extern u8 D_800EA0EC[];
void func_800CA24C(u8 arg0) {
D_800EA0EC[arg0] = 2;
}
@@ -4940,8 +4920,6 @@ void func_800CA270() {
D_800EA0F4 = 1;
}
extern u8 D_800E9F90[];
// appears to write u8 in list of f32s?
// However, 0x3C is 0.0f which could likely get confused with `u8 = 0`;
void func_800CA288(u8 arg0, s8 arg1) {
@@ -4965,8 +4943,6 @@ void func_800CA330(u8 arg0) {
func_800C3448(arg0 << 0x10 | 0x110000FF);
}
void func_800C58B8(u8, u8, u16); // extern
void func_800CA388(u8 arg0) {
arg0 *= 2;
func_800C58B8(0, 0, arg0);
@@ -4976,9 +4952,6 @@ void func_800CA388(u8 arg0) {
func_800C58B8(5, 0, arg0);
}
void func_800C3448(s32);
extern u8 D_800EA104;
void func_800CA414(u16 arg0, u16 arg1) {
if (D_800EA104 == 0) {
func_800C3448(func_800C3508(0) | 0x30000000);
@@ -4989,12 +4962,6 @@ void func_800CA414(u16 arg0, u16 arg1) {
D_800EA104 = 1;
}
extern u8 D_800EA108;
extern u16 D_800EA15C;
extern u8 D_800EA164;
extern u8 D_800EA1C0;
extern u8 D_8018FC08;
void func_800CA49C(u8 arg0) {
if (D_800EA108 == 0) {
if (D_800EA1C0 >= 2) {
+27 -1
View File
@@ -89,6 +89,7 @@ struct Unk_800EA06C {
} ;
void func_800C13F0();
void func_800C13FC(OSMesg);
f32 func_800C1480(u8, u8);
s8 func_800C15D0(u8, u8, u8);
f32 func_800C1934(u8, u8);
@@ -96,12 +97,16 @@ struct Unk_8018EFD8 *func_800C1C88(u8, Vec3f, Vec3f, f32*, u8, u32);
void func_800C1DA4(Camera*, Vec3s, struct Unk_8018EFD8*);
void func_800C1E2C(Camera*, Vec3f, struct Unk_8018EFD8*);
void func_800C1F8C();
f32 *func_800C21E8(s32, s32);
f32 *func_800C21E8(Vec3f, u32);
void func_800C3448(s32);
void func_800C36C4(s32, s32, u8, s8);
void func_800C4084(u16);
void play_sound(u32, f32*, u8, f32*, f32*, u8*);
void func_800C41CC(u8, struct Unk_80191420*);
void func_800C4398();
void func_800C5578(Vec3f, u32);
void func_800C5848();
void func_800C58B8(u8, u8, u16);
void func_800C6758(u8);
void func_800C86D8(u8);
void func_800C8770(u8);
@@ -109,19 +114,29 @@ void func_800C89E4();
void play_sound2(s32);
void func_800C8EAC(u16);
void func_800C8EF8(u16);
void func_800C8F44(u8);
void func_800C9060(u8, u32);
void func_800C90F4(u8, uintptr_t);
void func_800C9A88(u8);
void func_800C9EF4(Vec3f, u32);
void func_800C9F90(u8);
void func_800CA008(u8, u8);
void func_800CA0A0();
void func_800CA0B8();
void func_800CA0CC();
void func_800CA0E4();
void func_800CA118();
void func_800CA24C(u8);
void func_800CA270();
void func_800CA288(u8, s8);
void func_800CA2B8(u8);
void func_800CA2E4(u8, s8);
void func_800CA30C(u8);
void func_800CA330(u8);
void func_800CA388(u8);
void func_800CA414(u16, u16);
void func_800CA49C(u8);
void func_800CAACC(u8);
void func_800CB134();
void func_800CB2C4(void);
@@ -136,6 +151,7 @@ extern u8 D_8018FB91;
extern Camera *D_8018FB98[4];
extern Vec3f D_8018FBA8[4];
extern Vec3f D_8018FBD8[4];
extern u8 D_8018FC08;
extern struct Unk_80191420 sSoundBanks[SOUND_BANK_COUNT][20];
extern u8 sSoundBankUsedListBack[SOUND_BANK_COUNT];
@@ -154,10 +170,16 @@ extern u8 D_800E9F24[8];// = { 0, 0, 0, 0, 0, 0, 0, 0 };
extern f32 D_800E9F34[8];// = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; /* const */
extern f32 D_800E9F54[4];// = { 1.0f, 1.0f, 1.0f, 1.0f }; /* const */
extern u8 D_800E9F2C[8];// = { 0, 0, 0, 0, 0, 0, 0, 0 };
extern u8 D_800E9F90[];
extern struct Unk_800EA06C D_800EA06C[8];
extern u8 D_800EA0EC[];
extern u8 D_800EA0F0;// = 0;
extern u8 D_800EA0F4;
extern u8 D_800EA104;
extern u8 D_800EA108;// = 0;
extern u16 D_800EA15C;
extern u16 D_800EA160;
extern u8 D_800EA164;
extern s16 D_800EA174;// = 0;
extern f32 D_800EA178;
extern f32 D_800EA17C;
@@ -166,9 +188,13 @@ extern u8 D_800EA1C0;// = 0;
// Most similar to gGlobalSoundSource from SM64, but I don't know if its really
// a sound source, its usage makes it look like a 0'd Vec3f for general usage
extern Vec3f D_800EA1C8;// = {0.0f, 0.0f, 0.0f}
extern u8 D_800EA1D4;
extern u8 D_800EA1DC;// = 0;
extern u8 D_800EA244;
extern s8 D_800EA16C;
extern OSMesgQueue *D_800EA3B0;
extern OSMesgQueue *D_800EA3B4;
#endif
-4
View File
@@ -9,10 +9,6 @@ void func_80002DAC();
void clear_nmi_buffer();
void func_80003040();
// audio/external
void func_800C8F44(u16 arg0);
extern struct UnkStruct_800DC5EC *D_800DC5EC;
extern struct UnkStruct_800DC5EC *D_800DC5F0;
extern struct UnkStruct_800DC5EC *D_800DC5F4;
-1
View File
@@ -207,7 +207,6 @@ void func_80086D80();
// audio/external.c
void func_800C9D80(Vec3f, Vec3f, u32);
void func_800C9EF4(Vec3f, s32);
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *mq);
s32 osRecvMesg(OSMesgQueue*, OSMesg*, s32);
+5 -8
View File
@@ -999,20 +999,17 @@ GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008933C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_80072180(); // extern
s32 func_8007223C(?); // extern
f32 func_8008933C(Player *, s32, s32, s32); // extern
void func_800C9060(u8, s32); // extern
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-21-2022
f32 func_8008933C(Player *, s32, s32, s32); /* extern */
void func_80089474(s32 arg0, u8 arg1, s32 arg2, s32 arg3, s32 arg4) {
void func_80089474(s32 arg0, u8 arg1, s32 arg2, s32 arg3, u32 arg4) {
Player *sp18;
sp18 = &gPlayerOne[arg1];
if (func_8007223C(0x4000000) != 0) {
if (func_8007223C(arg0, 0x04000000) != 0) {
func_80072180();
}
if ((func_8008933C(sp18, arg0, arg2, arg3) >= 4.0) && ((sp18->unk_000 & 0x1000) != 0x1000)) {
if (((f64) func_8008933C(sp18, arg0, arg2, arg3) >= 4.0) && ((sp18->unk_000 & 0x1000) != 0x1000)) {
func_800C9060(arg1, arg4);
}
}
+16 -18
View File
@@ -417,7 +417,7 @@ void func_8008CDC0(Player* player, s8 arg1) {
}
#ifdef MIPS_TO_C
//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-14-2022
void func_8008CEB0(Player *player, s8 arg1) {
f32 sp2C;
s16 sp2A;
@@ -2226,9 +2226,7 @@ void func_800914A0(void) {
}
#ifdef MIPS_TO_C
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
extern u16 D_80152308;
extern s16 D_8015F6F8;
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-15-2022
extern u32 D_8015F718;
static ? D_800E7080; /* unable to generate initializer */
static ? D_800E708C; /* unable to generate initializer */
@@ -2248,9 +2246,9 @@ void func_800914E0(void) {
f32 temp_f8;
s16 temp_a0;
s16 temp_a0_2;
s16 temp_v0_2;
u32 temp_v0;
void *temp_v0_3;
s16 temp_v0;
u16 temp_t0;
void *temp_v0_2;
sp64.unk0 = (s32) D_800E7080.unk0;
sp64.unk4 = (s32) D_800E7080.unk4;
@@ -2258,32 +2256,32 @@ void func_800914E0(void) {
sp58.unk0 = (s32) D_800E708C.unk0;
sp58.unk4 = (s32) D_800E708C.unk4;
sp58.unk8 = (s32) D_800E708C.unk8;
temp_v0 = D_8015F718;
temp_a0 = temp_v0 & 0xFFFFFF;
temp_a0 = D_8015F718 & 0xFFFFFF;
var_t1 = &gPlayerOneCopy;
sp48 = gSegmentTable[temp_v0 >> 0x18] + temp_a0 + 0x80000000;
temp_v0_2 = (s16) gPlayerOneCopy->unk_006 - D_80152308;
sp48 = gSegmentTable[(u32) D_8015F718 >> 0x18] + temp_a0 + 0x80000000;
temp_t0 = D_80152308;
temp_v0 = (s16) gPlayerOneCopy->unk_006 - temp_t0;
cameras->up[0] = 0.0f;
cameras->up[2] = 0.0f;
cameras->up[1] = 1.0f;
if (temp_v0_2 == 7) {
if (temp_v0 == 7) {
func_800914A0(temp_a0, 7);
goto block_5;
}
if (temp_v0_2 < 0xE) {
temp_a0_2 = temp_v0_2 + D_8015F6F8;
if (temp_v0 < 0xE) {
temp_a0_2 = temp_v0 + (s16) D_8015F6F8;
if (temp_a0_2 == 7) {
func_800914A0(temp_a0_2, 7);
block_5:
var_t1 = &gPlayerOneCopy;
}
}
temp_v0_3 = (D_80152308 * 8) + sp48;
temp_f8 = (f32) (temp_v0_3->unk0 + 0xA);
temp_v0_2 = (temp_t0 * 8) + sp48;
temp_f8 = (f32) (temp_v0_2->unk0 + 0xA);
cameras->pos[0] = temp_f8;
temp_f16 = (f32) (temp_v0_3->unk2 + 7);
temp_f16 = (f32) (temp_v0_2->unk2 + 7);
cameras->pos[1] = temp_f16;
temp_f4 = (f32) (temp_v0_3->unk4 - 0x14);
temp_f4 = (f32) (temp_v0_2->unk4 - 0x14);
cameras->pos[2] = temp_f4;
cameras->lookAt[0] = (*var_t1)->pos[0];
cameras->lookAt[1] = (*var_t1)->pos[1];
+1144 -1647
View File
File diff suppressed because it is too large Load Diff
+38 -1
View File
@@ -49,6 +49,13 @@ typedef struct {
/* 0x04 */ Gfx *displayList;
} struct_8018E768_entry; // size = 0x08
typedef struct {
/* 0x00 */ s16 column;
/* 0x02 */ s16 row;
/* 0x04 */ s16 pad0;
/* 0x06 */ s16 pad1;
} Unk_D_800E70A0; // size = 0x08
/* Function Prototypes */
f64 exponent_by_squaring(f64, s32);
@@ -115,9 +122,9 @@ void *segmented_to_virtual_dupe_2(const void*);
Gfx *func_8009C204(Gfx*, MkTexture*, s32, s32, s32);
void func_8009CA2C();
void func_8009CA6C(s32);
void func_8009969C(MkTexture*);
void func_80099A94(MkTexture *, s32);
void func_80099AEC();
void func_8009E1E4();
void func_80099E54();
void func_80099E60(MkTexture *, s32, s32);
void func_80099EC4();
@@ -141,18 +148,31 @@ Gfx *func_8009C434(Gfx*, struct_8018DEE0_entry*, s32, s32, s32);
Gfx *func_8009C708(Gfx*, struct_8018DEE0_entry *, s32, s32, s32, s32);
void func_8009C918();
void func_8009CA2C();
void func_8009CDDC(s32, s32);
void func_8009CDFC(s32, s32);
void func_8009CE1C();
void func_8009D958(s32, s32);
void func_8009D978(s32, s32);
void func_8009DF4C(s32);
void func_8009DF6C(s32);
void func_8009DFE0(s32);
void func_8009E000(s32);
void func_8009E0F0(s32);
void func_8009E1C0();
void func_8009E1E4();
void func_8009E208();
void func_8009E230();
void func_8009E258();
void func_8009E280();
void func_8009E5BC();
void func_8009E5FC(s32);
void func_8009E620();
void add_8018D9E0_entry(s32, s32, s32, s8);
void func_800A08D8(u8, s32, s32);
void func_800A0AD0(struct_8018D9E0_entry*);
void func_800A0DFC();
void func_800A11D0(struct_8018D9E0_entry*, s32, s32);
void func_800A1500(struct_8018D9E0_entry*);
void func_800A15EC(struct_8018D9E0_entry*);
void func_800A1924(struct_8018D9E0_entry*);
void func_800A1A20(struct_8018D9E0_entry*);
@@ -183,8 +203,10 @@ void get_time_record_centiseconds(s32, char*);
void func_800A8230();
void func_800A8250();
void func_800A86E8(struct_8018D9E0_entry*);
void func_800A8A98(struct_8018D9E0_entry*);
void func_800A8E14(struct_8018D9E0_entry*);
void func_800A8EC0(struct_8018D9E0_entry*);
void func_800A90D4(s32, struct_8018D9E0_entry*);
void func_800A91D8(struct_8018D9E0_entry*, s32, s32);
void func_800A9208(struct_8018D9E0_entry*, s32);
void func_800A9278(struct_8018D9E0_entry*, s32);
@@ -194,6 +216,10 @@ void func_800A940C(struct_8018D9E0_entry*, s32);
void func_800A94C8(struct_8018D9E0_entry*, s32, s32);
void func_800A954C(struct_8018D9E0_entry*);
void func_800A9710(struct_8018D9E0_entry*);
void func_800A9B9C(struct_8018D9E0_entry*);
void func_800A9C40(struct_8018D9E0_entry*);
void func_800A9D5C(struct_8018D9E0_entry*);
void func_800AA280(struct_8018D9E0_entry*);
void func_800AAB90(struct_8018D9E0_entry*);
void func_800AADD4(struct_8018D9E0_entry*);
void func_800AAE18(struct_8018D9E0_entry*);
@@ -206,12 +232,19 @@ void func_800AAF94(struct_8018D9E0_entry*, s32);
s32 func_800AAFCC(s32);
void func_800AB020(struct_8018D9E0_entry*);
void func_800AB098(struct_8018D9E0_entry*);
void func_800AB164(struct_8018D9E0_entry*);
void func_800AB260(struct_8018D9E0_entry*);
void func_800AB290(struct_8018D9E0_entry*);
void func_800AB904(struct_8018D9E0_entry*);
void func_800ABAE8(struct_8018D9E0_entry*);
void func_800ABB24(struct_8018D9E0_entry*);
void func_800ABBCC(struct_8018D9E0_entry*);
void func_800ABC38(struct_8018D9E0_entry*);
void func_800ABCF4(struct_8018D9E0_entry*);
void func_800ABEAC(struct_8018D9E0_entry*);
void func_800ABF68(struct_8018D9E0_entry*);
void func_800AC128(struct_8018D9E0_entry*);
void func_800AC300(struct_8018D9E0_entry*);
void func_800AC324(struct_8018D9E0_entry*);
void func_800AC978(struct_8018D9E0_entry*);
void func_800AD1A4(struct_8018D9E0_entry*);
@@ -220,6 +253,8 @@ void func_800AEDBC(struct_8018D9E0_entry*);
void func_800AEE90(struct_8018D9E0_entry*);
void func_800AEEBC(struct_8018D9E0_entry*);
void func_800AEEE8(struct_8018D9E0_entry*);
void func_800AF004(struct_8018D9E0_entry*);
void func_800AF1AC(struct_8018D9E0_entry*);
void func_800AF480(struct_8018D9E0_entry*);
void func_800AF4DC(struct_8018D9E0_entry*);
void func_800AF740(struct_8018D9E0_entry*);
@@ -295,6 +330,8 @@ extern s32 gNumD_8018E768Entries; // D_8018E760
extern struct_8018E768_entry D_8018E768[D_8018E768_SIZE]; // D_8018E768
extern s8 gTextColor; // D_8018E860
extern s8 D_8018ED91;
extern s8 D_8018E838[];
extern s32 D_8018E840[];
extern s32 D_8018E850;
extern s32 D_8018E854;
extern s32 D_8018E858;
+188 -234
View File
@@ -721,178 +721,150 @@ s32 check_for_controller_pak(s32 controller) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 check_for_controller_pak(s32); // extern
s32 osPfsInit(? *, OSPfs *, ?); // extern
extern u16 D_800E86F0;
extern u32 D_800E86F4;
extern s8 D_800E86F8;
extern u8 D_800F2E64;
extern u8 D_800F2E74;
extern OSPfs D_8018E868;
extern s32 D_8018EB78;
extern s32 D_8018EB7C;
extern s32 gControllerPakNumPagesFree;
extern s32 D_8018EB84;
extern OSMesgQueue gSIEventMesgQueue;
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022
s32 check_for_controller_pak(?); /* extern */
s32 func_800B5B94(void) {
s32 temp_v0;
s32 temp_v0_2;
s32 temp_v0_3;
s8 temp_v0;
s8 phi_v0;
? phi_v0_2;
s32 var_v0;
s8 var_v0_2;
temp_v0 = D_800E86F8;
phi_v0 = temp_v0;
if (temp_v0 != 0) {
temp_v0_2 = osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84);
if (temp_v0_2 != 0) {
if (temp_v0_2 != 2) {
if (temp_v0_2 != 5) {
D_800E86F8 = 0;
goto block_8;
}
phi_v0 = D_800E86F8;
} else {
D_800E86F8 = 0;
var_v0_2 = D_800E86F8;
if (var_v0_2 != 0) {
temp_v0 = osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB84);
switch (temp_v0) { /* irregular */
default:
D_800E86F8 = 0;
block_8:
phi_v0 = 0;
}
var_v0_2 = 0;
goto block_9;
case 0:
return 0;
case 5:
var_v0_2 = D_800E86F8;
goto block_9;
case 2:
D_800E86F8 = 0;
goto block_8;
}
return 0;
}
} else {
block_9:
if (phi_v0 == 0) {
if (check_for_controller_pak(0) == 0) {
return 1;
}
temp_v0_3 = osPfsInit(&gSIEventMesgQueue, &D_8018E868, 0);
if (temp_v0_3 != 0) {
if (temp_v0_3 != 1) {
if (temp_v0_3 != 4) {
if (temp_v0_3 != 0xA) {
if (temp_v0_3 == 0xB) {
goto block_17;
if (var_v0_2 == 0) {
if (check_for_controller_pak(0) == 0) {
return 1;
}
temp_v0_2 = osPfsInit(&gSIEventMesgQueue, &D_8018E868, 0);
if (temp_v0_2 != 0) {
if (temp_v0_2 != 1) {
if (temp_v0_2 != 4) {
if (temp_v0_2 != 0x0000000A) {
if (temp_v0_2 == 0x0000000B) {
goto block_17;
}
goto block_19;
}
goto block_19;
return 2;
}
block_19:
return 2;
}
block_19:
block_17:
return 1;
}
D_800E86F8 = 1;
if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB84) == 0) {
return 0;
}
if (osPfsNumFiles(&D_8018E868, &D_8018EB78, &D_8018EB7C) != 0) {
return 2;
}
block_17:
return 1;
if (osPfsFreeBlocks(&D_8018E868, &gControllerPakNumPagesFree) != 0) {
return 2;
}
gControllerPakNumPagesFree = (s32) gControllerPakNumPagesFree >> 8;
goto block_27;
}
D_800E86F8 = 1;
if (osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB84) == 0) {
return 0;
}
if (osPfsNumFiles(&D_8018E868, &D_8018EB78, &D_8018EB7C) != 0) {
return 2;
}
if (osPfsFreeBlocks(&D_8018E868, &gControllerPakNumPagesFree) != 0) {
return 2;
}
gControllerPakNumPagesFree = gControllerPakNumPagesFree >> 8;
goto block_27;
}
block_27:
if (D_8018EB7C >= D_8018EB78) {
return 4;
if (D_8018EB7C >= D_8018EB78) {
return 4;
}
var_v0 = 4;
if (gControllerPakNumPagesFree >= 0x79) {
var_v0 = -1;
}
return var_v0;
}
phi_v0_2 = 4;
if (gControllerPakNumPagesFree >= 0x79) {
phi_v0_2 = -1;
}
return phi_v0_2;
}
#else
GLOBAL_ASM("asm/non_matchings/menus/func_800B5B94.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 check_for_controller_pak(?); // extern
s32 osPfsInit(? *, OSPfs *, ?); // extern
extern u16 D_800E86F0;
extern u32 D_800E86F4;
extern s8 D_800E86FC;
extern u8 D_800F2E64;
extern u8 D_800F2E74;
extern OSPfs D_8018E8D0;
extern s32 D_8018EB88;
extern OSMesgQueue gSIEventMesgQueue;
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022
s32 check_for_controller_pak(?); /* extern */
s8 func_800B5DA4(void) {
s32 func_800B5DA4(void) {
s32 temp_v0;
s32 temp_v0_2;
s32 temp_v0_3;
s32 temp_v0_4;
s8 temp_v0;
s8 phi_v0;
s8 phi_v0_2;
s8 var_v0;
temp_v0 = D_800E86FC;
phi_v0 = temp_v0;
if (temp_v0 != 0) {
temp_v0_2 = osPfsFindFile(&D_8018E8D0, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB88);
if (temp_v0_2 != 0) {
if (temp_v0_2 != 2) {
if (temp_v0_2 != 5) {
goto block_7;
}
return -1;
}
block_7:
var_v0 = D_800E86FC;
if (var_v0 != 0) {
temp_v0 = osPfsFindFile(&D_8018E8D0, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB88);
switch (temp_v0) { /* switch 1; irregular */
case 0: /* switch 1 */
return 0;
case 5: /* switch 1 */
return -1;
default: /* switch 1 */
case 2: /* switch 1 */
D_800E86FC = 0;
phi_v0 = 0;
var_v0 = 0;
goto block_8;
}
return 0;
}
} else {
block_8:
phi_v0_2 = phi_v0;
if (phi_v0 == 0) {
if (check_for_controller_pak(1) == 0) {
return 1;
}
temp_v0_3 = osPfsInit(&gSIEventMesgQueue, &D_8018E8D0, 1);
if (temp_v0_3 != 0) {
if (temp_v0_3 != 1) {
if (temp_v0_3 != 4) {
if (temp_v0_3 != 0xA) {
if (temp_v0_3 == 0xB) {
goto block_16;
if (var_v0 == 0) {
if (check_for_controller_pak(1) == 0) {
return 1;
}
temp_v0_2 = osPfsInit(&gSIEventMesgQueue, &D_8018E8D0, 1);
if (temp_v0_2 != 0) {
if (temp_v0_2 != 1) {
if (temp_v0_2 != 4) {
if (temp_v0_2 != 0x0000000A) {
if (temp_v0_2 == 0x0000000B) {
goto block_16;
}
goto block_18;
}
goto block_18;
goto block_25;
}
goto block_25;
}
block_18:
goto block_25;
}
block_16:
return 1;
}
D_800E86FC = 1;
temp_v0_4 = osPfsFindFile(&D_8018E8D0, D_800E86F0, D_800E86F4, &D_800F2E64, &D_800F2E74, &D_8018EB88);
if (temp_v0_4 != 0) {
if (temp_v0_4 != 2) {
if (temp_v0_4 != 5) {
goto block_25;
}
return -1;
block_16:
return 1;
}
D_800E86FC = 1;
temp_v0_3 = osPfsFindFile(&D_8018E8D0, D_800E86F0, D_800E86F4, D_800F2E64, D_800F2E74, &D_8018EB88);
switch (temp_v0_3) { /* irregular */
case 0:
return 0;
case 5:
return -1;
case 2:
block_25:
phi_v0_2 = 2;
// Duplicate return node #26. Try simplifying control flow for better match
return phi_v0_2;
var_v0 = 2;
/* Duplicate return node #26. Try simplifying control flow for better match */
return (s32) var_v0;
}
} else {
return (s32) var_v0;
}
return 0;
}
return phi_v0_2;
}
#else
GLOBAL_ASM("asm/non_matchings/menus/func_800B5DA4.s")
@@ -977,100 +949,90 @@ GLOBAL_ASM("asm/non_matchings/menus/func_800B60E8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_800051C4(); // extern
s32 func_800B6088(s32); // extern
s8 func_800B60E8(s32); // extern
extern u8 *D_800DC714;
extern s32 D_80162DFC;
extern OSPfs D_8018E868;
extern s32 D_8018EB84;
extern struct_8018EE10_entry D_8018EE10;
extern s8 gCupSelection;
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022
s32 func_800B6178(s32 arg0) {
s32 temp_s0_2;
s32 temp_v0;
s32 temp_v0_2;
s32 temp_v0_3;
s32 temp_v1;
s8 temp_s0;
s8 temp_s0_3;
void *temp_s1;
void *temp_s3;
s8 phi_s0;
void *phi_s1;
s32 phi_s0_2;
void *phi_s1_2;
s32 phi_v0;
s8 phi_s0_3;
void *phi_s1_3;
s32 phi_v1;
s32 var_s0_2;
s32 var_v0;
s32 var_v1;
s8 temp_t0;
s8 temp_t1;
s8 temp_t3;
s8 temp_t4;
s8 temp_t5;
s8 temp_t9;
s8 var_s0;
s8 var_s0_3;
struct_8018EE10_entry *temp_s3;
struct_8018EE10_entry *var_s1;
struct_8018EE10_entry *var_s1_2;
struct_8018EE10_entry *var_s1_3;
u8 temp_v0_2;
if ((arg0 != 0) && (arg0 != 1)) {
return -1;
}
if (gGamestate == RACING) {
if (gGamestate == 4) {
func_800051C4();
}
temp_s3 = (arg0 << 7) + &D_8018EE10;
temp_s3->unk4 = 0;
temp_s3 = &D_8018EE10[arg0];
temp_s3->ghostDataSaved = 0;
temp_v0 = func_800B6088(arg0);
temp_v1 = temp_v0;
phi_v1 = temp_v1;
var_v1 = temp_v0;
if (temp_v0 != 0) {
temp_s3->unk4 = 0;
phi_s0 = 0;
phi_s1 = temp_s3;
temp_s3->ghostDataSaved = 0;
var_s0 = 0;
var_s1 = temp_s3;
do {
phi_s1->unk7 = phi_s0;
temp_s0 = phi_s0 + 4;
phi_s1->unkA = phi_s0 + 3;
phi_s1->unk9 = phi_s0 + 2;
phi_s1->unk8 = phi_s0 + 1;
phi_s0 = temp_s0;
phi_s1 += 4;
} while (temp_s0 != 0x3C);
temp_t9 = var_s0 + 1;
temp_t0 = var_s0 + 2;
temp_t1 = var_s0 + 3;
var_s1->unk_07[0] = var_s0;
var_s0 += 4;
var_s1->unk_07[3] = temp_t1;
var_s1->unk_07[2] = temp_t0;
var_s1->unk_07[1] = temp_t9;
var_s1 += 4;
} while (var_s0 != 0x3C);
} else {
temp_v0_2 = osPfsReadWriteFile(&D_8018E868, D_8018EB84, 1, (arg0 * 0x3C00) + 0x100, 0x3C00, D_800DC714);
phi_v0 = temp_v0_2;
phi_v1 = temp_v0_2;
if (temp_v0_2 == 0) {
temp_s3->unk4 = 1;
if (gGamestate == RACING) {
temp_s3->unk5 = (gCupSelection * 4) + gCupCourseSelection;
var_v0 = osPfsReadWriteFile(&D_8018E868, D_8018EB84, 1U, (arg0 * 0x3C00) + 0x100, 0x00003C00, (u8 *) D_800DC714);
var_v1 = var_v0;
if (var_v0 == 0) {
temp_s3->ghostDataSaved = 1;
if (gGamestate == 4) {
temp_s3->courseIndex = (gCupSelection * 4) + gCupCourseSelection;
}
temp_s3->unk0 = D_80162DFC;
temp_s3->unk6 = D_80162DE0;
phi_s0_2 = 0;
phi_s1_2 = temp_s3;
var_s0_2 = 0;
temp_s3->unk_00 = D_80162DFC;
var_s1_2 = temp_s3;
temp_s3->characterId = (u8) D_80162DE0;
do {
temp_s0_2 = phi_s0_2 + 1;
temp_s1 = phi_s1_2 + 1;
temp_s1->unk6 = func_800B60E8(phi_s0_2);
phi_s0_2 = temp_s0_2;
phi_s1_2 = temp_s1;
} while (temp_s0_2 != 0x3C);
temp_v0_3 = func_800B6088(arg0);
phi_v0 = temp_v0_3;
phi_v1 = temp_v0_3;
temp_v0_2 = func_800B60E8(var_s0_2);
var_s0_2 += 1;
var_s1_2 += 1;
var_s1_2->characterId = temp_v0_2;
} while (var_s0_2 != 0x0000003C);
var_v0 = func_800B6088(arg0);
var_v1 = var_v0;
}
if (phi_v0 != 0) {
temp_s3->unk4 = 0;
phi_s0_3 = 0;
phi_s1_3 = temp_s3;
if (var_v0 != 0) {
temp_s3->ghostDataSaved = 0;
var_s0_3 = 0;
var_s1_3 = temp_s3;
do {
phi_s1_3->unk7 = phi_s0_3;
temp_s0_3 = phi_s0_3 + 4;
phi_s1_3->unkA = phi_s0_3 + 3;
phi_s1_3->unk9 = phi_s0_3 + 2;
phi_s1_3->unk8 = phi_s0_3 + 1;
phi_s0_3 = temp_s0_3;
phi_s1_3 += 4;
} while (temp_s0_3 != 0x3C);
temp_t3 = var_s0_3 + 1;
temp_t4 = var_s0_3 + 2;
temp_t5 = var_s0_3 + 3;
var_s1_3->unk_07[0] = var_s0_3;
var_s0_3 += 4;
var_s1_3->unk_07[3] = temp_t5;
var_s1_3->unk_07[2] = temp_t4;
var_s1_3->unk_07[1] = temp_t3;
var_s1_3 += 4;
} while (var_s0_3 != 0x3C);
}
}
return phi_v1;
return var_v1;
}
#else
GLOBAL_ASM("asm/non_matchings/menus/func_800B6178.s")
@@ -1169,44 +1131,36 @@ s32 func_800B64EC(s32 arg0) {
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_800B60E8(s32); // extern
extern u8 *D_800DC714;
extern s32 D_80162DFC;
extern s32 D_8018D9C0;
extern OSPfs D_8018E8D0;
extern s32 D_8018EB88;
extern ? D_8018EE15;
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-11-2022
s32 func_800B65F4(s32 arg0, s32 arg1) {
s32 sp34;
s32 temp_s0;
s32 temp_v0;
void *temp_s3;
s32 phi_s0;
void *phi_s1;
s32 var_s0;
struct_8018EE10_entry *temp_s3;
struct_8018EE10_entry *var_s1;
u8 temp_v0_2;
if ((arg0 != 0) && (arg0 != 1)) {
return -1;
}
temp_v0 = osPfsReadWriteFile(&D_8018E8D0, D_8018EB88, 0, (arg0 * 0x3C00) + 0x100, 0x3C00, D_800DC714);
temp_v0 = osPfsReadWriteFile(&D_8018E8D0, D_8018EB88, 0U, (arg0 * 0x3C00) + 0x100, 0x00003C00, (u8 *) D_800DC714);
sp34 = temp_v0;
if (temp_v0 == 0) {
temp_s3 = D_8018D9C0 + (arg0 << 7);
phi_s0 = 0;
phi_s1 = temp_s3;
temp_s3 = &D_8018D9C0[arg0];
var_s1 = temp_s3;
var_s0 = 0;
loop_5:
temp_s0 = phi_s0 + 1;
phi_s0 = temp_s0;
if (phi_s1->unk7 != func_800B60E8(phi_s0)) {
temp_s3->unk4 = 0;
temp_v0_2 = func_800B60E8(var_s0);
var_s0 += 1;
if ((u8) var_s1->unk_07[0] != temp_v0_2) {
temp_s3->ghostDataSaved = 0;
return -2;
}
phi_s1 += 1;
if (temp_s0 == 0x3C) {
D_80162DE0 = temp_s3->unk6;
D_80162DFC = temp_s3->unk0;
*(&D_8018EE15 + (arg1 << 7)) = temp_s3->unk5;
var_s1 += 1;
if (var_s0 == 0x0000003C) {
D_80162DE0 = (s32) temp_s3->characterId;
D_80162DFC = temp_s3->unk_00;
*(&D_8018EE10->courseIndex + (arg1 << 7)) = temp_s3->courseIndex;
goto block_9;
}
goto loop_5;
+25 -34
View File
@@ -211,67 +211,58 @@ GLOBAL_ASM("asm/non_matchings/code_80280650/func_80280B50.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_80280B50(f32 *, f32, s32, s16); // extern
extern s32 D_80284E50;
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-10-2022
static s32 D_80284E50[4] = { 0x007F2040, 0x0040207F, 0x00207F20, 0x007F7F20 };
void func_80280D1C(void *arg0) {
f32 sp60;
f32 sp5C;
f32 sp58;
f32 *temp_s4;
f32 temp_f0;
s32 temp_s0;
s32 temp_v0;
s32 temp_v1;
s32 temp_v1_2;
s32 phi_s1;
s32 phi_s0;
s32 phi_v1;
s32 var_s0;
s32 var_s1;
s32 var_v1;
phi_s1 = 0;
phi_s0 = 0;
var_s0 = 0;
var_s1 = 0;
if (arg0->unk44 < 0x1E) {
temp_s4 = &sp58;
do {
sp58 = arg0->unk10;
sp5C = arg0->unk14 - phi_s1;
sp5C = arg0->unk14 - (f32) var_s1;
sp60 = arg0->unk18;
func_80280B50(temp_s4, ((0xA - phi_s0) / 10.0f) * 2.0f, *(&D_80284E50 + (arg0->unk48 * 4)), ((0x1E - arg0->unk44) * 0x64) / 30.0f);
temp_s0 = phi_s0 + 1;
phi_s1 += 2;
phi_s0 = temp_s0;
} while (temp_s0 != 0xA);
func_80280B50(&sp58, ((f32) (0xA - var_s0) / 10.0f) * 2.0f, D_80284E50[arg0->unk48], (s16) (s32) ((f32) ((0x1E - arg0->unk44) * 0x64) / 30.0f));
var_s0 += 1;
var_s1 += 2;
} while (var_s0 != 0xA);
} else {
temp_v0 = arg0->unk2C;
if (temp_v0 < 5) {
temp_v1 = arg0->unk3C + (arg0->unk40 * 2);
arg0->unk3C = temp_v1;
arg0->unk34 = arg0->unk34 + (arg0->unk38 * 2.0f);
phi_v1 = temp_v1;
var_v1 = arg0->unk3C + (arg0->unk40 * 2);
arg0->unk3C = var_v1;
arg0->unk34 = (f32) (arg0->unk34 + (arg0->unk38 * 2.0f));
} else {
temp_f0 = 1.0f + (((temp_v0 * 7) - 0x23) / 10.0f);
temp_v1_2 = arg0->unk3C + (arg0->unk40 / temp_f0);
arg0->unk3C = temp_v1_2;
arg0->unk34 = arg0->unk34 + (arg0->unk38 / temp_f0);
phi_v1 = temp_v1_2;
if (temp_v1_2 < 0) {
temp_f0 = 1.0f + ((f32) ((temp_v0 * 7) - 0x23) / 10.0f);
var_v1 = (s32) ((f32) arg0->unk3C + ((f32) arg0->unk40 / temp_f0));
arg0->unk3C = var_v1;
arg0->unk34 = (f32) (arg0->unk34 + (arg0->unk38 / temp_f0));
if (var_v1 < 0) {
arg0->unk3C = 0;
phi_v1 = 0;
var_v1 = 0;
}
}
arg0->unk2C = arg0->unk2C + 1;
if ((phi_v1 <= 0) || !(arg0->unk34 > 0.0f)) {
arg0->unk2C = (s32) (arg0->unk2C + 1);
if ((var_v1 <= 0) || !(arg0->unk34 > 0.0f)) {
if (arg0->unk2C < 0x1E) {
goto block_12;
}
arg0->unk0 = 0;
} else {
block_12:
func_80280B50(arg0 + 0x10, arg0->unk34, arg0->unk30, phi_v1);
func_80280B50(arg0 + 0x10, arg0->unk34, arg0->unk30, (s16) var_v1);
}
}
arg0->unk44 = arg0->unk44 + 1;
arg0->unk44 = (s32) (arg0->unk44 + 1);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80280650/func_80280D1C.s")
+32 -52
View File
@@ -1307,28 +1307,23 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802AA7C8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void dma_copy(u8 *, s32, s32, s32); // extern
extern u8 *gPrevLoadedAddress;
s32 func_802AA88C(s32 arg0, s32 arg1) {
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-09-2022
void *func_802AA88C(u8 *arg0, u8 *arg1) {
s32 sp28;
u8 *sp20;
u8 *sp1C;
s32 temp_t6;
u32 sp1C;
u32 temp_t6;
u8 *temp_a0;
u8 *temp_a1;
temp_t6 = ((arg1 - arg0) + 0xF) & ~0xF;
temp_a0 = gHeapEndPtr - temp_t6;
sp20 = temp_a0;
dma_copy(temp_a0, arg0, temp_t6, arg1);
temp_a1 = gPrevLoadedAddress;
sp1C = temp_a1;
dma_copy(temp_a0, arg0, temp_t6);
sp1C = gPrevLoadedAddress;
sp28 = (temp_a0->unk4 + 0xF) & ~0xF;
mio0decode(temp_a0, temp_a1);
gPrevLoadedAddress = &gPrevLoadedAddress[sp28];
return sp1C;
mio0decode(temp_a0, (u8 *) gPrevLoadedAddress);
gPrevLoadedAddress += sp28;
return (void *) sp1C;
}
#else
GLOBAL_ASM("asm/non_matchings/memory/func_802AA88C.s")
@@ -3153,15 +3148,10 @@ GLOBAL_ASM("asm/non_matchings/memory/func_802ADDC8.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75
//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-09-2022
s32 func_802ABB04(f32, f32, s32); /* extern */
f32 func_802ABE30(f32, f32, f32, s32); /* extern */
extern u8 D_8014F110;
extern ? D_8014F110;
extern s32 D_8015F584;
extern s16 D_8015F6E8;
extern s16 D_8015F6EA;
extern s16 D_8015F6F0;
extern s16 D_8015F6F2;
static f32 D_802B9E4C = -3000.0f;
static f32 D_802B9E50 = 3000.0f;
static f32 D_802B9E54 = 3000.0f;
@@ -3171,39 +3161,31 @@ static f32 D_802B9E60 = 3000.0f;
f32 func_802AE1C0(f32 arg0, f32 arg1, f32 arg2) {
f32 temp_f0;
f32 temp_f20;
s16 temp_v0;
s16 temp_v1;
f32 var_f20;
s32 temp_at;
s32 temp_f4;
s32 temp_f6;
s32 temp_t0;
s32 temp_t9;
s32 var_s2;
u16 temp_s0;
u16 temp_t1;
u16 var_s1;
void *temp_t2;
u16 phi_s1;
f32 phi_f20;
s32 phi_s2;
f32 phi_f20_2;
f32 phi_f20_3;
temp_v0 = D_8015F6EA;
temp_f20 = D_802B9E4C;
temp_v1 = D_8015F6F2;
temp_f4 = (s32) ((arg0 - (f32) temp_v0) / (f32) ((s32) (D_8015F6E8 - temp_v0) / 32));
temp_f6 = (s32) ((arg2 - (f32) temp_v1) / (f32) ((s32) (D_8015F6F0 - temp_v1) / 32));
var_f20 = D_802B9E4C;
temp_f4 = (s32) ((arg0 - (f32) D_8015F6EA) / (f32) ((s32) (D_8015F6E8 - D_8015F6EA) / 32));
temp_f6 = (s32) ((arg2 - (f32) D_8015F6F2) / (f32) ((s32) (D_8015F6F0 - D_8015F6F2) / 32));
temp_t0 = (s16) temp_f6 << 5;
temp_t2 = ((s16) ((s16) temp_f4 + temp_t0) * 4) + &D_8014F110;
temp_t1 = temp_t2->unk2;
phi_f20 = temp_f20;
phi_f20_2 = temp_f20;
if ((s32) (s16) temp_f4 < 0) {
if ((s16) temp_f4 < 0) {
return D_802B9E50;
}
if ((s16) temp_f6 & 0x04000000) {
return D_802B9E54;
}
if ((s32) (s16) temp_f4 >= 0x20) {
if ((s16) temp_f4 >= 0x20) {
return D_802B9E58;
}
if (temp_t0 >= 0x400) {
@@ -3212,26 +3194,24 @@ f32 func_802AE1C0(f32 arg0, f32 arg1, f32 arg2) {
if (temp_t1 == 0) {
return D_802B9E60;
}
phi_s1 = temp_t2->unk0;
phi_s2 = 0;
var_s1 = temp_t2->unk0;
var_s2 = 0;
if ((s32) temp_t1 > 0) {
do {
temp_s0 = *(D_8015F584 + (phi_s1 * 2));
phi_f20_3 = phi_f20;
if ((((*D_8015F580)[temp_s0].flags & 0x4000) != 0) && (func_802ABB04(arg0, arg2, temp_s0 & 0xFFFF) == 1)) {
temp_s0 = *(D_8015F584 + (var_s1 * 2));
if ((D_8015F580[temp_s0].flags & 0x4000) && (func_802ABB04(arg0, arg2, temp_s0 & 0xFFFF) == 1)) {
temp_f0 = func_802ABE30(arg0, arg1, arg2, temp_s0 & 0xFFFF);
if ((temp_f0 <= arg1) && (phi_f20 < temp_f0)) {
phi_f20_3 = temp_f0;
if ((temp_f0 <= arg1) && (var_f20 < temp_f0)) {
var_f20 = temp_f0;
}
}
temp_t9 = (phi_s2 + 1) & 0xFFFF;
phi_s1 = (phi_s1 + 1) & 0xFFFF;
phi_f20 = phi_f20_3;
phi_s2 = temp_t9;
phi_f20_2 = phi_f20_3;
} while (temp_t9 < (s32) temp_t1);
temp_t9 = (var_s2 + 1) & 0xFFFF;
temp_at = temp_t9 < (s32) temp_t1;
var_s2 = temp_t9;
var_s1 = (var_s1 + 1) & 0xFFFF;
} while (temp_at != 0);
}
return phi_f20_2;
return var_f20;
}
#else
GLOBAL_ASM("asm/non_matchings/memory/func_802AE1C0.s")
+21 -64
View File
@@ -19,7 +19,6 @@
/** Externs to be put into headers **/
extern s16 D_8015F892; // bss unknown
extern u32 D_800DC5AC; // data? from this file or another (main.c?)?
extern void func_800C3448(s32);
extern void rmonPrintf(const char *, ...); // not in a libultra header?
/** BSS **/
@@ -91,25 +90,27 @@ u32 sVIGammaOffDitherOn = OS_VI_GAMMA_OFF | OS_VI_DITHER_FILTER_ON;
/*** Const/rodata Data ***/
// used to set gScreenModeSelection; might be smaller; could be function static data
const s8 D_800F2B50[] = {0, 1, 2, 3, 3, 0, 0, 0};
const s8 D_800F2B50[] = {0, 1, 2, 3, 3};
// set to D_8018EDF3, then that sets gPlayerCountSelection1
const s8 D_800F2B58[] = {1, 2, 2, 3, 4, 0, 0, 0};
const s8 D_800F2B58[] = {1, 2, 2, 3, 4};
// Limit for each column in one-two-three-four players selection
const s8 D_800F2B60[4] = {1, 2, 1, 1};
// Limit in each column
const s8 D_800F2B64[4][3] = {
{2, 1, 0},
{2, 2, 0},
{2, 0, 0},
{2, 0, 0}
const s8 D_800F2B60[5][3] = {
{1, 2, 1},
{1, 2, 1},
{0, 2, 2},
{0, 2, 0},
{0, 2, 0},
// {0, 3, 1},
// {0, 3, 3},
// {0, 3, 0},
// {0, 3, 0},
};
// is this another union GameModePack? Figure out when decomping.
const s32 gGameModeFromNumPlayersAndRowSelection[5][3] = {
{ 0x03010003, 0x03000300, 0x00030000 },
{ 0x03010003, 0x03000300, 0x00030000 }, // Despite this matching, there is no way this line belongs in this array
{ GRAND_PRIX, TIME_TRIALS, 0x00000000 }, //first column
{ GRAND_PRIX, VERSUS, BATTLE }, //second
{ VERSUS, BATTLE, 0x00000000 }, //third
@@ -151,17 +152,6 @@ union GameModePack {
};
const union GameModePack D_800F2BE4 = { {0, 1, 2, 3} };
/** forward decs **/
void options_menu_act(struct Controller *, u16);
void data_menu_act(struct Controller *, u16);
void course_data_menu_act(struct Controller *, u16);
void logo_intro_menu_act(struct Controller *, u16);
void controller_pak_menu_act(struct Controller *, u16);
void splash_menu_act(struct Controller *, u16);
void main_menu_act(struct Controller *, u16);
void player_select_menu_act(struct Controller *, u16);
void course_select_menu_act(struct Controller *, u16);
void func_800B44AC(void);
/**************************/
/**
@@ -234,14 +224,6 @@ void update_menus(void) {
}
}
// D_8018EDEC is position on options screen?
#ifndef NON_MATCHING
// issue is regalloc starting at the 0x32 0x33 case
enum MenuOptionsCursorPositions {
MENU_OPTIONS_CSRPOS_SOUNDMODE = 0x16
};
// navigation of the options menu
void options_menu_act(struct Controller *controller, u16 arg1) {
u16 btnAndStick; // sp3E
@@ -276,7 +258,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
sp38->unk8 = 1;
sp2C = TRUE;
}
// L800B066C
if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x16)) {
D_8018EDEC -= 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
@@ -286,14 +267,12 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
sp2C = TRUE;
sp38->unk8 = -1;
}
// L800B06FC
if (sp2C && gSoundMode != sp38->unk4) {
gSaveDataSoundMode = gSoundMode;
write_save_data_grand_prix_points_and_sound_mode();
update_save_data_backup();
sp38->unk4 = gSoundMode;
}
// L800B0758
if (btnAndStick & CONT_B) {
func_8009E280();
play_sound2(SOUND_MENU_GO_BACK);
@@ -305,7 +284,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
}
return;
}
// L800B07C8
if (btnAndStick & CONT_A) {
switch (D_8018EDEC) {
case 0x16:
@@ -357,20 +335,16 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
break;
}
// L800B09DC
// definitely reading u8 at 0x84 from struct_8018EE10_entry,
// but that is too big for the size of the struct... unsized array off the end?
if (sp2C == -1 && !sp30->ghostDataSaved && !((u8 *)sp30)[0x84]) {
if (sp2C == -1 && !sp30[0].ghostDataSaved && !sp30[1].ghostDataSaved) {
D_8018EDEC = 0x2A;
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
return;
}
// L800B0A20
if (sp2C == 0) {
if (sp30->ghostDataSaved) {
if (sp30[0].ghostDataSaved) {
D_8018EDEC = 0x28;
play_sound2(SOUND_MENU_SELECT);
} else if (((u8 *)sp30)[0x84]) {
} else if (sp30[1].ghostDataSaved) {
D_8018EDEC = 0x29;
play_sound2(SOUND_MENU_SELECT);
} else {
@@ -418,7 +392,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
}
sp38->unk8 = 1;
}
// L800B0B74
if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x1F)) {
D_8018EDEC -= 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
@@ -427,13 +400,11 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
}
sp38->unk8 = -1;
}
// L800B0BF8
if (btnAndStick & CONT_B) {
D_8018EDEC = 0x18;
play_sound2(SOUND_MENU_GO_BACK);
return;
}
// L800B0C20
if (btnAndStick & CONT_A) {
switch (D_8018EDEC) {
case 0x1E:
@@ -469,8 +440,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
}
sp38->unk8 = 1;
}
// L800B0D38
if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x29) && sp30->ghostDataSaved) {
if ((btnAndStick & CONT_UP) && (D_8018EDEC >= 0x29) && sp30[0].ghostDataSaved) {
D_8018EDEC -= 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp38->unk24 < 4.2) {
@@ -478,13 +448,11 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
}
sp38->unk8 = -1;
}
// L800B0DD0
if (btnAndStick & CONT_B) {
D_8018EDEC = 0x17;
play_sound2(SOUND_MENU_GO_BACK);
return;
}
// L800B0DF4
if (btnAndStick & CONT_A) {
sp38->unk20 = D_8018EDEC - 0x28;
if (sp30[sp38->unk20].courseIndex == D_8018EE10[1].courseIndex && D_8018EE10[1].ghostDataSaved) {
@@ -518,12 +486,10 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
sp38->unk8 = -1;
}
}
// L800B0FA4
if (btnAndStick & CONT_B) {
D_8018EDEC = sp38->unk20 + 0x28;
play_sound2(SOUND_MENU_GO_BACK);
} else if (btnAndStick & CONT_A) {
// L800B0FCC
sp38->unk1C = D_8018EDEC - 0x32;
if (D_8018EE10[(sp38->unk1C)].ghostDataSaved) {
D_8018EDEC = 0x38;
@@ -563,7 +529,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
}
sp38->unk8 = 1;
}
// L800B10C4
if ((btnAndStick & CONT_LEFT) && D_8018EDEC >= 0x39) {
D_8018EDEC -= 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
@@ -572,7 +537,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
}
sp38->unk8 = -1;
}
// L800B114C
if (btnAndStick & CONT_B) {
D_8018EDEC = sp38->unk1C + 0x32;
play_sound2(SOUND_MENU_GO_BACK);
@@ -607,13 +571,11 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
if (res == 0) {
res = func_800B65F4(sp38->unk20, sp38->unk1C);
}
// L800B1230
if (res != 0) {
D_8018EDEC = 0x42;
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
return;
}
// L800B1254
res = osPfsFindFile(&D_8018E868, D_800E86F0, D_800E86F4, (u8 *)D_800F2E64, (u8 *)D_800F2E74, &D_8018EB84);
if (res == 0) {
res = func_800B6178(sp38->unk1C);
@@ -623,7 +585,6 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
return;
}
// L800B12DC
D_8018EDEC = 0x3C;
D_8018EE10[sp38->unk1C].courseIndex = (sp30 + sp38->unk20)->courseIndex;
func_800B6088(sp38->unk1C);
@@ -644,7 +605,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
if (func_800B6A68()) {
D_8018EDEC = 0x36;
play_sound2(SOUND_MENU_FILE_NOT_FOUND);
} else if (sp30->ghostDataSaved) {
} else if (sp30[0].ghostDataSaved) {
D_8018EDEC = 0x28;
} else {
D_8018EDEC = 0x29;
@@ -654,11 +615,7 @@ void options_menu_act(struct Controller *controller, u16 arg1) {
default: break;
}
}
// L800B13A0 return
}
#else
GLOBAL_ASM("asm/non_matchings/menus/options_menu_act.s")
#endif
}
// Handle navigating the data menu interface
void data_menu_act(struct Controller *controller, UNUSED u16 arg1) {
@@ -1435,12 +1392,12 @@ void main_menu_act(struct Controller *controller, u16 arg1) {
if (btnAndStick & CONT_DOWN) {
sp24 = FALSE;
if (func_800B555C()) {
if (sp28 < D_800F2B64[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1] + 1]) {
if (sp28 < D_800F2B60[D_8018EDF3 + 4][D_800E86AC[D_8018EDF3 - 1] + 1]) {
sp24 = TRUE;
}
} else {
// L800B30D4
if (sp28 < D_800F2B60[D_8018EDF3]) {
if (sp28 < D_800F2B60[D_8018EDF3][D_800E86AC[D_8018EDF3 - 1] + 1]) {
sp24 = TRUE;
}
}
+20 -2
View File
@@ -6,11 +6,29 @@
#include <types.h>
#include <defines.h>
// D_8018EDEC is position on options screen?
enum MenuOptionsCursorPositions {
MENU_OPTIONS_CSRPOS_SOUNDMODE = 0x16
};
/* functions */
void update_menus(void);
void func_800B3F74(s32 menuSelection);
void options_menu_act(struct Controller *, u16);
void data_menu_act(struct Controller *, u16);
void course_data_menu_act(struct Controller *, u16);
void logo_intro_menu_act(struct Controller *, u16);
void controller_pak_menu_act(struct Controller *, u16);
void splash_menu_act(struct Controller *, u16);
void func_800B28C8(void);
void main_menu_act(struct Controller *, u16);
s32 is_character_spot_free(s32);
void player_select_menu_act(struct Controller *, u16);
void course_select_menu_act(struct Controller *, u16);
void func_800B3F74(s32);
void func_800B44AC(void);
void func_800B44BC(void);
s32 func_800B4520(void);
void func_800B4560(s32, s32);
/* data */
extern s32 gMenuSelection;
@@ -23,7 +41,7 @@ extern s8 gControllerPakSelectedTableRow;
extern s8 D_800E86C4[12];
extern s8 D_800E86D0[16];
extern const s8 D_800F2B60[4];
extern const s8 D_800F2B60[5][3];
extern const s32 gGameModeFromNumPlayersAndRowSelection[5][3];
extern const s16 gCupCourseOrder[5][4];