From a87c8984d8c094748ce098bec12e0e4dd587e5d8 Mon Sep 17 00:00:00 2001 From: MegaMech Date: Sun, 22 Sep 2024 21:45:20 -0600 Subject: [PATCH] buffer vars --- .../code_80091750/add_8018D9E0_entry.s | 56 ++-- .../code_80091750/func_80099184.s | 12 +- .../code_80091750/func_80099394.s | 8 +- .../code_80091750/func_8009952C.s | 12 +- .../code_80091750/func_800996BC.s | 20 +- .../code_80091750/func_80099AEC.s | 16 +- .../code_80091750/func_80099EC4.s | 4 +- .../code_80091750/func_8009F5E0.s | 2 +- .../code_80091750/func_800A1FB0.s | 12 +- .../code_80091750/func_800AC458.s | 12 +- asm/non_matchings/save/func_800B68F4.s | 4 +- src/code_8006E9C0.c | 4 +- src/code_80091750.c | 276 +++++++++--------- src/code_80091750.h | 32 +- src/menus.c | 4 +- src/save.c | 10 +- 16 files changed, 242 insertions(+), 242 deletions(-) diff --git a/asm/non_matchings/code_80091750/add_8018D9E0_entry.s b/asm/non_matchings/code_80091750/add_8018D9E0_entry.s index 320fcb299..19a3eadc8 100644 --- a/asm/non_matchings/code_80091750/add_8018D9E0_entry.s +++ b/asm/non_matchings/code_80091750/add_8018D9E0_entry.s @@ -89,11 +89,11 @@ glabel add_ui_element /* 09F254 8009E654 AFBF001C */ sw $ra, 0x1c($sp) /* 09F258 8009E658 AFA7008C */ sw $a3, 0x8c($sp) /* 09F25C 8009E65C 00077600 */ sll $t6, $a3, 0x18 -/* 09F260 8009E660 3C1F8019 */ lui $ra, %hi(D_8018D9E0) # $ra, 0x8019 +/* 09F260 8009E660 3C1F8019 */ lui $ra, %hi(gMenuItems) # $ra, 0x8019 /* 09F264 8009E664 000E3E03 */ sra $a3, $t6, 0x18 /* 09F268 8009E668 AFA40080 */ sw $a0, 0x80($sp) /* 09F26C 8009E66C 00001025 */ move $v0, $zero -/* 09F270 8009E670 27FFD9E0 */ addiu $ra, %lo(D_8018D9E0) # addiu $ra, $ra, -0x2620 +/* 09F270 8009E670 27FFD9E0 */ addiu $ra, %lo(gMenuItems) # addiu $ra, $ra, -0x2620 .L8009E674: /* 09F274 8009E674 8FF80000 */ lw $t8, ($ra) /* 09F278 8009E678 24420001 */ addiu $v0, $v0, 1 @@ -246,16 +246,16 @@ glabel L8009E888 /* 09F4A0 8009E8A0 0C026E55 */ jal func_8009B954 /* 09F4A4 8009E8A4 248414C8 */ addiu $a0, %lo(D_020014C8) # addiu $a0, $a0, 0x14c8 /* 09F4A8 8009E8A8 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F4AC 8009E8AC 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F4B0 8009E8B0 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F4AC 8009E8AC 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F4B0 8009E8B0 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F4B4 8009E8B4 3C050200 */ lui $a1, %hi(D_020014C8) # $a1, 0x200 /* 09F4B8 8009E8B8 8FE6000C */ lw $a2, 0xc($ra) /* 09F4BC 8009E8BC 8FE70010 */ lw $a3, 0x10($ra) /* 09F4C0 8009E8C0 24A514C8 */ addiu $a1, %lo(D_020014C8) # addiu $a1, $a1, 0x14c8 /* 09F4C4 8009E8C4 0C026E9D */ jal func_8009BA74 /* 09F4C8 8009E8C8 8D040000 */ lw $a0, ($t0) -/* 09F4CC 8009E8CC 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F4D0 8009E8D0 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F4CC 8009E8CC 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F4D0 8009E8D0 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F4D4 8009E8D4 0C026E66 */ jal func_8009B998 /* 09F4D8 8009E8D8 AD020000 */ sw $v0, ($t0) /* 09F4DC 8009E8DC 1000033D */ b .L8009F5D4 @@ -270,16 +270,16 @@ glabel L8009E8E4 /* 09F4FC 8009E8FC 0C026E55 */ jal func_8009B954 /* 09F500 8009E900 24841540 */ addiu $a0, %lo(D_02001540) # addiu $a0, $a0, 0x1540 /* 09F504 8009E904 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F508 8009E908 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F50C 8009E90C 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F508 8009E908 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F50C 8009E90C 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F510 8009E910 3C050200 */ lui $a1, %hi(D_02001540) # $a1, 0x200 /* 09F514 8009E914 8FE6000C */ lw $a2, 0xc($ra) /* 09F518 8009E918 8FE70010 */ lw $a3, 0x10($ra) /* 09F51C 8009E91C 24A51540 */ addiu $a1, %lo(D_02001540) # addiu $a1, $a1, 0x1540 /* 09F520 8009E920 0C026E9D */ jal func_8009BA74 /* 09F524 8009E924 8D040000 */ lw $a0, ($t0) -/* 09F528 8009E928 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F52C 8009E92C 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F528 8009E928 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F52C 8009E92C 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F530 8009E930 0C026E66 */ jal func_8009B998 /* 09F534 8009E934 AD020000 */ sw $v0, ($t0) /* 09F538 8009E938 10000326 */ b .L8009F5D4 @@ -322,16 +322,16 @@ glabel L8009E9AC /* 09F5C0 8009E9C0 0C026E55 */ jal func_8009B954 /* 09F5C4 8009E9C4 248415A4 */ addiu $a0, %lo(D_020015A4) # addiu $a0, $a0, 0x15a4 /* 09F5C8 8009E9C8 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F5CC 8009E9CC 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F5D0 8009E9D0 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F5CC 8009E9CC 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F5D0 8009E9D0 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F5D4 8009E9D4 3C050200 */ lui $a1, %hi(D_020015A4) # $a1, 0x200 /* 09F5D8 8009E9D8 8FE6000C */ lw $a2, 0xc($ra) /* 09F5DC 8009E9DC 8FE70010 */ lw $a3, 0x10($ra) /* 09F5E0 8009E9E0 24A515A4 */ addiu $a1, %lo(D_020015A4) # addiu $a1, $a1, 0x15a4 /* 09F5E4 8009E9E4 0C026E9D */ jal func_8009BA74 /* 09F5E8 8009E9E8 8D040000 */ lw $a0, ($t0) -/* 09F5EC 8009E9EC 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F5F0 8009E9F0 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F5EC 8009E9EC 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F5F0 8009E9F0 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F5F4 8009E9F4 AD020000 */ sw $v0, ($t0) /* 09F5F8 8009E9F8 244F0008 */ addiu $t7, $v0, 8 /* 09F5FC 8009E9FC AD0F0000 */ sw $t7, ($t0) @@ -343,8 +343,8 @@ glabel L8009E9AC /* 09F614 8009EA14 AFA2006C */ sw $v0, 0x6c($sp) /* 09F618 8009EA18 8FB9006C */ lw $t9, 0x6c($sp) /* 09F61C 8009EA1C 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F620 8009EA20 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F624 8009EA24 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F620 8009EA20 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F624 8009EA24 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F628 8009EA28 AF220004 */ sw $v0, 4($t9) /* 09F62C 8009EA2C 8D030000 */ lw $v1, ($t0) /* 09F630 8009EA30 3C180708 */ lui $t8, (0x07080200 >> 16) # lui $t8, 0x708 @@ -425,16 +425,16 @@ glabel L8009E9AC /* 09F75C 8009EB5C 0C026E55 */ jal func_8009B954 /* 09F760 8009EB60 248415CC */ addiu $a0, %lo(D_020015CC) # addiu $a0, $a0, 0x15cc /* 09F764 8009EB64 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F768 8009EB68 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F76C 8009EB6C 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F768 8009EB68 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F76C 8009EB6C 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F770 8009EB70 3C050200 */ lui $a1, %hi(D_020015CC) # $a1, 0x200 /* 09F774 8009EB74 8FE6000C */ lw $a2, 0xc($ra) /* 09F778 8009EB78 8FE70010 */ lw $a3, 0x10($ra) /* 09F77C 8009EB7C 24A515CC */ addiu $a1, %lo(D_020015CC) # addiu $a1, $a1, 0x15cc /* 09F780 8009EB80 0C026E9D */ jal func_8009BA74 /* 09F784 8009EB84 8D040000 */ lw $a0, ($t0) -/* 09F788 8009EB88 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F78C 8009EB8C 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F788 8009EB88 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F78C 8009EB8C 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F790 8009EB90 0C026E66 */ jal func_8009B998 /* 09F794 8009EB94 AD020000 */ sw $v0, ($t0) /* 09F798 8009EB98 3C040200 */ lui $a0, %hi(D_02001630) # $a0, 0x200 @@ -444,16 +444,16 @@ glabel L8009E9AC /* 09F7A8 8009EBA8 0C026E55 */ jal func_8009B954 /* 09F7AC 8009EBAC 24841630 */ addiu $a0, %lo(D_02001630) # addiu $a0, $a0, 0x1630 /* 09F7B0 8009EBB0 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F7B4 8009EBB4 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F7B8 8009EBB8 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F7B4 8009EBB4 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F7B8 8009EBB8 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F7BC 8009EBBC 3C050200 */ lui $a1, %hi(D_02001630) # $a1, 0x200 /* 09F7C0 8009EBC0 8FE6000C */ lw $a2, 0xc($ra) /* 09F7C4 8009EBC4 8FE70010 */ lw $a3, 0x10($ra) /* 09F7C8 8009EBC8 24A51630 */ addiu $a1, %lo(D_02001630) # addiu $a1, $a1, 0x1630 /* 09F7CC 8009EBCC 0C026E9D */ jal func_8009BA74 /* 09F7D0 8009EBD0 8D040000 */ lw $a0, ($t0) -/* 09F7D4 8009EBD4 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F7D8 8009EBD8 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F7D4 8009EBD4 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F7D8 8009EBD8 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F7DC 8009EBDC 0C026E66 */ jal func_8009B998 /* 09F7E0 8009EBE0 AD020000 */ sw $v0, ($t0) /* 09F7E4 8009EBE4 3C040200 */ lui $a0, %hi(D_02001658) # $a0, 0x200 @@ -463,16 +463,16 @@ glabel L8009E9AC /* 09F7F4 8009EBF4 0C026E55 */ jal func_8009B954 /* 09F7F8 8009EBF8 24841658 */ addiu $a0, %lo(D_02001658) # addiu $a0, $a0, 0x1658 /* 09F7FC 8009EBFC 8FBF007C */ lw $ra, 0x7c($sp) -/* 09F800 8009EC00 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F804 8009EC04 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F800 8009EC00 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F804 8009EC04 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F808 8009EC08 3C050200 */ lui $a1, %hi(D_02001658) # $a1, 0x200 /* 09F80C 8009EC0C 8FE6000C */ lw $a2, 0xc($ra) /* 09F810 8009EC10 8FE70010 */ lw $a3, 0x10($ra) /* 09F814 8009EC14 24A51658 */ addiu $a1, %lo(D_02001658) # addiu $a1, $a1, 0x1658 /* 09F818 8009EC18 0C026E9D */ jal func_8009BA74 /* 09F81C 8009EC1C 8D040000 */ lw $a0, ($t0) -/* 09F820 8009EC20 3C088019 */ lui $t0, %hi(D_8018E75C) # $t0, 0x8019 -/* 09F824 8009EC24 2508E75C */ addiu $t0, %lo(D_8018E75C) # addiu $t0, $t0, -0x18a4 +/* 09F820 8009EC20 3C088019 */ lui $t0, %hi(sGfxPtr) # $t0, 0x8019 +/* 09F824 8009EC24 2508E75C */ addiu $t0, %lo(sGfxPtr) # addiu $t0, $t0, -0x18a4 /* 09F828 8009EC28 0C026E66 */ jal func_8009B998 /* 09F82C 8009EC2C AD020000 */ sw $v0, ($t0) /* 09F830 8009EC30 10000268 */ b .L8009F5D4 diff --git a/asm/non_matchings/code_80091750/func_80099184.s b/asm/non_matchings/code_80091750/func_80099184.s index 2c09fe763..25d5200bc 100644 --- a/asm/non_matchings/code_80091750/func_80099184.s +++ b/asm/non_matchings/code_80091750/func_80099184.s @@ -13,16 +13,16 @@ glabel load_menu_img /* 099DB0 800991B0 00408825 */ move $s1, $v0 /* 099DB4 800991B4 24160003 */ li $s6, 3 /* 099DB8 800991B8 11C0006C */ beqz $t6, .L8009936C -/* 099DBC 800991BC 3C158019 */ lui $s5, %hi(D_8018D9B0) # $s5, 0x8019 -/* 099DC0 800991C0 3C148019 */ lui $s4, %hi(D_8018D9B4) # $s4, 0x8019 +/* 099DBC 800991BC 3C158019 */ lui $s5, %hi(gMenuTextureBuffer) # $s5, 0x8019 +/* 099DC0 800991C0 3C148019 */ lui $s4, %hi(gMenuCompressedBuffer) # $s4, 0x8019 /* 099DC4 800991C4 3C138019 */ lui $s3, %hi(gNumD_8018E118Entries) # $s3, 0x8019 /* 099DC8 800991C8 3C128019 */ lui $s2, %hi(gMenuTextureBufferIndex) # $s2, 0x8019 -/* 099DCC 800991CC 3C108019 */ lui $s0, %hi(D_8018E118) # $s0, 0x8019 -/* 099DD0 800991D0 2610E118 */ addiu $s0, %lo(D_8018E118) # addiu $s0, $s0, -0x1ee8 +/* 099DCC 800991CC 3C108019 */ lui $s0, %hi(sMenuTextureMap) # $s0, 0x8019 +/* 099DD0 800991D0 2610E118 */ addiu $s0, %lo(sMenuTextureMap) # addiu $s0, $s0, -0x1ee8 /* 099DD4 800991D4 2652E110 */ addiu $s2, %lo(gMenuTextureBufferIndex) # addiu $s2, $s2, -0x1ef0 /* 099DD8 800991D8 2673E758 */ addiu $s3, %lo(gNumD_8018E118Entries) # addiu $s3, $s3, -0x18a8 -/* 099DDC 800991DC 2694D9B4 */ addiu $s4, %lo(D_8018D9B4) # addiu $s4, $s4, -0x264c -/* 099DE0 800991E0 26B5D9B0 */ addiu $s5, %lo(D_8018D9B0) # addiu $s5, $s5, -0x2650 +/* 099DDC 800991DC 2694D9B4 */ addiu $s4, %lo(gMenuCompressedBuffer) # addiu $s4, $s4, -0x264c +/* 099DE0 800991E0 26B5D9B0 */ addiu $s5, %lo(gMenuTextureBuffer) # addiu $s5, $s5, -0x2650 /* 099DE4 800991E4 8E630000 */ lw $v1, ($s3) .L800991E8: /* 099DE8 800991E8 00002825 */ move $a1, $zero diff --git a/asm/non_matchings/code_80091750/func_80099394.s b/asm/non_matchings/code_80091750/func_80099394.s index 85febe6cc..e83c860da 100644 --- a/asm/non_matchings/code_80091750/func_80099394.s +++ b/asm/non_matchings/code_80091750/func_80099394.s @@ -10,14 +10,14 @@ glabel func_80099394 /* 099FB4 800993B4 0C026449 */ jal segmented_to_virtual_dupe /* 099FB8 800993B8 AFB00018 */ sw $s0, 0x18($sp) /* 099FBC 800993BC 8C4E0004 */ lw $t6, 4($v0) -/* 099FC0 800993C0 3C168019 */ lui $s6, %hi(D_8018D9B0) # $s6, 0x8019 +/* 099FC0 800993C0 3C168019 */ lui $s6, %hi(gMenuTextureBuffer) # $s6, 0x8019 /* 099FC4 800993C4 00409025 */ move $s2, $v0 /* 099FC8 800993C8 11C0004E */ beqz $t6, .L80099504 -/* 099FCC 800993CC 26D6D9B0 */ addiu $s6, %lo(D_8018D9B0) # addiu $s6, $s6, -0x2650 +/* 099FCC 800993CC 26D6D9B0 */ addiu $s6, %lo(gMenuTextureBuffer) # addiu $s6, $s6, -0x2650 /* 099FD0 800993D0 3C148019 */ lui $s4, %hi(gNumD_8018E118Entries) # $s4, 0x8019 /* 099FD4 800993D4 3C138019 */ lui $s3, %hi(gMenuTextureBufferIndex) # $s3, 0x8019 -/* 099FD8 800993D8 3C118019 */ lui $s1, %hi(D_8018E118) # $s1, 0x8019 -/* 099FDC 800993DC 2631E118 */ addiu $s1, %lo(D_8018E118) # addiu $s1, $s1, -0x1ee8 +/* 099FD8 800993D8 3C118019 */ lui $s1, %hi(sMenuTextureMap) # $s1, 0x8019 +/* 099FDC 800993DC 2631E118 */ addiu $s1, %lo(sMenuTextureMap) # addiu $s1, $s1, -0x1ee8 /* 099FE0 800993E0 2673E110 */ addiu $s3, %lo(gMenuTextureBufferIndex) # addiu $s3, $s3, -0x1ef0 /* 099FE4 800993E4 2694E758 */ addiu $s4, %lo(gNumD_8018E118Entries) # addiu $s4, $s4, -0x18a8 /* 099FE8 800993E8 24150005 */ li $s5, 5 diff --git a/asm/non_matchings/code_80091750/func_8009952C.s b/asm/non_matchings/code_80091750/func_8009952C.s index 57815908c..11108a0da 100644 --- a/asm/non_matchings/code_80091750/func_8009952C.s +++ b/asm/non_matchings/code_80091750/func_8009952C.s @@ -9,18 +9,18 @@ glabel func_8009952C /* 09A148 80099548 0C026449 */ jal segmented_to_virtual_dupe /* 09A14C 8009954C AFB00014 */ sw $s0, 0x14($sp) /* 09A150 80099550 8C4E0004 */ lw $t6, 4($v0) -/* 09A154 80099554 3C158019 */ lui $s5, %hi(D_8018D9B0) # $s5, 0x8019 +/* 09A154 80099554 3C158019 */ lui $s5, %hi(gMenuTextureBuffer) # $s5, 0x8019 /* 09A158 80099558 00408825 */ move $s1, $v0 /* 09A15C 8009955C 11C00046 */ beqz $t6, .L80099678 -/* 09A160 80099560 26B5D9B0 */ addiu $s5, %lo(D_8018D9B0) # addiu $s5, $s5, -0x2650 -/* 09A164 80099564 3C148019 */ lui $s4, %hi(D_8018D9B4) # $s4, 0x8019 +/* 09A160 80099560 26B5D9B0 */ addiu $s5, %lo(gMenuTextureBuffer) # addiu $s5, $s5, -0x2650 +/* 09A164 80099564 3C148019 */ lui $s4, %hi(gMenuCompressedBuffer) # $s4, 0x8019 /* 09A168 80099568 3C138019 */ lui $s3, %hi(gNumD_8018E118Entries) # $s3, 0x8019 /* 09A16C 8009956C 3C128019 */ lui $s2, %hi(gMenuTextureBufferIndex) # $s2, 0x8019 -/* 09A170 80099570 3C108019 */ lui $s0, %hi(D_8018E118) # $s0, 0x8019 -/* 09A174 80099574 2610E118 */ addiu $s0, %lo(D_8018E118) # addiu $s0, $s0, -0x1ee8 +/* 09A170 80099570 3C108019 */ lui $s0, %hi(sMenuTextureMap) # $s0, 0x8019 +/* 09A174 80099574 2610E118 */ addiu $s0, %lo(sMenuTextureMap) # addiu $s0, $s0, -0x1ee8 /* 09A178 80099578 2652E110 */ addiu $s2, %lo(gMenuTextureBufferIndex) # addiu $s2, $s2, -0x1ef0 /* 09A17C 8009957C 2673E758 */ addiu $s3, %lo(gNumD_8018E118Entries) # addiu $s3, $s3, -0x18a8 -/* 09A180 80099580 2694D9B4 */ addiu $s4, %lo(D_8018D9B4) # addiu $s4, $s4, -0x264c +/* 09A180 80099580 2694D9B4 */ addiu $s4, %lo(gMenuCompressedBuffer) # addiu $s4, $s4, -0x264c /* 09A184 80099584 8E630000 */ lw $v1, ($s3) .L80099588: /* 09A188 80099588 00002825 */ move $a1, $zero diff --git a/asm/non_matchings/code_80091750/func_800996BC.s b/asm/non_matchings/code_80091750/func_800996BC.s index a35f144e1..02d0734ed 100644 --- a/asm/non_matchings/code_80091750/func_800996BC.s +++ b/asm/non_matchings/code_80091750/func_800996BC.s @@ -17,14 +17,14 @@ glabel load_menu_img2 /* 09A2F8 800996F8 241E0002 */ li $fp, 2 /* 09A2FC 800996FC 11C0008A */ beqz $t6, .L80099928 /* 09A300 80099700 2417FFFF */ li $s7, -1 -/* 09A304 80099704 3C158019 */ lui $s5, %hi(D_8018D9B4) # $s5, 0x8019 +/* 09A304 80099704 3C158019 */ lui $s5, %hi(gMenuCompressedBuffer) # $s5, 0x8019 /* 09A308 80099708 3C148019 */ lui $s4, %hi(gNumD_8018E118Entries) # $s4, 0x8019 /* 09A30C 8009970C 3C138019 */ lui $s3, %hi(gMenuTextureBufferIndex) # $s3, 0x8019 -/* 09A310 80099710 3C118019 */ lui $s1, %hi(D_8018E118) # $s1, 0x8019 -/* 09A314 80099714 2631E118 */ addiu $s1, %lo(D_8018E118) # addiu $s1, $s1, -0x1ee8 +/* 09A310 80099710 3C118019 */ lui $s1, %hi(sMenuTextureMap) # $s1, 0x8019 +/* 09A314 80099714 2631E118 */ addiu $s1, %lo(sMenuTextureMap) # addiu $s1, $s1, -0x1ee8 /* 09A318 80099718 2673E110 */ addiu $s3, %lo(gMenuTextureBufferIndex) # addiu $s3, $s3, -0x1ef0 /* 09A31C 8009971C 2694E758 */ addiu $s4, %lo(gNumD_8018E118Entries) # addiu $s4, $s4, -0x18a8 -/* 09A320 80099720 26B5D9B4 */ addiu $s5, %lo(D_8018D9B4) # addiu $s5, $s5, -0x264c +/* 09A320 80099720 26B5D9B4 */ addiu $s5, %lo(gMenuCompressedBuffer) # addiu $s5, $s5, -0x264c /* 09A324 80099724 24160001 */ li $s6, 1 /* 09A328 80099728 8E830000 */ lw $v1, ($s4) .L8009972C: @@ -100,9 +100,9 @@ glabel load_menu_img2 /* 09A418 80099818 8EA60000 */ lw $a2, ($s5) .L8009981C: /* 09A41C 8009981C 1257000A */ beq $s2, $s7, .L80099848 -/* 09A420 80099820 3C0D8019 */ lui $t5, %hi(D_8018D9B0) # $t5, 0x8019 +/* 09A420 80099820 3C0D8019 */ lui $t5, %hi(gMenuTextureBuffer) # $t5, 0x8019 /* 09A424 80099824 12400011 */ beqz $s2, .L8009986C -/* 09A428 80099828 3C058019 */ lui $a1, %hi(D_8018D9B8) # 0x8019 +/* 09A428 80099828 3C058019 */ lui $a1, %hi(sTKMK00_LowResBuffer) # 0x8019 /* 09A42C 8009982C 52560007 */ beql $s2, $s6, .L8009984C /* 09A430 80099830 8E6B0000 */ lw $t3, ($s3) /* 09A434 80099834 525E000E */ beql $s2, $fp, .L80099870 @@ -113,7 +113,7 @@ glabel load_menu_img2 .L80099848: /* 09A448 80099848 8E6B0000 */ lw $t3, ($s3) .L8009984C: -/* 09A44C 8009984C 8DADD9B0 */ lw $t5, %lo(D_8018D9B0)($t5) +/* 09A44C 8009984C 8DADD9B0 */ lw $t5, %lo(gMenuTextureBuffer)($t5) /* 09A450 80099850 8EA40000 */ lw $a0, ($s5) /* 09A454 80099854 000B6040 */ sll $t4, $t3, 1 /* 09A458 80099858 0C010034 */ jal mio0decode @@ -125,17 +125,17 @@ glabel load_menu_img2 /* 09A46C 8009986C 860E0000 */ lh $t6, ($s0) .L80099870: /* 09A470 80099870 24020001 */ li $v0, 1 -/* 09A474 80099874 3C198019 */ lui $t9, %hi(D_8018D9B0) # $t9, 0x8019 +/* 09A474 80099874 3C198019 */ lui $t9, %hi(gMenuTextureBuffer) # $t9, 0x8019 /* 09A478 80099878 16CE0003 */ bne $s6, $t6, .L80099888 /* 09A47C 8009987C 00000000 */ nop /* 09A480 80099880 10000001 */ b .L80099888 /* 09A484 80099884 240200BE */ li $v0, 190 .L80099888: /* 09A488 80099888 8E6F0000 */ lw $t7, ($s3) -/* 09A48C 8009988C 8F39D9B0 */ lw $t9, %lo(D_8018D9B0)($t9) +/* 09A48C 8009988C 8F39D9B0 */ lw $t9, %lo(gMenuTextureBuffer)($t9) /* 09A490 80099890 8EA40000 */ lw $a0, ($s5) /* 09A494 80099894 000FC040 */ sll $t8, $t7, 1 -/* 09A498 80099898 8CA5D9B8 */ lw $a1, %lo(D_8018D9B8)($a1) # -0x2648($a1) +/* 09A498 80099898 8CA5D9B8 */ lw $a1, %lo(sTKMK00_LowResBuffer)($a1) # -0x2648($a1) /* 09A49C 8009989C 00403825 */ move $a3, $v0 /* 09A4A0 800998A0 0C010174 */ jal tkmk00decode /* 09A4A4 800998A4 03193021 */ addu $a2, $t8, $t9 diff --git a/asm/non_matchings/code_80091750/func_80099AEC.s b/asm/non_matchings/code_80091750/func_80099AEC.s index 6ed12c8e4..8f3778201 100644 --- a/asm/non_matchings/code_80091750/func_80099AEC.s +++ b/asm/non_matchings/code_80091750/func_80099AEC.s @@ -24,10 +24,10 @@ glabel func_80099AEC /* 09A73C 80099B3C 3C028019 */ lui $v0, %hi(D_8018E060) # 0x8019 /* 09A740 80099B40 2451E060 */ addiu $s1, $v0, %lo(D_8018E060) # -0x1fa0 /* 09A744 80099B44 8E320000 */ lw $s2, ($s1) -/* 09A748 80099B48 3C148019 */ lui $s4, %hi(D_8018D9B4) # $s4, 0x8019 +/* 09A748 80099B48 3C148019 */ lui $s4, %hi(gMenuCompressedBuffer) # $s4, 0x8019 /* 09A74C 80099B4C 0000A825 */ move $s5, $zero /* 09A750 80099B50 124000B4 */ beqz $s2, .L80099E24 -/* 09A754 80099B54 2694D9B4 */ addiu $s4, %lo(D_8018D9B4) # addiu $s4, $s4, -0x264c +/* 09A754 80099B54 2694D9B4 */ addiu $s4, %lo(gMenuCompressedBuffer) # addiu $s4, $s4, -0x264c /* 09A758 80099B58 96430010 */ lhu $v1, 0x10($s2) /* 09A75C 80099B5C 24101400 */ li $s0, 5120 /* 09A760 80099B60 10600003 */ beqz $v1, .L80099B70 @@ -77,8 +77,8 @@ glabel func_80099AEC /* 09A800 80099C00 02C02025 */ move $a0, $s6 /* 09A804 80099C04 0C0335D4 */ jal osRecvMesg /* 09A808 80099C08 24060001 */ li $a2, 1 -/* 09A80C 80099C0C 3C1E8019 */ lui $fp, %hi(D_8018E118) # $fp, 0x8019 -/* 09A810 80099C10 27DEE118 */ addiu $fp, %lo(D_8018E118) # addiu $fp, $fp, -0x1ee8 +/* 09A80C 80099C0C 3C1E8019 */ lui $fp, %hi(sMenuTextureMap) # $fp, 0x8019 +/* 09A810 80099C10 27DEE118 */ addiu $fp, %lo(sMenuTextureMap) # addiu $fp, $fp, -0x1ee8 /* 09A814 80099C14 8E220008 */ lw $v0, 8($s1) .L80099C18: /* 09A818 80099C18 8FB30060 */ lw $s3, 0x60($sp) @@ -136,8 +136,8 @@ glabel func_80099AEC /* 09A8D0 80099CD0 014C3821 */ addu $a3, $t2, $t4 .L80099CD4: /* 09A8D4 80099CD4 8E2F0004 */ lw $t7, 4($s1) -/* 09A8D8 80099CD8 3C098019 */ lui $t1, %hi(D_8018D9B0) # $t1, 0x8019 -/* 09A8DC 80099CDC 8D29D9B0 */ lw $t1, %lo(D_8018D9B0)($t1) +/* 09A8D8 80099CD8 3C098019 */ lui $t1, %hi(gMenuTextureBuffer) # $t1, 0x8019 +/* 09A8DC 80099CDC 8D29D9B0 */ lw $t1, %lo(gMenuTextureBuffer)($t1) /* 09A8E0 80099CE0 000FC0C0 */ sll $t8, $t7, 3 /* 09A8E4 80099CE4 031EC821 */ addu $t9, $t8, $fp /* 09A8E8 80099CE8 8F220004 */ lw $v0, 4($t9) @@ -206,8 +206,8 @@ glabel func_80099AEC /* 09A9D0 80099DD0 AFA90010 */ sw $t1, 0x10($sp) .L80099DD4: /* 09A9D4 80099DD4 8E2B0004 */ lw $t3, 4($s1) -/* 09A9D8 80099DD8 3C0F8019 */ lui $t7, %hi(D_8018D9B0) # $t7, 0x8019 -/* 09A9DC 80099DDC 8DEFD9B0 */ lw $t7, %lo(D_8018D9B0)($t7) +/* 09A9D8 80099DD8 3C0F8019 */ lui $t7, %hi(gMenuTextureBuffer) # $t7, 0x8019 +/* 09A9DC 80099DDC 8DEFD9B0 */ lw $t7, %lo(gMenuTextureBuffer)($t7) /* 09A9E0 80099DE0 000B50C0 */ sll $t2, $t3, 3 /* 09A9E4 80099DE4 015E6021 */ addu $t4, $t2, $fp /* 09A9E8 80099DE8 8D820004 */ lw $v0, 4($t4) diff --git a/asm/non_matchings/code_80091750/func_80099EC4.s b/asm/non_matchings/code_80091750/func_80099EC4.s index df6081783..c2233a0ca 100644 --- a/asm/non_matchings/code_80091750/func_80099EC4.s +++ b/asm/non_matchings/code_80091750/func_80099EC4.s @@ -13,10 +13,10 @@ glabel func_80099EC4 /* 09AAF0 80099EF0 AFB20030 */ sw $s2, 0x30($sp) /* 09AAF4 80099EF4 AFB00028 */ sw $s0, 0x28($sp) /* 09AAF8 80099EF8 8E320000 */ lw $s2, ($s1) -/* 09AAFC 80099EFC 3C138019 */ lui $s3, %hi(D_8018D9B4) # $s3, 0x8019 +/* 09AAFC 80099EFC 3C138019 */ lui $s3, %hi(gMenuCompressedBuffer) # $s3, 0x8019 /* 09AB00 80099F00 0000A025 */ move $s4, $zero /* 09AB04 80099F04 124000C0 */ beqz $s2, .L8009A208 -/* 09AB08 80099F08 2673D9B4 */ addiu $s3, %lo(D_8018D9B4) # addiu $s3, $s3, -0x264c +/* 09AB08 80099F08 2673D9B4 */ addiu $s3, %lo(gMenuCompressedBuffer) # addiu $s3, $s3, -0x264c /* 09AB0C 80099F0C 96430010 */ lhu $v1, 0x10($s2) /* 09AB10 80099F10 24101400 */ li $s0, 5120 /* 09AB14 80099F14 10600003 */ beqz $v1, .L80099F24 diff --git a/asm/non_matchings/code_80091750/func_8009F5E0.s b/asm/non_matchings/code_80091750/func_8009F5E0.s index 331124a8b..b59331691 100644 --- a/asm/non_matchings/code_80091750/func_8009F5E0.s +++ b/asm/non_matchings/code_80091750/func_8009F5E0.s @@ -195,7 +195,7 @@ glabel L8009F6CC glabel L8009F6E4 /* 0A02E4 8009F6E4 3C048015 */ lui $a0, %hi(gGfxPool) # $a0, 0x8015 /* 0A02E8 8009F6E8 8C84EF40 */ lw $a0, %lo(gGfxPool)($a0) -/* 0A02EC 8009F6EC 0C0251ED */ jal func_800947B4 +/* 0A02EC 8009F6EC 0C0251ED */ jal render_checkered_flag /* 0A02F0 8009F6F0 8E25001C */ lw $a1, 0x1c($s1) /* 0A02F4 8009F6F4 10000474 */ b .L800A08C8 /* 0A02F8 8009F6F8 8FBF0034 */ lw $ra, 0x34($sp) diff --git a/asm/non_matchings/code_80091750/func_800A1FB0.s b/asm/non_matchings/code_80091750/func_800A1FB0.s index e7c60f2da..ed9dfc2dd 100644 --- a/asm/non_matchings/code_80091750/func_800A1FB0.s +++ b/asm/non_matchings/code_80091750/func_800A1FB0.s @@ -460,14 +460,14 @@ glabel L800A23DC /* 0A319C 800A259C E7B60014 */ swc1 $f22, 0x14($sp) /* 0A31A0 800A25A0 2401002A */ li $at, 42 /* 0A31A4 800A25A4 16610006 */ bne $s3, $at, .L800A25C0 -/* 0A31A8 800A25A8 3C0F8019 */ lui $t7, %hi(D_8018D9C0) # $t7, 0x8019 +/* 0A31A8 800A25A8 3C0F8019 */ lui $t7, %hi(gSomeDLBuffer) # $t7, 0x8019 /* 0A31AC 800A25AC 3C0E8019 */ lui $t6, %hi(D_8018EE10) # $t6, 0x8019 /* 0A31B0 800A25B0 25CEEE10 */ addiu $t6, %lo(D_8018EE10) # addiu $t6, $t6, -0x11f0 /* 0A31B4 800A25B4 001069C0 */ sll $t5, $s0, 7 /* 0A31B8 800A25B8 10000004 */ b .L800A25CC /* 0A31BC 800A25BC 01AE1821 */ addu $v1, $t5, $t6 .L800A25C0: -/* 0A31C0 800A25C0 8DEFD9C0 */ lw $t7, %lo(D_8018D9C0)($t7) +/* 0A31C0 800A25C0 8DEFD9C0 */ lw $t7, %lo(gSomeDLBuffer)($t7) /* 0A31C4 800A25C4 0010C1C0 */ sll $t8, $s0, 7 /* 0A31C8 800A25C8 01F81821 */ addu $v1, $t7, $t8 .L800A25CC: @@ -653,14 +653,14 @@ glabel L800A26A8 /* 0A3458 800A2858 E7B60014 */ swc1 $f22, 0x14($sp) /* 0A345C 800A285C 2401002A */ li $at, 42 /* 0A3460 800A2860 16610006 */ bne $s3, $at, .L800A287C -/* 0A3464 800A2864 3C098019 */ lui $t1, %hi(D_8018D9C0) # $t1, 0x8019 +/* 0A3464 800A2864 3C098019 */ lui $t1, %hi(gSomeDLBuffer) # $t1, 0x8019 /* 0A3468 800A2868 3C0A8019 */ lui $t2, %hi(D_8018EE10) # $t2, 0x8019 /* 0A346C 800A286C 254AEE10 */ addiu $t2, %lo(D_8018EE10) # addiu $t2, $t2, -0x11f0 /* 0A3470 800A2870 001041C0 */ sll $t0, $s0, 7 /* 0A3474 800A2874 10000004 */ b .L800A2888 /* 0A3478 800A2878 010A1821 */ addu $v1, $t0, $t2 .L800A287C: -/* 0A347C 800A287C 8D29D9C0 */ lw $t1, %lo(D_8018D9C0)($t1) +/* 0A347C 800A287C 8D29D9C0 */ lw $t1, %lo(gSomeDLBuffer)($t1) /* 0A3480 800A2880 001059C0 */ sll $t3, $s0, 7 /* 0A3484 800A2884 012B1821 */ addu $v1, $t1, $t3 .L800A2888: @@ -871,14 +871,14 @@ glabel L800A29D0 /* 0A3774 800A2B74 E7B60014 */ swc1 $f22, 0x14($sp) /* 0A3778 800A2B78 2401002A */ li $at, 42 /* 0A377C 800A2B7C 16610006 */ bne $s3, $at, .L800A2B98 -/* 0A3780 800A2B80 3C0A8019 */ lui $t2, %hi(D_8018D9C0) # $t2, 0x8019 +/* 0A3780 800A2B80 3C0A8019 */ lui $t2, %hi(gSomeDLBuffer) # $t2, 0x8019 /* 0A3784 800A2B84 3C088019 */ lui $t0, %hi(D_8018EE10) # $t0, 0x8019 /* 0A3788 800A2B88 2508EE10 */ addiu $t0, %lo(D_8018EE10) # addiu $t0, $t0, -0x11f0 /* 0A378C 800A2B8C 0010C9C0 */ sll $t9, $s0, 7 /* 0A3790 800A2B90 10000004 */ b .L800A2BA4 /* 0A3794 800A2B94 03281821 */ addu $v1, $t9, $t0 .L800A2B98: -/* 0A3798 800A2B98 8D4AD9C0 */ lw $t2, %lo(D_8018D9C0)($t2) +/* 0A3798 800A2B98 8D4AD9C0 */ lw $t2, %lo(gSomeDLBuffer)($t2) /* 0A379C 800A2B9C 001049C0 */ sll $t1, $s0, 7 /* 0A37A0 800A2BA0 01491821 */ addu $v1, $t2, $t1 .L800A2BA4: diff --git a/asm/non_matchings/code_80091750/func_800AC458.s b/asm/non_matchings/code_80091750/func_800AC458.s index 9b3a8d883..ae2637a4d 100644 --- a/asm/non_matchings/code_80091750/func_800AC458.s +++ b/asm/non_matchings/code_80091750/func_800AC458.s @@ -26,8 +26,8 @@ glabel L800AC488 /* 0AD08C 800AC48C 24180001 */ li $t8, 1 /* 0AD090 800AC490 ACEF000C */ sw $t7, 0xc($a3) /* 0AD094 800AC494 ACF80004 */ sw $t8, 4($a3) -/* 0AD098 800AC498 3C028019 */ lui $v0, %hi(D_8018D9BC) # $v0, 0x8019 -/* 0AD09C 800AC49C 2442D9BC */ addiu $v0, %lo(D_8018D9BC) # addiu $v0, $v0, -0x2644 +/* 0AD098 800AC498 3C028019 */ lui $v0, %hi(sGPPointsCopy) # $v0, 0x8019 +/* 0AD09C 800AC49C 2442D9BC */ addiu $v0, %lo(sGPPointsCopy) # addiu $v0, $v0, -0x2644 /* 0AD0A0 800AC4A0 3C19800F */ lui $t9, %hi(gGPPointRewards) # $t9, 0x800f /* 0AD0A4 800AC4A4 83390B18 */ lb $t9, %lo(gGPPointRewards)($t9) /* 0AD0A8 800AC4A8 8C4A0000 */ lw $t2, ($v0) @@ -123,8 +123,8 @@ glabel L800AC5D0 /* 0AD1F8 800AC5F8 81CED9D8 */ lb $t6, %lo(D_8018D9D8)($t6) /* 0AD1FC 800AC5FC 11C00032 */ beqz $t6, .L800AC6C8 .L800AC600: -/* 0AD200 800AC600 3C028019 */ lui $v0, %hi(D_8018D9BC) # $v0, 0x8019 -/* 0AD204 800AC604 2442D9BC */ addiu $v0, %lo(D_8018D9BC) # addiu $v0, $v0, -0x2644 +/* 0AD200 800AC600 3C028019 */ lui $v0, %hi(sGPPointsCopy) # $v0, 0x8019 +/* 0AD204 800AC604 2442D9BC */ addiu $v0, %lo(sGPPointsCopy) # addiu $v0, $v0, -0x2644 /* 0AD208 800AC608 8C4F0000 */ lw $t7, ($v0) /* 0AD20C 800AC60C 0005C840 */ sll $t9, $a1, 1 /* 0AD210 800AC610 3C0A8016 */ lui $t2, %hi(gGPCurrentRacePlayerIdByRank) # 0x8016 @@ -157,8 +157,8 @@ glabel L800AC5D0 /* 0AD27C 800AC67C A06F0000 */ sb $t7, ($v1) /* 0AD280 800AC680 0C032384 */ jal play_sound2 /* 0AD284 800AC684 AFA5001C */ sw $a1, 0x1c($sp) -/* 0AD288 800AC688 3C028019 */ lui $v0, %hi(D_8018D9BC) # $v0, 0x8019 -/* 0AD28C 800AC68C 2442D9BC */ addiu $v0, %lo(D_8018D9BC) # addiu $v0, $v0, -0x2644 +/* 0AD288 800AC688 3C028019 */ lui $v0, %hi(sGPPointsCopy) # $v0, 0x8019 +/* 0AD28C 800AC68C 2442D9BC */ addiu $v0, %lo(sGPPointsCopy) # addiu $v0, $v0, -0x2644 /* 0AD290 800AC690 8FA5001C */ lw $a1, 0x1c($sp) /* 0AD294 800AC694 8C580000 */ lw $t8, ($v0) /* 0AD298 800AC698 8FA70020 */ lw $a3, 0x20($sp) diff --git a/asm/non_matchings/save/func_800B68F4.s b/asm/non_matchings/save/func_800B68F4.s index f4fb10271..55079f337 100644 --- a/asm/non_matchings/save/func_800B68F4.s +++ b/asm/non_matchings/save/func_800B68F4.s @@ -1,6 +1,6 @@ glabel func_800B68F4 -/* 0B74F4 800B68F4 3C028019 */ lui $v0, %hi(D_8018D9C0) # $v0, 0x8019 -/* 0B74F8 800B68F8 8C42D9C0 */ lw $v0, %lo(D_8018D9C0)($v0) +/* 0B74F4 800B68F4 3C028019 */ lui $v0, %hi(gSomeDLBuffer) # $v0, 0x8019 +/* 0B74F8 800B68F8 8C42D9C0 */ lw $v0, %lo(gSomeDLBuffer)($v0) /* 0B74FC 800B68FC 000471C0 */ sll $t6, $a0, 7 /* 0B7500 800B6900 24870001 */ addiu $a3, $a0, 1 /* 0B7504 800B6904 01C21821 */ addu $v1, $t6, $v0 diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c index d975f65e3..88b9628a7 100644 --- a/src/code_8006E9C0.c +++ b/src/code_8006E9C0.c @@ -127,7 +127,7 @@ u8* func_8006ED94(u8* devAddr, u8* baseAddress, u32 size, u32 offset) { } void load_mario_kart_64_logo(void) { - D_8018D1E0 = func_8006ED94((u8*) &gTextureLogoMarioKart64, (u8*) D_8018D9B0, 0x79E1, 0x20000); + D_8018D1E0 = func_8006ED94((u8*) &gTextureLogoMarioKart64, (u8*) gMenuTextureBuffer, 0x79E1, 0x20000); } // Some kind of initalization for the Item Window part of the HUD @@ -161,7 +161,7 @@ void func_8006EF60(void) { s16 huh; u8* wut; - wut = D_8018D9B4 + 0xFFFF0000; + wut = gMenuCompressedBuffer + 0xFFFF0000; // clang-format off // God forgive me for my sins... huh = 0x14; if (0) {} for (i = 0; i < huh; i++) { D_8018D248[i] = func_8006ED94(gCourseOutlineTextures[i], wut, D_800E5520[i], D_800E5520[i]); wut += D_800E5520[i]; } diff --git a/src/code_80091750.c b/src/code_80091750.c index 287d48876..2cdaa7318 100644 --- a/src/code_80091750.c +++ b/src/code_80091750.c @@ -37,11 +37,11 @@ // Unfortunately that's not a small effort due to weird import structure in this project #include "main.h" -u16* D_8018D9B0; -u8* D_8018D9B4; -u8* D_8018D9B8; -u8* D_8018D9BC; -void* D_8018D9C0; +u16* gMenuTextureBuffer; +u8* gMenuCompressedBuffer; +u8* sTKMK00_LowResBuffer; +u8* sGPPointsCopy; +void* gSomeDLBuffer; /** * List of bytes indexed by character ID * Indicates number of Grand Prix points that character @@ -51,15 +51,15 @@ s8 gGPPointsByCharacterId[8]; s8 gCharacterIdByGPOverallRank[8]; s8 D_8018D9D8; s8 D_8018D9D9; -MenuItem D_8018D9E0[D_8018D9E0_SIZE]; +MenuItem gMenuItems[MENU_ITEMS_MAX]; struct_8018DEE0_entry D_8018DEE0[D_8018DEE0_SIZE]; struct_8018E060_entry D_8018E060[D_8018E060_SIZE]; UNUSED u8 code_80091750_bss_padding0[8]; struct_8018E0E8_entry D_8018E0E8[D_8018E0E8_SIZE]; s32 gMenuTextureBufferIndex; -struct_8018E118_entry D_8018E118[D_8018E118_SIZE]; +static TextureMap sMenuTextureMap[TEXTURE_MAP_MAX]; s32 gNumD_8018E118Entries; -Gfx* D_8018E75C; +Gfx* sGfxPtr; s32 gNumD_8018E768Entries; struct_8018E768_entry D_8018E768[D_8018E768_SIZE]; s32 gCycleFlashMenu; @@ -1183,10 +1183,10 @@ void func_80091B78(void) { } gNextFreeMemoryAddress = gFreeMemoryResetAnchor; // Hypothetically, this should be a ptr... But only hypothetically. - D_8018D9B0 = get_next_available_memory_addr(0x000900B0); - D_8018D9B4 = (u8*) get_next_available_memory_addr(0x0000CE00); - D_8018D9B8 = (u8*) get_next_available_memory_addr(0x00012C00); - D_8018D9C0 = (struct_8018EE10_entry*) get_next_available_memory_addr(0x00001000); + gMenuTextureBuffer = get_next_available_memory_addr(0x000900B0); + gMenuCompressedBuffer = (u8*) get_next_available_memory_addr(0x0000CE00); + sTKMK00_LowResBuffer = (u8*) get_next_available_memory_addr(SCREEN_WIDTH * SCREEN_HEIGHT); + gSomeDLBuffer = (struct_8018EE10_entry*) get_next_available_memory_addr(0x00001000); func_800AF9B0(); D_8018EE0C = 0; @@ -1281,10 +1281,10 @@ void func_80091FA4(void) { s32 i; //! @todo These sizes need to be sizeof() for shiftability if possible - D_8018D9B4 = (u8*) get_next_available_memory_addr(0x00002800); - D_8018D9B0 = (u16*) get_next_available_memory_addr(0x000124F8); - D_8018D9B8 = (u8*) get_next_available_memory_addr(0x00001000); - D_8018D9BC = get_next_available_memory_addr(4); + gMenuCompressedBuffer = (u8*) get_next_available_memory_addr(0x00002800); + gMenuTextureBuffer = (u16*) get_next_available_memory_addr(0x000124F8); + sTKMK00_LowResBuffer = (u8*) get_next_available_memory_addr(0x00001000); + sGPPointsCopy = get_next_available_memory_addr(4); for (i = 0; i < 5; i++) { D_8018E7AC[i] = 0; @@ -2091,10 +2091,10 @@ void func_80093E40(void) { void func_80093E60(void) { s32 i; - D_8018D9B4 = get_next_available_memory_addr(0x00002800); - D_8018D9B0 = (u16*) get_next_available_memory_addr(0x000124F8); - D_8018D9B8 = get_next_available_memory_addr(0x00001000); - D_8018D9BC = get_next_available_memory_addr(4U); + gMenuCompressedBuffer = get_next_available_memory_addr(0x00002800); + gMenuTextureBuffer = (u16*) get_next_available_memory_addr(0x000124F8); + sTKMK00_LowResBuffer = get_next_available_memory_addr(0x00001000); + sGPPointsCopy = get_next_available_memory_addr(4U); for (i = 0; i < 5; i++) { D_8018E7AC[i] = 0; @@ -2202,7 +2202,7 @@ void func_80094660(struct GfxPool* arg0, UNUSED s32 arg1) { gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP); } -void func_800947B4(struct GfxPool* arg0, UNUSED s32 arg1) { +void render_checkered_flag(struct GfxPool* arg0, UNUSED s32 arg1) { u16 perspNorm; move_segment_table_to_dmem(); guPerspective(&arg0->mtxPersp[0], &perspNorm, 45.0f, 1.3333334f, 100.0f, 12800.0f, 1.0f); @@ -3177,7 +3177,7 @@ Gfx* func_80098558(Gfx* displayListHead, u32 arg1, u32 arg2, u32 arg3, u32 arg4, arg5Copy = arg5; for (var_v0 = arg2; var_v0 < arg4; var_v0 += 0x20) { for (var_a3 = arg1; var_a3 < arg3; var_a3 += 0x20) { - gDPLoadTextureTile(displayListHead++, D_8018D9B0, G_IM_FMT_RGBA, G_IM_SIZ_16b, arg8, 0, var_a3, var_v0, + gDPLoadTextureTile(displayListHead++, gMenuTextureBuffer, G_IM_FMT_RGBA, G_IM_SIZ_16b, arg8, 0, var_a3, var_v0, var_a3 + 0x20, var_v0 + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle(displayListHead++, arg5 << 2, arg6 << 2, (arg5 + 0x20) << 2, (arg6 + 0x20) << 2, 0, 0, @@ -3211,7 +3211,7 @@ Gfx* func_800987D0(Gfx* displayListHead, u32 arg1, u32 arg2, u32 width, u32 heig columnCopy = column; for (var_v0_2 = arg2; (u32) var_v0_2 < height; var_v0_2 += 0x20) { for (var_a2 = arg1; (u32) var_a2 < width; var_a2 += 0x20) { - gDPLoadTextureTile(displayListHead++, D_8018D9B0, G_IM_FMT_RGBA, G_IM_SIZ_16b, textureWidth, 0, var_a2, + gDPLoadTextureTile(displayListHead++, gMenuTextureBuffer, G_IM_FMT_RGBA, G_IM_SIZ_16b, textureWidth, 0, var_a2, var_v0_2, var_a2 + 0x20, var_v0_2 + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); temp_f6 = (temp_f18 * ((temp_f0 * (column - 0xA0)) + (temp_f24 * (row - 0x78)))) + 160.0f; @@ -3359,14 +3359,14 @@ void load_menu_img(MkTexture* arg0) { s32 var_a1; UNUSED s32 temp_s3; MkTexture* var_s1; - UNUSED struct_8018E118_entry* thing; + UNUSED TextureMap* thing; var_s1 = segmented_to_virtual_dupe(arg0); while (var_s1->textureData != NULL) { var_a1 = 0; for (var_v0 = 0; var_v0 < gNumD_8018E118Entries; var_v0++) { // wtf is going on here? - if (D_8018E118[var_v0 ^ 0].textureData == (*var_s1).textureData) { + if (sMenuTextureMap[var_v0 ^ 0].textureData == (*var_s1).textureData) { var_a1 = 1; break; } @@ -3381,16 +3381,16 @@ void load_menu_img(MkTexture* arg0) { if (var_a1_2 % 8) { var_a1_2 = ((var_a1_2 / 8) * 8) + 8; } - dma_copy_base_729a30(var_s1->textureData, var_a1_2, D_8018D9B4); - mio0decode(D_8018D9B4, (u8*) &D_8018D9B0[gMenuTextureBufferIndex]); + dma_copy_base_729a30(var_s1->textureData, var_a1_2, gMenuCompressedBuffer); + mio0decode(gMenuCompressedBuffer, (u8*) &gMenuTextureBuffer[gMenuTextureBufferIndex]); } else { dma_copy_base_729a30(var_s1->textureData, var_s1->height * var_s1->width * 2, - &D_8018D9B0[gMenuTextureBufferIndex]); + &gMenuTextureBuffer[gMenuTextureBufferIndex]); } - thing = &D_8018E118[gNumD_8018E118Entries]; + thing = &sMenuTextureMap[gNumD_8018E118Entries]; thing->textureData = var_s1->textureData; - thing = &D_8018E118[gNumD_8018E118Entries]; + thing = &sMenuTextureMap[gNumD_8018E118Entries]; thing->offset = gMenuTextureBufferIndex; gMenuTextureBufferIndex += (var_s1->height * var_s1->width); @@ -3413,14 +3413,14 @@ void func_80099394(MkTexture* arg0) { s32 var_a1; UNUSED s32 temp_s3; MkTexture* var_s1; - struct_8018E118_entry* thing; + TextureMap* thing; var_s1 = segmented_to_virtual_dupe(arg0); while (var_s1->textureData != NULL) { var_a1 = 0; for (var_v0 = 0; var_v0 < gNumD_8018E118Entries; var_v0++) { // wtf is going on here? - if (D_8018E118[var_v0 ^ 0].textureData == (*var_s1).textureData) { + if (sMenuTextureMap[var_v0 ^ 0].textureData == (*var_s1).textureData) { var_a1 = 1; break; } @@ -3428,12 +3428,12 @@ void func_80099394(MkTexture* arg0) { if (var_a1 == 0) { if (var_s1->type == 5) { dma_copy_base_729a30(var_s1->textureData, (u32) ((s32) (var_s1->height * var_s1->width) / 2), - &D_8018D9B0[gMenuTextureBufferIndex]); + &gMenuTextureBuffer[gMenuTextureBufferIndex]); } - thing = &D_8018E118[gNumD_8018E118Entries]; + thing = &sMenuTextureMap[gNumD_8018E118Entries]; thing->textureData = var_s1->textureData; - thing = &D_8018E118[gNumD_8018E118Entries]; + thing = &sMenuTextureMap[gNumD_8018E118Entries]; thing->offset = gMenuTextureBufferIndex; gMenuTextureBufferIndex += (var_s1->height * var_s1->width); @@ -3456,25 +3456,25 @@ void func_8009952C(MkTexture* arg0) { s32 var_a1; UNUSED s32 temp_s3; MkTexture* var_s1; - struct_8018E118_entry* thing; + TextureMap* thing; var_s1 = segmented_to_virtual_dupe(arg0); while (var_s1->textureData != NULL) { var_a1 = 0; for (var_v0 = 0; var_v0 < gNumD_8018E118Entries; var_v0++) { // wtf is going on here? - if (D_8018E118[var_v0 ^ 0].textureData == (*var_s1).textureData) { + if (sMenuTextureMap[var_v0 ^ 0].textureData == (*var_s1).textureData) { var_a1 = 1; break; } } if (var_a1 == 0) { - dma_copy_base_729a30(var_s1->textureData, 0x00008000U, D_8018D9B4); - mio0decode(D_8018D9B4, (u8*) &D_8018D9B0[gMenuTextureBufferIndex]); + dma_copy_base_729a30(var_s1->textureData, 0x00008000U, gMenuCompressedBuffer); + mio0decode(gMenuCompressedBuffer, (u8*) &gMenuTextureBuffer[gMenuTextureBufferIndex]); - thing = &D_8018E118[gNumD_8018E118Entries]; + thing = &sMenuTextureMap[gNumD_8018E118Entries]; thing->textureData = var_s1->textureData; - thing = &D_8018E118[gNumD_8018E118Entries]; + thing = &sMenuTextureMap[gNumD_8018E118Entries]; thing->offset = gMenuTextureBufferIndex; gMenuTextureBufferIndex += (var_s1->height * var_s1->width); @@ -3501,14 +3501,14 @@ void load_menu_img2(MkTexture* arg0, s32 arg1) { s32 var_a1; u8 var_v0_2; MkTexture* var_s1; - struct_8018E118_entry* thing; + TextureMap* thing; var_s1 = segmented_to_virtual_dupe(arg0); while (var_s1->textureData != NULL) { var_a1 = 0; for (var_v0 = 0; var_v0 < gNumD_8018E118Entries; var_v0++) { // wtf is going on here? - if (D_8018E118[var_v0 ^ 0].textureData == (*var_s1).textureData) { + if (sMenuTextureMap[var_v0 ^ 0].textureData == (*var_s1).textureData) { var_a1 = 1; break; } @@ -3525,17 +3525,17 @@ void load_menu_img2(MkTexture* arg0, s32 arg1) { switch (arg1) { /* irregular */ case -1: case 1: - dma_copy_base_729a30(var_s1->textureData, var_a1_2, D_8018D9B4); + dma_copy_base_729a30(var_s1->textureData, var_a1_2, gMenuCompressedBuffer); break; case 0: case 2: - dma_copy_base_7fa3c0(var_s1->textureData, var_a1_2, D_8018D9B4); + dma_copy_base_7fa3c0(var_s1->textureData, var_a1_2, gMenuCompressedBuffer); break; } switch (arg1) { /* switch 1; irregular */ case -1: /* switch 1 */ case 1: /* switch 1 */ - mio0decode(D_8018D9B4, (u8*) &D_8018D9B0[gMenuTextureBufferIndex]); + mio0decode(gMenuCompressedBuffer, (u8*) &gMenuTextureBuffer[gMenuTextureBufferIndex]); break; case 0: /* switch 1 */ case 2: /* switch 1 */ @@ -3545,12 +3545,12 @@ void load_menu_img2(MkTexture* arg0, s32 arg1) { var_v0_2 = 1; } if (1) {} - tkmk00decode(D_8018D9B4, D_8018D9B8, (u8*) &D_8018D9B0[gMenuTextureBufferIndex], var_v0_2); + tkmk00decode(gMenuCompressedBuffer, sTKMK00_LowResBuffer, (u8*) &gMenuTextureBuffer[gMenuTextureBufferIndex], var_v0_2); break; } - thing = &D_8018E118[gNumD_8018E118Entries]; + thing = &sMenuTextureMap[gNumD_8018E118Entries]; thing->textureData = var_s1->textureData; - thing = &D_8018E118[gNumD_8018E118Entries]; + thing = &sMenuTextureMap[gNumD_8018E118Entries]; thing->offset = gMenuTextureBufferIndex; gMenuTextureBufferIndex += var_s1->height * var_s1->width; gMenuTextureBufferIndex = ((gMenuTextureBufferIndex / 8) * 8) + 8; @@ -3579,8 +3579,8 @@ void func_80099958(MkTexture* arg0, s32 arg1, s32 arg2) { // Round up to the next multiple of eight var_a1 = ((var_a1 / 8) * 8) + 8; } - dma_copy_base_729a30(temp_v0->textureData, var_a1, D_8018D9B4); - mio0decode(D_8018D9B4, D_802BFB80.arraySize4[arg2][arg1 / 2][(arg1 % 2) + 2].pixel_index_array); + dma_copy_base_729a30(temp_v0->textureData, var_a1, gMenuCompressedBuffer); + mio0decode(gMenuCompressedBuffer, D_802BFB80.arraySize4[arg2][arg1 / 2][(arg1 % 2) + 2].pixel_index_array); temp_v0++; } } @@ -3641,9 +3641,9 @@ void func_80099AEC(void) { if (var_s0 % 8) { var_s0 = ((var_s0 / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4, var_s0); + osInvalDCache(gMenuCompressedBuffer, var_s0); osPiStartDma(&sp68, 0, 0, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], - D_8018D9B4, var_s0, &gDmaMesgQueue); + gMenuCompressedBuffer, var_s0, &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &sp64, 1); while (1) { if ((var_s1 + 1)->texture == NULL) { @@ -3659,11 +3659,11 @@ void func_80099AEC(void) { if (var_s0 % 8) { var_s0 = ((var_s0 / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4 + sp60 * 4, var_s0); + osInvalDCache(gMenuCompressedBuffer + sp60 * 4, var_s0); osPiStartDma(&sp68, 0, 0, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], - D_8018D9B4 + sp60 * 4, var_s0, &gDmaMesgQueue); + gMenuCompressedBuffer + sp60 * 4, var_s0, &gDmaMesgQueue); } - mio0decode(D_8018D9B4, (u8*) &D_8018D9B0[D_8018E118[var_s1->unk_4].offset]); + mio0decode(gMenuCompressedBuffer, (u8*) &gMenuTextureBuffer[sMenuTextureMap[var_s1->unk_4].offset]); var_s1->texture = NULL; var_s1++; if (var_s4 != 0) @@ -3682,11 +3682,11 @@ void func_80099AEC(void) { if (var_s0 % 8) { var_s0 = ((var_s0 / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4, var_s0); + osInvalDCache(gMenuCompressedBuffer, var_s0); osPiStartDma(&sp68, 0, 0, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], - D_8018D9B4, var_s0, &gDmaMesgQueue); + gMenuCompressedBuffer, var_s0, &gDmaMesgQueue); } - mio0decode(D_8018D9B4 + sp60 * 4, (u8*) &D_8018D9B0[D_8018E118[var_s1->unk_4].offset]); + mio0decode(gMenuCompressedBuffer + sp60 * 4, (u8*) &gMenuTextureBuffer[sMenuTextureMap[var_s1->unk_4].offset]); var_s1->texture = NULL; var_s1++; if (var_s4 != 0) @@ -3746,11 +3746,11 @@ void func_80099EC4(void) { if (var_s0 % 8) { var_s0 = ((var_s0 / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4, var_s0); + osInvalDCache(gMenuCompressedBuffer, var_s0); test = &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)]; - osPiStartDma(&sp68, 0, 0, (uintptr_t) test, D_8018D9B4, var_s0, &gDmaMesgQueue); + osPiStartDma(&sp68, 0, 0, (uintptr_t) test, gMenuCompressedBuffer, var_s0, &gDmaMesgQueue); if ((var_s0 && var_s0) && var_s0) {} - // osPiStartDma(&sp68, 0, 0, &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], D_8018D9B4, var_s0, + // osPiStartDma(&sp68, 0, 0, &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], gMenuCompressedBuffer, var_s0, // &gDmaMesgQueue); osRecvMesg(&gDmaMesgQueue, &sp64, 1); while (1) { @@ -3767,11 +3767,11 @@ void func_80099EC4(void) { if (var_s0 % 8) { var_s0 = ((var_s0 / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4 + 0x1400, var_s0); + osInvalDCache(gMenuCompressedBuffer + 0x1400, var_s0); osPiStartDma(&sp68, 0, 0, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], - D_8018D9B4 + 0x1400, var_s0, &gDmaMesgQueue); + gMenuCompressedBuffer + 0x1400, var_s0, &gDmaMesgQueue); } - mio0decode(D_8018D9B4, + mio0decode(gMenuCompressedBuffer, D_802BFB80.arraySize4[var_s1->unk6][var_s1->unk4 / 2][(var_s1->unk4 % 2) + 2].pixel_index_array); var_s1->mk64Texture = NULL; var_s1++; @@ -3791,11 +3791,11 @@ void func_80099EC4(void) { if (var_s0 % 8) { var_s0 = ((var_s0 / 8) * 8) + 8; } - osInvalDCache(D_8018D9B4, var_s0); + osInvalDCache(gMenuCompressedBuffer, var_s0); osPiStartDma(&sp68, 0, 0, (uintptr_t) &_textures_0aSegmentRomStart[SEGMENT_OFFSET(temp_s2->textureData)], - D_8018D9B4, var_s0, &gDmaMesgQueue); + gMenuCompressedBuffer, var_s0, &gDmaMesgQueue); } - mio0decode(D_8018D9B4 + 0x1400, + mio0decode(gMenuCompressedBuffer + 0x1400, D_802BFB80.arraySize4[var_s1->unk6][var_s1->unk4 / 2][(var_s1->unk4 % 2) + 2].pixel_index_array); var_s1->mk64Texture = NULL; var_s1++; @@ -3812,17 +3812,17 @@ void func_8009A238(MkTexture* arg0, s32 arg1) { s32 var_a3; s32 temp_v1; u64* sp24; - UNUSED struct_8018E118_entry* temp_v0; + UNUSED TextureMap* temp_v0; - temp_v1 = D_8018E118[arg1].offset; + temp_v1 = sMenuTextureMap[arg1].offset; sp24 = arg0->textureData; var_a3 = arg0->size; if (var_a3 % 8) { var_a3 = ((var_a3 / 8) * 8) + 8; } - dma_copy_base_7fa3c0(sp24, var_a3, D_8018D9B4); - tkmk00decode(D_8018D9B4, D_8018D9B8, (u8*) &D_8018D9B0[temp_v1], 1); - D_8018E118[arg1].textureData = sp24; + dma_copy_base_7fa3c0(sp24, var_a3, gMenuCompressedBuffer); + tkmk00decode(gMenuCompressedBuffer, sTKMK00_LowResBuffer, (u8*) &gMenuTextureBuffer[temp_v1], 1); + sMenuTextureMap[arg1].textureData = sp24; } void func_8009A2F0(struct_8018E0E8_entry* arg0) { @@ -4053,8 +4053,8 @@ void func_8009A9FC(s32 arg0, s32 arg1, u32 arg2, s32 arg3) { u16* color0; u16* color1; - color0 = &D_8018D9B0[D_8018E118[arg0].offset]; - color1 = &D_8018D9B0[D_8018E118[arg1].offset]; + color0 = &gMenuTextureBuffer[sMenuTextureMap[arg0].offset]; + color1 = &gMenuTextureBuffer[sMenuTextureMap[arg1].offset]; for (var_t1 = 0; (u32) var_t1 < arg2; var_t1++) { temp_a0 = *color0++; red = (temp_a0 & 0xF800) >> 0xB; @@ -4082,7 +4082,7 @@ void func_8009AB7C(s32 arg0) { s32 var_v1; u16* color; - color = &D_8018D9B0[D_8018E118[arg0].offset]; + color = &gMenuTextureBuffer[sMenuTextureMap[arg0].offset]; for (var_v1 = 0; var_v1 < 0x4B000; var_v1++) { red = ((*color & 0xF800) >> 0xB) * 0x4D; green = ((*color & 0x7C0) >> 6) * 0x96; @@ -4111,8 +4111,8 @@ void func_8009AD78(s32 arg0, s32 arg1) { UNUSED u16 temp_a0; u16* color; - color = &D_8018D9B0[D_8018E118[arg0].offset]; - size = D_8018E118[arg0 + 1].offset - D_8018E118[arg0].offset; + color = &gMenuTextureBuffer[sMenuTextureMap[arg0].offset]; + size = sMenuTextureMap[arg0 + 1].offset - sMenuTextureMap[arg0].offset; for (var_v1 = 0; var_v1 != size; var_v1++) { red = ((*color & 0xF800) >> 0xB) * 0x4D; green = ((*color & 0x7C0) >> 6) * 0x96; @@ -4139,8 +4139,8 @@ void convert_img_to_greyscale(s32 arg0, u32 arg1) { for (var_s0 = 0; var_s0 < 0x20; var_s0++) { sp48[var_s0] = func_800917B0(var_s0 * 0.03125, (arg1 * 1.5 * 0.00390625) + 0.25); } - color = &D_8018D9B0[D_8018E118[arg0].offset]; - size = D_8018E118[arg0 + 1].offset - D_8018E118[arg0].offset; + color = &gMenuTextureBuffer[sMenuTextureMap[arg0].offset]; + size = sMenuTextureMap[arg0 + 1].offset - sMenuTextureMap[arg0].offset; for (var_s0 = 0; var_s0 < (u32) size; var_s0++) { red = ((*color & 0xF800) >> 0xB) * 0x55; green = ((*color & 0x7C0) >> 6) * 0x4B; @@ -4168,7 +4168,7 @@ void adjust_img_colour(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { s32 var_v1; u16* color; - color = &D_8018D9B0[D_8018E118[arg0].offset]; + color = &gMenuTextureBuffer[sMenuTextureMap[arg0].offset]; for (var_v1 = 0; var_v1 != arg1; var_v1++) { red = ((*color & 0xF800) >> 0xB) * 0x4D; green = ((*color & 0x7C0) >> 6) * 0x96; @@ -4191,34 +4191,34 @@ u16* func_8009B8C4(u64* arg0) { found = 0; for (someIndex = 0; someIndex < gNumD_8018E118Entries; someIndex++) { - if (arg0 == D_8018E118[someIndex].textureData) { + if (arg0 == sMenuTextureMap[someIndex].textureData) { found = 1; - offset = D_8018E118[someIndex].offset; + offset = sMenuTextureMap[someIndex].offset; break; } } if (found != 0) { - return &D_8018D9B0[offset]; + return &gMenuTextureBuffer[offset]; } return NULL; } -// D_8018D9C0 is a little weird. In code_800AF9B0 its treated as a +// gSomeDLBuffer is a little weird. In code_800AF9B0 its treated as a // struct_8018EE10_entry pointer. But here its being treated as a // Gfx pointer. It seems to be multi use. void func_8009B938(void) { - D_8018E75C = (Gfx*) D_8018D9C0; + sGfxPtr = (Gfx*) gSomeDLBuffer; gNumD_8018E768Entries = 0; } void func_8009B954(MkTexture* arg0) { D_8018E768[gNumD_8018E768Entries].textures = segmented_to_virtual_dupe(arg0); - D_8018E768[gNumD_8018E768Entries].displayList = D_8018E75C; + D_8018E768[gNumD_8018E768Entries].displayList = sGfxPtr; } void func_8009B998(void) { - gSPEndDisplayList(D_8018E75C++); + gSPEndDisplayList(sGfxPtr++); gNumD_8018E768Entries += 1; } @@ -4451,9 +4451,9 @@ Gfx* func_8009C434(Gfx* arg0, struct_8018DEE0_entry* arg1, s32 arg2, s32 arg3, s break; } if (arg1->unk14 != 0) { - var_t0 = D_8018E118[arg1->D_8018E118_index + 1].offset; + var_t0 = sMenuTextureMap[arg1->D_8018E118_index + 1].offset; } else { - var_t0 = D_8018E118[arg1->D_8018E118_index].offset; + var_t0 = sMenuTextureMap[arg1->D_8018E118_index].offset; if (1) {} if (1) {} if (1) {} @@ -4461,18 +4461,18 @@ Gfx* func_8009C434(Gfx* arg0, struct_8018DEE0_entry* arg1, s32 arg2, s32 arg3, s if (arg4 >= 0) { arg0 = func_80097E58(arg0, var_t1, 0, 0U, var_s0->width, var_s0->height, var_s0->dX + arg2, var_s0->dY + arg3, - (u8*) &D_8018D9B0[var_t0], var_s0->width, var_s0->height, (u32) arg4); + (u8*) &gMenuTextureBuffer[var_t0], var_s0->width, var_s0->height, (u32) arg4); } else { switch (arg4) { case -1: arg0 = func_80095E10(arg0, var_t1, 0x00000400, 0x00000400, 0, 0, var_s0->width, var_s0->height, - var_s0->dX + arg2, var_s0->dY + arg3, (u8*) &D_8018D9B0[var_t0], var_s0->width, + var_s0->dX + arg2, var_s0->dY + arg3, (u8*) &gMenuTextureBuffer[var_t0], var_s0->width, var_s0->height); break; case -2: arg0 = func_800963F0(arg0, var_t1, 0x00000400, 0x00000400, 0.5f, 0.5f, 0, 0, var_s0->width, var_s0->height, var_s0->dX + arg2, var_s0->dY + arg3, - (u8*) &D_8018D9B0[var_t0], var_s0->width, var_s0->height); + (u8*) &gMenuTextureBuffer[var_t0], var_s0->width, var_s0->height); break; } } @@ -5090,7 +5090,7 @@ void func_8009DB8C(void) { if ((u32) var_v1 >= D_8018E7B8[4]) { if ((u32) var_v1 == D_8018E7B8[4]) { for (var_s0 = 0; var_s0 < 0x4B0; var_s0++) { - D_8018D9B8[var_s0] = 1; + sTKMK00_LowResBuffer[var_s0] = 1; } } else { func_8009CE64(4); @@ -5099,9 +5099,9 @@ void func_8009DB8C(void) { var_s0 = 0; var_s3 = 0; while (var_s3 < (0x4B0U / D_8018E7B8[4])) { - if ((D_8018D9B8[var_s0] == 0) && (random_int((0x4B0U - D_8018E7D0[4]) / D_8018E7B8[4]) == 0)) { + if ((sTKMK00_LowResBuffer[var_s0] == 0) && (random_int((0x4B0U - D_8018E7D0[4]) / D_8018E7B8[4]) == 0)) { var_s3 += 1; - D_8018D9B8[var_s0] = 1; + sTKMK00_LowResBuffer[var_s0] = 1; } var_s0 += 1; if (var_s0 >= 0x4B0) { @@ -5114,7 +5114,7 @@ void func_8009DB8C(void) { gDPSetPrimColor(gDisplayListHead++, 0, 0, 0x00, 0x00, 0x00, 0xFF); gDPSetCombineMode(gDisplayListHead++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); for (var_s0 = 0; var_s0 < 0x4B0; var_s0++) { - if (D_8018D9B8[var_s0] != 0) { + if (sTKMK00_LowResBuffer[var_s0] != 0) { temp_t4 = (var_s0 % 40) * 8; temp_t5 = (var_s0 / 40) * 8; gDPFillRectangle(gDisplayListHead++, temp_t4, temp_t5, temp_t4 + 8, temp_t5 + 8); @@ -5219,7 +5219,7 @@ void func_8009E0F0(s32 arg0) { } D_8018E7E0 = 0; for (var_v0 = 0; var_v0 < 0x4B0; var_v0++) { - D_8018D9B8[var_v0] = 0; + sTKMK00_LowResBuffer[var_v0] = 0; } } } @@ -5326,8 +5326,8 @@ void func_8009E5FC(s32 arg0) { void func_8009E620(void) { s32 index; - for (index = 0; index < D_8018D9E0_SIZE; index++) { - D_8018D9E0[index].type = 0; + for (index = 0; index < MENU_ITEMS_MAX; index++) { + gMenuItems[index].type = 0; } } @@ -5348,7 +5348,7 @@ void add_ui_element(s32 type, s32 column, s32 row, s8 priority) { s32 one = 1; var_v0 = 0; - var_ra = D_8018D9E0; + var_ra = gMenuItems; // ???????? // Credit to Vetri for the idea to mess around with this loop // to fix the issue near the 0xD4 case @@ -5357,7 +5357,7 @@ void add_ui_element(s32 type, s32 column, s32 row, s8 priority) { if (var_ra->type == 0) break; - if (var_v0 > D_8018D9E0_SIZE) { + if (var_v0 > MENU_ITEMS_MAX) { while (true) {} } var_ra++; @@ -5402,13 +5402,13 @@ void add_ui_element(s32 type, s32 column, s32 row, s8 priority) { case 0xD2: load_menu_img2(D_020014C8, 0); func_8009B954(D_020014C8); - D_8018E75C = func_8009BA74(D_8018E75C, D_020014C8, var_ra->column, var_ra->row); + sGfxPtr = func_8009BA74(sGfxPtr, D_020014C8, var_ra->column, var_ra->row); func_8009B998(); break; case 0xD3: load_menu_img2(D_02001540, 0); func_8009B954(D_02001540); - D_8018E75C = func_8009BA74(D_8018E75C, D_02001540, var_ra->column, var_ra->row); + sGfxPtr = func_8009BA74(sGfxPtr, D_02001540, var_ra->column, var_ra->row); func_8009B998(); break; case 0xD4: @@ -5422,23 +5422,23 @@ void add_ui_element(s32 type, s32 column, s32 row, s8 priority) { case 0xD5: load_menu_img(D_020015A4); func_8009B954(D_020015A4); - D_8018E75C = func_8009BA74(D_8018E75C, D_020015A4, var_ra->column, var_ra->row); - gDPLoadTextureBlock(D_8018E75C++, func_8009B8C4(gTexture7ED50C), G_IM_FMT_IA, G_IM_SIZ_16b, 256, 5, 0, + sGfxPtr = func_8009BA74(sGfxPtr, D_020015A4, var_ra->column, var_ra->row); + gDPLoadTextureBlock(sGfxPtr++, func_8009B8C4(gTexture7ED50C), G_IM_FMT_IA, G_IM_SIZ_16b, 256, 5, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(D_8018E75C++, 0x80, 0x2C0, 0x480, 0x2D4, G_TX_RENDERTILE, 0, 0x80, 0x0400, 0xFC00); + gSPTextureRectangle(sGfxPtr++, 0x80, 0x2C0, 0x480, 0x2D4, G_TX_RENDERTILE, 0, 0x80, 0x0400, 0xFC00); func_8009B998(); load_menu_img(D_020015CC); func_8009B954(D_020015CC); - D_8018E75C = func_8009BA74(D_8018E75C, D_020015CC, var_ra->column, var_ra->row); + sGfxPtr = func_8009BA74(sGfxPtr, D_020015CC, var_ra->column, var_ra->row); func_8009B998(); load_menu_img(D_02001630); func_8009B954(D_02001630); - D_8018E75C = func_8009BA74(D_8018E75C, D_02001630, var_ra->column, var_ra->row); + sGfxPtr = func_8009BA74(sGfxPtr, D_02001630, var_ra->column, var_ra->row); func_8009B998(); load_menu_img(D_02001658); func_8009B954(D_02001658); - D_8018E75C = func_8009BA74(D_8018E75C, D_02001658, var_ra->column, var_ra->row); + sGfxPtr = func_8009BA74(sGfxPtr, D_02001658, var_ra->column, var_ra->row); func_8009B998(); break; case 0xD6: @@ -5799,7 +5799,7 @@ void func_8009F5E0(MenuItem* arg0) { func_80094660(gGfxPool, arg0->unk1C); break; case START_MENU_FLAG: /* switch 6 */ - func_800947B4(gGfxPool, arg0->unk1C); + render_checkered_flag(gGfxPool, arg0->unk1C); break; case D_8018D9E0_TYPE_0D2: /* switch 6 */ gDisplayListHead = func_8009B9D0(gDisplayListHead, D_020014C8); @@ -6907,7 +6907,7 @@ void func_800A1FB0(MenuItem* arg0) { if (var_s1 == 0) { var_v1 = &D_8018EE10[var_s2]; } else { - var_v1 = &((struct_8018EE10_entry*) D_8018D9C0)[var_s2]; + var_v1 = &((struct_8018EE10_entry*) gSomeDLBuffer)[var_s2]; } if (var_v1->ghostDataSaved == 0) { print_text_mode_1(0x2A + (var_s1 * 0x89), 0x96 + (0x1E * var_s2), D_800E7A44, 0, 0.5f, 0.5f); @@ -6946,7 +6946,7 @@ void func_800A1FB0(MenuItem* arg0) { if (var_s1 == 0) { var_v1 = &D_8018EE10[var_s2]; } else { - var_v1 = &((struct_8018EE10_entry*) D_8018D9C0)[var_s2]; + var_v1 = &((struct_8018EE10_entry*) gSomeDLBuffer)[var_s2]; } if (var_v1->ghostDataSaved == 0) { print_text_mode_1(0x2A + (var_s1 * 0x89), 0x96 + (0x1E * var_s2), D_800E7A44, 0, 0.5f, 0.5f); @@ -6998,7 +6998,7 @@ void func_800A1FB0(MenuItem* arg0) { if (var_s1 == 0) { var_v1 = &D_8018EE10[var_s2]; } else { - var_v1 = &((struct_8018EE10_entry*) D_8018D9C0)[var_s2]; + var_v1 = &((struct_8018EE10_entry*) gSomeDLBuffer)[var_s2]; } if (var_v1->ghostDataSaved == 0) { print_text_mode_1(0x2A + (var_s1 * 0x89), 0x96 + (0x1E * var_s2), D_800E7A44, 0, 0.5f, 0.5f); @@ -7149,7 +7149,7 @@ void func_800A34A8(MenuItem* arg0) { if (arg0->state != 0) { if (arg0->state < 9) { - for (rank = 0; rank < 8; rank++) { + for (rank = 0; rank < NUM_PLAYERS; rank++) { sp80[rank] = gPlayers[gGPCurrentRacePlayerIdByRank[rank]].characterId; } } else { @@ -7283,8 +7283,8 @@ void func_800A3ADC(MenuItem* arg0, s32 arg1, s32 arg2, s32 characterId, s32 arg4 print_text_mode_1(arg1 + 0xA, arg2, D_800E76A8[characterId], 0, 0.7f, 0.7f); convert_number_to_ascii(gGPPointsByCharacterId[characterId], sp34); func_800939C8(arg1 + 0x47, arg2, sp34, 0, 0.7f, 0.7f); - if ((arg4 < 4) && (arg0->state < 9)) { - convert_number_to_ascii(D_8018D9BC[arg4], sp34); + if ((arg4 < ARRAY_COUNT(gGPPointRewards)) && (arg0->state < 9)) { + convert_number_to_ascii(sGPPointsCopy[arg4], sp34); sp34[0] = '+'; print_text_mode_1(arg1 + 0x5A, arg2, sp34, 0, 0.7f, 0.7f); } @@ -8450,9 +8450,9 @@ void func_800A7A4C(s32 arg0) { MenuItem* var_s1; s32 one = 1; - for (var_v1_2 = 0; var_v1_2 < D_8018D9E0_SIZE; var_v1_2++) { + for (var_v1_2 = 0; var_v1_2 < MENU_ITEMS_MAX; var_v1_2++) { var_v1 = 0; - var_s1 = &D_8018D9E0[var_v1_2]; + var_s1 = &gMenuItems[var_v1_2]; type = var_s1->type; if ((type == UNUSED_TYPE_004) || (type == START_MENU_TEXT_BOX) || (type == D_8018D9E0_TYPE_0C7)) { if (arg0 != 0) { @@ -8835,9 +8835,9 @@ void func_800A7A4C(s32 arg0) { } for (var_s0 = 0; var_s0 < 0x10; var_s0++) { - for (var_v1_2 = 0; var_v1_2 < D_8018D9E0_SIZE; var_v1_2++) { + for (var_v1_2 = 0; var_v1_2 < MENU_ITEMS_MAX; var_v1_2++) { var_v1 = 0; - var_s1 = &D_8018D9E0[var_v1_2]; + var_s1 = &gMenuItems[var_v1_2]; if (var_s1 && var_s1) {} // ? type = var_s1->type; if ((type == UNUSED_TYPE_004) || (type == START_MENU_TEXT_BOX) || (type == D_8018D9E0_TYPE_0C7)) { @@ -10023,14 +10023,14 @@ void func_800AAE18(MenuItem* arg0) { /** * Similar to find_8018D9E0_entry_dupe, there is potential for a - * hard lock in the function if no appropriate D_8018D9E0 entry + * hard lock in the function if no appropriate gMenuItems entry * is found. **/ MenuItem* func_800AAE68(void) { - MenuItem* entry = D_8018D9E0; + MenuItem* entry = gMenuItems; s32 thing = gPlayerCount - 1; - for (; !(entry > &D_8018D9E0[D_8018D9E0_SIZE]); entry++) { + for (; !(entry > &gMenuItems[MENU_ITEMS_MAX]); entry++) { if ((thing + 0xB) == entry->type) { goto escape; } @@ -10046,13 +10046,13 @@ escape: /** * Similar to find_8018D9E0_entry_dupe, there is potential for a - * hard lock in the function if no appropriate D_8018D9E0 entry + * hard lock in the function if no appropriate gMenuItems entry * is found. **/ MenuItem* func_800AAEB4(s32 arg0) { - MenuItem* entry = D_8018D9E0; + MenuItem* entry = gMenuItems; - for (; !(entry > &D_8018D9E0[D_8018D9E0_SIZE]); entry++) { + for (; !(entry > &gMenuItems[MENU_ITEMS_MAX]); entry++) { if ((arg0 + 0x2B) == entry->type) { goto escape; } @@ -10077,8 +10077,8 @@ escape: * reasoning on the original author(s) part. **/ MenuItem* find_8018D9E0_entry_dupe(s32 type) { - MenuItem* entry = D_8018D9E0; - for (; !(entry > (&D_8018D9E0[D_8018D9E0_SIZE])); entry++) { + MenuItem* entry = gMenuItems; + for (; !(entry > (&gMenuItems[MENU_ITEMS_MAX])); entry++) { if (entry->type == type) { goto escape; } @@ -10093,8 +10093,8 @@ escape: } MenuItem* find_8018D9E0_entry(s32 arg0) { - MenuItem* entry = D_8018D9E0; - for (; !(entry > (&D_8018D9E0[D_8018D9E0_SIZE])); entry++) { + MenuItem* entry = gMenuItems; + for (; !(entry > (&gMenuItems[MENU_ITEMS_MAX])); entry++) { if (entry->type == arg0) { goto escape; } @@ -10681,8 +10681,8 @@ void func_800AC458(struct_8018D9E0_entry* arg0) { case 0: arg0->column = -0x000000A0; arg0->state = 1; - for (var_a1 = 0; var_a1 < 4; var_a1++) { - D_8018D9BC[var_a1] = gGPPointRewards[var_a1]; + for (var_a1 = 0; var_a1 < ARRAY_COUNT(gGPPointRewards); var_a1++) { + sGPPointsCopy[var_a1] = gGPPointRewards[var_a1]; } arg0->unk20 = arg0->column; break; @@ -10723,12 +10723,12 @@ void func_800AC458(struct_8018D9E0_entry* arg0) { var_a1 = arg0->state - 3; arg0->unk1C++; if (((arg0->unk1C % 3) == 0) || (D_8018D9D8 != 0)) { - if (D_8018D9BC[var_a1] > 0) { - D_8018D9BC[var_a1]--; + if (sGPPointsCopy[var_a1] > 0) { + sGPPointsCopy[var_a1]--; gGPPointsByCharacterId[gPlayers[gGPCurrentRacePlayerIdByRank[var_a1]].characterId] += 1; play_sound2(SOUND_ACTION_COUNT_SCORE); var_t1 = 0; - if ((D_8018D9BC[var_a1] == 0) && (arg0->unk20 == 0)) { + if ((sGPPointsCopy[var_a1] == 0) && (arg0->unk20 == 0)) { arg0->unk20 = 1; arg0->unk1C = 0; } @@ -11091,8 +11091,8 @@ void func_800AD2E8(MenuItem* arg0) { case 0: /* switch 3 */ arg0->column = -0x000000A0; arg0->state = 1; - for (index = 0; index < 4; index++) { - D_8018D9BC[index] = gGPPointRewards[index]; + for (index = 0; index < ARRAY_COUNT(gGPPointRewards); index++) { + sGPPointsCopy[index] = gGPPointRewards[index]; } arg0->unk20 = arg0->column; break; diff --git a/src/code_80091750.h b/src/code_80091750.h index 0aa819917..7ca5c3749 100644 --- a/src/code_80091750.h +++ b/src/code_80091750.h @@ -28,7 +28,7 @@ typedef struct { /* 0x0C */ s32 column; /* 0x10 */ s32 row; /* 0x14 */ u8 priority; // priority/depth/z-level. Higher values are drawn on top of lower values - // If equal, later entries in D_8018D9E0 are on top + // If equal, later entries in gMenuItems are on top /* 0x15 */ u8 visible; // active? If 1 its displayed, if 0 its not // These seem to be generic space available for use by the struct, no 1 purpose for any given member /* 0x16 */ s16 unk16; // Potentially unused @@ -44,7 +44,7 @@ typedef struct { /* 0x04 */ s32 sequenceIndex; // Index in textureSequence that the animation is currently on /* 0x08 */ s32 frameCountDown; // Frames left for the given animation part /* 0x0C */ u32 visible; // visbile if 0x80000000, otherwise invisbile AND paused - /* 0x10 */ s32 D_8018E118_index; // Don't know what D_8018E118 tracks + /* 0x10 */ s32 D_8018E118_index; // Don't know what sMenuTextureMap tracks /* 0x14 */ s32 unk14; // Flip flops between 0 and 1, use unknown } struct_8018DEE0_entry; // size = 0x18 @@ -63,12 +63,12 @@ typedef struct { /* 0x00 */ u64* textureData; // This should be interpreted as a segmented address /** * Its hard to tell what exactly what this is meant to be, - * but it appears to be used as some sort of offset/index from the address stored in D_8018D9B0. + * but it appears to be used as some sort of offset/index from the address stored in gMenuTextureBuffer. * This value is (roughly) the sum of (width * height) of the - * textures in all the previous entries in D_8018E118 + * textures in all the previous entries in sMenuTextureMap */ /* 0x04 */ s32 offset; -} struct_8018E118_entry; // size = 0x08 +} TextureMap; // size = 0x08 typedef struct { /* 0x00 */ MkTexture* textures; @@ -374,7 +374,7 @@ void func_80093F10(void); void func_800940EC(s32); void func_800942D0(void); void func_80094660(struct GfxPool*, s32); -void func_800947B4(struct GfxPool*, s32); +void render_checkered_flag(struct GfxPool*, s32); void func_80094A64(struct GfxPool*); void render_menus(void); void func_80095574(void); @@ -630,11 +630,11 @@ void tkmk00decode(u8*, u8*, u8*, s32); /* File specific defines */ -#define D_8018D9E0_SIZE 0x20 +#define MENU_ITEMS_MAX 0x20 #define D_8018DEE0_SIZE 0x10 #define D_8018E060_SIZE 0x10 #define D_8018E0E8_SIZE 0x05 -#define D_8018E118_SIZE 0xC8 +#define TEXTURE_MAP_MAX 0xC8 #define D_8018E768_SIZE 0x08 #define D_8018E7E8_SIZE 0x05 #define D_8018E810_SIZE 0x05 @@ -644,23 +644,23 @@ void tkmk00decode(u8*, u8*, u8*, s32); extern s32 D_800DDB24; extern s16 D_80164478[]; -extern u16* D_8018D9B0; -extern u8* D_8018D9B4; -extern u8* D_8018D9B8; -extern u8* D_8018D9BC; -extern void* D_8018D9C0; +extern u16* gMenuTextureBuffer; +extern u8* gMenuCompressedBuffer; +extern u8* sTKMK00_LowResBuffer; +extern u8* sGPPointsCopy; +extern void* gSomeDLBuffer; extern s8 gGPPointsByCharacterId[8]; extern s8 gCharacterIdByGPOverallRank[]; extern s8 D_8018D9D8; extern s8 D_8018D9D9; -extern MenuItem D_8018D9E0[D_8018D9E0_SIZE]; +extern MenuItem gMenuItems[MENU_ITEMS_MAX]; extern struct_8018DEE0_entry D_8018DEE0[D_8018DEE0_SIZE]; extern struct_8018E060_entry D_8018E060[D_8018E060_SIZE]; extern struct_8018E0E8_entry D_8018E0E8[D_8018E0E8_SIZE]; extern s32 gMenuTextureBufferIndex; -extern struct_8018E118_entry D_8018E118[D_8018E118_SIZE]; +extern TextureMap sMenuTextureMap[TEXTURE_MAP_MAX]; extern s32 gNumD_8018E118Entries; -extern Gfx* D_8018E75C; +extern Gfx* sGfxPtr; extern s32 gNumD_8018E768Entries; extern struct_8018E768_entry D_8018E768[D_8018E768_SIZE]; extern s32 gCycleFlashMenu; diff --git a/src/menus.c b/src/menus.c index 982494d19..c90e69382 100644 --- a/src/menus.c +++ b/src/menus.c @@ -227,7 +227,7 @@ void options_menu_act(struct Controller* controller, u16 arg1) { if (!func_800B4520()) { sp38 = find_8018D9E0_entry_dupe(0xF0); - sp30 = (struct_8018EE10_entry*) D_8018D9C0; + sp30 = (struct_8018EE10_entry*) gSomeDLBuffer; switch (D_8018EDEC) { case 0x15: case 0x16: @@ -1988,7 +1988,7 @@ bool func_800B4520(void) { UNUSED void func_800B4560(s32 arg0, s32 arg1) { struct_8018EE10_entry* pak1 = D_8018EE10; - struct_8018EE10_entry* pak2 = (struct_8018EE10_entry*) D_8018D9C0; + struct_8018EE10_entry* pak2 = (struct_8018EE10_entry*) gSomeDLBuffer; rmonPrintf("ghost_kart=%d,", D_80162DE0); rmonPrintf("pak1_ghost_kart=%d,", (pak1 + arg0)->characterId); diff --git a/src/save.c b/src/save.c index b182aede1..6eb920871 100644 --- a/src/save.c +++ b/src/save.c @@ -909,7 +909,7 @@ s32 func_800B65F4(s32 arg0, s32 arg1) { writeStatus = osPfsReadWriteFile(&gControllerPak2FileHandle, gControllerPak2FileNote, 0U, (arg0 * 0x3C00) + 0x100, 0x00003C00, (u8*) D_800DC714); if (writeStatus == 0) { - temp_s3 = &((struct_8018EE10_entry*) D_8018D9C0)[arg0]; + temp_s3 = &((struct_8018EE10_entry*) gSomeDLBuffer)[arg0]; for (i = 0; i < 0x3C; i++) { if (temp_s3->unk_07[i] != func_800B60E8(i)) { temp_s3->ghostDataSaved = 0; @@ -940,14 +940,14 @@ void func_800B6798(void) { s32 temp_s0; u8* tmp; - tmp = (u8*) D_8018D9C0; + tmp = (u8*) gSomeDLBuffer; osPfsReadWriteFile(&gControllerPak2FileHandle, gControllerPak2FileNote, PFS_READ, 0, 0x100 /* 2*sizeof(struct_8018EE10_entry) ? */, tmp); for (temp_s0 = 0; temp_s0 < 2; ++temp_s0) { - // if (D_8018D9C0[temp_s0]->checksum != func_800B68F4(temp_s0)) { - // D_8018D9C0[temp_s0]->ghostDataSaved = 0; + // if (gSomeDLBuffer[temp_s0]->checksum != func_800B68F4(temp_s0)) { + // gSomeDLBuffer[temp_s0]->ghostDataSaved = 0; // } if (((struct_8018EE10_entry*) (tmp + (temp_s0 << 7)))->checksum != func_800B68F4(temp_s0)) { ((struct_8018EE10_entry*) (tmp + (temp_s0 << 7)))->ghostDataSaved = 0; @@ -972,7 +972,7 @@ u8 func_800B68F4(s32 arg0) { s32 i; checksum = 0; for (i = 0; i < 0x43; i++) { - u8* addr = &((u8*) D_8018D9C0)[arg0]; + u8* addr = &((u8*) gSomeDLBuffer)[arg0]; checksum += addr[i] * multiplier + i; } return checksum;