From 59d6788c073d83ca3d2e213cc1d4432ed42785d2 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sun, 4 Jul 2021 13:54:21 -0700 Subject: [PATCH 01/18] Decompiled non-matching func_80072C54. --- src/controller_pak.c | 149 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) diff --git a/src/controller_pak.c b/src/controller_pak.c index b74fb724..a54edf70 100644 --- a/src/controller_pak.c +++ b/src/controller_pak.c @@ -117,7 +117,156 @@ void func_80072708(void) { } GLOBAL_ASM("asm/non_matchings/controller_pak/func_80072718.s") + +#ifdef NON_MATCHING +s32 func_80072C54(s32 arg0) { + // v0 v1 a1 a2 a3 t0 t1 t2 t3 t4 t5 t6 t7 t8 + u32 v0; + u32 v1; + s32 a1; + u32 a2; + u8 *a3; + s32 t0; + u32 *t1; + u32 *t2; + u8 **t3; + u32 t4; + u32 t5; + u32 t6; + u32 t7; + u32 t8; + u32 t9; + + v1 = 0; + if (arg0 <= 0) { + return v1; + } + // L80072C64 + v0 = 1 << (arg0 + 0x1F); + if (arg0 != 0) { + a1 = -(arg0 & 3); + t0 = a1 + arg0; + if (a1 != 0) { + // L80072CA0 + do { + a2 = D_801241F4; + a1 = arg0 - 1; + t6 = v0 >> 1; + if (a2 == 0) { + a3 = D_801241EC; + a2 = 0x80; + t8 = *a3; + D_801241EC = a3 + 1; + D_801241F4 = 0x80; + D_801241F0 = t8; + } + // L80072CCC + arg0 = a1; + if (D_801241F0 & a2 != 0) { + v1 |= v0; + } + // L80072CE4 + v0 = t6; + D_801241F4 = a2 >> 1; + } while (t0 != a1); + if (a1 == 0) { + return v1; // should jump to end + } + } + // L80072CF4 + t1 = &D_801241F4; + t2 = &D_801241F0; + t3 = &D_801241EC; + t4 = 128; + // L80072D10 + do { + a2 = *t1; + t6 = v0 >> 1; + arg0 -= 4; + if (a2 == 0) { + a3 = *t3; + a2 = t4; + t9 = *a3; + *t3 = a3 + 1; + *t1 = t4; + *t2 = t9; + } + // L80072D3C + a1 = *t2; + t8 = a2 << 1; + t7 = a1 & a2; + a2 = t8; + if (t7 != 0) { + v1 |= v0; + } + // L80072D54 + v0 = t6; + *t1 = t8; + if (t8 == 0) { + a3 = *t3; + a2 = t4; + a1 = *a3; + *t3 = a3 + 1; + *t1 = t4; + *t2 = a1; + } + // L80072D7C + t7 = a1 & a2; + t6 = v0 >> 1; + if (t7 != 0) { + v1 |= v0; + } + // L80072D8C + t8 = a2 >> 1; + *t1 = t8; + a2 = t8; + v0 = t6; + if (t8 == 0) { + a3 = *t3; + a2 = t4; + a1 = *a3; + *t3 = a3 + 1; + *t1 = t4; + *t2 = a1; + } + // L80072DBC + t7 = a1 & a2; + t6 = v0 >> 1; + if (t7 != 0) { + v1 |= v0; + } + // L80072DCC + t8 = a2 >> 1; + *t1 = t8; + a2 = t8; + v0 = t6; + if (t8 == 0) { + a3 = *t3; + a2 = t4; + a1 = *a3; + *t3 = a3 + 1; + *t1 = t4; + *t2 = a1; + } + // L80072DFC + t7 = a1 & a2; + t6 = v0 >> 1; + if (t7 != 0) { + v1 |= v0; + } + // L80072E0C + t8 = a2 >> 1; + *t1 = t8; + v0 = t6; + } while (arg0 != 0); + } + // L80072E1C + return v1; +} +#else GLOBAL_ASM("asm/non_matchings/controller_pak/func_80072C54.s") +#endif + GLOBAL_ASM("asm/non_matchings/controller_pak/func_80072E28.s") GLOBAL_ASM("asm/non_matchings/controller_pak/func_8007306C.s") GLOBAL_ASM("asm/non_matchings/controller_pak/func_800732E8.s") From dc42f58661a966c00e4ef9e12b4d36ca1c7902a9 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 24 Jul 2021 21:27:06 -0700 Subject: [PATCH 02/18] Added 2nd argument to func_800238BC. --- src/unknown_00BC20.c | 168 ++++++++++++++++++++++--------------------- 1 file changed, 86 insertions(+), 82 deletions(-) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 1c70d66d..a930c31b 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -1441,264 +1441,268 @@ void func_800235D0(s32 arg0) { GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_800235DC.s") +<<<<<<< HEAD void func_800238BC(Object *arg0) { +======= +void func_800238BC(Object *arg0, void *arg1) { +>>>>>>> Added 2nd argument to func_800238BC. arg0->unk48 = arg0->descriptor_ptr->unk54; switch (arg0->unk48 - 1) { case 0x00: - func_8004DAB0(arg0); + func_8004DAB0(arg0, arg1); break; case 0x01: - func_80033CC0(arg0); + func_80033CC0(arg0, arg1); break; case 0x02: - func_80036C30(arg0); + func_80036C30(arg0, arg1); break; case 0x03: - func_800376E0(arg0); + func_800376E0(arg0, arg1); break; case 0x05: - func_800389AC(arg0); + func_800389AC(arg0, arg1); break; case 0x18: - func_80038A6C(arg0); + func_80038A6C(arg0, arg1); break; case 0x15: - func_80038B74(arg0); + func_80038B74(arg0, arg1); break; case 0x06: - func_80038E3C(arg0); + func_80038E3C(arg0, arg1); break; case 0x07: - func_8003FD68(arg0); + func_8003FD68(arg0, arg1); break; case 0x08: case 0x12: - func_8003FEF4(arg0); + func_8003FEF4(arg0, arg1); break; case 0x1A: - func_8004001C(arg0); + func_8004001C(arg0, arg1); break; case 0x09: - func_80039160(arg0); + func_80039160(arg0, arg1); break; case 0x0A: - func_80039190(arg0); + func_80039190(arg0, arg1); break; case 0x0B: - func_800391C8(arg0); + func_800391C8(arg0, arg1); break; case 0x0C: - func_8003ACBC(arg0); + func_8003ACBC(arg0, arg1); break; case 0x1D: - func_8003AD34(arg0); + func_8003AD34(arg0, arg1); break; case 0x28: - func_8003B058(arg0); + func_8003B058(arg0, arg1); break; case 0x0D: - func_8003B7CC(arg0); + func_8003B7CC(arg0, arg1); break; case 0x6E: - func_8003C1E0(arg0); + func_8003C1E0(arg0, arg1); break; case 0x0E: - func_8003CF18(arg0); + func_8003CF18(arg0, arg1); break; case 0x0F: - func_8003CFE0(arg0); + func_8003CFE0(arg0, arg1); break; case 0x10: - func_8003DFCC(arg0); + func_8003DFCC(arg0, arg1); break; case 0x16: - func_8003E5B0(arg0); + func_8003E5B0(arg0, arg1); break; case 0x04: case 0x11: - func_8003E5C8(arg0); + func_8003E5C8(arg0, arg1); break; case 0x19: - func_8003CF58(arg0); + func_8003CF58(arg0, arg1); break; case 0x1B: - func_80034AF0(arg0); + func_80034AF0(arg0, arg1); break; case 0x1C: - func_800400A4(arg0); + func_800400A4(arg0, arg1); break; case 0x1E: - func_80036194(arg0); + func_80036194(arg0, arg1); break; case 0x1F: - func_8003D534(arg0); + func_8003D534(arg0, arg1); break; case 0x20: - func_800403A8(arg0); + func_800403A8(arg0, arg1); break; case 0x23: - func_800403D8(arg0); + func_800403D8(arg0, arg1); break; case 0x42: - func_8004049C(arg0); + func_8004049C(arg0, arg1); break; case 0x24: - func_80040800(arg0); + func_80040800(arg0, arg1); break; case 0x25: - func_8003C9EC(arg0); + func_8003C9EC(arg0, arg1); break; case 0x26: - func_8003CE64(arg0); + func_8003CE64(arg0, arg1); break; case 0x27: - func_8003CF00(arg0); + func_8003CF00(arg0, arg1); break; case 0x2A: - func_8004092C(arg0); + func_8004092C(arg0, arg1); break; case 0x2B: - func_8004094C(arg0); + func_8004094C(arg0, arg1); break; case 0x2C: - func_8003522C(arg0); + func_8003522C(arg0, arg1); break; case 0x2D: - func_80035640(arg0); + func_80035640(arg0, arg1); break; case 0x2E: - func_80035EF8(arg0); + func_80035EF8(arg0, arg1); break; case 0x30: - func_80037A18(arg0); + func_80037A18(arg0, arg1); break; case 0x33: - func_80038854(arg0); + func_80038854(arg0, arg1); break; case 0x36: - func_8003C644(arg0); + func_8003C644(arg0, arg1); break; case 0x38: case 0x5C: - func_8003588C(arg0); + func_8003588C(arg0, arg1); break; case 0x39: - func_80035E20(arg0); + func_80035E20(arg0, arg1); break; case 0x3A: - func_800409A4(arg0); + func_800409A4(arg0, arg1); break; case 0x3C: - func_800409C8(arg0); + func_800409C8(arg0, arg1); break; case 0x3D: - func_800392B8(arg0); + func_800392B8(arg0, arg1); break; case 0x3F: - func_8003DE74(arg0); + func_8003DE74(arg0, arg1); break; case 0x40: - func_8003D3EC(arg0); + func_8003D3EC(arg0, arg1); break; case 0x41: - func_8003D038(arg0); + func_8003D038(arg0, arg1); break; case 0x43: - func_80037578(arg0); + func_80037578(arg0, arg1); break; case 0x44: - func_80037624(arg0); + func_80037624(arg0, arg1); break; case 0x45: case 0x66: - func_8003818C(arg0); + func_8003818C(arg0, arg1); break; case 0x47: case 0x5E: case 0x67: - func_800381E0(arg0); + func_800381E0(arg0, arg1); break; case 0x5F: case 0x64: - func_80038214(arg0); + func_80038214(arg0, arg1); break; case 0x60: case 0x65: - func_80038248(arg0); + func_80038248(arg0, arg1); break; case 0x46: - func_80041A90(arg0); + func_80041A90(arg0, arg1); break; case 0x6F: - func_80041E80(arg0); + func_80041E80(arg0, arg1); break; case 0x75: - func_80042014(arg0); + func_80042014(arg0, arg1); break; case 0x48: - func_80034B68(arg0); + func_80034B68(arg0, arg1); break; case 0x49: - func_80034E70(arg0); + func_80034E70(arg0, arg1); break; case 0x4A: - func_8004203C(arg0); + func_8004203C(arg0, arg1); break; case 0x4B: - func_8003D2AC(arg0); + func_8003D2AC(arg0, arg1); break; case 0x4C: - func_8003B368(arg0); + func_8003B368(arg0, arg1); break; case 0x4D: - func_80034844(arg0); + func_80034844(arg0, arg1); break; case 0x4E: - func_80034530(arg0); + func_80034530(arg0, arg1); break; case 0x51: - func_80035AE8(arg0); + func_80035AE8(arg0, arg1); break; case 0x52: - func_80037D54(arg0); + func_80037D54(arg0, arg1); break; case 0x53: - func_80037D6C(arg0); + func_80037D6C(arg0, arg1); break; case 0x58: - func_8004210C(arg0); + func_8004210C(arg0, arg1); break; case 0x57: - func_8003DC5C(arg0); + func_8003DC5C(arg0, arg1); break; case 0x59: - func_80038AC8(arg0); + func_80038AC8(arg0, arg1); break; case 0x5D: - func_80042150(arg0); + func_80042150(arg0, arg1); break; case 0x61: - func_80038D58(arg0); + func_80038D58(arg0, arg1); break; case 0x62: case 0x63: - func_8003572C(arg0); + func_8003572C(arg0, arg1); break; case 0x68: - func_8004216C(arg0); + func_8004216C(arg0, arg1); break; case 0x6B: case 0x73: - func_80033F44(arg0); + func_80033F44(arg0, arg1); break; case 0x6C: - func_80042210(arg0); + func_80042210(arg0, arg1); break; case 0x6D: - func_8003DBA0(arg0); + func_8003DBA0(arg0, arg1); break; case 0x74: - func_80042A1C(arg0); + func_80042A1C(arg0, arg1); break; } } From cc8b39a13289e0dd82f6b7fdf7915492d8c36fae Mon Sep 17 00:00:00 2001 From: Antonio Date: Sun, 25 Jul 2021 13:41:05 -0700 Subject: [PATCH 03/18] Decompiled non-matching func_8003DFCC. --- src/unknown_00BC20.c | 4 ---- src/unknown_00BC20.h | 2 +- src/unknown_0348C0.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index a930c31b..f88ceae4 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -1441,11 +1441,7 @@ void func_800235D0(s32 arg0) { GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_800235DC.s") -<<<<<<< HEAD -void func_800238BC(Object *arg0) { -======= void func_800238BC(Object *arg0, void *arg1) { ->>>>>>> Added 2nd argument to func_800238BC. arg0->unk48 = arg0->descriptor_ptr->unk54; switch (arg0->unk48 - 1) { case 0x00: diff --git a/src/unknown_00BC20.h b/src/unknown_00BC20.h index 571e2833..833fb3bf 100644 --- a/src/unknown_00BC20.h +++ b/src/unknown_00BC20.h @@ -211,7 +211,7 @@ s8 func_8002341C(void); s32 func_80023568(void); s8 func_800235C0(void); void func_800235D0(s32 arg0); -void func_800238BC(Object *arg0); +void func_800238BC(Object *arg0, void *arg1); void run_object_loop_func(Object *obj, s32 arg1); void func_8002458C(s32 arg0); s16 *func_80024594(s32 *arg0, s32 *arg1); diff --git a/src/unknown_0348C0.c b/src/unknown_0348C0.c index a906c5e0..d5eca7eb 100644 --- a/src/unknown_0348C0.c +++ b/src/unknown_0348C0.c @@ -1184,7 +1184,60 @@ void obj_loop_world_key(Object *worldKeyObj, s32 speed) { worldKeyObj->y_rotation += speed * 256; } +#ifdef NON_MATCHING +typedef struct unknown_struct_8003DFCC { + u8 pad0[8]; + u8 unk8; + u8 unk9; + u8 unkA; +} unknown_struct_8003DFCC; + +void func_8003DFCC(Object *arg0, unknown_struct_8003DFCC *arg1) { + f32 temp_f0; + s32 temp_v0; + Object_64 *temp_v0_2; + f32 phi_f0; + + arg0->unk4C->unk14 = 2; + arg0->unk4C->unk11 = 4; + arg0->unk4C->unk10 = 0x14; + temp_v0 = get_filtered_cheats(); + if (temp_v0 & 0x20000) { + arg1->unk9 = 0U; + } else if (temp_v0 & 0x08000) { + arg1->unk9 = 1U; + } else if (temp_v0 & 0x10000) { + arg1->unk9 = 2U; + } else if (temp_v0 & 0x40000) { + arg1->unk9 = 3U; + } else if (temp_v0 & 0x80000) { + arg1->unk9 = 4U; + } + if ((s32) arg1->unk8 >= 6) { + arg1->unk8 = 0U; + } + if ((s32) arg0->unk3A >= (s32) arg0->descriptor_ptr->unk55) { + arg0->unk3A = 0; + } + arg0->unk3A = (s8) arg1->unk9; + arg0->unk78 = (s32) arg0->unk3A; + phi_f0 = arg1->unkA; + if (arg1->unkA < 10.0f) { + phi_f0 = 10.0f; + } + temp_f0 = phi_f0 / 64.0f; + arg0->scale = (f32) (arg0->descriptor_ptr->unkC * temp_f0); + arg0->unk64->unk4 = 0; + arg0->unk64->unk0_a.unk0 = arg0->scale; + arg0->unk7C.word = 0; + if ((get_filtered_cheats() & 0x800) != 0) { + gParticlePtrList_addObject(arg0); + } +} +#else GLOBAL_ASM("asm/non_matchings/unknown_032760/func_8003DFCC.s") +#endif + GLOBAL_ASM("asm/non_matchings/unknown_032760/func_8003E140.s") void func_8003E5B0(s32 arg0, s32 arg1) { From 20218089a85b37d1663c4a64c0192ec8ec8920b7 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 9 Sep 2021 20:08:49 -0700 Subject: [PATCH 04/18] Decompiled non-matching func_80023E30. --- src/unknown_00BC20.c | 104 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index f88ceae4..07b19730 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -1703,7 +1703,111 @@ void func_800238BC(Object *arg0, void *arg1) { } } +#ifdef NON_MATCHING +s32 func_80023E30(s32 arg0) { + switch (arg0 - 1) { + case 0x00: + return 0x1F; + case 0x01: + return 0x13; + case 0x04: + return 0x16; + case 0x0B: + return 0x1B; + case 0x0D: + case 0x6E: + return 0x30; + case 0x10: + case 0x4C: + return 0x12; + case 0x45: + case 0x47: + case 0x5F: + case 0x60: + return 0x3B; + case 0x64: + case 0x65: + case 0x66: + case 0x67: + return 0x3A; + case 0x17: + return 0x04; + case 0x1E: + return 0x1B; + case 0x1F: + case 0x3F: + case 0x57: + case 0x6D: + return 0x12; + case 0x42: + return 0x30; + case 0x25: + return 0x39; + case 0x26: + return 0x12; + case 0x27: + return 0x09; + case 0x2C: + return 0x12; + case 0x2F: + return 0x09; + case 0x3E: + return 0x09; + case 0x31: + case 0x37: + case 0x4F: + case 0x53: + case 0x55: + case 0x72: + return 0x0B; + case 0x35: + return 0x0B; + case 0x49: + case 0x5E: + case 0x62: + case 0x63: + return 0x31; + case 0x5A: + return 0x01; + case 0x50: + return 0x0A; + case 0x06: + case 0x0C: + case 0x11: + case 0x19: + case 0x1D: + case 0x23: + case 0x28: + case 0x33: + case 0x36: + case 0x38: + case 0x43: + case 0x4D: + case 0x4E: + case 0x5C: + case 0x61: + case 0x6B: + case 0x73: + return 0x10; + case 0x51: + return 0x12; + case 0x30: + case 0x32: + case 0x3C: + return 0x02; + case 0x3D: + return 0x1B; + case 0x6C: + return 0x0B; + case 0x71: + return 0x01; + default: + return 0x00; + } +} +#else GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_80023E30.s") +#endif void run_object_loop_func(Object *obj, s32 arg1) { func_800B76B8(1, obj->unk4A); From fd91f18e921b3187e8874dcc1146a696aeaec9b9 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 9 Sep 2021 19:09:10 -0700 Subject: [PATCH 05/18] Decompiled func_8000E2B4. --- src/unknown_00BC20.c | 87 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 07b19730..9aa95ea9 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -601,6 +601,93 @@ void func_8000E1EC(Object *object, s32 arg1) { } GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_8000E2B4.s") +<<<<<<< HEAD +======= +#else +typedef struct LevelObjectEntry8000E2B4 { + struct LevelObjectEntryCommonSplit { + u8 object_id;//2c + u8 size;//2d + s16 x, y, z;//2e,30,32 + } common; + s16 unk8;//34 + s16 unkA;//36 + s16 unkC;//38 + s16 unkE;//3a +} LevelObjectEntry8000E2B4; + +void func_8000E2B4(void) { + LevelObjectEntry8000E2B4 sp2C; + Settings *settings; + Object *player; + Object_64 *player_64; +<<<<<<< HEAD + s16 object_id; +======= + s16 phi_v1; +>>>>>>> Decompiled func_8000E2B4. + + if (D_8011AD44 == 0) { + return; + } + D_8011AD44 = (s8) (D_8011AD44 - 1); + if (D_8011AD44 != 0) { + return; + } + settings = get_settings(); + sp2C.unkE = 0; + sp2C.common.size = 0x10; + if (D_8011AD45 < 5) { +<<<<<<< HEAD + object_id = ((s16*)D_800DC7A8)[settings->racers[0].character + D_8011AD45 * 10]; + } else { + object_id = D_800DC800[D_8011AD45 + 37]; + } + func_8006DB14(D_8011AD45); + sp2C.common.size = sp2C.common.size | ((s32) (object_id & 0x100) >> 1); + sp2C.unkA = 0; + sp2C.unk8 = 0; + sp2C.common.object_id = (s8) object_id; +======= + phi_v1 = ((s16*)D_800DC7A8)[settings->racers[0].character + D_8011AD45 * 10]; + } else { + phi_v1 = D_800DC800[D_8011AD45 + 37]; + } + func_8006DB14(D_8011AD45); + sp2C.common.size = sp2C.common.size | ((s32) (phi_v1 & 0x100) >> 1); + sp2C.unkA = 0; + sp2C.unk8 = 0; + sp2C.common.object_id = (s8) phi_v1; +>>>>>>> Decompiled func_8000E2B4. + sp2C.common.x = D_8011AD46; + sp2C.common.y = D_8011AD48; + sp2C.common.z = D_8011AD4A; + sp2C.unkC = D_8011AD4C; + func_800521B8(1); + player = func_8000EA54(&sp2C, 0x11); + gObjectCount = 1; + (*gObjectStructArrayPtr)[0] = (s32) player; + *D_8011AEEC = (s32) player; + *D_8011AEE8 = (s32) player; + player_64 = player->unk64; + player_64->unk1D6 = (s8) D_8011AD45; + player_64->unk0_a.unk0_b.unk2 = (u8)0; + player_64->unk1D7 = (s8) D_8011AD45; + player_64->unk0_a.unk0_b.unk0 = (u16)0; + player_64->unk118 = 0; + player_64->unk0_a.unk0_b.unk3 = (s8) settings->racers[0].character; + if ((get_filtered_cheats() & 0x10) != 0) { + player->scale *= 1.4f; + } + if ((get_filtered_cheats() & 0x20) != 0) { + player->scale *= 0.714f; + } + player->unk3C_a.unk3C = 0; + player->y_rotation = D_8011AD4C; + player->y_position = D_8011AD48; +} +#endif +>>>>>>> c0e8460... Decompiled func_8000E2B4. /** * Enables or Disables time trial mode. From 074fe8bf4b4d8d6bac2a738f01859d3cff1d8f57 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 28 Oct 2021 22:50:19 -0700 Subject: [PATCH 06/18] Decompiled non-matching func_8000E2B4. --- include/structs.h | 3 ++- src/unknown_00BC20.c | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/structs.h b/include/structs.h index f19d4c1a..41a5bf66 100644 --- a/include/structs.h +++ b/include/structs.h @@ -450,7 +450,8 @@ typedef struct LevelModel { /* Size: 8 bytes. */ typedef struct LevelObjectEntryCommon { - u16 id; // Upper 9 bits = Object ID to load, Lower 7 bits = Total entry length. + u8 object_id; // 9-bit object ID to load (uses size'a MSB). + u8 size; // 7-bit total entry length (MSB is used in object_id). s16 x, y, z; // Position in level } LevelObjectEntryCommon; diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 9aa95ea9..89aa151b 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -600,20 +600,20 @@ void func_8000E1EC(Object *object, s32 arg1) { gObjectCount = 0; } +<<<<<<< HEAD GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_8000E2B4.s") <<<<<<< HEAD ======= #else +======= +#ifdef NON_MATCHING +>>>>>>> 935635f... Decompiled non-matching func_8000E2B4. typedef struct LevelObjectEntry8000E2B4 { - struct LevelObjectEntryCommonSplit { - u8 object_id;//2c - u8 size;//2d - s16 x, y, z;//2e,30,32 - } common; - s16 unk8;//34 - s16 unkA;//36 - s16 unkC;//38 - s16 unkE;//3a + LevelObjectEntryCommon common; + s16 unk8; + s16 unkA; + s16 unkC; + s16 unkE; } LevelObjectEntry8000E2B4; void func_8000E2B4(void) { @@ -641,7 +641,7 @@ void func_8000E2B4(void) { <<<<<<< HEAD object_id = ((s16*)D_800DC7A8)[settings->racers[0].character + D_8011AD45 * 10]; } else { - object_id = D_800DC800[D_8011AD45 + 37]; + object_id = D_800DC7B8[D_8011AD45 + 37]; } func_8006DB14(D_8011AD45); sp2C.common.size = sp2C.common.size | ((s32) (object_id & 0x100) >> 1); @@ -686,6 +686,8 @@ void func_8000E2B4(void) { player->y_rotation = D_8011AD4C; player->y_position = D_8011AD48; } +#else +GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_8000E2B4.s") #endif >>>>>>> c0e8460... Decompiled func_8000E2B4. From d92f002bcad5266b5c64f9854f96a1b6b13ce053 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sun, 7 Nov 2021 21:02:45 -0800 Subject: [PATCH 07/18] Fixed some merge conflicts. --- src/unknown_00BC20.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 89aa151b..794f4dd4 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -600,14 +600,7 @@ void func_8000E1EC(Object *object, s32 arg1) { gObjectCount = 0; } -<<<<<<< HEAD -GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_8000E2B4.s") -<<<<<<< HEAD -======= -#else -======= #ifdef NON_MATCHING ->>>>>>> 935635f... Decompiled non-matching func_8000E2B4. typedef struct LevelObjectEntry8000E2B4 { LevelObjectEntryCommon common; s16 unk8; @@ -621,11 +614,7 @@ void func_8000E2B4(void) { Settings *settings; Object *player; Object_64 *player_64; -<<<<<<< HEAD s16 object_id; -======= - s16 phi_v1; ->>>>>>> Decompiled func_8000E2B4. if (D_8011AD44 == 0) { return; @@ -638,7 +627,6 @@ void func_8000E2B4(void) { sp2C.unkE = 0; sp2C.common.size = 0x10; if (D_8011AD45 < 5) { -<<<<<<< HEAD object_id = ((s16*)D_800DC7A8)[settings->racers[0].character + D_8011AD45 * 10]; } else { object_id = D_800DC7B8[D_8011AD45 + 37]; @@ -648,17 +636,6 @@ void func_8000E2B4(void) { sp2C.unkA = 0; sp2C.unk8 = 0; sp2C.common.object_id = (s8) object_id; -======= - phi_v1 = ((s16*)D_800DC7A8)[settings->racers[0].character + D_8011AD45 * 10]; - } else { - phi_v1 = D_800DC800[D_8011AD45 + 37]; - } - func_8006DB14(D_8011AD45); - sp2C.common.size = sp2C.common.size | ((s32) (phi_v1 & 0x100) >> 1); - sp2C.unkA = 0; - sp2C.unk8 = 0; - sp2C.common.object_id = (s8) phi_v1; ->>>>>>> Decompiled func_8000E2B4. sp2C.common.x = D_8011AD46; sp2C.common.y = D_8011AD48; sp2C.common.z = D_8011AD4A; @@ -689,7 +666,6 @@ void func_8000E2B4(void) { #else GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_8000E2B4.s") #endif ->>>>>>> c0e8460... Decompiled func_8000E2B4. /** * Enables or Disables time trial mode. From e016e79f2d4b9203dcfa0f0df22b58a73aed8bf3 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 13 Nov 2021 00:03:32 -0800 Subject: [PATCH 08/18] Updated struct definition containing savefile info. --- asm/non_matchings/menu/func_8008D5F8.s | 4 +- asm/non_matchings/menu/func_8008D8BC.s | 12 +++--- asm/non_matchings/menu/func_8008DC7C.s | 8 ++-- .../menu/menu_file_select_loop.s | 16 +++---- .../menu/render_file_select_menu.s | 12 +++--- src/menu.c | 42 ++++++++----------- src/menu.h | 10 ++--- 7 files changed, 48 insertions(+), 56 deletions(-) diff --git a/asm/non_matchings/menu/func_8008D5F8.s b/asm/non_matchings/menu/func_8008D5F8.s index 2e83e3c0..d3955340 100644 --- a/asm/non_matchings/menu/func_8008D5F8.s +++ b/asm/non_matchings/menu/func_8008D5F8.s @@ -47,11 +47,11 @@ glabel func_8008D5F8 /* 08E2A8 8008D6A8 00000000 */ nop .L8008D6AC: /* 08E2AC 8008D6AC 8D6C0000 */ lw $t4, ($t3) -/* 08E2B0 8008D6B0 3C0E8012 */ lui $t6, %hi(D_801264A0) # $t6, 0x8012 +/* 08E2B0 8008D6B0 3C0E8012 */ lui $t6, %hi(gSavefileInfo) # $t6, 0x8012 /* 08E2B4 8008D6B4 000C6880 */ sll $t5, $t4, 2 /* 08E2B8 8008D6B8 01AC6823 */ subu $t5, $t5, $t4 /* 08E2BC 8008D6BC 000D6880 */ sll $t5, $t5, 2 -/* 08E2C0 8008D6C0 25CE64A0 */ addiu $t6, %lo(D_801264A0) # addiu $t6, $t6, 0x64a0 +/* 08E2C0 8008D6C0 25CE64A0 */ addiu $t6, %lo(gSavefileInfo) # addiu $t6, $t6, 0x64a0 /* 08E2C4 8008D6C4 01AE1021 */ addu $v0, $t5, $t6 /* 08E2C8 8008D6C8 904F0001 */ lbu $t7, 1($v0) /* 08E2CC 8008D6CC 3C18800E */ lui $t8, %hi(gIsInAdventureTwo) # $t8, 0x800e diff --git a/asm/non_matchings/menu/func_8008D8BC.s b/asm/non_matchings/menu/func_8008D8BC.s index 7fe2f4d7..4e3c9524 100644 --- a/asm/non_matchings/menu/func_8008D8BC.s +++ b/asm/non_matchings/menu/func_8008D8BC.s @@ -45,8 +45,8 @@ glabel func_8008D8BC /* 08E560 8008D960 8C490000 */ lw $t1, ($v0) /* 08E564 8008D964 2403000C */ li $v1, 12 /* 08E568 8008D968 01230019 */ multu $t1, $v1 -/* 08E56C 8008D96C 3C088012 */ lui $t0, %hi(D_801264A0) # $t0, 0x8012 -/* 08E570 8008D970 250864A0 */ addiu $t0, %lo(D_801264A0) # addiu $t0, $t0, 0x64a0 +/* 08E56C 8008D96C 3C088012 */ lui $t0, %hi(gSavefileInfo) # $t0, 0x8012 +/* 08E570 8008D970 250864A0 */ addiu $t0, %lo(gSavefileInfo) # addiu $t0, $t0, 0x64a0 /* 08E574 8008D974 240400EF */ li $a0, 239 /* 08E578 8008D978 00005012 */ mflo $t2 /* 08E57C 8008D97C 010A5821 */ addu $t3, $t0, $t2 @@ -125,8 +125,8 @@ glabel func_8008D8BC /* 08E688 8008DA88 8CCB0000 */ lw $t3, ($a2) /* 08E68C 8008DA8C 2403000C */ li $v1, 12 /* 08E690 8008DA90 01630019 */ multu $t3, $v1 -/* 08E694 8008DA94 3C088012 */ lui $t0, %hi(D_801264A0) # $t0, 0x8012 -/* 08E698 8008DA98 250864A0 */ addiu $t0, %lo(D_801264A0) # addiu $t0, $t0, 0x64a0 +/* 08E694 8008DA94 3C088012 */ lui $t0, %hi(gSavefileInfo) # $t0, 0x8012 +/* 08E698 8008DA98 250864A0 */ addiu $t0, %lo(gSavefileInfo) # addiu $t0, $t0, 0x64a0 /* 08E69C 8008DA9C 00002825 */ move $a1, $zero /* 08E6A0 8008DAA0 24040241 */ li $a0, 577 /* 08E6A4 8008DAA4 00006012 */ mflo $t4 @@ -185,8 +185,8 @@ glabel func_8008D8BC /* 08E764 8008DB64 8CC70000 */ lw $a3, ($a2) /* 08E768 8008DB68 2403000C */ li $v1, 12 /* 08E76C 8008DB6C 00E30019 */ multu $a3, $v1 -/* 08E770 8008DB70 3C088012 */ lui $t0, %hi(D_801264A0) # $t0, 0x8012 -/* 08E774 8008DB74 250864A0 */ addiu $t0, %lo(D_801264A0) # addiu $t0, $t0, 0x64a0 +/* 08E770 8008DB70 3C088012 */ lui $t0, %hi(gSavefileInfo) # $t0, 0x8012 +/* 08E774 8008DB74 250864A0 */ addiu $t0, %lo(gSavefileInfo) # addiu $t0, $t0, 0x64a0 /* 08E778 8008DB78 8FA5001C */ lw $a1, 0x1c($sp) /* 08E77C 8008DB7C 24040001 */ li $a0, 1 /* 08E780 8008DB80 00074880 */ sll $t1, $a3, 2 diff --git a/asm/non_matchings/menu/func_8008DC7C.s b/asm/non_matchings/menu/func_8008DC7C.s index 155e3040..e8e95756 100644 --- a/asm/non_matchings/menu/func_8008DC7C.s +++ b/asm/non_matchings/menu/func_8008DC7C.s @@ -41,12 +41,12 @@ glabel func_8008DC7C /* 08E910 8008DD10 3C068012 */ lui $a2, %hi(D_8012648C) # $a2, 0x8012 /* 08E914 8008DD14 24C6648C */ addiu $a2, %lo(D_8012648C) # addiu $a2, $a2, 0x648c /* 08E918 8008DD18 8CC90000 */ lw $t1, ($a2) -/* 08E91C 8008DD1C 3C0B8012 */ lui $t3, %hi(D_801264A0+1) # $t3, 0x8012 +/* 08E91C 8008DD1C 3C0B8012 */ lui $t3, %hi(gSavefileInfo+1) # $t3, 0x8012 /* 08E920 8008DD20 00095080 */ sll $t2, $t1, 2 /* 08E924 8008DD24 01495023 */ subu $t2, $t2, $t1 /* 08E928 8008DD28 000A5080 */ sll $t2, $t2, 2 /* 08E92C 8008DD2C 016A5821 */ addu $t3, $t3, $t2 -/* 08E930 8008DD30 916B64A1 */ lbu $t3, %lo(D_801264A0+1)($t3) +/* 08E930 8008DD30 916B64A1 */ lbu $t3, %lo(gSavefileInfo+1)($t3) /* 08E934 8008DD34 00002825 */ move $a1, $zero /* 08E938 8008DD38 11600007 */ beqz $t3, .L8008DD58 /* 08E93C 8008DD3C 24040241 */ li $a0, 577 @@ -97,11 +97,11 @@ glabel func_8008DC7C /* 08E9DC 8008DDDC 3C068012 */ lui $a2, %hi(D_8012648C) # $a2, 0x8012 /* 08E9E0 8008DDE0 24C6648C */ addiu $a2, %lo(D_8012648C) # addiu $a2, $a2, 0x648c /* 08E9E4 8008DDE4 8CC30000 */ lw $v1, ($a2) -/* 08E9E8 8008DDE8 3C198012 */ lui $t9, %hi(D_801264A0) # $t9, 0x8012 +/* 08E9E8 8008DDE8 3C198012 */ lui $t9, %hi(gSavefileInfo) # $t9, 0x8012 /* 08E9EC 8008DDEC 0003C080 */ sll $t8, $v1, 2 /* 08E9F0 8008DDF0 0303C023 */ subu $t8, $t8, $v1 /* 08E9F4 8008DDF4 0018C080 */ sll $t8, $t8, 2 -/* 08E9F8 8008DDF8 273964A0 */ addiu $t9, %lo(D_801264A0) # addiu $t9, $t9, 0x64a0 +/* 08E9F8 8008DDF8 273964A0 */ addiu $t9, %lo(gSavefileInfo) # addiu $t9, $t9, 0x64a0 /* 08E9FC 8008DDFC 03191021 */ addu $v0, $t8, $t9 /* 08EA00 8008DE00 24080044 */ li $t0, 68 /* 08EA04 8008DE04 2409004B */ li $t1, 75 diff --git a/asm/non_matchings/menu/menu_file_select_loop.s b/asm/non_matchings/menu/menu_file_select_loop.s index 366e9ef2..595791cb 100644 --- a/asm/non_matchings/menu/menu_file_select_loop.s +++ b/asm/non_matchings/menu/menu_file_select_loop.s @@ -17,10 +17,10 @@ glabel menu_file_select_loop /* 08EAAC 8008DEAC 00004025 */ move $t0, $zero /* 08EAB0 8008DEB0 29E10003 */ slti $at, $t7, 3 /* 08EAB4 8008DEB4 14200030 */ bnez $at, .L8008DF78 -/* 08EAB8 8008DEB8 3C028012 */ lui $v0, %hi(D_801264A0) # $v0, 0x8012 +/* 08EAB8 8008DEB8 3C028012 */ lui $v0, %hi(gSavefileInfo) # $v0, 0x8012 /* 08EABC 8008DEBC 3C078012 */ lui $a3, %hi(D_80126530) # $a3, 0x8012 /* 08EAC0 8008DEC0 24E76530 */ addiu $a3, %lo(D_80126530) # addiu $a3, $a3, 0x6530 -/* 08EAC4 8008DEC4 244264A0 */ addiu $v0, %lo(D_801264A0) # addiu $v0, $v0, 0x64a0 +/* 08EAC4 8008DEC4 244264A0 */ addiu $v0, %lo(gSavefileInfo) # addiu $v0, $v0, 0x64a0 .L8008DEC8: /* 08EAC8 8008DEC8 8CE30000 */ lw $v1, ($a3) /* 08EACC 8008DECC A0400000 */ sb $zero, ($v0) @@ -143,8 +143,8 @@ glabel menu_file_select_loop /* 08EC7C 8008E07C 00086880 */ sll $t5, $t0, 2 /* 08EC80 8008E080 15800012 */ bnez $t4, .L8008E0CC /* 08EC84 8008E084 01A86823 */ subu $t5, $t5, $t0 -/* 08EC88 8008E088 3C0E8012 */ lui $t6, %hi(D_801264A0) # $t6, 0x8012 -/* 08EC8C 8008E08C 25CE64A0 */ addiu $t6, %lo(D_801264A0) # addiu $t6, $t6, 0x64a0 +/* 08EC88 8008E088 3C0E8012 */ lui $t6, %hi(gSavefileInfo) # $t6, 0x8012 +/* 08EC8C 8008E08C 25CE64A0 */ addiu $t6, %lo(gSavefileInfo) # addiu $t6, $t6, 0x64a0 /* 08EC90 8008E090 000D6880 */ sll $t5, $t5, 2 /* 08EC94 8008E094 01AE1021 */ addu $v0, $t5, $t6 /* 08EC98 8008E098 0C02607A */ jal func_800981E8 @@ -170,12 +170,12 @@ glabel menu_file_select_loop /* 08ECE4 8008E0E4 00000000 */ nop /* 08ECE8 8008E0E8 3C0C800E */ lui $t4, %hi(gSaveFileIndex) # $t4, 0x800e /* 08ECEC 8008E0EC 8D8CF4CC */ lw $t4, %lo(gSaveFileIndex)($t4) -/* 08ECF0 8008E0F0 3C0E8012 */ lui $t6, %hi(D_801264A0) # $t6, 0x8012 +/* 08ECF0 8008E0F0 3C0E8012 */ lui $t6, %hi(gSavefileInfo) # $t6, 0x8012 /* 08ECF4 8008E0F4 000C6880 */ sll $t5, $t4, 2 /* 08ECF8 8008E0F8 01AC6823 */ subu $t5, $t5, $t4 /* 08ECFC 8008E0FC 3C018012 */ lui $at, %hi(D_80126CC0) # $at, 0x8012 /* 08ED00 8008E100 000D6880 */ sll $t5, $t5, 2 -/* 08ED04 8008E104 25CE64A0 */ addiu $t6, %lo(D_801264A0) # addiu $t6, $t6, 0x64a0 +/* 08ED04 8008E104 25CE64A0 */ addiu $t6, %lo(gSavefileInfo) # addiu $t6, $t6, 0x64a0 /* 08ED08 8008E108 AC206CC0 */ sw $zero, %lo(D_80126CC0)($at) /* 08ED0C 8008E10C 01AE1021 */ addu $v0, $t5, $t6 /* 08ED10 8008E110 A0400000 */ sb $zero, ($v0) @@ -214,11 +214,11 @@ glabel menu_file_select_loop /* 08ED8C 8008E18C 18400036 */ blez $v0, .L8008E268 /* 08ED90 8008E190 3C09800E */ lui $t1, %hi(gSaveFileIndex) # $t1, 0x800e /* 08ED94 8008E194 8D29F4CC */ lw $t1, %lo(gSaveFileIndex)($t1) -/* 08ED98 8008E198 3C0F8012 */ lui $t7, %hi(D_801264A0) # $t7, 0x8012 +/* 08ED98 8008E198 3C0F8012 */ lui $t7, %hi(gSavefileInfo) # $t7, 0x8012 /* 08ED9C 8008E19C 00097080 */ sll $t6, $t1, 2 /* 08EDA0 8008E1A0 01C97023 */ subu $t6, $t6, $t1 /* 08EDA4 8008E1A4 000E7080 */ sll $t6, $t6, 2 -/* 08EDA8 8008E1A8 25EF64A0 */ addiu $t7, %lo(D_801264A0) # addiu $t7, $t7, 0x64a0 +/* 08EDA8 8008E1A8 25EF64A0 */ addiu $t7, %lo(gSavefileInfo) # addiu $t7, $t7, 0x64a0 /* 08EDAC 8008E1AC 01CF1021 */ addu $v0, $t6, $t7 /* 08EDB0 8008E1B0 90580001 */ lbu $t8, 1($v0) /* 08EDB4 8008E1B4 3C0B800E */ lui $t3, %hi(D_800E0FB0) # $t3, 0x800e diff --git a/asm/non_matchings/menu/render_file_select_menu.s b/asm/non_matchings/menu/render_file_select_menu.s index 94fded8f..a0aee289 100644 --- a/asm/non_matchings/menu/render_file_select_menu.s +++ b/asm/non_matchings/menu/render_file_select_menu.s @@ -26,7 +26,7 @@ glabel render_file_select_menu /* 08D9CC 8008CDCC 24A563A8 */ addiu $a1, %lo(D_801263A8) # addiu $a1, $a1, 0x63a8 /* 08D9D0 8008CDD0 0C019FCB */ jal func_80067F2C /* 08D9D4 8008CDD4 02E02025 */ move $a0, $s7 -/* 08D9D8 8008CDD8 3C118012 */ lui $s1, %hi(D_801264A0) # $s1, 0x8012 +/* 08D9D8 8008CDD8 3C118012 */ lui $s1, %hi(gSavefileInfo) # $s1, 0x8012 /* 08D9DC 8008CDDC 3C10800E */ lui $s0, %hi(D_800E03CC) # $s0, 0x800e /* 08D9E0 8008CDE0 3C158012 */ lui $s5, %hi(D_80126550) # $s5, 0x8012 /* 08D9E4 8008CDE4 3C13B0E0 */ lui $s3, (0xB0E0C0FF >> 16) # lui $s3, 0xb0e0 @@ -35,7 +35,7 @@ glabel render_file_select_menu /* 08D9F0 8008CDF0 3673C0FF */ ori $s3, (0xB0E0C0FF & 0xFFFF) # ori $s3, $s3, 0xc0ff /* 08D9F4 8008CDF4 26B56550 */ addiu $s5, %lo(D_80126550) # addiu $s5, $s5, 0x6550 /* 08D9F8 8008CDF8 261003CC */ addiu $s0, %lo(D_800E03CC) # addiu $s0, $s0, 0x3cc -/* 08D9FC 8008CDFC 263164A0 */ addiu $s1, %lo(D_801264A0) # addiu $s1, $s1, 0x64a0 +/* 08D9FC 8008CDFC 263164A0 */ addiu $s1, %lo(gSavefileInfo) # addiu $s1, $s1, 0x64a0 /* 08DA00 8008CE00 24140078 */ li $s4, 120 .L8008CE04: /* 08DA04 8008CE04 8E4F0000 */ lw $t7, ($s2) @@ -86,14 +86,14 @@ glabel render_file_select_menu /* 08DAB0 8008CEB0 00003025 */ move $a2, $zero /* 08DAB4 8008CEB4 0C0310F3 */ jal set_text_background_color /* 08DAB8 8008CEB8 00003825 */ move $a3, $zero -/* 08DABC 8008CEBC 3C118012 */ lui $s1, %hi(D_801264A0) # $s1, 0x8012 +/* 08DABC 8008CEBC 3C118012 */ lui $s1, %hi(gSavefileInfo) # $s1, 0x8012 /* 08DAC0 8008CEC0 3C10800E */ lui $s0, %hi(D_800E03CC) # $s0, 0x800e /* 08DAC4 8008CEC4 3C14800E */ lui $s4, %hi(D_800E03FC) # $s4, 0x800e /* 08DAC8 8008CEC8 3C13800E */ lui $s3, %hi(D_800DF75C) # $s3, 0x800e /* 08DACC 8008CECC 2673F75C */ addiu $s3, %lo(D_800DF75C) # addiu $s3, $s3, -0x8a4 /* 08DAD0 8008CED0 269403FC */ addiu $s4, %lo(D_800E03FC) # addiu $s4, $s4, 0x3fc /* 08DAD4 8008CED4 261003CC */ addiu $s0, %lo(D_800E03CC) # addiu $s0, $s0, 0x3cc -/* 08DAD8 8008CED8 263164A0 */ addiu $s1, %lo(D_801264A0) # addiu $s1, $s1, 0x64a0 +/* 08DAD8 8008CED8 263164A0 */ addiu $s1, %lo(gSavefileInfo) # addiu $s1, $s1, 0x64a0 /* 08DADC 8008CEDC 2415000A */ li $s5, 10 .L8008CEE0: /* 08DAE0 8008CEE0 922F0001 */ lbu $t7, 1($s1) @@ -350,8 +350,8 @@ glabel render_file_select_menu /* 08DE90 8008D290 126A0021 */ beq $s3, $t2, .L8008D318 .L8008D294: /* 08DE94 8008D294 01735823 */ subu $t3, $t3, $s3 -/* 08DE98 8008D298 3C0C8012 */ lui $t4, %hi(D_801264A0) # $t4, 0x8012 -/* 08DE9C 8008D29C 258C64A0 */ addiu $t4, %lo(D_801264A0) # addiu $t4, $t4, 0x64a0 +/* 08DE98 8008D298 3C0C8012 */ lui $t4, %hi(gSavefileInfo) # $t4, 0x8012 +/* 08DE9C 8008D29C 258C64A0 */ addiu $t4, %lo(gSavefileInfo) # addiu $t4, $t4, 0x64a0 /* 08DEA0 8008D2A0 000B5880 */ sll $t3, $t3, 2 /* 08DEA4 8008D2A4 016C8821 */ addu $s1, $t3, $t4 /* 08DEA8 8008D2A8 26240004 */ addiu $a0, $s1, 4 diff --git a/src/menu.c b/src/menu.c index 66c16a29..d850f2ed 100644 --- a/src/menu.c +++ b/src/menu.c @@ -89,7 +89,7 @@ s32 D_80126494; s32 D_80126498; s32 D_8012649C; -unk801264A0 D_801264A0[4]; +SavefileInfo gSavefileInfo[4]; s32 D_801264D0; s32 D_801264D4; @@ -3963,7 +3963,7 @@ void render_file_select_menu(s32 arg0) { func_8009BD5C(); func_80067F2C(&D_801263A0, &D_801263A8); for (i = 0; i < 3; i++) { // 3 files - if (D_801264A0[i].unk0 == gIsInAdventureTwo || D_801264A0[i].unk1 == 0) { + if (gSavefileInfo[i].unk0 == gIsInAdventureTwo || gSavefileInfo[i].unk1 == 0) { color = 0xB0E0C0FF; } else { color = 0x6A9073FF; @@ -3977,17 +3977,17 @@ void render_file_select_menu(s32 arg0) { set_text_background_color(0, 0, 0, 0); s5 = 10; for (i = 0; i < 3; i++) { - if (D_801264A0[i].unk1 != 0) { + if (gSavefileInfo[i].unk1 != 0) { s2 = 0xB; func_8007BF1C(0); - if (D_801264A0[i].unk0 != 0) { + if (gSavefileInfo[i].unk0 != 0) { s2 = 0xC; } func_8008CC28(s2, D_800E03FC[2] + D_800E03CC[i].unk0, D_800E03FC[3] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); func_80068508(1); - D_800DF75C->unk18 = D_801264A0[i].unk2 / s5; + D_800DF75C->unk18 = gSavefileInfo[i].unk2 / s5; func_8008CC28(0, (D_800E03FC[6] + D_800E03CC[i].unk0) - 6, D_800E03FC[7] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); - D_800DF75C->unk18 = D_801264A0[i].unk2 % s5; + D_800DF75C->unk18 = gSavefileInfo[i].unk2 % s5; func_8008CC28(0, D_800E03FC[6] + D_800E03CC[i].unk0 + 6, D_800E03FC[7] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); func_80068508(0); D_800DF4A8 = 0x40; @@ -4028,8 +4028,8 @@ void render_file_select_menu(s32 arg0) { D_800E03CC[i].unk8, D_800E03CC[i].unkA, temp_t0, temp_t0, temp_t0, temp_t0); } if (D_80126CC0 == 0 || i != gSaveFileIndex) { - trim_filename_string(D_801264A0[i].name, tempName); - if (D_801264A0[i].unk1 == 0) { + trim_filename_string(gSavefileInfo[i].name, tempName); + if (gSavefileInfo[i].unk1 == 0) { trim_filename_string(gFilenames[i], tempName); } if (tempName != NULL) { @@ -4090,15 +4090,7 @@ GLOBAL_ASM("asm/non_matchings/menu/func_8008D8BC.s") GLOBAL_ASM("asm/non_matchings/menu/func_8008DC7C.s") #else /* Size: 0x0C Bytes */ -typedef struct unk801264A0 { - u8 unk0; - u8 unk1; - u16 unk2; - char name[4]; - u32 pad8; -} unk801264A0; - -extern unk801264A0 D_801264A0[3]; // Filename structs? +extern SavefileInfo gSavefileInfo[3]; // Filename structs? extern s32 D_80126494; extern s32 D_8012648C; @@ -4120,7 +4112,7 @@ void func_8008DC7C(s32 arg0) { func_80001D04(0x241, NULL); D_80126488 = 0; } else if (phi_v1 & 0x9000) { - if (D_801264A0[D_8012648C].unk0 == 0) { + if (gSavefileInfo[D_8012648C].unk0 == 0) { func_80001D04(0x241, NULL); } func_80001D04(0xEF, NULL); @@ -4151,13 +4143,13 @@ void func_8008DC7C(s32 arg0) { if (phi_v1 & 0x9000) { func_80001D04(0xEF, NULL); func_8006ECAC(D_8012648C); - D_801264A0[D_8012648C].unk0 = 0; - D_801264A0[D_8012648C].unk1 = 0; - D_801264A0[D_8012648C].unk2 = 0; - D_801264A0[D_8012648C].name[0] = 'D'; - D_801264A0[D_8012648C].name[1] = 'K'; - D_801264A0[D_8012648C].name[2] = 'R'; - D_801264A0[D_8012648C].name[3] = '\0'; + gSavefileInfo[D_8012648C].unk0 = 0; + gSavefileInfo[D_8012648C].unk1 = 0; + gSavefileInfo[D_8012648C].unk2 = 0; + gSavefileInfo[D_8012648C].name[0] = 'D'; + gSavefileInfo[D_8012648C].name[1] = 'K'; + gSavefileInfo[D_8012648C].name[2] = 'R'; + gSavefileInfo[D_8012648C].name[3] = '\0'; gSaveFileIndex = (s32)D_8012648C; D_801263E0 = 0; D_80126488 = 0; diff --git a/src/menu.h b/src/menu.h index c8c86129..c0f41ccf 100644 --- a/src/menu.h +++ b/src/menu.h @@ -173,13 +173,13 @@ typedef struct unk801263CC { } unk801263CC; /* Size: 0x0C Bytes */ -typedef struct unk801264A0 { - u8 unk0; - u8 unk1; - u16 unk2; +typedef struct SavefileInfo { + u8 isAdventure2; + u8 isStarted; + u16 balloonCount; char name[4]; u32 pad8; -} unk801264A0; +} SavefileInfo; typedef struct unk800E153C { TextureHeader *texture; From cd8f5e88d4628c134c83da14f9f774e3c387eb39 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 13 Nov 2021 00:04:55 -0800 Subject: [PATCH 09/18] Documented silver coin race flag. --- asm/non_matchings/unknown_00BC20/func_8000C8F8.s | 4 ++-- asm/non_matchings/unknown_00BC20/func_8001A7D8.s | 4 ++-- src/unknown_00BC20.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/asm/non_matchings/unknown_00BC20/func_8000C8F8.s b/asm/non_matchings/unknown_00BC20/func_8000C8F8.s index 3986cbf8..0b824aa0 100644 --- a/asm/non_matchings/unknown_00BC20/func_8000C8F8.s +++ b/asm/non_matchings/unknown_00BC20/func_8000C8F8.s @@ -24,8 +24,8 @@ glabel func_8000C8F8 /* 00D550 8000C950 0003702B */ sltu $t6, $zero, $v1 /* 00D554 8000C954 01C01825 */ move $v1, $t6 .L8000C958: -/* 00D558 8000C958 3C108012 */ lui $s0, %hi(D_8011AE03) # $s0, 0x8012 -/* 00D55C 8000C95C 2610AE03 */ addiu $s0, %lo(D_8011AE03) # addiu $s0, $s0, -0x51fd +/* 00D558 8000C958 3C108012 */ lui $s0, %hi(gIsSilverCoinRace) # $s0, 0x8012 +/* 00D55C 8000C95C 2610AE03 */ addiu $s0, %lo(gIsSilverCoinRace) # addiu $s0, $s0, -0x51fd /* 00D560 8000C960 A2030000 */ sb $v1, ($s0) /* 00D564 8000C964 904F0049 */ lbu $t7, 0x49($v0) /* 00D568 8000C968 8C580004 */ lw $t8, 4($v0) diff --git a/asm/non_matchings/unknown_00BC20/func_8001A7D8.s b/asm/non_matchings/unknown_00BC20/func_8001A7D8.s index a9a52aae..60477af2 100644 --- a/asm/non_matchings/unknown_00BC20/func_8001A7D8.s +++ b/asm/non_matchings/unknown_00BC20/func_8001A7D8.s @@ -23,7 +23,7 @@ glabel func_8001A7D8 /* 01B424 8001A824 3C0D8012 */ lui $t5, %hi(D_8011AEF5) # $t5, 0x8012 /* 01B428 8001A828 316C0002 */ andi $t4, $t3, 2 /* 01B42C 8001A82C 1580000F */ bnez $t4, .L8001A86C -/* 01B430 8001A830 3C0A8012 */ lui $t2, %hi(D_8011AE03) # $t2, 0x8012 +/* 01B430 8001A830 3C0A8012 */ lui $t2, %hi(gIsSilverCoinRace) # $t2, 0x8012 /* 01B434 8001A834 91ADAEF5 */ lbu $t5, %lo(D_8011AEF5)($t5) /* 01B438 8001A838 240E0001 */ li $t6, 1 /* 01B43C 8001A83C 15A00021 */ bnez $t5, .L8001A8C4 @@ -39,7 +39,7 @@ glabel func_8001A7D8 /* 01B464 8001A864 10000017 */ b .L8001A8C4 /* 01B468 8001A868 AC490000 */ sw $t1, ($v0) .L8001A86C: -/* 01B46C 8001A86C 814AAE03 */ lb $t2, %lo(D_8011AE03)($t2) +/* 01B46C 8001A86C 814AAE03 */ lb $t2, %lo(gIsSilverCoinRace)($t2) /* 01B470 8001A870 00000000 */ nop /* 01B474 8001A874 11400013 */ beqz $t2, .L8001A8C4 /* 01B478 8001A878 00000000 */ nop diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 1c70d66d..735cc5e6 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -176,7 +176,7 @@ s32 D_8011ADD8[10]; s8 D_8011AE00; s8 D_8011AE01; s8 D_8011AE02; -s8 D_8011AE03; +s8 gIsSilverCoinRace; u32 *D_8011AE08[16]; s32 (*D_8011AE48)[8]; // Unknown number of entries. u8 (*D_8011AE4C)[8]; // Unknown number of entries. @@ -585,7 +585,7 @@ s8 func_8000E1CC(void) { } s8 func_8000E1DC() { - return D_8011AE03; + return gIsSilverCoinRace; } void func_8000E1EC(Object *object, s32 arg1) { From 6799c345b7e89477e0f6483504c63f71ec4c1e4d Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Fri, 26 Nov 2021 23:19:17 +0000 Subject: [PATCH 10/18] Labelling of various things, mainly in and relating to unknown_06B2B0.c --- .../controller_pak/func_8007431C.s | 2 +- .../controller_pak/func_800744DC.s | 2 +- .../controller_pak/func_800746F0.s | 4 +- .../controller_pak/func_8007497C.s | 2 +- asm/non_matchings/menu/func_80094688.s | 4 +- asm/non_matchings/menu/func_80094D28.s | 2 +- asm/non_matchings/menu/tt_menu_loop.s | 104 ++++----- asm/non_matchings/printf/func_800B5F78.s | 2 +- .../unknown_00BC20/func_8000CC7C.s | 4 +- .../unknown_00BC20/func_80019808.s | 2 +- .../unknown_043920/func_8004DE38.s | 2 +- .../unknown_043920/func_8005A6F0.s | 2 +- .../unknown_06B2B0/func_8006CCF0.s | 14 +- .../unknown_06B2B0/func_8006DCF8.s | 40 ++-- .../unknown_06B2B0/func_8006ECFC.s | 4 +- .../unknown_09F8F0/func_800A01A0.s | 6 +- .../unknown_09F8F0/func_800A22F4.s | 2 +- src/audio.c | 10 +- src/controller_pak.c | 2 +- src/fade_transition.c | 16 +- src/menu.c | 219 +++++++++--------- src/menu.h | 11 +- src/thread0_epc.c | 4 +- src/unknown_00BC20.c | 2 +- src/unknown_06B2B0.c | 185 +++++++-------- src/unknown_06B2B0.h | 16 +- src/unknown_078050.c | 12 +- src/unknown_078050.h | 4 +- src/video.c | 20 +- 29 files changed, 361 insertions(+), 338 deletions(-) diff --git a/asm/non_matchings/controller_pak/func_8007431C.s b/asm/non_matchings/controller_pak/func_8007431C.s index 3afa7a2e..746e97a8 100644 --- a/asm/non_matchings/controller_pak/func_8007431C.s +++ b/asm/non_matchings/controller_pak/func_8007431C.s @@ -97,7 +97,7 @@ glabel func_8007431C /* 075070 80074470 1605FFFA */ bne $s0, $a1, .L8007445C /* 075074 80074474 24630004 */ addiu $v1, $v1, 4 .L80074478: -/* 075078 80074478 0C01BAB0 */ jal func_8006EAC0 +/* 075078 80074478 0C01BAB0 */ jal check_reset_pressed /* 07507C 8007447C AFA60054 */ sw $a2, 0x54($sp) /* 075080 80074480 8FA60054 */ lw $a2, 0x54($sp) /* 075084 80074484 1440000C */ bnez $v0, .L800744B8 diff --git a/asm/non_matchings/controller_pak/func_800744DC.s b/asm/non_matchings/controller_pak/func_800744DC.s index 30e6cbd5..47e0f76c 100644 --- a/asm/non_matchings/controller_pak/func_800744DC.s +++ b/asm/non_matchings/controller_pak/func_800744DC.s @@ -38,7 +38,7 @@ glabel func_800744DC /* 07515C 8007455C 02202025 */ move $a0, $s1 /* 075160 80074560 0C01CCBA */ jal func_800732E8 /* 075164 80074564 00402825 */ move $a1, $v0 -/* 075168 80074568 0C01BAB0 */ jal func_8006EAC0 +/* 075168 80074568 0C01BAB0 */ jal check_reset_pressed /* 07516C 8007456C 00000000 */ nop /* 075170 80074570 8FA3002C */ lw $v1, 0x2c($sp) /* 075174 80074574 1440000C */ bnez $v0, .L800745A8 diff --git a/asm/non_matchings/controller_pak/func_800746F0.s b/asm/non_matchings/controller_pak/func_800746F0.s index 4aaa3765..e84aa228 100644 --- a/asm/non_matchings/controller_pak/func_800746F0.s +++ b/asm/non_matchings/controller_pak/func_800746F0.s @@ -24,7 +24,7 @@ glabel func_800746F0 /* 075344 80074744 322F0001 */ andi $t7, $s1, 1 /* 075348 80074748 11E00011 */ beqz $t7, .L80074790 /* 07534C 8007474C AFB10028 */ sw $s1, 0x28($sp) -/* 075350 80074750 0C01BAB0 */ jal func_8006EAC0 +/* 075350 80074750 0C01BAB0 */ jal check_reset_pressed /* 075354 80074754 24110018 */ li $s1, 24 /* 075358 80074758 1440000D */ bnez $v0, .L80074790 /* 07535C 8007475C 00008025 */ move $s0, $zero @@ -47,7 +47,7 @@ glabel func_800746F0 /* 075398 80074798 31090002 */ andi $t1, $t0, 2 /* 07539C 8007479C 11200012 */ beqz $t1, .L800747E8 /* 0753A0 800747A0 00000000 */ nop -/* 0753A4 800747A4 0C01BAB0 */ jal func_8006EAC0 +/* 0753A4 800747A4 0C01BAB0 */ jal check_reset_pressed /* 0753A8 800747A8 24110018 */ li $s1, 24 /* 0753AC 800747AC 1440000E */ bnez $v0, .L800747E8 /* 0753B0 800747B0 00008025 */ move $s0, $zero diff --git a/asm/non_matchings/controller_pak/func_8007497C.s b/asm/non_matchings/controller_pak/func_8007497C.s index c885cfe5..01d33668 100644 --- a/asm/non_matchings/controller_pak/func_8007497C.s +++ b/asm/non_matchings/controller_pak/func_8007497C.s @@ -37,7 +37,7 @@ glabel func_8007497C /* 075604 80074A04 01C2C025 */ or $t8, $t6, $v0 /* 075608 80074A08 01E3C825 */ or $t9, $t7, $v1 /* 07560C 80074A0C AE190004 */ sw $t9, 4($s0) -/* 075610 80074A10 0C01BAB0 */ jal func_8006EAC0 +/* 075610 80074A10 0C01BAB0 */ jal check_reset_pressed /* 075614 80074A14 AE180000 */ sw $t8, ($s0) /* 075618 80074A18 14400008 */ bnez $v0, .L80074A3C /* 07561C 80074A1C 24020001 */ li $v0, 1 diff --git a/asm/non_matchings/menu/func_80094688.s b/asm/non_matchings/menu/func_80094688.s index 0e6efc0b..af73b424 100644 --- a/asm/non_matchings/menu/func_80094688.s +++ b/asm/non_matchings/menu/func_80094688.s @@ -141,7 +141,7 @@ glabel func_80094688 /* 095490 80094890 24090064 */ li $t1, 100 /* 095494 80094894 AC29F47C */ sw $t1, %lo(gMenuDelay)($at) .L80094898: -/* 095498 80094898 0C01B683 */ jal func_8006DA0C +/* 095498 80094898 0C01B683 */ jal get_render_context /* 09549C 8009489C 00000000 */ nop /* 0954A0 800948A0 10400003 */ beqz $v0, .L800948B0 /* 0954A4 800948A4 240A0007 */ li $t2, 7 @@ -230,7 +230,7 @@ glabel func_80094688 .L800949E0: /* 0955E0 800949E0 846A0004 */ lh $t2, 4($v1) /* 0955E4 800949E4 3C018012 */ lui $at, %hi(D_80126BC0) # $at, 0x8012 -/* 0955E8 800949E8 0C01B683 */ jal func_8006DA0C +/* 0955E8 800949E8 0C01B683 */ jal get_render_context /* 0955EC 800949EC AC2A6BC0 */ sw $t2, %lo(D_80126BC0)($at) /* 0955F0 800949F0 14400008 */ bnez $v0, .L80094A14 /* 0955F4 800949F4 3C048012 */ lui $a0, %hi(D_80126BB8) # $a0, 0x8012 diff --git a/asm/non_matchings/menu/func_80094D28.s b/asm/non_matchings/menu/func_80094D28.s index 87e63951..68dab965 100644 --- a/asm/non_matchings/menu/func_80094D28.s +++ b/asm/non_matchings/menu/func_80094D28.s @@ -590,7 +590,7 @@ glabel L800951CC /* 096184 80095584 24040007 */ li $a0, 7 .L80095588: glabel L80095588 -/* 096188 80095588 0C01B683 */ jal func_8006DA0C +/* 096188 80095588 0C01B683 */ jal get_render_context /* 09618C 8009558C 00000000 */ nop /* 096190 80095590 1440001D */ bnez $v0, .L80095608 /* 096194 80095594 3C0F800E */ lui $t7, %hi(gNumberOfActivePlayers) # $t7, 0x800e diff --git a/asm/non_matchings/menu/tt_menu_loop.s b/asm/non_matchings/menu/tt_menu_loop.s index 0ea1df58..0b5018af 100644 --- a/asm/non_matchings/menu/tt_menu_loop.s +++ b/asm/non_matchings/menu/tt_menu_loop.s @@ -13,7 +13,7 @@ glabel tt_menu_loop /* 09E74C 8009DB4C 0C027B20 */ jal is_in_two_player_adventure /* 09E750 8009DB50 AFA20030 */ sw $v0, 0x30($sp) /* 09E754 8009DB54 10400007 */ beqz $v0, .L8009DB74 -/* 09E758 8009DB58 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 +/* 09E758 8009DB58 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 /* 09E75C 8009DB5C 8FA20030 */ lw $v0, 0x30($sp) /* 09E760 8009DB60 00000000 */ nop /* 09E764 8009DB64 8C4E0010 */ lw $t6, 0x10($v0) @@ -24,13 +24,13 @@ glabel tt_menu_loop /* 09E774 8009DB74 8FA20030 */ lw $v0, 0x30($sp) /* 09E778 8009DB78 24090005 */ li $t1, 5 /* 09E77C 8009DB7C 8C580010 */ lw $t8, 0x10($v0) -/* 09E780 8009DB80 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09E780 8009DB80 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09E784 8009DB84 33190002 */ andi $t9, $t8, 2 /* 09E788 8009DB88 17200002 */ bnez $t9, .L8009DB94 /* 09E78C 8009DB8C 24040001 */ li $a0, 1 -/* 09E790 8009DB90 A02964E2 */ sb $t1, %lo(D_801264E2)($at) +/* 09E790 8009DB90 A02964E2 */ sb $t1, %lo(sCurrentMenuID)($at) .L8009DB94: -/* 09E794 8009DB94 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09E794 8009DB94 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09E798 8009DB98 24010004 */ li $at, 4 /* 09E79C 8009DB9C 10610012 */ beq $v1, $at, .L8009DBE8 /* 09E7A0 8009DBA0 24050018 */ li $a1, 24 @@ -65,12 +65,12 @@ glabel tt_menu_loop /* 09E808 8009DC08 AFA00044 */ sw $zero, 0x44($sp) /* 09E80C 8009DC0C 0C01A955 */ jal get_buttons_pressed_from_player /* 09E810 8009DC10 00002025 */ move $a0, $zero -/* 09E814 8009DC14 3C018012 */ lui $at, %hi(D_80126504) # $at, 0x8012 -/* 09E818 8009DC18 A0206504 */ sb $zero, %lo(D_80126504)($at) -/* 09E81C 8009DC1C 3C088012 */ lui $t0, %hi(D_801264E2) # $t0, 0x8012 +/* 09E814 8009DC14 3C018012 */ lui $at, %hi(sDialogueOptionMax) # $at, 0x8012 +/* 09E818 8009DC18 A0206504 */ sb $zero, %lo(sDialogueOptionMax)($at) +/* 09E81C 8009DC1C 3C088012 */ lui $t0, %hi(sCurrentMenuID) # $t0, 0x8012 /* 09E820 8009DC20 3C018012 */ lui $at, %hi(D_8012650E) # $at, 0x8012 /* 09E824 8009DC24 240E0020 */ li $t6, 32 -/* 09E828 8009DC28 250864E2 */ addiu $t0, %lo(D_801264E2) # addiu $t0, $t0, 0x64e2 +/* 09E828 8009DC28 250864E2 */ addiu $t0, %lo(sCurrentMenuID) # addiu $t0, $t0, 0x64e2 /* 09E82C 8009DC2C A02E650E */ sb $t6, %lo(D_8012650E)($at) /* 09E830 8009DC30 81030000 */ lb $v1, ($t0) /* 09E834 8009DC34 00402025 */ move $a0, $v0 @@ -181,8 +181,8 @@ glabel L8009DC60 /* 09E9B8 8009DDB8 8FAE0040 */ lw $t6, 0x40($sp) /* 09E9BC 8009DDBC 33198000 */ andi $t9, $t8, 0x8000 /* 09E9C0 8009DDC0 13200032 */ beqz $t9, .L8009DE8C -/* 09E9C4 8009DDC4 3C098012 */ lui $t1, %hi(D_801264E2) # $t1, 0x8012 -/* 09E9C8 8009DDC8 812964E2 */ lb $t1, %lo(D_801264E2)($t1) +/* 09E9C4 8009DDC4 3C098012 */ lui $t1, %hi(sCurrentMenuID) # $t1, 0x8012 +/* 09E9C8 8009DDC8 812964E2 */ lb $t1, %lo(sCurrentMenuID)($t1) /* 09E9CC 8009DDCC 2401000A */ li $at, 10 /* 09E9D0 8009DDD0 1121002E */ beq $t1, $at, .L8009DE8C /* 09E9D4 8009DDD4 3C038012 */ lui $v1, %hi(D_80126516) # $v1, 0x8012 @@ -204,11 +204,11 @@ glabel L8009DC60 /* 09EA10 8009DE10 3C018012 */ lui $at, %hi(D_8012639C) # $at, 0x8012 /* 09EA14 8009DE14 AC20639C */ sw $zero, %lo(D_8012639C)($at) /* 09EA18 8009DE18 3C038012 */ lui $v1, %hi(D_80126516) # $v1, 0x8012 -/* 09EA1C 8009DE1C 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EA1C 8009DE1C 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EA20 8009DE20 240A0008 */ li $t2, 8 /* 09EA24 8009DE24 80636516 */ lb $v1, %lo(D_80126516)($v1) /* 09EA28 8009DE28 10000015 */ b .L8009DE80 -/* 09EA2C 8009DE2C A02A64E2 */ sb $t2, %lo(D_801264E2)($at) +/* 09EA2C 8009DE2C A02A64E2 */ sb $t2, %lo(sCurrentMenuID)($at) /* 09EA30 8009DE30 240400EF */ li $a0, 239 .L8009DE34: /* 09EA34 8009DE34 0C000741 */ jal func_80001D04 @@ -226,10 +226,10 @@ glabel L8009DC60 /* 09EA64 8009DE64 3C01800E */ lui $at, %hi(D_800E1E28) # $at, 0x800e /* 09EA68 8009DE68 A02B1E28 */ sb $t3, %lo(D_800E1E28)($at) /* 09EA6C 8009DE6C 3C038012 */ lui $v1, %hi(D_80126516) # $v1, 0x8012 -/* 09EA70 8009DE70 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EA70 8009DE70 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EA74 8009DE74 240C0004 */ li $t4, 4 /* 09EA78 8009DE78 80636516 */ lb $v1, %lo(D_80126516)($v1) -/* 09EA7C 8009DE7C A02C64E2 */ sb $t4, %lo(D_801264E2)($at) +/* 09EA7C 8009DE7C A02C64E2 */ sb $t4, %lo(sCurrentMenuID)($at) .L8009DE80: /* 09EA80 8009DE80 246D0001 */ addiu $t5, $v1, 1 .L8009DE84: @@ -244,8 +244,8 @@ glabel L8009DC60 /* 09EAA0 8009DEA0 24180003 */ li $t8, 3 /* 09EAA4 8009DEA4 AFB80044 */ sw $t8, 0x44($sp) .L8009DEA8: -/* 09EAA8 8009DEA8 3C038012 */ lui $v1, %hi(D_801264E2) -/* 09EAAC 8009DEAC 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EAA8 8009DEA8 3C038012 */ lui $v1, %hi(sCurrentMenuID) +/* 09EAAC 8009DEAC 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EAB0 8009DEB0 24010004 */ li $at, 4 /* 09EAB4 8009DEB4 14610002 */ bne $v1, $at, .L8009DEC0 /* 09EAB8 8009DEB8 2409000A */ li $t1, 10 @@ -255,8 +255,8 @@ glabel L8009DC60 /* 09EAC4 8009DEC4 24010003 */ li $at, 3 /* 09EAC8 8009DEC8 17210004 */ bne $t9, $at, .L8009DEDC /* 09EACC 8009DECC 240A0003 */ li $t2, 3 -/* 09EAD0 8009DED0 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 -/* 09EAD4 8009DED4 A02964E2 */ sb $t1, %lo(D_801264E2)($at) +/* 09EAD0 8009DED0 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 +/* 09EAD4 8009DED4 A02964E2 */ sb $t1, %lo(sCurrentMenuID)($at) /* 09EAD8 8009DED8 2403000A */ li $v1, 10 .L8009DEDC: /* 09EADC 8009DEDC 2401000A */ li $at, 10 @@ -305,17 +305,17 @@ glabel L8009DEF0 /* 09EB78 8009DF78 24C60010 */ addiu $a2, $a2, 0x10 /* 09EB7C 8009DF7C 14E0FFEF */ bnez $a3, .L8009DF3C /* 09EB80 8009DF80 240F0001 */ li $t7, 1 -/* 09EB84 8009DF84 3C088012 */ lui $t0, %hi(D_801264E2) # $t0, 0x8012 -/* 09EB88 8009DF88 250864E2 */ addiu $t0, %lo(D_801264E2) # addiu $t0, $t0, 0x64e2 +/* 09EB84 8009DF84 3C088012 */ lui $t0, %hi(sCurrentMenuID) # $t0, 0x8012 +/* 09EB88 8009DF88 250864E2 */ addiu $t0, %lo(sCurrentMenuID) # addiu $t0, $t0, 0x64e2 .L8009DF8C: /* 09EB8C 8009DF8C 8FAA0040 */ lw $t2, 0x40($sp) -/* 09EB90 8009DF90 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 +/* 09EB90 8009DF90 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 /* 09EB94 8009DF94 314BC000 */ andi $t3, $t2, 0xc000 /* 09EB98 8009DF98 11600002 */ beqz $t3, .L8009DFA4 /* 09EB9C 8009DF9C 00000000 */ nop /* 09EBA0 8009DFA0 A1000000 */ sb $zero, ($t0) .L8009DFA4: -/* 09EBA4 8009DFA4 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EBA4 8009DFA4 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EBA8 8009DFA8 100000F5 */ b .L8009E380 /* 09EBAC 8009DFAC 24010001 */ li $at, 1 glabel L8009DFB0 @@ -330,8 +330,8 @@ glabel L8009DFB0 /* 09EBD0 8009DFD0 2404022F */ li $a0, 559 /* 09EBD4 8009DFD4 0C00DAF3 */ jal func_80036BCC /* 09EBD8 8009DFD8 24050001 */ li $a1, 1 -/* 09EBDC 8009DFDC 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 -/* 09EBE0 8009DFE0 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EBDC 8009DFDC 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 +/* 09EBE0 8009DFE0 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EBE4 8009DFE4 100000E6 */ b .L8009E380 /* 09EBE8 8009DFE8 24010001 */ li $at, 1 glabel L8009DFEC @@ -364,21 +364,21 @@ glabel L8009DFEC /* 09EC50 8009E050 24C60010 */ addiu $a2, $a2, 0x10 /* 09EC54 8009E054 14E0FFEF */ bnez $a3, .L8009E014 /* 09EC58 8009E058 240D0001 */ li $t5, 1 -/* 09EC5C 8009E05C 3C088012 */ lui $t0, %hi(D_801264E2) # $t0, 0x8012 -/* 09EC60 8009E060 250864E2 */ addiu $t0, %lo(D_801264E2) # addiu $t0, $t0, 0x64e2 +/* 09EC5C 8009E05C 3C088012 */ lui $t0, %hi(sCurrentMenuID) # $t0, 0x8012 +/* 09EC60 8009E060 250864E2 */ addiu $t0, %lo(sCurrentMenuID) # addiu $t0, $t0, 0x64e2 /* 09EC64 8009E064 8FA90040 */ lw $t1, 0x40($sp) .L8009E068: /* 09EC68 8009E068 8FAB0030 */ lw $t3, 0x30($sp) /* 09EC6C 8009E06C 312AC000 */ andi $t2, $t1, 0xc000 /* 09EC70 8009E070 11400006 */ beqz $t2, .L8009E08C -/* 09EC74 8009E074 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 +/* 09EC74 8009E074 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 /* 09EC78 8009E078 8D6C0010 */ lw $t4, 0x10($t3) /* 09EC7C 8009E07C 00000000 */ nop /* 09EC80 8009E080 358E0002 */ ori $t6, $t4, 2 /* 09EC84 8009E084 AD6E0010 */ sw $t6, 0x10($t3) /* 09EC88 8009E088 A1000000 */ sb $zero, ($t0) .L8009E08C: -/* 09EC8C 8009E08C 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EC8C 8009E08C 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EC90 8009E090 100000BB */ b .L8009E380 /* 09EC94 8009E094 24010001 */ li $at, 1 glabel L8009E098 @@ -428,10 +428,10 @@ glabel L8009E098 /* 09ED44 8009E144 24180007 */ li $t8, 7 /* 09ED48 8009E148 3C018012 */ lui $at, %hi(D_8012639C) # $at, 0x8012 /* 09ED4C 8009E14C AC38639C */ sw $t8, %lo(D_8012639C)($at) -/* 09ED50 8009E150 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09ED50 8009E150 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09ED54 8009E154 24190008 */ li $t9, 8 /* 09ED58 8009E158 1000000A */ b .L8009E184 -/* 09ED5C 8009E15C A03964E2 */ sb $t9, %lo(D_801264E2)($at) +/* 09ED5C 8009E15C A03964E2 */ sb $t9, %lo(sCurrentMenuID)($at) /* 09ED60 8009E160 8FA90040 */ lw $t1, 0x40($sp) .L8009E164: /* 09ED64 8009E164 00000000 */ nop @@ -440,11 +440,11 @@ glabel L8009E098 /* 09ED70 8009E170 24040241 */ li $a0, 577 /* 09ED74 8009E174 0C000741 */ jal func_80001D04 /* 09ED78 8009E178 00002825 */ move $a1, $zero -/* 09ED7C 8009E17C 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 -/* 09ED80 8009E180 A02064E2 */ sb $zero, %lo(D_801264E2)($at) +/* 09ED7C 8009E17C 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 +/* 09ED80 8009E180 A02064E2 */ sb $zero, %lo(sCurrentMenuID)($at) .L8009E184: -/* 09ED84 8009E184 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 -/* 09ED88 8009E188 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09ED84 8009E184 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 +/* 09ED88 8009E188 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09ED8C 8009E18C 1000007C */ b .L8009E380 /* 09ED90 8009E190 24010001 */ li $at, 1 glabel L8009E194 @@ -482,13 +482,13 @@ glabel L8009E194 /* 09EE10 8009E210 0C03145A */ jal func_800C5168 /* 09EE14 8009E214 24060042 */ li $a2, 66 /* 09EE18 8009E218 8FAC0040 */ lw $t4, 0x40($sp) -/* 09EE1C 8009E21C 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EE1C 8009E21C 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EE20 8009E220 318ED000 */ andi $t6, $t4, 0xd000 /* 09EE24 8009E224 11C00002 */ beqz $t6, .L8009E230 -/* 09EE28 8009E228 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 -/* 09EE2C 8009E22C A02064E2 */ sb $zero, %lo(D_801264E2)($at) +/* 09EE28 8009E228 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 +/* 09EE2C 8009E22C A02064E2 */ sb $zero, %lo(sCurrentMenuID)($at) .L8009E230: -/* 09EE30 8009E230 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EE30 8009E230 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EE34 8009E234 10000052 */ b .L8009E380 /* 09EE38 8009E238 24010001 */ li $at, 1 glabel L8009E23C @@ -533,53 +533,53 @@ glabel L8009E23C glabel L8009E2D0 /* 09EED0 8009E2D0 3C0C8012 */ lui $t4, %hi(D_8012639C) # $t4, 0x8012 /* 09EED4 8009E2D4 8D8C639C */ lw $t4, %lo(D_8012639C)($t4) -/* 09EED8 8009E2D8 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EED8 8009E2D8 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EEDC 8009E2DC 10000024 */ b .L8009E370 -/* 09EEE0 8009E2E0 A02C64E2 */ sb $t4, %lo(D_801264E2)($at) +/* 09EEE0 8009E2E0 A02C64E2 */ sb $t4, %lo(sCurrentMenuID)($at) glabel L8009E2E4 /* 09EEE4 8009E2E4 240E0006 */ li $t6, 6 -/* 09EEE8 8009E2E8 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EEE8 8009E2E8 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EEEC 8009E2EC 10000020 */ b .L8009E370 -/* 09EEF0 8009E2F0 A02E64E2 */ sb $t6, %lo(D_801264E2)($at) +/* 09EEF0 8009E2F0 A02E64E2 */ sb $t6, %lo(sCurrentMenuID)($at) glabel L8009E2F4 /* 09EEF4 8009E2F4 3C0B800E */ lui $t3, %hi(D_800E09D8) # $t3, 0x800e /* 09EEF8 8009E2F8 256B09D8 */ addiu $t3, %lo(D_800E09D8) # addiu $t3, $t3, 0x9d8 /* 09EEFC 8009E2FC 3C018012 */ lui $at, %hi(D_801263A4) # $at, 0x8012 /* 09EF00 8009E300 AC2B63A4 */ sw $t3, %lo(D_801263A4)($at) -/* 09EF04 8009E304 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EF04 8009E304 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EF08 8009E308 240D0001 */ li $t5, 1 /* 09EF0C 8009E30C 10000018 */ b .L8009E370 -/* 09EF10 8009E310 A02D64E2 */ sb $t5, %lo(D_801264E2)($at) +/* 09EF10 8009E310 A02D64E2 */ sb $t5, %lo(sCurrentMenuID)($at) glabel L8009E314 /* 09EF14 8009E314 3C0F800E */ lui $t7, %hi(D_800E09C4) # $t7, 0x800e /* 09EF18 8009E318 25EF09C4 */ addiu $t7, %lo(D_800E09C4) # addiu $t7, $t7, 0x9c4 /* 09EF1C 8009E31C 3C018012 */ lui $at, %hi(D_801263A4) # $at, 0x8012 /* 09EF20 8009E320 AC2F63A4 */ sw $t7, %lo(D_801263A4)($at) -/* 09EF24 8009E324 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EF24 8009E324 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EF28 8009E328 24180001 */ li $t8, 1 /* 09EF2C 8009E32C 10000010 */ b .L8009E370 -/* 09EF30 8009E330 A03864E2 */ sb $t8, %lo(D_801264E2)($at) +/* 09EF30 8009E330 A03864E2 */ sb $t8, %lo(sCurrentMenuID)($at) glabel L8009E334 /* 09EF34 8009E334 3C19800E */ lui $t9, %hi(D_800E09EC) # $t9, 0x800e /* 09EF38 8009E338 273909EC */ addiu $t9, %lo(D_800E09EC) # addiu $t9, $t9, 0x9ec /* 09EF3C 8009E33C 3C018012 */ lui $at, %hi(D_801263A4) # $at, 0x8012 /* 09EF40 8009E340 AC3963A4 */ sw $t9, %lo(D_801263A4)($at) -/* 09EF44 8009E344 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EF44 8009E344 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EF48 8009E348 24090001 */ li $t1, 1 /* 09EF4C 8009E34C 10000008 */ b .L8009E370 -/* 09EF50 8009E350 A02964E2 */ sb $t1, %lo(D_801264E2)($at) +/* 09EF50 8009E350 A02964E2 */ sb $t1, %lo(sCurrentMenuID)($at) .L8009E354: glabel L8009E354 /* 09EF54 8009E354 3C0A800E */ lui $t2, %hi(D_800E09B0) # $t2, 0x800e /* 09EF58 8009E358 254A09B0 */ addiu $t2, %lo(D_800E09B0) # addiu $t2, $t2, 0x9b0 /* 09EF5C 8009E35C 3C018012 */ lui $at, %hi(D_801263A4) # $at, 0x8012 /* 09EF60 8009E360 AC2A63A4 */ sw $t2, %lo(D_801263A4)($at) -/* 09EF64 8009E364 3C018012 */ lui $at, %hi(D_801264E2) # $at, 0x8012 +/* 09EF64 8009E364 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 /* 09EF68 8009E368 240C0001 */ li $t4, 1 -/* 09EF6C 8009E36C A02C64E2 */ sb $t4, %lo(D_801264E2)($at) +/* 09EF6C 8009E36C A02C64E2 */ sb $t4, %lo(sCurrentMenuID)($at) .L8009E370: -/* 09EF70 8009E370 3C038012 */ lui $v1, %hi(D_801264E2) # $v1, 0x8012 -/* 09EF74 8009E374 806364E2 */ lb $v1, %lo(D_801264E2)($v1) +/* 09EF70 8009E370 3C038012 */ lui $v1, %hi(sCurrentMenuID) # $v1, 0x8012 +/* 09EF74 8009E374 806364E2 */ lb $v1, %lo(sCurrentMenuID)($v1) /* 09EF78 8009E378 00000000 */ nop .L8009E37C: glabel L8009E37C diff --git a/asm/non_matchings/printf/func_800B5F78.s b/asm/non_matchings/printf/func_800B5F78.s index af53680a..de495bae 100644 --- a/asm/non_matchings/printf/func_800B5F78.s +++ b/asm/non_matchings/printf/func_800B5F78.s @@ -6,7 +6,7 @@ glabel func_800B5F78 /* 0B6B88 800B5F88 AFB40030 */ sw $s4, 0x30($sp) /* 0B6B8C 800B5F8C AFB20028 */ sw $s2, 0x28($sp) /* 0B6B90 800B5F90 AFB10024 */ sw $s1, 0x24($sp) -/* 0B6B94 800B5F94 0C01E015 */ jal func_80078054 +/* 0B6B94 800B5F94 0C01E015 */ jal init_rdp_and_framebuffer /* 0B6B98 800B5F98 AFB00020 */ sw $s0, 0x20($sp) /* 0B6B9C 800B5F9C 0C01E948 */ jal get_video_width_and_height_as_s32 /* 0B6BA0 800B5FA0 00000000 */ nop diff --git a/asm/non_matchings/unknown_00BC20/func_8000CC7C.s b/asm/non_matchings/unknown_00BC20/func_8000CC7C.s index 625315a7..be199e1e 100644 --- a/asm/non_matchings/unknown_00BC20/func_8000CC7C.s +++ b/asm/non_matchings/unknown_00BC20/func_8000CC7C.s @@ -79,7 +79,7 @@ glabel func_8000CC7C /* 00D974 8000CD74 AFB90130 */ sw $t9, 0x130($sp) /* 00D978 8000CD78 A04D003B */ sb $t5, 0x3b($v0) .L8000CD7C: -/* 00D97C 8000CD7C 0C01B683 */ jal func_8006DA0C +/* 00D97C 8000CD7C 0C01B683 */ jal get_render_context /* 00D980 8000CD80 00000000 */ nop /* 00D984 8000CD84 0C01BAA4 */ jal get_settings /* 00D988 8000CD88 AFA20138 */ sw $v0, 0x138($sp) @@ -967,7 +967,7 @@ glabel L8000D98C /* 00E5D4 8000D9D4 3C018012 */ lui $at, %hi(D_8011AD20) # $at, 0x8012 /* 00E5D8 8000D9D8 A020AD20 */ sb $zero, %lo(D_8011AD20)($at) .L8000D9DC: -/* 00E5DC 8000D9DC 0C01B683 */ jal func_8006DA0C +/* 00E5DC 8000D9DC 0C01B683 */ jal get_render_context /* 00E5E0 8000D9E0 00000000 */ nop /* 00E5E4 8000D9E4 1440002D */ bnez $v0, .L8000DA9C /* 00E5E8 8000D9E8 3C028012 */ lui $v0, %hi(objCount) # $v0, 0x8012 diff --git a/asm/non_matchings/unknown_00BC20/func_80019808.s b/asm/non_matchings/unknown_00BC20/func_80019808.s index 47cdfc93..348f5f9b 100644 --- a/asm/non_matchings/unknown_00BC20/func_80019808.s +++ b/asm/non_matchings/unknown_00BC20/func_80019808.s @@ -604,7 +604,7 @@ glabel func_80019808 /* 01ACA0 8001A0A0 00000000 */ nop /* 01ACA4 8001A0A4 AFBF0064 */ sw $ra, 0x64($sp) /* 01ACA8 8001A0A8 AFA80080 */ sw $t0, 0x80($sp) -/* 01ACAC 8001A0AC 0C01B683 */ jal func_8006DA0C +/* 01ACAC 8001A0AC 0C01B683 */ jal get_render_context /* 01ACB0 8001A0B0 AFAA0044 */ sw $t2, 0x44($sp) /* 01ACB4 8001A0B4 8FA80080 */ lw $t0, 0x80($sp) /* 01ACB8 8001A0B8 8FAA0044 */ lw $t2, 0x44($sp) diff --git a/asm/non_matchings/unknown_043920/func_8004DE38.s b/asm/non_matchings/unknown_043920/func_8004DE38.s index 8c2fc46f..93859daf 100644 --- a/asm/non_matchings/unknown_043920/func_8004DE38.s +++ b/asm/non_matchings/unknown_043920/func_8004DE38.s @@ -260,7 +260,7 @@ glabel func_8004DE38 /* 04ED84 8004E184 3C018012 */ lui $at, %hi(D_8011D586) # $at, 0x8012 /* 04ED88 8004E188 A420D586 */ sh $zero, %lo(D_8011D586)($at) .L8004E18C: -/* 04ED8C 8004E18C 0C01B683 */ jal func_8006DA0C +/* 04ED8C 8004E18C 0C01B683 */ jal get_render_context /* 04ED90 8004E190 00000000 */ nop /* 04ED94 8004E194 3C0D8012 */ lui $t5, %hi(D_8011D540) # $t5, 0x8012 /* 04ED98 8004E198 8DADD540 */ lw $t5, %lo(D_8011D540)($t5) diff --git a/asm/non_matchings/unknown_043920/func_8005A6F0.s b/asm/non_matchings/unknown_043920/func_8005A6F0.s index 56d9ce5f..79bc0ac7 100644 --- a/asm/non_matchings/unknown_043920/func_8005A6F0.s +++ b/asm/non_matchings/unknown_043920/func_8005A6F0.s @@ -37,7 +37,7 @@ glabel func_8005A6F0 /* 05B308 8005A708 AFA400A0 */ sw $a0, 0xa0($sp) /* 05B30C 8005A70C AFA600A8 */ sw $a2, 0xa8($sp) /* 05B310 8005A710 AFA700AC */ sw $a3, 0xac($sp) -/* 05B314 8005A714 0C01B683 */ jal func_8006DA0C +/* 05B314 8005A714 0C01B683 */ jal get_render_context /* 05B318 8005A718 AC2ED55C */ sw $t6, %lo(D_8011D55C)($at) /* 05B31C 8005A71C 0C01AF6C */ jal get_current_level_header /* 05B320 8005A720 AFA20094 */ sw $v0, 0x94($sp) diff --git a/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s b/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s index 1ec9a99d..2771c662 100644 --- a/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s +++ b/asm/non_matchings/unknown_06B2B0/func_8006CCF0.s @@ -75,10 +75,10 @@ glabel func_8006CCF0 /* 06D9E0 8006CDE0 14400018 */ bnez $v0, .L8006CE44 /* 06D9E4 8006CDE4 3C19800E */ lui $t9, %hi(D_800DD390) # $t9, 0x800e /* 06D9E8 8006CDE8 8339D390 */ lb $t9, %lo(D_800DD390)($t9) -/* 06D9EC 8006CDEC 3C098012 */ lui $t1, %hi(D_801234EC) # $t1, 0x8012 +/* 06D9EC 8006CDEC 3C098012 */ lui $t1, %hi(sRenderContext) # $t1, 0x8012 /* 06D9F0 8006CDF0 17200014 */ bnez $t9, .L8006CE44 /* 06D9F4 8006CDF4 00000000 */ nop -/* 06D9F8 8006CDF8 8D2934EC */ lw $t1, %lo(D_801234EC)($t1) +/* 06D9F8 8006CDF8 8D2934EC */ lw $t1, %lo(sRenderContext)($t1) /* 06D9FC 8006CDFC 3C0A8012 */ lui $t2, %hi(D_80123516) # $t2, 0x8012 /* 06DA00 8006CE00 15200010 */ bnez $t1, .L8006CE44 /* 06DA04 8006CE04 00000000 */ nop @@ -144,8 +144,8 @@ glabel func_8006CCF0 /* 06DAE0 8006CEE0 248411F8 */ addiu $a0, %lo(gCurrDisplayList) # addiu $a0, $a0, 0x11f8 /* 06DAE4 8006CEE4 0C009355 */ jal func_80024D54 /* 06DAE8 8006CEE8 AFB90010 */ sw $t9, 0x10($sp) -/* 06DAEC 8006CEEC 3C098012 */ lui $t1, %hi(D_801234EC) # $t1, 0x8012 -/* 06DAF0 8006CEF0 8D2934EC */ lw $t1, %lo(D_801234EC)($t1) +/* 06DAEC 8006CEEC 3C098012 */ lui $t1, %hi(sRenderContext) # $t1, 0x8012 +/* 06DAF0 8006CEF0 8D2934EC */ lw $t1, %lo(sRenderContext)($t1) /* 06DAF4 8006CEF4 2401DFCF */ li $at, -8241 /* 06DAF8 8006CEF8 15200003 */ bnez $t1, .L8006CF08 /* 06DAFC 8006CEFC 3C0B8012 */ lui $t3, %hi(D_80123516) # $t3, 0x8012 @@ -354,7 +354,7 @@ glabel L8006D19C .L8006D1C0: glabel L8006D1C0 /* 06DDC0 8006D1C0 3C048012 */ lui $a0, %hi(gCurrDisplayList) # $a0, 0x8012 -/* 06DDC4 8006D1C4 0C01E015 */ jal func_80078054 +/* 06DDC4 8006D1C4 0C01E015 */ jal init_rdp_and_framebuffer /* 06DDC8 8006D1C8 248411F8 */ addiu $a0, %lo(gCurrDisplayList) # addiu $a0, $a0, 0x11f8 /* 06DDCC 8006D1CC 3C048012 */ lui $a0, %hi(gCurrDisplayList) # $a0, 0x8012 /* 06DDD0 8006D1D0 0C01DC14 */ jal render_borders_for_multiplayer @@ -608,8 +608,8 @@ glabel L8006D1C0 /* 06E160 8006D560 320C0020 */ andi $t4, $s0, 0x20 .L8006D564: /* 06E164 8006D564 11800004 */ beqz $t4, .L8006D578 -/* 06E168 8006D568 3C0D8012 */ lui $t5, %hi(D_801234EC) # $t5, 0x8012 -/* 06E16C 8006D56C 8DAD34EC */ lw $t5, %lo(D_801234EC)($t5) +/* 06E168 8006D568 3C0D8012 */ lui $t5, %hi(sRenderContext) # $t5, 0x8012 +/* 06E16C 8006D56C 8DAD34EC */ lw $t5, %lo(sRenderContext)($t5) /* 06E170 8006D570 00000000 */ nop /* 06E174 8006D574 11A00004 */ beqz $t5, .L8006D588 .L8006D578: diff --git a/asm/non_matchings/unknown_06B2B0/func_8006DCF8.s b/asm/non_matchings/unknown_06B2B0/func_8006DCF8.s index cd37fc27..e6d1c8a0 100644 --- a/asm/non_matchings/unknown_06B2B0/func_8006DCF8.s +++ b/asm/non_matchings/unknown_06B2B0/func_8006DCF8.s @@ -53,8 +53,8 @@ glabel func_8006DCF8 /* 06E9A4 8006DDA4 00000000 */ nop /* 06E9A8 8006DDA8 0C01B6F9 */ jal func_8006DBE4 /* 06E9AC 8006DDAC 00000000 */ nop -/* 06E9B0 8006DDB0 3C0D8012 */ lui $t5, %hi(D_801234E8) # $t5, 0x8012 -/* 06E9B4 8006DDB4 8DAD34E8 */ lw $t5, %lo(D_801234E8)($t5) +/* 06E9B0 8006DDB0 3C0D8012 */ lui $t5, %hi(gSPTaskNum) # $t5, 0x8012 +/* 06E9B4 8006DDB4 8DAD34E8 */ lw $t5, %lo(gSPTaskNum)($t5) /* 06E9B8 8006DDB8 3C0F8012 */ lui $t7, %hi(gDisplayLists) # $t7, 0x8012 /* 06E9BC 8006DDBC 000D7080 */ sll $t6, $t5, 2 /* 06E9C0 8006DDC0 01EE7821 */ addu $t7, $t7, $t6 @@ -87,8 +87,8 @@ glabel func_8006DCF8 /* 06EA2C 8006DE2C AD420000 */ sw $v0, ($t2) /* 06EA30 8006DE30 AD200000 */ sw $zero, ($t1) /* 06EA34 8006DE34 AD780000 */ sw $t8, ($t3) -/* 06EA38 8006DE38 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 -/* 06EA3C 8006DE3C AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EA38 8006DE38 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 +/* 06EA3C 8006DE3C AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EA40 8006DE40 3C018012 */ lui $at, %hi(gIsPaused) # $at, 0x8012 /* 06EA44 8006DE44 A0203515 */ sb $zero, %lo(gIsPaused)($at) /* 06EA48 8006DE48 3C018012 */ lui $at, %hi(D_80123516) # $at, 0x8012 @@ -150,8 +150,8 @@ glabel L8006DF00 /* 06EB1C 8006DF1C AD000000 */ sw $zero, ($t0) /* 06EB20 8006DF20 AD200000 */ sw $zero, ($t1) /* 06EB24 8006DF24 AD6F0000 */ sw $t7, ($t3) -/* 06EB28 8006DF28 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 -/* 06EB2C 8006DF2C AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EB28 8006DF28 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 +/* 06EB2C 8006DF2C AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EB30 8006DF30 3C038012 */ lui $v1, %hi(D_80123500) # $v1, 0x8012 /* 06EB34 8006DF34 3C0A8012 */ lui $t2, %hi(D_80123518) # $t2, 0x8012 /* 06EB38 8006DF38 254A3518 */ addiu $t2, %lo(D_80123518) # addiu $t2, $t2, 0x3518 @@ -181,9 +181,9 @@ glabel L8006DF70 /* 06EB94 8006DF94 24190064 */ li $t9, 100 /* 06EB98 8006DF98 AD200000 */ sw $zero, ($t1) /* 06EB9C 8006DF9C AD790000 */ sw $t9, ($t3) -/* 06EBA0 8006DFA0 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 +/* 06EBA0 8006DFA0 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 /* 06EBA4 8006DFA4 AD180000 */ sw $t8, ($t0) -/* 06EBA8 8006DFA8 AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EBA8 8006DFA8 AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EBAC 8006DFAC 80A2000F */ lb $v0, 0xf($a1) /* 06EBB0 8006DFB0 80A30001 */ lb $v1, 1($a1) /* 06EBB4 8006DFB4 04400002 */ bltz $v0, .L8006DFC0 @@ -211,8 +211,8 @@ glabel L8006DF70 /* 06EC04 8006E004 100000B5 */ b .L8006E2DC /* 06EC08 8006E008 8FBF0024 */ lw $ra, 0x24($sp) glabel L8006E00C -/* 06EC0C 8006E00C 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 -/* 06EC10 8006E010 AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EC0C 8006E00C 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 +/* 06EC10 8006E010 AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EC14 8006E014 3C038012 */ lui $v1, %hi(D_80123500) # $v1, 0x8012 /* 06EC18 8006E018 3C088012 */ lui $t0, %hi(D_801234F4) # $t0, 0x8012 /* 06EC1C 8006E01C 3C098012 */ lui $t1, %hi(D_80123504) # $t1, 0x8012 @@ -231,9 +231,9 @@ glabel L8006E00C /* 06EC50 8006E050 8FBF0024 */ lw $ra, 0x24($sp) glabel L8006E054 /* 06EC54 8006E054 3C058012 */ lui $a1, %hi(D_80121250) # $a1, 0x8012 -/* 06EC58 8006E058 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 +/* 06EC58 8006E058 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 /* 06EC5C 8006E05C 24A51250 */ addiu $a1, %lo(D_80121250) # addiu $a1, $a1, 0x1250 -/* 06EC60 8006E060 AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EC60 8006E060 AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EC64 8006E064 80AF0001 */ lb $t7, 1($a1) /* 06EC68 8006E068 80A40000 */ lb $a0, ($a1) /* 06EC6C 8006E06C 00AFC021 */ addu $t8, $a1, $t7 @@ -282,8 +282,8 @@ glabel L8006E0E0 /* 06ED08 8006E108 00000000 */ nop /* 06ED0C 8006E10C 0C01B6F9 */ jal func_8006DBE4 /* 06ED10 8006E110 00000000 */ nop -/* 06ED14 8006E114 3C0D8012 */ lui $t5, %hi(D_801234E8) # $t5, 0x8012 -/* 06ED18 8006E118 8DAD34E8 */ lw $t5, %lo(D_801234E8)($t5) +/* 06ED14 8006E114 3C0D8012 */ lui $t5, %hi(gSPTaskNum) # $t5, 0x8012 +/* 06ED18 8006E118 8DAD34E8 */ lw $t5, %lo(gSPTaskNum)($t5) /* 06ED1C 8006E11C 3C0F8012 */ lui $t7, %hi(gDisplayLists) # $t7, 0x8012 /* 06ED20 8006E120 000D7080 */ sll $t6, $t5, 2 /* 06ED24 8006E124 01EE7821 */ addu $t7, $t7, $t6 @@ -314,10 +314,10 @@ glabel L8006E0E0 /* 06ED88 8006E188 80790004 */ lb $t9, 4($v1) /* 06ED8C 8006E18C 3C098012 */ lui $t1, %hi(D_80123504) # $t1, 0x8012 /* 06ED90 8006E190 25293504 */ addiu $t1, %lo(D_80123504) # addiu $t1, $t1, 0x3504 -/* 06ED94 8006E194 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 +/* 06ED94 8006E194 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 /* 06ED98 8006E198 AD180000 */ sw $t8, ($t0) /* 06ED9C 8006E19C AD390000 */ sw $t9, ($t1) -/* 06EDA0 8006E1A0 AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EDA0 8006E1A0 AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EDA4 8006E1A4 806C000C */ lb $t4, 0xc($v1) /* 06EDA8 8006E1A8 3C0B8012 */ lui $t3, %hi(D_80123508) # $t3, 0x8012 /* 06EDAC 8006E1AC 256B3508 */ addiu $t3, %lo(D_80123508) # addiu $t3, $t3, 0x3508 @@ -353,8 +353,8 @@ glabel L8006E0E0 /* 06EE20 8006E220 8FBF0024 */ lw $ra, 0x24($sp) /* 06EE24 8006E224 0C01B6F9 */ jal func_8006DBE4 /* 06EE28 8006E228 00000000 */ nop -/* 06EE2C 8006E22C 3C198012 */ lui $t9, %hi(D_801234E8) # $t9, 0x8012 -/* 06EE30 8006E230 8F3934E8 */ lw $t9, %lo(D_801234E8)($t9) +/* 06EE2C 8006E22C 3C198012 */ lui $t9, %hi(gSPTaskNum) # $t9, 0x8012 +/* 06EE30 8006E230 8F3934E8 */ lw $t9, %lo(gSPTaskNum)($t9) /* 06EE34 8006E234 3C0D8012 */ lui $t5, %hi(gDisplayLists) # $t5, 0x8012 /* 06EE38 8006E238 00196080 */ sll $t4, $t9, 2 /* 06EE3C 8006E23C 01AC6821 */ addu $t5, $t5, $t4 @@ -372,9 +372,9 @@ glabel L8006E0E0 /* 06EE6C 8006E26C AC400004 */ sw $zero, 4($v0) /* 06EE70 8006E270 AC590000 */ sw $t9, ($v0) /* 06EE74 8006E274 3C0A8012 */ lui $t2, %hi(D_80123518) # $t2, 0x8012 -/* 06EE78 8006E278 3C018012 */ lui $at, %hi(D_801234EC) # $at, 0x8012 +/* 06EE78 8006E278 3C018012 */ lui $at, %hi(sRenderContext) # $at, 0x8012 /* 06EE7C 8006E27C 254A3518 */ addiu $t2, %lo(D_80123518) # addiu $t2, $t2, 0x3518 -/* 06EE80 8006E280 AC2034EC */ sw $zero, %lo(D_801234EC)($at) +/* 06EE80 8006E280 AC2034EC */ sw $zero, %lo(sRenderContext)($at) /* 06EE84 8006E284 8D460000 */ lw $a2, ($t2) /* 06EE88 8006E288 8FA4002C */ lw $a0, 0x2c($sp) /* 06EE8C 8006E28C 0C01B2B9 */ jal func_8006CAE4 diff --git a/asm/non_matchings/unknown_06B2B0/func_8006ECFC.s b/asm/non_matchings/unknown_06B2B0/func_8006ECFC.s index ff75ab6a..21abd3e0 100644 --- a/asm/non_matchings/unknown_06B2B0/func_8006ECFC.s +++ b/asm/non_matchings/unknown_06B2B0/func_8006ECFC.s @@ -137,8 +137,8 @@ glabel func_8006ECFC /* 06FB08 8006EF08 0C01C42C */ jal set_free_queue_state /* 06FB0C 8006EF0C AC2E3534 */ sw $t6, %lo(gCurrNumHudVertsPerPlayer)($at) .L8006EF10: -/* 06FB10 8006EF10 3C038012 */ lui $v1, %hi(D_801234E8) # $v1, 0x8012 -/* 06FB14 8006EF14 8C6334E8 */ lw $v1, %lo(D_801234E8)($v1) +/* 06FB10 8006EF10 3C038012 */ lui $v1, %hi(gSPTaskNum) # $v1, 0x8012 +/* 06FB14 8006EF14 8C6334E8 */ lw $v1, %lo(gSPTaskNum)($v1) /* 06FB18 8006EF18 3C118012 */ lui $s1, %hi(gDisplayLists) # $s1, 0x8012 /* 06FB1C 8006EF1C 263111F0 */ addiu $s1, %lo(gDisplayLists) # addiu $s1, $s1, 0x11f0 /* 06FB20 8006EF20 00037880 */ sll $t7, $v1, 2 diff --git a/asm/non_matchings/unknown_09F8F0/func_800A01A0.s b/asm/non_matchings/unknown_09F8F0/func_800A01A0.s index 6502e3a2..b7da7ea3 100644 --- a/asm/non_matchings/unknown_09F8F0/func_800A01A0.s +++ b/asm/non_matchings/unknown_09F8F0/func_800A01A0.s @@ -45,7 +45,7 @@ glabel func_800A01A0 /* 0A0E40 800A0240 314B0002 */ andi $t3, $t2, 2 /* 0A0E44 800A0244 15600248 */ bnez $t3, .L800A0B68 /* 0A0E48 800A0248 8FBF0024 */ lw $ra, 0x24($sp) -/* 0A0E4C 800A024C 0C01B683 */ jal func_8006DA0C +/* 0A0E4C 800A024C 0C01B683 */ jal get_render_context /* 0A0E50 800A0250 00000000 */ nop /* 0A0E54 800A0254 24030001 */ li $v1, 1 /* 0A0E58 800A0258 10430242 */ beq $v0, $v1, .L800A0B64 @@ -323,10 +323,10 @@ glabel func_800A01A0 /* 0A1258 800A0658 244E0008 */ addiu $t6, $v0, 8 /* 0A125C 800A065C AC8E0000 */ sw $t6, ($a0) /* 0A1260 800A0660 AC400004 */ sw $zero, 4($v0) -/* 0A1264 800A0664 0C01E037 */ jal func_800780DC +/* 0A1264 800A0664 0C01E037 */ jal init_rsp /* 0A1268 800A0668 AC580000 */ sw $t8, ($v0) /* 0A126C 800A066C 3C048012 */ lui $a0, %hi(D_80126CFC) # $a0, 0x8012 -/* 0A1270 800A0670 0C01E015 */ jal func_80078054 +/* 0A1270 800A0670 0C01E015 */ jal init_rdp_and_framebuffer /* 0A1274 800A0674 24846CFC */ addiu $a0, %lo(D_80126CFC) # addiu $a0, $a0, 0x6cfc /* 0A1278 800A0678 0C01EB8A */ jal func_8007AE28 /* 0A127C 800A067C 2404FFFF */ li $a0, -1 diff --git a/asm/non_matchings/unknown_09F8F0/func_800A22F4.s b/asm/non_matchings/unknown_09F8F0/func_800A22F4.s index ae5eba3d..3ceca655 100644 --- a/asm/non_matchings/unknown_09F8F0/func_800A22F4.s +++ b/asm/non_matchings/unknown_09F8F0/func_800A22F4.s @@ -40,7 +40,7 @@ glabel func_800A22F4 /* 0A2F88 800A2388 3C018012 */ lui $at, %hi(D_80126CD5) # $at, 0x8012 /* 0A2F8C 800A238C 3C048012 */ lui $a0, %hi(D_80126CFC) # $a0, 0x8012 /* 0A2F90 800A2390 A0206CD5 */ sb $zero, %lo(D_80126CD5)($at) -/* 0A2F94 800A2394 0C01E015 */ jal func_80078054 +/* 0A2F94 800A2394 0C01E015 */ jal init_rdp_and_framebuffer /* 0A2F98 800A2398 24846CFC */ addiu $a0, %lo(D_80126CFC) # addiu $a0, $a0, 0x6cfc /* 0A2F9C 800A239C 3C048012 */ lui $a0, %hi(D_80126CFC) # $a0, 0x8012 /* 0A2FA0 800A23A0 0C01ECF4 */ jal func_8007B3D0 diff --git a/src/audio.c b/src/audio.c index cd909467..8d1a2793 100644 --- a/src/audio.c +++ b/src/audio.c @@ -281,12 +281,12 @@ void func_80000CBC(void) { set_relative_volume_for_music(musicRelativeVolume); } -void func_80000D00(u8 arg0) { +void func_80000D00(u8 mulFactor) { s32 reg_s2; s32 j; if (D_80115D3C > 0) { - D_80115D38 += arg0; + D_80115D38 += mulFactor; D_800DC650 = ((f32)D_80115D38) / ((f32)D_80115D3C); if ((f64)D_800DC650 > 1.0f) { @@ -297,7 +297,7 @@ void func_80000D00(u8 arg0) { set_relative_volume_for_music(musicRelativeVolume); } else if (D_80115D3C < 0) { - D_80115D38 -= arg0; + D_80115D38 -= mulFactor; D_800DC650 = 1.0f - ((f32)D_80115D38) / ((f32)D_80115D3C); if ((f64)D_800DC650 < 0) { D_80115D38 = 0; @@ -308,9 +308,9 @@ void func_80000D00(u8 arg0) { } if (D_800DC658 > 0) { - //reg_arg0 = arg0; + //reg_arg0 = mulFactor; for (reg_s2 = 0; reg_s2 < D_800DC658;) { - D_80115D48[reg_s2].unk2 -= arg0; + D_80115D48[reg_s2].unk2 -= mulFactor; if (D_80115D48[reg_s2].unk2 <= 0) { j = reg_s2; func_80001D04(D_80115D48[reg_s2].unk0, D_80115D48[reg_s2].unk4); diff --git a/src/controller_pak.c b/src/controller_pak.c index b74fb724..246b8ca7 100644 --- a/src/controller_pak.c +++ b/src/controller_pak.c @@ -201,7 +201,7 @@ s32 func_8007497C(u64 *arg0) { *arg0 <<= 8; *arg0 >>= 8; *arg0 |= (s64)((s32)func_8007480C(*arg0)) << 56; - if (func_8006EAC0() == 0) { + if (check_reset_pressed() == 0) { osEepromWrite(func_8006A100(), 0xF, (u8 *)arg0); } return 1; diff --git a/src/fade_transition.c b/src/fade_transition.c index 3c37406f..9c73ed56 100644 --- a/src/fade_transition.c +++ b/src/fade_transition.c @@ -288,12 +288,12 @@ s32 func_800C01D8(FadeTransition *transition) { GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C01D8.s") #endif -s32 func_800C0494(s32 arg0) { +s32 func_800C0494(s32 mulFactor) { if (D_800E31A4 != 0) { D_800E31A4 = D_800E31A4 - 1; - arg0 = 0; - } else if (arg0 >= 6) { - arg0 = 5; + mulFactor = 0; + } else if (mulFactor >= 6) { + mulFactor = 5; } if (D_800E31AC != 0) { @@ -308,19 +308,19 @@ s32 func_800C0494(s32 arg0) { } switch (gCurFaceTransition) { case FADE_FULLSCREEN: - func_800C0834(arg0); + func_800C0834(mulFactor); break; case FADE_BARNDOOR_HORIZONTAL: case FADE_BARNDOOR_VERTICAL: case FADE_WAVES: case FADE_BARNDOOR_DIAGONAL: - func_800C1130(arg0); + func_800C1130(mulFactor); break; case FADE_CIRCLE: - func_800C1EE8(arg0); + func_800C1EE8(mulFactor); break; case FADE_DISABLED: - func_800C27A0(arg0); + func_800C27A0(mulFactor); break; } } diff --git a/src/menu.c b/src/menu.c index 66c16a29..527bd541 100644 --- a/src/menu.c +++ b/src/menu.c @@ -93,21 +93,21 @@ unk801264A0 D_801264A0[4]; s32 D_801264D0; s32 D_801264D4; -s8 D_801264D8; +s8 sDialogueOption; s32 D_801264DC; s8 D_801264E0; s8 D_801264E1; -s8 D_801264E2; +s8 sCurrentMenuID; -s8 D_801264E2; +s8 sCurrentMenuID; s32 D_801264E4; s32 D_801264E8; s32 D_801264EC; s32 D_801264F0[2]; s32 D_801264F8[2]; s32 D_80126500; -s8 D_80126504; +s8 sDialogueOptionMax; s32 D_80126508; s16 D_8012650C; s8 D_8012650E; @@ -2140,10 +2140,10 @@ void func_800828B8(void) { } } -void func_800829F8(s32 arg0, s32 arg1) { +void func_800829F8(Gfx *dl, s32 mulFactor) { s32 temp; - D_800DF46C += arg1; + D_800DF46C += mulFactor; if (D_800DF46C & 0x10) { load_menu_text(get_language()); @@ -2154,7 +2154,7 @@ void func_800829F8(s32 arg0, s32 arg1) { if (osTvType == TV_TYPE_PAL) { temp = 0xEA; } - draw_text(arg0, -0x8000, temp, gMenuText[151], 0xC); + draw_text(dl, -0x8000, temp, gMenuText[151], 0xC); } } @@ -5935,8 +5935,8 @@ GLOBAL_ASM("asm/non_matchings/menu/func_8009CD7C.s") void func_8009CF68(s32 arg0) { if (D_800DF4E4[arg0] == 0) { if (arg0 != 3) { - D_801264E2 = 0; - D_801264D8 = 0; + sCurrentMenuID = 0; + sDialogueOption = 0; } D_800DF4E0 = 1; D_800DF4E4[arg0] = 1; @@ -5971,19 +5971,19 @@ s32 func_8009CFEC(u32 arg0) { func_800C4FBC(1, 0, 0, 0, 0x80); func_8001F450(); switch (arg0) { - case 0: + case DIALOG_TAJ: result = taj_menu_loop(); // Taj menu break; - case 2: + case DIALOG_TT: result = tt_menu_loop(); // T.T. menu break; - case 3: + case DIALOG_CHALLENGE: result = func_800C3564(); // Taj challenge completed/failed menu break; - case 4: + case DIALOG_TROPHY: result = trophy_race_cabinet_menu_loop(); // Trophy race cabinet menu break; - case 5: + case DIALOG_RACERESULT: result = func_8009D9F4(); break; } @@ -6003,30 +6003,30 @@ void func_8009D118(s32 arg0) { } void func_8009D1B8(s32 arg0, s32 arg1, s32 arg2) { - func_8009D118(D_801264D8 == D_80126504); - if (D_801264D8 == D_80126504) { + func_8009D118(sDialogueOption == sDialogueOptionMax); + if (sDialogueOption == sDialogueOptionMax) { D_80126516 = arg2; } func_800C5168(1, -0x8000, D_8012650E, arg0, 1, 4); D_8012650E = (s8)(D_8012650E + arg1); - D_80126504 = (s8)(D_80126504 + 1); + sDialogueOptionMax = (s8)(sDialogueOptionMax + 1); } void func_8009D26C(void) { if (gControllersYAxisDirection[0] < 0) { - D_801264D8 = D_801264D8 + 1; + sDialogueOption = sDialogueOption + 1; func_80001D04(0xB2, NULL); } else if (gControllersYAxisDirection[0] > 0) { - D_801264D8 = D_801264D8 - 1; + sDialogueOption = sDialogueOption - 1; func_80001D04(0xB2, NULL); } - if (D_801264D8 < 0) { - D_801264D8 = D_80126504 - 1; + if (sDialogueOption < 0) { + sDialogueOption = sDialogueOptionMax - 1; } - if (D_801264D8 >= D_80126504) { - D_801264D8 = 0; + if (sDialogueOption >= sDialogueOptionMax) { + sDialogueOption = 0; } } @@ -6039,8 +6039,8 @@ void func_8009D330(s32 arg0) { } void func_8009D33C(s32 arg0, s32 arg1) { - if (D_801264E2 == arg0) { - D_801264E2 = arg1; + if (sCurrentMenuID == arg0) { + sCurrentMenuID = arg1; } } @@ -6050,21 +6050,21 @@ s32 taj_menu_loop(void) { Settings *settings; // sp24 settings = get_settings(); - if ((D_800DF4DC != 0) && (D_801264E2 == 0)) { - D_801264E2 = -D_800DF4DC; + if ((D_800DF4DC != 0) && (sCurrentMenuID == 0)) { + sCurrentMenuID = -D_800DF4DC; } - if (D_801264E2 == 0) { - D_801264E2 = 1; + if (sCurrentMenuID == 0) { + sCurrentMenuID = 1; } - if ((D_801264E2 > 0) && (D_801264E2 < 4)) { + if ((sCurrentMenuID > 0) && (sCurrentMenuID < 4)) { func_800C4EDC(1, 0x18, 0x10, 0xB8, 0x7C); func_800C4F7C(1, 0); } sp2C = 0; buttonsPressed = get_buttons_pressed_from_player(0); - D_80126504 = 0; + sDialogueOptionMax = 0; - switch (D_801264E2) { + switch (sCurrentMenuID) { case 2: case 0x62: func_800C5168(1, -0x8000, 6, gMenuText[40], 1, 4); // VEHICLE SELECT @@ -6094,10 +6094,10 @@ s32 taj_menu_loop(void) { break; } - switch (D_801264E2) { + switch (sCurrentMenuID) { case 0: func_800C31EC(7); - D_801264E2 = 1; + sCurrentMenuID = 1; D_800DF4D8 = 1; break; case 1: @@ -6117,16 +6117,16 @@ s32 taj_menu_loop(void) { func_80001D04(0xEF, 0); switch (D_80126516) { case 1: - D_801264E2 = 3; - D_801264D8 = 0; + sCurrentMenuID = 3; + sDialogueOption = 0; func_8003AC3C(0x239, 1); break; case 2: sp2C = 3; break; case 0: - D_801264E2 = 2; - D_801264D8 = 0; + sCurrentMenuID = 2; + sDialogueOption = 0; func_8003AC3C(0x234, 1); break; } @@ -6137,15 +6137,15 @@ s32 taj_menu_loop(void) { if (buttonsPressed & B_BUTTON) { func_80001D04(0x241, 0); func_8003AC3C(0x238, 1); - D_801264E2 = 1; - D_801264D8 = 0; + sCurrentMenuID = 1; + sDialogueOption = 0; } else if (buttonsPressed & A_BUTTON) { if (D_80126516 != 3) { sp2C = D_80126516 | 0x80; - D_801264E2 = 0x62; + sCurrentMenuID = 0x62; } else { - D_801264E2 = 1; - D_801264D8 = 0; + sCurrentMenuID = 1; + sDialogueOption = 0; func_8003AC3C(0x238, 1); } } @@ -6155,42 +6155,42 @@ s32 taj_menu_loop(void) { if ((buttonsPressed & B_BUTTON) || ((buttonsPressed & A_BUTTON) && (D_80126516 == 3))) { func_80001D04(0x241, 0); func_8003AC3C(0x23A, 1); - D_801264E2 = 1; - D_801264D8 = 3; + sCurrentMenuID = 1; + sDialogueOption = 3; } else if (buttonsPressed & A_BUTTON) { sp2C = D_80126516 | 0x40; func_80001D04(0xEF, 0); - D_801264E2 = 0x63; + sCurrentMenuID = 0x63; } break; case -3: case -2: case -1: - func_800C31EC(8 - D_801264E2); - D_801264E2 = 4; + func_800C31EC(8 - sCurrentMenuID); + sCurrentMenuID = 4; break; case -4: func_800C31EC(0x11); D_800DF4DC = 0; - D_801264E2 = 1; - D_801264D8 = 3; + sCurrentMenuID = 1; + sDialogueOption = 3; break; case -5: func_800C31EC(0x15); D_800DF4DC = 0; - D_801264E2 = 7; - D_801264D8 = 0; + sCurrentMenuID = 7; + sDialogueOption = 0; break; case -8: case -7: case -6: - func_800C31EC(0xC - D_801264E2); - D_801264E2 = 6; - D_801264D8 = 0; + func_800C31EC(0xC - sCurrentMenuID); + sCurrentMenuID = 6; + sDialogueOption = 0; break; case 4: sp2C = (D_800DF4DC - 1) | 0x40; - D_801264E2 = 5; + sCurrentMenuID = 5; func_800C5620(1); break; case 5: @@ -6200,13 +6200,13 @@ s32 taj_menu_loop(void) { case 6: case 7: sp2C = 4; - if (D_801264E2 == 7) { + if (sCurrentMenuID == 7) { sp2C = 3; } D_800DF4E0 = 0; func_800C5620(1); D_800DF4DC = 0; - D_801264E2 = 0; + sCurrentMenuID = 0; break; } return sp2C; @@ -6220,7 +6220,7 @@ s32 func_8009D9F4(void) { func_800C4F7C(1, 0); state = 0; playerInput = get_buttons_pressed_from_player(0); - D_80126504 = 0; + sDialogueOptionMax = 0; D_800DF4DC = 0; func_800C5168(1, -0x8000, 6, gMenuText[49], 1, 4); // BETTER LUCK func_800C5168(1, -0x8000, 0x14, gMenuText[50], 1, 4); // NEXT TIME! @@ -6247,7 +6247,7 @@ s32 func_8009D9F4(void) { // Has a couple minor issues, but should be functionally equivalent. s32 tt_menu_loop(void) { Settings *settings; - s32 sp44; + s32 currentOption; s32 buttonsPressed; // sp40 s32 sp3C; s32 sp38; @@ -6261,23 +6261,23 @@ s32 tt_menu_loop(void) { settings->cutsceneFlags |= 2; } if (!(settings->cutsceneFlags & 2)) { - D_801264E2 = TT_MENU_INTRODUCTION; + sCurrentMenuID = TT_MENU_INTRODUCTION; } - if ((D_801264E2 != TT_MENU_GAME_STATUS) && (D_801264E2 != TT_MENU_INTRODUCTION)) { - sp44 = 0x78; + if ((sCurrentMenuID != TT_MENU_GAME_STATUS) && (sCurrentMenuID != TT_MENU_INTRODUCTION)) { + currentOption = 0x78; if (func_8001B780() != 0) { - sp44 = 0x88; + currentOption = 0x88; } - func_800C4EDC(1, 0x18, 0x10, 0xC0, sp44); + func_800C4EDC(1, 0x18, 0x10, 0xC0, currentOption); } else { func_800C4EDC(1, 0x18, 0x10, 0xB8, 0xDC); } func_800C4F7C(1, 0); - sp44 = 0; + currentOption = 0; buttonsPressed = get_buttons_pressed_from_player(0); - D_80126504 = 0; + sDialogueOptionMax = 0; D_8012650E = 0x20; - switch (D_801264E2) { + switch (sCurrentMenuID) { case TT_MENU_ROOT: case TT_MENU_EXIT: func_800C5168(1, -0x8000, 6, gMenuText[36], 1, 4); // OPTIONS @@ -6307,13 +6307,13 @@ s32 tt_menu_loop(void) { set_time_trial_enabled(FALSE); } } - if ((buttonsPressed & A_BUTTON) && (D_801264E2 != TT_MENU_EXIT)) { + if ((buttonsPressed & A_BUTTON) && (sCurrentMenuID != TT_MENU_EXIT)) { switch (D_80126516) { case 1: func_80001D04(0xEF, 0); D_80126398 = 0; D_8012639C = TT_MENU_ROOT; - D_801264E2 = TT_MENU_SAVE_GHOST; + sCurrentMenuID = TT_MENU_SAVE_GHOST; break; case 3: func_80001D04(0xEF, 0); @@ -6321,22 +6321,22 @@ s32 tt_menu_loop(void) { func_8009C674(&D_800E1E2C); func_8009C8A4(&D_800E1E40); D_800E1E28 = 1; - D_801264E2 = TT_MENU_GAME_STATUS; + sCurrentMenuID = TT_MENU_GAME_STATUS; break; } - sp44 = D_80126516 + 1; + currentOption = D_80126516 + 1; } else if (buttonsPressed & B_BUTTON) { func_80001D04(0x241, 0); - sp44 = 3; + currentOption = 3; } - if (D_801264E2 == TT_MENU_GAME_STATUS) { - sp44 = 0; + if (sCurrentMenuID == TT_MENU_GAME_STATUS) { + currentOption = 0; } - if (sp44 == 3) { - D_801264E2 = TT_MENU_EXIT; + if (currentOption == 3) { + sCurrentMenuID = TT_MENU_EXIT; } - if (D_801264E2 == TT_MENU_EXIT) { - sp44 = 3; + if (sCurrentMenuID == TT_MENU_EXIT) { + currentOption = 3; } break; case TT_MENU_CONT_PAK_ERROR_1: @@ -6356,12 +6356,12 @@ s32 tt_menu_loop(void) { } } if (buttonsPressed & (A_BUTTON | B_BUTTON)) { - D_801264E2 = TT_MENU_ROOT; + sCurrentMenuID = TT_MENU_ROOT; } break; case TT_MENU_GAME_STATUS: if (buttonsPressed & (A_BUTTON | B_BUTTON)) { - D_801264E2 = TT_MENU_ROOT; + sCurrentMenuID = TT_MENU_ROOT; D_800E1E28 = 0; func_8009C4A8(&D_800E1E2C); func_80036BCC(0x22F, 1); @@ -6375,7 +6375,7 @@ s32 tt_menu_loop(void) { } if (buttonsPressed & (A_BUTTON | B_BUTTON)) { settings->cutsceneFlags |= 2; - D_801264E2 = TT_MENU_ROOT; + sCurrentMenuID = TT_MENU_ROOT; } break; case TT_MENU_INSERT_CONT_PAK: @@ -6386,10 +6386,10 @@ s32 tt_menu_loop(void) { func_80001D04(0xEF, 0); D_80126398 = 0; D_8012639C = TT_MENU_INSERT_RUMBLE_PAK; - D_801264E2 = TT_MENU_SAVE_GHOST; + sCurrentMenuID = TT_MENU_SAVE_GHOST; } else if (buttonsPressed & B_BUTTON) { func_80001D04(0x241, 0); - D_801264E2 = TT_MENU_ROOT; + sCurrentMenuID = TT_MENU_ROOT; } break; case TT_MENU_INSERT_RUMBLE_PAK: @@ -6397,7 +6397,7 @@ s32 tt_menu_loop(void) { func_800C5168(1, -0x8000, 0x32, gMenuText[161], 1, 4); // the Rumble Pak func_800C5168(1, -0x8000, 0x42, gMenuText[162], 1, 4); // insert it now! if (buttonsPressed & (A_BUTTON | B_BUTTON | START_BUTTON)) { - D_801264E2 = TT_MENU_ROOT; + sCurrentMenuID = TT_MENU_ROOT; } break; case TT_MENU_SAVE_GHOST: @@ -6410,41 +6410,42 @@ s32 tt_menu_loop(void) { } switch (result) { case 0: - D_801264E2 = D_8012639C; + sCurrentMenuID = D_8012639C; break; case 7: - D_801264E2 = TT_MENU_INSERT_CONT_PAK; + sCurrentMenuID = TT_MENU_INSERT_CONT_PAK; break; case 1: D_801263A4 = &D_800E09D8; - D_801264E2 = TT_MENU_CONT_PAK_ERROR_1; + sCurrentMenuID = TT_MENU_CONT_PAK_ERROR_1; break; case 4: case 6: D_801263A4 = &D_800E09C4; - D_801264E2 = TT_MENU_CONT_PAK_ERROR_1; + sCurrentMenuID = TT_MENU_CONT_PAK_ERROR_1; break; case 9: D_801263A4 = &D_800E09EC; - D_801264E2 = TT_MENU_CONT_PAK_ERROR_1; + sCurrentMenuID = TT_MENU_CONT_PAK_ERROR_1; break; case 2: case 3: case 5: case 8: D_801263A4 = &D_800E09B0; - D_801264E2 = TT_MENU_CONT_PAK_ERROR_1; + sCurrentMenuID = TT_MENU_CONT_PAK_ERROR_1; break; } } break; } - if ((D_801264E2 == TT_MENU_CONT_PAK_ERROR_1) || - (D_801264E2 == TT_MENU_CONT_PAK_ERROR_2) || - (D_801264E2 == TT_MENU_CONT_PAK_ERROR_3)) { + if ((sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_1) || + (sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_2) || + (sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_3)) { func_800C5168(1, -0x8000, 6, gMenuText[64], 1, 4); // PAK ERROR } - return sp44; + + return currentOption; } #else GLOBAL_ASM("asm/non_matchings/menu/tt_menu_loop.s") @@ -6453,36 +6454,36 @@ GLOBAL_ASM("asm/non_matchings/menu/tt_menu_loop.s") GLOBAL_ASM("asm/non_matchings/menu/func_8009E3D0.s") s32 trophy_race_cabinet_menu_loop(void) { - s32 sp24; + s32 currentOption; s32 buttonsPressed; func_800C4EDC(1, 0x18, 0x10, 0xB8, 0x78); func_800C4F7C(1, 0); - sp24 = 0; + currentOption = 0; buttonsPressed = get_buttons_pressed_from_player(0); func_800C5168(1, -0x8000, 6, gMenuText[70], 1, 4); // TROPHY RACE if (gControllersYAxisDirection[0] < 0) { - D_801264D8++; + sDialogueOption++; } else if (gControllersYAxisDirection[0] > 0) { - D_801264D8--; + sDialogueOption--; } - if (D_801264D8 < 0) { - D_801264D8 = 0; + if (sDialogueOption < 0) { + sDialogueOption = 0; } - if (D_801264D8 > 1) { - D_801264D8 = 1; + if (sDialogueOption > 1) { + sDialogueOption = 1; } - func_8009D118(D_801264D8 == 0); + func_8009D118(sDialogueOption == 0); func_800C5168(1, -0x8000, 0x1E, gMenuText[180], 1, 4); // ENTER TROPHY RACE - func_8009D118(D_801264D8 == 1); + func_8009D118(sDialogueOption == 1); func_800C5168(1, -0x8000, 0x32, gMenuText[51], 1, 4); // EXIT if (buttonsPressed & A_BUTTON) { - sp24 = D_801264D8 + 1; + currentOption = sDialogueOption + 1; } if (buttonsPressed & B_BUTTON) { - sp24 = 2; + currentOption = 2; } - return sp24; + return currentOption; } void func_8009E9A0(void) { @@ -6496,7 +6497,7 @@ f32 func_8009E9B0(unk8012A7E8 *arg0, Gfx **arg1, s32 *arg2, s32 *arg3) { D_801263A8 = *arg2; D_801263AC = *arg3; func_80067F2C(&D_801263A0, &D_801263A8); - if (D_800E1E28 != 0 && D_801264E2 == 4) { + if (D_800E1E28 != 0 && sCurrentMenuID == 4) { func_8009E3D0(); } *arg1 = D_801263A0; diff --git a/src/menu.h b/src/menu.h index c8c86129..ddab56fa 100644 --- a/src/menu.h +++ b/src/menu.h @@ -17,6 +17,15 @@ #define TT_MENU_SAVE_GHOST 8 #define TT_MENU_EXIT 10 +enum DialogueMenuCases { + DIALOG_TAJ, + DIALOG_UNK_01, + DIALOG_TT, + DIALOG_CHALLENGE, + DIALOG_TROPHY, + DIALOG_RACERESULT, +}; + #define CHEAT(index) 1 << index typedef enum Cheats { @@ -656,7 +665,7 @@ s32 menu_loop(Gfx **arg0, s32 **arg1, s32 **arg2, s32 **arg3, s32 arg4); void func_80081800(s32 arg0, s32 arg1, s32 arg2, u8 arg3, u8 arg4, u8 arg5, u8 arg6); void func_80081E54(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5); void func_800828B8(void); -void func_800829F8(s32 arg0, s32 arg1); +void func_800829F8(Gfx *dl, s32 mulFactor); void menu_logos_screen_init(void); s32 menu_logo_screen_loop(s32 arg0); void func_80082FAC(void); diff --git a/src/thread0_epc.c b/src/thread0_epc.c index c8b104b2..a934fdd0 100644 --- a/src/thread0_epc.c +++ b/src/thread0_epc.c @@ -241,8 +241,8 @@ s32 func_800B76DC(void) { } } -void func_800B77D4(s32 arg0) { - D_800E3028 += arg0; +void func_800B77D4(s32 mulFactor) { + D_800E3028 += mulFactor; if (D_800E3028 >= 0x3D) { D_800E3028 = 0; D_800E3024++; diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 1c70d66d..b73c9e02 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -1284,7 +1284,7 @@ void func_8001E45C(s32 arg0) { D_8011AE7A = arg0; D_8011ADAC = 0; D_8011AE7E = (u8)1; - if (func_8006DA0C() == 1) { + if (get_render_context() == DRAW_MENU) { func_8006F42C(); } } diff --git a/src/unknown_06B2B0.c b/src/unknown_06B2B0.c index 95595428..0ed35143 100644 --- a/src/unknown_06B2B0.c +++ b/src/unknown_06B2B0.c @@ -101,7 +101,7 @@ s8 D_800DD3F0 = 0; FadeTransition D_800DD3F4 = FADE_TRANSITION(128, FADE_COLOR_BLACK, 20, 0); // Unused? FadeTransition D_800DD3FC = FADE_TRANSITION(0, FADE_COLOR_WHITE, 20, -1); -s32 D_800DD404 = 12; +s32 sLogicMulFactor = 12; FadeTransition D_800DD408 = FADE_TRANSITION(0, FADE_COLOR_WHITE, 30, -1); // Unused? char *D_800DD410[3] = { @@ -140,10 +140,10 @@ s32 *gHudTriangles[2]; s32 gCurrHudTris; s32 D_80121230[8]; s8 D_80121250[16]; -OSSched *D_80121260; -s32 D_80121268[2208]; //Padding -s32 D_801234E8; -s32 D_801234EC; +OSSched gMainSched; // 0x288 / 648 bytes +s8 D_80121268[8192]; // 0x2000 / 8192 bytes Padding? +s32 gSPTaskNum; +s32 sRenderContext; s32 D_801234F0; s32 D_801234F4; s32 D_801234F8; @@ -166,9 +166,9 @@ s32 gCurrNumF3dCmdsPerPlayer; s32 gCurrNumHudMatPerPlayer; s32 gCurrNumHudTrisPerPlayer; s32 gCurrNumHudVertsPerPlayer; -OSScClient *D_80123538[3]; -OSMesg *D_80123544; -OSMesgQueue *D_80123548; +OSScClient *gNMISched[3]; +OSMesg *gNMIMesgBuf; +OSMesgQueue *gNMIMesgQueue; s32 D_8012354C; s32 D_80123550[4]; s32 D_80123560[8]; @@ -706,7 +706,7 @@ void func_8006BFC8(s8 *arg0) { if ((get_filtered_cheats() << 6) < 0) { phi_s0 = 9; } - if (func_8006DA0C() == 1) { + if (get_render_context() == DRAW_MENU) { phi_s0 = 5; } gTempAssetTable = load_asset_section_from_rom(ASSET_UNKNOWN_0_TABLE); @@ -784,9 +784,9 @@ void thread3_main(s32 arg0) { func_8006C3E0(); D_800DD37C = func_8006A1C4(D_800DD37C, 0); D_80123520 = 0; - D_801234EC = -1; + sRenderContext = DRAW_INTRO; while (1) { - if (func_8006EAC0() != 0) { + if (check_reset_pressed() != 0) { func_80072708(); audioStopThread(); stop_thread30(); @@ -821,15 +821,15 @@ void func_8006C3E0(void) { mode = 28; } - osCreateScheduler(&D_80121260, &D_801234E8, /*priority*/ 13, (u8)mode, 1); + osCreateScheduler(&gMainSched, &gSPTaskNum, /*priority*/ 13, (u8)mode, 1); D_800DD3A0 = 0; if (func_8006EFB8() == 0) { D_800DD3A0 = 1; } - init_video(1, &D_80121260); + init_video(1, &gMainSched); func_80076BA0(); - func_80078100(&D_80121260); - audio_init(&D_80121260); + func_80078100(&gMainSched); + audio_init(&gMainSched); func_80008040(); D_800DD384 = func_8006A10C(); func_8007AC70(); @@ -845,14 +845,14 @@ void func_8006C3E0(void) { func_80075B18(); func_80081218(); create_and_start_thread30(); - osCreateMesgQueue(&D_80123548, &D_80123544, 1); - osScAddClient(&D_80121260, &D_80123538, &D_80123548, 3); + osCreateMesgQueue(&gNMIMesgQueue, &gNMIMesgBuf, 1); + osScAddClient(&gMainSched, &gNMISched, &gNMIMesgQueue, 3); D_80123560[0] = 0; D_80123504 = 0; D_80123508 = 0; - D_801234E8 = 0; + gSPTaskNum = 0; - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); @@ -862,42 +862,42 @@ void func_8006C3E0(void) { void render(void) { s32 phi_v0; s32 phi_v0_2; - s32 temp, temp2; + s32 tempLogicMulFactor, tempLogicMulFactorMax; osSetTime(0); if (D_800DD380 == 8) { - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; set_rsp_segment(&gCurrDisplayList, 0, 0); set_rsp_segment(&gCurrDisplayList, 1, gVideoCurrFramebuffer); set_rsp_segment(&gCurrDisplayList, 2, gVideoLastDepthBuffer); set_rsp_segment(&gCurrDisplayList, 4, gVideoCurrFramebuffer - 0x500); } if (D_800DD3F0 == 0) { - setupOSTasks(gDisplayLists[D_801234E8], gCurrDisplayList, 0); - D_801234E8 += 1; - D_801234E8 &= 1; + setupOSTasks(gDisplayLists[gSPTaskNum], gCurrDisplayList, 0); + gSPTaskNum += 1; + gSPTaskNum &= 1; } if (D_800DD3F0 != 0) { D_800DD3F0 -= 1; } - gCurrDisplayList = gDisplayLists[D_801234E8]; - gCurrHudMat = gHudMatrices[D_801234E8]; - gCurrHudVerts = gHudVertices[D_801234E8]; - gCurrHudTris = gHudTriangles[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; + gCurrHudMat = gHudMatrices[gSPTaskNum]; + gCurrHudVerts = gHudVertices[gSPTaskNum]; + gCurrHudTris = gHudTriangles[gSPTaskNum]; set_rsp_segment(&gCurrDisplayList, 0, 0); set_rsp_segment(&gCurrDisplayList, 1, gVideoLastFramebuffer); set_rsp_segment(&gCurrDisplayList, 2, gVideoLastDepthBuffer); set_rsp_segment(&gCurrDisplayList, 4, gVideoLastFramebuffer - 0x500); - func_800780DC(&gCurrDisplayList); - func_80078054(&gCurrDisplayList); + init_rsp(&gCurrDisplayList); + init_rdp_and_framebuffer(&gCurrDisplayList); render_background(&gCurrDisplayList, &gCurrHudMat, 1); - D_800DD37C = func_8006A1C4(D_800DD37C, D_800DD404); + D_800DD37C = func_8006A1C4(D_800DD37C, sLogicMulFactor); if (func_800B76DC() != 0) { render_epc_lock_up_display(); - D_801234EC = 5; + sRenderContext = DRAW_CRASH_SCREEN; } if (D_800DD3A0 != 0) { phi_v0 = 0; @@ -909,34 +909,34 @@ void render(void) { } } - switch (D_801234EC) { - case -1: // Pre-boot screen + switch (sRenderContext) { + case DRAW_INTRO: // Pre-boot screen func_8006F43C(); break; - case 1: // In a menu - func_8006DCF8(D_800DD404); + case DRAW_MENU: // In a menu + func_8006DCF8(sLogicMulFactor); break; - case 0: // In game (Controlling a character) - func_8006CCF0(D_800DD404); + case DRAW_GAME: // In game (Controlling a character) + func_8006CCF0(sLogicMulFactor); break; - case 5: // EPC (lockup display) - func_800B77D4(D_800DD404); + case DRAW_CRASH_SCREEN: // EPC (lockup display) + func_800B77D4(sLogicMulFactor); break; } // This is a good spot to place custom text if you want it to overlay it over ALL the // menus & gameplay. - func_80000D00((u8)D_800DD404); + func_80000D00((u8)sLogicMulFactor); func_800B5F78(&gCurrDisplayList); func_800C56FC(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); func_800C5620(4); func_800C5494(4); - if (func_800C0494(D_800DD404) != 0) { + if (func_800C0494(sLogicMulFactor) != 0) { render_fade_transition(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); } if ((D_80123520 >= 8) && (func_8006F4C8() != 0)) { - func_800829F8(&gCurrDisplayList, D_800DD404); + func_800829F8(&gCurrDisplayList, sLogicMulFactor); } gDPFullSync(gCurrDisplayList++); @@ -962,12 +962,15 @@ void render(void) { } func_80070B04(gVideoLastFramebuffer, gVideoCurrFramebuffer, gVideoCurrFramebuffer + phi_v0_2); } - - temp = func_8007A98C(D_800DD380); - D_800DD404 = temp; - temp2 = 6; - if (temp > temp2) { - D_800DD404 = temp2; + // tempLogicMulFactor will be set to a value 2 or higher, based on the framerate. + // the mul factor is hardcapped at 6, which happens at 10FPS. The mul factor + // affects frameskipping, to maintain consistent game speed, through the (many) + // dropped frames in DKR. + tempLogicMulFactor = func_8007A98C(D_800DD380); + sLogicMulFactor = tempLogicMulFactor; + tempLogicMulFactorMax = 6; + if (tempLogicMulFactor > tempLogicMulFactorMax) { + sLogicMulFactor = tempLogicMulFactorMax; } } @@ -1013,7 +1016,7 @@ void func_8006CC14(void) { func_800AE270(); func_800A003C(); func_800C30CC(); - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); set_free_queue_state(2); @@ -1021,7 +1024,7 @@ void func_8006CC14(void) { #ifdef NON_MATCHING // Almost matching except for a couple minor issues. -void func_8006CCF0(s32 arg0) { +void func_8006CCF0(s32 mulFactor) { s32 i, buttonHeldInputs, sp40, sp3C, buttonPressedInputs, phi_v1_2; sp40 = 0; @@ -1036,10 +1039,10 @@ void func_8006CCF0(s32 arg0) { buttonPressedInputs |= START_BUTTON; } if (!gIsPaused) { - func_80010994(arg0); + func_80010994(mulFactor); if (func_80066510() == 0 || func_8001139C()) { if ((buttonPressedInputs & START_BUTTON) && (func_8006C2F0() == 0) && (D_800DD390 == 0) - && (D_801234EC == 0) && (D_80123516 == 0) && (D_800DD394 == 0) && (D_800DD398 == 0)) { + && (sRenderContext == DRAW_GAME) && (D_80123516 == 0) && (D_800DD394 == 0) && (D_800DD398 == 0)) { buttonPressedInputs = 0; gIsPaused = TRUE; func_80093A40(); @@ -1048,7 +1051,7 @@ void func_8006CCF0(s32 arg0) { } else { func_80028FA0(1); } - D_800DD398 -= arg0; + D_800DD398 -= mulFactor; if (D_800DD398 < 0) { D_800DD398 = 0; } @@ -1057,13 +1060,13 @@ void func_8006CCF0(s32 arg0) { } gParticlePtrList_flush(); func_8001BF20(); - func_80024D54(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, arg0); - if (D_801234EC == 0) { + func_80024D54(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, mulFactor); + if (sRenderContext == DRAW_GAME) { // Ignore the user's L/R/Z buttons. buttonHeldInputs &= ~(L_TRIG | R_TRIG | Z_TRIG); } if (D_80123516 != 0) { - i = func_80095728(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, arg0); + i = func_80095728(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, mulFactor); switch (i - 1) { case 1: buttonHeldInputs |= (L_TRIG | Z_TRIG); @@ -1108,7 +1111,7 @@ void func_8006CCF0(s32 arg0) { break; } } - func_800C3440(arg0); + func_800C3440(mulFactor); i = func_800C3400(); if (i != 0) { if (i == 2) { @@ -1120,7 +1123,7 @@ void func_8006CCF0(s32 arg0) { } } if (gIsPaused) { - i = func_80094170(&gCurrDisplayList, arg0); + i = func_80094170(&gCurrDisplayList, mulFactor); switch (i - 1) { case 0: gIsPaused = FALSE; @@ -1167,9 +1170,9 @@ void func_8006CCF0(s32 arg0) { break; } } - func_80078054(&gCurrDisplayList); + init_rdp_and_framebuffer(&gCurrDisplayList); render_borders_for_multiplayer(&gCurrDisplayList); - func_800A8474(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, arg0); + func_800A8474(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, mulFactor); func_80077268(&gCurrDisplayList); if (D_800DD39C != 0) { if (func_800214C4() != 0) { @@ -1181,7 +1184,7 @@ void func_8006CCF0(s32 arg0) { } phi_v1_2 = FALSE; if (D_800DD390 != 0) { - D_800DD390 -= arg0; + D_800DD390 -= mulFactor; if (D_800DD390 <= 0) { D_800DD390 = 0; func_8006C1AC(0, 0, 0, 0); @@ -1190,7 +1193,7 @@ void func_8006CCF0(s32 arg0) { } } if (D_800DD394 > 0) { - D_800DD394 -= arg0; + D_800DD394 -= mulFactor; if (D_800DD394 <= 0) { buttonHeldInputs = L_TRIG; switch (D_80123524) { @@ -1270,7 +1273,7 @@ void func_8006CCF0(s32 arg0) { } } } - if (((buttonHeldInputs & L_TRIG) && (D_801234EC == 0)) || (D_801234FC != 0)) { + if (((buttonHeldInputs & L_TRIG) && (sRenderContext == DRAW_GAME)) || (D_801234FC != 0)) { gIsPaused = FALSE; D_800DD394 = 0; D_80123516 = 0; @@ -1364,9 +1367,9 @@ void func_8006D8E0(s32 arg0) { D_80123516 = arg0 + 1; } -void func_8006D8F0(s32 arg0) { +void func_8006D8F0(UNUSED s32 arg0) { s32 temp; - if (D_801234EC != 4) { + if (sRenderContext != DRAW_UNK_04) { D_801234F4 = D_80121250[0]; D_80123504 = 0; D_80123508 = 0x64; @@ -1383,7 +1386,7 @@ void func_8006D8F0(s32 arg0) { void func_8006D968(s8 *arg0) { s32 i; - if (D_801234EC != 4) { + if (sRenderContext != DRAW_UNK_04) { D_80121250[0] = D_801234F4; for (i = 0; i < 2; i++) { D_80121250[i + 2] = arg0[i + 8]; @@ -1399,18 +1402,18 @@ void func_8006D968(s8 *arg0) { } } -s32 func_8006DA0C(void) { - return D_801234EC; +s32 get_render_context(void) { + return sRenderContext; } -/* Unused? */ -void func_8006DA1C(s32 arg0) { - D_801234EC = arg0; +/* Unused function used to set the render context from outside this file */ +UNUSED void set_render_context(s32 changeTo) { + sRenderContext = changeTo; } void load_menu_with_level_background(s32 menuId, s32 levelId, s32 cutsceneId) { func_8006ECFC(0); - D_801234EC = 1; + sRenderContext = DRAW_MENU; D_801234F0 = 1; func_80004A60(0, 0x7FFF); func_80004A60(1, 0x7FFF); @@ -1481,7 +1484,7 @@ void func_8006DC58(s32 arg0) { func_8001BF20(); func_80024D54(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, arg0); func_800C3440(arg0); - func_80078054(&gCurrDisplayList); + init_rdp_and_framebuffer(&gCurrDisplayList); render_borders_for_multiplayer(&gCurrDisplayList); func_80077268(&gCurrDisplayList); } @@ -1489,15 +1492,15 @@ void func_8006DC58(s32 arg0) { #ifdef NON_MATCHING // Minor & regalloc issues. -void func_8006DCF8(s32 arg0) { +void func_8006DCF8(s32 mulFactor) { s32 menuLoopResult, temp, temp2, tempResult; gIsPaused = FALSE; D_80123516 = 0; if (!D_80123514 && D_801234F0) { - func_8006DC58(arg0); + func_8006DC58(mulFactor); } - menuLoopResult = menu_loop(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, arg0); + menuLoopResult = menu_loop(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, mulFactor); D_801234F0 = TRUE; if (menuLoopResult == -2) { D_801234F0 = FALSE; @@ -1505,14 +1508,14 @@ void func_8006DCF8(s32 arg0) { } if ((menuLoopResult != -1) && (menuLoopResult & 0x200)) { func_8006DBE4(); - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); D_801234F4 = menuLoopResult & 0x7F; D_80123518 = func_8006B0AC(D_801234F4); D_80123504 = 0; D_80123508 = 0x64; - D_801234EC = 0; + sRenderContext = DRAW_GAME; gIsPaused = FALSE; D_80123516 = 0; load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); @@ -1531,7 +1534,7 @@ void func_8006DCF8(s32 arg0) { D_801234F4 = 0; D_80123504 = 0; D_80123508 = 0x64; - D_801234EC = 0; + sRenderContext = DRAW_GAME; load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); func_8006EC48(get_save_file_index()); break; @@ -1539,7 +1542,7 @@ void func_8006DCF8(s32 arg0) { D_80123504 = 0; D_80123508 = 0x64; D_801234F4 = D_80121250[0]; - D_801234EC = 0; + sRenderContext = DRAW_GAME; // Minor issue with these 2 if statements temp2 = D_80121250[D_80121250[1] + 8]; temp = D_80121250[15]; @@ -1553,11 +1556,11 @@ void func_8006DCF8(s32 arg0) { func_8006EC48(get_save_file_index()); break; case 2: - D_801234EC = 0; + sRenderContext = DRAW_GAME; load_level_2(D_801234F4, D_80123500, D_80123504, D_80123518); break; case 3: - D_801234EC = 0; + sRenderContext = DRAW_GAME; D_801234F4 = D_80121250[0]; D_80123504 = D_80121250[15]; D_80123508 = D_80121250[D_80121250[1] + 8]; @@ -1573,7 +1576,7 @@ void func_8006DCF8(s32 arg0) { if ((menuLoopResult & 0x80) && (menuLoopResult != -1)) { func_8006DBE4(); // Minor issue here. - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); temp = menuLoopResult & 0x7F; @@ -1581,7 +1584,7 @@ void func_8006DCF8(s32 arg0) { D_80121250[0] = D_801234F4; D_801234F4 = D_80121250[temp + 2]; D_80123504 = D_80121250[temp + 4]; - D_801234EC = 0; + sRenderContext = DRAW_GAME; D_80123508 = D_80121250[temp + 12]; temp = get_player_selected_vehicle(0); D_80123500 = gSettingsPtr->gObjectCount - 1; @@ -1592,10 +1595,10 @@ void func_8006DCF8(s32 arg0) { } if (menuLoopResult > 0) { func_8006DBE4(); - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); - D_801234EC = 0; + sRenderContext = DRAW_GAME; func_8006CAE4(menuLoopResult, -1, D_80123518); if (gSettingsPtr->newGame && !is_in_tracks_mode()) { func_80000B28(); @@ -1612,7 +1615,7 @@ void load_level_for_menu(s32 levelId, s32 numberOfPlayers, s32 cutsceneId) { if (!D_80123514) { func_8006DBE4(); if (get_thread30_level_id_to_load() == 0) { - gCurrDisplayList = gDisplayLists[D_801234E8]; + gCurrDisplayList = gDisplayLists[gSPTaskNum]; gDPFullSync(gCurrDisplayList++); gSPEndDisplayList(gCurrDisplayList++); } @@ -1769,9 +1772,9 @@ s8 func_8006EAB0(void) { return D_80123516; } -s32 func_8006EAC0(void) { +s32 check_reset_pressed(void) { if (D_80123560[0] == 0) { - D_80123560[0] = (s32)((osRecvMesg(&D_80123548, NULL, 0) + 1) != 0); + D_80123560[0] = (s32)((osRecvMesg(&gNMIMesgQueue, NULL, 0) + 1) != 0); } return D_80123560[0]; } @@ -1821,7 +1824,7 @@ void func_8006EC18(s32 arg0) { } void func_8006EC48(s32 arg0) { - if (D_801234EC == 0 && !is_in_tracks_mode()) { + if (sRenderContext == DRAW_GAME && !is_in_tracks_mode()) { D_800DD37C &= -0xC01; D_800DD37C |= (0x40 | ((arg0 & 3) << 0xA)); } diff --git a/src/unknown_06B2B0.h b/src/unknown_06B2B0.h index 78c8aa30..2f74a406 100644 --- a/src/unknown_06B2B0.h +++ b/src/unknown_06B2B0.h @@ -5,6 +5,16 @@ #include "structs.h" #include "fade_transition.h" +enum RenderContext { + DRAW_INTRO = -1, + DRAW_GAME, + DRAW_MENU, + DRAW_UNK_02, + DRAW_UNK_03, + DRAW_UNK_04, + DRAW_CRASH_SCREEN, +}; + /* Size: 6 bytes */ typedef struct unk8012117C { s8 unk0; @@ -129,8 +139,8 @@ void func_8006D8A4(void); void func_8006D8E0(s32 arg0); void func_8006D8F0(s32 arg0); void func_8006D968(s8 *arg0); -s32 func_8006DA0C(void); -void func_8006DA1C(s32 arg0); +s32 get_render_context(void); +UNUSED void func_8006DA1C(s32 arg0); void load_menu_with_level_background(s32 menuId, s32 levelId, s32 cutsceneId); void func_8006DB14(s32 arg0); void func_8006DB20(s32 vehicleId); @@ -147,7 +157,7 @@ void func_8006EA58(void); Settings *get_settings(void); s8 is_game_paused(void); s8 func_8006EAB0(void); -s32 func_8006EAC0(void); +s32 check_reset_pressed(void); s32 func_8006EB14(void); void func_8006EB24(void); void func_8006EB40(void); diff --git a/src/unknown_078050.c b/src/unknown_078050.c index 107d0bf1..580a6a42 100644 --- a/src/unknown_078050.c +++ b/src/unknown_078050.c @@ -29,7 +29,7 @@ s32 D_800DE4D4 = 0; s32 D_800DE4D8 = 0; s32 D_800DE4DC = 0; -Gfx D_800DE4E0[] = { +Gfx dl_rsp_init[] = { gsSPClearGeometryMode(0x001F3204), gsSPTexture(0, 0, 0, 0, 0), gsSPSetGeometryMode(G_SHADING_SMOOTH | G_SHADE), @@ -38,7 +38,7 @@ Gfx D_800DE4E0[] = { }; // Default RDP settings -Gfx D_800DE520[] = { +Gfx dl_rdp_init[] = { gsDPSetCycleType(G_CYC_1CYCLE), gsDPPipelineMode(G_PM_1PRIMITIVE), gsDPSetTextureLOD(G_TL_TILE), @@ -266,15 +266,15 @@ void render_background(Gfx **dlist, s32 *arg1, s32 arg2) { GLOBAL_ASM("asm/non_matchings/unknown_078050/render_background.s") #endif -void func_80078054(Gfx **dlist) { +void init_rdp_and_framebuffer(Gfx **dlist) { s32 width = get_video_width_and_height_as_s32() & 0xFFF; gDPSetColorImage((*dlist)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, 0x01000000); gDPSetDepthImage((*dlist)++, 0x2000000); - gSPDisplayList((*dlist)++, D_800DE520); + gSPDisplayList((*dlist)++, dl_rdp_init); } -void func_800780DC(Gfx **dlist) { - gSPDisplayList((*dlist)++, D_800DE4E0); +void init_rsp(Gfx **dlist) { + gSPDisplayList((*dlist)++, dl_rsp_init); } void func_80078100(OSSched *sc) { diff --git a/src/unknown_078050.h b/src/unknown_078050.h index b10a75ea..30b8af57 100644 --- a/src/unknown_078050.h +++ b/src/unknown_078050.h @@ -32,8 +32,8 @@ s32 func_80077A54(void); void func_80077AAC(void *bufPtr, s32 arg1, s32 arg2); void func_80077B34(u8 arg0, u8 arg1, u8 arg2); void func_80077B5C(s32 red, s32 green, s32 blue); -void func_80078054(Gfx **dlist); -void func_800780DC(Gfx **dlist); +void init_rdp_and_framebuffer(Gfx **dlist); +void init_rsp(Gfx **dlist); void func_80078100(OSSched *sc); void func_80078170(u32 arg0, u32 arg1, u32 arg2); void func_80078778(s32 arg0, s32 arg1, s32 arg2, s32 arg3); diff --git a/src/video.c b/src/video.c index 3515ad7b..5f1c7f1d 100644 --- a/src/video.c +++ b/src/video.c @@ -233,9 +233,9 @@ void func_8007A974(void) { #ifdef NON_MATCHING // regalloc & stack issues s32 func_8007A98C(s32 arg0) { - s32 s0; + s32 tempMulFactor; - s0 = 1; + tempMulFactor = 1; if (D_801262D0 != 0) { D_801262D0--; if (D_801262D0 == 0) { @@ -250,28 +250,28 @@ s32 func_8007A98C(s32 arg0) { s0 &= 0xFF; } - if (s0 < D_80126309) { + if (tempMulFactor < D_80126309) { if (D_80126308 < 0x14) { D_80126308++; } if (D_80126308 == 0x14) { - D_80126309 = s0; + D_80126309 = tempMulFactor; D_80126308 = 0; } } else { D_80126308 = 0; - if ((D_80126309 >= s0) || (D_801262E4 > s0)) { - D_80126309 = s0; + if ((D_80126309 >= tempMulFactor) || (D_801262E4 > tempMulFactor)) { + D_80126309 = tempMulFactor; } } - while (s0 < D_80126309) { + while (tempMulFactor < D_80126309) { osRecvMesg(&D_801261A0, NULL, 1); - s0 += 1; - s0 &= 0xFF; + tempMulFactor += 1; + tempMulFactor &= 0xFF; } osViSwapBuffer(gVideoLastFramebuffer); osRecvMesg(&D_801261A0, NULL, 1); - return s0; + return tempMulFactor; } #else GLOBAL_ASM("asm/non_matchings/video/func_8007A98C.s") From 195f6d1125c3480abde8145321d7b2da7bb8c145 Mon Sep 17 00:00:00 2001 From: Antonio Date: Tue, 30 Nov 2021 18:41:54 -0800 Subject: [PATCH 11/18] Updated #include guards. --- include/audio_internal.h | 4 ++-- include/controller.h | 5 +++-- include/libultra_internal.h | 1 + include/sched.h | 1 + include/siint.h | 5 +++-- include/ultra64.h | 1 - include/viint.h | 5 +++-- src/asset_loading.h | 4 ++-- src/audio.h | 4 ++-- src/camera.h | 4 ++-- src/controller_pak.h | 4 ++-- src/menu.h | 4 ++-- src/object_models.h | 4 ++-- src/textures_sprites.h | 4 ++-- src/unknown_0ABDF0.h | 4 ++-- 15 files changed, 29 insertions(+), 25 deletions(-) diff --git a/include/audio_internal.h b/include/audio_internal.h index e1790d48..95e104a3 100644 --- a/include/audio_internal.h +++ b/include/audio_internal.h @@ -1,5 +1,5 @@ -#ifndef _AUDIO_INTERNAL_H -#define _AUDIO_INTERNAL_H +#ifndef _AUDIO_INTERNAL_H_ +#define _AUDIO_INTERNAL_H_ #include "PR/libaudio.h" diff --git a/include/controller.h b/include/controller.h index 7b0f66be..3da78fa4 100644 --- a/include/controller.h +++ b/include/controller.h @@ -1,5 +1,6 @@ -#ifndef _CONTROLLER_H -#define _CONTROLLER_H +#ifndef _CONTROLLER_H_ +#define _CONTROLLER_H_ + #include "libultra_internal.h" //#include diff --git a/include/libultra_internal.h b/include/libultra_internal.h index d39c66d6..df20d090 100644 --- a/include/libultra_internal.h +++ b/include/libultra_internal.h @@ -1,5 +1,6 @@ #ifndef _LIBULTRA_INTERNAL_H_ #define _LIBULTRA_INTERNAL_H_ + #include #endif diff --git a/include/sched.h b/include/sched.h index 74f51d5d..44d8d8bc 100644 --- a/include/sched.h +++ b/include/sched.h @@ -1,5 +1,6 @@ #ifndef _SCHED_H_ #define _SCHED_H_ + #include "types.h" #include "macros.h" #include "f3ddkr.h" diff --git a/include/siint.h b/include/siint.h index 9ce09884..e9fb2b83 100644 --- a/include/siint.h +++ b/include/siint.h @@ -1,5 +1,6 @@ -#ifndef _SIINT_H -#define _SIINT_H +#ifndef _SIINT_H_ +#define _SIINT_H_ + #include "PR/os_internal.h" #include "PR/rcp.h" diff --git a/include/ultra64.h b/include/ultra64.h index b61d4b35..e6e3b468 100644 --- a/include/ultra64.h +++ b/include/ultra64.h @@ -1,4 +1,3 @@ - #ifndef _ULTRA64_H_ #define _ULTRA64_H_ diff --git a/include/viint.h b/include/viint.h index 74cee418..3578fb3e 100644 --- a/include/viint.h +++ b/include/viint.h @@ -1,5 +1,6 @@ -#ifndef _VIINT_H -#define _VIINT_H +#ifndef _VIINT_H_ +#define _VIINT_H_ + #include "libultra_internal.h" #define OS_TV_TYPE_PAL 0 diff --git a/src/asset_loading.h b/src/asset_loading.h index d0ec4648..2efbc112 100644 --- a/src/asset_loading.h +++ b/src/asset_loading.h @@ -1,5 +1,5 @@ -#ifndef _UNKNOWN_0777A0_H_ -#define _UNKNOWN_0777A0_H_ +#ifndef _ASSET_LOADING_H_ +#define _ASSET_LOADING_H_ #include "types.h" #include "gzip.h" diff --git a/src/audio.h b/src/audio.h index 32fda725..f968978a 100644 --- a/src/audio.h +++ b/src/audio.h @@ -1,5 +1,5 @@ -#ifndef _UNKNOWN_001050_H_ -#define _UNKNOWN_001050_H_ +#ifndef _AUDIO_H_ +#define _AUDIO_H_ #include "types.h" #include "audio_internal.h" diff --git a/src/camera.h b/src/camera.h index c5303459..c606842c 100644 --- a/src/camera.h +++ b/src/camera.h @@ -1,5 +1,5 @@ -#ifndef _UNKNOWN_066AA0_H_ -#define _UNKNOWN_066AA0_H_ +#ifndef _CAMERA_H_ +#define _CAMERA_H_ #include "types.h" #include "macros.h" diff --git a/src/controller_pak.h b/src/controller_pak.h index 65a67f31..4d1e59ab 100644 --- a/src/controller_pak.h +++ b/src/controller_pak.h @@ -1,5 +1,5 @@ -#ifndef _UNKNOWN_072E50_H_ -#define _UNKNOWN_072E50_H_ +#ifndef _CONTROLLER_PAK_H_ +#define _CONTROLLER_PAK_H_ #include "types.h" #include "structs.h" diff --git a/src/menu.h b/src/menu.h index c0f41ccf..2df2b9ca 100644 --- a/src/menu.h +++ b/src/menu.h @@ -1,5 +1,5 @@ -#ifndef _UNKNOWN_080500_H_ -#define _UNKNOWN_080500_H_ +#ifndef _MENU_H_ +#define _MENU_H_ #include "types.h" #include "structs.h" diff --git a/src/object_models.h b/src/object_models.h index 4a2eed19..77def6e7 100644 --- a/src/object_models.h +++ b/src/object_models.h @@ -1,5 +1,5 @@ -#ifndef _UNKNOWN_060450_H_ -#define _UNKNOWN_060450_H_ +#ifndef _OBJECT_MODELS_H_ +#define _OBJECT_MODELS_H_ #include "types.h" #include "PR/gbi.h" diff --git a/src/textures_sprites.h b/src/textures_sprites.h index 737b2e4c..5bdd4565 100644 --- a/src/textures_sprites.h +++ b/src/textures_sprites.h @@ -1,5 +1,5 @@ -#ifndef _UNKNOWN_07B870_H_ -#define _UNKNOWN_07B870_H_ +#ifndef _TEXTURES_SPRITES_H_ +#define _TEXTURES_SPRITES_H_ #include "asset_sections.h" #include "types.h" diff --git a/src/unknown_0ABDF0.h b/src/unknown_0ABDF0.h index e1d883c7..091976e2 100644 --- a/src/unknown_0ABDF0.h +++ b/src/unknown_0ABDF0.h @@ -1,5 +1,5 @@ -#ifndef _THREAD30_H_ -#define _THREAD30_H_ +#ifndef _UNKNOWN_0ABDF0_H_ +#define _UNKNOWN_0ABDF0_H_ #include "types.h" #include "textures_sprites.h" From b05c9873734fe94491bf90c037a0b4135476c9d9 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 1 Dec 2021 20:32:55 +0000 Subject: [PATCH 12/18] Label menu.c and font.c d --- asm/non_matchings/font/func_800C45A4.s | 8 +- asm/non_matchings/font/func_800C4DA0.s | 4 +- ...func_800C5168.s => render_dialogue_text.s} | 6 +- asm/non_matchings/game_text/func_800C2B00.s | 12 +- asm/non_matchings/game_text/func_800C3564.s | 8 +- asm/non_matchings/game_text/func_800C38B4.s | 6 +- asm/non_matchings/menu/func_80084854.s | 4 +- asm/non_matchings/menu/func_800871D8.s | 14 +- asm/non_matchings/menu/func_80088938.s | 36 +-- asm/non_matchings/menu/func_80092E94.s | 2 +- asm/non_matchings/menu/func_80093D40.s | 30 +-- asm/non_matchings/menu/func_80094D28.s | 26 +-- asm/non_matchings/menu/func_80096978.s | 24 +- asm/non_matchings/menu/func_80099E8C.s | 16 +- .../menu/render_magic_codes_ui.s | 8 +- .../menu/render_track_select_setup_ui.s | 4 +- asm/non_matchings/menu/tt_menu_loop.s | 42 ++-- .../unknown_032760/func_80042A90.s | 8 +- include/structs.h | 36 +-- src/font.c | 220 +++++++++--------- src/font.h | 23 +- src/menu.c | 190 +++++++-------- src/menu.h | 8 +- 23 files changed, 374 insertions(+), 361 deletions(-) rename asm/non_matchings/font/{func_800C5168.s => render_dialogue_text.s} (97%) diff --git a/asm/non_matchings/font/func_800C45A4.s b/asm/non_matchings/font/func_800C45A4.s index b81a234e..a75f8509 100644 --- a/asm/non_matchings/font/func_800C45A4.s +++ b/asm/non_matchings/font/func_800C45A4.s @@ -32,10 +32,10 @@ glabel func_800C45A4 /* 0C5208 800C4608 3C18800E */ lui $t8, %hi(D_800E3690) # $t8, 0x800e /* 0C520C 800C460C 27183690 */ addiu $t8, %lo(D_800E3690) # addiu $t8, $t8, 0x3690 /* 0C5210 800C4610 3C0F0600 */ lui $t7, 0x600 -/* 0C5214 800C4614 3C198013 */ lui $t9, %hi(D_8012A7E8) # $t9, 0x8013 +/* 0C5214 800C4614 3C198013 */ lui $t9, %hi(gDialogueBoxBackground) # $t9, 0x8013 /* 0C5218 800C4618 AC6F0000 */ sw $t7, ($v1) /* 0C521C 800C461C AC780004 */ sw $t8, 4($v1) -/* 0C5220 800C4620 8F39A7E8 */ lw $t9, %lo(D_8012A7E8)($t9) +/* 0C5220 800C4620 8F39A7E8 */ lw $t9, %lo(gDialogueBoxBackground)($t9) /* 0C5224 800C4624 3C014080 */ li $at, 0x40800000 # 4.000000 /* 0C5228 800C4628 10B9005B */ beq $a1, $t9, .L800C4798 /* 0C522C 800C462C 326E0005 */ andi $t6, $s3, 5 @@ -518,10 +518,10 @@ glabel L800C4AE8 /* 0C592C 800C4D2C 3C18E700 */ lui $t8, 0xe700 /* 0C5930 800C4D30 246F0008 */ addiu $t7, $v1, 8 /* 0C5934 800C4D34 AE2F0000 */ sw $t7, ($s1) -/* 0C5938 800C4D38 3C0E8013 */ lui $t6, %hi(D_8012A7E8) # $t6, 0x8013 +/* 0C5938 800C4D38 3C0E8013 */ lui $t6, %hi(gDialogueBoxBackground) # $t6, 0x8013 /* 0C593C 800C4D3C AC600004 */ sw $zero, 4($v1) /* 0C5940 800C4D40 AC780000 */ sw $t8, ($v1) -/* 0C5944 800C4D44 8DCEA7E8 */ lw $t6, %lo(D_8012A7E8)($t6) +/* 0C5944 800C4D44 8DCEA7E8 */ lw $t6, %lo(gDialogueBoxBackground)($t6) /* 0C5948 800C4D48 00000000 */ nop /* 0C594C 800C4D4C 124E0003 */ beq $s2, $t6, .L800C4D5C /* 0C5950 800C4D50 00000000 */ nop diff --git a/asm/non_matchings/font/func_800C4DA0.s b/asm/non_matchings/font/func_800C4DA0.s index 80f22beb..8381c319 100644 --- a/asm/non_matchings/font/func_800C4DA0.s +++ b/asm/non_matchings/font/func_800C4DA0.s @@ -7,8 +7,8 @@ glabel func_800C4DA0 .L800C4DB0: /* 0C59B0 800C4DB0 04C10006 */ bgez $a2, .L800C4DCC /* 0C59B4 800C4DB4 00A01825 */ move $v1, $a1 -/* 0C59B8 800C4DB8 3C0E8013 */ lui $t6, %hi(D_8012A7E8) # $t6, 0x8013 -/* 0C59BC 800C4DBC 8DCEA7E8 */ lw $t6, %lo(D_8012A7E8)($t6) +/* 0C59B8 800C4DB8 3C0E8013 */ lui $t6, %hi(gDialogueBoxBackground) # $t6, 0x8013 +/* 0C59BC 800C4DBC 8DCEA7E8 */ lw $t6, %lo(gDialogueBoxBackground)($t6) /* 0C59C0 800C4DC0 00000000 */ nop /* 0C59C4 800C4DC4 91C6001D */ lbu $a2, 0x1d($t6) /* 0C59C8 800C4DC8 00000000 */ nop diff --git a/asm/non_matchings/font/func_800C5168.s b/asm/non_matchings/font/render_dialogue_text.s similarity index 97% rename from asm/non_matchings/font/func_800C5168.s rename to asm/non_matchings/font/render_dialogue_text.s index 992e193e..059f9f4e 100644 --- a/asm/non_matchings/font/func_800C5168.s +++ b/asm/non_matchings/font/render_dialogue_text.s @@ -1,4 +1,4 @@ -glabel func_800C5168 +glabel render_dialogue_text /* 0C5D68 800C5168 27BDFEB8 */ addiu $sp, $sp, -0x148 /* 0C5D6C 800C516C AFB00018 */ sw $s0, 0x18($sp) /* 0C5D70 800C5170 00808025 */ move $s0, $a0 @@ -34,8 +34,8 @@ glabel func_800C5168 /* 0C5DD8 800C51D8 10E0008E */ beqz $a3, .L800C5414 /* 0C5DDC 800C51DC 240500FF */ li $a1, 255 /* 0C5DE0 800C51E0 00105080 */ sll $t2, $s0, 2 -/* 0C5DE4 800C51E4 3C0B8013 */ lui $t3, %hi(D_8012A7E8) # $t3, 0x8013 -/* 0C5DE8 800C51E8 8D6BA7E8 */ lw $t3, %lo(D_8012A7E8)($t3) +/* 0C5DE4 800C51E4 3C0B8013 */ lui $t3, %hi(gDialogueBoxBackground) # $t3, 0x8013 +/* 0C5DE8 800C51E8 8D6BA7E8 */ lw $t3, %lo(gDialogueBoxBackground)($t3) /* 0C5DEC 800C51EC 8FAC014C */ lw $t4, 0x14c($sp) /* 0C5DF0 800C51F0 01505021 */ addu $t2, $t2, $s0 /* 0C5DF4 800C51F4 24028000 */ li $v0, -32768 diff --git a/asm/non_matchings/game_text/func_800C2B00.s b/asm/non_matchings/game_text/func_800C2B00.s index 18949b5f..9403338c 100644 --- a/asm/non_matchings/game_text/func_800C2B00.s +++ b/asm/non_matchings/game_text/func_800C2B00.s @@ -25,7 +25,7 @@ glabel func_800C2B00 /* 0C375C 800C2B5C 86A50000 */ lh $a1, ($s5) /* 0C3760 800C2B60 86C70000 */ lh $a3, ($s6) /* 0C3764 800C2B64 24040006 */ li $a0, 6 -/* 0C3768 800C2B68 0C0313B7 */ jal func_800C4EDC +/* 0C3768 800C2B68 0C0313B7 */ jal set_dialogue_box_coords /* 0C376C 800C2B6C AFAE0010 */ sw $t6, 0x10($sp) /* 0C3770 800C2B70 3C178013 */ lui $s7, %hi(D_8012A7A8) # $s7, 0x8013 /* 0C3774 800C2B74 26F7A7A8 */ addiu $s7, %lo(D_8012A7A8) # addiu $s7, $s7, -0x5858 @@ -69,7 +69,7 @@ glabel func_800C2B00 /* 0C3808 800C2C08 8E4F0000 */ lw $t7, ($s2) /* 0C380C 800C2C0C 24040006 */ li $a0, 6 /* 0C3810 800C2C10 91E50005 */ lbu $a1, 5($t7) -/* 0C3814 800C2C14 0C0313DF */ jal func_800C4F7C +/* 0C3814 800C2C14 0C0313DF */ jal set_dialogue_font /* 0C3818 800C2C18 00000000 */ nop /* 0C381C 800C2C1C 8E420000 */ lw $v0, ($s2) /* 0C3820 800C2C20 24010004 */ li $at, 4 @@ -105,7 +105,7 @@ glabel func_800C2B00 /* 0C3890 800C2C90 018D0019 */ multu $t4, $t5 /* 0C3894 800C2C94 00007012 */ mflo $t6 /* 0C3898 800C2C98 000E7A03 */ sra $t7, $t6, 8 -/* 0C389C 800C2C9C 0C031400 */ jal func_800C5000 +/* 0C389C 800C2C9C 0C031400 */ jal set_text_colour /* 0C38A0 800C2CA0 AFAF0014 */ sw $t7, 0x14($sp) /* 0C38A4 800C2CA4 8E470000 */ lw $a3, ($s2) /* 0C38A8 800C2CA8 24180001 */ li $t8, 1 @@ -114,7 +114,7 @@ glabel func_800C2B00 /* 0C38B4 800C2CB4 02202825 */ move $a1, $s1 /* 0C38B8 800C2CB8 02603025 */ move $a2, $s3 /* 0C38BC 800C2CBC AFB00014 */ sw $s0, 0x14($sp) -/* 0C38C0 800C2CC0 0C03145A */ jal func_800C5168 +/* 0C38C0 800C2CC0 0C03145A */ jal render_dialogue_text /* 0C38C4 800C2CC4 24E70008 */ addiu $a3, $a3, 8 /* 0C38C8 800C2CC8 86E80000 */ lh $t0, ($s7) /* 0C38CC 800C2CCC 241900FF */ li $t9, 255 @@ -126,7 +126,7 @@ glabel func_800C2B00 /* 0C38E4 800C2CE4 24040006 */ li $a0, 6 /* 0C38E8 800C2CE8 00002825 */ move $a1, $zero /* 0C38EC 800C2CEC 00003025 */ move $a2, $zero -/* 0C38F0 800C2CF0 0C031400 */ jal func_800C5000 +/* 0C38F0 800C2CF0 0C031400 */ jal set_text_colour /* 0C38F4 800C2CF4 00003825 */ move $a3, $zero /* 0C38F8 800C2CF8 8E470000 */ lw $a3, ($s2) /* 0C38FC 800C2CFC 240B0001 */ li $t3, 1 @@ -135,7 +135,7 @@ glabel func_800C2B00 /* 0C3908 800C2D08 26250001 */ addiu $a1, $s1, 1 /* 0C390C 800C2D0C 26660001 */ addiu $a2, $s3, 1 /* 0C3910 800C2D10 AFB00014 */ sw $s0, 0x14($sp) -/* 0C3914 800C2D14 0C03145A */ jal func_800C5168 +/* 0C3914 800C2D14 0C03145A */ jal render_dialogue_text /* 0C3918 800C2D18 24E70008 */ addiu $a3, $a3, 8 /* 0C391C 800C2D1C 87CC0000 */ lh $t4, ($fp) /* 0C3920 800C2D20 26940001 */ addiu $s4, $s4, 1 diff --git a/asm/non_matchings/game_text/func_800C3564.s b/asm/non_matchings/game_text/func_800C3564.s index df862c3c..0b1bdd74 100644 --- a/asm/non_matchings/game_text/func_800C3564.s +++ b/asm/non_matchings/game_text/func_800C3564.s @@ -31,10 +31,10 @@ glabel func_800C3564 /* 0C41D8 800C35D8 24040001 */ li $a0, 1 /* 0C41DC 800C35DC 2405000A */ li $a1, 10 /* 0C41E0 800C35E0 2406000F */ li $a2, 15 -/* 0C41E4 800C35E4 0C0313B7 */ jal func_800C4EDC +/* 0C41E4 800C35E4 0C0313B7 */ jal set_dialogue_box_coords /* 0C41E8 800C35E8 240700B4 */ li $a3, 180 /* 0C41EC 800C35EC 8FA50040 */ lw $a1, 0x40($sp) -/* 0C41F0 800C35F0 0C0313DF */ jal func_800C4F7C +/* 0C41F0 800C35F0 0C0313DF */ jal set_dialogue_font /* 0C41F4 800C35F4 24040001 */ li $a0, 1 /* 0C41F8 800C35F8 240D0080 */ li $t5, 128 /* 0C41FC 800C35FC AFAD0010 */ sw $t5, 0x10($sp) @@ -50,7 +50,7 @@ glabel func_800C3564 /* 0C4224 800C3624 240F00FF */ li $t7, 255 /* 0C4228 800C3628 AFAF0014 */ sw $t7, 0x14($sp) /* 0C422C 800C362C 24040001 */ li $a0, 1 -/* 0C4230 800C3630 0C031400 */ jal func_800C5000 +/* 0C4230 800C3630 0C031400 */ jal set_text_colour /* 0C4234 800C3634 AFAE0010 */ sw $t6, 0x10($sp) /* 0C4238 800C3638 3C048013 */ lui $a0, %hi(D_8012A78E) # $a0, 0x8013 /* 0C423C 800C363C 8484A78E */ lh $a0, %lo(D_8012A78E)($a0) @@ -135,7 +135,7 @@ glabel func_800C3564 /* 0C4358 800C3758 8FA6006C */ lw $a2, 0x6c($sp) /* 0C435C 800C375C 02003825 */ move $a3, $s0 /* 0C4360 800C3760 AFAF0010 */ sw $t7, 0x10($sp) -/* 0C4364 800C3764 0C03145A */ jal func_800C5168 +/* 0C4364 800C3764 0C03145A */ jal render_dialogue_text /* 0C4368 800C3768 AFB80014 */ sw $t8, 0x14($sp) /* 0C436C 800C376C 8FB9006C */ lw $t9, 0x6c($sp) /* 0C4370 800C3770 8FA80070 */ lw $t0, 0x70($sp) diff --git a/asm/non_matchings/game_text/func_800C38B4.s b/asm/non_matchings/game_text/func_800C38B4.s index 8563d063..58ab9ebb 100644 --- a/asm/non_matchings/game_text/func_800C38B4.s +++ b/asm/non_matchings/game_text/func_800C38B4.s @@ -50,7 +50,7 @@ glabel L800C3958 /* 0C4558 800C3958 92050001 */ lbu $a1, 1($s0) /* 0C455C 800C395C 26310002 */ addiu $s1, $s1, 2 /* 0C4560 800C3960 24040001 */ li $a0, 1 -/* 0C4564 800C3964 0C0313DF */ jal func_800C4F7C +/* 0C4564 800C3964 0C0313DF */ jal set_dialogue_font /* 0C4568 800C3968 AE450000 */ sw $a1, ($s2) /* 0C456C 800C396C 8E790000 */ lw $t9, ($s3) /* 0C4570 800C3970 00000000 */ nop @@ -96,7 +96,7 @@ glabel L800C3984 /* 0C4604 800C3A04 26310005 */ addiu $s1, $s1, 5 /* 0C4608 800C3A08 01E2C021 */ addu $t8, $t7, $v0 /* 0C460C 800C3A0C AE580010 */ sw $t8, 0x10($s2) -/* 0C4610 800C3A10 0C0313B7 */ jal func_800C4EDC +/* 0C4610 800C3A10 0C0313B7 */ jal set_dialogue_box_coords /* 0C4614 800C3A14 AFB80010 */ sw $t8, 0x10($sp) /* 0C4618 800C3A18 8E680000 */ lw $t0, ($s3) /* 0C461C 800C3A1C 00000000 */ nop @@ -127,7 +127,7 @@ glabel L800C3A30 /* 0C467C 800C3A7C 26310005 */ addiu $s1, $s1, 5 /* 0C4680 800C3A80 AE480020 */ sw $t0, 0x20($s2) /* 0C4684 800C3A84 AFAA0014 */ sw $t2, 0x14($sp) -/* 0C4688 800C3A88 0C031400 */ jal func_800C5000 +/* 0C4688 800C3A88 0C031400 */ jal set_text_colour /* 0C468C 800C3A8C AFA80010 */ sw $t0, 0x10($sp) /* 0C4690 800C3A90 8E6B0000 */ lw $t3, ($s3) /* 0C4694 800C3A94 00000000 */ nop diff --git a/asm/non_matchings/menu/func_80084854.s b/asm/non_matchings/menu/func_80084854.s index f1f8caa1..f6cab963 100644 --- a/asm/non_matchings/menu/func_80084854.s +++ b/asm/non_matchings/menu/func_80084854.s @@ -139,7 +139,7 @@ glabel func_80084854 /* 08565C 80084A5C 24040007 */ li $a0, 7 /* 085660 80084A60 2405005E */ li $a1, 94 /* 085664 80084A64 24060075 */ li $a2, 117 -/* 085668 80084A68 0C0313B7 */ jal func_800C4EDC +/* 085668 80084A68 0C0313B7 */ jal set_dialogue_box_coords /* 08566C 80084A6C 240700E2 */ li $a3, 226 /* 085670 80084A70 02402025 */ move $a0, $s2 /* 085674 80084A74 00002825 */ move $a1, $zero @@ -151,7 +151,7 @@ glabel func_80084854 /* 08568C 80084A8C 24040007 */ li $a0, 7 /* 085690 80084A90 2405005E */ li $a1, 94 /* 085694 80084A94 2406009D */ li $a2, 157 -/* 085698 80084A98 0C0313B7 */ jal func_800C4EDC +/* 085698 80084A98 0C0313B7 */ jal set_dialogue_box_coords /* 08569C 80084A9C 240700E2 */ li $a3, 226 /* 0856A0 80084AA0 02402025 */ move $a0, $s2 /* 0856A4 80084AA4 00002825 */ move $a1, $zero diff --git a/asm/non_matchings/menu/func_800871D8.s b/asm/non_matchings/menu/func_800871D8.s index 67692e3c..ab066e27 100644 --- a/asm/non_matchings/menu/func_800871D8.s +++ b/asm/non_matchings/menu/func_800871D8.s @@ -71,7 +71,7 @@ glabel func_800871D8 /* 087EDC 800872DC 01001025 */ move $v0, $t0 /* 087EE0 800872E0 24040007 */ li $a0, 7 /* 087EE4 800872E4 24050028 */ li $a1, 40 -/* 087EE8 800872E8 0C0313B7 */ jal func_800C4EDC +/* 087EE8 800872E8 0C0313B7 */ jal set_dialogue_box_coords /* 087EEC 800872EC 24070118 */ li $a3, 280 /* 087EF0 800872F0 240B00A0 */ li $t3, 160 /* 087EF4 800872F4 AFAB0010 */ sw $t3, 0x10($sp) @@ -87,7 +87,7 @@ glabel func_800871D8 /* 087F1C 8008731C 0C031414 */ jal func_800C5050 /* 087F20 80087320 AFA00010 */ sw $zero, 0x10($sp) /* 087F24 80087324 24040007 */ li $a0, 7 -/* 087F28 80087328 0C0313DF */ jal func_800C4F7C +/* 087F28 80087328 0C0313DF */ jal set_dialogue_font /* 087F2C 8008732C 24050002 */ li $a1, 2 /* 087F30 80087330 240C00FF */ li $t4, 255 /* 087F34 80087334 AFAC0014 */ sw $t4, 0x14($sp) @@ -95,7 +95,7 @@ glabel func_800871D8 /* 087F3C 8008733C 240500FF */ li $a1, 255 /* 087F40 80087340 240600FF */ li $a2, 255 /* 087F44 80087344 240700FF */ li $a3, 255 -/* 087F48 80087348 0C031400 */ jal func_800C5000 +/* 087F48 80087348 0C031400 */ jal set_text_colour /* 087F4C 8008734C AFA00010 */ sw $zero, 0x10($sp) /* 087F50 80087350 3C02800E */ lui $v0, %hi(gMenuText) # $v0, 0x800e /* 087F54 80087354 8C42F4A0 */ lw $v0, %lo(gMenuText)($v0) @@ -125,12 +125,12 @@ glabel func_800871D8 /* 087FA8 800873A8 AFB90014 */ sw $t9, 0x14($sp) /* 087FAC 800873AC AFB80010 */ sw $t8, 0x10($sp) /* 087FB0 800873B0 24058000 */ li $a1, -32768 -/* 087FB4 800873B4 0C03145A */ jal func_800C5168 +/* 087FB4 800873B4 0C03145A */ jal render_dialogue_text /* 087FB8 800873B8 24060014 */ li $a2, 20 /* 087FBC 800873BC 24120034 */ li $s2, 52 /* 087FC0 800873C0 00009825 */ move $s3, $zero /* 087FC4 800873C4 24040007 */ li $a0, 7 -/* 087FC8 800873C8 0C0313DF */ jal func_800C4F7C +/* 087FC8 800873C8 0C0313DF */ jal set_dialogue_font /* 087FCC 800873CC 00002825 */ move $a1, $zero /* 087FD0 800873D0 8E830000 */ lw $v1, ($s4) /* 087FD4 800873D4 00138080 */ sll $s0, $s3, 2 @@ -149,7 +149,7 @@ glabel func_800871D8 /* 088004 80087404 24040007 */ li $a0, 7 /* 088008 80087408 24058000 */ li $a1, -32768 /* 08800C 8008740C 02403025 */ move $a2, $s2 -/* 088010 80087410 0C03145A */ jal func_800C5168 +/* 088010 80087410 0C03145A */ jal render_dialogue_text /* 088014 80087414 02203825 */ move $a3, $s1 /* 088018 80087418 8E830000 */ lw $v1, ($s4) /* 08801C 8008741C 26100004 */ addiu $s0, $s0, 4 @@ -175,7 +175,7 @@ glabel func_800871D8 /* 088064 80087464 24040007 */ li $a0, 7 /* 088068 80087468 24058000 */ li $a1, -32768 /* 08806C 8008746C 02403025 */ move $a2, $s2 -/* 088070 80087470 0C03145A */ jal func_800C5168 +/* 088070 80087470 0C03145A */ jal render_dialogue_text /* 088074 80087474 02203825 */ move $a3, $s1 /* 088078 80087478 8E990000 */ lw $t9, ($s4) /* 08807C 8008747C 26100004 */ addiu $s0, $s0, 4 diff --git a/asm/non_matchings/menu/func_80088938.s b/asm/non_matchings/menu/func_80088938.s index 59621ab3..39c6dbc6 100644 --- a/asm/non_matchings/menu/func_80088938.s +++ b/asm/non_matchings/menu/func_80088938.s @@ -84,7 +84,7 @@ glabel func_80088938 /* 089678 80088A78 24040006 */ li $a0, 6 /* 08967C 80088A7C 2405003A */ li $a1, 58 /* 089680 80088A80 02A03025 */ move $a2, $s5 -/* 089684 80088A84 0C0313B7 */ jal func_800C4EDC +/* 089684 80088A84 0C0313B7 */ jal set_dialogue_box_coords /* 089688 80088A88 24070106 */ li $a3, 262 /* 08968C 80088A8C 3C0F800E */ lui $t7, %hi(D_800DF460) # $t7, 0x800e /* 089690 80088A90 8DEFF460 */ lw $t7, %lo(D_800DF460)($t7) @@ -110,7 +110,7 @@ glabel func_80088938 /* 0896DC 80088ADC 2407005C */ li $a3, 92 /* 0896E0 80088AE0 24040006 */ li $a0, 6 .L80088AE4: -/* 0896E4 80088AE4 0C0313DF */ jal func_800C4F7C +/* 0896E4 80088AE4 0C0313DF */ jal set_dialogue_font /* 0896E8 80088AE8 00002825 */ move $a1, $zero /* 0896EC 80088AEC 240900FF */ li $t1, 255 /* 0896F0 80088AF0 AFA90014 */ sw $t1, 0x14($sp) @@ -118,7 +118,7 @@ glabel func_80088938 /* 0896F8 80088AF8 240500FF */ li $a1, 255 /* 0896FC 80088AFC 240600FF */ li $a2, 255 /* 089700 80088B00 240700FF */ li $a3, 255 -/* 089704 80088B04 0C031400 */ jal func_800C5000 +/* 089704 80088B04 0C031400 */ jal set_text_colour /* 089708 80088B08 AFA00010 */ sw $zero, 0x10($sp) /* 08970C 80088B0C 24040006 */ li $a0, 6 /* 089710 80088B10 00002825 */ move $a1, $zero @@ -138,7 +138,7 @@ glabel func_80088938 /* 089748 80088B48 AFAE0010 */ sw $t6, 0x10($sp) /* 08974C 80088B4C 24040006 */ li $a0, 6 /* 089750 80088B50 24058000 */ li $a1, -32768 -/* 089754 80088B54 0C03145A */ jal func_800C5168 +/* 089754 80088B54 0C03145A */ jal render_dialogue_text /* 089758 80088B58 24060002 */ li $a2, 2 /* 08975C 80088B5C 8EF80000 */ lw $t8, ($s7) /* 089760 80088B60 3C198012 */ lui $t9, %hi(D_80126BB0) # $t9, 0x8012 @@ -149,7 +149,7 @@ glabel func_80088938 /* 089774 80088B74 24040006 */ li $a0, 6 /* 089778 80088B78 24058000 */ li $a1, -32768 /* 08977C 80088B7C 24060010 */ li $a2, 16 -/* 089780 80088B80 0C03145A */ jal func_800C5168 +/* 089780 80088B80 0C03145A */ jal render_dialogue_text /* 089784 80088B84 AFB90010 */ sw $t9, 0x10($sp) /* 089788 80088B88 3C048012 */ lui $a0, %hi(D_801263A0) # $a0, 0x8012 /* 08978C 80088B8C 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 @@ -159,7 +159,7 @@ glabel func_80088938 /* 08979C 80088B9C 24070006 */ li $a3, 6 /* 0897A0 80088BA0 26B50022 */ addiu $s5, $s5, 0x22 /* 0897A4 80088BA4 24040006 */ li $a0, 6 -/* 0897A8 80088BA8 0C0313DF */ jal func_800C4F7C +/* 0897A8 80088BA8 0C0313DF */ jal set_dialogue_font /* 0897AC 80088BAC 24050001 */ li $a1, 1 /* 0897B0 80088BB0 24040006 */ li $a0, 6 /* 0897B4 80088BB4 00002825 */ move $a1, $zero @@ -180,7 +180,7 @@ glabel func_80088938 /* 0897EC 80088BEC 24040006 */ li $a0, 6 /* 0897F0 80088BF0 2405001C */ li $a1, 28 /* 0897F4 80088BF4 02A03025 */ move $a2, $s5 -/* 0897F8 80088BF8 0C0313B7 */ jal func_800C4EDC +/* 0897F8 80088BF8 0C0313B7 */ jal set_dialogue_box_coords /* 0897FC 80088BFC 24070124 */ li $a3, 292 /* 089800 80088C00 0621001A */ bgez $s1, .L80088C6C /* 089804 80088C04 3C0E800F */ lui $t6, %hi(D_800E820C) # $t6, 0x800f @@ -199,7 +199,7 @@ glabel func_80088938 /* 089838 80088C38 24040006 */ li $a0, 6 /* 08983C 80088C3C 240500E0 */ li $a1, 224 /* 089840 80088C40 240600E0 */ li $a2, 224 -/* 089844 80088C44 0C031400 */ jal func_800C5000 +/* 089844 80088C44 0C031400 */ jal set_text_colour /* 089848 80088C48 24070030 */ li $a3, 48 /* 08984C 80088C4C 8EE20000 */ lw $v0, ($s7) /* 089850 80088C50 3C0D8012 */ lui $t5, %hi(D_801263D8) # $t5, 0x8012 @@ -244,7 +244,7 @@ glabel func_80088938 /* 0898E0 80088CE0 24040006 */ li $a0, 6 /* 0898E4 80088CE4 24050010 */ li $a1, 16 /* 0898E8 80088CE8 24060010 */ li $a2, 16 -/* 0898EC 80088CEC 0C031400 */ jal func_800C5000 +/* 0898EC 80088CEC 0C031400 */ jal set_text_colour /* 0898F0 80088CF0 240700A0 */ li $a3, 160 /* 0898F4 80088CF4 3C0D8012 */ lui $t5, %hi(D_801263D8) # $t5, 0x8012 /* 0898F8 80088CF8 8DAD63D8 */ lw $t5, %lo(D_801263D8)($t5) @@ -265,7 +265,7 @@ glabel func_80088938 /* 089930 80088D30 24040006 */ li $a0, 6 /* 089934 80088D34 2405001A */ li $a1, 26 /* 089938 80088D38 24060002 */ li $a2, 2 -/* 08993C 80088D3C 0C03145A */ jal func_800C5168 +/* 08993C 80088D3C 0C03145A */ jal render_dialogue_text /* 089940 80088D40 02403825 */ move $a3, $s2 /* 089944 80088D44 240F0001 */ li $t7, 1 /* 089948 80088D48 AFAF0010 */ sw $t7, 0x10($sp) @@ -273,7 +273,7 @@ glabel func_80088938 /* 089950 80088D50 24050038 */ li $a1, 56 /* 089954 80088D54 24060002 */ li $a2, 2 /* 089958 80088D58 02003825 */ move $a3, $s0 -/* 08995C 80088D5C 0C03145A */ jal func_800C5168 +/* 08995C 80088D5C 0C03145A */ jal render_dialogue_text /* 089960 80088D60 AFA00014 */ sw $zero, 0x14($sp) /* 089964 80088D64 24190004 */ li $t9, 4 /* 089968 80088D68 AFB90014 */ sw $t9, 0x14($sp) @@ -281,7 +281,7 @@ glabel func_80088938 /* 089970 80088D70 240500F0 */ li $a1, 240 /* 089974 80088D74 24060002 */ li $a2, 2 /* 089978 80088D78 02803825 */ move $a3, $s4 -/* 08997C 80088D7C 0C03145A */ jal func_800C5168 +/* 08997C 80088D7C 0C03145A */ jal render_dialogue_text /* 089980 80088D80 AFB30010 */ sw $s3, 0x10($sp) /* 089984 80088D84 3C048012 */ lui $a0, %hi(D_801263A0) # $a0, 0x8012 /* 089988 80088D88 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 @@ -380,14 +380,14 @@ glabel func_80088938 /* 089AE4 80088EE4 0C031525 */ jal func_800C5494 /* 089AE8 80088EE8 24040006 */ li $a0, 6 /* 089AEC 80088EEC 24040006 */ li $a0, 6 -/* 089AF0 80088EF0 0C0313DF */ jal func_800C4F7C +/* 089AF0 80088EF0 0C0313DF */ jal set_dialogue_font /* 089AF4 80088EF4 00002825 */ move $a1, $zero /* 089AF8 80088EF8 26AE001C */ addiu $t6, $s5, 0x1c /* 089AFC 80088EFC AFAE0010 */ sw $t6, 0x10($sp) /* 089B00 80088F00 24040006 */ li $a0, 6 /* 089B04 80088F04 2405004C */ li $a1, 76 /* 089B08 80088F08 26A6FFE4 */ addiu $a2, $s5, -0x1c -/* 089B0C 80088F0C 0C0313B7 */ jal func_800C4EDC +/* 089B0C 80088F0C 0C0313B7 */ jal set_dialogue_box_coords /* 089B10 80088F10 240700F4 */ li $a3, 244 /* 089B14 80088F14 241800A0 */ li $t8, 160 /* 089B18 80088F18 AFB80010 */ sw $t8, 0x10($sp) @@ -409,7 +409,7 @@ glabel func_80088938 /* 089B54 80088F54 AFAF0010 */ sw $t7, 0x10($sp) /* 089B58 80088F58 240500FF */ li $a1, 255 /* 089B5C 80088F5C 00003025 */ move $a2, $zero -/* 089B60 80088F60 0C031400 */ jal func_800C5000 +/* 089B60 80088F60 0C031400 */ jal set_text_colour /* 089B64 80088F64 240700FF */ li $a3, 255 /* 089B68 80088F68 10000016 */ b .L80088FC4 /* 089B6C 80088F6C 8EEA0000 */ lw $t2, ($s7) @@ -424,7 +424,7 @@ glabel func_80088938 /* 089B8C 80088F8C 240500FF */ li $a1, 255 /* 089B90 80088F90 240600FF */ li $a2, 255 /* 089B94 80088F94 240700FF */ li $a3, 255 -/* 089B98 80088F98 0C031400 */ jal func_800C5000 +/* 089B98 80088F98 0C031400 */ jal set_text_colour /* 089B9C 80088F9C AFB60010 */ sw $s6, 0x10($sp) /* 089BA0 80088FA0 10000008 */ b .L80088FC4 /* 089BA4 80088FA4 8EEA0000 */ lw $t2, ($s7) @@ -433,7 +433,7 @@ glabel func_80088938 /* 089BAC 80088FAC AFAB0014 */ sw $t3, 0x14($sp) /* 089BB0 80088FB0 240600FF */ li $a2, 255 /* 089BB4 80088FB4 240700FF */ li $a3, 255 -/* 089BB8 80088FB8 0C031400 */ jal func_800C5000 +/* 089BB8 80088FB8 0C031400 */ jal set_text_colour /* 089BBC 80088FBC AFA00010 */ sw $zero, 0x10($sp) /* 089BC0 80088FC0 8EEA0000 */ lw $t2, ($s7) .L80088FC4: @@ -447,7 +447,7 @@ glabel func_80088938 /* 089BE0 80088FE0 AFB80014 */ sw $t8, 0x14($sp) /* 089BE4 80088FE4 24040006 */ li $a0, 6 /* 089BE8 80088FE8 24058000 */ li $a1, -32768 -/* 089BEC 80088FEC 0C03145A */ jal func_800C5168 +/* 089BEC 80088FEC 0C03145A */ jal render_dialogue_text /* 089BF0 80088FF0 02A03025 */ move $a2, $s5 /* 089BF4 80088FF4 12200003 */ beqz $s1, .L80089004 /* 089BF8 80088FF8 00000000 */ nop diff --git a/asm/non_matchings/menu/func_80092E94.s b/asm/non_matchings/menu/func_80092E94.s index 331f7b15..c07d082d 100644 --- a/asm/non_matchings/menu/func_80092E94.s +++ b/asm/non_matchings/menu/func_80092E94.s @@ -267,7 +267,7 @@ glabel func_80092E94 /* 093EA8 800932A8 AFAB0010 */ sw $t3, 0x10($sp) /* 093EAC 800932AC 24050086 */ li $a1, 134 /* 093EB0 800932B0 240700BA */ li $a3, 186 -/* 093EB4 800932B4 0C0313B7 */ jal func_800C4EDC +/* 093EB4 800932B4 0C0313B7 */ jal set_dialogue_box_coords /* 093EB8 800932B8 24460070 */ addiu $a2, $v0, 0x70 /* 093EBC 800932BC 02402025 */ move $a0, $s2 /* 093EC0 800932C0 00002825 */ move $a1, $zero diff --git a/asm/non_matchings/menu/func_80093D40.s b/asm/non_matchings/menu/func_80093D40.s index 90831a7d..9336a300 100644 --- a/asm/non_matchings/menu/func_80093D40.s +++ b/asm/non_matchings/menu/func_80093D40.s @@ -58,7 +58,7 @@ glabel func_80093D40 /* 094A0C 80093E0C 244700A0 */ addiu $a3, $v0, 0xa0 /* 094A10 80093E10 AFB80010 */ sw $t8, 0x10($sp) /* 094A14 80093E14 02503023 */ subu $a2, $s2, $s0 -/* 094A18 80093E18 0C0313B7 */ jal func_800C4EDC +/* 094A18 80093E18 0C0313B7 */ jal set_dialogue_box_coords /* 094A1C 80093E1C 24040007 */ li $a0, 7 /* 094A20 80093E20 3C11800E */ lui $s1, %hi(D_800E098C) # $s1, 0x800e /* 094A24 80093E24 2631098C */ addiu $s1, %lo(D_800E098C) # addiu $s1, $s1, 0x98c @@ -77,7 +77,7 @@ glabel func_80093D40 /* 094A58 80093E58 0C0313EF */ jal func_800C4FBC /* 094A5C 80093E5C AFAA0010 */ sw $t2, 0x10($sp) /* 094A60 80093E60 24040007 */ li $a0, 7 -/* 094A64 80093E64 0C0313DF */ jal func_800C4F7C +/* 094A64 80093E64 0C0313DF */ jal set_dialogue_font /* 094A68 80093E68 00002825 */ move $a1, $zero /* 094A6C 80093E6C 24040007 */ li $a0, 7 /* 094A70 80093E70 24050080 */ li $a1, 128 @@ -99,7 +99,7 @@ glabel func_80093D40 /* 094AB0 80093EB0 240E00FF */ li $t6, 255 /* 094AB4 80093EB4 AFAE0014 */ sw $t6, 0x14($sp) /* 094AB8 80093EB8 24040007 */ li $a0, 7 -/* 094ABC 80093EBC 0C031400 */ jal func_800C5000 +/* 094ABC 80093EBC 0C031400 */ jal set_text_colour /* 094AC0 80093EC0 AFAD0010 */ sw $t5, 0x10($sp) /* 094AC4 80093EC4 3C148012 */ lui $s4, %hi(D_801263BC) # $s4, 0x8012 /* 094AC8 80093EC8 8E9463BC */ lw $s4, %lo(D_801263BC)($s4) @@ -131,7 +131,7 @@ glabel func_80093D40 /* 094B2C 80093F2C AFAB0010 */ sw $t3, 0x10($sp) /* 094B30 80093F30 26260008 */ addiu $a2, $s1, 8 /* 094B34 80093F34 24040007 */ li $a0, 7 -/* 094B38 80093F38 0C03145A */ jal func_800C5168 +/* 094B38 80093F38 0C03145A */ jal render_dialogue_text /* 094B3C 80093F3C 24058000 */ li $a1, -32768 /* 094B40 80093F40 1000000C */ b .L80093F74 /* 094B44 80093F44 8E580000 */ lw $t8, ($s2) @@ -144,7 +144,7 @@ glabel func_80093D40 /* 094B5C 80093F5C 240F000C */ li $t7, 12 /* 094B60 80093F60 AFAF0014 */ sw $t7, 0x14($sp) /* 094B64 80093F64 AFAE0010 */ sw $t6, 0x10($sp) -/* 094B68 80093F68 0C03145A */ jal func_800C5168 +/* 094B68 80093F68 0C03145A */ jal render_dialogue_text /* 094B6C 80093F6C 26260008 */ addiu $a2, $s1, 8 /* 094B70 80093F70 8E580000 */ lw $t8, ($s2) .L80093F74: @@ -157,7 +157,7 @@ glabel func_80093D40 /* 094B8C 80093F8C 240500FF */ li $a1, 255 /* 094B90 80093F90 240600FF */ li $a2, 255 /* 094B94 80093F94 240700FF */ li $a3, 255 -/* 094B98 80093F98 0C031400 */ jal func_800C5000 +/* 094B98 80093F98 0C031400 */ jal set_text_colour /* 094B9C 80093F9C AFB40010 */ sw $s4, 0x10($sp) /* 094BA0 80093FA0 10000008 */ b .L80093FC4 /* 094BA4 80093FA4 00000000 */ nop @@ -167,7 +167,7 @@ glabel func_80093D40 /* 094BB0 80093FB0 240500FF */ li $a1, 255 /* 094BB4 80093FB4 240600FF */ li $a2, 255 /* 094BB8 80093FB8 240700FF */ li $a3, 255 -/* 094BBC 80093FBC 0C031400 */ jal func_800C5000 +/* 094BBC 80093FBC 0C031400 */ jal set_text_colour /* 094BC0 80093FC0 AFA00010 */ sw $zero, 0x10($sp) .L80093FC4: /* 094BC4 80093FC4 3C0A800E */ lui $t2, %hi(gMenuText) # $t2, 0x800e @@ -179,7 +179,7 @@ glabel func_80093D40 /* 094BDC 80093FDC AFAB0010 */ sw $t3, 0x10($sp) /* 094BE0 80093FE0 24040007 */ li $a0, 7 /* 094BE4 80093FE4 24058000 */ li $a1, -32768 -/* 094BE8 80093FE8 0C03145A */ jal func_800C5168 +/* 094BE8 80093FE8 0C03145A */ jal render_dialogue_text /* 094BEC 80093FEC 2626001C */ addiu $a2, $s1, 0x1c /* 094BF0 80093FF0 8E4D0000 */ lw $t5, ($s2) /* 094BF4 80093FF4 24010002 */ li $at, 2 @@ -191,7 +191,7 @@ glabel func_80093D40 /* 094C0C 8009400C 240500FF */ li $a1, 255 /* 094C10 80094010 240600FF */ li $a2, 255 /* 094C14 80094014 240700FF */ li $a3, 255 -/* 094C18 80094018 0C031400 */ jal func_800C5000 +/* 094C18 80094018 0C031400 */ jal set_text_colour /* 094C1C 8009401C AFB40010 */ sw $s4, 0x10($sp) /* 094C20 80094020 10000008 */ b .L80094044 /* 094C24 80094024 00000000 */ nop @@ -201,7 +201,7 @@ glabel func_80093D40 /* 094C30 80094030 240500FF */ li $a1, 255 /* 094C34 80094034 240600FF */ li $a2, 255 /* 094C38 80094038 240700FF */ li $a3, 255 -/* 094C3C 8009403C 0C031400 */ jal func_800C5000 +/* 094C3C 8009403C 0C031400 */ jal set_text_colour /* 094C40 80094040 AFA00010 */ sw $zero, 0x10($sp) .L80094044: /* 094C44 80094044 3C18800E */ lui $t8, %hi(gMenuText) # $t8, 0x800e @@ -213,7 +213,7 @@ glabel func_80093D40 /* 094C5C 8009405C AFB90010 */ sw $t9, 0x10($sp) /* 094C60 80094060 24040007 */ li $a0, 7 /* 094C64 80094064 24058000 */ li $a1, -32768 -/* 094C68 80094068 0C03145A */ jal func_800C5168 +/* 094C68 80094068 0C03145A */ jal render_dialogue_text /* 094C6C 8009406C 2626002C */ addiu $a2, $s1, 0x2c /* 094C70 80094070 10000035 */ b .L80094148 /* 094C74 80094074 00000000 */ nop @@ -226,7 +226,7 @@ glabel func_80093D40 /* 094C8C 8009408C 256C0001 */ addiu $t4, $t3, 1 /* 094C90 80094090 AFAC0010 */ sw $t4, 0x10($sp) /* 094C94 80094094 AFAD0014 */ sw $t5, 0x14($sp) -/* 094C98 80094098 0C03145A */ jal func_800C5168 +/* 094C98 80094098 0C03145A */ jal render_dialogue_text /* 094C9C 8009409C 2406000C */ li $a2, 12 /* 094CA0 800940A0 8E6E0000 */ lw $t6, ($s3) /* 094CA4 800940A4 00008825 */ move $s1, $zero @@ -246,7 +246,7 @@ glabel func_80093D40 /* 094CD8 800940D8 240500FF */ li $a1, 255 /* 094CDC 800940DC 240600FF */ li $a2, 255 /* 094CE0 800940E0 240700FF */ li $a3, 255 -/* 094CE4 800940E4 0C031400 */ jal func_800C5000 +/* 094CE4 800940E4 0C031400 */ jal set_text_colour /* 094CE8 800940E8 AFB40010 */ sw $s4, 0x10($sp) /* 094CEC 800940EC 10000008 */ b .L80094110 /* 094CF0 800940F0 8E070000 */ lw $a3, ($s0) @@ -255,7 +255,7 @@ glabel func_80093D40 /* 094CF8 800940F8 AFB90014 */ sw $t9, 0x14($sp) /* 094CFC 800940FC 240600FF */ li $a2, 255 /* 094D00 80094100 240700FF */ li $a3, 255 -/* 094D04 80094104 0C031400 */ jal func_800C5000 +/* 094D04 80094104 0C031400 */ jal set_text_colour /* 094D08 80094108 AFA00010 */ sw $zero, 0x10($sp) /* 094D0C 8009410C 8E070000 */ lw $a3, ($s0) .L80094110: @@ -265,7 +265,7 @@ glabel func_80093D40 /* 094D1C 8009411C AFA90010 */ sw $t1, 0x10($sp) /* 094D20 80094120 24040007 */ li $a0, 7 /* 094D24 80094124 24058000 */ li $a1, -32768 -/* 094D28 80094128 0C03145A */ jal func_800C5168 +/* 094D28 80094128 0C03145A */ jal render_dialogue_text /* 094D2C 8009412C 02403025 */ move $a2, $s2 /* 094D30 80094130 8E6B0000 */ lw $t3, ($s3) /* 094D34 80094134 26310001 */ addiu $s1, $s1, 1 diff --git a/asm/non_matchings/menu/func_80094D28.s b/asm/non_matchings/menu/func_80094D28.s index 68dab965..9e121a84 100644 --- a/asm/non_matchings/menu/func_80094D28.s +++ b/asm/non_matchings/menu/func_80094D28.s @@ -337,7 +337,7 @@ glabel L800951CC /* 095DD4 800951D4 0C031525 */ jal func_800C5494 /* 095DD8 800951D8 24040007 */ li $a0, 7 /* 095DDC 800951DC 24040007 */ li $a0, 7 -/* 095DE0 800951E0 0C0313DF */ jal func_800C4F7C +/* 095DE0 800951E0 0C0313DF */ jal set_dialogue_font /* 095DE4 800951E4 00002825 */ move $a1, $zero /* 095DE8 800951E8 24040007 */ li $a0, 7 /* 095DEC 800951EC 00002825 */ move $a1, $zero @@ -398,7 +398,7 @@ glabel L800951CC /* 095EAC 800952AC 01623023 */ subu $a2, $t3, $v0 /* 095EB0 800952B0 25AE0004 */ addiu $t6, $t5, 4 /* 095EB4 800952B4 AFAE0010 */ sw $t6, 0x10($sp) -/* 095EB8 800952B8 0C0313B7 */ jal func_800C4EDC +/* 095EB8 800952B8 0C0313B7 */ jal set_dialogue_box_coords /* 095EBC 800952BC 24C6FFFC */ addiu $a2, $a2, -4 /* 095EC0 800952C0 24040007 */ li $a0, 7 /* 095EC4 800952C4 24050040 */ li $a1, 64 @@ -413,7 +413,7 @@ glabel L800951CC /* 095EE8 800952E8 24040007 */ li $a0, 7 /* 095EEC 800952EC 240500FF */ li $a1, 255 /* 095EF0 800952F0 00003025 */ move $a2, $zero -/* 095EF4 800952F4 0C031400 */ jal func_800C5000 +/* 095EF4 800952F4 0C031400 */ jal set_text_colour /* 095EF8 800952F8 240700FF */ li $a3, 255 /* 095EFC 800952FC 8E380000 */ lw $t8, ($s1) /* 095F00 80095300 3C028012 */ lui $v0, %hi(D_80126C1C) # $v0, 0x8012 @@ -428,7 +428,7 @@ glabel L800951CC /* 095F24 80095324 AFAB0010 */ sw $t3, 0x10($sp) /* 095F28 80095328 24040007 */ li $a0, 7 /* 095F2C 8009532C 24058000 */ li $a1, -32768 -/* 095F30 80095330 0C03145A */ jal func_800C5168 +/* 095F30 80095330 0C03145A */ jal render_dialogue_text /* 095F34 80095334 2406000C */ li $a2, 12 /* 095F38 80095338 10000091 */ b .L80095580 /* 095F3C 8009533C 00000000 */ nop @@ -457,7 +457,7 @@ glabel L800951CC /* 095F90 80095390 AFB80010 */ sw $t8, 0x10($sp) /* 095F94 80095394 24040007 */ li $a0, 7 /* 095F98 80095398 24058000 */ li $a1, -32768 -/* 095F9C 8009539C 0C03145A */ jal func_800C5168 +/* 095F9C 8009539C 0C03145A */ jal render_dialogue_text /* 095FA0 800953A0 02403025 */ move $a2, $s2 /* 095FA4 800953A4 3C0B8012 */ lui $t3, %hi(D_80126C24) # $t3, 0x8012 /* 095FA8 800953A8 8D6B6C24 */ lw $t3, %lo(D_80126C24)($t3) @@ -483,7 +483,7 @@ glabel L800951CC /* 095FF4 800953F4 AFAE0010 */ sw $t6, 0x10($sp) /* 095FF8 800953F8 24040007 */ li $a0, 7 /* 095FFC 800953FC 24058000 */ li $a1, -32768 -/* 096000 80095400 0C03145A */ jal func_800C5168 +/* 096000 80095400 0C03145A */ jal render_dialogue_text /* 096004 80095404 26460008 */ addiu $a2, $s2, 8 /* 096008 80095408 8E390000 */ lw $t9, ($s1) /* 09600C 8009540C 24010001 */ li $at, 1 @@ -498,7 +498,7 @@ glabel L800951CC /* 09602C 8009542C 24040007 */ li $a0, 7 /* 096030 80095430 240500FF */ li $a1, 255 /* 096034 80095434 240600FF */ li $a2, 255 -/* 096038 80095438 0C031400 */ jal func_800C5000 +/* 096038 80095438 0C031400 */ jal set_text_colour /* 09603C 8009543C 240700FF */ li $a3, 255 /* 096040 80095440 3C0F800E */ lui $t7, %hi(gMenuText) # $t7, 0x800e /* 096044 80095444 8DEFF4A0 */ lw $t7, %lo(gMenuText)($t7) @@ -509,7 +509,7 @@ glabel L800951CC /* 096058 80095458 AFAB0010 */ sw $t3, 0x10($sp) /* 09605C 8009545C 24040007 */ li $a0, 7 /* 096060 80095460 24058000 */ li $a1, -32768 -/* 096064 80095464 0C03145A */ jal func_800C5168 +/* 096064 80095464 0C03145A */ jal render_dialogue_text /* 096068 80095468 2646001A */ addiu $a2, $s2, 0x1a /* 09606C 8009546C 8E2D0000 */ lw $t5, ($s1) /* 096070 80095470 24010002 */ li $at, 2 @@ -522,7 +522,7 @@ glabel L800951CC /* 096088 80095488 240500FF */ li $a1, 255 /* 09608C 8009548C 240600FF */ li $a2, 255 /* 096090 80095490 240700FF */ li $a3, 255 -/* 096094 80095494 0C031400 */ jal func_800C5000 +/* 096094 80095494 0C031400 */ jal set_text_colour /* 096098 80095498 AFB00010 */ sw $s0, 0x10($sp) /* 09609C 8009549C 3C0A800E */ lui $t2, %hi(gMenuText) # $t2, 0x800e /* 0960A0 800954A0 8D4AF4A0 */ lw $t2, %lo(gMenuText)($t2) @@ -533,7 +533,7 @@ glabel L800951CC /* 0960B4 800954B4 AFB90010 */ sw $t9, 0x10($sp) /* 0960B8 800954B8 24040007 */ li $a0, 7 /* 0960BC 800954BC 24058000 */ li $a1, -32768 -/* 0960C0 800954C0 0C03145A */ jal func_800C5168 +/* 0960C0 800954C0 0C03145A */ jal render_dialogue_text /* 0960C4 800954C4 2646002A */ addiu $a2, $s2, 0x2a /* 0960C8 800954C8 1000002D */ b .L80095580 /* 0960CC 800954CC 00000000 */ nop @@ -556,7 +556,7 @@ glabel L800951CC /* 096108 80095508 240500FF */ li $a1, 255 /* 09610C 8009550C 240600FF */ li $a2, 255 /* 096110 80095510 240700FF */ li $a3, 255 -/* 096114 80095514 0C031400 */ jal func_800C5000 +/* 096114 80095514 0C031400 */ jal set_text_colour /* 096118 80095518 AFB30010 */ sw $s3, 0x10($sp) /* 09611C 8009551C 10000008 */ b .L80095540 /* 096120 80095520 8E270000 */ lw $a3, ($s1) @@ -565,7 +565,7 @@ glabel L800951CC /* 096128 80095528 AFAD0014 */ sw $t5, 0x14($sp) /* 09612C 8009552C 240600FF */ li $a2, 255 /* 096130 80095530 240700FF */ li $a3, 255 -/* 096134 80095534 0C031400 */ jal func_800C5000 +/* 096134 80095534 0C031400 */ jal set_text_colour /* 096138 80095538 AFA00010 */ sw $zero, 0x10($sp) /* 09613C 8009553C 8E270000 */ lw $a3, ($s1) .L80095540: @@ -575,7 +575,7 @@ glabel L800951CC /* 09614C 8009554C AFAE0010 */ sw $t6, 0x10($sp) /* 096150 80095550 24040007 */ li $a0, 7 /* 096154 80095554 240500A0 */ li $a1, 160 -/* 096158 80095558 0C03145A */ jal func_800C5168 +/* 096158 80095558 0C03145A */ jal render_dialogue_text /* 09615C 8009555C 02403025 */ move $a2, $s2 /* 096160 80095560 3C188012 */ lui $t8, %hi(D_80126C14) # $t8, 0x8012 /* 096164 80095564 8F186C14 */ lw $t8, %lo(D_80126C14)($t8) diff --git a/asm/non_matchings/menu/func_80096978.s b/asm/non_matchings/menu/func_80096978.s index 268b7a2d..2e9cf97f 100644 --- a/asm/non_matchings/menu/func_80096978.s +++ b/asm/non_matchings/menu/func_80096978.s @@ -424,7 +424,7 @@ glabel func_80096978 /* 097BC4 80096FC4 24C600C4 */ addiu $a2, $a2, 0xc4 /* 097BC8 80096FC8 AFB80010 */ sw $t8, 0x10($sp) /* 097BCC 80096FCC 24050050 */ li $a1, 80 -/* 097BD0 80096FD0 0C0313B7 */ jal func_800C4EDC +/* 097BD0 80096FD0 0C0313B7 */ jal set_dialogue_box_coords /* 097BD4 80096FD4 240700F0 */ li $a3, 240 /* 097BD8 80096FD8 24040007 */ li $a0, 7 /* 097BDC 80096FDC 24050040 */ li $a1, 64 @@ -433,7 +433,7 @@ glabel func_80096978 /* 097BE8 80096FE8 0C0313EF */ jal func_800C4FBC /* 097BEC 80096FEC AFA00010 */ sw $zero, 0x10($sp) /* 097BF0 80096FF0 24040007 */ li $a0, 7 -/* 097BF4 80096FF4 0C0313DF */ jal func_800C4F7C +/* 097BF4 80096FF4 0C0313DF */ jal set_dialogue_font /* 097BF8 80096FF8 00002825 */ move $a1, $zero /* 097BFC 80096FFC 24040007 */ li $a0, 7 /* 097C00 80097000 00002825 */ move $a1, $zero @@ -468,7 +468,7 @@ glabel func_80096978 /* 097C70 80097070 AFA200A0 */ sw $v0, 0xa0($sp) /* 097C74 80097074 25A60008 */ addiu $a2, $t5, 8 /* 097C78 80097078 24040007 */ li $a0, 7 -/* 097C7C 8009707C 0C03145A */ jal func_800C5168 +/* 097C7C 8009707C 0C03145A */ jal render_dialogue_text /* 097C80 80097080 24058000 */ li $a1, -32768 /* 097C84 80097084 8E0F0000 */ lw $t7, ($s0) /* 097C88 80097088 24010001 */ li $at, 1 @@ -481,7 +481,7 @@ glabel func_80096978 /* 097CA4 800970A4 240500FF */ li $a1, 255 /* 097CA8 800970A8 240600FF */ li $a2, 255 /* 097CAC 800970AC 240700FF */ li $a3, 255 -/* 097CB0 800970B0 0C031400 */ jal func_800C5000 +/* 097CB0 800970B0 0C031400 */ jal set_text_colour /* 097CB4 800970B4 AFB80010 */ sw $t8, 0x10($sp) /* 097CB8 800970B8 10000008 */ b .L800970DC /* 097CBC 800970BC 00000000 */ nop @@ -491,7 +491,7 @@ glabel func_80096978 /* 097CC8 800970C8 240500FF */ li $a1, 255 /* 097CCC 800970CC 240600FF */ li $a2, 255 /* 097CD0 800970D0 240700FF */ li $a3, 255 -/* 097CD4 800970D4 0C031400 */ jal func_800C5000 +/* 097CD4 800970D4 0C031400 */ jal set_text_colour /* 097CD8 800970D8 AFA00010 */ sw $zero, 0x10($sp) .L800970DC: /* 097CDC 800970DC 3C0A800E */ lui $t2, %hi(gMenuText) # $t2, 0x800e @@ -504,7 +504,7 @@ glabel func_80096978 /* 097CF8 800970F8 AFB90010 */ sw $t9, 0x10($sp) /* 097CFC 800970FC 24040007 */ li $a0, 7 /* 097D00 80097100 24058000 */ li $a1, -32768 -/* 097D04 80097104 0C03145A */ jal func_800C5168 +/* 097D04 80097104 0C03145A */ jal render_dialogue_text /* 097D08 80097108 24C6001A */ addiu $a2, $a2, 0x1a /* 097D0C 8009710C 8E0B0000 */ lw $t3, ($s0) /* 097D10 80097110 24010002 */ li $at, 2 @@ -517,7 +517,7 @@ glabel func_80096978 /* 097D2C 8009712C 240500FF */ li $a1, 255 /* 097D30 80097130 240600FF */ li $a2, 255 /* 097D34 80097134 240700FF */ li $a3, 255 -/* 097D38 80097138 0C031400 */ jal func_800C5000 +/* 097D38 80097138 0C031400 */ jal set_text_colour /* 097D3C 8009713C AFAC0010 */ sw $t4, 0x10($sp) /* 097D40 80097140 10000008 */ b .L80097164 /* 097D44 80097144 00000000 */ nop @@ -527,7 +527,7 @@ glabel func_80096978 /* 097D50 80097150 240500FF */ li $a1, 255 /* 097D54 80097154 240600FF */ li $a2, 255 /* 097D58 80097158 240700FF */ li $a3, 255 -/* 097D5C 8009715C 0C031400 */ jal func_800C5000 +/* 097D5C 8009715C 0C031400 */ jal set_text_colour /* 097D60 80097160 AFA00010 */ sw $zero, 0x10($sp) .L80097164: /* 097D64 80097164 3C18800E */ lui $t8, %hi(gMenuText) # $t8, 0x800e @@ -540,7 +540,7 @@ glabel func_80096978 /* 097D80 80097180 AFA90010 */ sw $t1, 0x10($sp) /* 097D84 80097184 24040007 */ li $a0, 7 /* 097D88 80097188 24058000 */ li $a1, -32768 -/* 097D8C 8009718C 0C03145A */ jal func_800C5168 +/* 097D8C 8009718C 0C03145A */ jal render_dialogue_text /* 097D90 80097190 24C6002A */ addiu $a2, $a2, 0x2a /* 097D94 80097194 10000032 */ b .L80097260 /* 097D98 80097198 00000000 */ nop @@ -566,7 +566,7 @@ glabel func_80096978 /* 097DE0 800971E0 240600FF */ li $a2, 255 /* 097DE4 800971E4 240700FF */ li $a3, 255 /* 097DE8 800971E8 AFA20010 */ sw $v0, 0x10($sp) -/* 097DEC 800971EC 0C031400 */ jal func_800C5000 +/* 097DEC 800971EC 0C031400 */ jal set_text_colour /* 097DF0 800971F0 AFA200A0 */ sw $v0, 0xa0($sp) /* 097DF4 800971F4 1000000A */ b .L80097220 /* 097DF8 800971F8 8FA600A8 */ lw $a2, 0xa8($sp) @@ -577,7 +577,7 @@ glabel func_80096978 /* 097E08 80097208 240600FF */ li $a2, 255 /* 097E0C 8009720C 240700FF */ li $a3, 255 /* 097E10 80097210 AFA00010 */ sw $zero, 0x10($sp) -/* 097E14 80097214 0C031400 */ jal func_800C5000 +/* 097E14 80097214 0C031400 */ jal set_text_colour /* 097E18 80097218 AFA200A0 */ sw $v0, 0xa0($sp) /* 097E1C 8009721C 8FA600A8 */ lw $a2, 0xa8($sp) .L80097220: @@ -587,7 +587,7 @@ glabel func_80096978 /* 097E2C 8009722C AFAF0014 */ sw $t7, 0x14($sp) /* 097E30 80097230 AFAE0010 */ sw $t6, 0x10($sp) /* 097E34 80097234 24040007 */ li $a0, 7 -/* 097E38 80097238 0C03145A */ jal func_800C5168 +/* 097E38 80097238 0C03145A */ jal render_dialogue_text /* 097E3C 8009723C 24050050 */ li $a1, 80 /* 097E40 80097240 8E280000 */ lw $t0, ($s1) /* 097E44 80097244 8FB800A8 */ lw $t8, 0xa8($sp) diff --git a/asm/non_matchings/menu/func_80099E8C.s b/asm/non_matchings/menu/func_80099E8C.s index 32857299..0bbfada1 100644 --- a/asm/non_matchings/menu/func_80099E8C.s +++ b/asm/non_matchings/menu/func_80099E8C.s @@ -446,7 +446,7 @@ glabel func_80099E8C /* 09B128 8009A528 24040007 */ li $a0, 7 /* 09B12C 8009A52C 24050068 */ li $a1, 104 /* 09B130 8009A530 24060066 */ li $a2, 102 -/* 09B134 8009A534 0C0313B7 */ jal func_800C4EDC +/* 09B134 8009A534 0C0313B7 */ jal set_dialogue_box_coords /* 09B138 8009A538 240700D8 */ li $a3, 216 /* 09B13C 8009A53C 240C00C0 */ li $t4, 192 /* 09B140 8009A540 AFAC0010 */ sw $t4, 0x10($sp) @@ -456,7 +456,7 @@ glabel func_80099E8C /* 09B150 8009A550 0C0313EF */ jal func_800C4FBC /* 09B154 8009A554 00003825 */ move $a3, $zero /* 09B158 8009A558 24040007 */ li $a0, 7 -/* 09B15C 8009A55C 0C0313DF */ jal func_800C4F7C +/* 09B15C 8009A55C 0C0313DF */ jal set_dialogue_font /* 09B160 8009A560 00002825 */ move $a1, $zero /* 09B164 8009A564 24040007 */ li $a0, 7 /* 09B168 8009A568 00002825 */ move $a1, $zero @@ -475,7 +475,7 @@ glabel func_80099E8C /* 09B19C 8009A59C 240500FF */ li $a1, 255 /* 09B1A0 8009A5A0 240600FF */ li $a2, 255 /* 09B1A4 8009A5A4 240700FF */ li $a3, 255 -/* 09B1A8 8009A5A8 0C031400 */ jal func_800C5000 +/* 09B1A8 8009A5A8 0C031400 */ jal set_text_colour /* 09B1AC 8009A5AC AFAF0010 */ sw $t7, 0x10($sp) /* 09B1B0 8009A5B0 10000008 */ b .L8009A5D4 /* 09B1B4 8009A5B4 00000000 */ nop @@ -485,7 +485,7 @@ glabel func_80099E8C /* 09B1C0 8009A5C0 240500FF */ li $a1, 255 /* 09B1C4 8009A5C4 240600FF */ li $a2, 255 /* 09B1C8 8009A5C8 240700FF */ li $a3, 255 -/* 09B1CC 8009A5CC 0C031400 */ jal func_800C5000 +/* 09B1CC 8009A5CC 0C031400 */ jal set_text_colour /* 09B1D0 8009A5D0 AFA00010 */ sw $zero, 0x10($sp) .L8009A5D4: /* 09B1D4 8009A5D4 3C19800E */ lui $t9, %hi(gMenuText) # $t9, 0x800e @@ -497,7 +497,7 @@ glabel func_80099E8C /* 09B1EC 8009A5EC AFA90010 */ sw $t1, 0x10($sp) /* 09B1F0 8009A5F0 24040007 */ li $a0, 7 /* 09B1F4 8009A5F4 24058000 */ li $a1, -32768 -/* 09B1F8 8009A5F8 0C03145A */ jal func_800C5168 +/* 09B1F8 8009A5F8 0C03145A */ jal render_dialogue_text /* 09B1FC 8009A5FC 2406000C */ li $a2, 12 /* 09B200 8009A600 8E0B0000 */ lw $t3, ($s0) /* 09B204 8009A604 24010002 */ li $at, 2 @@ -510,7 +510,7 @@ glabel func_80099E8C /* 09B220 8009A620 240500FF */ li $a1, 255 /* 09B224 8009A624 240600FF */ li $a2, 255 /* 09B228 8009A628 240700FF */ li $a3, 255 -/* 09B22C 8009A62C 0C031400 */ jal func_800C5000 +/* 09B22C 8009A62C 0C031400 */ jal set_text_colour /* 09B230 8009A630 AFAC0010 */ sw $t4, 0x10($sp) /* 09B234 8009A634 10000008 */ b .L8009A658 /* 09B238 8009A638 00000000 */ nop @@ -520,7 +520,7 @@ glabel func_80099E8C /* 09B244 8009A644 240500FF */ li $a1, 255 /* 09B248 8009A648 240600FF */ li $a2, 255 /* 09B24C 8009A64C 240700FF */ li $a3, 255 -/* 09B250 8009A650 0C031400 */ jal func_800C5000 +/* 09B250 8009A650 0C031400 */ jal set_text_colour /* 09B254 8009A654 AFA00010 */ sw $zero, 0x10($sp) .L8009A658: /* 09B258 8009A658 3C18800E */ lui $t8, %hi(gMenuText) # $t8, 0x800e @@ -532,7 +532,7 @@ glabel func_80099E8C /* 09B270 8009A670 AFAE0010 */ sw $t6, 0x10($sp) /* 09B274 8009A674 24040007 */ li $a0, 7 /* 09B278 8009A678 24058000 */ li $a1, -32768 -/* 09B27C 8009A67C 0C03145A */ jal func_800C5168 +/* 09B27C 8009A67C 0C03145A */ jal render_dialogue_text /* 09B280 8009A680 2406001C */ li $a2, 28 /* 09B284 8009A684 02E02025 */ move $a0, $s7 /* 09B288 8009A688 00002825 */ move $a1, $zero diff --git a/asm/non_matchings/menu/render_magic_codes_ui.s b/asm/non_matchings/menu/render_magic_codes_ui.s index 99170f97..ff6cd534 100644 --- a/asm/non_matchings/menu/render_magic_codes_ui.s +++ b/asm/non_matchings/menu/render_magic_codes_ui.s @@ -335,14 +335,14 @@ glabel render_magic_codes_ui /* 08A784 80089B84 0C031525 */ jal func_800C5494 /* 08A788 80089B88 24040006 */ li $a0, 6 /* 08A78C 80089B8C 24040006 */ li $a0, 6 -/* 08A790 80089B90 0C0313DF */ jal func_800C4F7C +/* 08A790 80089B90 0C0313DF */ jal set_dialogue_font /* 08A794 80089B94 00002825 */ move $a1, $zero /* 08A798 80089B98 266E001C */ addiu $t6, $s3, 0x1c /* 08A79C 80089B9C AFAE0010 */ sw $t6, 0x10($sp) /* 08A7A0 80089BA0 24040006 */ li $a0, 6 /* 08A7A4 80089BA4 2405004C */ li $a1, 76 /* 08A7A8 80089BA8 2666FFE4 */ addiu $a2, $s3, -0x1c -/* 08A7AC 80089BAC 0C0313B7 */ jal func_800C4EDC +/* 08A7AC 80089BAC 0C0313B7 */ jal set_dialogue_box_coords /* 08A7B0 80089BB0 240700F4 */ li $a3, 244 /* 08A7B4 80089BB4 240F00A0 */ li $t7, 160 /* 08A7B8 80089BB8 AFAF0010 */ sw $t7, 0x10($sp) @@ -374,7 +374,7 @@ glabel render_magic_codes_ui /* 08A810 80089C10 24040006 */ li $a0, 6 /* 08A814 80089C14 240500FF */ li $a1, 255 /* 08A818 80089C18 240700FF */ li $a3, 255 -/* 08A81C 80089C1C 0C031400 */ jal func_800C5000 +/* 08A81C 80089C1C 0C031400 */ jal set_text_colour /* 08A820 80089C20 AFB00010 */ sw $s0, 0x10($sp) /* 08A824 80089C24 3C09800E */ lui $t1, %hi(gMenuText) # $t1, 0x800e /* 08A828 80089C28 8D29F4A0 */ lw $t1, %lo(gMenuText)($t1) @@ -386,7 +386,7 @@ glabel render_magic_codes_ui /* 08A840 80089C40 AFAB0010 */ sw $t3, 0x10($sp) /* 08A844 80089C44 24040006 */ li $a0, 6 /* 08A848 80089C48 24058000 */ li $a1, -32768 -/* 08A84C 80089C4C 0C03145A */ jal func_800C5168 +/* 08A84C 80089C4C 0C03145A */ jal render_dialogue_text /* 08A850 80089C50 02603025 */ move $a2, $s3 /* 08A854 80089C54 13C00003 */ beqz $fp, .L80089C64 /* 08A858 80089C58 00000000 */ nop diff --git a/asm/non_matchings/menu/render_track_select_setup_ui.s b/asm/non_matchings/menu/render_track_select_setup_ui.s index ad77263b..0a01212b 100644 --- a/asm/non_matchings/menu/render_track_select_setup_ui.s +++ b/asm/non_matchings/menu/render_track_select_setup_ui.s @@ -451,7 +451,7 @@ glabel render_track_select_setup_ui /* 0921CC 800915CC 270E0089 */ addiu $t6, $t8, 0x89 /* 0921D0 800915D0 AFAE0010 */ sw $t6, 0x10($sp) /* 0921D4 800915D4 240700BA */ li $a3, 186 -/* 0921D8 800915D8 0C0313B7 */ jal func_800C4EDC +/* 0921D8 800915D8 0C0313B7 */ jal set_dialogue_box_coords /* 0921DC 800915DC 27060070 */ addiu $a2, $t8, 0x70 /* 0921E0 800915E0 3C048012 */ lui $a0, %hi(D_801263A0) # $a0, 0x8012 /* 0921E4 800915E4 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 @@ -593,7 +593,7 @@ glabel render_track_select_setup_ui /* 0923E0 800917E0 2466FFFE */ addiu $a2, $v1, -2 /* 0923E4 800917E4 24040007 */ li $a0, 7 /* 0923E8 800917E8 2445FFFE */ addiu $a1, $v0, -2 -/* 0923EC 800917EC 0C0313B7 */ jal func_800C4EDC +/* 0923EC 800917EC 0C0313B7 */ jal set_dialogue_box_coords /* 0923F0 800917F0 24470032 */ addiu $a3, $v0, 0x32 /* 0923F4 800917F4 3C048012 */ lui $a0, %hi(D_801263A0) # $a0, 0x8012 /* 0923F8 800917F8 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 diff --git a/asm/non_matchings/menu/tt_menu_loop.s b/asm/non_matchings/menu/tt_menu_loop.s index 0b5018af..9cc0de78 100644 --- a/asm/non_matchings/menu/tt_menu_loop.s +++ b/asm/non_matchings/menu/tt_menu_loop.s @@ -48,7 +48,7 @@ glabel tt_menu_loop /* 09E7CC 8009DBCC 24050018 */ li $a1, 24 /* 09E7D0 8009DBD0 24060010 */ li $a2, 16 /* 09E7D4 8009DBD4 240700C0 */ li $a3, 192 -/* 09E7D8 8009DBD8 0C0313B7 */ jal func_800C4EDC +/* 09E7D8 8009DBD8 0C0313B7 */ jal set_dialogue_box_coords /* 09E7DC 8009DBDC AFAC0010 */ sw $t4, 0x10($sp) /* 09E7E0 8009DBE0 10000007 */ b .L8009DC00 /* 09E7E4 8009DBE4 24040001 */ li $a0, 1 @@ -56,11 +56,11 @@ glabel tt_menu_loop /* 09E7E8 8009DBE8 240D00DC */ li $t5, 220 /* 09E7EC 8009DBEC AFAD0010 */ sw $t5, 0x10($sp) /* 09E7F0 8009DBF0 24060010 */ li $a2, 16 -/* 09E7F4 8009DBF4 0C0313B7 */ jal func_800C4EDC +/* 09E7F4 8009DBF4 0C0313B7 */ jal set_dialogue_box_coords /* 09E7F8 8009DBF8 240700B8 */ li $a3, 184 /* 09E7FC 8009DBFC 24040001 */ li $a0, 1 .L8009DC00: -/* 09E800 8009DC00 0C0313DF */ jal func_800C4F7C +/* 09E800 8009DC00 0C0313DF */ jal set_dialogue_font /* 09E804 8009DC04 00002825 */ move $a1, $zero /* 09E808 8009DC08 AFA00044 */ sw $zero, 0x44($sp) /* 09E80C 8009DC0C 0C01A955 */ jal get_buttons_pressed_from_player @@ -68,10 +68,10 @@ glabel tt_menu_loop /* 09E814 8009DC14 3C018012 */ lui $at, %hi(sDialogueOptionMax) # $at, 0x8012 /* 09E818 8009DC18 A0206504 */ sb $zero, %lo(sDialogueOptionMax)($at) /* 09E81C 8009DC1C 3C088012 */ lui $t0, %hi(sCurrentMenuID) # $t0, 0x8012 -/* 09E820 8009DC20 3C018012 */ lui $at, %hi(D_8012650E) # $at, 0x8012 +/* 09E820 8009DC20 3C018012 */ lui $at, %hi(gDialogOptionYOffset) # $at, 0x8012 /* 09E824 8009DC24 240E0020 */ li $t6, 32 /* 09E828 8009DC28 250864E2 */ addiu $t0, %lo(sCurrentMenuID) # addiu $t0, $t0, 0x64e2 -/* 09E82C 8009DC2C A02E650E */ sb $t6, %lo(D_8012650E)($at) +/* 09E82C 8009DC2C A02E650E */ sb $t6, %lo(gDialogOptionYOffset)($at) /* 09E830 8009DC30 81030000 */ lb $v1, ($t0) /* 09E834 8009DC34 00402025 */ move $a0, $v0 /* 09E838 8009DC38 2C61000B */ sltiu $at, $v1, 0xb @@ -94,13 +94,13 @@ glabel L8009DC60 /* 09E878 8009DC78 AFB90010 */ sw $t9, 0x10($sp) /* 09E87C 8009DC7C 24040001 */ li $a0, 1 /* 09E880 8009DC80 24058000 */ li $a1, -32768 -/* 09E884 8009DC84 0C03145A */ jal func_800C5168 +/* 09E884 8009DC84 0C03145A */ jal render_dialogue_text /* 09E888 8009DC88 24060006 */ li $a2, 6 /* 09E88C 8009DC8C 3C0A800E */ lui $t2, %hi(gMenuText) # $t2, 0x800e /* 09E890 8009DC90 8D4AF4A0 */ lw $t2, %lo(gMenuText)($t2) /* 09E894 8009DC94 24050014 */ li $a1, 20 /* 09E898 8009DC98 8D44011C */ lw $a0, 0x11c($t2) -/* 09E89C 8009DC9C 0C02746E */ jal func_8009D1B8 +/* 09E89C 8009DC9C 0C02746E */ jal render_dialogue_option /* 09E8A0 8009DCA0 24060003 */ li $a2, 3 /* 09E8A4 8009DCA4 0C027B20 */ jal is_in_two_player_adventure /* 09E8A8 8009DCA8 00000000 */ nop @@ -114,7 +114,7 @@ glabel L8009DC60 /* 09E8C8 8009DCC8 8D6BF4A0 */ lw $t3, %lo(gMenuText)($t3) /* 09E8CC 8009DCCC 24050014 */ li $a1, 20 /* 09E8D0 8009DCD0 8D640104 */ lw $a0, 0x104($t3) -/* 09E8D4 8009DCD4 0C02746E */ jal func_8009D1B8 +/* 09E8D4 8009DCD4 0C02746E */ jal render_dialogue_option /* 09E8D8 8009DCD8 00003025 */ move $a2, $zero /* 09E8DC 8009DCDC 10000006 */ b .L8009DCF8 /* 09E8E0 8009DCE0 00000000 */ nop @@ -122,7 +122,7 @@ glabel L8009DC60 /* 09E8E4 8009DCE4 8D8CF4A0 */ lw $t4, %lo(gMenuText)($t4) /* 09E8E8 8009DCE8 24050014 */ li $a1, 20 /* 09E8EC 8009DCEC 8D840108 */ lw $a0, 0x108($t4) -/* 09E8F0 8009DCF0 0C02746E */ jal func_8009D1B8 +/* 09E8F0 8009DCF0 0C02746E */ jal render_dialogue_option /* 09E8F4 8009DCF4 00003025 */ move $a2, $zero .L8009DCF8: /* 09E8F8 8009DCF8 0C006DE0 */ jal func_8001B780 @@ -132,14 +132,14 @@ glabel L8009DC60 /* 09E908 8009DD08 8DADF4A0 */ lw $t5, %lo(gMenuText)($t5) /* 09E90C 8009DD0C 24050014 */ li $a1, 20 /* 09E910 8009DD10 8DA4006C */ lw $a0, 0x6c($t5) -/* 09E914 8009DD14 0C02746E */ jal func_8009D1B8 +/* 09E914 8009DD14 0C02746E */ jal render_dialogue_option /* 09E918 8009DD18 24060001 */ li $a2, 1 .L8009DD1C: /* 09E91C 8009DD1C 3C0E800E */ lui $t6, %hi(gMenuText) # $t6, 0x800e /* 09E920 8009DD20 8DCEF4A0 */ lw $t6, %lo(gMenuText)($t6) /* 09E924 8009DD24 24050014 */ li $a1, 20 /* 09E928 8009DD28 8DC40014 */ lw $a0, 0x14($t6) -/* 09E92C 8009DD2C 0C02746E */ jal func_8009D1B8 +/* 09E92C 8009DD2C 0C02746E */ jal render_dialogue_option /* 09E930 8009DD30 24060002 */ li $a2, 2 /* 09E934 8009DD34 0C02749B */ jal func_8009D26C /* 09E938 8009DD38 00000000 */ nop @@ -293,7 +293,7 @@ glabel L8009DEF0 /* 09EB48 8009DF48 24040001 */ li $a0, 1 /* 09EB4C 8009DF4C 24058000 */ li $a1, -32768 /* 09EB50 8009DF50 AFA30024 */ sw $v1, 0x24($sp) -/* 09EB54 8009DF54 0C03145A */ jal func_800C5168 +/* 09EB54 8009DF54 0C03145A */ jal render_dialogue_text /* 09EB58 8009DF58 AFA60038 */ sw $a2, 0x38($sp) /* 09EB5C 8009DF5C 8FA30024 */ lw $v1, 0x24($sp) /* 09EB60 8009DF60 3C198012 */ lui $t9, %hi(D_801263A4) # $t9, 0x8012 @@ -352,7 +352,7 @@ glabel L8009DFEC /* 09EC20 8009E020 24040001 */ li $a0, 1 /* 09EC24 8009E024 24058000 */ li $a1, -32768 /* 09EC28 8009E028 AFA30024 */ sw $v1, 0x24($sp) -/* 09EC2C 8009E02C 0C03145A */ jal func_800C5168 +/* 09EC2C 8009E02C 0C03145A */ jal render_dialogue_text /* 09EC30 8009E030 AFA60020 */ sw $a2, 0x20($sp) /* 09EC34 8009E034 8FA30024 */ lw $v1, 0x24($sp) /* 09EC38 8009E038 3C18800E */ lui $t8, %hi(gMenuText) # $t8, 0x800e @@ -391,7 +391,7 @@ glabel L8009E098 /* 09ECB0 8009E0B0 AFAF0010 */ sw $t7, 0x10($sp) /* 09ECB4 8009E0B4 24040001 */ li $a0, 1 /* 09ECB8 8009E0B8 24058000 */ li $a1, -32768 -/* 09ECBC 8009E0BC 0C03145A */ jal func_800C5168 +/* 09ECBC 8009E0BC 0C03145A */ jal render_dialogue_text /* 09ECC0 8009E0C0 24060022 */ li $a2, 34 /* 09ECC4 8009E0C4 3C19800E */ lui $t9, %hi(gMenuText) # $t9, 0x800e /* 09ECC8 8009E0C8 8F39F4A0 */ lw $t9, %lo(gMenuText)($t9) @@ -402,7 +402,7 @@ glabel L8009E098 /* 09ECDC 8009E0DC AFA90010 */ sw $t1, 0x10($sp) /* 09ECE0 8009E0E0 24040001 */ li $a0, 1 /* 09ECE4 8009E0E4 24058000 */ li $a1, -32768 -/* 09ECE8 8009E0E8 0C03145A */ jal func_800C5168 +/* 09ECE8 8009E0E8 0C03145A */ jal render_dialogue_text /* 09ECEC 8009E0EC 24060032 */ li $a2, 50 /* 09ECF0 8009E0F0 3C0C800E */ lui $t4, %hi(gMenuText) # $t4, 0x800e /* 09ECF4 8009E0F4 8D8CF4A0 */ lw $t4, %lo(gMenuText)($t4) @@ -413,7 +413,7 @@ glabel L8009E098 /* 09ED08 8009E108 AFAE0010 */ sw $t6, 0x10($sp) /* 09ED0C 8009E10C 24040001 */ li $a0, 1 /* 09ED10 8009E110 24058000 */ li $a1, -32768 -/* 09ED14 8009E114 0C03145A */ jal func_800C5168 +/* 09ED14 8009E114 0C03145A */ jal render_dialogue_text /* 09ED18 8009E118 24060042 */ li $a2, 66 /* 09ED1C 8009E11C 8FAD0040 */ lw $t5, 0x40($sp) /* 09ED20 8009E120 240400EF */ li $a0, 239 @@ -457,7 +457,7 @@ glabel L8009E194 /* 09EDAC 8009E1AC AFAE0010 */ sw $t6, 0x10($sp) /* 09EDB0 8009E1B0 24040001 */ li $a0, 1 /* 09EDB4 8009E1B4 24058000 */ li $a1, -32768 -/* 09EDB8 8009E1B8 0C03145A */ jal func_800C5168 +/* 09EDB8 8009E1B8 0C03145A */ jal render_dialogue_text /* 09EDBC 8009E1BC 24060022 */ li $a2, 34 /* 09EDC0 8009E1C0 3C0D800E */ lui $t5, %hi(gMenuText) # $t5, 0x800e /* 09EDC4 8009E1C4 8DADF4A0 */ lw $t5, %lo(gMenuText)($t5) @@ -468,7 +468,7 @@ glabel L8009E194 /* 09EDD8 8009E1D8 AFAF0010 */ sw $t7, 0x10($sp) /* 09EDDC 8009E1DC 24040001 */ li $a0, 1 /* 09EDE0 8009E1E0 24058000 */ li $a1, -32768 -/* 09EDE4 8009E1E4 0C03145A */ jal func_800C5168 +/* 09EDE4 8009E1E4 0C03145A */ jal render_dialogue_text /* 09EDE8 8009E1E8 24060032 */ li $a2, 50 /* 09EDEC 8009E1EC 3C19800E */ lui $t9, %hi(gMenuText) # $t9, 0x800e /* 09EDF0 8009E1F0 8F39F4A0 */ lw $t9, %lo(gMenuText)($t9) @@ -479,7 +479,7 @@ glabel L8009E194 /* 09EE04 8009E204 AFA90010 */ sw $t1, 0x10($sp) /* 09EE08 8009E208 24040001 */ li $a0, 1 /* 09EE0C 8009E20C 24058000 */ li $a1, -32768 -/* 09EE10 8009E210 0C03145A */ jal func_800C5168 +/* 09EE10 8009E210 0C03145A */ jal render_dialogue_text /* 09EE14 8009E214 24060042 */ li $a2, 66 /* 09EE18 8009E218 8FAC0040 */ lw $t4, 0x40($sp) /* 09EE1C 8009E21C 3C018012 */ lui $at, %hi(sCurrentMenuID) # $at, 0x8012 @@ -501,7 +501,7 @@ glabel L8009E23C /* 09EE54 8009E254 AFAD0010 */ sw $t5, 0x10($sp) /* 09EE58 8009E258 24040001 */ li $a0, 1 /* 09EE5C 8009E25C 24058000 */ li $a1, -32768 -/* 09EE60 8009E260 0C03145A */ jal func_800C5168 +/* 09EE60 8009E260 0C03145A */ jal render_dialogue_text /* 09EE64 8009E264 24060032 */ li $a2, 50 /* 09EE68 8009E268 3C048012 */ lui $a0, %hi(D_80126398) # $a0, 0x8012 /* 09EE6C 8009E26C 24846398 */ addiu $a0, %lo(D_80126398) # addiu $a0, $a0, 0x6398 @@ -600,7 +600,7 @@ glabel L8009E37C /* 09EFAC 8009E3AC AFAD0014 */ sw $t5, 0x14($sp) /* 09EFB0 8009E3B0 AFAB0010 */ sw $t3, 0x10($sp) /* 09EFB4 8009E3B4 24058000 */ li $a1, -32768 -/* 09EFB8 8009E3B8 0C03145A */ jal func_800C5168 +/* 09EFB8 8009E3B8 0C03145A */ jal render_dialogue_text /* 09EFBC 8009E3BC 24060006 */ li $a2, 6 .L8009E3C0: /* 09EFC0 8009E3C0 8FBF001C */ lw $ra, 0x1c($sp) diff --git a/asm/non_matchings/unknown_032760/func_80042A90.s b/asm/non_matchings/unknown_032760/func_80042A90.s index 8964ea14..5fa7a9b5 100644 --- a/asm/non_matchings/unknown_032760/func_80042A90.s +++ b/asm/non_matchings/unknown_032760/func_80042A90.s @@ -91,7 +91,7 @@ glabel func_80042A90 /* 0437E4 80042BE4 8FA6004C */ lw $a2, 0x4c($sp) /* 0437E8 80042BE8 8FA70048 */ lw $a3, 0x48($sp) /* 0437EC 80042BEC 24040004 */ li $a0, 4 -/* 0437F0 80042BF0 0C0313B7 */ jal func_800C4EDC +/* 0437F0 80042BF0 0C0313B7 */ jal set_dialogue_box_coords /* 0437F4 80042BF4 AFAA0010 */ sw $t2, 0x10($sp) /* 0437F8 80042BF8 860B0006 */ lh $t3, 6($s0) /* 0437FC 80042BFC 24040004 */ li $a0, 4 @@ -111,7 +111,7 @@ glabel func_80042A90 /* 043834 80042C34 0C031414 */ jal func_800C5050 /* 043838 80042C38 AFA00010 */ sw $zero, 0x10($sp) /* 04383C 80042C3C 24040004 */ li $a0, 4 -/* 043840 80042C40 0C0313DF */ jal func_800C4F7C +/* 043840 80042C40 0C0313DF */ jal set_dialogue_font /* 043844 80042C44 00002825 */ move $a1, $zero /* 043848 80042C48 AFA00010 */ sw $zero, 0x10($sp) /* 04384C 80042C4C 860E0006 */ lh $t6, 6($s0) @@ -122,7 +122,7 @@ glabel func_80042A90 /* 043860 80042C60 AFB80014 */ sw $t8, 0x14($sp) /* 043864 80042C64 240500FF */ li $a1, 255 /* 043868 80042C68 240600FF */ li $a2, 255 -/* 04386C 80042C6C 0C031400 */ jal func_800C5000 +/* 04386C 80042C6C 0C031400 */ jal set_text_colour /* 043870 80042C70 240700FF */ li $a3, 255 /* 043874 80042C74 8FB90048 */ lw $t9, 0x48($sp) /* 043878 80042C78 8FA80050 */ lw $t0, 0x50($sp) @@ -139,7 +139,7 @@ glabel func_80042A90 /* 0438A4 80042CA4 AFAD0010 */ sw $t5, 0x10($sp) /* 0438A8 80042CA8 01202825 */ move $a1, $t1 /* 0438AC 80042CAC 25860002 */ addiu $a2, $t4, 2 -/* 0438B0 80042CB0 0C03145A */ jal func_800C5168 +/* 0438B0 80042CB0 0C03145A */ jal render_dialogue_text /* 0438B4 80042CB4 24040004 */ li $a0, 4 /* 0438B8 80042CB8 0C03157D */ jal func_800C55F4 /* 0438BC 80042CBC 24040004 */ li $a0, 4 diff --git a/include/structs.h b/include/structs.h index f19d4c1a..5afa0c4d 100644 --- a/include/structs.h +++ b/include/structs.h @@ -55,8 +55,8 @@ typedef struct TextureHeader { /* 0x00 */ u8 width; /* 0x01 */ u8 height; /* 0x02 */ u8 format; // Lower 4 bits determines image format. - // 0 = RGBA32 - // 1 = RGBA16 + // 0 = RGBA32 + // 1 = RGBA16 // 2 = I8 // 3 = I4 // 4 = IA16 @@ -78,7 +78,7 @@ typedef struct TextureHeader { /* 0x11 */ u8 unk11; /* 0x12 */ u16 numOfTextures; // For animated textures, static textures are just 0x01. Each texture has it's own header. /* 0x14 */ u16 frameAdvanceDelay; // How many frames to delay before moving to the next texture. - /* 0x16 */ s16 textureSize; // Size in number of bytes, including the header + /* 0x16 */ s16 textureSize; // Size in number of bytes, including the header /* 0x18 */ u8 unk18; /* 0x19 */ u8 unk19; /* 0x1A */ u8 unk1A; @@ -629,14 +629,14 @@ typedef struct Object_68 { u8 pad00[0x20]; s8 unk20; } Object_68; - + /* Size: 0x20 bytes */ typedef struct Object_6C { u8 pad0[0x4]; s16 unk4; u8 pad6[0x1A]; } Object_6C; - + /* Size: 0x0630 bytes */ typedef struct Object { /* 0x0000 */ s16 y_rotation; @@ -984,7 +984,8 @@ typedef struct unk80042178 { u8 pad0[0x20]; } unk80042178; -typedef struct unk8012A7E8_24 { +//Dialogue Box text (Including background struct) +typedef struct DialogueBox { u8 unk00; u8 unk01; char *unk4; @@ -1002,19 +1003,20 @@ typedef struct unk8012A7E8_24 { u8 unk17; u8 unk18; u8 unk19; - struct unk8012A7E8_24 *unk1C; -} unk8012A7E8_24; + struct DialogueBox *unk1C; +} DialogueBox; /* Size: 0x28 bytes */ -typedef struct unk8012A7E8 { +// Dialogue Box background +typedef struct DialogueBoxBackground { s16 xpos; s16 ypos; - s16 unk4; - s16 unk6; - s16 unk8; - s16 unkA; - s16 unkC; - s16 unkE; + s16 x1; + s16 y1; + s16 x2; + s16 y2; + s16 width; + s16 height; u8 unk10; u8 unk11; u8 unk12; @@ -1032,7 +1034,7 @@ typedef struct unk8012A7E8 { u16 unk1E; s16 unk20; s16 unk22; - unk8012A7E8_24 *unk24; -} unk8012A7E8; + DialogueBox *unk24; +} DialogueBoxBackground; #endif diff --git a/src/font.c b/src/font.c index a947b3ba..60fdb176 100644 --- a/src/font.c +++ b/src/font.c @@ -64,7 +64,7 @@ OSDevMgr __osPiDevMgr = { 0, NULL, NULL, NULL, NULL, NULL, NULL, }; s32 gNumberOfFonts; FontData *gFonts; -unk8012A7E8 (*D_8012A7E8)[1]; +DialogueBoxBackground (*gDialogueBoxBackground)[1]; unk8012A7EC (*D_8012A7EC)[1]; s32 D_8012A7F0; s8 D_8012A7F4; @@ -87,40 +87,40 @@ void load_fonts(void) { gFonts[i].unk28[0] = 0; } - D_8012A7E8 = allocate_from_main_pool_safe(unk8012A7E8_TOTAL_SIZE + unk8012A7EC_TOTAL_SIZE, COLOR_TAG_YELLOW); - D_8012A7EC = (unk8012A7EC *)((u8 *)D_8012A7E8 + unk8012A7E8_TOTAL_SIZE); + gDialogueBoxBackground = allocate_from_main_pool_safe(DIALOGUEBOXBACKGROUND_TOTAL_SIZE + unk8012A7EC_TOTAL_SIZE, COLOR_TAG_YELLOW); + D_8012A7EC = (unk8012A7EC *)((u8 *)gDialogueBoxBackground + DIALOGUEBOXBACKGROUND_TOTAL_SIZE); - for (i = 0; i < unk8012A7E8_COUNT; i++) { - (*D_8012A7E8)[i].xpos = 0; - (*D_8012A7E8)[i].ypos = 0; - (*D_8012A7E8)[i].unk4 = 0; - (*D_8012A7E8)[i].unk6 = 0; - (*D_8012A7E8)[i].unk8 = SCREEN_WIDTH - 1; - (*D_8012A7E8)[i].unkA = SCREEN_HEIGHT - 1; - (*D_8012A7E8)[i].unkC = SCREEN_WIDTH; - (*D_8012A7E8)[i].unkE = SCREEN_HEIGHT; - (*D_8012A7E8)[i].unk10 = 0xFF; - (*D_8012A7E8)[i].unk11 = 0xFF; - (*D_8012A7E8)[i].unk12 = 0xFF; - (*D_8012A7E8)[i].unk13 = 0; - (*D_8012A7E8)[i].colorRed = 0xFF; - (*D_8012A7E8)[i].colorGreen = 0xFF; - (*D_8012A7E8)[i].colorBlue = 0xFF; - (*D_8012A7E8)[i].colorAlpha = 0; - (*D_8012A7E8)[i].bgRed = 0xFF; - (*D_8012A7E8)[i].bgGreen = 0xFF; - (*D_8012A7E8)[i].bgBlue = 0xFF; - (*D_8012A7E8)[i].bgAlpha = 0; - (*D_8012A7E8)[i].opacity = 0xFF; - (*D_8012A7E8)[i].font = 0xFF; + for (i = 0; i < DIALOGUEBOXBACKGROUND_COUNT; i++) { + (*gDialogueBoxBackground)[i].xpos = 0; + (*gDialogueBoxBackground)[i].ypos = 0; + (*gDialogueBoxBackground)[i].x1 = 0; + (*gDialogueBoxBackground)[i].y1 = 0; + (*gDialogueBoxBackground)[i].x2 = SCREEN_WIDTH - 1; + (*gDialogueBoxBackground)[i].y2 = SCREEN_HEIGHT - 1; + (*gDialogueBoxBackground)[i].width = SCREEN_WIDTH; + (*gDialogueBoxBackground)[i].height = SCREEN_HEIGHT; + (*gDialogueBoxBackground)[i].unk10 = 0xFF; + (*gDialogueBoxBackground)[i].unk11 = 0xFF; + (*gDialogueBoxBackground)[i].unk12 = 0xFF; + (*gDialogueBoxBackground)[i].unk13 = 0; + (*gDialogueBoxBackground)[i].colorRed = 0xFF; + (*gDialogueBoxBackground)[i].colorGreen = 0xFF; + (*gDialogueBoxBackground)[i].colorBlue = 0xFF; + (*gDialogueBoxBackground)[i].colorAlpha = 0; + (*gDialogueBoxBackground)[i].bgRed = 0xFF; + (*gDialogueBoxBackground)[i].bgGreen = 0xFF; + (*gDialogueBoxBackground)[i].bgBlue = 0xFF; + (*gDialogueBoxBackground)[i].bgAlpha = 0; + (*gDialogueBoxBackground)[i].opacity = 0xFF; + (*gDialogueBoxBackground)[i].font = 0xFF; if (i != 0) { - (*D_8012A7E8)[i].unk1E = 0x4000; + (*gDialogueBoxBackground)[i].unk1E = 0x4000; } else { - (*D_8012A7E8)[i].unk1E = 0; + (*gDialogueBoxBackground)[i].unk1E = 0; } - (*D_8012A7E8)[i].unk20 = 0; - (*D_8012A7E8)[i].unk22 = 0; - (*D_8012A7E8)[i].unk24 = 0; + (*gDialogueBoxBackground)[i].unk20 = 0; + (*gDialogueBoxBackground)[i].unk22 = 0; + (*gDialogueBoxBackground)[i].unk24 = 0; } for (i = 0; i < unk8012A7EC_COUNT; i++) { (*D_8012A7EC)[i].unk1 = 0xFF; @@ -195,7 +195,7 @@ GLOBAL_ASM("asm/non_matchings/font/func_800C422C.s") void set_text_font(s32 arg0) { if (arg0 < gNumberOfFonts) { - (*D_8012A7E8)[0].font = arg0; + (*gDialogueBoxBackground)[0].font = arg0; } } @@ -222,36 +222,36 @@ GLOBAL_ASM("asm/non_matchings/font/func_800C4318.s") #endif void set_text_color(s32 red, s32 green, s32 blue, s32 alpha, s32 opacity) { - (*D_8012A7E8)[0].colorRed = red; - (*D_8012A7E8)[0].colorGreen = green; - (*D_8012A7E8)[0].colorBlue = blue; - (*D_8012A7E8)[0].colorAlpha = alpha; - (*D_8012A7E8)[0].opacity = opacity; + (*gDialogueBoxBackground)[0].colorRed = red; + (*gDialogueBoxBackground)[0].colorGreen = green; + (*gDialogueBoxBackground)[0].colorBlue = blue; + (*gDialogueBoxBackground)[0].colorAlpha = alpha; + (*gDialogueBoxBackground)[0].opacity = opacity; } void set_text_background_color(s32 red, s32 green, s32 blue, s32 alpha) { - (*D_8012A7E8)[0].bgRed = red; - (*D_8012A7E8)[0].bgGreen = green; - (*D_8012A7E8)[0].bgBlue = blue; - (*D_8012A7E8)[0].bgAlpha = alpha; + (*gDialogueBoxBackground)[0].bgRed = red; + (*gDialogueBoxBackground)[0].bgGreen = green; + (*gDialogueBoxBackground)[0].bgBlue = blue; + (*gDialogueBoxBackground)[0].bgAlpha = alpha; } // Unused? void func_800C4404(Gfx **displayList, char *text, s32 alignmentFlags) { - func_800C45A4(displayList, &(*D_8012A7E8)[0], text, alignmentFlags, 1.0f); + func_800C45A4(displayList, &(*gDialogueBoxBackground)[0], text, alignmentFlags, 1.0f); } void draw_text(Gfx **displayList, s32 xpos, s32 ypos, char *text, s32 alignmentFlags) { - unk8012A7E8 *temp = &(*D_8012A7E8)[0]; - temp->xpos = (xpos == -0x8000) ? temp->unkC >> 1 : xpos; - temp->ypos = (ypos == -0x8000) ? temp->unkE >> 1 : ypos; + DialogueBoxBackground *temp = &(*gDialogueBoxBackground)[0]; + temp->xpos = (xpos == POS_X_CENTRED) ? temp->width >> 1 : xpos; + temp->ypos = (ypos == POS_X_CENTRED) ? temp->height >> 1 : ypos; func_800C45A4(displayList, temp, text, alignmentFlags, 1.0f); } // Unused? void func_800C44C0(Gfx **displayList, s32 arg1, char *text, s32 alignmentFlags) { if (arg1 >= 0 && arg1 < 8) { - unk8012A7E8 *temp = &D_8012A7E8[arg1]; + DialogueBoxBackground *temp = &gDialogueBoxBackground[arg1]; func_800C45A4(displayList, temp, text, alignmentFlags, 1.0f); } } @@ -259,9 +259,9 @@ void func_800C44C0(Gfx **displayList, s32 arg1, char *text, s32 alignmentFlags) // Unused? void func_800C4510(Gfx **displayList, s32 arg1, s32 xpos, s32 ypos, char *text, s32 alignmentFlags) { if (arg1 >= 0 && arg1 < 8) { - unk8012A7E8 *temp = &D_8012A7E8[arg1]; - temp->xpos = (xpos == -0x8000) ? temp->unkC >> 1 : xpos; - temp->ypos = (ypos == -0x8000) ? temp->unkE >> 1 : ypos; + DialogueBoxBackground *temp = &gDialogueBoxBackground[arg1]; + temp->xpos = (xpos == POS_X_CENTRED) ? temp->width >> 1 : xpos; + temp->ypos = (ypos == POS_X_CENTRED) ? temp->height >> 1 : ypos; func_800C45A4(displayList, temp, text, alignmentFlags, 1.0f); } } @@ -280,7 +280,7 @@ s32 func_800C4DA0(u8 *text, s32 x, s32 font) { } diffX = x; if (font < 0) { - font = (*D_8012A7E8)[0].font; + font = (*gDialogueBoxBackground)[0].font; } fontData = &gFonts[font]; while (*text != '\0') { @@ -313,33 +313,33 @@ s32 func_800C4DA0(u8 *text, s32 x, s32 font) { GLOBAL_ASM("asm/non_matchings/font/func_800C4DA0.s") #endif -void func_800C4EDC(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { +void set_dialogue_box_coords(s32 arg0, s32 x1, s32 y1, s32 x2, s32 y2) { if (arg0 > 0 && arg0 < 8) { - unk8012A7E8 *temp = &D_8012A7E8[arg0]; + DialogueBoxBackground *temp = &gDialogueBoxBackground[arg0]; temp->xpos = 0; temp->ypos = 0; - if (arg1 < arg3) { - temp->unk4 = (s16)arg1; - temp->unk8 = (s16)arg3; + if (x1 < x2) { + temp->x1 = (s16)x1; + temp->x2 = (s16)x2; } else { - temp->unk8 = (s16)arg1; - temp->unk4 = (s16)arg3; + temp->x2 = (s16)x1; + temp->x1 = (s16)x2; } - if (arg2 < arg4) { - temp->unk6 = (s16)arg2; - temp->unkA = (s16)arg4; + if (y1 < y2) { + temp->y1 = (s16)y1; + temp->y2 = (s16)y2; } else { - temp->unkA = (s16)arg2; - temp->unk6 = (s16)arg4; + temp->y2 = (s16)y1; + temp->y1 = (s16)y2; } - temp->unkC = (temp->unk8 - temp->unk4) + 1; - temp->unkE = (temp->unkA - temp->unk6) + 1; + temp->width = (temp->x2 - temp->x1) + 1; + temp->height = (temp->y2 - temp->y1) + 1; } } -void func_800C4F7C(s32 arg0, s32 font) { +void set_dialogue_font(s32 arg0, s32 font) { if (arg0 >= 0 && arg0 < 8) { - unk8012A7E8 *temp = &D_8012A7E8[arg0]; + DialogueBoxBackground *temp = &gDialogueBoxBackground[arg0]; if (font < gNumberOfFonts) { temp->font = font; } @@ -348,7 +348,7 @@ void func_800C4F7C(s32 arg0, s32 font) { void func_800C4FBC(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { if (arg0 > 0 && arg0 < 8) { - unk8012A7E8 *temp = &D_8012A7E8[arg0]; + DialogueBoxBackground *temp = &gDialogueBoxBackground[arg0]; temp->unk10 = arg1; temp->unk11 = arg2; temp->unk12 = arg3; @@ -356,12 +356,12 @@ void func_800C4FBC(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { } } -void func_800C5000(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha, s32 opacity) { - unk8012A7E8 *temp; +void set_text_colour(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha, s32 opacity) { + DialogueBoxBackground *temp; if (arg0 <= 0 || arg0 >= 8) { return; } - temp = &D_8012A7E8[arg0]; + temp = &gDialogueBoxBackground[arg0]; temp->colorRed = red; temp->colorGreen = green; temp->colorBlue = blue; @@ -370,11 +370,11 @@ void func_800C5000(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha, s32 opacit } void func_800C5050(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { - unk8012A7E8 *temp; + DialogueBoxBackground *temp; if (arg0 <= 0 || arg0 >= 8) { return; } - temp = &D_8012A7E8[arg0]; + temp = &gDialogueBoxBackground[arg0]; temp->bgRed = arg1; temp->bgGreen = arg2; temp->bgBlue = arg3; @@ -383,40 +383,40 @@ void func_800C5050(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { // Unused? void func_800C5094(s32 arg0, s32 arg1, s32 arg2) { - unk8012A7E8 *temp; + DialogueBoxBackground *temp; if (arg0 <= 0 || arg0 >= 8) { return; } - temp = &D_8012A7E8[arg0]; + temp = &gDialogueBoxBackground[arg0]; temp->unk20 += arg1; temp->unk22 += arg2; } // Unused? void func_800C50D8(s32 arg0) { - unk8012A7E8 *temp; + DialogueBoxBackground *temp; if (arg0 <= 0 || arg0 >= 8) { return; } - temp = &D_8012A7E8[arg0]; + temp = &gDialogueBoxBackground[arg0]; temp->unk20 = 0; temp->unk22 = 0; } // Unused? void func_800C510C(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { - func_800C5168(arg0, (*D_8012A7E8)[arg0].xpos, (*D_8012A7E8)[arg0].ypos, arg1, arg2, arg3); + render_dialogue_text(arg0, (*gDialogueBoxBackground)[arg0].xpos, (*gDialogueBoxBackground)[arg0].ypos, arg1, arg2, arg3); } -GLOBAL_ASM("asm/non_matchings/font/func_800C5168.s") +GLOBAL_ASM("asm/non_matchings/font/render_dialogue_text.s") // Unused -void func_800C5428(s32 arg0, unk8012A7E8_24 *arg1) { - unk8012A7E8 *temp; - unk8012A7E8_24 *temp_24; - unk8012A7E8_24 **temp_24_ptr; +void func_800C5428(s32 arg0, DialogueBox *arg1) { + DialogueBoxBackground *temp; + DialogueBox *temp_24; + DialogueBox **temp_24_ptr; - temp = &D_8012A7E8[arg0]; + temp = &gDialogueBoxBackground[arg0]; temp_24_ptr = &temp->unk24; temp_24 = temp->unk24; while ((temp_24 != NULL) && (temp_24 != arg1)) { @@ -430,10 +430,10 @@ void func_800C5428(s32 arg0, unk8012A7E8_24 *arg1) { } void func_800C5494(s32 arg0) { - unk8012A7E8 *temp; - unk8012A7E8_24 *temp_24, *temp_24_2; + DialogueBoxBackground *temp; + DialogueBox *temp_24, *temp_24_2; - temp = &D_8012A7E8[arg0]; + temp = &gDialogueBoxBackground[arg0]; temp_24 = temp->unk24; if (temp_24 != NULL) { temp_24_2 = temp_24; // This seems redundant. @@ -448,9 +448,9 @@ void func_800C5494(s32 arg0) { // Unused void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4) { FontData *fontData; - unk8012A7E8 *temp; + DialogueBoxBackground *temp; - temp = &D_8012A7E8[arg0]; + temp = &gDialogueBoxBackground[arg0]; if (arg1 != NULL) { if (arg1->unk19 != 0xFF) { @@ -461,7 +461,7 @@ void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4) { arg3 *= fontData->unk22; break; case 2: - arg3 *= (temp->unkE / fontData->unk22) * fontData->unk22; + arg3 *= (temp->height / fontData->unk22) * fontData->unk22; break; } arg1->unkC += arg2; @@ -476,30 +476,30 @@ void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4) { } void func_800C55F4(s32 arg0) { - (*D_8012A7E8)[arg0].unk1E |= 0x8000; + (*gDialogueBoxBackground)[arg0].unk1E |= 0x8000; } void func_800C5620(s32 arg0) { - (*D_8012A7E8)[arg0].unk1E &= 0x7FFF; + (*gDialogueBoxBackground)[arg0].unk1E &= 0x7FFF; } // Unused? void func_800C564C(s32 arg0) { - (*D_8012A7E8)[arg0].unk1E |= 0x0001; + (*gDialogueBoxBackground)[arg0].unk1E |= 0x0001; } // Unused? void func_800C5678(s32 arg0) { - (*D_8012A7E8)[arg0].unk1E &= 0xFFFE; + (*gDialogueBoxBackground)[arg0].unk1E &= 0xFFFE; } // Unused? void func_800C56A4(s32 arg0) { - (*D_8012A7E8)[arg0].unk1E |= 0x4000; + (*gDialogueBoxBackground)[arg0].unk1E |= 0x4000; } void func_800C56D0(s32 arg0) { - (*D_8012A7E8)[arg0].unk1E &= 0xBFFF; + (*gDialogueBoxBackground)[arg0].unk1E &= 0xBFFF; } void func_800C56FC(s32 arg0, s32 arg1, s32 arg2) { @@ -514,8 +514,8 @@ void func_800C56FC(s32 arg0, s32 arg1, s32 arg2) { } for (i = 1; i < 8; i++) { - if ((*D_8012A7E8)[i].unk1E & 0x8000) { - if ((*D_8012A7E8)[i].unk1E & 0x4000) { + if ((*gDialogueBoxBackground)[i].unk1E & 0x8000) { + if ((*gDialogueBoxBackground)[i].unk1E & 0x4000) { func_800C5B58(arg0, arg1, arg2, i); } else { func_800C5B58(arg0, 0, 0, i); @@ -581,34 +581,34 @@ void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry) { } void func_800C5B58(Gfx **dlist, s32 *arg1, s32 *arg2, s32 arg3) { - unk8012A7E8 *temp; - unk8012A7E8_24 *temp_24; + DialogueBoxBackground *temp; + DialogueBox *temp_24; s32 i; s32 x0, x1; char sp6C[256]; s32 y0, y1; - temp = &D_8012A7E8[arg3]; + temp = &gDialogueBoxBackground[arg3]; if (temp->unk13 != 0) { gSPDisplayList((*dlist)++, &D_800E3690); gDkrDmaDisplayList((*dlist)++, ((u8 *)&D_800E36C8[1]) + 0x80000000, 2); gDPSetEnvColor((*dlist)++, 0, 0, 0, 0); - if ((temp->unk8 - temp->unk4) < 10 || (temp->unkA - temp->unk6) < 10) { - render_fill_rectangle(dlist, temp->unk4 - 2, temp->unk6 - 2, temp->unk8 + 2, temp->unkA + 2); + if ((temp->x2 - temp->x1) < 10 || (temp->y2 - temp->y1) < 10) { + render_fill_rectangle(dlist, temp->x1 - 2, temp->y1 - 2, temp->x2 + 2, temp->y2 + 2); } else { - render_fill_rectangle(dlist, temp->unk4 - 2, temp->unk6 + 2, temp->unk4 + 2, temp->unkA - 2); - render_fill_rectangle(dlist, temp->unk4 - 2, temp->unk6 - 2, temp->unk8 + 2, temp->unk6 + 2); - render_fill_rectangle(dlist, temp->unk8 - 2, temp->unk6 + 2, temp->unk8 + 2, temp->unkA - 2); - render_fill_rectangle(dlist, temp->unk4 - 2, temp->unkA - 2, temp->unk8 + 2, temp->unkA + 2); + render_fill_rectangle(dlist, temp->x1 - 2, temp->y1 + 2, temp->x1 + 2, temp->y2 - 2); + render_fill_rectangle(dlist, temp->x1 - 2, temp->y1 - 2, temp->x2 + 2, temp->y1 + 2); + render_fill_rectangle(dlist, temp->x2 - 2, temp->y1 + 2, temp->x2 + 2, temp->y2 - 2); + render_fill_rectangle(dlist, temp->x1 - 2, temp->y2 - 2, temp->x2 + 2, temp->y2 + 2); } gDPPipeSync((*dlist)++); gDPSetEnvColor((*dlist)++, temp->unk10, temp->unk11, temp->unk12, temp->unk13); for (i = 0; D_800E3710[i] >= 0; i += 5) { - x0 = D_800E3710[i] + temp->unk4; - y0 = (D_800E3710[i + 1]) ? D_800E3710[i + 2] + temp->unkA : D_800E3710[i + 2] + temp->unk6; - x1 = temp->unk8 - D_800E3710[i]; - y1 = (D_800E3710[i + 3]) ? D_800E3710[i + 4] + temp->unkA : D_800E3710[i + 4] + temp->unk6; + x0 = D_800E3710[i] + temp->x1; + y0 = (D_800E3710[i + 1]) ? D_800E3710[i + 2] + temp->y2 : D_800E3710[i + 2] + temp->y1; + x1 = temp->x2 - D_800E3710[i]; + y1 = (D_800E3710[i + 3]) ? D_800E3710[i + 4] + temp->y2 : D_800E3710[i + 4] + temp->y1; render_fill_rectangle(dlist, x0, y0, x1, y1); } gDPPipeSync((*dlist)++); diff --git a/src/font.h b/src/font.h index a02cade3..a7e6454d 100644 --- a/src/font.h +++ b/src/font.h @@ -14,6 +14,13 @@ #include "f3ddkr.h" #include "textures_sprites.h" +#define POS_X_CENTRED -0x8000 + +enum TextFonts { + FONT_COLOURFUL, + FONT_SMALL, +}; + /* Size: 0x20 bytes */ typedef struct unk8012A7EC { u8 unk0; @@ -69,9 +76,9 @@ typedef struct FontData { /* 0x100 */ FontCharData unk100[96]; } FontData; -#define unk8012A7E8_COUNT 8 +#define DIALOGUEBOXBACKGROUND_COUNT 8 #define unk8012A7EC_COUNT 64 -#define unk8012A7E8_TOTAL_SIZE (sizeof(unk8012A7E8) * unk8012A7E8_COUNT) +#define DIALOGUEBOXBACKGROUND_TOTAL_SIZE (sizeof(DialogueBoxBackground) * DIALOGUEBOXBACKGROUND_COUNT) #define unk8012A7EC_TOTAL_SIZE (sizeof(unk8012A7EC) * unk8012A7EC_COUNT) void load_fonts(void); @@ -84,15 +91,15 @@ void func_800C4404(Gfx** displayList, char *text, s32 alignmentFlags); void draw_text(Gfx** displayList, s32 xpos, s32 ypos, char *text, s32 alignmentFlags); void func_800C44C0(Gfx** displayList, s32 arg1, char *text, s32 alignmentFlags); void func_800C4510(Gfx** displayList, s32 arg1, s32 xpos, s32 ypos, char *text, s32 alignmentFlags); -void func_800C4EDC(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); -void func_800C4F7C(s32 arg0, s32 font); +void set_dialogue_box_coords(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); +void set_dialogue_font(s32 arg0, s32 font); void func_800C4FBC(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); -void func_800C5000(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha, s32 opacity); +void set_text_colour(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha, s32 opacity); void func_800C5050(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); void func_800C5094(s32 arg0, s32 arg1, s32 arg2); void func_800C50D8(s32 arg0); void func_800C510C(s32 arg0, s32 arg1, s32 arg2, s32 arg3); -void func_800C5428(s32 arg0, unk8012A7E8_24 *arg1); +void func_800C5428(s32 arg0, DialogueBox *arg1); void func_800C5494(s32 arg0); void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4); void func_800C55F4(s32 arg0); @@ -110,8 +117,8 @@ void s32_to_string(char** outString, s32 number); //Non Matching TextureHeader *func_800C4318(s32 font, u8 arg1); //Non Matching void func_800C4170(s32 arg0); //Non Matching void func_800C422C(s32 arg0); //Non Matching -void func_800C45A4(Gfx **dlist, unk8012A7E8 *arg1, u8 *text, s32 alignmentFlags, f32 arg4); //Non Matching +void func_800C45A4(Gfx **dlist, DialogueBoxBackground *arg1, u8 *text, s32 alignmentFlags, f32 arg4); //Non Matching s32 func_800C4DA0(u8 *text, s32 x, s32 font); //Non Matching -//void func_800C5168(s32, s16, s16, s32, s32, s32); //Non Matching +//void render_dialogue_text(s32 unk01, s16 posX, s16 posY, s32 text, s32 unk01, s32 unk02); //Non Matching #endif diff --git a/src/menu.c b/src/menu.c index 527bd541..7cec9a1e 100644 --- a/src/menu.c +++ b/src/menu.c @@ -110,7 +110,7 @@ s32 D_80126500; s8 sDialogueOptionMax; s32 D_80126508; s16 D_8012650C; -s8 D_8012650E; +s8 gDialogOptionYOffset; s32 D_80126510; s16 D_80126514; s8 D_80126516; @@ -321,7 +321,7 @@ s8 D_800DF4E4[4] = { }; s32 D_800DF4E8 = 0; // Currently unknown, might be a different type. -s8 D_800DF4EC = 0; +s8 gDialogOptionTangible = FALSE; // Unused? s32 D_800DF4F0[] = { @@ -2154,7 +2154,7 @@ void func_800829F8(Gfx *dl, s32 mulFactor) { if (osTvType == TV_TYPE_PAL) { temp = 0xEA; } - draw_text(dl, -0x8000, temp, gMenuText[151], 0xC); + draw_text(dl, POS_X_CENTRED, temp, gMenuText[151], 0xC); } } @@ -2215,8 +2215,8 @@ s32 menu_logo_screen_loop(s32 arg0) { set_text_color(0xFF, 0xFF, 0, 0xFF, phi_v0); draw_text(&D_801263A0, 0x9F, yOffset + 0xD4, gRareCopyrightString, 0xC); draw_text(&D_801263A0, 0xA1, yOffset + 0xD4, gRareCopyrightString, 0xC); - draw_text(&D_801263A0, -0x8000, yOffset + 0xD3, gRareCopyrightString, 0xC); - draw_text(&D_801263A0, -0x8000, yOffset + 0xD5, gRareCopyrightString, 0xC); + draw_text(&D_801263A0, POS_X_CENTRED, yOffset + 0xD3, gRareCopyrightString, 0xC); + draw_text(&D_801263A0, POS_X_CENTRED, yOffset + 0xD5, gRareCopyrightString, 0xC); } sp20 = yOffset + 0xD4; if (D_80126450 > 8.0) { @@ -2225,7 +2225,7 @@ s32 menu_logo_screen_loop(s32 arg0) { phi_v0 = 0xFF; } set_text_color(0xFF, 0xFF, 0xFF, 0xFF, phi_v0); - draw_text(&D_801263A0, -0x8000, sp20, gRareCopyrightString, 0xC); + draw_text(&D_801263A0, POS_X_CENTRED, sp20, gRareCopyrightString, 0xC); } return 0; } @@ -2349,7 +2349,7 @@ void func_800841B8(s32 arg0) { phi_a3 = 0; } set_text_color(255, 255, 255, phi_a3, 0xFF); - draw_text(&D_801263A0, -0x8000, phi_s2, gOptionMenuStrings[phi_s1], 0xC); + draw_text(&D_801263A0, POS_X_CENTRED, phi_s2, gOptionMenuStrings[phi_s1], 0xC); phi_s1++; phi_s2 += 0x1C; @@ -2994,7 +2994,7 @@ void menu_magic_codes_init(void) { D_801263D8 = 0; D_801263E0 = 0; func_800C01D8(&D_800DF77C); - func_800C4EDC(7, 0x32, 0x32, 0x10E, 0x84); + set_dialogue_box_coords(7, 0x32, 0x32, 0x10E, 0x84); func_800C4FBC(7, 0, 0, 0, 0x80); func_800C5494(7); func_800C4170(2); @@ -3067,7 +3067,7 @@ void render_magic_codes_ui(s32 arg0) { alpha = temp; } set_text_color(0xFF, 0xFF, 0xFF, alpha, 0xFF); - draw_text(&D_801263A0, -0x8000, yPos, gMagicCodeMenuStrings[i], 0xC); + draw_text(&D_801263A0, POS_X_CENTRED, yPos, gMagicCodeMenuStrings[i], 0xC); yPos += yIncr; } set_text_font(0); @@ -3075,15 +3075,15 @@ void render_magic_codes_ui(s32 arg0) { set_text_background_color(0, 0, 0x80, 0x80); if (gOptionsMenuItemIndex == 4) { if (D_80126C4C == -1) { - draw_text(&D_801263A0, -0x8000, 0x90, gMenuText[18], 0xC); // gMenuText[18] = "Sorry, the code was incorrect" + draw_text(&D_801263A0, POS_X_CENTRED, 0x90, gMenuText[18], 0xC); // gMenuText[18] = "Sorry, the code was incorrect" } else { // Draw cheat code name. - draw_text(&D_801263A0, -0x8000, 0x90, (char *)(*gCheatsAssetData) + (*gCheatsAssetData + 1)[D_80126C4C + 1], 0xC); + draw_text(&D_801263A0, POS_X_CENTRED, 0x90, (char *)(*gCheatsAssetData) + (*gCheatsAssetData + 1)[D_80126C4C + 1], 0xC); } } else if (5 == gOptionsMenuItemIndex) { - draw_text(&D_801263A0, -0x8000, 0x90, D_80126C58, 0xC); + draw_text(&D_801263A0, POS_X_CENTRED, 0x90, D_80126C58, 0xC); } else if (gOptionsMenuItemIndex == 6) { - draw_text(&D_801263A0, -0x8000, 0x90, gMenuText[19], 0xC); // gMenuText[19] = "All cheats have been deleted" + draw_text(&D_801263A0, POS_X_CENTRED, 0x90, gMenuText[19], 0xC); // gMenuText[19] = "All cheats have been deleted" } if (D_801263E0 != 0) { yPos = 0x78; @@ -3091,8 +3091,8 @@ void render_magic_codes_ui(s32 arg0) { yPos = 0x86; } func_800C5494(6); - func_800C4F7C(6, 0); - func_800C4EDC(6, 0x4C, yPos - 0x1C, 0xF4, yPos + 0x1C); + set_dialogue_font(6, FONT_COLOURFUL); + set_dialogue_box_coords(6, 0x4C, yPos - 0x1C, 0xF4, yPos + 0x1C); func_800C4FBC(6, 0, 0, 0, 0xA0); yPos = 4; for (i = 0; i < 3; i++) { @@ -3104,10 +3104,10 @@ void render_magic_codes_ui(s32 arg0) { } else if (i == D_801263E0) { alpha = temp; } - func_800C5000(6, 0xFF, green, 0xFF, alpha, 0xFF); + set_text_colour(6, 0xFF, green, 0xFF, alpha, 0xFF); // gMenuText[148] = "CLEAR ALL CODES?", [149] = "OK", [150] = "CANCEL" - func_800C5168(6, -0x8000, yPos, gMenuText[148 + i], 1, 4); + render_dialogue_text(6, POS_X_CENTRED, yPos, gMenuText[148 + i], 1, 4); if (i != 0) { yPos += 0x10; @@ -3199,7 +3199,7 @@ void render_magic_codes_list_menu_text(s32 arg0) { if (numOfUnlockedCheats == gOptionsMenuItemIndex) { set_text_color(0xFF, 0xFF, 0xFF, fp, 0xFF); } - draw_text(&D_801263A0, -0x8000, s2, gMenuText[5], 4); // RETURN + draw_text(&D_801263A0, POS_X_CENTRED, s2, gMenuText[5], 4); // RETURN return; } if (D_801263BC & 8) { @@ -3968,7 +3968,7 @@ void render_file_select_menu(s32 arg0) { } else { color = 0x6A9073FF; } - func_80080580(0, D_800E03CC[i].unk0 - 0xA0, 0x78 - D_800E03CC[i].unk2, D_800E03CC[i].unk4, + func_80080580(0, D_800E03CC[i].unk0 - 0xA0, 0x78 - D_800E03CC[i].unk2, D_800E03CC[i].unk4, D_800E03CC[i].unk6, D_800E03CC[i].unk8, D_800E03CC[i].unkA, color, D_80126550[67]); } func_80080BC8(&D_801263A0); @@ -4024,7 +4024,7 @@ void render_file_select_menu(s32 arg0) { } if (s2) { s32 temp_t0 = phi_v0_2 | ~0xFF; - func_80080E90(&D_801263A0, D_800E03CC[i].unk0, D_800E03CC[i].unk2 + y, D_800E03CC[i].unk4, D_800E03CC[i].unk6, + func_80080E90(&D_801263A0, D_800E03CC[i].unk0, D_800E03CC[i].unk2 + y, D_800E03CC[i].unk4, D_800E03CC[i].unk6, D_800E03CC[i].unk8, D_800E03CC[i].unkA, temp_t0, temp_t0, temp_t0, temp_t0); } if (D_80126CC0 == 0 || i != gSaveFileIndex) { @@ -4379,7 +4379,7 @@ void render_track_select_setup_ui(s32 arg0) { set_text_font(2); set_text_color(0xC0, 0xC0, 0xFF, 0, D_800DF764); set_text_background_color(0, 0, 0, 0); - draw_text(&D_801263A0, -0x8000, 0x2B, func_8006BDDC(gTrackIdForPreview), 0xC); // Draw track name? + draw_text(&D_801263A0, POS_X_CENTRED, 0x2B, func_8006BDDC(gTrackIdForPreview), 0xC); // Draw track name? sp84 = D_801263BC * 8; if (sp84 >= 0x100) { sp84 = 0x1FF - sp84; @@ -4396,7 +4396,7 @@ void render_track_select_setup_ui(s32 arg0) { } else { s4 += 0xC; } - func_80080580(&D_801263A0, -(s4 >> 1), 0x78 - D_800E0700[1], s4, D_800E0700[3], + func_80080580(&D_801263A0, -(s4 >> 1), 0x78 - D_800E0700[1], s4, D_800E0700[3], D_800E0700[4], D_800E0700[5], D_800DF764 + 0xB0E0C000, D_8012665C); func_80080E6C(); set_text_font(0); @@ -4434,7 +4434,7 @@ void render_track_select_setup_ui(s32 arg0) { if (D_801263E0 != -1) { if (gNumberOfActivePlayers == 1) { // Glow effect - func_800C4EDC(7, 0x86, sp80 + 0x70, 0xBA, sp80 + 0x89); + set_dialogue_box_coords(7, 0x86, sp80 + 0x70, 0xBA, sp80 + 0x89); func_800C5B58(&D_801263A0, 0, 0, 7); if (D_801263E0 <= 0) { render_textured_rectangle(&D_801263A0, &D_800E05B4, 0x88, sp80 + 0x72, 0xFF, 0xFF, 0xFF, D_800DF764); @@ -4458,7 +4458,7 @@ void render_track_select_setup_ui(s32 arg0) { s32 temp_v0_9 = D_800E0688[s3 + (i * 2)]; s32 temp_v1 = D_800E0688[s3 + (i * 2) + 1] + sp80; // Glow effect around Player image - func_800C4EDC(7, temp_v0_9 - 2, temp_v1 - 2, temp_v0_9 + 0x32, temp_v1 + 0x17); + set_dialogue_box_coords(7, temp_v0_9 - 2, temp_v1 - 2, temp_v0_9 + 0x32, temp_v1 + 0x17); func_800C5B58(&D_801263A0, 0, 0, 7); } @@ -5990,25 +5990,29 @@ s32 func_8009CFEC(u32 arg0) { return result; } -void func_8009D118(s32 arg0) { - if (arg0 == 0) { - func_800C5000(1, 0, 0, 0x7F, 0x5A, 0xFF); - if (D_800DF4EC != 0) { - func_800C5000(1, 0, 0, 0x7F, 0x5A, 0x78); +/** + * Each dialogue option runs this. If the condition is true, it makes the text partially whiter. + * Otherwise, it stays as normal, or fades out, depending on whether the option is accessable. + */ +void set_option_text_colour(s32 condition) { + if (condition == FALSE) { + set_text_colour(1, 0, 0, 0x7F, 0x5A, 0xFF); // Normal + if (gDialogOptionTangible != FALSE) { + set_text_colour(1, 0, 0, 0x7F, 0x5A, 0x78); //Locked } } else { - func_800C5000(1, 0xCF, 0xCF, 0xCF, 0x5A, 0xFF); + set_text_colour(1, 0xCF, 0xCF, 0xCF, 0x5A, 0xFF); // Selected Option } - D_800DF4EC = (u8)0; + gDialogOptionTangible = (u8)FALSE; } -void func_8009D1B8(s32 arg0, s32 arg1, s32 arg2) { - func_8009D118(sDialogueOption == sDialogueOptionMax); +void render_dialogue_option(char *text, s32 yOffset, s32 optionID) { + set_option_text_colour(sDialogueOption == sDialogueOptionMax); if (sDialogueOption == sDialogueOptionMax) { - D_80126516 = arg2; + D_80126516 = optionID; } - func_800C5168(1, -0x8000, D_8012650E, arg0, 1, 4); - D_8012650E = (s8)(D_8012650E + arg1); + render_dialogue_text(1, POS_X_CENTRED, gDialogOptionYOffset, text, 1, 4); + gDialogOptionYOffset = (s8)(gDialogOptionYOffset + yOffset); sDialogueOptionMax = (s8)(sDialogueOptionMax + 1); } @@ -6057,8 +6061,8 @@ s32 taj_menu_loop(void) { sCurrentMenuID = 1; } if ((sCurrentMenuID > 0) && (sCurrentMenuID < 4)) { - func_800C4EDC(1, 0x18, 0x10, 0xB8, 0x7C); - func_800C4F7C(1, 0); + set_dialogue_box_coords(1, 24, 16, 184, 124); + set_dialogue_font(1, FONT_COLOURFUL); } sp2C = 0; buttonsPressed = get_buttons_pressed_from_player(0); @@ -6067,30 +6071,30 @@ s32 taj_menu_loop(void) { switch (sCurrentMenuID) { case 2: case 0x62: - func_800C5168(1, -0x8000, 6, gMenuText[40], 1, 4); // VEHICLE SELECT - D_8012650E = 0x1E; - func_8009D1B8(gMenuText[41], 0x14, 0); // CAR - func_8009D1B8(gMenuText[42], 0x14, 1); // HOVERCRAFT - func_8009D1B8(gMenuText[43], 0x14, 2); // PLANE - func_8009D1B8(gMenuText[44], 0x14, 3); // MAIN MENU + render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[40], 1, 4); // VEHICLE SELECT + gDialogOptionYOffset = 30; + render_dialogue_option(gMenuText[41], 20, 0); // CAR + render_dialogue_option(gMenuText[42], 20, 1); // HOVERCRAFT + render_dialogue_option(gMenuText[43], 20, 2); // PLANE + render_dialogue_option(gMenuText[44], 20, 3); // MAIN MENU break; case 3: case 0x63: - func_800C5168(1, -0x8000, 6, gMenuText[45], 1, 4); // CHALLENGE SELECT - D_8012650E = 0x1E; + render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[45], 1, 4); // CHALLENGE SELECT + gDialogOptionYOffset = 30; if (settings->tajFlags & TAJ_FLAGS_CAR_CHAL_UNLOCKED) { - D_800DF4EC = settings->tajFlags & TAJ_FLAGS_CAR_CHAL_COMPLETED; - func_8009D1B8(gMenuText[46], 0x14, 0); // CAR CHALLENGE + gDialogOptionTangible = settings->tajFlags & TAJ_FLAGS_CAR_CHAL_COMPLETED; + render_dialogue_option(gMenuText[46], 0x14, 0); // CAR CHALLENGE } if (settings->tajFlags & TAJ_FLAGS_HOVER_CHAL_UNLOCKED) { - D_800DF4EC = settings->tajFlags & TAJ_FLAGS_HOVER_CHAL_COMPLETED; - func_8009D1B8(gMenuText[47], 0x14, 1); // HOVER CHALLENGE + gDialogOptionTangible = settings->tajFlags & TAJ_FLAGS_HOVER_CHAL_COMPLETED; + render_dialogue_option(gMenuText[47], 0x14, 1); // HOVER CHALLENGE } if (settings->tajFlags & TAJ_FLAGS_PLANE_CHAL_UNLOCKED) { - D_800DF4EC = settings->tajFlags & TAJ_FLAGS_PLANE_CHAL_COMPLETED; - func_8009D1B8(gMenuText[48], 0x14, 2); // PLANE CHALLENGE + gDialogOptionTangible = settings->tajFlags & TAJ_FLAGS_PLANE_CHAL_COMPLETED; + render_dialogue_option(gMenuText[48], 0x14, 2); // PLANE CHALLENGE } - func_8009D1B8(gMenuText[44], 0x14, 3); // MAIN MENU + render_dialogue_option(gMenuText[44], 0x14, 3); // MAIN MENU break; } @@ -6102,13 +6106,13 @@ s32 taj_menu_loop(void) { break; case 1: D_800DF4DC = 0; - func_800C5168(1, -0x8000, 6, gMenuText[36], 1, 4); // OPTIONS - D_8012650E = 0x1E; - func_8009D1B8(gMenuText[37], 0x14, 0); // CHANGE VEHICLE + render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[36], 1, 4); // OPTIONS + gDialogOptionYOffset = 30; + render_dialogue_option(gMenuText[37], 0x14, 0); // CHANGE VEHICLE if (settings->tajFlags & TAJ_FLAGS_UNLOCKED_A_CHALLENGE) { - func_8009D1B8(gMenuText[39], 0x14, 1); // CHALLENGES + render_dialogue_option(gMenuText[39], 0x14, 1); // CHALLENGES } - func_8009D1B8(gMenuText[5], 0x14, 2); // RETURN + render_dialogue_option(gMenuText[5], 0x14, 2); // RETURN func_8009D26C(); if (buttonsPressed & B_BUTTON) { sp2C = 3; @@ -6216,17 +6220,17 @@ s32 func_8009D9F4(void) { s32 state; s32 playerInput; - func_800C4EDC(1, 0x18, 0x10, 0xB8, 0x87); - func_800C4F7C(1, 0); + set_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0x87); + set_dialogue_font(1, FONT_COLOURFUL); state = 0; playerInput = get_buttons_pressed_from_player(0); sDialogueOptionMax = 0; D_800DF4DC = 0; - func_800C5168(1, -0x8000, 6, gMenuText[49], 1, 4); // BETTER LUCK - func_800C5168(1, -0x8000, 0x14, gMenuText[50], 1, 4); // NEXT TIME! - D_8012650E = 0x32; - func_8009D1B8(gMenuText[23], 0x14, 0); // TRY AGAIN - func_8009D1B8(gMenuText[51], 0x14, 1); // EXIT + render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[49], 1, 4); // BETTER LUCK + render_dialogue_text(1, POS_X_CENTRED, 20, gMenuText[50], 1, 4); // NEXT TIME! + gDialogOptionYOffset = 50; + render_dialogue_option(gMenuText[23], 20, 0); // TRY AGAIN + render_dialogue_option(gMenuText[51], 20, 1); // EXIT func_8009D26C(); if (playerInput & A_BUTTON) { func_80001D04(0xEF, NULL); @@ -6268,31 +6272,31 @@ s32 tt_menu_loop(void) { if (func_8001B780() != 0) { currentOption = 0x88; } - func_800C4EDC(1, 0x18, 0x10, 0xC0, currentOption); + set_dialogue_box_coords(1, 0x18, 0x10, 0xC0, currentOption); } else { - func_800C4EDC(1, 0x18, 0x10, 0xB8, 0xDC); + set_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0xDC); } - func_800C4F7C(1, 0); + set_dialogue_font(1, FONT_COLOURFUL); currentOption = 0; buttonsPressed = get_buttons_pressed_from_player(0); sDialogueOptionMax = 0; - D_8012650E = 0x20; + gDialogOptionYOffset = 32; switch (sCurrentMenuID) { case TT_MENU_ROOT: case TT_MENU_EXIT: - func_800C5168(1, -0x8000, 6, gMenuText[36], 1, 4); // OPTIONS - func_8009D1B8(gMenuText[71], 0x14, 3); // STATUS + render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[36], 1, 4); // OPTIONS + render_dialogue_option(gMenuText[71], 0x14, 3); // STATUS if (!is_in_two_player_adventure()) { if (is_time_trial_enabled()) { - func_8009D1B8(gMenuText[65], 0x14, 0); // TIME TRIAL ON + render_dialogue_option(gMenuText[65], 0x14, 0); // TIME TRIAL ON } else { - func_8009D1B8(gMenuText[66], 0x14, 0); // TIME TRIAL OFF + render_dialogue_option(gMenuText[66], 0x14, 0); // TIME TRIAL OFF } if (func_8001B780() != 0) { - func_8009D1B8(gMenuText[27], 0x14, 1); // SAVE GHOST + render_dialogue_option(gMenuText[27], 0x14, 1); // SAVE GHOST } } - func_8009D1B8(gMenuText[5], 0x14, 2); // RETURN + render_dialogue_option(gMenuText[5], 0x14, 2); // RETURN func_8009D26C(); if (D_80126516 == 0) { if (gControllersXAxisDirection[0] > 0) { @@ -6350,7 +6354,7 @@ s32 tt_menu_loop(void) { sp38 -= sp24 * 8; sp24 = 0; while (D_801263A4[sp24] != NULL) { - func_800C5168(1, -0x8000, sp38, D_801263A4[sp24], 1, 4); + render_dialogue_text(1, POS_X_CENTRED, sp38, D_801263A4[sp24], 1, 4); sp38 += 0x10; sp24++; } @@ -6370,7 +6374,7 @@ s32 tt_menu_loop(void) { case TT_MENU_INTRODUCTION: sp20 = 6; for (i = 52; gMenuText[i] != NULL; i++) { - func_800C5168(1, -0x8000, sp20, gMenuText[i], 1, 4); + render_dialogue_text(1, POS_X_CENTRED, sp20, gMenuText[i], 1, 4); sp20 += 0x10; } if (buttonsPressed & (A_BUTTON | B_BUTTON)) { @@ -6379,9 +6383,9 @@ s32 tt_menu_loop(void) { } break; case TT_MENU_INSERT_CONT_PAK: - func_800C5168(1, -0x8000, 0x22, gMenuText[159], 1, 4); // If you wish to use - func_800C5168(1, -0x8000, 0x32, gMenuText[160], 1, 4); // the Controller Pak - func_800C5168(1, -0x8000, 0x42, gMenuText[162], 1, 4); // insert it now! + render_dialogue_text(1, POS_X_CENTRED, 34, gMenuText[159], 1, 4); // If you wish to use + render_dialogue_text(1, POS_X_CENTRED, 50, gMenuText[160], 1, 4); // the Controller Pak + render_dialogue_text(1, POS_X_CENTRED, 66, gMenuText[162], 1, 4); // insert it now! if (buttonsPressed & (A_BUTTON | START_BUTTON)) { func_80001D04(0xEF, 0); D_80126398 = 0; @@ -6393,15 +6397,15 @@ s32 tt_menu_loop(void) { } break; case TT_MENU_INSERT_RUMBLE_PAK: - func_800C5168(1, -0x8000, 0x22, gMenuText[159], 1, 4); // If you wish to use - func_800C5168(1, -0x8000, 0x32, gMenuText[161], 1, 4); // the Rumble Pak - func_800C5168(1, -0x8000, 0x42, gMenuText[162], 1, 4); // insert it now! + render_dialogue_text(1, POS_X_CENTRED, 34, gMenuText[159], 1, 4); // If you wish to use + render_dialogue_text(1, POS_X_CENTRED, 50, gMenuText[161], 1, 4); // the Rumble Pak + render_dialogue_text(1, POS_X_CENTRED, 66, gMenuText[162], 1, 4); // insert it now! if (buttonsPressed & (A_BUTTON | B_BUTTON | START_BUTTON)) { sCurrentMenuID = TT_MENU_ROOT; } break; case TT_MENU_SAVE_GHOST: - func_800C5168(1, -0x8000, 0x32, gMenuText[124], 1, 4); // PLEASE WAIT + render_dialogue_text(1, POS_X_CENTRED, 50, gMenuText[124], 1, 4); // PLEASE WAIT D_80126398++; if (D_80126398 >= 5) { s32 result = func_8001B738(0) & 0xFF; @@ -6442,7 +6446,7 @@ s32 tt_menu_loop(void) { if ((sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_1) || (sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_2) || (sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_3)) { - func_800C5168(1, -0x8000, 6, gMenuText[64], 1, 4); // PAK ERROR + render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[64], 1, 4); // PAK ERROR } return currentOption; @@ -6457,11 +6461,11 @@ s32 trophy_race_cabinet_menu_loop(void) { s32 currentOption; s32 buttonsPressed; - func_800C4EDC(1, 0x18, 0x10, 0xB8, 0x78); - func_800C4F7C(1, 0); + set_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0x78); + set_dialogue_font(1, FONT_COLOURFUL); currentOption = 0; buttonsPressed = get_buttons_pressed_from_player(0); - func_800C5168(1, -0x8000, 6, gMenuText[70], 1, 4); // TROPHY RACE + render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[70], 1, 4); // TROPHY RACE if (gControllersYAxisDirection[0] < 0) { sDialogueOption++; } else if (gControllersYAxisDirection[0] > 0) { @@ -6473,10 +6477,10 @@ s32 trophy_race_cabinet_menu_loop(void) { if (sDialogueOption > 1) { sDialogueOption = 1; } - func_8009D118(sDialogueOption == 0); - func_800C5168(1, -0x8000, 0x1E, gMenuText[180], 1, 4); // ENTER TROPHY RACE - func_8009D118(sDialogueOption == 1); - func_800C5168(1, -0x8000, 0x32, gMenuText[51], 1, 4); // EXIT + set_option_text_colour(sDialogueOption == 0); + render_dialogue_text(1, POS_X_CENTRED, 30, gMenuText[180], 1, 4); // ENTER TROPHY RACE + set_option_text_colour(sDialogueOption == 1); + render_dialogue_text(1, POS_X_CENTRED, 50, gMenuText[51], 1, 4); // EXIT if (buttonsPressed & A_BUTTON) { currentOption = sDialogueOption + 1; } @@ -6492,7 +6496,7 @@ void func_8009E9A0(void) { void func_8009E9A8(void) { } -f32 func_8009E9B0(unk8012A7E8 *arg0, Gfx **arg1, s32 *arg2, s32 *arg3) { +f32 func_8009E9B0(DialogueBoxBackground *arg0, Gfx **arg1, s32 *arg2, s32 *arg3) { D_801263A0 = *arg1; D_801263A8 = *arg2; D_801263AC = *arg3; diff --git a/src/menu.h b/src/menu.h index ddab56fa..1e38c0a4 100644 --- a/src/menu.h +++ b/src/menu.h @@ -276,7 +276,7 @@ extern s8 D_800DF4DC; extern s8 D_800DF4E0; extern s8 D_800DF4E4[4]; extern s32 D_800DF4E8; -extern s8 D_800DF4EC; +extern s8 gDialogOptionTangible; // Unused? extern s32 D_800DF4F0[]; @@ -763,8 +763,8 @@ void func_8009CA58(void); void func_8009CF68(s32 arg0); void func_8009CFB0(void); s32 func_8009CFEC(u32 arg0); -void func_8009D118(s32 arg0); -void func_8009D1B8(s32 arg0, s32 arg1, s32 arg2); +void set_option_text_colour(s32 condition); +void render_dialogue_option(char *text, s32 yOffset, s32 optionID); void func_8009D26C(void); void func_8009D324(void); void func_8009D330(s32 arg0); @@ -774,7 +774,7 @@ s32 func_8009D9F4(void); s32 trophy_race_cabinet_menu_loop(void); void func_8009E9A0(void); void func_8009E9A8(void); -f32 func_8009E9B0(unk8012A7E8 *arg0, Gfx **arg1, s32 *arg2, s32 *arg3); +f32 func_8009E9B0(DialogueBoxBackground *arg0, Gfx **arg1, s32 *arg2, s32 *arg3); s64 *func_8009EA6C(void); s32 func_8009EA78(s64 arg0); s32 func_8009EABC(s64 arg0); From e99577f1795d7998134c7165e5043b4d8354b584 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Wed, 1 Dec 2021 20:54:57 +0000 Subject: [PATCH 13/18] Even more --- asm/non_matchings/game_text/func_800C2B00.s | 12 +- asm/non_matchings/game_text/func_800C3564.s | 6 +- asm/non_matchings/game_text/func_800C38B4.s | 4 +- asm/non_matchings/menu/func_80084854.s | 6 +- asm/non_matchings/menu/func_800871D8.s | 8 +- asm/non_matchings/menu/func_80088938.s | 34 ++--- asm/non_matchings/menu/func_80092E94.s | 4 +- asm/non_matchings/menu/func_80093D40.s | 22 +-- asm/non_matchings/menu/func_80094D28.s | 18 +-- asm/non_matchings/menu/func_80095728.s | 2 +- asm/non_matchings/menu/func_80096978.s | 20 +-- asm/non_matchings/menu/func_80099E8C.s | 14 +- asm/non_matchings/menu/menu_results_loop.s | 2 +- .../menu/menu_trophy_race_rankings_loop.s | 2 +- .../menu/render_magic_codes_ui.s | 6 +- .../menu/render_track_select_setup_ui.s | 6 +- asm/non_matchings/menu/tt_menu_loop.s | 4 +- .../unknown_032760/func_80042A90.s | 10 +- include/structs.h | 28 ++-- src/font.c | 144 +++++++++--------- src/font.h | 21 ++- src/game_text.c | 4 +- src/menu.c | 46 +++--- src/unknown_06B2B0.c | 2 +- 24 files changed, 217 insertions(+), 208 deletions(-) diff --git a/asm/non_matchings/game_text/func_800C2B00.s b/asm/non_matchings/game_text/func_800C2B00.s index 9403338c..6f36c50a 100644 --- a/asm/non_matchings/game_text/func_800C2B00.s +++ b/asm/non_matchings/game_text/func_800C2B00.s @@ -25,7 +25,7 @@ glabel func_800C2B00 /* 0C375C 800C2B5C 86A50000 */ lh $a1, ($s5) /* 0C3760 800C2B60 86C70000 */ lh $a3, ($s6) /* 0C3764 800C2B64 24040006 */ li $a0, 6 -/* 0C3768 800C2B68 0C0313B7 */ jal set_dialogue_box_coords +/* 0C3768 800C2B68 0C0313B7 */ jal set_current_dialogue_box_coords /* 0C376C 800C2B6C AFAE0010 */ sw $t6, 0x10($sp) /* 0C3770 800C2B70 3C178013 */ lui $s7, %hi(D_8012A7A8) # $s7, 0x8013 /* 0C3774 800C2B74 26F7A7A8 */ addiu $s7, %lo(D_8012A7A8) # addiu $s7, $s7, -0x5858 @@ -38,13 +38,13 @@ glabel func_800C2B00 /* 0C3790 800C2B90 AFB90010 */ sw $t9, 0x10($sp) /* 0C3794 800C2B94 24050040 */ li $a1, 64 /* 0C3798 800C2B98 24060060 */ li $a2, 96 -/* 0C379C 800C2B9C 0C0313EF */ jal func_800C4FBC +/* 0C379C 800C2B9C 0C0313EF */ jal set_current_dialogue_background_colour /* 0C37A0 800C2BA0 24070060 */ li $a3, 96 /* 0C37A4 800C2BA4 24040006 */ li $a0, 6 /* 0C37A8 800C2BA8 00002825 */ move $a1, $zero /* 0C37AC 800C2BAC 00003025 */ move $a2, $zero /* 0C37B0 800C2BB0 00003825 */ move $a3, $zero -/* 0C37B4 800C2BB4 0C031414 */ jal func_800C5050 +/* 0C37B4 800C2BB4 0C031414 */ jal set_current_text_background_colour /* 0C37B8 800C2BB8 AFA00010 */ sw $zero, 0x10($sp) /* 0C37BC 800C2BBC 3C1E8013 */ lui $fp, %hi(D_8012A7B8) # $fp, 0x8013 /* 0C37C0 800C2BC0 27DEA7B8 */ addiu $fp, %lo(D_8012A7B8) # addiu $fp, $fp, -0x5848 @@ -105,7 +105,7 @@ glabel func_800C2B00 /* 0C3890 800C2C90 018D0019 */ multu $t4, $t5 /* 0C3894 800C2C94 00007012 */ mflo $t6 /* 0C3898 800C2C98 000E7A03 */ sra $t7, $t6, 8 -/* 0C389C 800C2C9C 0C031400 */ jal set_text_colour +/* 0C389C 800C2C9C 0C031400 */ jal set_current_text_colour /* 0C38A0 800C2CA0 AFAF0014 */ sw $t7, 0x14($sp) /* 0C38A4 800C2CA4 8E470000 */ lw $a3, ($s2) /* 0C38A8 800C2CA8 24180001 */ li $t8, 1 @@ -126,7 +126,7 @@ glabel func_800C2B00 /* 0C38E4 800C2CE4 24040006 */ li $a0, 6 /* 0C38E8 800C2CE8 00002825 */ move $a1, $zero /* 0C38EC 800C2CEC 00003025 */ move $a2, $zero -/* 0C38F0 800C2CF0 0C031400 */ jal set_text_colour +/* 0C38F0 800C2CF0 0C031400 */ jal set_current_text_colour /* 0C38F4 800C2CF4 00003825 */ move $a3, $zero /* 0C38F8 800C2CF8 8E470000 */ lw $a3, ($s2) /* 0C38FC 800C2CFC 240B0001 */ li $t3, 1 @@ -144,7 +144,7 @@ glabel func_800C2B00 /* 0C392C 800C2D2C 1420FFB6 */ bnez $at, .L800C2C08 /* 0C3930 800C2D30 2673000E */ addiu $s3, $s3, 0xe .L800C2D34: -/* 0C3934 800C2D34 0C03157D */ jal func_800C55F4 +/* 0C3934 800C2D34 0C03157D */ jal open_dialogue_box /* 0C3938 800C2D38 24040006 */ li $a0, 6 /* 0C393C 800C2D3C 8FBF0044 */ lw $ra, 0x44($sp) /* 0C3940 800C2D40 8FB00020 */ lw $s0, 0x20($sp) diff --git a/asm/non_matchings/game_text/func_800C3564.s b/asm/non_matchings/game_text/func_800C3564.s index 0b1bdd74..d3d85b6b 100644 --- a/asm/non_matchings/game_text/func_800C3564.s +++ b/asm/non_matchings/game_text/func_800C3564.s @@ -31,7 +31,7 @@ glabel func_800C3564 /* 0C41D8 800C35D8 24040001 */ li $a0, 1 /* 0C41DC 800C35DC 2405000A */ li $a1, 10 /* 0C41E0 800C35E0 2406000F */ li $a2, 15 -/* 0C41E4 800C35E4 0C0313B7 */ jal set_dialogue_box_coords +/* 0C41E4 800C35E4 0C0313B7 */ jal set_current_dialogue_box_coords /* 0C41E8 800C35E8 240700B4 */ li $a3, 180 /* 0C41EC 800C35EC 8FA50040 */ lw $a1, 0x40($sp) /* 0C41F0 800C35F0 0C0313DF */ jal set_dialogue_font @@ -41,7 +41,7 @@ glabel func_800C3564 /* 0C4200 800C3600 24040001 */ li $a0, 1 /* 0C4204 800C3604 00002825 */ move $a1, $zero /* 0C4208 800C3608 24060010 */ li $a2, 16 -/* 0C420C 800C360C 0C0313EF */ jal func_800C4FBC +/* 0C420C 800C360C 0C0313EF */ jal set_current_dialogue_background_colour /* 0C4210 800C3610 24070010 */ li $a3, 16 /* 0C4214 800C3614 8FAE0060 */ lw $t6, 0x60($sp) /* 0C4218 800C3618 8FA50054 */ lw $a1, 0x54($sp) @@ -50,7 +50,7 @@ glabel func_800C3564 /* 0C4224 800C3624 240F00FF */ li $t7, 255 /* 0C4228 800C3628 AFAF0014 */ sw $t7, 0x14($sp) /* 0C422C 800C362C 24040001 */ li $a0, 1 -/* 0C4230 800C3630 0C031400 */ jal set_text_colour +/* 0C4230 800C3630 0C031400 */ jal set_current_text_colour /* 0C4234 800C3634 AFAE0010 */ sw $t6, 0x10($sp) /* 0C4238 800C3638 3C048013 */ lui $a0, %hi(D_8012A78E) # $a0, 0x8013 /* 0C423C 800C363C 8484A78E */ lh $a0, %lo(D_8012A78E)($a0) diff --git a/asm/non_matchings/game_text/func_800C38B4.s b/asm/non_matchings/game_text/func_800C38B4.s index 58ab9ebb..7881865e 100644 --- a/asm/non_matchings/game_text/func_800C38B4.s +++ b/asm/non_matchings/game_text/func_800C38B4.s @@ -96,7 +96,7 @@ glabel L800C3984 /* 0C4604 800C3A04 26310005 */ addiu $s1, $s1, 5 /* 0C4608 800C3A08 01E2C021 */ addu $t8, $t7, $v0 /* 0C460C 800C3A0C AE580010 */ sw $t8, 0x10($s2) -/* 0C4610 800C3A10 0C0313B7 */ jal set_dialogue_box_coords +/* 0C4610 800C3A10 0C0313B7 */ jal set_current_dialogue_box_coords /* 0C4614 800C3A14 AFB80010 */ sw $t8, 0x10($sp) /* 0C4618 800C3A18 8E680000 */ lw $t0, ($s3) /* 0C461C 800C3A1C 00000000 */ nop @@ -127,7 +127,7 @@ glabel L800C3A30 /* 0C467C 800C3A7C 26310005 */ addiu $s1, $s1, 5 /* 0C4680 800C3A80 AE480020 */ sw $t0, 0x20($s2) /* 0C4684 800C3A84 AFAA0014 */ sw $t2, 0x14($sp) -/* 0C4688 800C3A88 0C031400 */ jal set_text_colour +/* 0C4688 800C3A88 0C031400 */ jal set_current_text_colour /* 0C468C 800C3A8C AFA80010 */ sw $t0, 0x10($sp) /* 0C4690 800C3A90 8E6B0000 */ lw $t3, ($s3) /* 0C4694 800C3A94 00000000 */ nop diff --git a/asm/non_matchings/menu/func_80084854.s b/asm/non_matchings/menu/func_80084854.s index f6cab963..21de0848 100644 --- a/asm/non_matchings/menu/func_80084854.s +++ b/asm/non_matchings/menu/func_80084854.s @@ -132,14 +132,14 @@ glabel func_80084854 /* 085640 80084A40 24040007 */ li $a0, 7 /* 085644 80084A44 00002825 */ move $a1, $zero /* 085648 80084A48 00003025 */ move $a2, $zero -/* 08564C 80084A4C 0C0313EF */ jal func_800C4FBC +/* 08564C 80084A4C 0C0313EF */ jal set_current_dialogue_background_colour /* 085650 80084A50 00003825 */ move $a3, $zero /* 085654 80084A54 240B007B */ li $t3, 123 /* 085658 80084A58 AFAB0010 */ sw $t3, 0x10($sp) /* 08565C 80084A5C 24040007 */ li $a0, 7 /* 085660 80084A60 2405005E */ li $a1, 94 /* 085664 80084A64 24060075 */ li $a2, 117 -/* 085668 80084A68 0C0313B7 */ jal set_dialogue_box_coords +/* 085668 80084A68 0C0313B7 */ jal set_current_dialogue_box_coords /* 08566C 80084A6C 240700E2 */ li $a3, 226 /* 085670 80084A70 02402025 */ move $a0, $s2 /* 085674 80084A74 00002825 */ move $a1, $zero @@ -151,7 +151,7 @@ glabel func_80084854 /* 08568C 80084A8C 24040007 */ li $a0, 7 /* 085690 80084A90 2405005E */ li $a1, 94 /* 085694 80084A94 2406009D */ li $a2, 157 -/* 085698 80084A98 0C0313B7 */ jal set_dialogue_box_coords +/* 085698 80084A98 0C0313B7 */ jal set_current_dialogue_box_coords /* 08569C 80084A9C 240700E2 */ li $a3, 226 /* 0856A0 80084AA0 02402025 */ move $a0, $s2 /* 0856A4 80084AA4 00002825 */ move $a1, $zero diff --git a/asm/non_matchings/menu/func_800871D8.s b/asm/non_matchings/menu/func_800871D8.s index ab066e27..3f30b2d7 100644 --- a/asm/non_matchings/menu/func_800871D8.s +++ b/asm/non_matchings/menu/func_800871D8.s @@ -71,20 +71,20 @@ glabel func_800871D8 /* 087EDC 800872DC 01001025 */ move $v0, $t0 /* 087EE0 800872E0 24040007 */ li $a0, 7 /* 087EE4 800872E4 24050028 */ li $a1, 40 -/* 087EE8 800872E8 0C0313B7 */ jal set_dialogue_box_coords +/* 087EE8 800872E8 0C0313B7 */ jal set_current_dialogue_box_coords /* 087EEC 800872EC 24070118 */ li $a3, 280 /* 087EF0 800872F0 240B00A0 */ li $t3, 160 /* 087EF4 800872F4 AFAB0010 */ sw $t3, 0x10($sp) /* 087EF8 800872F8 24040007 */ li $a0, 7 /* 087EFC 800872FC 00002825 */ move $a1, $zero /* 087F00 80087300 00003025 */ move $a2, $zero -/* 087F04 80087304 0C0313EF */ jal func_800C4FBC +/* 087F04 80087304 0C0313EF */ jal set_current_dialogue_background_colour /* 087F08 80087308 00003825 */ move $a3, $zero /* 087F0C 8008730C 24040007 */ li $a0, 7 /* 087F10 80087310 00002825 */ move $a1, $zero /* 087F14 80087314 00003025 */ move $a2, $zero /* 087F18 80087318 00003825 */ move $a3, $zero -/* 087F1C 8008731C 0C031414 */ jal func_800C5050 +/* 087F1C 8008731C 0C031414 */ jal set_current_text_background_colour /* 087F20 80087320 AFA00010 */ sw $zero, 0x10($sp) /* 087F24 80087324 24040007 */ li $a0, 7 /* 087F28 80087328 0C0313DF */ jal set_dialogue_font @@ -95,7 +95,7 @@ glabel func_800871D8 /* 087F3C 8008733C 240500FF */ li $a1, 255 /* 087F40 80087340 240600FF */ li $a2, 255 /* 087F44 80087344 240700FF */ li $a3, 255 -/* 087F48 80087348 0C031400 */ jal set_text_colour +/* 087F48 80087348 0C031400 */ jal set_current_text_colour /* 087F4C 8008734C AFA00010 */ sw $zero, 0x10($sp) /* 087F50 80087350 3C02800E */ lui $v0, %hi(gMenuText) # $v0, 0x800e /* 087F54 80087354 8C42F4A0 */ lw $v0, %lo(gMenuText)($v0) diff --git a/asm/non_matchings/menu/func_80088938.s b/asm/non_matchings/menu/func_80088938.s index 39c6dbc6..16681f23 100644 --- a/asm/non_matchings/menu/func_80088938.s +++ b/asm/non_matchings/menu/func_80088938.s @@ -84,7 +84,7 @@ glabel func_80088938 /* 089678 80088A78 24040006 */ li $a0, 6 /* 08967C 80088A7C 2405003A */ li $a1, 58 /* 089680 80088A80 02A03025 */ move $a2, $s5 -/* 089684 80088A84 0C0313B7 */ jal set_dialogue_box_coords +/* 089684 80088A84 0C0313B7 */ jal set_current_dialogue_box_coords /* 089688 80088A88 24070106 */ li $a3, 262 /* 08968C 80088A8C 3C0F800E */ lui $t7, %hi(D_800DF460) # $t7, 0x800e /* 089690 80088A90 8DEFF460 */ lw $t7, %lo(D_800DF460)($t7) @@ -96,7 +96,7 @@ glabel func_80088938 /* 0896A8 80088AA8 24040006 */ li $a0, 6 /* 0896AC 80088AAC 240500FF */ li $a1, 255 /* 0896B0 80088AB0 240600FF */ li $a2, 255 -/* 0896B4 80088AB4 0C0313EF */ jal func_800C4FBC +/* 0896B4 80088AB4 0C0313EF */ jal set_current_dialogue_background_colour /* 0896B8 80088AB8 240700FF */ li $a3, 255 /* 0896BC 80088ABC 10000009 */ b .L80088AE4 /* 0896C0 80088AC0 24040006 */ li $a0, 6 @@ -106,7 +106,7 @@ glabel func_80088938 /* 0896CC 80088ACC 24040006 */ li $a0, 6 /* 0896D0 80088AD0 24050060 */ li $a1, 96 /* 0896D4 80088AD4 240600C0 */ li $a2, 192 -/* 0896D8 80088AD8 0C0313EF */ jal func_800C4FBC +/* 0896D8 80088AD8 0C0313EF */ jal set_current_dialogue_background_colour /* 0896DC 80088ADC 2407005C */ li $a3, 92 /* 0896E0 80088AE0 24040006 */ li $a0, 6 .L80088AE4: @@ -118,13 +118,13 @@ glabel func_80088938 /* 0896F8 80088AF8 240500FF */ li $a1, 255 /* 0896FC 80088AFC 240600FF */ li $a2, 255 /* 089700 80088B00 240700FF */ li $a3, 255 -/* 089704 80088B04 0C031400 */ jal set_text_colour +/* 089704 80088B04 0C031400 */ jal set_current_text_colour /* 089708 80088B08 AFA00010 */ sw $zero, 0x10($sp) /* 08970C 80088B0C 24040006 */ li $a0, 6 /* 089710 80088B10 00002825 */ move $a1, $zero /* 089714 80088B14 00003025 */ move $a2, $zero /* 089718 80088B18 00003825 */ move $a3, $zero -/* 08971C 80088B1C 0C031414 */ jal func_800C5050 +/* 08971C 80088B1C 0C031414 */ jal set_current_text_background_colour /* 089720 80088B20 AFA00010 */ sw $zero, 0x10($sp) /* 089724 80088B24 3C0B8012 */ lui $t3, %hi(D_80126A68) # $t3, 0x8012 /* 089728 80088B28 8D6B6A68 */ lw $t3, %lo(D_80126A68)($t3) @@ -165,7 +165,7 @@ glabel func_80088938 /* 0897B4 80088BB4 00002825 */ move $a1, $zero /* 0897B8 80088BB8 00003025 */ move $a2, $zero /* 0897BC 80088BBC 00003825 */ move $a3, $zero -/* 0897C0 80088BC0 0C031414 */ jal func_800C5050 +/* 0897C0 80088BC0 0C031414 */ jal set_current_text_background_colour /* 0897C4 80088BC4 AFA00010 */ sw $zero, 0x10($sp) /* 0897C8 80088BC8 3C028012 */ lui $v0, %hi(D_80126BB4) # $v0, 0x8012 /* 0897CC 80088BCC 8C426BB4 */ lw $v0, %lo(D_80126BB4)($v0) @@ -180,7 +180,7 @@ glabel func_80088938 /* 0897EC 80088BEC 24040006 */ li $a0, 6 /* 0897F0 80088BF0 2405001C */ li $a1, 28 /* 0897F4 80088BF4 02A03025 */ move $a2, $s5 -/* 0897F8 80088BF8 0C0313B7 */ jal set_dialogue_box_coords +/* 0897F8 80088BF8 0C0313B7 */ jal set_current_dialogue_box_coords /* 0897FC 80088BFC 24070124 */ li $a3, 292 /* 089800 80088C00 0621001A */ bgez $s1, .L80088C6C /* 089804 80088C04 3C0E800F */ lui $t6, %hi(D_800E820C) # $t6, 0x800f @@ -190,7 +190,7 @@ glabel func_80088938 /* 089814 80088C14 240500E0 */ li $a1, 224 /* 089818 80088C18 24060030 */ li $a2, 48 /* 08981C 80088C1C 24070030 */ li $a3, 48 -/* 089820 80088C20 0C0313EF */ jal func_800C4FBC +/* 089820 80088C20 0C0313EF */ jal set_current_dialogue_background_colour /* 089824 80088C24 24130001 */ li $s3, 1 /* 089828 80088C28 240A00FF */ li $t2, 255 /* 08982C 80088C2C 240C00FF */ li $t4, 255 @@ -199,7 +199,7 @@ glabel func_80088938 /* 089838 80088C38 24040006 */ li $a0, 6 /* 08983C 80088C3C 240500E0 */ li $a1, 224 /* 089840 80088C40 240600E0 */ li $a2, 224 -/* 089844 80088C44 0C031400 */ jal set_text_colour +/* 089844 80088C44 0C031400 */ jal set_current_text_colour /* 089848 80088C48 24070030 */ li $a3, 48 /* 08984C 80088C4C 8EE20000 */ lw $v0, ($s7) /* 089850 80088C50 3C0D8012 */ lui $t5, %hi(D_801263D8) # $t5, 0x8012 @@ -224,7 +224,7 @@ glabel func_80088938 /* 089898 80088C98 24040006 */ li $a0, 6 /* 08989C 80088C9C 240500FF */ li $a1, 255 /* 0898A0 80088CA0 240600FF */ li $a2, 255 -/* 0898A4 80088CA4 0C0313EF */ jal func_800C4FBC +/* 0898A4 80088CA4 0C0313EF */ jal set_current_dialogue_background_colour /* 0898A8 80088CA8 240700FF */ li $a3, 255 /* 0898AC 80088CAC 10000009 */ b .L80088CD4 /* 0898B0 80088CB0 240A00FF */ li $t2, 255 @@ -234,7 +234,7 @@ glabel func_80088938 /* 0898BC 80088CBC 24040006 */ li $a0, 6 /* 0898C0 80088CC0 240500E0 */ li $a1, 224 /* 0898C4 80088CC4 240600E0 */ li $a2, 224 -/* 0898C8 80088CC8 0C0313EF */ jal func_800C4FBC +/* 0898C8 80088CC8 0C0313EF */ jal set_current_dialogue_background_colour /* 0898CC 80088CCC 24070030 */ li $a3, 48 /* 0898D0 80088CD0 240A00FF */ li $t2, 255 .L80088CD4: @@ -244,7 +244,7 @@ glabel func_80088938 /* 0898E0 80088CE0 24040006 */ li $a0, 6 /* 0898E4 80088CE4 24050010 */ li $a1, 16 /* 0898E8 80088CE8 24060010 */ li $a2, 16 -/* 0898EC 80088CEC 0C031400 */ jal set_text_colour +/* 0898EC 80088CEC 0C031400 */ jal set_current_text_colour /* 0898F0 80088CF0 240700A0 */ li $a3, 160 /* 0898F4 80088CF4 3C0D8012 */ lui $t5, %hi(D_801263D8) # $t5, 0x8012 /* 0898F8 80088CF8 8DAD63D8 */ lw $t5, %lo(D_801263D8)($t5) @@ -387,14 +387,14 @@ glabel func_80088938 /* 089B00 80088F00 24040006 */ li $a0, 6 /* 089B04 80088F04 2405004C */ li $a1, 76 /* 089B08 80088F08 26A6FFE4 */ addiu $a2, $s5, -0x1c -/* 089B0C 80088F0C 0C0313B7 */ jal set_dialogue_box_coords +/* 089B0C 80088F0C 0C0313B7 */ jal set_current_dialogue_box_coords /* 089B10 80088F10 240700F4 */ li $a3, 244 /* 089B14 80088F14 241800A0 */ li $t8, 160 /* 089B18 80088F18 AFB80010 */ sw $t8, 0x10($sp) /* 089B1C 80088F1C 24040006 */ li $a0, 6 /* 089B20 80088F20 00002825 */ move $a1, $zero /* 089B24 80088F24 00003025 */ move $a2, $zero -/* 089B28 80088F28 0C0313EF */ jal func_800C4FBC +/* 089B28 80088F28 0C0313EF */ jal set_current_dialogue_background_colour /* 089B2C 80088F2C 00003825 */ move $a3, $zero /* 089B30 80088F30 24150004 */ li $s5, 4 /* 089B34 80088F34 00008825 */ move $s1, $zero @@ -409,7 +409,7 @@ glabel func_80088938 /* 089B54 80088F54 AFAF0010 */ sw $t7, 0x10($sp) /* 089B58 80088F58 240500FF */ li $a1, 255 /* 089B5C 80088F5C 00003025 */ move $a2, $zero -/* 089B60 80088F60 0C031400 */ jal set_text_colour +/* 089B60 80088F60 0C031400 */ jal set_current_text_colour /* 089B64 80088F64 240700FF */ li $a3, 255 /* 089B68 80088F68 10000016 */ b .L80088FC4 /* 089B6C 80088F6C 8EEA0000 */ lw $t2, ($s7) @@ -424,7 +424,7 @@ glabel func_80088938 /* 089B8C 80088F8C 240500FF */ li $a1, 255 /* 089B90 80088F90 240600FF */ li $a2, 255 /* 089B94 80088F94 240700FF */ li $a3, 255 -/* 089B98 80088F98 0C031400 */ jal set_text_colour +/* 089B98 80088F98 0C031400 */ jal set_current_text_colour /* 089B9C 80088F9C AFB60010 */ sw $s6, 0x10($sp) /* 089BA0 80088FA0 10000008 */ b .L80088FC4 /* 089BA4 80088FA4 8EEA0000 */ lw $t2, ($s7) @@ -433,7 +433,7 @@ glabel func_80088938 /* 089BAC 80088FAC AFAB0014 */ sw $t3, 0x14($sp) /* 089BB0 80088FB0 240600FF */ li $a2, 255 /* 089BB4 80088FB4 240700FF */ li $a3, 255 -/* 089BB8 80088FB8 0C031400 */ jal set_text_colour +/* 089BB8 80088FB8 0C031400 */ jal set_current_text_colour /* 089BBC 80088FBC AFA00010 */ sw $zero, 0x10($sp) /* 089BC0 80088FC0 8EEA0000 */ lw $t2, ($s7) .L80088FC4: diff --git a/asm/non_matchings/menu/func_80092E94.s b/asm/non_matchings/menu/func_80092E94.s index c07d082d..6d028fff 100644 --- a/asm/non_matchings/menu/func_80092E94.s +++ b/asm/non_matchings/menu/func_80092E94.s @@ -259,7 +259,7 @@ glabel func_80092E94 /* 093E88 80093288 240F00FF */ li $t7, 255 /* 093E8C 8009328C AFAF0010 */ sw $t7, 0x10($sp) /* 093E90 80093290 240500FF */ li $a1, 255 -/* 093E94 80093294 0C0313EF */ jal func_800C4FBC +/* 093E94 80093294 0C0313EF */ jal set_current_dialogue_background_colour /* 093E98 80093298 00003825 */ move $a3, $zero /* 093E9C 8009329C 8FA20060 */ lw $v0, 0x60($sp) /* 093EA0 800932A0 24040007 */ li $a0, 7 @@ -267,7 +267,7 @@ glabel func_80092E94 /* 093EA8 800932A8 AFAB0010 */ sw $t3, 0x10($sp) /* 093EAC 800932AC 24050086 */ li $a1, 134 /* 093EB0 800932B0 240700BA */ li $a3, 186 -/* 093EB4 800932B4 0C0313B7 */ jal set_dialogue_box_coords +/* 093EB4 800932B4 0C0313B7 */ jal set_current_dialogue_box_coords /* 093EB8 800932B8 24460070 */ addiu $a2, $v0, 0x70 /* 093EBC 800932BC 02402025 */ move $a0, $s2 /* 093EC0 800932C0 00002825 */ move $a1, $zero diff --git a/asm/non_matchings/menu/func_80093D40.s b/asm/non_matchings/menu/func_80093D40.s index 9336a300..8541b37c 100644 --- a/asm/non_matchings/menu/func_80093D40.s +++ b/asm/non_matchings/menu/func_80093D40.s @@ -58,7 +58,7 @@ glabel func_80093D40 /* 094A0C 80093E0C 244700A0 */ addiu $a3, $v0, 0xa0 /* 094A10 80093E10 AFB80010 */ sw $t8, 0x10($sp) /* 094A14 80093E14 02503023 */ subu $a2, $s2, $s0 -/* 094A18 80093E18 0C0313B7 */ jal set_dialogue_box_coords +/* 094A18 80093E18 0C0313B7 */ jal set_current_dialogue_box_coords /* 094A1C 80093E1C 24040007 */ li $a0, 7 /* 094A20 80093E20 3C11800E */ lui $s1, %hi(D_800E098C) # $s1, 0x800e /* 094A24 80093E24 2631098C */ addiu $s1, %lo(D_800E098C) # addiu $s1, $s1, 0x98c @@ -74,7 +74,7 @@ glabel func_80093D40 /* 094A4C 80093E4C 90660001 */ lbu $a2, 1($v1) /* 094A50 80093E50 90670002 */ lbu $a3, 2($v1) /* 094A54 80093E54 24040007 */ li $a0, 7 -/* 094A58 80093E58 0C0313EF */ jal func_800C4FBC +/* 094A58 80093E58 0C0313EF */ jal set_current_dialogue_background_colour /* 094A5C 80093E5C AFAA0010 */ sw $t2, 0x10($sp) /* 094A60 80093E60 24040007 */ li $a0, 7 /* 094A64 80093E64 0C0313DF */ jal set_dialogue_font @@ -83,7 +83,7 @@ glabel func_80093D40 /* 094A70 80093E70 24050080 */ li $a1, 128 /* 094A74 80093E74 24060080 */ li $a2, 128 /* 094A78 80093E78 240700FF */ li $a3, 255 -/* 094A7C 80093E7C 0C031414 */ jal func_800C5050 +/* 094A7C 80093E7C 0C031414 */ jal set_current_text_background_colour /* 094A80 80093E80 AFA00010 */ sw $zero, 0x10($sp) /* 094A84 80093E84 8E240000 */ lw $a0, ($s1) /* 094A88 80093E88 0C01A93E */ jal func_8006A4F8 @@ -99,7 +99,7 @@ glabel func_80093D40 /* 094AB0 80093EB0 240E00FF */ li $t6, 255 /* 094AB4 80093EB4 AFAE0014 */ sw $t6, 0x14($sp) /* 094AB8 80093EB8 24040007 */ li $a0, 7 -/* 094ABC 80093EBC 0C031400 */ jal set_text_colour +/* 094ABC 80093EBC 0C031400 */ jal set_current_text_colour /* 094AC0 80093EC0 AFAD0010 */ sw $t5, 0x10($sp) /* 094AC4 80093EC4 3C148012 */ lui $s4, %hi(D_801263BC) # $s4, 0x8012 /* 094AC8 80093EC8 8E9463BC */ lw $s4, %lo(D_801263BC)($s4) @@ -157,7 +157,7 @@ glabel func_80093D40 /* 094B8C 80093F8C 240500FF */ li $a1, 255 /* 094B90 80093F90 240600FF */ li $a2, 255 /* 094B94 80093F94 240700FF */ li $a3, 255 -/* 094B98 80093F98 0C031400 */ jal set_text_colour +/* 094B98 80093F98 0C031400 */ jal set_current_text_colour /* 094B9C 80093F9C AFB40010 */ sw $s4, 0x10($sp) /* 094BA0 80093FA0 10000008 */ b .L80093FC4 /* 094BA4 80093FA4 00000000 */ nop @@ -167,7 +167,7 @@ glabel func_80093D40 /* 094BB0 80093FB0 240500FF */ li $a1, 255 /* 094BB4 80093FB4 240600FF */ li $a2, 255 /* 094BB8 80093FB8 240700FF */ li $a3, 255 -/* 094BBC 80093FBC 0C031400 */ jal set_text_colour +/* 094BBC 80093FBC 0C031400 */ jal set_current_text_colour /* 094BC0 80093FC0 AFA00010 */ sw $zero, 0x10($sp) .L80093FC4: /* 094BC4 80093FC4 3C0A800E */ lui $t2, %hi(gMenuText) # $t2, 0x800e @@ -191,7 +191,7 @@ glabel func_80093D40 /* 094C0C 8009400C 240500FF */ li $a1, 255 /* 094C10 80094010 240600FF */ li $a2, 255 /* 094C14 80094014 240700FF */ li $a3, 255 -/* 094C18 80094018 0C031400 */ jal set_text_colour +/* 094C18 80094018 0C031400 */ jal set_current_text_colour /* 094C1C 8009401C AFB40010 */ sw $s4, 0x10($sp) /* 094C20 80094020 10000008 */ b .L80094044 /* 094C24 80094024 00000000 */ nop @@ -201,7 +201,7 @@ glabel func_80093D40 /* 094C30 80094030 240500FF */ li $a1, 255 /* 094C34 80094034 240600FF */ li $a2, 255 /* 094C38 80094038 240700FF */ li $a3, 255 -/* 094C3C 8009403C 0C031400 */ jal set_text_colour +/* 094C3C 8009403C 0C031400 */ jal set_current_text_colour /* 094C40 80094040 AFA00010 */ sw $zero, 0x10($sp) .L80094044: /* 094C44 80094044 3C18800E */ lui $t8, %hi(gMenuText) # $t8, 0x800e @@ -246,7 +246,7 @@ glabel func_80093D40 /* 094CD8 800940D8 240500FF */ li $a1, 255 /* 094CDC 800940DC 240600FF */ li $a2, 255 /* 094CE0 800940E0 240700FF */ li $a3, 255 -/* 094CE4 800940E4 0C031400 */ jal set_text_colour +/* 094CE4 800940E4 0C031400 */ jal set_current_text_colour /* 094CE8 800940E8 AFB40010 */ sw $s4, 0x10($sp) /* 094CEC 800940EC 10000008 */ b .L80094110 /* 094CF0 800940F0 8E070000 */ lw $a3, ($s0) @@ -255,7 +255,7 @@ glabel func_80093D40 /* 094CF8 800940F8 AFB90014 */ sw $t9, 0x14($sp) /* 094CFC 800940FC 240600FF */ li $a2, 255 /* 094D00 80094100 240700FF */ li $a3, 255 -/* 094D04 80094104 0C031400 */ jal set_text_colour +/* 094D04 80094104 0C031400 */ jal set_current_text_colour /* 094D08 80094108 AFA00010 */ sw $zero, 0x10($sp) /* 094D0C 8009410C 8E070000 */ lw $a3, ($s0) .L80094110: @@ -274,7 +274,7 @@ glabel func_80093D40 /* 094D40 80094140 1420FFDD */ bnez $at, .L800940B8 /* 094D44 80094144 26520010 */ addiu $s2, $s2, 0x10 .L80094148: -/* 094D48 80094148 0C03157D */ jal func_800C55F4 +/* 094D48 80094148 0C03157D */ jal open_dialogue_box /* 094D4C 8009414C 24040007 */ li $a0, 7 /* 094D50 80094150 8FBF0034 */ lw $ra, 0x34($sp) /* 094D54 80094154 8FB00020 */ lw $s0, 0x20($sp) diff --git a/asm/non_matchings/menu/func_80094D28.s b/asm/non_matchings/menu/func_80094D28.s index 9e121a84..867fb7ff 100644 --- a/asm/non_matchings/menu/func_80094D28.s +++ b/asm/non_matchings/menu/func_80094D28.s @@ -343,7 +343,7 @@ glabel L800951CC /* 095DEC 800951EC 00002825 */ move $a1, $zero /* 095DF0 800951F0 00003025 */ move $a2, $zero /* 095DF4 800951F4 00003825 */ move $a3, $zero -/* 095DF8 800951F8 0C031414 */ jal func_800C5050 +/* 095DF8 800951F8 0C031414 */ jal set_current_text_background_colour /* 095DFC 800951FC AFA00010 */ sw $zero, 0x10($sp) /* 095E00 80095200 3C118012 */ lui $s1, %hi(D_80126A98) # $s1, 0x8012 /* 095E04 80095204 26316A98 */ addiu $s1, %lo(D_80126A98) # addiu $s1, $s1, 0x6a98 @@ -398,13 +398,13 @@ glabel L800951CC /* 095EAC 800952AC 01623023 */ subu $a2, $t3, $v0 /* 095EB0 800952B0 25AE0004 */ addiu $t6, $t5, 4 /* 095EB4 800952B4 AFAE0010 */ sw $t6, 0x10($sp) -/* 095EB8 800952B8 0C0313B7 */ jal set_dialogue_box_coords +/* 095EB8 800952B8 0C0313B7 */ jal set_current_dialogue_box_coords /* 095EBC 800952BC 24C6FFFC */ addiu $a2, $a2, -4 /* 095EC0 800952C0 24040007 */ li $a0, 7 /* 095EC4 800952C4 24050040 */ li $a1, 64 /* 095EC8 800952C8 24060040 */ li $a2, 64 /* 095ECC 800952CC 240700FF */ li $a3, 255 -/* 095ED0 800952D0 0C0313EF */ jal func_800C4FBC +/* 095ED0 800952D0 0C0313EF */ jal set_current_dialogue_background_colour /* 095ED4 800952D4 AFA00010 */ sw $zero, 0x10($sp) /* 095ED8 800952D8 240A0040 */ li $t2, 64 /* 095EDC 800952DC 241900FF */ li $t9, 255 @@ -413,7 +413,7 @@ glabel L800951CC /* 095EE8 800952E8 24040007 */ li $a0, 7 /* 095EEC 800952EC 240500FF */ li $a1, 255 /* 095EF0 800952F0 00003025 */ move $a2, $zero -/* 095EF4 800952F4 0C031400 */ jal set_text_colour +/* 095EF4 800952F4 0C031400 */ jal set_current_text_colour /* 095EF8 800952F8 240700FF */ li $a3, 255 /* 095EFC 800952FC 8E380000 */ lw $t8, ($s1) /* 095F00 80095300 3C028012 */ lui $v0, %hi(D_80126C1C) # $v0, 0x8012 @@ -498,7 +498,7 @@ glabel L800951CC /* 09602C 8009542C 24040007 */ li $a0, 7 /* 096030 80095430 240500FF */ li $a1, 255 /* 096034 80095434 240600FF */ li $a2, 255 -/* 096038 80095438 0C031400 */ jal set_text_colour +/* 096038 80095438 0C031400 */ jal set_current_text_colour /* 09603C 8009543C 240700FF */ li $a3, 255 /* 096040 80095440 3C0F800E */ lui $t7, %hi(gMenuText) # $t7, 0x800e /* 096044 80095444 8DEFF4A0 */ lw $t7, %lo(gMenuText)($t7) @@ -522,7 +522,7 @@ glabel L800951CC /* 096088 80095488 240500FF */ li $a1, 255 /* 09608C 8009548C 240600FF */ li $a2, 255 /* 096090 80095490 240700FF */ li $a3, 255 -/* 096094 80095494 0C031400 */ jal set_text_colour +/* 096094 80095494 0C031400 */ jal set_current_text_colour /* 096098 80095498 AFB00010 */ sw $s0, 0x10($sp) /* 09609C 8009549C 3C0A800E */ lui $t2, %hi(gMenuText) # $t2, 0x800e /* 0960A0 800954A0 8D4AF4A0 */ lw $t2, %lo(gMenuText)($t2) @@ -556,7 +556,7 @@ glabel L800951CC /* 096108 80095508 240500FF */ li $a1, 255 /* 09610C 8009550C 240600FF */ li $a2, 255 /* 096110 80095510 240700FF */ li $a3, 255 -/* 096114 80095514 0C031400 */ jal set_text_colour +/* 096114 80095514 0C031400 */ jal set_current_text_colour /* 096118 80095518 AFB30010 */ sw $s3, 0x10($sp) /* 09611C 8009551C 10000008 */ b .L80095540 /* 096120 80095520 8E270000 */ lw $a3, ($s1) @@ -565,7 +565,7 @@ glabel L800951CC /* 096128 80095528 AFAD0014 */ sw $t5, 0x14($sp) /* 09612C 8009552C 240600FF */ li $a2, 255 /* 096130 80095530 240700FF */ li $a3, 255 -/* 096134 80095534 0C031400 */ jal set_text_colour +/* 096134 80095534 0C031400 */ jal set_current_text_colour /* 096138 80095538 AFA00010 */ sw $zero, 0x10($sp) /* 09613C 8009553C 8E270000 */ lw $a3, ($s1) .L80095540: @@ -586,7 +586,7 @@ glabel L800951CC /* 096178 80095578 1420FFDB */ bnez $at, .L800954E8 /* 09617C 8009557C 02599021 */ addu $s2, $s2, $t9 .L80095580: -/* 096180 80095580 0C03157D */ jal func_800C55F4 +/* 096180 80095580 0C03157D */ jal open_dialogue_box /* 096184 80095584 24040007 */ li $a0, 7 .L80095588: glabel L80095588 diff --git a/asm/non_matchings/menu/func_80095728.s b/asm/non_matchings/menu/func_80095728.s index 39c12b21..e6d9fb2e 100644 --- a/asm/non_matchings/menu/func_80095728.s +++ b/asm/non_matchings/menu/func_80095728.s @@ -998,7 +998,7 @@ glabel L800964DC /* 097160 80096560 00002825 */ move $a1, $zero /* 097164 80096564 0C0259E4 */ jal func_80096790 /* 097168 80096568 00000000 */ nop -/* 09716C 8009656C 0C031588 */ jal func_800C5620 +/* 09716C 8009656C 0C031588 */ jal close_dialogue_box /* 097170 80096570 24040007 */ li $a0, 7 /* 097174 80096574 0C031525 */ jal func_800C5494 /* 097178 80096578 24040007 */ li $a0, 7 diff --git a/asm/non_matchings/menu/func_80096978.s b/asm/non_matchings/menu/func_80096978.s index 2e9cf97f..167233af 100644 --- a/asm/non_matchings/menu/func_80096978.s +++ b/asm/non_matchings/menu/func_80096978.s @@ -424,13 +424,13 @@ glabel func_80096978 /* 097BC4 80096FC4 24C600C4 */ addiu $a2, $a2, 0xc4 /* 097BC8 80096FC8 AFB80010 */ sw $t8, 0x10($sp) /* 097BCC 80096FCC 24050050 */ li $a1, 80 -/* 097BD0 80096FD0 0C0313B7 */ jal set_dialogue_box_coords +/* 097BD0 80096FD0 0C0313B7 */ jal set_current_dialogue_box_coords /* 097BD4 80096FD4 240700F0 */ li $a3, 240 /* 097BD8 80096FD8 24040007 */ li $a0, 7 /* 097BDC 80096FDC 24050040 */ li $a1, 64 /* 097BE0 80096FE0 24060040 */ li $a2, 64 /* 097BE4 80096FE4 240700FF */ li $a3, 255 -/* 097BE8 80096FE8 0C0313EF */ jal func_800C4FBC +/* 097BE8 80096FE8 0C0313EF */ jal set_current_dialogue_background_colour /* 097BEC 80096FEC AFA00010 */ sw $zero, 0x10($sp) /* 097BF0 80096FF0 24040007 */ li $a0, 7 /* 097BF4 80096FF4 0C0313DF */ jal set_dialogue_font @@ -439,7 +439,7 @@ glabel func_80096978 /* 097C00 80097000 00002825 */ move $a1, $zero /* 097C04 80097004 00003025 */ move $a2, $zero /* 097C08 80097008 00003825 */ move $a3, $zero -/* 097C0C 8009700C 0C031414 */ jal func_800C5050 +/* 097C0C 8009700C 0C031414 */ jal set_current_text_background_colour /* 097C10 80097010 AFA00010 */ sw $zero, 0x10($sp) /* 097C14 80097014 3C028012 */ lui $v0, %hi(D_801263BC) # $v0, 0x8012 /* 097C18 80097018 8C4263BC */ lw $v0, %lo(D_801263BC)($v0) @@ -481,7 +481,7 @@ glabel func_80096978 /* 097CA4 800970A4 240500FF */ li $a1, 255 /* 097CA8 800970A8 240600FF */ li $a2, 255 /* 097CAC 800970AC 240700FF */ li $a3, 255 -/* 097CB0 800970B0 0C031400 */ jal set_text_colour +/* 097CB0 800970B0 0C031400 */ jal set_current_text_colour /* 097CB4 800970B4 AFB80010 */ sw $t8, 0x10($sp) /* 097CB8 800970B8 10000008 */ b .L800970DC /* 097CBC 800970BC 00000000 */ nop @@ -491,7 +491,7 @@ glabel func_80096978 /* 097CC8 800970C8 240500FF */ li $a1, 255 /* 097CCC 800970CC 240600FF */ li $a2, 255 /* 097CD0 800970D0 240700FF */ li $a3, 255 -/* 097CD4 800970D4 0C031400 */ jal set_text_colour +/* 097CD4 800970D4 0C031400 */ jal set_current_text_colour /* 097CD8 800970D8 AFA00010 */ sw $zero, 0x10($sp) .L800970DC: /* 097CDC 800970DC 3C0A800E */ lui $t2, %hi(gMenuText) # $t2, 0x800e @@ -517,7 +517,7 @@ glabel func_80096978 /* 097D2C 8009712C 240500FF */ li $a1, 255 /* 097D30 80097130 240600FF */ li $a2, 255 /* 097D34 80097134 240700FF */ li $a3, 255 -/* 097D38 80097138 0C031400 */ jal set_text_colour +/* 097D38 80097138 0C031400 */ jal set_current_text_colour /* 097D3C 8009713C AFAC0010 */ sw $t4, 0x10($sp) /* 097D40 80097140 10000008 */ b .L80097164 /* 097D44 80097144 00000000 */ nop @@ -527,7 +527,7 @@ glabel func_80096978 /* 097D50 80097150 240500FF */ li $a1, 255 /* 097D54 80097154 240600FF */ li $a2, 255 /* 097D58 80097158 240700FF */ li $a3, 255 -/* 097D5C 8009715C 0C031400 */ jal set_text_colour +/* 097D5C 8009715C 0C031400 */ jal set_current_text_colour /* 097D60 80097160 AFA00010 */ sw $zero, 0x10($sp) .L80097164: /* 097D64 80097164 3C18800E */ lui $t8, %hi(gMenuText) # $t8, 0x800e @@ -566,7 +566,7 @@ glabel func_80096978 /* 097DE0 800971E0 240600FF */ li $a2, 255 /* 097DE4 800971E4 240700FF */ li $a3, 255 /* 097DE8 800971E8 AFA20010 */ sw $v0, 0x10($sp) -/* 097DEC 800971EC 0C031400 */ jal set_text_colour +/* 097DEC 800971EC 0C031400 */ jal set_current_text_colour /* 097DF0 800971F0 AFA200A0 */ sw $v0, 0xa0($sp) /* 097DF4 800971F4 1000000A */ b .L80097220 /* 097DF8 800971F8 8FA600A8 */ lw $a2, 0xa8($sp) @@ -577,7 +577,7 @@ glabel func_80096978 /* 097E08 80097208 240600FF */ li $a2, 255 /* 097E0C 8009720C 240700FF */ li $a3, 255 /* 097E10 80097210 AFA00010 */ sw $zero, 0x10($sp) -/* 097E14 80097214 0C031400 */ jal set_text_colour +/* 097E14 80097214 0C031400 */ jal set_current_text_colour /* 097E18 80097218 AFA200A0 */ sw $v0, 0xa0($sp) /* 097E1C 8009721C 8FA600A8 */ lw $a2, 0xa8($sp) .L80097220: @@ -598,7 +598,7 @@ glabel func_80096978 /* 097E58 80097258 1420FFD9 */ bnez $at, .L800971C0 /* 097E5C 8009725C AFA900A8 */ sw $t1, 0xa8($sp) .L80097260: -/* 097E60 80097260 0C03157D */ jal func_800C55F4 +/* 097E60 80097260 0C03157D */ jal open_dialogue_box /* 097E64 80097264 24040007 */ li $a0, 7 .L80097268: /* 097E68 80097268 8FBF005C */ lw $ra, 0x5c($sp) diff --git a/asm/non_matchings/menu/func_80099E8C.s b/asm/non_matchings/menu/func_80099E8C.s index 0bbfada1..dbeb25f0 100644 --- a/asm/non_matchings/menu/func_80099E8C.s +++ b/asm/non_matchings/menu/func_80099E8C.s @@ -446,14 +446,14 @@ glabel func_80099E8C /* 09B128 8009A528 24040007 */ li $a0, 7 /* 09B12C 8009A52C 24050068 */ li $a1, 104 /* 09B130 8009A530 24060066 */ li $a2, 102 -/* 09B134 8009A534 0C0313B7 */ jal set_dialogue_box_coords +/* 09B134 8009A534 0C0313B7 */ jal set_current_dialogue_box_coords /* 09B138 8009A538 240700D8 */ li $a3, 216 /* 09B13C 8009A53C 240C00C0 */ li $t4, 192 /* 09B140 8009A540 AFAC0010 */ sw $t4, 0x10($sp) /* 09B144 8009A544 24040007 */ li $a0, 7 /* 09B148 8009A548 00002825 */ move $a1, $zero /* 09B14C 8009A54C 00003025 */ move $a2, $zero -/* 09B150 8009A550 0C0313EF */ jal func_800C4FBC +/* 09B150 8009A550 0C0313EF */ jal set_current_dialogue_background_colour /* 09B154 8009A554 00003825 */ move $a3, $zero /* 09B158 8009A558 24040007 */ li $a0, 7 /* 09B15C 8009A55C 0C0313DF */ jal set_dialogue_font @@ -462,7 +462,7 @@ glabel func_80099E8C /* 09B168 8009A568 00002825 */ move $a1, $zero /* 09B16C 8009A56C 00003025 */ move $a2, $zero /* 09B170 8009A570 00003825 */ move $a3, $zero -/* 09B174 8009A574 0C031414 */ jal func_800C5050 +/* 09B174 8009A574 0C031414 */ jal set_current_text_background_colour /* 09B178 8009A578 AFA00010 */ sw $zero, 0x10($sp) /* 09B17C 8009A57C 8E0D0000 */ lw $t5, ($s0) /* 09B180 8009A580 24010001 */ li $at, 1 @@ -475,7 +475,7 @@ glabel func_80099E8C /* 09B19C 8009A59C 240500FF */ li $a1, 255 /* 09B1A0 8009A5A0 240600FF */ li $a2, 255 /* 09B1A4 8009A5A4 240700FF */ li $a3, 255 -/* 09B1A8 8009A5A8 0C031400 */ jal set_text_colour +/* 09B1A8 8009A5A8 0C031400 */ jal set_current_text_colour /* 09B1AC 8009A5AC AFAF0010 */ sw $t7, 0x10($sp) /* 09B1B0 8009A5B0 10000008 */ b .L8009A5D4 /* 09B1B4 8009A5B4 00000000 */ nop @@ -485,7 +485,7 @@ glabel func_80099E8C /* 09B1C0 8009A5C0 240500FF */ li $a1, 255 /* 09B1C4 8009A5C4 240600FF */ li $a2, 255 /* 09B1C8 8009A5C8 240700FF */ li $a3, 255 -/* 09B1CC 8009A5CC 0C031400 */ jal set_text_colour +/* 09B1CC 8009A5CC 0C031400 */ jal set_current_text_colour /* 09B1D0 8009A5D0 AFA00010 */ sw $zero, 0x10($sp) .L8009A5D4: /* 09B1D4 8009A5D4 3C19800E */ lui $t9, %hi(gMenuText) # $t9, 0x800e @@ -510,7 +510,7 @@ glabel func_80099E8C /* 09B220 8009A620 240500FF */ li $a1, 255 /* 09B224 8009A624 240600FF */ li $a2, 255 /* 09B228 8009A628 240700FF */ li $a3, 255 -/* 09B22C 8009A62C 0C031400 */ jal set_text_colour +/* 09B22C 8009A62C 0C031400 */ jal set_current_text_colour /* 09B230 8009A630 AFAC0010 */ sw $t4, 0x10($sp) /* 09B234 8009A634 10000008 */ b .L8009A658 /* 09B238 8009A638 00000000 */ nop @@ -520,7 +520,7 @@ glabel func_80099E8C /* 09B244 8009A644 240500FF */ li $a1, 255 /* 09B248 8009A648 240600FF */ li $a2, 255 /* 09B24C 8009A64C 240700FF */ li $a3, 255 -/* 09B250 8009A650 0C031400 */ jal set_text_colour +/* 09B250 8009A650 0C031400 */ jal set_current_text_colour /* 09B254 8009A654 AFA00010 */ sw $zero, 0x10($sp) .L8009A658: /* 09B258 8009A658 3C18800E */ lui $t8, %hi(gMenuText) # $t8, 0x800e diff --git a/asm/non_matchings/menu/menu_results_loop.s b/asm/non_matchings/menu/menu_results_loop.s index 7cfd358d..a60b4d45 100644 --- a/asm/non_matchings/menu/menu_results_loop.s +++ b/asm/non_matchings/menu/menu_results_loop.s @@ -246,7 +246,7 @@ glabel menu_results_loop /* 098228 80097628 AD390000 */ sw $t9, ($t1) /* 09822C 8009762C 0C025DB3 */ jal func_800976CC /* 098230 80097630 00000000 */ nop -/* 098234 80097634 0C031588 */ jal func_800C5620 +/* 098234 80097634 0C031588 */ jal close_dialogue_box /* 098238 80097638 24040007 */ li $a0, 7 /* 09823C 8009763C 0C031525 */ jal func_800C5494 /* 098240 80097640 24040007 */ li $a0, 7 diff --git a/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s b/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s index 9115f99a..5e4e8fb6 100644 --- a/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s +++ b/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s @@ -236,7 +236,7 @@ glabel menu_trophy_race_rankings_loop /* 099F38 80099338 ACAE0000 */ sw $t6, ($a1) /* 099F3C 8009933C 0C026580 */ jal func_80099600 /* 099F40 80099340 AFAB002C */ sw $t3, 0x2c($sp) -/* 099F44 80099344 0C031588 */ jal func_800C5620 +/* 099F44 80099344 0C031588 */ jal close_dialogue_box /* 099F48 80099348 24040007 */ li $a0, 7 /* 099F4C 8009934C 0C031525 */ jal func_800C5494 /* 099F50 80099350 24040007 */ li $a0, 7 diff --git a/asm/non_matchings/menu/render_magic_codes_ui.s b/asm/non_matchings/menu/render_magic_codes_ui.s index ff6cd534..05cabce2 100644 --- a/asm/non_matchings/menu/render_magic_codes_ui.s +++ b/asm/non_matchings/menu/render_magic_codes_ui.s @@ -342,14 +342,14 @@ glabel render_magic_codes_ui /* 08A7A0 80089BA0 24040006 */ li $a0, 6 /* 08A7A4 80089BA4 2405004C */ li $a1, 76 /* 08A7A8 80089BA8 2666FFE4 */ addiu $a2, $s3, -0x1c -/* 08A7AC 80089BAC 0C0313B7 */ jal set_dialogue_box_coords +/* 08A7AC 80089BAC 0C0313B7 */ jal set_current_dialogue_box_coords /* 08A7B0 80089BB0 240700F4 */ li $a3, 244 /* 08A7B4 80089BB4 240F00A0 */ li $t7, 160 /* 08A7B8 80089BB8 AFAF0010 */ sw $t7, 0x10($sp) /* 08A7BC 80089BBC 24040006 */ li $a0, 6 /* 08A7C0 80089BC0 00002825 */ move $a1, $zero /* 08A7C4 80089BC4 00003025 */ move $a2, $zero -/* 08A7C8 80089BC8 0C0313EF */ jal func_800C4FBC +/* 08A7C8 80089BC8 0C0313EF */ jal set_current_dialogue_background_colour /* 08A7CC 80089BCC 00003825 */ move $a3, $zero /* 08A7D0 80089BD0 24130004 */ li $s3, 4 /* 08A7D4 80089BD4 00008825 */ move $s1, $zero @@ -374,7 +374,7 @@ glabel render_magic_codes_ui /* 08A810 80089C10 24040006 */ li $a0, 6 /* 08A814 80089C14 240500FF */ li $a1, 255 /* 08A818 80089C18 240700FF */ li $a3, 255 -/* 08A81C 80089C1C 0C031400 */ jal set_text_colour +/* 08A81C 80089C1C 0C031400 */ jal set_current_text_colour /* 08A820 80089C20 AFB00010 */ sw $s0, 0x10($sp) /* 08A824 80089C24 3C09800E */ lui $t1, %hi(gMenuText) # $t1, 0x800e /* 08A828 80089C28 8D29F4A0 */ lw $t1, %lo(gMenuText)($t1) diff --git a/asm/non_matchings/menu/render_track_select_setup_ui.s b/asm/non_matchings/menu/render_track_select_setup_ui.s index 0a01212b..fc218a0a 100644 --- a/asm/non_matchings/menu/render_track_select_setup_ui.s +++ b/asm/non_matchings/menu/render_track_select_setup_ui.s @@ -173,7 +173,7 @@ glabel render_track_select_setup_ui /* 091D9C 8009119C 240500FF */ li $a1, 255 /* 091DA0 800911A0 00003825 */ move $a3, $zero /* 091DA4 800911A4 AFA60084 */ sw $a2, 0x84($sp) -/* 091DA8 800911A8 0C0313EF */ jal func_800C4FBC +/* 091DA8 800911A8 0C0313EF */ jal set_current_dialogue_background_colour /* 091DAC 800911AC AFAF0010 */ sw $t7, 0x10($sp) /* 091DB0 800911B0 3C028012 */ lui $v0, %hi(D_801263E0) # $v0, 0x8012 /* 091DB4 800911B4 8C4263E0 */ lw $v0, %lo(D_801263E0)($v0) @@ -451,7 +451,7 @@ glabel render_track_select_setup_ui /* 0921CC 800915CC 270E0089 */ addiu $t6, $t8, 0x89 /* 0921D0 800915D0 AFAE0010 */ sw $t6, 0x10($sp) /* 0921D4 800915D4 240700BA */ li $a3, 186 -/* 0921D8 800915D8 0C0313B7 */ jal set_dialogue_box_coords +/* 0921D8 800915D8 0C0313B7 */ jal set_current_dialogue_box_coords /* 0921DC 800915DC 27060070 */ addiu $a2, $t8, 0x70 /* 0921E0 800915E0 3C048012 */ lui $a0, %hi(D_801263A0) # $a0, 0x8012 /* 0921E4 800915E4 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 @@ -593,7 +593,7 @@ glabel render_track_select_setup_ui /* 0923E0 800917E0 2466FFFE */ addiu $a2, $v1, -2 /* 0923E4 800917E4 24040007 */ li $a0, 7 /* 0923E8 800917E8 2445FFFE */ addiu $a1, $v0, -2 -/* 0923EC 800917EC 0C0313B7 */ jal set_dialogue_box_coords +/* 0923EC 800917EC 0C0313B7 */ jal set_current_dialogue_box_coords /* 0923F0 800917F0 24470032 */ addiu $a3, $v0, 0x32 /* 0923F4 800917F4 3C048012 */ lui $a0, %hi(D_801263A0) # $a0, 0x8012 /* 0923F8 800917F8 248463A0 */ addiu $a0, %lo(D_801263A0) # addiu $a0, $a0, 0x63a0 diff --git a/asm/non_matchings/menu/tt_menu_loop.s b/asm/non_matchings/menu/tt_menu_loop.s index 9cc0de78..ce00811b 100644 --- a/asm/non_matchings/menu/tt_menu_loop.s +++ b/asm/non_matchings/menu/tt_menu_loop.s @@ -48,7 +48,7 @@ glabel tt_menu_loop /* 09E7CC 8009DBCC 24050018 */ li $a1, 24 /* 09E7D0 8009DBD0 24060010 */ li $a2, 16 /* 09E7D4 8009DBD4 240700C0 */ li $a3, 192 -/* 09E7D8 8009DBD8 0C0313B7 */ jal set_dialogue_box_coords +/* 09E7D8 8009DBD8 0C0313B7 */ jal set_current_dialogue_box_coords /* 09E7DC 8009DBDC AFAC0010 */ sw $t4, 0x10($sp) /* 09E7E0 8009DBE0 10000007 */ b .L8009DC00 /* 09E7E4 8009DBE4 24040001 */ li $a0, 1 @@ -56,7 +56,7 @@ glabel tt_menu_loop /* 09E7E8 8009DBE8 240D00DC */ li $t5, 220 /* 09E7EC 8009DBEC AFAD0010 */ sw $t5, 0x10($sp) /* 09E7F0 8009DBF0 24060010 */ li $a2, 16 -/* 09E7F4 8009DBF4 0C0313B7 */ jal set_dialogue_box_coords +/* 09E7F4 8009DBF4 0C0313B7 */ jal set_current_dialogue_box_coords /* 09E7F8 8009DBF8 240700B8 */ li $a3, 184 /* 09E7FC 8009DBFC 24040001 */ li $a0, 1 .L8009DC00: diff --git a/asm/non_matchings/unknown_032760/func_80042A90.s b/asm/non_matchings/unknown_032760/func_80042A90.s index 5fa7a9b5..c4c88cfd 100644 --- a/asm/non_matchings/unknown_032760/func_80042A90.s +++ b/asm/non_matchings/unknown_032760/func_80042A90.s @@ -91,7 +91,7 @@ glabel func_80042A90 /* 0437E4 80042BE4 8FA6004C */ lw $a2, 0x4c($sp) /* 0437E8 80042BE8 8FA70048 */ lw $a3, 0x48($sp) /* 0437EC 80042BEC 24040004 */ li $a0, 4 -/* 0437F0 80042BF0 0C0313B7 */ jal set_dialogue_box_coords +/* 0437F0 80042BF0 0C0313B7 */ jal set_current_dialogue_box_coords /* 0437F4 80042BF4 AFAA0010 */ sw $t2, 0x10($sp) /* 0437F8 80042BF8 860B0006 */ lh $t3, 6($s0) /* 0437FC 80042BFC 24040004 */ li $a0, 4 @@ -102,13 +102,13 @@ glabel func_80042A90 /* 043810 80042C10 AFAD0010 */ sw $t5, 0x10($sp) /* 043814 80042C14 24050080 */ li $a1, 128 /* 043818 80042C18 24060040 */ li $a2, 64 -/* 04381C 80042C1C 0C0313EF */ jal func_800C4FBC +/* 04381C 80042C1C 0C0313EF */ jal set_current_dialogue_background_colour /* 043820 80042C20 24070080 */ li $a3, 128 /* 043824 80042C24 24040004 */ li $a0, 4 /* 043828 80042C28 00002825 */ move $a1, $zero /* 04382C 80042C2C 00003025 */ move $a2, $zero /* 043830 80042C30 00003825 */ move $a3, $zero -/* 043834 80042C34 0C031414 */ jal func_800C5050 +/* 043834 80042C34 0C031414 */ jal set_current_text_background_colour /* 043838 80042C38 AFA00010 */ sw $zero, 0x10($sp) /* 04383C 80042C3C 24040004 */ li $a0, 4 /* 043840 80042C40 0C0313DF */ jal set_dialogue_font @@ -122,7 +122,7 @@ glabel func_80042A90 /* 043860 80042C60 AFB80014 */ sw $t8, 0x14($sp) /* 043864 80042C64 240500FF */ li $a1, 255 /* 043868 80042C68 240600FF */ li $a2, 255 -/* 04386C 80042C6C 0C031400 */ jal set_text_colour +/* 04386C 80042C6C 0C031400 */ jal set_current_text_colour /* 043870 80042C70 240700FF */ li $a3, 255 /* 043874 80042C74 8FB90048 */ lw $t9, 0x48($sp) /* 043878 80042C78 8FA80050 */ lw $t0, 0x50($sp) @@ -141,7 +141,7 @@ glabel func_80042A90 /* 0438AC 80042CAC 25860002 */ addiu $a2, $t4, 2 /* 0438B0 80042CB0 0C03145A */ jal render_dialogue_text /* 0438B4 80042CB4 24040004 */ li $a0, 4 -/* 0438B8 80042CB8 0C03157D */ jal func_800C55F4 +/* 0438B8 80042CB8 0C03157D */ jal open_dialogue_box /* 0438BC 80042CBC 24040004 */ li $a0, 4 /* 0438C0 80042CC0 8FBF0024 */ lw $ra, 0x24($sp) .L80042CC4: diff --git a/include/structs.h b/include/structs.h index 5afa0c4d..046aabac 100644 --- a/include/structs.h +++ b/include/structs.h @@ -1017,24 +1017,24 @@ typedef struct DialogueBoxBackground { s16 y2; s16 width; s16 height; - u8 unk10; - u8 unk11; - u8 unk12; - u8 unk13; - u8 colorRed; - u8 colorGreen; - u8 colorBlue; - u8 colorAlpha; - u8 bgRed; - u8 bgGreen; - u8 bgBlue; - u8 bgAlpha; + u8 backgroundColourR; + u8 backgroundColourG; + u8 backgroundColourB; + u8 backgroundColourA; + u8 textColourR; + u8 textColourG; + u8 textColourB; + u8 textColourA; + u8 textBGColourR; + u8 textBGColourG; + u8 textBGColourB; + u8 textBGColourA; u8 opacity; u8 font; - u16 unk1E; + u16 flags; s16 unk20; s16 unk22; - DialogueBox *unk24; + DialogueBox *text; } DialogueBoxBackground; #endif diff --git a/src/font.c b/src/font.c index 60fdb176..9d0affd7 100644 --- a/src/font.c +++ b/src/font.c @@ -45,13 +45,13 @@ s32 gDescPowsOf10[9] = { }; s8 D_800E3710[48] = { - 4, FALSE, 0, FALSE, 1, - 2, FALSE, 1, FALSE, 2, - 1, FALSE, 2, FALSE, 4, - 0, FALSE, 4, TRUE, -4, - 1, TRUE, -4, TRUE, -2, - 2, TRUE, -2, TRUE, -1, - 4, TRUE, -1, TRUE, 0, + 4, FALSE, 0, FALSE, 1, + 2, FALSE, 1, FALSE, 2, + 1, FALSE, 2, FALSE, 4, + 0, FALSE, 4, TRUE, -4, + 1, TRUE, -4, TRUE, -2, + 2, TRUE, -2, TRUE, -1, + 4, TRUE, -1, TRUE, 0, -1, 0, 0, 0, 0, // End of Data 0, 0, 0, 0, 0, 0, 0, 0, }; @@ -99,28 +99,28 @@ void load_fonts(void) { (*gDialogueBoxBackground)[i].y2 = SCREEN_HEIGHT - 1; (*gDialogueBoxBackground)[i].width = SCREEN_WIDTH; (*gDialogueBoxBackground)[i].height = SCREEN_HEIGHT; - (*gDialogueBoxBackground)[i].unk10 = 0xFF; - (*gDialogueBoxBackground)[i].unk11 = 0xFF; - (*gDialogueBoxBackground)[i].unk12 = 0xFF; - (*gDialogueBoxBackground)[i].unk13 = 0; - (*gDialogueBoxBackground)[i].colorRed = 0xFF; - (*gDialogueBoxBackground)[i].colorGreen = 0xFF; - (*gDialogueBoxBackground)[i].colorBlue = 0xFF; - (*gDialogueBoxBackground)[i].colorAlpha = 0; - (*gDialogueBoxBackground)[i].bgRed = 0xFF; - (*gDialogueBoxBackground)[i].bgGreen = 0xFF; - (*gDialogueBoxBackground)[i].bgBlue = 0xFF; - (*gDialogueBoxBackground)[i].bgAlpha = 0; + (*gDialogueBoxBackground)[i].backgroundColourR = 0xFF; + (*gDialogueBoxBackground)[i].backgroundColourG = 0xFF; + (*gDialogueBoxBackground)[i].backgroundColourB = 0xFF; + (*gDialogueBoxBackground)[i].backgroundColourA = 0; + (*gDialogueBoxBackground)[i].textColourR = 0xFF; + (*gDialogueBoxBackground)[i].textColourG = 0xFF; + (*gDialogueBoxBackground)[i].textColourB = 0xFF; + (*gDialogueBoxBackground)[i].textColourA = 0; + (*gDialogueBoxBackground)[i].textBGColourR = 0xFF; + (*gDialogueBoxBackground)[i].textBGColourG = 0xFF; + (*gDialogueBoxBackground)[i].textBGColourB = 0xFF; + (*gDialogueBoxBackground)[i].textBGColourA = 0; (*gDialogueBoxBackground)[i].opacity = 0xFF; (*gDialogueBoxBackground)[i].font = 0xFF; if (i != 0) { - (*gDialogueBoxBackground)[i].unk1E = 0x4000; + (*gDialogueBoxBackground)[i].flags = DIALOGUE_BOX_UNK_01; } else { - (*gDialogueBoxBackground)[i].unk1E = 0; + (*gDialogueBoxBackground)[i].flags = 0; } (*gDialogueBoxBackground)[i].unk20 = 0; (*gDialogueBoxBackground)[i].unk22 = 0; - (*gDialogueBoxBackground)[i].unk24 = 0; + (*gDialogueBoxBackground)[i].text = 0; } for (i = 0; i < unk8012A7EC_COUNT; i++) { (*D_8012A7EC)[i].unk1 = 0xFF; @@ -222,18 +222,18 @@ GLOBAL_ASM("asm/non_matchings/font/func_800C4318.s") #endif void set_text_color(s32 red, s32 green, s32 blue, s32 alpha, s32 opacity) { - (*gDialogueBoxBackground)[0].colorRed = red; - (*gDialogueBoxBackground)[0].colorGreen = green; - (*gDialogueBoxBackground)[0].colorBlue = blue; - (*gDialogueBoxBackground)[0].colorAlpha = alpha; + (*gDialogueBoxBackground)[0].textColourR = red; + (*gDialogueBoxBackground)[0].textColourG = green; + (*gDialogueBoxBackground)[0].textColourB = blue; + (*gDialogueBoxBackground)[0].textColourA = alpha; (*gDialogueBoxBackground)[0].opacity = opacity; } void set_text_background_color(s32 red, s32 green, s32 blue, s32 alpha) { - (*gDialogueBoxBackground)[0].bgRed = red; - (*gDialogueBoxBackground)[0].bgGreen = green; - (*gDialogueBoxBackground)[0].bgBlue = blue; - (*gDialogueBoxBackground)[0].bgAlpha = alpha; + (*gDialogueBoxBackground)[0].textBGColourR = red; + (*gDialogueBoxBackground)[0].textBGColourG = green; + (*gDialogueBoxBackground)[0].textBGColourB = blue; + (*gDialogueBoxBackground)[0].textBGColourA = alpha; } // Unused? @@ -313,7 +313,7 @@ s32 func_800C4DA0(u8 *text, s32 x, s32 font) { GLOBAL_ASM("asm/non_matchings/font/func_800C4DA0.s") #endif -void set_dialogue_box_coords(s32 arg0, s32 x1, s32 y1, s32 x2, s32 y2) { +void set_current_dialogue_box_coords(s32 arg0, s32 x1, s32 y1, s32 x2, s32 y2) { if (arg0 > 0 && arg0 < 8) { DialogueBoxBackground *temp = &gDialogueBoxBackground[arg0]; temp->xpos = 0; @@ -346,39 +346,39 @@ void set_dialogue_font(s32 arg0, s32 font) { } } -void func_800C4FBC(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { +void set_current_dialogue_background_colour(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { if (arg0 > 0 && arg0 < 8) { DialogueBoxBackground *temp = &gDialogueBoxBackground[arg0]; - temp->unk10 = arg1; - temp->unk11 = arg2; - temp->unk12 = arg3; - temp->unk13 = arg4; + temp->backgroundColourR = arg1; + temp->backgroundColourG = arg2; + temp->backgroundColourB = arg3; + temp->backgroundColourA = arg4; } } -void set_text_colour(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha, s32 opacity) { +void set_current_text_colour(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha, s32 opacity) { DialogueBoxBackground *temp; if (arg0 <= 0 || arg0 >= 8) { return; } temp = &gDialogueBoxBackground[arg0]; - temp->colorRed = red; - temp->colorGreen = green; - temp->colorBlue = blue; - temp->colorAlpha = alpha; + temp->textColourR = red; + temp->textColourG = green; + temp->textColourB = blue; + temp->textColourA = alpha; temp->opacity = opacity; } -void func_800C5050(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { +void set_current_text_background_colour(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha) { DialogueBoxBackground *temp; if (arg0 <= 0 || arg0 >= 8) { return; } temp = &gDialogueBoxBackground[arg0]; - temp->bgRed = arg1; - temp->bgGreen = arg2; - temp->bgBlue = arg3; - temp->bgAlpha = arg4; + temp->textBGColourR = red; + temp->textBGColourG = green; + temp->textBGColourB = blue; + temp->textBGColourA = alpha; } // Unused? @@ -417,8 +417,8 @@ void func_800C5428(s32 arg0, DialogueBox *arg1) { DialogueBox **temp_24_ptr; temp = &gDialogueBoxBackground[arg0]; - temp_24_ptr = &temp->unk24; - temp_24 = temp->unk24; + temp_24_ptr = &temp->text; + temp_24 = temp->text; while ((temp_24 != NULL) && (temp_24 != arg1)) { temp_24_ptr = &temp_24->unk1C; temp_24 = temp_24->unk1C; @@ -434,14 +434,14 @@ void func_800C5494(s32 arg0) { DialogueBox *temp_24, *temp_24_2; temp = &gDialogueBoxBackground[arg0]; - temp_24 = temp->unk24; + temp_24 = temp->text; if (temp_24 != NULL) { temp_24_2 = temp_24; // This seems redundant. while (temp_24_2 != NULL) { temp_24_2->unk01 = 0xFF; temp_24_2 = temp_24_2->unk1C; } - temp->unk24 = NULL; + temp->text = NULL; } } @@ -475,31 +475,31 @@ void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4) { } } -void func_800C55F4(s32 arg0) { - (*gDialogueBoxBackground)[arg0].unk1E |= 0x8000; +void open_dialogue_box(s32 arg0) { + (*gDialogueBoxBackground)[arg0].flags |= DIALOGUE_BOX_OPEN; } -void func_800C5620(s32 arg0) { - (*gDialogueBoxBackground)[arg0].unk1E &= 0x7FFF; +void close_dialogue_box(s32 arg0) { + (*gDialogueBoxBackground)[arg0].flags &= DIALOGUE_BOX_CLOSED; } // Unused? void func_800C564C(s32 arg0) { - (*gDialogueBoxBackground)[arg0].unk1E |= 0x0001; + (*gDialogueBoxBackground)[arg0].flags |= DIALOGUE_BOX_UNUSED_01; } // Unused? void func_800C5678(s32 arg0) { - (*gDialogueBoxBackground)[arg0].unk1E &= 0xFFFE; + (*gDialogueBoxBackground)[arg0].flags &= DIALOGUE_BOX_UNUSED_02; } // Unused? void func_800C56A4(s32 arg0) { - (*gDialogueBoxBackground)[arg0].unk1E |= 0x4000; + (*gDialogueBoxBackground)[arg0].flags |= DIALOGUE_BOX_UNK_01; } void func_800C56D0(s32 arg0) { - (*gDialogueBoxBackground)[arg0].unk1E &= 0xBFFF; + (*gDialogueBoxBackground)[arg0].flags &= DIALOGUE_BOX_UNK_02; } void func_800C56FC(s32 arg0, s32 arg1, s32 arg2) { @@ -514,8 +514,8 @@ void func_800C56FC(s32 arg0, s32 arg1, s32 arg2) { } for (i = 1; i < 8; i++) { - if ((*gDialogueBoxBackground)[i].unk1E & 0x8000) { - if ((*gDialogueBoxBackground)[i].unk1E & 0x4000) { + if ((*gDialogueBoxBackground)[i].flags & DIALOGUE_BOX_OPEN) { + if ((*gDialogueBoxBackground)[i].flags & DIALOGUE_BOX_UNK_01) { func_800C5B58(arg0, arg1, arg2, i); } else { func_800C5B58(arg0, 0, 0, i); @@ -590,7 +590,7 @@ void func_800C5B58(Gfx **dlist, s32 *arg1, s32 *arg2, s32 arg3) { temp = &gDialogueBoxBackground[arg3]; - if (temp->unk13 != 0) { + if (temp->backgroundColourA != 0) { gSPDisplayList((*dlist)++, &D_800E3690); gDkrDmaDisplayList((*dlist)++, ((u8 *)&D_800E36C8[1]) + 0x80000000, 2); gDPSetEnvColor((*dlist)++, 0, 0, 0, 0); @@ -603,7 +603,7 @@ void func_800C5B58(Gfx **dlist, s32 *arg1, s32 *arg2, s32 arg3) { render_fill_rectangle(dlist, temp->x1 - 2, temp->y2 - 2, temp->x2 + 2, temp->y2 + 2); } gDPPipeSync((*dlist)++); - gDPSetEnvColor((*dlist)++, temp->unk10, temp->unk11, temp->unk12, temp->unk13); + gDPSetEnvColor((*dlist)++, temp->backgroundColourR, temp->backgroundColourG, temp->backgroundColourB, temp->backgroundColourA); for (i = 0; D_800E3710[i] >= 0; i += 5) { x0 = D_800E3710[i] + temp->x1; y0 = (D_800E3710[i + 1]) ? D_800E3710[i + 2] + temp->y2 : D_800E3710[i + 2] + temp->y1; @@ -621,18 +621,18 @@ void func_800C5B58(Gfx **dlist, s32 *arg1, s32 *arg2, s32 arg3) { D_8012A7F4 = 2; func_8009E9B0(temp, dlist, arg1, arg2); } - temp_24 = temp->unk24; + temp_24 = temp->text; while (temp_24 != NULL) { temp->xpos = temp_24->unk8 + temp_24->unkC; temp->ypos = temp_24->unkA + temp_24->unkE; - temp->colorRed = temp_24->unk10; - temp->colorGreen = temp_24->unk11; - temp->colorBlue = temp_24->unk12; - temp->colorAlpha = temp_24->unk13; - temp->bgRed = temp_24->unk14; - temp->bgGreen = temp_24->unk15; - temp->bgBlue = temp_24->unk16; - temp->bgAlpha = temp_24->unk17; + temp->textColourR = temp_24->unk10; + temp->textColourG = temp_24->unk11; + temp->textColourB = temp_24->unk12; + temp->textColourA = temp_24->unk13; + temp->textBGColourR = temp_24->unk14; + temp->textBGColourG = temp_24->unk15; + temp->textBGColourB = temp_24->unk16; + temp->textBGColourA = temp_24->unk17; temp->opacity = temp_24->unk18; temp->font = temp_24->unk19; parse_string_with_number(temp_24->unk4, &sp6C, temp_24->unk01); @@ -642,7 +642,7 @@ void func_800C5B58(Gfx **dlist, s32 *arg1, s32 *arg2, s32 arg3) { } /** - * Takes in a string and a number, and replaces each instance of the + * Takes in a string and a number, and replaces each instance of the * character '~' with the number. */ void parse_string_with_number(unsigned char *input, char *output, s32 number) { diff --git a/src/font.h b/src/font.h index a7e6454d..029be63f 100644 --- a/src/font.h +++ b/src/font.h @@ -21,6 +21,15 @@ enum TextFonts { FONT_SMALL, }; +enum DialogueFlags { + DIALOGUE_BOX_UNUSED_01 = 0x0001, + DIALOGUE_BOX_UNK_01 = 0x4000, + DIALOGUE_BOX_CLOSED = 0x7FFF, + DIALOGUE_BOX_OPEN = 0x8000, + DIALOGUE_BOX_UNK_02 = 0xBFFF, + DIALOGUE_BOX_UNUSED_02 = 0xFFFE, +}; + /* Size: 0x20 bytes */ typedef struct unk8012A7EC { u8 unk0; @@ -91,19 +100,19 @@ void func_800C4404(Gfx** displayList, char *text, s32 alignmentFlags); void draw_text(Gfx** displayList, s32 xpos, s32 ypos, char *text, s32 alignmentFlags); void func_800C44C0(Gfx** displayList, s32 arg1, char *text, s32 alignmentFlags); void func_800C4510(Gfx** displayList, s32 arg1, s32 xpos, s32 ypos, char *text, s32 alignmentFlags); -void set_dialogue_box_coords(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); +void set_current_dialogue_box_coords(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); void set_dialogue_font(s32 arg0, s32 font); -void func_800C4FBC(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); -void set_text_colour(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha, s32 opacity); -void func_800C5050(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); +void set_current_dialogue_background_colour(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); +void set_current_text_colour(s32 arg0, s32 red, s32 green, s32 blue, s32 alpha, s32 opacity); +void set_current_text_background_colour(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); void func_800C5094(s32 arg0, s32 arg1, s32 arg2); void func_800C50D8(s32 arg0); void func_800C510C(s32 arg0, s32 arg1, s32 arg2, s32 arg3); void func_800C5428(s32 arg0, DialogueBox *arg1); void func_800C5494(s32 arg0); void func_800C54E8(s32 arg0, unk800C54E8 *arg1, s32 arg2, s32 arg3, s32 arg4); -void func_800C55F4(s32 arg0); -void func_800C5620(s32 arg0); +void open_dialogue_box(s32 arg0); +void close_dialogue_box(s32 arg0); void func_800C564C(s32 arg0); void func_800C5678(s32 arg0); void func_800C56A4(s32 arg0); diff --git a/src/game_text.c b/src/game_text.c index 4a7e3476..f2f8b612 100644 --- a/src/game_text.c +++ b/src/game_text.c @@ -77,7 +77,7 @@ void func_800C29F0(void) { void func_800C2AB4(void) { free_from_memory_pool(D_8012A7C8.unk0); D_8012A7B6 = 0; - func_800C5620(6); + close_dialogue_box(6); func_800C5494(6); } @@ -98,7 +98,7 @@ void func_800C2F1C(s32 arg0) { if ((s32)D_8012A7A8 < 0) { D_8012A7A8 = 0; D_8012A7B6 = 0; - func_800C5620(6); + close_dialogue_box(6); func_800C5494(6); } } else { diff --git a/src/menu.c b/src/menu.c index 7cec9a1e..a9f27abd 100644 --- a/src/menu.c +++ b/src/menu.c @@ -2994,8 +2994,8 @@ void menu_magic_codes_init(void) { D_801263D8 = 0; D_801263E0 = 0; func_800C01D8(&D_800DF77C); - set_dialogue_box_coords(7, 0x32, 0x32, 0x10E, 0x84); - func_800C4FBC(7, 0, 0, 0, 0x80); + set_current_dialogue_box_coords(7, 0x32, 0x32, 0x10E, 0x84); + set_current_dialogue_background_colour(7, 0, 0, 0, 0x80); func_800C5494(7); func_800C4170(2); } @@ -3092,8 +3092,8 @@ void render_magic_codes_ui(s32 arg0) { } func_800C5494(6); set_dialogue_font(6, FONT_COLOURFUL); - set_dialogue_box_coords(6, 0x4C, yPos - 0x1C, 0xF4, yPos + 0x1C); - func_800C4FBC(6, 0, 0, 0, 0xA0); + set_current_dialogue_box_coords(6, 0x4C, yPos - 0x1C, 0xF4, yPos + 0x1C); + set_current_dialogue_background_colour(6, 0, 0, 0, 0xA0); yPos = 4; for (i = 0; i < 3; i++) { alpha = 0; @@ -3104,7 +3104,7 @@ void render_magic_codes_ui(s32 arg0) { } else if (i == D_801263E0) { alpha = temp; } - set_text_colour(6, 0xFF, green, 0xFF, alpha, 0xFF); + set_current_text_colour(6, 0xFF, green, 0xFF, alpha, 0xFF); // gMenuText[148] = "CLEAR ALL CODES?", [149] = "OK", [150] = "CANCEL" render_dialogue_text(6, POS_X_CENTRED, yPos, gMenuText[148 + i], 1, 4); @@ -4384,7 +4384,7 @@ void render_track_select_setup_ui(s32 arg0) { if (sp84 >= 0x100) { sp84 = 0x1FF - sp84; } - func_800C4FBC(7, 0xFF, sp84, 0, D_800DF764); + set_current_dialogue_background_colour(7, 0xFF, sp84, 0, D_800DF764); if ((D_801263E0 == -1) || ((D_801263E0 == 2) && (D_801269C8 == 4) && is_adventure_two_unlocked())) { s4 = func_800C4DA0(gMenuText[146], 0, 0); // gMenuText[146] = "ADVENTURE" temp = func_800C4DA0(gMenuText[147], 0, 0); // gMenuText[147] = "ADVENTURE TWO" @@ -4434,7 +4434,7 @@ void render_track_select_setup_ui(s32 arg0) { if (D_801263E0 != -1) { if (gNumberOfActivePlayers == 1) { // Glow effect - set_dialogue_box_coords(7, 0x86, sp80 + 0x70, 0xBA, sp80 + 0x89); + set_current_dialogue_box_coords(7, 0x86, sp80 + 0x70, 0xBA, sp80 + 0x89); func_800C5B58(&D_801263A0, 0, 0, 7); if (D_801263E0 <= 0) { render_textured_rectangle(&D_801263A0, &D_800E05B4, 0x88, sp80 + 0x72, 0xFF, 0xFF, 0xFF, D_800DF764); @@ -4458,7 +4458,7 @@ void render_track_select_setup_ui(s32 arg0) { s32 temp_v0_9 = D_800E0688[s3 + (i * 2)]; s32 temp_v1 = D_800E0688[s3 + (i * 2) + 1] + sp80; // Glow effect around Player image - set_dialogue_box_coords(7, temp_v0_9 - 2, temp_v1 - 2, temp_v0_9 + 0x32, temp_v1 + 0x17); + set_current_dialogue_box_coords(7, temp_v0_9 - 2, temp_v1 - 2, temp_v0_9 + 0x32, temp_v1 + 0x17); func_800C5B58(&D_801263A0, 0, 0, 7); } @@ -4835,7 +4835,7 @@ GLOBAL_ASM("asm/non_matchings/menu/func_80094170.s") void n_alSynRemovePlayer(void) { func_80072298(1); - func_800C5620(7); + close_dialogue_box(7); func_800C5494(7); D_800E0984 = 0; } @@ -5946,7 +5946,7 @@ void func_8009CF68(s32 arg0) { void func_8009CFB0(void) { if (D_800DF4E0 != 0) { D_800DF4E0 = 0; - func_800C5620(1); + close_dialogue_box(1); reset_controller_sticks(); } } @@ -5967,8 +5967,8 @@ s32 func_8009CFEC(u32 arg0) { result = 0; update_controller_sticks(); func_800C5494(1); - func_800C55F4(1); - func_800C4FBC(1, 0, 0, 0, 0x80); + open_dialogue_box(1); + set_current_dialogue_background_colour(1, 0, 0, 0, 0x80); func_8001F450(); switch (arg0) { case DIALOG_TAJ: @@ -5996,12 +5996,12 @@ s32 func_8009CFEC(u32 arg0) { */ void set_option_text_colour(s32 condition) { if (condition == FALSE) { - set_text_colour(1, 0, 0, 0x7F, 0x5A, 0xFF); // Normal + set_current_text_colour(1, 0, 0, 0x7F, 0x5A, 0xFF); // Normal if (gDialogOptionTangible != FALSE) { - set_text_colour(1, 0, 0, 0x7F, 0x5A, 0x78); //Locked + set_current_text_colour(1, 0, 0, 0x7F, 0x5A, 0x78); //Locked } } else { - set_text_colour(1, 0xCF, 0xCF, 0xCF, 0x5A, 0xFF); // Selected Option + set_current_text_colour(1, 0xCF, 0xCF, 0xCF, 0x5A, 0xFF); // Selected Option } gDialogOptionTangible = (u8)FALSE; } @@ -6061,7 +6061,7 @@ s32 taj_menu_loop(void) { sCurrentMenuID = 1; } if ((sCurrentMenuID > 0) && (sCurrentMenuID < 4)) { - set_dialogue_box_coords(1, 24, 16, 184, 124); + set_current_dialogue_box_coords(1, 24, 16, 184, 124); set_dialogue_font(1, FONT_COLOURFUL); } sp2C = 0; @@ -6195,11 +6195,11 @@ s32 taj_menu_loop(void) { case 4: sp2C = (D_800DF4DC - 1) | 0x40; sCurrentMenuID = 5; - func_800C5620(1); + close_dialogue_box(1); break; case 5: D_800DF4DC = 0; - func_800C5620(1); + close_dialogue_box(1); break; case 6: case 7: @@ -6208,7 +6208,7 @@ s32 taj_menu_loop(void) { sp2C = 3; } D_800DF4E0 = 0; - func_800C5620(1); + close_dialogue_box(1); D_800DF4DC = 0; sCurrentMenuID = 0; break; @@ -6220,7 +6220,7 @@ s32 func_8009D9F4(void) { s32 state; s32 playerInput; - set_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0x87); + set_current_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0x87); set_dialogue_font(1, FONT_COLOURFUL); state = 0; playerInput = get_buttons_pressed_from_player(0); @@ -6272,9 +6272,9 @@ s32 tt_menu_loop(void) { if (func_8001B780() != 0) { currentOption = 0x88; } - set_dialogue_box_coords(1, 0x18, 0x10, 0xC0, currentOption); + set_current_dialogue_box_coords(1, 0x18, 0x10, 0xC0, currentOption); } else { - set_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0xDC); + set_current_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0xDC); } set_dialogue_font(1, FONT_COLOURFUL); currentOption = 0; @@ -6461,7 +6461,7 @@ s32 trophy_race_cabinet_menu_loop(void) { s32 currentOption; s32 buttonsPressed; - set_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0x78); + set_current_dialogue_box_coords(1, 0x18, 0x10, 0xB8, 0x78); set_dialogue_font(1, FONT_COLOURFUL); currentOption = 0; buttonsPressed = get_buttons_pressed_from_player(0); diff --git a/src/unknown_06B2B0.c b/src/unknown_06B2B0.c index 0ed35143..93f3ede6 100644 --- a/src/unknown_06B2B0.c +++ b/src/unknown_06B2B0.c @@ -930,7 +930,7 @@ void render(void) { func_80000D00((u8)sLogicMulFactor); func_800B5F78(&gCurrDisplayList); func_800C56FC(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); - func_800C5620(4); + close_dialogue_box(4); func_800C5494(4); if (func_800C0494(sLogicMulFactor) != 0) { render_fade_transition(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); From ff307982e5ee1d8a7c552cbc202510d49dd536f9 Mon Sep 17 00:00:00 2001 From: AntonioCastelli Date: Wed, 1 Dec 2021 19:19:14 -0800 Subject: [PATCH 14/18] Use magic code macros Co-authored-by: Faschz --- src/unknown_00BC20.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 794f4dd4..0a97609c 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -653,7 +653,7 @@ void func_8000E2B4(void) { player_64->unk0_a.unk0_b.unk0 = (u16)0; player_64->unk118 = 0; player_64->unk0_a.unk0_b.unk3 = (s8) settings->racers[0].character; - if ((get_filtered_cheats() & 0x10) != 0) { + if (get_filtered_cheats() & CHEAT_BIG_CHARACTERS) { player->scale *= 1.4f; } if ((get_filtered_cheats() & 0x20) != 0) { From b3f4cce2f5e4aea27d10acc6cd8d1d785b47da3d Mon Sep 17 00:00:00 2001 From: AntonioCastelli Date: Wed, 1 Dec 2021 19:25:15 -0800 Subject: [PATCH 15/18] Use magic code macros Co-authored-by: Faschz --- src/unknown_00BC20.c | 2 +- src/unknown_0348C0.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 0a97609c..da8148be 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -656,7 +656,7 @@ void func_8000E2B4(void) { if (get_filtered_cheats() & CHEAT_BIG_CHARACTERS) { player->scale *= 1.4f; } - if ((get_filtered_cheats() & 0x20) != 0) { + if (get_filtered_cheats() & CHEAT_SMALL_CHARACTERS) { player->scale *= 0.714f; } player->unk3C_a.unk3C = 0; diff --git a/src/unknown_0348C0.c b/src/unknown_0348C0.c index d5eca7eb..887a79d0 100644 --- a/src/unknown_0348C0.c +++ b/src/unknown_0348C0.c @@ -1202,15 +1202,15 @@ void func_8003DFCC(Object *arg0, unknown_struct_8003DFCC *arg1) { arg0->unk4C->unk11 = 4; arg0->unk4C->unk10 = 0x14; temp_v0 = get_filtered_cheats(); - if (temp_v0 & 0x20000) { + if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_BLUE) { arg1->unk9 = 0U; - } else if (temp_v0 & 0x08000) { + } else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_RED) { arg1->unk9 = 1U; - } else if (temp_v0 & 0x10000) { + } else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_GREEN) { arg1->unk9 = 2U; - } else if (temp_v0 & 0x40000) { + } else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_YELLOW) { arg1->unk9 = 3U; - } else if (temp_v0 & 0x80000) { + } else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_RAINBOW) { arg1->unk9 = 4U; } if ((s32) arg1->unk8 >= 6) { @@ -1230,7 +1230,7 @@ void func_8003DFCC(Object *arg0, unknown_struct_8003DFCC *arg1) { arg0->unk64->unk4 = 0; arg0->unk64->unk0_a.unk0 = arg0->scale; arg0->unk7C.word = 0; - if ((get_filtered_cheats() & 0x800) != 0) { + if (get_filtered_cheats() & CHEAT_DISABLE_WEAPONS) { gParticlePtrList_addObject(arg0); } } From e93a5db1ecfa2e29a151e673a3f295464e067349 Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 1 Dec 2021 19:44:23 -0800 Subject: [PATCH 16/18] Added undefined struct members. --- include/structs.h | 7 +++++-- src/unknown_00BC20.c | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/structs.h b/include/structs.h index 41a5bf66..259455bf 100644 --- a/include/structs.h +++ b/include/structs.h @@ -608,7 +608,9 @@ typedef struct Object_64 { u8 unkFC; u8 padFD[0xB]; s32 unk108; - u8 pad10C[0x54]; + u8 pad10C[0xC]; + s32 unk118; + u8 pad11C[0x44]; s16 unk160; s16 unk162; s16 unk164; @@ -619,7 +621,8 @@ typedef struct Object_64 { u8 unk193; u8 pad194[0x26]; u16 unk1BA; - u8 pad1BC[0x1B]; + u8 pad1BC[0x1A]; + s8 unk1D6; s8 unk1D7; u8 pad1D8[0x1A]; u8 unk1F2; diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index da8148be..e758c84f 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -11,6 +11,7 @@ #include "asset_loading.h" #include "thread0_epc.h" #include "controller_pak.h" +#include "menu.h" #include "unknown_06B2B0.h" #include "unknown_043920.h" From ea51d96bfb71eee1abb445c4798697e6707cc383 Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 1 Dec 2021 21:13:54 -0800 Subject: [PATCH 17/18] Fixed NON_MATCHING. --- src/menu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/menu.c b/src/menu.c index d850f2ed..01a9a641 100644 --- a/src/menu.c +++ b/src/menu.c @@ -3963,7 +3963,7 @@ void render_file_select_menu(s32 arg0) { func_8009BD5C(); func_80067F2C(&D_801263A0, &D_801263A8); for (i = 0; i < 3; i++) { // 3 files - if (gSavefileInfo[i].unk0 == gIsInAdventureTwo || gSavefileInfo[i].unk1 == 0) { + if (gSavefileInfo[i].isAdventure2 == gIsInAdventureTwo || gSavefileInfo[i].isStarted == 0) { color = 0xB0E0C0FF; } else { color = 0x6A9073FF; @@ -3977,17 +3977,17 @@ void render_file_select_menu(s32 arg0) { set_text_background_color(0, 0, 0, 0); s5 = 10; for (i = 0; i < 3; i++) { - if (gSavefileInfo[i].unk1 != 0) { + if (gSavefileInfo[i].isStarted != 0) { s2 = 0xB; func_8007BF1C(0); - if (gSavefileInfo[i].unk0 != 0) { + if (gSavefileInfo[i].isAdventure2 != 0) { s2 = 0xC; } func_8008CC28(s2, D_800E03FC[2] + D_800E03CC[i].unk0, D_800E03FC[3] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); func_80068508(1); - D_800DF75C->unk18 = gSavefileInfo[i].unk2 / s5; + D_800DF75C->unk18 = gSavefileInfo[i].balloonCount / s5; func_8008CC28(0, (D_800E03FC[6] + D_800E03CC[i].unk0) - 6, D_800E03FC[7] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); - D_800DF75C->unk18 = gSavefileInfo[i].unk2 % s5; + D_800DF75C->unk18 = gSavefileInfo[i].balloonCount % s5; func_8008CC28(0, D_800E03FC[6] + D_800E03CC[i].unk0 + 6, D_800E03FC[7] + D_800E03CC[i].unk2, 0, 0, 0, 0x80); func_80068508(0); D_800DF4A8 = 0x40; @@ -4029,7 +4029,7 @@ void render_file_select_menu(s32 arg0) { } if (D_80126CC0 == 0 || i != gSaveFileIndex) { trim_filename_string(gSavefileInfo[i].name, tempName); - if (gSavefileInfo[i].unk1 == 0) { + if (gSavefileInfo[i].isStarted == 0) { trim_filename_string(gFilenames[i], tempName); } if (tempName != NULL) { From 55f7ffe3007a5ffe0ae358ba95a89798aaf4ad53 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Thu, 2 Dec 2021 10:24:00 +0000 Subject: [PATCH 18/18] make requested changes --- .../controller_pak/func_8007431C.s | 2 +- .../controller_pak/func_800744DC.s | 2 +- .../controller_pak/func_800746F0.s | 4 +- .../controller_pak/func_8007497C.s | 2 +- src/audio.c | 10 +-- src/controller_pak.c | 2 +- src/fade_transition.c | 16 ++-- src/font.c | 8 +- src/font.h | 2 +- src/menu.c | 80 +++++++++---------- src/menu.h | 2 +- src/thread0_epc.c | 4 +- src/unknown_06B2B0.c | 62 +++++++------- src/unknown_06B2B0.h | 2 +- src/video.c | 24 +++--- src/video.h | 15 ++++ 16 files changed, 126 insertions(+), 111 deletions(-) diff --git a/asm/non_matchings/controller_pak/func_8007431C.s b/asm/non_matchings/controller_pak/func_8007431C.s index 746e97a8..f24a91ea 100644 --- a/asm/non_matchings/controller_pak/func_8007431C.s +++ b/asm/non_matchings/controller_pak/func_8007431C.s @@ -97,7 +97,7 @@ glabel func_8007431C /* 075070 80074470 1605FFFA */ bne $s0, $a1, .L8007445C /* 075074 80074474 24630004 */ addiu $v1, $v1, 4 .L80074478: -/* 075078 80074478 0C01BAB0 */ jal check_reset_pressed +/* 075078 80074478 0C01BAB0 */ jal is_reset_pressed /* 07507C 8007447C AFA60054 */ sw $a2, 0x54($sp) /* 075080 80074480 8FA60054 */ lw $a2, 0x54($sp) /* 075084 80074484 1440000C */ bnez $v0, .L800744B8 diff --git a/asm/non_matchings/controller_pak/func_800744DC.s b/asm/non_matchings/controller_pak/func_800744DC.s index 47e0f76c..08dd48ce 100644 --- a/asm/non_matchings/controller_pak/func_800744DC.s +++ b/asm/non_matchings/controller_pak/func_800744DC.s @@ -38,7 +38,7 @@ glabel func_800744DC /* 07515C 8007455C 02202025 */ move $a0, $s1 /* 075160 80074560 0C01CCBA */ jal func_800732E8 /* 075164 80074564 00402825 */ move $a1, $v0 -/* 075168 80074568 0C01BAB0 */ jal check_reset_pressed +/* 075168 80074568 0C01BAB0 */ jal is_reset_pressed /* 07516C 8007456C 00000000 */ nop /* 075170 80074570 8FA3002C */ lw $v1, 0x2c($sp) /* 075174 80074574 1440000C */ bnez $v0, .L800745A8 diff --git a/asm/non_matchings/controller_pak/func_800746F0.s b/asm/non_matchings/controller_pak/func_800746F0.s index e84aa228..c22faf6e 100644 --- a/asm/non_matchings/controller_pak/func_800746F0.s +++ b/asm/non_matchings/controller_pak/func_800746F0.s @@ -24,7 +24,7 @@ glabel func_800746F0 /* 075344 80074744 322F0001 */ andi $t7, $s1, 1 /* 075348 80074748 11E00011 */ beqz $t7, .L80074790 /* 07534C 8007474C AFB10028 */ sw $s1, 0x28($sp) -/* 075350 80074750 0C01BAB0 */ jal check_reset_pressed +/* 075350 80074750 0C01BAB0 */ jal is_reset_pressed /* 075354 80074754 24110018 */ li $s1, 24 /* 075358 80074758 1440000D */ bnez $v0, .L80074790 /* 07535C 8007475C 00008025 */ move $s0, $zero @@ -47,7 +47,7 @@ glabel func_800746F0 /* 075398 80074798 31090002 */ andi $t1, $t0, 2 /* 07539C 8007479C 11200012 */ beqz $t1, .L800747E8 /* 0753A0 800747A0 00000000 */ nop -/* 0753A4 800747A4 0C01BAB0 */ jal check_reset_pressed +/* 0753A4 800747A4 0C01BAB0 */ jal is_reset_pressed /* 0753A8 800747A8 24110018 */ li $s1, 24 /* 0753AC 800747AC 1440000E */ bnez $v0, .L800747E8 /* 0753B0 800747B0 00008025 */ move $s0, $zero diff --git a/asm/non_matchings/controller_pak/func_8007497C.s b/asm/non_matchings/controller_pak/func_8007497C.s index 01d33668..d02bc25e 100644 --- a/asm/non_matchings/controller_pak/func_8007497C.s +++ b/asm/non_matchings/controller_pak/func_8007497C.s @@ -37,7 +37,7 @@ glabel func_8007497C /* 075604 80074A04 01C2C025 */ or $t8, $t6, $v0 /* 075608 80074A08 01E3C825 */ or $t9, $t7, $v1 /* 07560C 80074A0C AE190004 */ sw $t9, 4($s0) -/* 075610 80074A10 0C01BAB0 */ jal check_reset_pressed +/* 075610 80074A10 0C01BAB0 */ jal is_reset_pressed /* 075614 80074A14 AE180000 */ sw $t8, ($s0) /* 075618 80074A18 14400008 */ bnez $v0, .L80074A3C /* 07561C 80074A1C 24020001 */ li $v0, 1 diff --git a/src/audio.c b/src/audio.c index 8d1a2793..9122dc68 100644 --- a/src/audio.c +++ b/src/audio.c @@ -281,12 +281,12 @@ void func_80000CBC(void) { set_relative_volume_for_music(musicRelativeVolume); } -void func_80000D00(u8 mulFactor) { +void func_80000D00(u8 updateRate) { s32 reg_s2; s32 j; if (D_80115D3C > 0) { - D_80115D38 += mulFactor; + D_80115D38 += updateRate; D_800DC650 = ((f32)D_80115D38) / ((f32)D_80115D3C); if ((f64)D_800DC650 > 1.0f) { @@ -297,7 +297,7 @@ void func_80000D00(u8 mulFactor) { set_relative_volume_for_music(musicRelativeVolume); } else if (D_80115D3C < 0) { - D_80115D38 -= mulFactor; + D_80115D38 -= updateRate; D_800DC650 = 1.0f - ((f32)D_80115D38) / ((f32)D_80115D3C); if ((f64)D_800DC650 < 0) { D_80115D38 = 0; @@ -308,9 +308,9 @@ void func_80000D00(u8 mulFactor) { } if (D_800DC658 > 0) { - //reg_arg0 = mulFactor; + //reg_arg0 = updateRate; for (reg_s2 = 0; reg_s2 < D_800DC658;) { - D_80115D48[reg_s2].unk2 -= mulFactor; + D_80115D48[reg_s2].unk2 -= updateRate; if (D_80115D48[reg_s2].unk2 <= 0) { j = reg_s2; func_80001D04(D_80115D48[reg_s2].unk0, D_80115D48[reg_s2].unk4); diff --git a/src/controller_pak.c b/src/controller_pak.c index d9cac03b..ce0334fc 100644 --- a/src/controller_pak.c +++ b/src/controller_pak.c @@ -350,7 +350,7 @@ s32 func_8007497C(u64 *arg0) { *arg0 <<= 8; *arg0 >>= 8; *arg0 |= (s64)((s32)func_8007480C(*arg0)) << 56; - if (check_reset_pressed() == 0) { + if (is_reset_pressed() == 0) { osEepromWrite(func_8006A100(), 0xF, (u8 *)arg0); } return 1; diff --git a/src/fade_transition.c b/src/fade_transition.c index 9c73ed56..2253289b 100644 --- a/src/fade_transition.c +++ b/src/fade_transition.c @@ -288,12 +288,12 @@ s32 func_800C01D8(FadeTransition *transition) { GLOBAL_ASM("asm/non_matchings/fade_transition/func_800C01D8.s") #endif -s32 func_800C0494(s32 mulFactor) { +s32 func_800C0494(s32 updateRate) { if (D_800E31A4 != 0) { D_800E31A4 = D_800E31A4 - 1; - mulFactor = 0; - } else if (mulFactor >= 6) { - mulFactor = 5; + updateRate = LOGIC_NULL; + } else if (updateRate >= LOGIC_10FPS) { + updateRate = LOGIC_12FPS; } if (D_800E31AC != 0) { @@ -308,19 +308,19 @@ s32 func_800C0494(s32 mulFactor) { } switch (gCurFaceTransition) { case FADE_FULLSCREEN: - func_800C0834(mulFactor); + func_800C0834(updateRate); break; case FADE_BARNDOOR_HORIZONTAL: case FADE_BARNDOOR_VERTICAL: case FADE_WAVES: case FADE_BARNDOOR_DIAGONAL: - func_800C1130(mulFactor); + func_800C1130(updateRate); break; case FADE_CIRCLE: - func_800C1EE8(mulFactor); + func_800C1EE8(updateRate); break; case FADE_DISABLED: - func_800C27A0(mulFactor); + func_800C27A0(updateRate); break; } } diff --git a/src/font.c b/src/font.c index 9d0affd7..bb5f036a 100644 --- a/src/font.c +++ b/src/font.c @@ -243,8 +243,8 @@ void func_800C4404(Gfx **displayList, char *text, s32 alignmentFlags) { void draw_text(Gfx **displayList, s32 xpos, s32 ypos, char *text, s32 alignmentFlags) { DialogueBoxBackground *temp = &(*gDialogueBoxBackground)[0]; - temp->xpos = (xpos == POS_X_CENTRED) ? temp->width >> 1 : xpos; - temp->ypos = (ypos == POS_X_CENTRED) ? temp->height >> 1 : ypos; + temp->xpos = (xpos == POS_CENTRED) ? temp->width >> 1 : xpos; + temp->ypos = (ypos == POS_CENTRED) ? temp->height >> 1 : ypos; func_800C45A4(displayList, temp, text, alignmentFlags, 1.0f); } @@ -260,8 +260,8 @@ void func_800C44C0(Gfx **displayList, s32 arg1, char *text, s32 alignmentFlags) void func_800C4510(Gfx **displayList, s32 arg1, s32 xpos, s32 ypos, char *text, s32 alignmentFlags) { if (arg1 >= 0 && arg1 < 8) { DialogueBoxBackground *temp = &gDialogueBoxBackground[arg1]; - temp->xpos = (xpos == POS_X_CENTRED) ? temp->width >> 1 : xpos; - temp->ypos = (ypos == POS_X_CENTRED) ? temp->height >> 1 : ypos; + temp->xpos = (xpos == POS_CENTRED) ? temp->width >> 1 : xpos; + temp->ypos = (ypos == POS_CENTRED) ? temp->height >> 1 : ypos; func_800C45A4(displayList, temp, text, alignmentFlags, 1.0f); } } diff --git a/src/font.h b/src/font.h index 029be63f..7348a5ff 100644 --- a/src/font.h +++ b/src/font.h @@ -14,7 +14,7 @@ #include "f3ddkr.h" #include "textures_sprites.h" -#define POS_X_CENTRED -0x8000 +#define POS_CENTRED -0x8000 enum TextFonts { FONT_COLOURFUL, diff --git a/src/menu.c b/src/menu.c index a9f27abd..3a1114a1 100644 --- a/src/menu.c +++ b/src/menu.c @@ -2140,10 +2140,10 @@ void func_800828B8(void) { } } -void func_800829F8(Gfx *dl, s32 mulFactor) { +void func_800829F8(Gfx *dl, s32 updateRate) { s32 temp; - D_800DF46C += mulFactor; + D_800DF46C += updateRate; if (D_800DF46C & 0x10) { load_menu_text(get_language()); @@ -2154,7 +2154,7 @@ void func_800829F8(Gfx *dl, s32 mulFactor) { if (osTvType == TV_TYPE_PAL) { temp = 0xEA; } - draw_text(dl, POS_X_CENTRED, temp, gMenuText[151], 0xC); + draw_text(dl, POS_CENTRED, temp, gMenuText[151], 0xC); } } @@ -2215,8 +2215,8 @@ s32 menu_logo_screen_loop(s32 arg0) { set_text_color(0xFF, 0xFF, 0, 0xFF, phi_v0); draw_text(&D_801263A0, 0x9F, yOffset + 0xD4, gRareCopyrightString, 0xC); draw_text(&D_801263A0, 0xA1, yOffset + 0xD4, gRareCopyrightString, 0xC); - draw_text(&D_801263A0, POS_X_CENTRED, yOffset + 0xD3, gRareCopyrightString, 0xC); - draw_text(&D_801263A0, POS_X_CENTRED, yOffset + 0xD5, gRareCopyrightString, 0xC); + draw_text(&D_801263A0, POS_CENTRED, yOffset + 0xD3, gRareCopyrightString, 0xC); + draw_text(&D_801263A0, POS_CENTRED, yOffset + 0xD5, gRareCopyrightString, 0xC); } sp20 = yOffset + 0xD4; if (D_80126450 > 8.0) { @@ -2225,7 +2225,7 @@ s32 menu_logo_screen_loop(s32 arg0) { phi_v0 = 0xFF; } set_text_color(0xFF, 0xFF, 0xFF, 0xFF, phi_v0); - draw_text(&D_801263A0, POS_X_CENTRED, sp20, gRareCopyrightString, 0xC); + draw_text(&D_801263A0, POS_CENTRED, sp20, gRareCopyrightString, 0xC); } return 0; } @@ -2349,7 +2349,7 @@ void func_800841B8(s32 arg0) { phi_a3 = 0; } set_text_color(255, 255, 255, phi_a3, 0xFF); - draw_text(&D_801263A0, POS_X_CENTRED, phi_s2, gOptionMenuStrings[phi_s1], 0xC); + draw_text(&D_801263A0, POS_CENTRED, phi_s2, gOptionMenuStrings[phi_s1], 0xC); phi_s1++; phi_s2 += 0x1C; @@ -3067,7 +3067,7 @@ void render_magic_codes_ui(s32 arg0) { alpha = temp; } set_text_color(0xFF, 0xFF, 0xFF, alpha, 0xFF); - draw_text(&D_801263A0, POS_X_CENTRED, yPos, gMagicCodeMenuStrings[i], 0xC); + draw_text(&D_801263A0, POS_CENTRED, yPos, gMagicCodeMenuStrings[i], 0xC); yPos += yIncr; } set_text_font(0); @@ -3075,15 +3075,15 @@ void render_magic_codes_ui(s32 arg0) { set_text_background_color(0, 0, 0x80, 0x80); if (gOptionsMenuItemIndex == 4) { if (D_80126C4C == -1) { - draw_text(&D_801263A0, POS_X_CENTRED, 0x90, gMenuText[18], 0xC); // gMenuText[18] = "Sorry, the code was incorrect" + draw_text(&D_801263A0, POS_CENTRED, 0x90, gMenuText[18], 0xC); // gMenuText[18] = "Sorry, the code was incorrect" } else { // Draw cheat code name. - draw_text(&D_801263A0, POS_X_CENTRED, 0x90, (char *)(*gCheatsAssetData) + (*gCheatsAssetData + 1)[D_80126C4C + 1], 0xC); + draw_text(&D_801263A0, POS_CENTRED, 0x90, (char *)(*gCheatsAssetData) + (*gCheatsAssetData + 1)[D_80126C4C + 1], 0xC); } } else if (5 == gOptionsMenuItemIndex) { - draw_text(&D_801263A0, POS_X_CENTRED, 0x90, D_80126C58, 0xC); + draw_text(&D_801263A0, POS_CENTRED, 0x90, D_80126C58, 0xC); } else if (gOptionsMenuItemIndex == 6) { - draw_text(&D_801263A0, POS_X_CENTRED, 0x90, gMenuText[19], 0xC); // gMenuText[19] = "All cheats have been deleted" + draw_text(&D_801263A0, POS_CENTRED, 0x90, gMenuText[19], 0xC); // gMenuText[19] = "All cheats have been deleted" } if (D_801263E0 != 0) { yPos = 0x78; @@ -3107,7 +3107,7 @@ void render_magic_codes_ui(s32 arg0) { set_current_text_colour(6, 0xFF, green, 0xFF, alpha, 0xFF); // gMenuText[148] = "CLEAR ALL CODES?", [149] = "OK", [150] = "CANCEL" - render_dialogue_text(6, POS_X_CENTRED, yPos, gMenuText[148 + i], 1, 4); + render_dialogue_text(6, POS_CENTRED, yPos, gMenuText[148 + i], 1, 4); if (i != 0) { yPos += 0x10; @@ -3199,7 +3199,7 @@ void render_magic_codes_list_menu_text(s32 arg0) { if (numOfUnlockedCheats == gOptionsMenuItemIndex) { set_text_color(0xFF, 0xFF, 0xFF, fp, 0xFF); } - draw_text(&D_801263A0, POS_X_CENTRED, s2, gMenuText[5], 4); // RETURN + draw_text(&D_801263A0, POS_CENTRED, s2, gMenuText[5], 4); // RETURN return; } if (D_801263BC & 8) { @@ -4379,7 +4379,7 @@ void render_track_select_setup_ui(s32 arg0) { set_text_font(2); set_text_color(0xC0, 0xC0, 0xFF, 0, D_800DF764); set_text_background_color(0, 0, 0, 0); - draw_text(&D_801263A0, POS_X_CENTRED, 0x2B, func_8006BDDC(gTrackIdForPreview), 0xC); // Draw track name? + draw_text(&D_801263A0, POS_CENTRED, 0x2B, func_8006BDDC(gTrackIdForPreview), 0xC); // Draw track name? sp84 = D_801263BC * 8; if (sp84 >= 0x100) { sp84 = 0x1FF - sp84; @@ -5951,17 +5951,17 @@ void func_8009CFB0(void) { } } -s32 func_8009CFEC(u32 arg0) { +s32 func_8009CFEC(u32 dialogueOption) { s32 result; - D_800DF4E4[arg0] = 0; - if ((func_800C3400() != 0) && (arg0 != 3)) { + D_800DF4E4[dialogueOption] = 0; + if ((func_800C3400() != 0) && (dialogueOption != DIALOG_CHALLENGE)) { return 0; } if (D_800DF4E0 != 0) { return 0; } - if (arg0 != 3) { + if (dialogueOption != 3) { func_8006F388(1); } result = 0; @@ -5970,7 +5970,7 @@ s32 func_8009CFEC(u32 arg0) { open_dialogue_box(1); set_current_dialogue_background_colour(1, 0, 0, 0, 0x80); func_8001F450(); - switch (arg0) { + switch (dialogueOption) { case DIALOG_TAJ: result = taj_menu_loop(); // Taj menu break; @@ -6011,7 +6011,7 @@ void render_dialogue_option(char *text, s32 yOffset, s32 optionID) { if (sDialogueOption == sDialogueOptionMax) { D_80126516 = optionID; } - render_dialogue_text(1, POS_X_CENTRED, gDialogOptionYOffset, text, 1, 4); + render_dialogue_text(1, POS_CENTRED, gDialogOptionYOffset, text, 1, 4); gDialogOptionYOffset = (s8)(gDialogOptionYOffset + yOffset); sDialogueOptionMax = (s8)(sDialogueOptionMax + 1); } @@ -6071,7 +6071,7 @@ s32 taj_menu_loop(void) { switch (sCurrentMenuID) { case 2: case 0x62: - render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[40], 1, 4); // VEHICLE SELECT + render_dialogue_text(1, POS_CENTRED, 6, gMenuText[40], 1, 4); // VEHICLE SELECT gDialogOptionYOffset = 30; render_dialogue_option(gMenuText[41], 20, 0); // CAR render_dialogue_option(gMenuText[42], 20, 1); // HOVERCRAFT @@ -6080,7 +6080,7 @@ s32 taj_menu_loop(void) { break; case 3: case 0x63: - render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[45], 1, 4); // CHALLENGE SELECT + render_dialogue_text(1, POS_CENTRED, 6, gMenuText[45], 1, 4); // CHALLENGE SELECT gDialogOptionYOffset = 30; if (settings->tajFlags & TAJ_FLAGS_CAR_CHAL_UNLOCKED) { gDialogOptionTangible = settings->tajFlags & TAJ_FLAGS_CAR_CHAL_COMPLETED; @@ -6106,7 +6106,7 @@ s32 taj_menu_loop(void) { break; case 1: D_800DF4DC = 0; - render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[36], 1, 4); // OPTIONS + render_dialogue_text(1, POS_CENTRED, 6, gMenuText[36], 1, 4); // OPTIONS gDialogOptionYOffset = 30; render_dialogue_option(gMenuText[37], 0x14, 0); // CHANGE VEHICLE if (settings->tajFlags & TAJ_FLAGS_UNLOCKED_A_CHALLENGE) { @@ -6226,8 +6226,8 @@ s32 func_8009D9F4(void) { playerInput = get_buttons_pressed_from_player(0); sDialogueOptionMax = 0; D_800DF4DC = 0; - render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[49], 1, 4); // BETTER LUCK - render_dialogue_text(1, POS_X_CENTRED, 20, gMenuText[50], 1, 4); // NEXT TIME! + render_dialogue_text(1, POS_CENTRED, 6, gMenuText[49], 1, 4); // BETTER LUCK + render_dialogue_text(1, POS_CENTRED, 20, gMenuText[50], 1, 4); // NEXT TIME! gDialogOptionYOffset = 50; render_dialogue_option(gMenuText[23], 20, 0); // TRY AGAIN render_dialogue_option(gMenuText[51], 20, 1); // EXIT @@ -6284,7 +6284,7 @@ s32 tt_menu_loop(void) { switch (sCurrentMenuID) { case TT_MENU_ROOT: case TT_MENU_EXIT: - render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[36], 1, 4); // OPTIONS + render_dialogue_text(1, POS_CENTRED, 6, gMenuText[36], 1, 4); // OPTIONS render_dialogue_option(gMenuText[71], 0x14, 3); // STATUS if (!is_in_two_player_adventure()) { if (is_time_trial_enabled()) { @@ -6354,7 +6354,7 @@ s32 tt_menu_loop(void) { sp38 -= sp24 * 8; sp24 = 0; while (D_801263A4[sp24] != NULL) { - render_dialogue_text(1, POS_X_CENTRED, sp38, D_801263A4[sp24], 1, 4); + render_dialogue_text(1, POS_CENTRED, sp38, D_801263A4[sp24], 1, 4); sp38 += 0x10; sp24++; } @@ -6374,7 +6374,7 @@ s32 tt_menu_loop(void) { case TT_MENU_INTRODUCTION: sp20 = 6; for (i = 52; gMenuText[i] != NULL; i++) { - render_dialogue_text(1, POS_X_CENTRED, sp20, gMenuText[i], 1, 4); + render_dialogue_text(1, POS_CENTRED, sp20, gMenuText[i], 1, 4); sp20 += 0x10; } if (buttonsPressed & (A_BUTTON | B_BUTTON)) { @@ -6383,9 +6383,9 @@ s32 tt_menu_loop(void) { } break; case TT_MENU_INSERT_CONT_PAK: - render_dialogue_text(1, POS_X_CENTRED, 34, gMenuText[159], 1, 4); // If you wish to use - render_dialogue_text(1, POS_X_CENTRED, 50, gMenuText[160], 1, 4); // the Controller Pak - render_dialogue_text(1, POS_X_CENTRED, 66, gMenuText[162], 1, 4); // insert it now! + render_dialogue_text(1, POS_CENTRED, 34, gMenuText[159], 1, 4); // If you wish to use + render_dialogue_text(1, POS_CENTRED, 50, gMenuText[160], 1, 4); // the Controller Pak + render_dialogue_text(1, POS_CENTRED, 66, gMenuText[162], 1, 4); // insert it now! if (buttonsPressed & (A_BUTTON | START_BUTTON)) { func_80001D04(0xEF, 0); D_80126398 = 0; @@ -6397,15 +6397,15 @@ s32 tt_menu_loop(void) { } break; case TT_MENU_INSERT_RUMBLE_PAK: - render_dialogue_text(1, POS_X_CENTRED, 34, gMenuText[159], 1, 4); // If you wish to use - render_dialogue_text(1, POS_X_CENTRED, 50, gMenuText[161], 1, 4); // the Rumble Pak - render_dialogue_text(1, POS_X_CENTRED, 66, gMenuText[162], 1, 4); // insert it now! + render_dialogue_text(1, POS_CENTRED, 34, gMenuText[159], 1, 4); // If you wish to use + render_dialogue_text(1, POS_CENTRED, 50, gMenuText[161], 1, 4); // the Rumble Pak + render_dialogue_text(1, POS_CENTRED, 66, gMenuText[162], 1, 4); // insert it now! if (buttonsPressed & (A_BUTTON | B_BUTTON | START_BUTTON)) { sCurrentMenuID = TT_MENU_ROOT; } break; case TT_MENU_SAVE_GHOST: - render_dialogue_text(1, POS_X_CENTRED, 50, gMenuText[124], 1, 4); // PLEASE WAIT + render_dialogue_text(1, POS_CENTRED, 50, gMenuText[124], 1, 4); // PLEASE WAIT D_80126398++; if (D_80126398 >= 5) { s32 result = func_8001B738(0) & 0xFF; @@ -6446,7 +6446,7 @@ s32 tt_menu_loop(void) { if ((sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_1) || (sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_2) || (sCurrentMenuID == TT_MENU_CONT_PAK_ERROR_3)) { - render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[64], 1, 4); // PAK ERROR + render_dialogue_text(1, POS_CENTRED, 6, gMenuText[64], 1, 4); // PAK ERROR } return currentOption; @@ -6465,7 +6465,7 @@ s32 trophy_race_cabinet_menu_loop(void) { set_dialogue_font(1, FONT_COLOURFUL); currentOption = 0; buttonsPressed = get_buttons_pressed_from_player(0); - render_dialogue_text(1, POS_X_CENTRED, 6, gMenuText[70], 1, 4); // TROPHY RACE + render_dialogue_text(1, POS_CENTRED, 6, gMenuText[70], 1, 4); // TROPHY RACE if (gControllersYAxisDirection[0] < 0) { sDialogueOption++; } else if (gControllersYAxisDirection[0] > 0) { @@ -6478,9 +6478,9 @@ s32 trophy_race_cabinet_menu_loop(void) { sDialogueOption = 1; } set_option_text_colour(sDialogueOption == 0); - render_dialogue_text(1, POS_X_CENTRED, 30, gMenuText[180], 1, 4); // ENTER TROPHY RACE + render_dialogue_text(1, POS_CENTRED, 30, gMenuText[180], 1, 4); // ENTER TROPHY RACE set_option_text_colour(sDialogueOption == 1); - render_dialogue_text(1, POS_X_CENTRED, 50, gMenuText[51], 1, 4); // EXIT + render_dialogue_text(1, POS_CENTRED, 50, gMenuText[51], 1, 4); // EXIT if (buttonsPressed & A_BUTTON) { currentOption = sDialogueOption + 1; } diff --git a/src/menu.h b/src/menu.h index 1e38c0a4..f011f43e 100644 --- a/src/menu.h +++ b/src/menu.h @@ -665,7 +665,7 @@ s32 menu_loop(Gfx **arg0, s32 **arg1, s32 **arg2, s32 **arg3, s32 arg4); void func_80081800(s32 arg0, s32 arg1, s32 arg2, u8 arg3, u8 arg4, u8 arg5, u8 arg6); void func_80081E54(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5); void func_800828B8(void); -void func_800829F8(Gfx *dl, s32 mulFactor); +void func_800829F8(Gfx *dl, s32 updateRate); void menu_logos_screen_init(void); s32 menu_logo_screen_loop(s32 arg0); void func_80082FAC(void); diff --git a/src/thread0_epc.c b/src/thread0_epc.c index a934fdd0..17fc5dc4 100644 --- a/src/thread0_epc.c +++ b/src/thread0_epc.c @@ -241,8 +241,8 @@ s32 func_800B76DC(void) { } } -void func_800B77D4(s32 mulFactor) { - D_800E3028 += mulFactor; +void func_800B77D4(s32 updateRate) { + D_800E3028 += updateRate; if (D_800E3028 >= 0x3D) { D_800E3028 = 0; D_800E3024++; diff --git a/src/unknown_06B2B0.c b/src/unknown_06B2B0.c index 93f3ede6..78a258c3 100644 --- a/src/unknown_06B2B0.c +++ b/src/unknown_06B2B0.c @@ -101,7 +101,7 @@ s8 D_800DD3F0 = 0; FadeTransition D_800DD3F4 = FADE_TRANSITION(128, FADE_COLOR_BLACK, 20, 0); // Unused? FadeTransition D_800DD3FC = FADE_TRANSITION(0, FADE_COLOR_WHITE, 20, -1); -s32 sLogicMulFactor = 12; +s32 sLogicUpdateRate = LOGIC_5FPS; FadeTransition D_800DD408 = FADE_TRANSITION(0, FADE_COLOR_WHITE, 30, -1); // Unused? char *D_800DD410[3] = { @@ -786,7 +786,7 @@ void thread3_main(s32 arg0) { D_80123520 = 0; sRenderContext = DRAW_INTRO; while (1) { - if (check_reset_pressed() != 0) { + if (is_reset_pressed()) { func_80072708(); audioStopThread(); stop_thread30(); @@ -862,7 +862,7 @@ void func_8006C3E0(void) { void render(void) { s32 phi_v0; s32 phi_v0_2; - s32 tempLogicMulFactor, tempLogicMulFactorMax; + s32 tempLogicUpdateRate, tempLogicUpdateRateMax; osSetTime(0); @@ -894,7 +894,7 @@ void render(void) { init_rsp(&gCurrDisplayList); init_rdp_and_framebuffer(&gCurrDisplayList); render_background(&gCurrDisplayList, &gCurrHudMat, 1); - D_800DD37C = func_8006A1C4(D_800DD37C, sLogicMulFactor); + D_800DD37C = func_8006A1C4(D_800DD37C, sLogicUpdateRate); if (func_800B76DC() != 0) { render_epc_lock_up_display(); sRenderContext = DRAW_CRASH_SCREEN; @@ -914,29 +914,29 @@ void render(void) { func_8006F43C(); break; case DRAW_MENU: // In a menu - func_8006DCF8(sLogicMulFactor); + func_8006DCF8(sLogicUpdateRate); break; case DRAW_GAME: // In game (Controlling a character) - func_8006CCF0(sLogicMulFactor); + func_8006CCF0(sLogicUpdateRate); break; case DRAW_CRASH_SCREEN: // EPC (lockup display) - func_800B77D4(sLogicMulFactor); + func_800B77D4(sLogicUpdateRate); break; } // This is a good spot to place custom text if you want it to overlay it over ALL the // menus & gameplay. - func_80000D00((u8)sLogicMulFactor); + func_80000D00((u8)sLogicUpdateRate); func_800B5F78(&gCurrDisplayList); func_800C56FC(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); close_dialogue_box(4); func_800C5494(4); - if (func_800C0494(sLogicMulFactor) != 0) { + if (func_800C0494(sLogicUpdateRate) != 0) { render_fade_transition(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts); } if ((D_80123520 >= 8) && (func_8006F4C8() != 0)) { - func_800829F8(&gCurrDisplayList, sLogicMulFactor); + func_800829F8(&gCurrDisplayList, sLogicUpdateRate); } gDPFullSync(gCurrDisplayList++); @@ -962,15 +962,15 @@ void render(void) { } func_80070B04(gVideoLastFramebuffer, gVideoCurrFramebuffer, gVideoCurrFramebuffer + phi_v0_2); } - // tempLogicMulFactor will be set to a value 2 or higher, based on the framerate. + // tempLogicUpdateRate will be set to a value 2 or higher, based on the framerate. // the mul factor is hardcapped at 6, which happens at 10FPS. The mul factor // affects frameskipping, to maintain consistent game speed, through the (many) // dropped frames in DKR. - tempLogicMulFactor = func_8007A98C(D_800DD380); - sLogicMulFactor = tempLogicMulFactor; - tempLogicMulFactorMax = 6; - if (tempLogicMulFactor > tempLogicMulFactorMax) { - sLogicMulFactor = tempLogicMulFactorMax; + tempLogicUpdateRate = func_8007A98C(D_800DD380); + sLogicUpdateRate = tempLogicUpdateRate; + tempLogicUpdateRateMax = LOGIC_10FPS; + if (tempLogicUpdateRate > tempLogicUpdateRateMax) { + sLogicUpdateRate = tempLogicUpdateRateMax; } } @@ -985,7 +985,7 @@ void func_8006CAE4(s32 arg0, s32 arg1, s32 arg2) { } /** - * Calls load_level() with the same arguments except for the cutsceneId, + * Calls load_level() with the same arguments except for the cutsceneId, * which is the value at D_80123508. Also does some other stuff. * Needs a better name! */ @@ -1024,7 +1024,7 @@ void func_8006CC14(void) { #ifdef NON_MATCHING // Almost matching except for a couple minor issues. -void func_8006CCF0(s32 mulFactor) { +void func_8006CCF0(s32 updateRate) { s32 i, buttonHeldInputs, sp40, sp3C, buttonPressedInputs, phi_v1_2; sp40 = 0; @@ -1039,7 +1039,7 @@ void func_8006CCF0(s32 mulFactor) { buttonPressedInputs |= START_BUTTON; } if (!gIsPaused) { - func_80010994(mulFactor); + func_80010994(updateRate); if (func_80066510() == 0 || func_8001139C()) { if ((buttonPressedInputs & START_BUTTON) && (func_8006C2F0() == 0) && (D_800DD390 == 0) && (sRenderContext == DRAW_GAME) && (D_80123516 == 0) && (D_800DD394 == 0) && (D_800DD398 == 0)) { @@ -1051,7 +1051,7 @@ void func_8006CCF0(s32 mulFactor) { } else { func_80028FA0(1); } - D_800DD398 -= mulFactor; + D_800DD398 -= updateRate; if (D_800DD398 < 0) { D_800DD398 = 0; } @@ -1060,13 +1060,13 @@ void func_8006CCF0(s32 mulFactor) { } gParticlePtrList_flush(); func_8001BF20(); - func_80024D54(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, mulFactor); + func_80024D54(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, updateRate); if (sRenderContext == DRAW_GAME) { // Ignore the user's L/R/Z buttons. buttonHeldInputs &= ~(L_TRIG | R_TRIG | Z_TRIG); } if (D_80123516 != 0) { - i = func_80095728(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, mulFactor); + i = func_80095728(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, updateRate); switch (i - 1) { case 1: buttonHeldInputs |= (L_TRIG | Z_TRIG); @@ -1111,7 +1111,7 @@ void func_8006CCF0(s32 mulFactor) { break; } } - func_800C3440(mulFactor); + func_800C3440(updateRate); i = func_800C3400(); if (i != 0) { if (i == 2) { @@ -1123,7 +1123,7 @@ void func_8006CCF0(s32 mulFactor) { } } if (gIsPaused) { - i = func_80094170(&gCurrDisplayList, mulFactor); + i = func_80094170(&gCurrDisplayList, updateRate); switch (i - 1) { case 0: gIsPaused = FALSE; @@ -1172,7 +1172,7 @@ void func_8006CCF0(s32 mulFactor) { } init_rdp_and_framebuffer(&gCurrDisplayList); render_borders_for_multiplayer(&gCurrDisplayList); - func_800A8474(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, mulFactor); + func_800A8474(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, updateRate); func_80077268(&gCurrDisplayList); if (D_800DD39C != 0) { if (func_800214C4() != 0) { @@ -1184,7 +1184,7 @@ void func_8006CCF0(s32 mulFactor) { } phi_v1_2 = FALSE; if (D_800DD390 != 0) { - D_800DD390 -= mulFactor; + D_800DD390 -= updateRate; if (D_800DD390 <= 0) { D_800DD390 = 0; func_8006C1AC(0, 0, 0, 0); @@ -1193,7 +1193,7 @@ void func_8006CCF0(s32 mulFactor) { } } if (D_800DD394 > 0) { - D_800DD394 -= mulFactor; + D_800DD394 -= updateRate; if (D_800DD394 <= 0) { buttonHeldInputs = L_TRIG; switch (D_80123524) { @@ -1492,15 +1492,15 @@ void func_8006DC58(s32 arg0) { #ifdef NON_MATCHING // Minor & regalloc issues. -void func_8006DCF8(s32 mulFactor) { +void func_8006DCF8(s32 updateRate) { s32 menuLoopResult, temp, temp2, tempResult; gIsPaused = FALSE; D_80123516 = 0; if (!D_80123514 && D_801234F0) { - func_8006DC58(mulFactor); + func_8006DC58(updateRate); } - menuLoopResult = menu_loop(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, mulFactor); + menuLoopResult = menu_loop(&gCurrDisplayList, &gCurrHudMat, &gCurrHudVerts, &gCurrHudTris, updateRate); D_801234F0 = TRUE; if (menuLoopResult == -2) { D_801234F0 = FALSE; @@ -1772,7 +1772,7 @@ s8 func_8006EAB0(void) { return D_80123516; } -s32 check_reset_pressed(void) { +s32 is_reset_pressed(void) { if (D_80123560[0] == 0) { D_80123560[0] = (s32)((osRecvMesg(&gNMIMesgQueue, NULL, 0) + 1) != 0); } diff --git a/src/unknown_06B2B0.h b/src/unknown_06B2B0.h index 2f74a406..87e64eea 100644 --- a/src/unknown_06B2B0.h +++ b/src/unknown_06B2B0.h @@ -157,7 +157,7 @@ void func_8006EA58(void); Settings *get_settings(void); s8 is_game_paused(void); s8 func_8006EAB0(void); -s32 check_reset_pressed(void); +s32 is_reset_pressed(void); s32 func_8006EB14(void); void func_8006EB24(void); void func_8006EB40(void); diff --git a/src/video.c b/src/video.c index 5f1c7f1d..eb1f3ae9 100644 --- a/src/video.c +++ b/src/video.c @@ -233,9 +233,9 @@ void func_8007A974(void) { #ifdef NON_MATCHING // regalloc & stack issues s32 func_8007A98C(s32 arg0) { - s32 tempMulFactor; + s32 tempUpdateRate; - tempMulFactor = 1; + tempUpdateRate = LOGIC_60FPS; if (D_801262D0 != 0) { D_801262D0--; if (D_801262D0 == 0) { @@ -246,32 +246,32 @@ s32 func_8007A98C(s32 arg0) { swap_framebuffers(); } while (osRecvMesg(&D_801261A0, NULL, 0) != -1) { - s0 += 1; - s0 &= 0xFF; + tempUpdateRate += 1; + tempUpdateRate &= 0xFF; } - if (tempMulFactor < D_80126309) { + if (tempUpdateRate < D_80126309) { if (D_80126308 < 0x14) { D_80126308++; } if (D_80126308 == 0x14) { - D_80126309 = tempMulFactor; + D_80126309 = tempUpdateRate; D_80126308 = 0; } } else { D_80126308 = 0; - if ((D_80126309 >= tempMulFactor) || (D_801262E4 > tempMulFactor)) { - D_80126309 = tempMulFactor; + if ((D_80126309 >= tempUpdateRate) || (D_801262E4 > tempUpdateRate)) { + D_80126309 = tempUpdateRate; } } - while (tempMulFactor < D_80126309) { + while (tempUpdateRate < D_80126309) { osRecvMesg(&D_801261A0, NULL, 1); - tempMulFactor += 1; - tempMulFactor &= 0xFF; + tempUpdateRate += 1; + tempUpdateRate &= 0xFF; } osViSwapBuffer(gVideoLastFramebuffer); osRecvMesg(&D_801261A0, NULL, 1); - return tempMulFactor; + return tempUpdateRate; } #else GLOBAL_ASM("asm/non_matchings/video/func_8007A98C.s") diff --git a/src/video.h b/src/video.h index 6c810e53..c8e47d98 100644 --- a/src/video.h +++ b/src/video.h @@ -32,6 +32,21 @@ #define HEIGHT_RATIO_NTSC (LOW_RES_NTSC_HEIGHT / LOW_RES_NTSC_HEIGHT) #define HEIGHT_RATIO_MPAL (LOW_RES_MPAL_HEIGHT / LOW_RES_NTSC_HEIGHT) +/** + * Values for the rate game logic will work depending on the framerate. Vanilla DKR will default to LOGIC_30FPS (2) + */ + +enum LogicUpdateRates { + LOGIC_NULL, + LOGIC_60FPS, + LOGIC_30FPS, + LOGIC_20FPS, + LOGIC_15FPS, + LOGIC_12FPS, + LOGIC_10FPS, + LOGIC_5FPS = 12, +}; + extern s32 gVideoRefreshRate; extern u16 *gVideoDepthBuffer;