Match a few small functions (#249)

* Match func_8000B820

* Match func_80011AB8

* Match a few small functions
This commit is contained in:
Maciek Baron 2022-08-03 02:44:33 +01:00 committed by GitHub
parent e9383d1b7a
commit 2fe6c6a2f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 44 additions and 235 deletions

View File

@ -1,25 +0,0 @@
glabel func_8000B820
/* 00C420 8000B820 00047080 */ sll $t6, $a0, 2
/* 00C424 8000B824 3C018016 */ lui $at, %hi(D_80163068)
/* 00C428 8000B828 002E0821 */ addu $at, $at, $t6
/* 00C42C 8000B82C C4203068 */ lwc1 $f0, %lo(D_80163068)($at)
/* 00C430 8000B830 3C01800F */ lui $at, %hi(D_800ECFD8) # $at, 0x800f
/* 00C434 8000B834 C424CFD8 */ lwc1 $f4, %lo(D_800ECFD8)($at)
/* 00C438 8000B838 3C01800F */ lui $at, %hi(D_800ECFDC) # $at, 0x800f
/* 00C43C 8000B83C 4600203E */ c.le.s $f4, $f0
/* 00C440 8000B840 00000000 */ nop
/* 00C444 8000B844 45010007 */ bc1t .L8000B864
/* 00C448 8000B848 00000000 */ nop
/* 00C44C 8000B84C C426CFDC */ lwc1 $f6, %lo(D_800ECFDC)($at)
/* 00C450 8000B850 00001025 */ move $v0, $zero
/* 00C454 8000B854 4606003E */ c.le.s $f0, $f6
/* 00C458 8000B858 00000000 */ nop
/* 00C45C 8000B85C 45000003 */ bc1f .L8000B86C
/* 00C460 8000B860 00000000 */ nop
.L8000B864:
/* 00C464 8000B864 03E00008 */ jr $ra
/* 00C468 8000B868 24020001 */ li $v0, 1
.L8000B86C:
/* 00C46C 8000B86C 03E00008 */ jr $ra
/* 00C470 8000B870 00000000 */ nop

View File

@ -1,12 +0,0 @@
glabel func_80011AB8
/* 0126B8 80011AB8 00041040 */ sll $v0, $a0, 1
/* 0126BC 80011ABC 3C018016 */ lui $at, %hi(D_801632B8) # 0x8016
/* 0126C0 80011AC0 00220821 */ addu $at, $at, $v0
/* 0126C4 80011AC4 A42032B8 */ sh $zero, %lo(D_801632B8)($at) # 0x32b8($at)
/* 0126C8 80011AC8 3C018016 */ lui $at, %hi(D_801632D0) # 0x8016
/* 0126CC 80011ACC 00220821 */ addu $at, $at, $v0
/* 0126D0 80011AD0 A42032D0 */ sh $zero, %lo(D_801632D0)($at) # 0x32d0($at)
/* 0126D4 80011AD4 3C018016 */ lui $at, %hi(D_801632E8) # 0x8016
/* 0126D8 80011AD8 00220821 */ addu $at, $at, $v0
/* 0126DC 80011ADC 03E00008 */ jr $ra
/* 0126E0 80011AE0 A42032E8 */ sh $zero, %lo(D_801632E8)($at) # 0x32e8($at)

View File

@ -1,13 +0,0 @@
glabel func_80011AE4
/* 0126E4 80011AE4 00041040 */ sll $v0, $a0, 1
/* 0126E8 80011AE8 3C018016 */ lui $at, %hi(D_801632B8) # 0x8016
/* 0126EC 80011AEC 00220821 */ addu $at, $at, $v0
/* 0126F0 80011AF0 A42032B8 */ sh $zero, %lo(D_801632B8)($at) # 0x32b8($at)
/* 0126F4 80011AF4 3C018016 */ lui $at, %hi(D_801632D0) # 0x8016
/* 0126F8 80011AF8 00220821 */ addu $at, $at, $v0
/* 0126FC 80011AFC A42032D0 */ sh $zero, %lo(D_801632D0)($at) # 0x32d0($at)
/* 012700 80011B00 3C018016 */ lui $at, %hi(D_801632E8) # 0x8016
/* 012704 80011B04 00220821 */ addu $at, $at, $v0
/* 012708 80011B08 240E0001 */ li $t6, 1
/* 01270C 80011B0C 03E00008 */ jr $ra
/* 012710 80011B10 A42E32E8 */ sh $t6, %lo(D_801632E8)($at) # 0x32e8($at)

View File

@ -1,14 +0,0 @@
glabel func_8006ED60
/* 06F960 8006ED60 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 06F964 8006ED64 AFBF0014 */ sw $ra, 0x14($sp)
/* 06F968 8006ED68 3C048016 */ lui $a0, %hi(D_80165C18) # $a0, 0x8016
/* 06F96C 8006ED6C 3C050001 */ lui $a1, (0x0001E140 >> 16) # lui $a1, 1
/* 06F970 8006ED70 34A5E140 */ ori $a1, (0x0001E140 & 0xFFFF) # ori $a1, $a1, 0xe140
/* 06F974 8006ED74 0C033698 */ jal bzero
/* 06F978 8006ED78 24845C18 */ addiu $a0, %lo(D_80165C18) # addiu $a0, $a0, 0x5c18
/* 06F97C 8006ED7C 8FBF0014 */ lw $ra, 0x14($sp)
/* 06F980 8006ED80 240EFFFF */ li $t6, -1
/* 06F984 8006ED84 3C018018 */ lui $at, %hi(D_80183D5C) # $at, 0x8018
/* 06F988 8006ED88 AC2E3D5C */ sw $t6, %lo(D_80183D5C)($at)
/* 06F98C 8006ED8C 03E00008 */ jr $ra
/* 06F990 8006ED90 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,15 +0,0 @@
glabel func_8006EE44
/* 06FA44 8006EE44 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 06FA48 8006EE48 AFBF0014 */ sw $ra, 0x14($sp)
/* 06FA4C 8006EE4C 3C040F0D */ lui $a0, %hi(gTextureLogoMarioKart64) # $a0, 0xf0d
/* 06FA50 8006EE50 3C058019 */ lui $a1, %hi(D_8018D9B0) # $a1, 0x8019
/* 06FA54 8006EE54 8CA5D9B0 */ lw $a1, %lo(D_8018D9B0)($a1)
/* 06FA58 8006EE58 24847510 */ addiu $a0, %lo(gTextureLogoMarioKart64) # addiu $a0, $a0, 0x7510
/* 06FA5C 8006EE5C 240679E1 */ li $a2, 31201
/* 06FA60 8006EE60 0C01BB65 */ jal func_8006ED94
/* 06FA64 8006EE64 3C070002 */ lui $a3, 2
/* 06FA68 8006EE68 8FBF0014 */ lw $ra, 0x14($sp)
/* 06FA6C 8006EE6C 3C018019 */ lui $at, %hi(D_8018D1E0) # $at, 0x8019
/* 06FA70 8006EE70 AC22D1E0 */ sw $v0, %lo(D_8018D1E0)($at)
/* 06FA74 8006EE74 03E00008 */ jr $ra
/* 06FA78 8006EE78 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,30 +0,0 @@
glabel func_80070714
/* 071314 80070714 3C0E8019 */ lui $t6, %hi(D_8018EDF3) # $t6, 0x8019
/* 071318 80070718 81CEEDF3 */ lb $t6, %lo(D_8018EDF3)($t6)
/* 07131C 8007071C 24020001 */ li $v0, 1
/* 071320 80070720 3C018016 */ lui $at, %hi(D_80165730) # $at, 0x8016
/* 071324 80070724 144E000B */ bne $v0, $t6, .L80070754
/* 071328 80070728 A4225730 */ sh $v0, %lo(D_80165730)($at)
/* 07132C 8007072C 240F0064 */ li $t7, 100
/* 071330 80070730 3C018016 */ lui $at, %hi(D_80165738) # $at, 0x8016
/* 071334 80070734 A42F5738 */ sh $t7, %lo(D_80165738)($at)
/* 071338 80070738 3C018016 */ lui $at, %hi(D_80165740) # $at, 0x8016
/* 07133C 8007073C 2418003C */ li $t8, 60
/* 071340 80070740 A4385740 */ sh $t8, %lo(D_80165740)($at)
/* 071344 80070744 3C018016 */ lui $at, %hi(D_80165748) # 0x8016
/* 071348 80070748 2419001E */ li $t9, 30
/* 07134C 8007074C 03E00008 */ jr $ra
/* 071350 80070750 A4395748 */ sh $t9, %lo(D_80165748)($at) # 0x5748
.L80070754:
/* 071354 80070754 24080032 */ li $t0, 50
/* 071358 80070758 3C018016 */ lui $at, %hi(D_80165738) # $at, 0x8016
/* 07135C 8007075C A4285738 */ sh $t0, %lo(D_80165738)($at)
/* 071360 80070760 3C018016 */ lui $at, %hi(D_80165740) # $at, 0x8016
/* 071364 80070764 2409001E */ li $t1, 30
/* 071368 80070768 A4295740 */ sh $t1, %lo(D_80165740)($at)
/* 07136C 8007076C 3C018016 */ lui $at, %hi(D_80165748) # $at, 0x8016
/* 071370 80070770 240A000A */ li $t2, 10
/* 071374 80070774 A42A5748 */ sh $t2, %lo(D_80165748)($at)
/* 071378 80070778 03E00008 */ jr $ra
/* 07137C 8007077C 00000000 */ nop

View File

@ -1,33 +0,0 @@
glabel func_8008A8B0
/* 08B4B0 8008A8B0 3C06800E */ lui $a2, %hi(gPlayerCountSelection1) # $a2, 0x800e
/* 08B4B4 8008A8B4 8CC6C538 */ lw $a2, %lo(gPlayerCountSelection1)($a2)
/* 08B4B8 8008A8B8 00043C00 */ sll $a3, $a0, 0x10
/* 08B4BC 8008A8BC 00077403 */ sra $t6, $a3, 0x10
/* 08B4C0 8008A8C0 AFA50004 */ sw $a1, 4($sp)
/* 08B4C4 8008A8C4 00057C00 */ sll $t7, $a1, 0x10
/* 08B4C8 8008A8C8 000F2C03 */ sra $a1, $t7, 0x10
/* 08B4CC 8008A8CC 01C03825 */ move $a3, $t6
/* 08B4D0 8008A8D0 AFA40000 */ sw $a0, ($sp)
/* 08B4D4 8008A8D4 18C00010 */ blez $a2, .L8008A918
/* 08B4D8 8008A8D8 00001825 */ move $v1, $zero
/* 08B4DC 8008A8DC 3C198019 */ lui $t9, %hi(D_8018CF68) # 0x8019
/* 08B4E0 8008A8E0 2722CF68 */ addiu $v0, $t9, %lo(D_8018CF68) # -0x3098
/* 08B4E4 8008A8E4 00064840 */ sll $t1, $a2, 1
/* 08B4E8 8008A8E8 01224021 */ addu $t0, $t1, $v0
/* 08B4EC 8008A8EC 84440000 */ lh $a0, ($v0)
.L8008A8F0:
/* 08B4F0 8008A8F0 24420002 */ addiu $v0, $v0, 2
/* 08B4F4 8008A8F4 0087082A */ slt $at, $a0, $a3
/* 08B4F8 8008A8F8 14200004 */ bnez $at, .L8008A90C
/* 08B4FC 8008A8FC 00A4082A */ slt $at, $a1, $a0
/* 08B500 8008A900 54200003 */ bnel $at, $zero, .L8008A910
/* 08B504 8008A904 0048082B */ sltu $at, $v0, $t0
/* 08B508 8008A908 24030001 */ li $v1, 1
.L8008A90C:
/* 08B50C 8008A90C 0048082B */ sltu $at, $v0, $t0
.L8008A910:
/* 08B510 8008A910 5420FFF7 */ bnel $at, $zero, .L8008A8F0
/* 08B514 8008A914 84440000 */ lh $a0, ($v0)
.L8008A918:
/* 08B518 8008A918 03E00008 */ jr $ra
/* 08B51C 8008A91C 00601025 */ move $v0, $v1

View File

@ -2127,7 +2127,7 @@ void func_800097E0(void) {
func_8000EF20();
D_8016337C++;
if (gCurrentCourseId == 20) {
if (gCurrentCourseId == 20) {
for (i = 0; i < 7; i++) {
func_8000DF8C(i);
}
@ -3043,19 +3043,17 @@ s32 func_8000B7E4(s32 arg0, u16 wayPointIndex) {
return 0;
}
#ifdef NEEDS_RODATA
extern f32 D_800ECFD8;// = 1.1f;
extern f32 D_800ECFDC;// = -1.1f;
s32 func_8000B820(s32 playerId) {
if ((1.1f <= D_80163068[playerId]) || (D_80163068[playerId] <= -1.1f)) {
s32 func_8000B820(s32 playerIndex) {
f32 value = D_80163068[playerIndex];
// Check if value between 1.1 and -1.1
if ((D_800ECFD8 <= value) || (value <= D_800ECFDC)) {
return 1;
}
return 0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_8000B820.s")
#endif
#ifdef NEEDS_RODATA
extern f32 D_800ECFE0;// = 0.01f;
@ -3069,7 +3067,7 @@ f32 func_8000B874(f32 posX, f32 posZ, u16 wayPointIndex, s32 pathIndex) {
f32 math;
struct TrackWayPoint *thing1;
struct TrackWayPoint *thing2;
thing1 = &D_80164560[pathIndex][wayPointIndex];
thing2 = &D_80164570[pathIndex][wayPointIndex];
@ -4470,7 +4468,7 @@ extern struct unk_41F8 D_801641F8[];
s32 func_8000ED14(s32, s16);
s32 func_8000ED14(s32 arg0, s16 arg1) {
s32 i;
s32 a2 = 0;
s32 a2 = 0;
for (i = 0; i < 8; i++) {
@ -6068,37 +6066,22 @@ void func_80011A5C(void) {
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80011A5C.s")
#endif
//#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
// Probably a struct but it matches so good enough for now.
extern s16 D_801632B8[];
extern s16 D_801632D0[];
extern s16 D_801632E8[];
void func_80011AB8(s32 arg0) {
D_801632B8[arg0] = 0;
D_801632D0[arg0] = 0;
D_801632E8[arg0] = 0;
}
//#else
//GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80011AB8.s")
//#endif
//#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
//extern ? D_801632B8;
//extern ? D_801632D0;
//extern ? D_801632E8;
void func_80011AE4(s32 arg0) {
D_801632B8[arg0] = 0;
D_801632D0[arg0] = 0;
D_801632E8[arg0] = 1;
void func_80011AB8(s32 index) {
D_801632B8[index] = 0;
D_801632D0[index] = 0;
D_801632E8[index] = 0;
}
void func_80011AE4(s32 index) {
D_801632B8[index] = 0;
D_801632D0[index] = 0;
D_801632E8[index] = 1;
}
//#else
//GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80011AE4.s")
//#endif
#ifdef MIPS_TO_C
//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9

View File

@ -3,7 +3,19 @@
#include <defines.h>
void func_8006EA5C(void);
void func_8006ED60(void);
s32 func_8006ED94(s32*, s32, s32, s32);
extern s32 gScreenModeSelection;
extern s32 gTextureLogoMarioKart64;
extern s16 D_80165730;
extern s16 D_80165738;
extern s16 D_80165740;
extern s16 D_80165748;
extern s32 D_80165C18;
extern s32 D_80183D5C;
extern s8 D_8018EDF3;
extern s32 D_8018D1E0;
extern s32 D_8018D9B0;
void func_8006E9C0(void) {
@ -195,18 +207,10 @@ void func_8006EB10(void) {
GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006EB10.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern void D_80165C18;
extern s32 D_80183D5C;
void func_8006ED60(void) {
void func_8006ED60() {
bzero(&D_80165C18, 0x1E140);
D_80183D5C = -1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006ED60.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
@ -234,19 +238,9 @@ u8 *func_8006ED94(s32 arg0, u8 *arg1, u32 arg2, s32 arg3) {
GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006ED94.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_8006ED94(? *, s32, ?, ?); // extern
extern s32 D_8018D1E0;
extern s32 D_8018D9B0;
extern ? gTextureLogoMarioKart64;
void func_8006EE44(void) {
D_8018D1E0 = func_8006ED94(&gTextureLogoMarioKart64, D_8018D9B0, 0x79E1, 0x20000);
}
#else
GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8006EE44.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
@ -1294,13 +1288,6 @@ void func_8007055C(void) {
GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_8007055C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s16 D_80165730;
extern s16 D_80165738;
extern s16 D_80165740;
extern s16 D_80165748;
void func_80070714(void) {
D_80165730 = 1;
if (D_8018EDF3 == ONE_PLAYERS_SELECTED) {
@ -1313,9 +1300,6 @@ void func_80070714(void) {
D_80165740 = 0x1E;
D_80165748 = 0xA;
}
#else
GLOBAL_ASM("asm/non_matchings/code_8006E9C0/func_80070714.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909

View File

@ -17,6 +17,9 @@ struct struct_E0 {
}; // Size 0xE0
extern struct struct_E0 D_80165CC6[];
extern s16 D_8018CF68[];
extern s32 gPlayerCountSelection1;
void func_800721E8(s32, s32); // extern
void func_80086E70(s32 arg0) {
D_80165CC6[arg0].unk00.s16 = 1;// * 0xE0)) = 1;
@ -1886,38 +1889,19 @@ s32 func_8008A890(struct UnkStruct8008A890 *arg0) {
return func_802ABD40(arg0->value);
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s16 D_8018CF68;
? func_8008A8B0(s16 arg0, s16 arg1) {
s16 *temp_v0;
s16 temp_a0;
s32 temp_a2;
s16 *phi_v0;
? phi_v1;
? phi_v1_2;
temp_a2 = gPlayerCountSelection1;
phi_v1 = 0;
phi_v1_2 = 0;
if (temp_a2 > 0) {
phi_v0 = &D_8018CF68;
do {
temp_a0 = *phi_v0;
temp_v0 = phi_v0 + 2;
phi_v0 = temp_v0;
if ((temp_a0 >= arg0) && (arg1 >= temp_a0)) {
phi_v1_2 = 1;
}
phi_v1 = phi_v1_2;
} while (temp_v0 < ((temp_a2 * 2) + &D_8018CF68));
s32 func_8008A8B0(s16 arg0, s16 arg1) {
s32 var_v1;
s16* var_v0;
s32 i;
var_v1 = 0;
for (i = 0; i < gPlayerCountSelection1; i++) {
var_v0 = &D_8018CF68[i];
if ((*var_v0 >= arg0) && (arg1 >= *var_v0)) {
var_v1 = 1;
}
}
return phi_v1;
return var_v1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008A8B0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307