Skip to content

Commit

Permalink
get it match again and fix some warning
Browse files Browse the repository at this point in the history
  • Loading branch information
coco875 committed Sep 27, 2024
1 parent bfaab29 commit 0bca03b
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 42 deletions.
12 changes: 6 additions & 6 deletions asm/non_matchings/code_80091750/menu_item_render.s
Original file line number Diff line number Diff line change
Expand Up @@ -757,10 +757,10 @@ glabel L8009FF0C
.L8009FF24:
/* 0A0B24 8009FF24 00084880 */ sll $t1, $t0, 2
.L8009FF28:
/* 0A0B28 8009FF28 3C04800F */ lui $a0, %hi(D_800E8234-0x18) # 0x800f
/* 0A0B28 8009FF28 3C04800F */ lui $a0, %hi(D_800E8234+0x18) # 0x800f
/* 0A0B2C 8009FF2C 00892021 */ addu $a0, $a0, $t1
/* 0A0B30 8009FF30 AFB900A8 */ sw $t9, 0xa8($sp)
/* 0A0B34 8009FF34 8C84824C */ lw $a0, %lo(D_800E8234-0x18)($a0) # -0x7db4($a0)
/* 0A0B34 8009FF34 8C84824C */ lw $a0, %lo(D_800E8234+0x18)($a0) # -0x7db4($a0)
/* 0A0B38 8009FF38 0C026449 */ jal segmented_to_virtual_dupe
/* 0A0B3C 8009FF3C AFA600AC */ sw $a2, 0xac($sp)
/* 0A0B40 8009FF40 8FA600AC */ lw $a2, 0xac($sp)
Expand All @@ -774,10 +774,10 @@ glabel L8009FF50
/* 0A0B5C 8009FF5C 1000001B */ b .L8009FFCC
/* 0A0B60 8009FF60 2406FFFF */ li $a2, -1
.L8009FF64:
/* 0A0B64 8009FF64 3C04800F */ lui $a0, %hi(D_800E8234-0x18) # 0x800f
/* 0A0B64 8009FF64 3C04800F */ lui $a0, %hi(D_800E8234+0x18) # 0x800f
/* 0A0B68 8009FF68 24050016 */ li $a1, 22
/* 0A0B6C 8009FF6C 008A2021 */ addu $a0, $a0, $t2
/* 0A0B70 8009FF70 8C84824C */ lw $a0, %lo(D_800E8234-0x18)($a0) # -0x7db4($a0)
/* 0A0B70 8009FF70 8C84824C */ lw $a0, %lo(D_800E8234+0x18)($a0) # -0x7db4($a0)
/* 0A0B74 8009FF74 AFA500A8 */ sw $a1, 0xa8($sp)
/* 0A0B78 8009FF78 0C026449 */ jal segmented_to_virtual_dupe
/* 0A0B7C 8009FF7C AFA600AC */ sw $a2, 0xac($sp)
Expand All @@ -792,10 +792,10 @@ glabel L8009FF90
/* 0A0B9C 8009FF9C 1000000B */ b .L8009FFCC
/* 0A0BA0 8009FFA0 2406FFFF */ li $a2, -1
.L8009FFA4:
/* 0A0BA4 8009FFA4 3C04800F */ lui $a0, %hi(D_800E8234-0x18) # 0x800f
/* 0A0BA4 8009FFA4 3C04800F */ lui $a0, %hi(D_800E8234+0x18) # 0x800f
/* 0A0BA8 8009FFA8 24050018 */ li $a1, 24
/* 0A0BAC 8009FFAC 008B2021 */ addu $a0, $a0, $t3
/* 0A0BB0 8009FFB0 8C84824C */ lw $a0, %lo(D_800E8234-0x18)($a0) # -0x7db4($a0)
/* 0A0BB0 8009FFB0 8C84824C */ lw $a0, %lo(D_800E8234+0x18)($a0) # -0x7db4($a0)
/* 0A0BB4 8009FFB4 AFA500A8 */ sw $a1, 0xa8($sp)
/* 0A0BB8 8009FFB8 0C026449 */ jal segmented_to_virtual_dupe
/* 0A0BBC 8009FFBC AFA600AC */ sw $a2, 0xac($sp)
Expand Down
2 changes: 1 addition & 1 deletion include/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ enum COLOR_ID {
TEXT_RED,
TEXT_YELLOW,
TEXT_BLUE_GREEN_RED_CYCLE_1,
TEXT_BLUE_GREEN_RED_CYCLE_2,
TEXT_BLUE_GREEN_RED_CYCLE_2
};

/**
Expand Down
14 changes: 14 additions & 0 deletions print_rodata.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.section .rodata

glabel print_rodata
.word 0x0

.section .text

glabel fake_function
nop
nop
nop
nop
nop
nop
48 changes: 21 additions & 27 deletions src/code_80091750.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
// Unfortunately that's not a small effort due to weird import structure in this project
#include "main.h"

void guMtxCatL(Mtx* m, Mtx* n, Mtx* res);

u16* gMenuTextureBuffer;
u8* gMenuCompressedBuffer;
u8* sTKMK00_LowResBuffer;
Expand Down Expand Up @@ -416,16 +418,6 @@ char* gMenuText[] = {
"CONTINUE GAME", "RETRY", "COURSE CHANGE", "DRIVER CHANGE", "QUIT", "REPLAY", "SAVE GHOST",
};

enum TEXT_MENU_ID {
CONTINUE_GAME,
RETRY,
COURSE_CHANGE,
DRIVER_CHANGE,
QUIT,
REPLAY,
SAVE_GHOST,
};

char* D_800E7778[] = {
"VS MATCH RANKING",
"BATTLE RANKING",
Expand Down Expand Up @@ -2665,7 +2657,7 @@ Gfx* func_80095BD0(Gfx* displayListHead, u8* arg1, f32 arg2, f32 arg3, u32 arg4,
rmonPrintf("MAX effectcount(760) over!!!!(kawano)\n");
return displayListHead;
func_80095BD0_label2:
func_80095AE0(sp28, arg2, arg3, arg6, arg7);
func_80095AE0((void*) sp28, arg2, arg3, arg6, arg7);
gSPMatrix(displayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxEffect[gMatrixEffectCount]),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gMatrixEffectCount += 1;
Expand Down Expand Up @@ -2988,7 +2980,7 @@ GLOBAL_ASM("asm/non_matchings/code_80091750/func_80096CD8.s")

#ifdef NON_MATCHING
Gfx* func_80097274(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8,
s32 arg9, u16* argA, u32 argB, u32 argC, s32 argD) {
s32 arg9, UNUSED u16* argA, u32 argB, u32 argC, UNUSED s32 argD) {
u32 var_a1_2 = arg4;
u32 var_s3 = arg5;
s32 sp7C;
Expand Down Expand Up @@ -3061,7 +3053,7 @@ Gfx* func_80097274(Gfx* displayListHead, s8 arg1, s32 arg2, s32 arg3, s32 arg4,
var_s4 = temp_lo;
}

for (var_a1_2 = arg4; var_a1_2 < arg6; var_a1_2 += var_t0) {
for (var_a1_2 = arg4; var_a1_2 < (u32) arg6; var_a1_2 += var_t0) {

if (arg6 < var_t0 + var_a1_2) {
var_s2 = arg6 - var_a1_2;
Expand Down Expand Up @@ -3141,8 +3133,8 @@ Gfx* func_80097AE4(Gfx* displayListHead, s8 fmt, s32 arg2, s32 arg3, u8* arg4, s
return displayListHead;
}

Gfx* func_80097E58(Gfx* displayListHead, s8 fmt, u32 arg2, u32 arg3, u32 arg4, u32 arg5, s32 arg6, s32 arg7,
u8* someTexture, u32 arg9, u32 argA, s32 width) {
Gfx* func_80097E58(Gfx* displayListHead, s8 fmt, UNUSED u32 arg2, u32 arg3, UNUSED u32 arg4, u32 arg5, s32 arg6,
s32 arg7, u8* someTexture, u32 arg9, UNUSED u32 argA, s32 width) {
u32 ult;
u32 temp;
s32 arg6Copy;
Expand Down Expand Up @@ -4345,8 +4337,8 @@ Gfx* func_8009BC9C(Gfx* arg0, MenuTexture* arg1, s32 arg2, s32 arg3, s32 arg4, s
break;
case 4: /* switch 1 */
arg0 = func_80097274(arg0, 0, 0x00000400, 0x00000400, 0, 0, var_s0->width, var_s0->height,
var_s0->dX + arg2, var_s0->dY + arg3, temp_v0_3, var_s0->width, var_s0->height,
arg5);
var_s0->dX + arg2, var_s0->dY + arg3, (u16*) temp_v0_3, var_s0->width,
var_s0->height, arg5);
break;
}
}
Expand Down Expand Up @@ -6342,6 +6334,8 @@ void menu_item_render(MenuItem* arg0) {
GLOBAL_ASM("asm/non_matchings/code_80091750/menu_item_render.s")
#endif

// GLOBAL_ASM("print_rodata.S")

void func_800A08D8(u8 arg0, s32 column, s32 row) {
if (arg0 >= 0x10) {
arg0 -= 0x10;
Expand Down Expand Up @@ -8123,7 +8117,7 @@ void func_800A66A8(MenuItem* arg0, Unk_D_800E70A0* arg1) {
z2 += z1;

// clang-format off
if (x2); if (y2); if (z2);
if (x2) {}; if (y2) {}; if (z2) {};
// clang-format on

guScale(mtx, 1.2f, 1.2f, 1.2f);
Expand Down Expand Up @@ -8615,15 +8609,15 @@ void func_800A7A4C(s32 arg0) {
case CHARACTER_SELECT_MENU_WARIO: /* switch 8 */
case CHARACTER_SELECT_MENU_BOWSER: /* switch 8 */
func_800AAC18(var_s1);
switch (var_s1->type) { /* switch 7 */
case D_8018D9E0_TYPE_043: /* switch 7 */
case D_8018D9E0_TYPE_044: /* switch 7 */
case D_8018D9E0_TYPE_045: /* switch 7 */
case D_8018D9E0_TYPE_046: /* switch 7 */
case D_8018D9E0_TYPE_047: /* switch 7 */
case D_8018D9E0_TYPE_048: /* switch 7 */
case D_8018D9E0_TYPE_049: /* switch 7 */
case D_8018D9E0_TYPE_050: /* switch 7 */
switch (var_s1->type) { /* switch 7 */
case CHARACTER_SELECT_MENU_MARIO: /* switch 7 */
case CHARACTER_SELECT_MENU_LUIGI: /* switch 7 */
case CHARACTER_SELECT_MENU_TOAD: /* switch 7 */
case CHARACTER_SELECT_MENU_PEACH: /* switch 7 */
case CHARACTER_SELECT_MENU_YOSHI: /* switch 7 */
case CHARACTER_SELECT_MENU_DK: /* switch 7 */
case CHARACTER_SELECT_MENU_WARIO: /* switch 7 */
case CHARACTER_SELECT_MENU_BOWSER: /* switch 7 */
func_800AA69C(var_s1);
break;
}
Expand Down
13 changes: 5 additions & 8 deletions src/code_80091750.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,10 @@ enum D_8018D9E0_priority {
D_8018D9E0_PRIORITY_9,
D_8018D9E0_PRIORITY_A,
D_8018D9E0_PRIORITY_B,
D_8018D9E0_PRIORITY_C,
D_8018D9E0_PRIORITY_C
};

enum CenterText {
LEFT_TEXT = 1,
CENTER_TEXT_MODE_1,
RIGHT_TEXT,
CENTER_TEXT_MODE_2,
};
enum CenterText { LEFT_TEXT = 1, CENTER_TEXT_MODE_1, RIGHT_TEXT, CENTER_TEXT_MODE_2 };

enum D_8018D9E0_type {
D_8018D9E0_TYPE_NULL,
Expand Down Expand Up @@ -314,9 +309,11 @@ enum D_8018D9E0_type {
D_8018D9E0_TYPE_1CB,
D_8018D9E0_TYPE_1CC,
D_8018D9E0_TYPE_1CD,
D_8018D9E0_TYPE_1CE,
D_8018D9E0_TYPE_1CE
};

enum TEXT_MENU_ID { CONTINUE_GAME, RETRY, COURSE_CHANGE, DRIVER_CHANGE, QUIT_TEXT_MENU, REPLAY, SAVE_GHOST };

/* Function Prototypes */

f64 exponent_by_squaring(f64, s32);
Expand Down

0 comments on commit 0bca03b

Please sign in to comment.