diff --git a/Makefile b/Makefile index 4aa93ae3..5c53185b 100755 --- a/Makefile +++ b/Makefile @@ -4,11 +4,21 @@ SHELL := /bin/bash -########################### Version ########################## +################## Preprocessor definitions ################## # Currently, only US 1.0 is supported. VERSION := us_1.0 +NON_MATCHING ?= 0 +$(eval $(call validate-option,NON_MATCHING,0 1)) + +ifeq ($(VERSION),us_1.0) + DEFINES += VERSION_US_1_0=1 +endif +ifeq ($(NON_MATCHING),1) + DEFINES += NON_MATCHING=1 +endif + ############################ Setup ########################### # Don't do setup checks if cleaning. @@ -123,9 +133,12 @@ OBJCOPY = $(CROSS)objcopy --pad-to=0xC00000 --gap-fill=0xFF MIPSISET := -mips1 OPT_FLAGS := -O2 -ASFLAGS = -mtune=vr4300 -march=vr4300 $(INCLUDE_FLAGS) +C_DEFINES := $(foreach d,$(DEFINES),-D$(d)) +DEF_INC_CFLAGS := $(foreach i,$(INCLUDE_DIRS),-I$(i)) $(C_DEFINES) + +ASFLAGS = -mtune=vr4300 -march=vr4300 $(foreach d,$(DEFINES),--defsym $(d)) INCLUDE_CFLAGS := -I include -I $(BUILD_DIR) -I $(BUILD_DIR)/include -I src -I . -CFLAGS = -c -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -Xfullwarn -signed $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(MIPSISET) +CFLAGS = -c -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -Xfullwarn -signed $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(MIPSISET) $(DEF_INC_CFLAGS) LDFLAGS = undefined_syms.txt -T $(LD_SCRIPT) -Map $(BUILD_DIR)/dkr.map ####################### Other Tools ######################### @@ -445,7 +458,11 @@ $(BUILD_DIR)/$(TARGET).z64: $(BUILD_DIR)/$(TARGET).bin | $(ALL_ASSETS_BUILT) cp $< $@ $(FIXCHECKSUMS) $(N64CRC) $@ +ifeq ($(NON_MATCHING),0) sha1sum -c sha1/dkr.$(VERSION).sha1 +else + @echo "Build complete!" +endif $(BUILD_DIR)/$(TARGET).hex: $(BUILD_DIR)/$(TARGET).z64 xxd $< > $@ diff --git a/README.md b/README.md index 33d74259..eadb31ac 100755 --- a/README.md +++ b/README.md @@ -27,6 +27,16 @@ Currently, only the US 1.0 version of the game is supported. US 1.1, EU 1.0, EU 3. Run `make` in the main directory. **a.** Use the `-jN` argument to use `N` number of threads to speed up building. For example, if you have a system with 4 cores / 4 threads, you should do `make -j4`. +## Modding + +If you are modifying the code in the repo, then you should add `NON_MATCHING=1` to the make command: `make NON_MATCHING=1 -j4` + +## Style Guide + +This repo is following the same style guide as the SM64 decomp project, which can be found here: https://docs.google.com/document/d/1T_6dUj32QOscrMOMDsr7bY0esohswEAstKCO4gFn6t0 + +If you see variables/functions/structs/etc. that doesn't follow these rules, then file an issue and we'll try to fix them. + ## Scripts There are some useful scripts that should be kept in mind when working on this repo. @@ -37,25 +47,29 @@ There are some useful scripts that should be kept in mind when working on this r This script will extract all the assets from a DKR ROM and place them into `/assets/` folder according to the config file within the `/extract-ver/` folder. The version parameter should either be `us_1.0`, `us_1.1`, `eu_1.0`, `eu_1.1`, or `jp`. ---- - -#### `./rename_sym.sh ` - -This script will rename an existing symbol within the repo with a new one. - -Example: `./rename_sym.sh D_A4001000 SP_IMEM` +Example: `./extract.sh us_1.0` --- -#### `./score.sh` +#### `./diff.sh ` -Prints out the current completion percentage of the decomp. You do need to have an `OK` build for this to work properly. +Compares the assembly output of a function from a built ROM to the base ROM. Useful for decompiling. + +Example: `./diff.sh menu_init` + +--- + +#### `./rename.sh ` + +This script will rename an existing symbol, file name, and/or folder name within the repo with a new one. + +Example: `./rename.sh D_A4001000 SP_IMEM` --- #### `./get_symbol.sh ` -Will return the symbol associated with the RAM address within `undefined_syms.txt`. The RAM address must be in base 16. The `0x` prefix is not required. +Will return the symbol associated with the RAM address found in `/build/us_1.0/dkr.map`. The RAM address must be in base 16. The `0x` prefix is not required. Example: ``` @@ -65,25 +79,76 @@ Example: --- -## TODO list +#### `./score.sh` -TODO: Add more things to the TODO list. +Prints out the current completion percentage of the decomp. You do need to have an `OK` build for this to work properly. + +The scoring is split into 2 sections: +1. Assembly to C Decompilation (Adventure One) +2. Cleanup and Documentation (Adventure Two) + +Show scores for Adventure One & Adventure Two: `./score.sh` +Show score for Adventure One only: `./score.sh -a 1` +Show score for Adventure Two only: `./score.sh -a 2` +Show top 10 files remaining: `./score.sh -t 10` + +To make progress in Adventure 2, a function must be properly named (must not start with `func_`) and also include a doxygen comment above it. + +For example: +```c +/** + * Returns 1 if Drumstick is avaliable to use, or 0 if not. + */ +s32 is_drumstick_unlocked(void) { + return gActiveMagicCodes & 2; +} +``` + +As of June 13th 2021, this is our current score: +``` +======================================================= + ADVENTURE ONE (ASM -> C Decompilation) + ------------------- 9.15% Complete ------------------- + # Decompiled functions: 677 + # GLOBAL_ASM remaining: 1076 + --------------------- Game Status --------------------- + Balloons: 6/47, Keys: 1/4, Trophies: 0/5 + T.T. Amulets: 0/4, Wizpig Amulets: 0/4 + ------------------------------------------------------- + We are racing in Jungle Falls. (Lap 1/3) + ======================================================= + ADVENTURE TWO (Cleanup & Documentation) + ------------------- 0.01% Complete ------------------- + # Documented functions: 4 + # Undocumented remaining: 1749 + --------------------- Game Status --------------------- + Balloons: 0/47, Keys: 0/4, Trophies: 0/5 + T.T. Amulets: 0/4, Wizpig Amulets: 0/4 + ------------------------------------------------------- + We are collecting the first balloon on Timber's Island. + ======================================================= +``` + +--- + +## TODO list ### Major What should be focused on. * Decompiling the asm files into matching c files. +* Documenting variables & functions ### Minor What can be done, but not essential. * Figuring out the formats for the assets in the /assets/ folder. +* Creating tools to modify assets ### Future These features won't be complete anytime soon. -* Make the ROM fully shiftable. * Add support for the other 4 versions. diff --git a/asm/non_matchings/unknown_001050/func_800015F8.s b/asm/non_matchings/audio/func_800015F8.s similarity index 100% rename from asm/non_matchings/unknown_001050/func_800015F8.s rename to asm/non_matchings/audio/func_800015F8.s diff --git a/asm/non_matchings/unknown_001050/func_80001D04.s b/asm/non_matchings/audio/func_80001D04.s similarity index 100% rename from asm/non_matchings/unknown_001050/func_80001D04.s rename to asm/non_matchings/audio/func_80001D04.s diff --git a/asm/non_matchings/unknown_001050/func_80001FB8.s b/asm/non_matchings/audio/func_80001FB8.s similarity index 100% rename from asm/non_matchings/unknown_001050/func_80001FB8.s rename to asm/non_matchings/audio/func_80001FB8.s diff --git a/asm/non_matchings/unknown_001050/func_80002224.s b/asm/non_matchings/audio/func_80002224.s similarity index 100% rename from asm/non_matchings/unknown_001050/func_80002224.s rename to asm/non_matchings/audio/func_80002224.s diff --git a/asm/non_matchings/unknown_001050/func_8000232C.s b/asm/non_matchings/audio/func_8000232C.s similarity index 100% rename from asm/non_matchings/unknown_001050/func_8000232C.s rename to asm/non_matchings/audio/func_8000232C.s diff --git a/asm/non_matchings/unknown_080500/DrawMenuText.s b/asm/non_matchings/menu/DrawMenuText.s similarity index 100% rename from asm/non_matchings/unknown_080500/DrawMenuText.s rename to asm/non_matchings/menu/DrawMenuText.s diff --git a/asm/non_matchings/unknown_080500/MenuBootInit.s b/asm/non_matchings/menu/MenuBootInit.s similarity index 100% rename from asm/non_matchings/unknown_080500/MenuBootInit.s rename to asm/non_matchings/menu/MenuBootInit.s diff --git a/asm/non_matchings/unknown_080500/MenuBootLoop.s b/asm/non_matchings/menu/MenuBootLoop.s similarity index 100% rename from asm/non_matchings/unknown_080500/MenuBootLoop.s rename to asm/non_matchings/menu/MenuBootLoop.s diff --git a/asm/non_matchings/unknown_080500/func_8007F900.s b/asm/non_matchings/menu/func_8007F900.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8007F900.s rename to asm/non_matchings/menu/func_8007F900.s diff --git a/asm/non_matchings/unknown_080500/func_8007FFEC.s b/asm/non_matchings/menu/func_8007FFEC.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8007FFEC.s rename to asm/non_matchings/menu/func_8007FFEC.s diff --git a/asm/non_matchings/unknown_080500/func_80080580.s b/asm/non_matchings/menu/func_80080580.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80080580.s rename to asm/non_matchings/menu/func_80080580.s diff --git a/asm/non_matchings/unknown_080500/func_80080BC8.s b/asm/non_matchings/menu/func_80080BC8.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80080BC8.s rename to asm/non_matchings/menu/func_80080BC8.s diff --git a/asm/non_matchings/unknown_080500/func_80080E90.s b/asm/non_matchings/menu/func_80080E90.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80080E90.s rename to asm/non_matchings/menu/func_80080E90.s diff --git a/asm/non_matchings/unknown_080500/func_80081218.s b/asm/non_matchings/menu/func_80081218.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80081218.s rename to asm/non_matchings/menu/func_80081218.s diff --git a/asm/non_matchings/unknown_080500/func_80081C04.s b/asm/non_matchings/menu/func_80081C04.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80081C04.s rename to asm/non_matchings/menu/func_80081C04.s diff --git a/asm/non_matchings/unknown_080500/func_80081F4C.s b/asm/non_matchings/menu/func_80081F4C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80081F4C.s rename to asm/non_matchings/menu/func_80081F4C.s diff --git a/asm/non_matchings/unknown_080500/func_80083098.s b/asm/non_matchings/menu/func_80083098.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80083098.s rename to asm/non_matchings/menu/func_80083098.s diff --git a/asm/non_matchings/unknown_080500/func_8008377C.s b/asm/non_matchings/menu/func_8008377C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008377C.s rename to asm/non_matchings/menu/func_8008377C.s diff --git a/asm/non_matchings/unknown_080500/func_80084854.s b/asm/non_matchings/menu/func_80084854.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80084854.s rename to asm/non_matchings/menu/func_80084854.s diff --git a/asm/non_matchings/unknown_080500/func_800853D0.s b/asm/non_matchings/menu/func_800853D0.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_800853D0.s rename to asm/non_matchings/menu/func_800853D0.s diff --git a/asm/non_matchings/unknown_080500/func_80085B9C.s b/asm/non_matchings/menu/func_80085B9C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80085B9C.s rename to asm/non_matchings/menu/func_80085B9C.s diff --git a/asm/non_matchings/unknown_080500/func_800862C4.s b/asm/non_matchings/menu/func_800862C4.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_800862C4.s rename to asm/non_matchings/menu/func_800862C4.s diff --git a/asm/non_matchings/unknown_080500/func_800867D4.s b/asm/non_matchings/menu/func_800867D4.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_800867D4.s rename to asm/non_matchings/menu/func_800867D4.s diff --git a/asm/non_matchings/unknown_080500/func_80086A48.s b/asm/non_matchings/menu/func_80086A48.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80086A48.s rename to asm/non_matchings/menu/func_80086A48.s diff --git a/asm/non_matchings/unknown_080500/func_80086AFC.s b/asm/non_matchings/menu/func_80086AFC.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80086AFC.s rename to asm/non_matchings/menu/func_80086AFC.s diff --git a/asm/non_matchings/unknown_080500/func_800871D8.s b/asm/non_matchings/menu/func_800871D8.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_800871D8.s rename to asm/non_matchings/menu/func_800871D8.s diff --git a/asm/non_matchings/unknown_080500/func_80087734.s b/asm/non_matchings/menu/func_80087734.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80087734.s rename to asm/non_matchings/menu/func_80087734.s diff --git a/asm/non_matchings/unknown_080500/func_80087F14.s b/asm/non_matchings/menu/func_80087F14.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80087F14.s rename to asm/non_matchings/menu/func_80087F14.s diff --git a/asm/non_matchings/unknown_080500/func_8008832C.s b/asm/non_matchings/menu/func_8008832C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008832C.s rename to asm/non_matchings/menu/func_8008832C.s diff --git a/asm/non_matchings/unknown_080500/func_80088938.s b/asm/non_matchings/menu/func_80088938.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80088938.s rename to asm/non_matchings/menu/func_80088938.s diff --git a/asm/non_matchings/unknown_080500/func_800890AC.s b/asm/non_matchings/menu/func_800890AC.s similarity index 99% rename from asm/non_matchings/unknown_080500/func_800890AC.s rename to asm/non_matchings/menu/func_800890AC.s index b84cb301..3639a67b 100644 --- a/asm/non_matchings/unknown_080500/func_800890AC.s +++ b/asm/non_matchings/menu/func_800890AC.s @@ -338,7 +338,7 @@ glabel func_800890AC /* 08A170 80089570 AD2C0000 */ sw $t4, ($t1) /* 08A174 80089574 0C022569 */ jal func_800895A4 /* 08A178 80089578 00000000 */ nop -/* 08A17C 8008957C 0C0204F4 */ jal MenuInit +/* 08A17C 8008957C 0C0204F4 */ jal menu_init /* 08A180 80089580 24040001 */ li $a0, 1 /* 08A184 80089584 24040015 */ li $a0, 21 /* 08A188 80089588 2405FFFF */ li $a1, -1 diff --git a/asm/non_matchings/unknown_080500/func_800896A4.s b/asm/non_matchings/menu/func_800896A4.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_800896A4.s rename to asm/non_matchings/menu/func_800896A4.s diff --git a/asm/non_matchings/unknown_080500/func_8008A56C.s b/asm/non_matchings/menu/func_8008A56C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008A56C.s rename to asm/non_matchings/menu/func_8008A56C.s diff --git a/asm/non_matchings/unknown_080500/func_8008AD44.s b/asm/non_matchings/menu/func_8008AD44.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008AD44.s rename to asm/non_matchings/menu/func_8008AD44.s diff --git a/asm/non_matchings/unknown_080500/func_8008B358.s b/asm/non_matchings/menu/func_8008B358.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008B358.s rename to asm/non_matchings/menu/func_8008B358.s diff --git a/asm/non_matchings/unknown_080500/func_8008B4C8.s b/asm/non_matchings/menu/func_8008B4C8.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008B4C8.s rename to asm/non_matchings/menu/func_8008B4C8.s diff --git a/asm/non_matchings/unknown_080500/func_8008B758.s b/asm/non_matchings/menu/func_8008B758.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008B758.s rename to asm/non_matchings/menu/func_8008B758.s diff --git a/asm/non_matchings/unknown_080500/func_8008BB3C.s b/asm/non_matchings/menu/func_8008BB3C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008BB3C.s rename to asm/non_matchings/menu/func_8008BB3C.s diff --git a/asm/non_matchings/unknown_080500/func_8008C168.s b/asm/non_matchings/menu/func_8008C168.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008C168.s rename to asm/non_matchings/menu/func_8008C168.s diff --git a/asm/non_matchings/unknown_080500/func_8008C698.s b/asm/non_matchings/menu/func_8008C698.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008C698.s rename to asm/non_matchings/menu/func_8008C698.s diff --git a/asm/non_matchings/unknown_080500/func_8008CC28.s b/asm/non_matchings/menu/func_8008CC28.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008CC28.s rename to asm/non_matchings/menu/func_8008CC28.s diff --git a/asm/non_matchings/unknown_080500/func_8008CD74.s b/asm/non_matchings/menu/func_8008CD74.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008CD74.s rename to asm/non_matchings/menu/func_8008CD74.s diff --git a/asm/non_matchings/unknown_080500/func_8008D5F8.s b/asm/non_matchings/menu/func_8008D5F8.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008D5F8.s rename to asm/non_matchings/menu/func_8008D5F8.s diff --git a/asm/non_matchings/unknown_080500/func_8008D8BC.s b/asm/non_matchings/menu/func_8008D8BC.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008D8BC.s rename to asm/non_matchings/menu/func_8008D8BC.s diff --git a/asm/non_matchings/unknown_080500/func_8008DC7C.s b/asm/non_matchings/menu/func_8008DC7C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008DC7C.s rename to asm/non_matchings/menu/func_8008DC7C.s diff --git a/asm/non_matchings/unknown_080500/func_8008E4EC.s b/asm/non_matchings/menu/func_8008E4EC.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008E4EC.s rename to asm/non_matchings/menu/func_8008E4EC.s diff --git a/asm/non_matchings/unknown_080500/func_8008F00C.s b/asm/non_matchings/menu/func_8008F00C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008F00C.s rename to asm/non_matchings/menu/func_8008F00C.s diff --git a/asm/non_matchings/unknown_080500/func_8008F618.s b/asm/non_matchings/menu/func_8008F618.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008F618.s rename to asm/non_matchings/menu/func_8008F618.s diff --git a/asm/non_matchings/unknown_080500/func_8008FA54.s b/asm/non_matchings/menu/func_8008FA54.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008FA54.s rename to asm/non_matchings/menu/func_8008FA54.s diff --git a/asm/non_matchings/unknown_080500/func_8008FF1C.s b/asm/non_matchings/menu/func_8008FF1C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8008FF1C.s rename to asm/non_matchings/menu/func_8008FF1C.s diff --git a/asm/non_matchings/unknown_080500/func_800904E8.s b/asm/non_matchings/menu/func_800904E8.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_800904E8.s rename to asm/non_matchings/menu/func_800904E8.s diff --git a/asm/non_matchings/unknown_080500/func_80090918.s b/asm/non_matchings/menu/func_80090918.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80090918.s rename to asm/non_matchings/menu/func_80090918.s diff --git a/asm/non_matchings/unknown_080500/func_80090F30.s b/asm/non_matchings/menu/func_80090F30.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80090F30.s rename to asm/non_matchings/menu/func_80090F30.s diff --git a/asm/non_matchings/unknown_080500/func_80092188.s b/asm/non_matchings/menu/func_80092188.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80092188.s rename to asm/non_matchings/menu/func_80092188.s diff --git a/asm/non_matchings/unknown_080500/func_80092E94.s b/asm/non_matchings/menu/func_80092E94.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80092E94.s rename to asm/non_matchings/menu/func_80092E94.s diff --git a/asm/non_matchings/unknown_080500/func_80093A40.s b/asm/non_matchings/menu/func_80093A40.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80093A40.s rename to asm/non_matchings/menu/func_80093A40.s diff --git a/asm/non_matchings/unknown_080500/func_80093D40.s b/asm/non_matchings/menu/func_80093D40.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80093D40.s rename to asm/non_matchings/menu/func_80093D40.s diff --git a/asm/non_matchings/unknown_080500/func_80094170.s b/asm/non_matchings/menu/func_80094170.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80094170.s rename to asm/non_matchings/menu/func_80094170.s diff --git a/asm/non_matchings/unknown_080500/func_80094688.s b/asm/non_matchings/menu/func_80094688.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80094688.s rename to asm/non_matchings/menu/func_80094688.s diff --git a/asm/non_matchings/unknown_080500/func_80094A5C.s b/asm/non_matchings/menu/func_80094A5C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80094A5C.s rename to asm/non_matchings/menu/func_80094A5C.s diff --git a/asm/non_matchings/unknown_080500/func_80094D28.s b/asm/non_matchings/menu/func_80094D28.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80094D28.s rename to asm/non_matchings/menu/func_80094D28.s diff --git a/asm/non_matchings/unknown_080500/func_80095624.s b/asm/non_matchings/menu/func_80095624.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80095624.s rename to asm/non_matchings/menu/func_80095624.s diff --git a/asm/non_matchings/unknown_080500/func_80095728.s b/asm/non_matchings/menu/func_80095728.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80095728.s rename to asm/non_matchings/menu/func_80095728.s diff --git a/asm/non_matchings/unknown_080500/func_80096978.s b/asm/non_matchings/menu/func_80096978.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80096978.s rename to asm/non_matchings/menu/func_80096978.s diff --git a/asm/non_matchings/unknown_080500/func_800977D0.s b/asm/non_matchings/menu/func_800977D0.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_800977D0.s rename to asm/non_matchings/menu/func_800977D0.s diff --git a/asm/non_matchings/unknown_080500/func_80097918.s b/asm/non_matchings/menu/func_80097918.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80097918.s rename to asm/non_matchings/menu/func_80097918.s diff --git a/asm/non_matchings/unknown_080500/func_80097D10.s b/asm/non_matchings/menu/func_80097D10.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80097D10.s rename to asm/non_matchings/menu/func_80097D10.s diff --git a/asm/non_matchings/unknown_080500/func_80098774.s b/asm/non_matchings/menu/func_80098774.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80098774.s rename to asm/non_matchings/menu/func_80098774.s diff --git a/asm/non_matchings/unknown_080500/func_80098EBC.s b/asm/non_matchings/menu/func_80098EBC.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80098EBC.s rename to asm/non_matchings/menu/func_80098EBC.s diff --git a/asm/non_matchings/unknown_080500/func_8009963C.s b/asm/non_matchings/menu/func_8009963C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8009963C.s rename to asm/non_matchings/menu/func_8009963C.s diff --git a/asm/non_matchings/unknown_080500/func_800998E0.s b/asm/non_matchings/menu/func_800998E0.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_800998E0.s rename to asm/non_matchings/menu/func_800998E0.s diff --git a/asm/non_matchings/unknown_080500/func_80099E8C.s b/asm/non_matchings/menu/func_80099E8C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_80099E8C.s rename to asm/non_matchings/menu/func_80099E8C.s diff --git a/asm/non_matchings/unknown_080500/func_8009B1E4.s b/asm/non_matchings/menu/func_8009B1E4.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8009B1E4.s rename to asm/non_matchings/menu/func_8009B1E4.s diff --git a/asm/non_matchings/unknown_080500/func_8009BF20.s b/asm/non_matchings/menu/func_8009BF20.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8009BF20.s rename to asm/non_matchings/menu/func_8009BF20.s diff --git a/asm/non_matchings/unknown_080500/func_8009C6D4.s b/asm/non_matchings/menu/func_8009C6D4.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8009C6D4.s rename to asm/non_matchings/menu/func_8009C6D4.s diff --git a/asm/non_matchings/unknown_080500/func_8009CA60.s b/asm/non_matchings/menu/func_8009CA60.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8009CA60.s rename to asm/non_matchings/menu/func_8009CA60.s diff --git a/asm/non_matchings/unknown_080500/func_8009CD7C.s b/asm/non_matchings/menu/func_8009CD7C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8009CD7C.s rename to asm/non_matchings/menu/func_8009CD7C.s diff --git a/asm/non_matchings/unknown_080500/func_8009CFEC.s b/asm/non_matchings/menu/func_8009CFEC.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8009CFEC.s rename to asm/non_matchings/menu/func_8009CFEC.s diff --git a/asm/non_matchings/unknown_080500/func_8009D360.s b/asm/non_matchings/menu/func_8009D360.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8009D360.s rename to asm/non_matchings/menu/func_8009D360.s diff --git a/asm/non_matchings/unknown_080500/func_8009DB3C.s b/asm/non_matchings/menu/func_8009DB3C.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8009DB3C.s rename to asm/non_matchings/menu/func_8009DB3C.s diff --git a/asm/non_matchings/unknown_080500/func_8009E3D0.s b/asm/non_matchings/menu/func_8009E3D0.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8009E3D0.s rename to asm/non_matchings/menu/func_8009E3D0.s diff --git a/asm/non_matchings/unknown_080500/func_8009E7E8.s b/asm/non_matchings/menu/func_8009E7E8.s similarity index 100% rename from asm/non_matchings/unknown_080500/func_8009E7E8.s rename to asm/non_matchings/menu/func_8009E7E8.s diff --git a/asm/non_matchings/unknown_080500/Menu17Loop.s b/asm/non_matchings/menu/menu_23_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/Menu17Loop.s rename to asm/non_matchings/menu/menu_23_loop.s index 2c2d76bc..e0fb4c48 100644 --- a/asm/non_matchings/unknown_080500/Menu17Loop.s +++ b/asm/non_matchings/menu/menu_23_loop.s @@ -1,4 +1,4 @@ -glabel Menu17Loop +glabel menu_23_loop /* 09B8FC 8009ACFC 27BDFFB8 */ addiu $sp, $sp, -0x48 /* 09B900 8009AD00 3C0E8012 */ lui $t6, %hi(D_801263C4) # $t6, 0x8012 /* 09B904 8009AD04 8DCE63C4 */ lw $t6, %lo(D_801263C4)($t6) diff --git a/asm/non_matchings/unknown_080500/MenuLoadNewAreaInit.s b/asm/non_matchings/menu/menu_5_init.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuLoadNewAreaInit.s rename to asm/non_matchings/menu/menu_5_init.s index 7d6e7857..df4450fa 100644 --- a/asm/non_matchings/unknown_080500/MenuLoadNewAreaInit.s +++ b/asm/non_matchings/menu/menu_5_init.s @@ -1,4 +1,4 @@ -glabel MenuLoadNewAreaInit +glabel menu_5_init /* 093884 80092C84 27BDFFD8 */ addiu $sp, $sp, -0x28 /* 093888 80092C88 AFBF001C */ sw $ra, 0x1c($sp) /* 09388C 80092C8C 0C01BAA4 */ jal get_settings diff --git a/asm/non_matchings/unknown_080500/MenuLoadNewAreaLoop.s b/asm/non_matchings/menu/menu_5_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuLoadNewAreaLoop.s rename to asm/non_matchings/menu/menu_5_loop.s index 493aad1a..d93da4bd 100644 --- a/asm/non_matchings/unknown_080500/MenuLoadNewAreaLoop.s +++ b/asm/non_matchings/menu/menu_5_loop.s @@ -1,4 +1,4 @@ -glabel MenuLoadNewAreaLoop +glabel menu_5_loop /* 094200 80093600 3C0E8012 */ lui $t6, %hi(D_801263E0) # $t6, 0x8012 /* 094204 80093604 8DCE63E0 */ lw $t6, %lo(D_801263E0)($t6) /* 094208 80093608 27BDFFC8 */ addiu $sp, $sp, -0x38 diff --git a/asm/non_matchings/unknown_080500/MenuAudioOptionsLoop.s b/asm/non_matchings/menu/menu_audio_options_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuAudioOptionsLoop.s rename to asm/non_matchings/menu/menu_audio_options_loop.s index b3a1c9a5..4ba74c0d 100644 --- a/asm/non_matchings/unknown_080500/MenuAudioOptionsLoop.s +++ b/asm/non_matchings/menu/menu_audio_options_loop.s @@ -1,4 +1,4 @@ -glabel MenuAudioOptionsLoop +glabel menu_audio_options_loop /* 085874 80084C74 3C038012 */ lui $v1, %hi(D_801263BC) # $v1, 0x8012 /* 085878 80084C78 246363BC */ addiu $v1, %lo(D_801263BC) # addiu $v1, $v1, 0x63bc /* 08587C 80084C7C 8C6E0000 */ lw $t6, ($v1) @@ -377,7 +377,7 @@ glabel MenuAudioOptionsLoop /* 085DC8 800851C8 00000000 */ nop /* 085DCC 800851CC 0C02147F */ jal func_800851FC /* 085DD0 800851D0 00000000 */ nop -/* 085DD4 800851D4 0C0204F4 */ jal MenuInit +/* 085DD4 800851D4 0C0204F4 */ jal menu_init /* 085DD8 800851D8 2404000C */ li $a0, 12 /* 085DDC 800851DC 10000003 */ b .L800851EC /* 085DE0 800851E0 00001025 */ move $v0, $zero diff --git a/asm/non_matchings/unknown_080500/MenuCharacterSelectInit.s b/asm/non_matchings/menu/menu_character_select_init.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuCharacterSelectInit.s rename to asm/non_matchings/menu/menu_character_select_init.s index 5c9c47a6..9403ddbd 100644 --- a/asm/non_matchings/unknown_080500/MenuCharacterSelectInit.s +++ b/asm/non_matchings/menu/menu_character_select_init.s @@ -1,4 +1,4 @@ -glabel MenuCharacterSelectInit +glabel menu_character_select_init /* 08BBCC 8008AFCC 27BDFFD0 */ addiu $sp, $sp, -0x30 /* 08BBD0 8008AFD0 AFBF002C */ sw $ra, 0x2c($sp) /* 08BBD4 8008AFD4 AFB1001C */ sw $s1, 0x1c($sp) diff --git a/asm/non_matchings/unknown_080500/MenuCharacterSelectLoop.s b/asm/non_matchings/menu/menu_character_select_loop.s similarity index 97% rename from asm/non_matchings/unknown_080500/MenuCharacterSelectLoop.s rename to asm/non_matchings/menu/menu_character_select_loop.s index e790367d..b22ccee3 100644 --- a/asm/non_matchings/unknown_080500/MenuCharacterSelectLoop.s +++ b/asm/non_matchings/menu/menu_character_select_loop.s @@ -1,4 +1,4 @@ -glabel MenuCharacterSelectLoop +glabel menu_character_select_loop /* 08C924 8008BD24 27BDFFD0 */ addiu $sp, $sp, -0x30 /* 08C928 8008BD28 AFBF0014 */ sw $ra, 0x14($sp) /* 08C92C 8008BD2C 0C022C83 */ jal func_8008B20C @@ -143,12 +143,12 @@ glabel MenuCharacterSelectLoop /* 08CB3C 8008BF3C 00000000 */ nop /* 08CB40 8008BF40 15A00005 */ bnez $t5, .L8008BF58 /* 08CB44 8008BF44 00000000 */ nop -/* 08CB48 8008BF48 0C0204F4 */ jal MenuInit +/* 08CB48 8008BF48 0C0204F4 */ jal menu_init /* 08CB4C 8008BF4C 2404001C */ li $a0, 28 /* 08CB50 8008BF50 10000021 */ b .L8008BFD8 /* 08CB54 8008BF54 00001025 */ move $v0, $zero .L8008BF58: -/* 08CB58 8008BF58 0C0204F4 */ jal MenuInit +/* 08CB58 8008BF58 0C0204F4 */ jal menu_init /* 08CB5C 8008BF5C 24040013 */ li $a0, 19 /* 08CB60 8008BF60 1000001D */ b .L8008BFD8 /* 08CB64 8008BF64 00001025 */ move $v0, $zero @@ -159,7 +159,7 @@ glabel MenuCharacterSelectLoop /* 08CB74 8008BF74 00000000 */ nop /* 08CB78 8008BF78 0C01B96F */ jal func_8006E5BC /* 08CB7C 8008BF7C 00000000 */ nop -/* 08CB80 8008BF80 0C0204F4 */ jal MenuInit +/* 08CB80 8008BF80 0C0204F4 */ jal menu_init /* 08CB84 8008BF84 2404000F */ li $a0, 15 /* 08CB88 8008BF88 10000013 */ b .L8008BFD8 /* 08CB8C 8008BF8C 00001025 */ move $v0, $zero @@ -179,7 +179,7 @@ glabel MenuCharacterSelectLoop /* 08CBC0 8008BFC0 240A0001 */ li $t2, 1 /* 08CBC4 8008BFC4 3C01800E */ lui $at, %hi(D_800DF4BC) # $at, 0x800e /* 08CBC8 8008BFC8 AC2AF4BC */ sw $t2, %lo(D_800DF4BC)($at) -/* 08CBCC 8008BFCC 0C0204F4 */ jal MenuInit +/* 08CBCC 8008BFCC 0C0204F4 */ jal menu_init /* 08CBD0 8008BFD0 00002025 */ move $a0, $zero .L8008BFD4: /* 08CBD4 8008BFD4 00001025 */ move $v0, $zero diff --git a/asm/non_matchings/unknown_080500/MenuCreditsLoop.s b/asm/non_matchings/menu/menu_credits_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuCreditsLoop.s rename to asm/non_matchings/menu/menu_credits_loop.s index b0369978..edf3e154 100644 --- a/asm/non_matchings/unknown_080500/MenuCreditsLoop.s +++ b/asm/non_matchings/menu/menu_credits_loop.s @@ -3,7 +3,7 @@ glabel jpt_800E8574 .word L8009BA98, L8009BAD8, L8009BB08, L8009BB48, L8009BB9C .text -glabel MenuCreditsLoop +glabel menu_credits_loop /* 09BF2C 8009B32C 27BDFF78 */ addiu $sp, $sp, -0x88 /* 09BF30 8009B330 AFBF0054 */ sw $ra, 0x54($sp) /* 09BF34 8009B334 AFA40088 */ sw $a0, 0x88($sp) @@ -665,7 +665,7 @@ glabel L8009BB9C /* 09C8A0 8009BCA0 2405FFFF */ li $a1, -1 /* 09C8A4 8009BCA4 0C01B8BA */ jal func_8006E2E8 /* 09C8A8 8009BCA8 00003025 */ move $a2, $zero -/* 09C8AC 8009BCAC 0C0204F4 */ jal MenuInit +/* 09C8AC 8009BCAC 0C0204F4 */ jal menu_init /* 09C8B0 8009BCB0 24040001 */ li $a0, 1 .L8009BCB4: /* 09C8B4 8009BCB4 8FBF0054 */ lw $ra, 0x54($sp) diff --git a/asm/non_matchings/unknown_080500/MenuGameSelectLoop.s b/asm/non_matchings/menu/menu_file_select_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuGameSelectLoop.s rename to asm/non_matchings/menu/menu_file_select_loop.s index d76e05d6..ee42ef38 100644 --- a/asm/non_matchings/unknown_080500/MenuGameSelectLoop.s +++ b/asm/non_matchings/menu/menu_file_select_loop.s @@ -1,4 +1,4 @@ -glabel MenuGameSelectLoop +glabel menu_file_select_loop /* 08EA70 8008DE70 27BDFFB8 */ addiu $sp, $sp, -0x48 /* 08EA74 8008DE74 AFBF0024 */ sw $ra, 0x24($sp) /* 08EA78 8008DE78 0C01BAA4 */ jal get_settings @@ -356,7 +356,7 @@ glabel MenuGameSelectLoop /* 08EFA4 8008E3A4 AFA00010 */ sw $zero, 0x10($sp) /* 08EFA8 8008E3A8 0C026AF6 */ jal func_8009ABD8 /* 08EFAC 8008E3AC AFA00014 */ sw $zero, 0x14($sp) -/* 08EFB0 8008E3B0 0C0204F4 */ jal MenuInit +/* 08EFB0 8008E3B0 0C0204F4 */ jal menu_init /* 08EFB4 8008E3B4 24040017 */ li $a0, 23 /* 08EFB8 8008E3B8 10000017 */ b .L8008E418 /* 08EFBC 8008E3BC 00001025 */ move $v0, $zero @@ -382,7 +382,7 @@ glabel MenuGameSelectLoop /* 08EFFC 8008E3FC 00001025 */ move $v0, $zero /* 08F000 8008E400 0C02390A */ jal func_8008E428 /* 08F004 8008E404 00000000 */ nop -/* 08F008 8008E408 0C0204F4 */ jal MenuInit +/* 08F008 8008E408 0C0204F4 */ jal menu_init /* 08F00C 8008E40C 24040013 */ li $a0, 19 /* 08F010 8008E410 10000001 */ b .L8008E418 /* 08F014 8008E414 00001025 */ move $v0, $zero diff --git a/asm/non_matchings/unknown_080500/MenuGameSelectInit.s b/asm/non_matchings/menu/menu_game_select_init.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuGameSelectInit.s rename to asm/non_matchings/menu/menu_game_select_init.s index db16ebf4..baa726bd 100644 --- a/asm/non_matchings/unknown_080500/MenuGameSelectInit.s +++ b/asm/non_matchings/menu/menu_game_select_init.s @@ -1,4 +1,4 @@ -glabel MenuGameSelectInit +glabel menu_game_select_init /* 08D108 8008C508 3C01800E */ lui $at, %hi(D_800DF47C) # $at, 0x800e /* 08D10C 8008C50C 27BDFFD0 */ addiu $sp, $sp, -0x30 /* 08D110 8008C510 AC20F47C */ sw $zero, %lo(D_800DF47C)($at) diff --git a/asm/non_matchings/unknown_080500/MenuFileSelectLoop.s b/asm/non_matchings/menu/menu_game_select_loop.s similarity index 98% rename from asm/non_matchings/unknown_080500/MenuFileSelectLoop.s rename to asm/non_matchings/menu/menu_game_select_loop.s index d4ff9c24..cacef127 100644 --- a/asm/non_matchings/unknown_080500/MenuFileSelectLoop.s +++ b/asm/non_matchings/menu/menu_game_select_loop.s @@ -1,4 +1,4 @@ -glabel MenuFileSelectLoop +glabel menu_game_select_loop /* 08D3BC 8008C7BC 27BDFFD8 */ addiu $sp, $sp, -0x28 /* 08D3C0 8008C7C0 AFBF0014 */ sw $ra, 0x14($sp) /* 08D3C4 8008C7C4 0C02305A */ jal func_8008C168 @@ -64,7 +64,7 @@ glabel MenuFileSelectLoop /* 08D4A4 8008C8A4 2405FFFF */ li $a1, -1 /* 08D4A8 8008C8A8 0C01B8BA */ jal func_8006E2E8 /* 08D4AC 8008C8AC 00003025 */ move $a2, $zero -/* 08D4B0 8008C8B0 0C0204F4 */ jal MenuInit +/* 08D4B0 8008C8B0 0C0204F4 */ jal menu_init /* 08D4B4 8008C8B4 2404000F */ li $a0, 15 /* 08D4B8 8008C8B8 10000080 */ b .L8008CABC /* 08D4BC 8008C8BC 00001025 */ move $v0, $zero @@ -75,7 +75,7 @@ glabel MenuFileSelectLoop /* 08D4CC 8008C8CC 3C018012 */ lui $at, %hi(gPlayerVehicle) # $at, 0x8012 /* 08D4D0 8008C8D0 0C01B6C5 */ jal func_8006DB14 /* 08D4D4 8008C8D4 A02069C0 */ sb $zero, %lo(gPlayerVehicle)($at) -/* 08D4D8 8008C8D8 0C0204F4 */ jal MenuInit +/* 08D4D8 8008C8D8 0C0204F4 */ jal menu_init /* 08D4DC 8008C8DC 24040006 */ li $a0, 6 /* 08D4E0 8008C8E0 10000076 */ b .L8008CABC /* 08D4E4 8008C8E4 00001025 */ move $v0, $zero @@ -105,7 +105,7 @@ glabel MenuFileSelectLoop /* 08D538 8008C938 00002025 */ move $a0, $zero /* 08D53C 8008C93C 0C022BAD */ jal func_8008AEB4 /* 08D540 8008C940 00002825 */ move $a1, $zero -/* 08D544 8008C944 0C0204F4 */ jal MenuInit +/* 08D544 8008C944 0C0204F4 */ jal menu_init /* 08D548 8008C948 24040003 */ li $a0, 3 /* 08D54C 8008C94C 1000005B */ b .L8008CABC /* 08D550 8008C950 00001025 */ move $v0, $zero diff --git a/asm/non_matchings/unknown_080500/MenuGhostDataInit.s b/asm/non_matchings/menu/menu_ghost_data_init.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuGhostDataInit.s rename to asm/non_matchings/menu/menu_ghost_data_init.s index 1a866b0a..ad572cf6 100644 --- a/asm/non_matchings/unknown_080500/MenuGhostDataInit.s +++ b/asm/non_matchings/menu/menu_ghost_data_init.s @@ -1,4 +1,4 @@ -glabel MenuGhostDataInit +glabel menu_ghost_data_init /* 09A65C 80099A5C 27BDFF88 */ addiu $sp, $sp, -0x78 /* 09A660 80099A60 3C048012 */ lui $a0, %hi(D_801264D0) # $a0, 0x8012 /* 09A664 80099A64 3C0E8012 */ lui $t6, %hi(D_801264F8) # $t6, 0x8012 diff --git a/asm/non_matchings/unknown_080500/MenuGhostDataLoop.s b/asm/non_matchings/menu/menu_ghost_data_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuGhostDataLoop.s rename to asm/non_matchings/menu/menu_ghost_data_loop.s index e17c09b7..8f7b0426 100644 --- a/asm/non_matchings/unknown_080500/MenuGhostDataLoop.s +++ b/asm/non_matchings/menu/menu_ghost_data_loop.s @@ -1,4 +1,4 @@ -glabel MenuGhostDataLoop +glabel menu_ghost_data_loop /* 09B3D4 8009A7D4 3C038012 */ lui $v1, %hi(D_801263BC) # $v1, 0x8012 /* 09B3D8 8009A7D8 246363BC */ addiu $v1, %lo(D_801263BC) # addiu $v1, $v1, 0x63bc /* 09B3DC 8009A7DC 3C09800E */ lui $t1, %hi(D_800DF47C) # $t1, 0x800e @@ -263,7 +263,7 @@ glabel MenuGhostDataLoop /* 09B784 8009AB84 8FBF001C */ lw $ra, 0x1c($sp) /* 09B788 8009AB88 0C026AEB */ jal func_8009ABAC /* 09B78C 8009AB8C 00000000 */ nop -/* 09B790 8009AB90 0C0204F4 */ jal MenuInit +/* 09B790 8009AB90 0C0204F4 */ jal menu_init /* 09B794 8009AB94 2404000E */ li $a0, 14 /* 09B798 8009AB98 8FBF001C */ lw $ra, 0x1c($sp) .L8009AB9C: diff --git a/asm/non_matchings/unknown_080500/MenuInit.s b/asm/non_matchings/menu/menu_init.s similarity index 91% rename from asm/non_matchings/unknown_080500/MenuInit.s rename to asm/non_matchings/menu/menu_init.s index 9f595bce..f7aa20ca 100644 --- a/asm/non_matchings/unknown_080500/MenuInit.s +++ b/asm/non_matchings/menu/menu_init.s @@ -3,7 +3,7 @@ glabel jpt_800E8284 .word L80081464, L80081454, L8008158C, L800814C4, L8008158C, L80081504, L800814E4, L8008158C, L8008158C, L8008158C, L800814A4, L800814B4, L80081474, L80081484, L80081494, L800814F4, L8008158C, L80081514, L8008158C, L800814D4, L80081524, L80081534, L8008158C, L80081544, L80081554, L80081564, L80081574, L8008158C, L80081584 .text -glabel MenuInit +glabel menu_init /* 081FD0 800813D0 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 081FD4 800813D4 AFBF0014 */ sw $ra, 0x14($sp) /* 081FD8 800813D8 3C01800E */ lui $at, %hi(D_800DF470) # $at, 0x800e @@ -43,7 +43,7 @@ glabel L80081454 /* 08205C 8008145C 1000004C */ b .L80081590 /* 082060 80081460 8FBF0014 */ lw $ra, 0x14($sp) glabel L80081464 -/* 082064 80081464 0C020D4F */ jal MenuTitleScreenInit +/* 082064 80081464 0C020D4F */ jal menu_title_screen_init /* 082068 80081468 00000000 */ nop /* 08206C 8008146C 10000048 */ b .L80081590 /* 082070 80081470 8FBF0014 */ lw $ra, 0x14($sp) @@ -53,7 +53,7 @@ glabel L80081474 /* 08207C 8008147C 10000044 */ b .L80081590 /* 082080 80081480 8FBF0014 */ lw $ra, 0x14($sp) glabel L80081484 -/* 082084 80081484 0C0211D5 */ jal MenuAudioOptionsInit +/* 082084 80081484 0C0211D5 */ jal menu_audio_options_init /* 082088 80081488 00000000 */ nop /* 08208C 8008148C 10000040 */ b .L80081590 /* 082090 80081490 8FBF0014 */ lw $ra, 0x14($sp) @@ -73,12 +73,12 @@ glabel L800814B4 /* 0820BC 800814BC 10000034 */ b .L80081590 /* 0820C0 800814C0 8FBF0014 */ lw $ra, 0x14($sp) glabel L800814C4 -/* 0820C4 800814C4 0C022BF3 */ jal MenuCharacterSelectInit +/* 0820C4 800814C4 0C022BF3 */ jal menu_character_select_init /* 0820C8 800814C8 00000000 */ nop /* 0820CC 800814CC 10000030 */ b .L80081590 /* 0820D0 800814D0 8FBF0014 */ lw $ra, 0x14($sp) glabel L800814D4 -/* 0820D4 800814D4 0C023142 */ jal MenuGameSelectInit +/* 0820D4 800814D4 0C023142 */ jal menu_game_select_init /* 0820D8 800814D8 00000000 */ nop /* 0820DC 800814DC 1000002C */ b .L80081590 /* 0820E0 800814E0 8FBF0014 */ lw $ra, 0x14($sp) @@ -88,12 +88,12 @@ glabel L800814E4 /* 0820EC 800814EC 10000028 */ b .L80081590 /* 0820F0 800814F0 8FBF0014 */ lw $ra, 0x14($sp) glabel L800814F4 -/* 0820F4 800814F4 0C0239E8 */ jal MenuTrackSelectInit +/* 0820F4 800814F4 0C0239E8 */ jal menu_track_select_init /* 0820F8 800814F8 00000000 */ nop /* 0820FC 800814FC 10000024 */ b .L80081590 /* 082100 80081500 8FBF0014 */ lw $ra, 0x14($sp) glabel L80081504 -/* 082104 80081504 0C024B21 */ jal MenuLoadNewAreaInit +/* 082104 80081504 0C024B21 */ jal menu_5_init /* 082108 80081508 00000000 */ nop /* 08210C 8008150C 10000020 */ b .L80081590 /* 082110 80081510 8FBF0014 */ lw $ra, 0x14($sp) @@ -103,22 +103,22 @@ glabel L80081514 /* 08211C 8008151C 1000001C */ b .L80081590 /* 082120 80081520 8FBF0014 */ lw $ra, 0x14($sp) glabel L80081524 -/* 082124 80081524 0C02609B */ jal MenuTrophyRaceRoundInit +/* 082124 80081524 0C02609B */ jal menu_trophy_race_round_init /* 082128 80081528 00000000 */ nop /* 08212C 8008152C 10000018 */ b .L80081590 /* 082130 80081530 8FBF0014 */ lw $ra, 0x14($sp) glabel L80081534 -/* 082134 80081534 0C026289 */ jal MenuTrophyRaceRankingsInit +/* 082134 80081534 0C026289 */ jal menu_trophy_race_rankings_init /* 082138 80081538 00000000 */ nop /* 08213C 8008153C 10000014 */ b .L80081590 /* 082140 80081540 8FBF0014 */ lw $ra, 0x14($sp) glabel L80081544 -/* 082144 80081544 0C026B26 */ jal menu_17_init +/* 082144 80081544 0C026B26 */ jal menu_23_init /* 082148 80081548 00000000 */ nop /* 08214C 8008154C 10000010 */ b .L80081590 /* 082150 80081550 8FBF0014 */ lw $ra, 0x14($sp) glabel L80081554 -/* 082154 80081554 0C026697 */ jal MenuGhostDataInit +/* 082154 80081554 0C026697 */ jal menu_ghost_data_init /* 082158 80081558 00000000 */ nop /* 08215C 8008155C 1000000C */ b .L80081590 /* 082160 80081560 8FBF0014 */ lw $ra, 0x14($sp) diff --git a/asm/non_matchings/unknown_080500/MenuLogoScreenLoop.s b/asm/non_matchings/menu/menu_logo_screen_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuLogoScreenLoop.s rename to asm/non_matchings/menu/menu_logo_screen_loop.s index a8cfffc2..c790829c 100644 --- a/asm/non_matchings/unknown_080500/MenuLogoScreenLoop.s +++ b/asm/non_matchings/menu/menu_logo_screen_loop.s @@ -12,7 +12,7 @@ glabel D_800E83A8 .double 510.0 .text -glabel MenuLogoScreenLoop +glabel menu_logo_screen_loop /* 083784 80082B84 3C0E8000 */ lui $t6, %hi(osTvType) # $t6, 0x8000 /* 083788 80082B88 8DCE0300 */ lw $t6, %lo(osTvType)($t6) /* 08378C 80082B8C 27BDFFD0 */ addiu $sp, $sp, -0x30 @@ -104,7 +104,7 @@ glabel MenuLogoScreenLoop /* 0838D0 80082CD0 34078000 */ li $a3, 32768 /* 0838D4 80082CD4 0C020BEB */ jal func_80082FAC /* 0838D8 80082CD8 00000000 */ nop -/* 0838DC 80082CDC 0C0204F4 */ jal MenuInit +/* 0838DC 80082CDC 0C0204F4 */ jal menu_init /* 0838E0 80082CE0 00002025 */ move $a0, $zero /* 0838E4 80082CE4 3C018012 */ lui $at, %hi(D_80126450) # $at, 0x8012 /* 0838E8 80082CE8 C4206450 */ lwc1 $f0, %lo(D_80126450)($at) diff --git a/asm/non_matchings/unknown_080500/MenuMagicCodesListLoop.s b/asm/non_matchings/menu/menu_magic_codes_list_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuMagicCodesListLoop.s rename to asm/non_matchings/menu/menu_magic_codes_list_loop.s index 0fb32c8a..1b1c7cc3 100644 --- a/asm/non_matchings/unknown_080500/MenuMagicCodesListLoop.s +++ b/asm/non_matchings/menu/menu_magic_codes_list_loop.s @@ -1,4 +1,4 @@ -glabel MenuMagicCodesListLoop +glabel menu_magic_codes_list_loop /* 08B528 8008A928 27BDFFA8 */ addiu $sp, $sp, -0x58 /* 08B52C 8008A92C 3C02800E */ lui $v0, %hi(D_800DF47C) # $v0, 0x800e /* 08B530 8008A930 8C42F47C */ lw $v0, %lo(D_800DF47C)($v0) @@ -256,7 +256,7 @@ glabel MenuMagicCodesListLoop /* 08B8DC 8008ACDC 00000000 */ nop /* 08B8E0 8008ACE0 0C022B47 */ jal func_8008AD1C /* 08B8E4 8008ACE4 00000000 */ nop -/* 08B8E8 8008ACE8 0C0204F4 */ jal MenuInit +/* 08B8E8 8008ACE8 0C0204F4 */ jal menu_init /* 08B8EC 8008ACEC 2404000A */ li $a0, 10 /* 08B8F0 8008ACF0 10000003 */ b .L8008AD00 /* 08B8F4 8008ACF4 00001025 */ move $v0, $zero diff --git a/asm/non_matchings/unknown_080500/MenuMagicCodesLoop.s b/asm/non_matchings/menu/menu_magic_codes_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuMagicCodesLoop.s rename to asm/non_matchings/menu/menu_magic_codes_loop.s index 0976b421..6817a249 100644 --- a/asm/non_matchings/unknown_080500/MenuMagicCodesLoop.s +++ b/asm/non_matchings/menu/menu_magic_codes_loop.s @@ -1,4 +1,4 @@ -glabel MenuMagicCodesLoop +glabel menu_magic_codes_loop /* 08A8D8 80089CD8 27BDFFA0 */ addiu $sp, $sp, -0x60 /* 08A8DC 80089CDC 3C0B8012 */ lui $t3, %hi(D_801263D8) # $t3, 0x8012 /* 08A8E0 80089CE0 256B63D8 */ addiu $t3, %lo(D_801263D8) # addiu $t3, $t3, 0x63d8 @@ -544,7 +544,7 @@ glabel MenuMagicCodesLoop /* 08B070 8008A470 24180001 */ li $t8, 1 /* 08B074 8008A474 3C01800E */ lui $at, %hi(D_800E1B4C) # $at, 0x800e /* 08B078 8008A478 AC381B4C */ sw $t8, %lo(D_800E1B4C)($at) -/* 08B07C 8008A47C 0C0204F4 */ jal MenuInit +/* 08B07C 8008A47C 0C0204F4 */ jal menu_init /* 08B080 8008A480 24040019 */ li $a0, 25 /* 08B084 8008A484 3C19800E */ lui $t9, %hi(gActiveMagicCodes) # $t9, 0x800e /* 08B088 8008A488 8F39FD98 */ lw $t9, %lo(gActiveMagicCodes)($t9) @@ -554,12 +554,12 @@ glabel MenuMagicCodesLoop /* 08B098 8008A498 10000007 */ b .L8008A4B8 /* 08B09C 8008A49C AC2FFD98 */ sw $t7, %lo(gActiveMagicCodes)($at) .L8008A4A0: -/* 08B0A0 8008A4A0 0C0204F4 */ jal MenuInit +/* 08B0A0 8008A4A0 0C0204F4 */ jal menu_init /* 08B0A4 8008A4A4 2404000C */ li $a0, 12 /* 08B0A8 8008A4A8 10000004 */ b .L8008A4BC /* 08B0AC 8008A4AC 8FBF0014 */ lw $ra, 0x14($sp) .L8008A4B0: -/* 08B0B0 8008A4B0 0C0204F4 */ jal MenuInit +/* 08B0B0 8008A4B0 0C0204F4 */ jal menu_init /* 08B0B4 8008A4B4 2404000B */ li $a0, 11 .L8008A4B8: /* 08B0B8 8008A4B8 8FBF0014 */ lw $ra, 0x14($sp) diff --git a/asm/non_matchings/unknown_080500/MenuOptionsLoop.s b/asm/non_matchings/menu/menu_options_loop.s similarity index 98% rename from asm/non_matchings/unknown_080500/MenuOptionsLoop.s rename to asm/non_matchings/menu/menu_options_loop.s index 399f89f0..a7a4139f 100644 --- a/asm/non_matchings/unknown_080500/MenuOptionsLoop.s +++ b/asm/non_matchings/menu/menu_options_loop.s @@ -1,4 +1,4 @@ -glabel MenuOptionsLoop +glabel menu_options_loop /* 084F5C 8008435C 3C038012 */ lui $v1, %hi(D_801263BC) # $v1, 0x8012 /* 084F60 80084360 246363BC */ addiu $v1, %lo(D_801263BC) # addiu $v1, $v1, 0x63bc /* 084F64 80084364 8C6E0000 */ lw $t6, ($v1) @@ -226,7 +226,7 @@ glabel MenuOptionsLoop /* 085298 80084698 24010003 */ li $at, 3 /* 08529C 8008469C 0C0211CD */ jal func_80084734 /* 0852A0 800846A0 00000000 */ nop -/* 0852A4 800846A4 0C0204F4 */ jal MenuInit +/* 0852A4 800846A4 0C0204F4 */ jal menu_init /* 0852A8 800846A8 2404000D */ li $a0, 13 /* 0852AC 800846AC 1000001D */ b .L80084724 /* 0852B0 800846B0 00001025 */ move $v0, $zero @@ -236,14 +236,14 @@ glabel MenuOptionsLoop /* 0852BC 800846BC 00000000 */ nop /* 0852C0 800846C0 0C0211CD */ jal func_80084734 /* 0852C4 800846C4 00000000 */ nop -/* 0852C8 800846C8 0C0204F4 */ jal MenuInit +/* 0852C8 800846C8 0C0204F4 */ jal menu_init /* 0852CC 800846CC 2404000E */ li $a0, 14 /* 0852D0 800846D0 10000014 */ b .L80084724 /* 0852D4 800846D4 00001025 */ move $v0, $zero .L800846D8: /* 0852D8 800846D8 0C0211CD */ jal func_80084734 /* 0852DC 800846DC 00000000 */ nop -/* 0852E0 800846E0 0C0204F4 */ jal MenuInit +/* 0852E0 800846E0 0C0204F4 */ jal menu_init /* 0852E4 800846E4 2404000A */ li $a0, 10 /* 0852E8 800846E8 1000000E */ b .L80084724 /* 0852EC 800846EC 00001025 */ move $v0, $zero @@ -255,7 +255,7 @@ glabel MenuOptionsLoop /* 085300 80084700 00000000 */ nop /* 085304 80084704 0C0211CD */ jal func_80084734 /* 085308 80084708 00000000 */ nop -/* 08530C 8008470C 0C0204F4 */ jal MenuInit +/* 08530C 8008470C 0C0204F4 */ jal menu_init /* 085310 80084710 00002025 */ move $a0, $zero /* 085314 80084714 10000003 */ b .L80084724 /* 085318 80084718 00001025 */ move $v0, $zero diff --git a/asm/non_matchings/unknown_080500/Menu11Loop.s b/asm/non_matchings/menu/menu_results_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/Menu11Loop.s rename to asm/non_matchings/menu/menu_results_loop.s index 445a7aa8..a44dd2cb 100644 --- a/asm/non_matchings/unknown_080500/Menu11Loop.s +++ b/asm/non_matchings/menu/menu_results_loop.s @@ -1,4 +1,4 @@ -glabel Menu11Loop +glabel menu_results_loop /* 097EA8 800972A8 3C028012 */ lui $v0, %hi(D_801263BC) # $v0, 0x8012 /* 097EAC 800972AC 244263BC */ addiu $v0, %lo(D_801263BC) # addiu $v0, $v0, 0x63bc /* 097EB0 800972B0 8C4E0000 */ lw $t6, ($v0) @@ -272,7 +272,7 @@ glabel Menu11Loop /* 09828C 8009768C 2405FFFF */ li $a1, -1 /* 098290 80097690 0C01B8BA */ jal func_8006E2E8 /* 098294 80097694 00003025 */ move $a2, $zero -/* 098298 80097698 0C0204F4 */ jal MenuInit +/* 098298 80097698 0C0204F4 */ jal menu_init /* 09829C 8009769C 2404000F */ li $a0, 15 /* 0982A0 800976A0 10000006 */ b .L800976BC /* 0982A4 800976A4 00001025 */ move $v0, $zero diff --git a/asm/non_matchings/unknown_080500/MenuSaveOptionsLoop.s b/asm/non_matchings/menu/menu_save_options_loop.s similarity index 98% rename from asm/non_matchings/unknown_080500/MenuSaveOptionsLoop.s rename to asm/non_matchings/menu/menu_save_options_loop.s index e271f93a..f46cece2 100644 --- a/asm/non_matchings/unknown_080500/MenuSaveOptionsLoop.s +++ b/asm/non_matchings/menu/menu_save_options_loop.s @@ -3,7 +3,7 @@ glabel jpt_800E84B0 .word L80087D18, L80087D28, L80087D54, L80087D94, L80087DAC, L80087DEC, L80087E04, L80087E1C .text -glabel MenuSaveOptionsLoop +glabel menu_save_options_loop /* 088760 80087B60 3C038012 */ lui $v1, %hi(D_801263BC) # $v1, 0x8012 /* 088764 80087B64 246363BC */ addiu $v1, %lo(D_801263BC) # addiu $v1, $v1, 0x63bc /* 088768 80087B68 8C6E0000 */ lw $t6, ($v1) @@ -62,7 +62,7 @@ glabel MenuSaveOptionsLoop /* 08882C 80087C2C 2841FFE2 */ slti $at, $v0, -0x1e /* 088830 80087C30 0C021FAE */ jal func_80087EB8 /* 088834 80087C34 00000000 */ nop -/* 088838 80087C38 0C0204F4 */ jal MenuInit +/* 088838 80087C38 0C0204F4 */ jal menu_init /* 08883C 80087C3C 24040018 */ li $a0, 24 /* 088840 80087C40 10000095 */ b .L80087E98 /* 088844 80087C44 00001025 */ move $v0, $zero @@ -72,7 +72,7 @@ glabel MenuSaveOptionsLoop /* 088850 80087C50 00000000 */ nop /* 088854 80087C54 0C021FAE */ jal func_80087EB8 /* 088858 80087C58 00000000 */ nop -/* 08885C 80087C5C 0C0204F4 */ jal MenuInit +/* 08885C 80087C5C 0C0204F4 */ jal menu_init /* 088860 80087C60 2404000C */ li $a0, 12 .L80087C64: /* 088864 80087C64 1000008C */ b .L80087E98 diff --git a/asm/non_matchings/unknown_080500/MenuTitleScreenInit.s b/asm/non_matchings/menu/menu_title_screen_init.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuTitleScreenInit.s rename to asm/non_matchings/menu/menu_title_screen_init.s index bfa7235e..ac0502f7 100644 --- a/asm/non_matchings/unknown_080500/MenuTitleScreenInit.s +++ b/asm/non_matchings/menu/menu_title_screen_init.s @@ -1,4 +1,4 @@ -glabel MenuTitleScreenInit +glabel menu_title_screen_init /* 08413C 8008353C 240E0001 */ li $t6, 1 /* 084140 80083540 3C01800E */ lui $at, %hi(D_800DF488) # $at, 0x800e /* 084144 80083544 AC2EF488 */ sw $t6, %lo(D_800DF488)($at) diff --git a/asm/non_matchings/unknown_080500/MenuTitleScreenLoop.s b/asm/non_matchings/menu/menu_title_screen_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuTitleScreenLoop.s rename to asm/non_matchings/menu/menu_title_screen_loop.s index 055414ee..e54dd223 100644 --- a/asm/non_matchings/unknown_080500/MenuTitleScreenLoop.s +++ b/asm/non_matchings/menu/menu_title_screen_loop.s @@ -5,7 +5,7 @@ glabel D_800E83B4 .float 2.83 .text -glabel MenuTitleScreenLoop +glabel menu_title_screen_loop /* 0845E4 800839E4 27BDFFD0 */ addiu $sp, $sp, -0x30 /* 0845E8 800839E8 AFBF0014 */ sw $ra, 0x14($sp) /* 0845EC 800839EC 0C01A748 */ jal func_80069D20 @@ -479,7 +479,7 @@ glabel MenuTitleScreenLoop /* 084CC4 800840C4 00002025 */ move $a0, $zero /* 084CC8 800840C8 0C022BAD */ jal func_8008AEB4 /* 084CCC 800840CC 00002825 */ move $a1, $zero -/* 084CD0 800840D0 0C0204F4 */ jal MenuInit +/* 084CD0 800840D0 0C0204F4 */ jal menu_init /* 084CD4 800840D4 24040003 */ li $a0, 3 /* 084CD8 800840D8 1000000B */ b .L80084108 /* 084CDC 800840DC 00001025 */ move $v0, $zero @@ -488,7 +488,7 @@ glabel MenuTitleScreenLoop /* 084CE4 800840E4 2405FFFF */ li $a1, -1 /* 084CE8 800840E8 0C01B8BA */ jal func_8006E2E8 /* 084CEC 800840EC 00003025 */ move $a2, $zero -/* 084CF0 800840F0 0C0204F4 */ jal MenuInit +/* 084CF0 800840F0 0C0204F4 */ jal menu_init /* 084CF4 800840F4 2404000C */ li $a0, 12 /* 084CF8 800840F8 10000003 */ b .L80084108 /* 084CFC 800840FC 00001025 */ move $v0, $zero diff --git a/asm/non_matchings/unknown_080500/MenuTrackSelectInit.s b/asm/non_matchings/menu/menu_track_select_init.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuTrackSelectInit.s rename to asm/non_matchings/menu/menu_track_select_init.s index 6434e582..8fe3db72 100644 --- a/asm/non_matchings/unknown_080500/MenuTrackSelectInit.s +++ b/asm/non_matchings/menu/menu_track_select_init.s @@ -1,4 +1,4 @@ -glabel MenuTrackSelectInit +glabel menu_track_select_init /* 08F3A0 8008E7A0 27BDFF80 */ addiu $sp, $sp, -0x80 /* 08F3A4 8008E7A4 AFBF0044 */ sw $ra, 0x44($sp) /* 08F3A8 8008E7A8 AFBE0040 */ sw $fp, 0x40($sp) diff --git a/asm/non_matchings/unknown_080500/MenuTrackSelectLoop.s b/asm/non_matchings/menu/menu_track_select_loop.s similarity index 98% rename from asm/non_matchings/unknown_080500/MenuTrackSelectLoop.s rename to asm/non_matchings/menu/menu_track_select_loop.s index 5f69e73c..78d77834 100644 --- a/asm/non_matchings/unknown_080500/MenuTrackSelectLoop.s +++ b/asm/non_matchings/menu/menu_track_select_loop.s @@ -1,4 +1,4 @@ -glabel MenuTrackSelectLoop +glabel menu_track_select_loop /* 08FE34 8008F234 27BDFFE0 */ addiu $sp, $sp, -0x20 /* 08FE38 8008F238 AFBF0014 */ sw $ra, 0x14($sp) /* 08FE3C 8008F23C 0C01BAA4 */ jal get_settings @@ -139,7 +139,7 @@ glabel MenuTrackSelectLoop /* 09002C 8008F42C 00002025 */ move $a0, $zero /* 090030 8008F430 0C022BAD */ jal func_8008AEB4 /* 090034 8008F434 00002825 */ move $a1, $zero -/* 090038 8008F438 0C0204F4 */ jal MenuInit +/* 090038 8008F438 0C0204F4 */ jal menu_init /* 09003C 8008F43C 24040003 */ li $a0, 3 /* 090040 8008F440 10000038 */ b .L8008F524 /* 090044 8008F444 00001025 */ move $v0, $zero @@ -149,7 +149,7 @@ glabel MenuTrackSelectLoop /* 09004C 8008F44C 2405FFFF */ li $a1, -1 /* 090050 8008F450 0C01B8BA */ jal func_8006E2E8 /* 090054 8008F454 00003025 */ move $a2, $zero -/* 090058 8008F458 0C0204F4 */ jal MenuInit +/* 090058 8008F458 0C0204F4 */ jal menu_init /* 09005C 8008F45C 24040013 */ li $a0, 19 /* 090060 8008F460 10000030 */ b .L8008F524 /* 090064 8008F464 00001025 */ move $v0, $zero @@ -198,7 +198,7 @@ glabel MenuTrackSelectLoop /* 090100 8008F500 A020F450 */ sb $zero, %lo(D_800DF450)($at) /* 090104 8008F504 3C01800E */ lui $at, %hi(D_800E0FEC) # $at, 0x800e /* 090108 8008F508 AC200FEC */ sw $zero, %lo(D_800E0FEC)($at) -/* 09010C 8008F50C 0C0204F4 */ jal MenuInit +/* 09010C 8008F50C 0C0204F4 */ jal menu_init /* 090110 8008F510 24040014 */ li $a0, 20 /* 090114 8008F514 10000003 */ b .L8008F524 /* 090118 8008F518 00001025 */ move $v0, $zero diff --git a/asm/non_matchings/unknown_080500/MenuTrophyRaceRankingsInit.s b/asm/non_matchings/menu/menu_trophy_race_rankings_init.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuTrophyRaceRankingsInit.s rename to asm/non_matchings/menu/menu_trophy_race_rankings_init.s index 218069f6..07b2a483 100644 --- a/asm/non_matchings/unknown_080500/MenuTrophyRaceRankingsInit.s +++ b/asm/non_matchings/menu/menu_trophy_race_rankings_init.s @@ -1,4 +1,4 @@ -glabel MenuTrophyRaceRankingsInit +glabel menu_trophy_race_rankings_init /* 099624 80098A24 27BDFF90 */ addiu $sp, $sp, -0x70 /* 099628 80098A28 AFBF001C */ sw $ra, 0x1c($sp) /* 09962C 80098A2C 0C01BAA4 */ jal get_settings diff --git a/asm/non_matchings/unknown_080500/MenuTrophyRaceRankingsLoop.s b/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuTrophyRaceRankingsLoop.s rename to asm/non_matchings/menu/menu_trophy_race_rankings_loop.s index f538eeb5..43e2907f 100644 --- a/asm/non_matchings/unknown_080500/MenuTrophyRaceRankingsLoop.s +++ b/asm/non_matchings/menu/menu_trophy_race_rankings_loop.s @@ -1,4 +1,4 @@ -glabel MenuTrophyRaceRankingsLoop +glabel menu_trophy_race_rankings_loop /* 099BD4 80098FD4 27BDFFB0 */ addiu $sp, $sp, -0x50 /* 099BD8 80098FD8 AFBF001C */ sw $ra, 0x1c($sp) /* 099BDC 80098FDC AFA40050 */ sw $a0, 0x50($sp) @@ -246,7 +246,7 @@ glabel MenuTrophyRaceRankingsLoop /* 099F60 80099360 2B010004 */ slti $at, $t8, 4 /* 099F64 80099364 10200005 */ beqz $at, .L8009937C /* 099F68 80099368 3C07800E */ lui $a3, %hi(D_800E0FE4) # $a3, 0x800e -/* 099F6C 8009936C 0C0204F4 */ jal MenuInit +/* 099F6C 8009936C 0C0204F4 */ jal menu_init /* 099F70 80099370 24040014 */ li $a0, 20 /* 099F74 80099374 1000009D */ b .L800995EC /* 099F78 80099378 8FBF001C */ lw $ra, 0x1c($sp) @@ -332,7 +332,7 @@ glabel MenuTrophyRaceRankingsLoop /* 09A0A0 800994A0 14200007 */ bnez $at, .L800994C0 /* 09A0A4 800994A4 240E0105 */ li $t6, 261 /* 09A0A8 800994A8 2404000F */ li $a0, 15 -/* 09A0AC 800994AC 0C0204F4 */ jal MenuInit +/* 09A0AC 800994AC 0C0204F4 */ jal menu_init /* 09A0B0 800994B0 AFAC0034 */ sw $t4, 0x34($sp) /* 09A0B4 800994B4 8FAC0034 */ lw $t4, 0x34($sp) /* 09A0B8 800994B8 10000033 */ b .L80099588 @@ -411,7 +411,7 @@ glabel MenuTrophyRaceRankingsLoop /* 09A1CC 800995CC 00003825 */ move $a3, $zero /* 09A1D0 800995D0 0C026AF6 */ jal func_8009ABD8 /* 09A1D4 800995D4 AFA00010 */ sw $zero, 0x10($sp) -/* 09A1D8 800995D8 0C0204F4 */ jal MenuInit +/* 09A1D8 800995D8 0C0204F4 */ jal menu_init /* 09A1DC 800995DC 24040017 */ li $a0, 23 .L800995E0: /* 09A1E0 800995E0 3C01800E */ lui $at, %hi(gTrophyRaceWorldId) # $at, 0x800e diff --git a/asm/non_matchings/unknown_080500/MenuTrophyRaceRoundInit.s b/asm/non_matchings/menu/menu_trophy_race_round_init.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuTrophyRaceRoundInit.s rename to asm/non_matchings/menu/menu_trophy_race_round_init.s index 99b68125..5bf33fa2 100644 --- a/asm/non_matchings/unknown_080500/MenuTrophyRaceRoundInit.s +++ b/asm/non_matchings/menu/menu_trophy_race_round_init.s @@ -1,4 +1,4 @@ -glabel MenuTrophyRaceRoundInit +glabel menu_trophy_race_round_init /* 098E6C 8009826C 27BDFFD8 */ addiu $sp, $sp, -0x28 /* 098E70 80098270 AFBF0024 */ sw $ra, 0x24($sp) /* 098E74 80098274 AFB30020 */ sw $s3, 0x20($sp) diff --git a/asm/non_matchings/unknown_080500/MenuTrophyRaceRoundLoop.s b/asm/non_matchings/menu/menu_trophy_race_round_loop.s similarity index 99% rename from asm/non_matchings/unknown_080500/MenuTrophyRaceRoundLoop.s rename to asm/non_matchings/menu/menu_trophy_race_round_loop.s index 0f484de3..477f101d 100644 --- a/asm/non_matchings/unknown_080500/MenuTrophyRaceRoundLoop.s +++ b/asm/non_matchings/menu/menu_trophy_race_round_loop.s @@ -1,4 +1,4 @@ -glabel MenuTrophyRaceRoundLoop +glabel menu_trophy_race_round_loop /* 09919C 8009859C 27BDFFE0 */ addiu $sp, $sp, -0x20 /* 0991A0 800985A0 AFBF0014 */ sw $ra, 0x14($sp) /* 0991A4 800985A4 AFA40020 */ sw $a0, 0x20($sp) diff --git a/asm/non_matchings/unknown_066AA0/func_8006DA28.s b/asm/non_matchings/unknown_066AA0/func_8006DA28.s index 05f9a496..dead34de 100644 --- a/asm/non_matchings/unknown_066AA0/func_8006DA28.s +++ b/asm/non_matchings/unknown_066AA0/func_8006DA28.s @@ -55,7 +55,7 @@ glabel func_8006DA28 /* 06E6F0 8006DAF0 8FA40020 */ lw $a0, 0x20($sp) /* 06E6F4 8006DAF4 00000000 */ nop .L8006DAF8: -/* 06E6F8 8006DAF8 0C0204F4 */ jal MenuInit +/* 06E6F8 8006DAF8 0C0204F4 */ jal menu_init /* 06E6FC 8006DAFC 00000000 */ nop /* 06E700 8006DB00 8FBF001C */ lw $ra, 0x1c($sp) /* 06E704 8006DB04 3C018012 */ lui $at, %hi(D_80123504) # $at, 0x8012 diff --git a/asm/non_matchings/unknown_066AA0/func_8006DCF8.s b/asm/non_matchings/unknown_066AA0/func_8006DCF8.s index 64b369a1..58b39c09 100644 --- a/asm/non_matchings/unknown_066AA0/func_8006DCF8.s +++ b/asm/non_matchings/unknown_066AA0/func_8006DCF8.s @@ -34,7 +34,7 @@ glabel func_8006DCF8 /* 06E95C 8006DD5C 24C61218 */ addiu $a2, %lo(D_80121218) # addiu $a2, $a2, 0x1218 /* 06E960 8006DD60 24A51208 */ addiu $a1, %lo(D_80121208) # addiu $a1, $a1, 0x1208 /* 06E964 8006DD64 02002025 */ move $a0, $s0 -/* 06E968 8006DD68 0C020569 */ jal MenuLoop +/* 06E968 8006DD68 0C020569 */ jal menu_loop /* 06E96C 8006DD6C AFB80010 */ sw $t8, 0x10($sp) /* 06E970 8006DD70 24190001 */ li $t9, 1 /* 06E974 8006DD74 3C018012 */ lui $at, %hi(D_801234F0) # $at, 0x8012 diff --git a/asm/non_matchings/unknown_080500/MenuLoop.s b/asm/non_matchings/unknown_080500/MenuLoop.s deleted file mode 100644 index 8b5d13e6..00000000 --- a/asm/non_matchings/unknown_080500/MenuLoop.s +++ /dev/null @@ -1,180 +0,0 @@ -.late_rodata -glabel jpt_800E82F8 -.word L80081634, L80081620, L800817AC, L800816AC, L800817AC, L800816FC, L800816C0, L800817AC, L800817AC, L800817AC, L80081684, L80081698, L80081648, L8008165C, L80081670, L800816E8, L800817AC, L80081710, L800817AC, L800816D4, L80081724, L80081738, L800817AC, L8008174C, L80081760, L80081774, L80081788, L800817AC, L8008179C - -.text -glabel MenuLoop -/* 0821A4 800815A4 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 0821A8 800815A8 AFBF0014 */ sw $ra, 0x14($sp) -/* 0821AC 800815AC AFA40020 */ sw $a0, 0x20($sp) -/* 0821B0 800815B0 AFA50024 */ sw $a1, 0x24($sp) -/* 0821B4 800815B4 AFA60028 */ sw $a2, 0x28($sp) -/* 0821B8 800815B8 AFA7002C */ sw $a3, 0x2c($sp) -/* 0821BC 800815BC 8C8F0000 */ lw $t7, ($a0) -/* 0821C0 800815C0 3C018012 */ lui $at, %hi(D_801263A0) # $at, 0x8012 -/* 0821C4 800815C4 AC2F63A0 */ sw $t7, %lo(D_801263A0)($at) -/* 0821C8 800815C8 8CB90000 */ lw $t9, ($a1) -/* 0821CC 800815CC 3C018012 */ lui $at, %hi(D_801263A8) # $at, 0x8012 -/* 0821D0 800815D0 AC3963A8 */ sw $t9, %lo(D_801263A8)($at) -/* 0821D4 800815D4 8CC90000 */ lw $t1, ($a2) -/* 0821D8 800815D8 3C018012 */ lui $at, %hi(D_801263AC) # $at, 0x8012 -/* 0821DC 800815DC AC2963AC */ sw $t1, %lo(D_801263AC)($at) -/* 0821E0 800815E0 8CEB0000 */ lw $t3, ($a3) -/* 0821E4 800815E4 3C018012 */ lui $at, %hi(D_801263B0) # $at, 0x8012 -/* 0821E8 800815E8 0C026FC8 */ jal func_8009BF20 -/* 0821EC 800815EC AC2B63B0 */ sw $t3, %lo(D_801263B0)($at) -/* 0821F0 800815F0 3C0C800E */ lui $t4, %hi(D_800DF470) # $t4, 0x800e -/* 0821F4 800815F4 8D8CF470 */ lw $t4, %lo(D_800DF470)($t4) -/* 0821F8 800815F8 00000000 */ nop -/* 0821FC 800815FC 2D81001D */ sltiu $at, $t4, 0x1d -/* 082200 80081600 1020006A */ beqz $at, .L800817AC -/* 082204 80081604 000C6080 */ sll $t4, $t4, 2 -/* 082208 80081608 3C01800F */ lui $at, %hi(jpt_800E82F8) # $at, 0x800f -/* 08220C 8008160C 002C0821 */ addu $at, $at, $t4 -/* 082210 80081610 8C2C82F8 */ lw $t4, %lo(jpt_800E82F8)($at) -/* 082214 80081614 00000000 */ nop -/* 082218 80081618 01800008 */ jr $t4 -/* 08221C 8008161C 00000000 */ nop -glabel L80081620 -/* 082220 80081620 8FA40030 */ lw $a0, 0x30($sp) -/* 082224 80081624 0C020AE1 */ jal MenuLogoScreenLoop -/* 082228 80081628 00000000 */ nop -/* 08222C 8008162C 1000005F */ b .L800817AC -/* 082230 80081630 AFA2001C */ sw $v0, 0x1c($sp) -glabel L80081634 -/* 082234 80081634 8FA40030 */ lw $a0, 0x30($sp) -/* 082238 80081638 0C020E79 */ jal MenuTitleScreenLoop -/* 08223C 8008163C 00000000 */ nop -/* 082240 80081640 1000005A */ b .L800817AC -/* 082244 80081644 AFA2001C */ sw $v0, 0x1c($sp) -glabel L80081648 -/* 082248 80081648 8FA40030 */ lw $a0, 0x30($sp) -/* 08224C 8008164C 0C0210D7 */ jal MenuOptionsLoop -/* 082250 80081650 00000000 */ nop -/* 082254 80081654 10000055 */ b .L800817AC -/* 082258 80081658 AFA2001C */ sw $v0, 0x1c($sp) -glabel L8008165C -/* 08225C 8008165C 8FA40030 */ lw $a0, 0x30($sp) -/* 082260 80081660 0C02131D */ jal MenuAudioOptionsLoop -/* 082264 80081664 00000000 */ nop -/* 082268 80081668 10000050 */ b .L800817AC -/* 08226C 8008166C AFA2001C */ sw $v0, 0x1c($sp) -glabel L80081670 -/* 082270 80081670 8FA40030 */ lw $a0, 0x30($sp) -/* 082274 80081674 0C021ED8 */ jal MenuSaveOptionsLoop -/* 082278 80081678 00000000 */ nop -/* 08227C 8008167C 1000004B */ b .L800817AC -/* 082280 80081680 AFA2001C */ sw $v0, 0x1c($sp) -glabel L80081684 -/* 082284 80081684 8FA40030 */ lw $a0, 0x30($sp) -/* 082288 80081688 0C022736 */ jal MenuMagicCodesLoop -/* 08228C 8008168C 00000000 */ nop -/* 082290 80081690 10000046 */ b .L800817AC -/* 082294 80081694 AFA2001C */ sw $v0, 0x1c($sp) -glabel L80081698 -/* 082298 80081698 8FA40030 */ lw $a0, 0x30($sp) -/* 08229C 8008169C 0C022A4A */ jal MenuMagicCodesListLoop -/* 0822A0 800816A0 00000000 */ nop -/* 0822A4 800816A4 10000041 */ b .L800817AC -/* 0822A8 800816A8 AFA2001C */ sw $v0, 0x1c($sp) -glabel L800816AC -/* 0822AC 800816AC 8FA40030 */ lw $a0, 0x30($sp) -/* 0822B0 800816B0 0C022F49 */ jal MenuCharacterSelectLoop -/* 0822B4 800816B4 00000000 */ nop -/* 0822B8 800816B8 1000003C */ b .L800817AC -/* 0822BC 800816BC AFA2001C */ sw $v0, 0x1c($sp) -glabel L800816C0 -/* 0822C0 800816C0 8FA40030 */ lw $a0, 0x30($sp) -/* 0822C4 800816C4 0C02379C */ jal MenuGameSelectLoop -/* 0822C8 800816C8 00000000 */ nop -/* 0822CC 800816CC 10000037 */ b .L800817AC -/* 0822D0 800816D0 AFA2001C */ sw $v0, 0x1c($sp) -glabel L800816D4 -/* 0822D4 800816D4 8FA40030 */ lw $a0, 0x30($sp) -/* 0822D8 800816D8 0C0231EF */ jal MenuFileSelectLoop -/* 0822DC 800816DC 00000000 */ nop -/* 0822E0 800816E0 10000032 */ b .L800817AC -/* 0822E4 800816E4 AFA2001C */ sw $v0, 0x1c($sp) -glabel L800816E8 -/* 0822E8 800816E8 8FA40030 */ lw $a0, 0x30($sp) -/* 0822EC 800816EC 0C023C8D */ jal MenuTrackSelectLoop -/* 0822F0 800816F0 00000000 */ nop -/* 0822F4 800816F4 1000002D */ b .L800817AC -/* 0822F8 800816F8 AFA2001C */ sw $v0, 0x1c($sp) -glabel L800816FC -/* 0822FC 800816FC 8FA40030 */ lw $a0, 0x30($sp) -/* 082300 80081700 0C024D80 */ jal MenuLoadNewAreaLoop -/* 082304 80081704 00000000 */ nop -/* 082308 80081708 10000028 */ b .L800817AC -/* 08230C 8008170C AFA2001C */ sw $v0, 0x1c($sp) -glabel L80081710 -/* 082310 80081710 8FA40030 */ lw $a0, 0x30($sp) -/* 082314 80081714 0C025CAA */ jal Menu11Loop -/* 082318 80081718 00000000 */ nop -/* 08231C 8008171C 10000023 */ b .L800817AC -/* 082320 80081720 AFA2001C */ sw $v0, 0x1c($sp) -glabel L80081724 -/* 082324 80081724 8FA40030 */ lw $a0, 0x30($sp) -/* 082328 80081728 0C026167 */ jal MenuTrophyRaceRoundLoop -/* 08232C 8008172C 00000000 */ nop -/* 082330 80081730 1000001E */ b .L800817AC -/* 082334 80081734 AFA2001C */ sw $v0, 0x1c($sp) -glabel L80081738 -/* 082338 80081738 8FA40030 */ lw $a0, 0x30($sp) -/* 08233C 8008173C 0C0263F5 */ jal MenuTrophyRaceRankingsLoop -/* 082340 80081740 00000000 */ nop -/* 082344 80081744 10000019 */ b .L800817AC -/* 082348 80081748 AFA2001C */ sw $v0, 0x1c($sp) -glabel L8008174C -/* 08234C 8008174C 8FA40030 */ lw $a0, 0x30($sp) -/* 082350 80081750 0C026B3F */ jal Menu17Loop -/* 082354 80081754 00000000 */ nop -/* 082358 80081758 10000014 */ b .L800817AC -/* 08235C 8008175C AFA2001C */ sw $v0, 0x1c($sp) -glabel L80081760 -/* 082360 80081760 8FA40030 */ lw $a0, 0x30($sp) -/* 082364 80081764 0C0269F5 */ jal MenuGhostDataLoop -/* 082368 80081768 00000000 */ nop -/* 08236C 8008176C 1000000F */ b .L800817AC -/* 082370 80081770 AFA2001C */ sw $v0, 0x1c($sp) -glabel L80081774 -/* 082374 80081774 8FA40030 */ lw $a0, 0x30($sp) -/* 082378 80081778 0C026CCB */ jal MenuCreditsLoop -/* 08237C 8008177C 00000000 */ nop -/* 082380 80081780 1000000A */ b .L800817AC -/* 082384 80081784 AFA2001C */ sw $v0, 0x1c($sp) -glabel L80081788 -/* 082388 80081788 8FA40030 */ lw $a0, 0x30($sp) -/* 08238C 8008178C 0C022183 */ jal menu_boot_loop -/* 082390 80081790 00000000 */ nop -/* 082394 80081794 10000005 */ b .L800817AC -/* 082398 80081798 AFA2001C */ sw $v0, 0x1c($sp) -glabel L8008179C -/* 08239C 8008179C 8FA40030 */ lw $a0, 0x30($sp) -/* 0823A0 800817A0 0C0230FF */ jal menu_caution_loop -/* 0823A4 800817A4 00000000 */ nop -/* 0823A8 800817A8 AFA2001C */ sw $v0, 0x1c($sp) -.L800817AC: -glabel L800817AC -/* 0823AC 800817AC 3C0D8012 */ lui $t5, %hi(D_801263A0) # $t5, 0x8012 -/* 0823B0 800817B0 8DAD63A0 */ lw $t5, %lo(D_801263A0)($t5) -/* 0823B4 800817B4 8FAE0020 */ lw $t6, 0x20($sp) -/* 0823B8 800817B8 3C0F8012 */ lui $t7, %hi(D_801263A8) # $t7, 0x8012 -/* 0823BC 800817BC ADCD0000 */ sw $t5, ($t6) -/* 0823C0 800817C0 8FB80024 */ lw $t8, 0x24($sp) -/* 0823C4 800817C4 8DEF63A8 */ lw $t7, %lo(D_801263A8)($t7) -/* 0823C8 800817C8 3C198012 */ lui $t9, %hi(D_801263AC) # $t9, 0x8012 -/* 0823CC 800817CC AF0F0000 */ sw $t7, ($t8) -/* 0823D0 800817D0 8FA80028 */ lw $t0, 0x28($sp) -/* 0823D4 800817D4 8F3963AC */ lw $t9, %lo(D_801263AC)($t9) -/* 0823D8 800817D8 3C098012 */ lui $t1, %hi(D_801263B0) # $t1, 0x8012 -/* 0823DC 800817DC AD190000 */ sw $t9, ($t0) -/* 0823E0 800817E0 8FAA002C */ lw $t2, 0x2c($sp) -/* 0823E4 800817E4 8D2963B0 */ lw $t1, %lo(D_801263B0)($t1) -/* 0823E8 800817E8 00000000 */ nop -/* 0823EC 800817EC AD490000 */ sw $t1, ($t2) -/* 0823F0 800817F0 8FBF0014 */ lw $ra, 0x14($sp) -/* 0823F4 800817F4 8FA2001C */ lw $v0, 0x1c($sp) -/* 0823F8 800817F8 03E00008 */ jr $ra -/* 0823FC 800817FC 27BD0020 */ addiu $sp, $sp, 0x20 - diff --git a/diff.sh b/diff.sh new file mode 100755 index 00000000..876e8c83 --- /dev/null +++ b/diff.sh @@ -0,0 +1 @@ +python3 tools/python/diff.py "$1" \ No newline at end of file diff --git a/diff_settings.py b/diff_settings.py deleted file mode 100644 index e53805a7..00000000 --- a/diff_settings.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python3 - -def add_custom_arguments(parser): - group = parser.add_mutually_exclusive_group(required=False) - group.add_argument('-j', dest='lang', action='store_const', const='jp', - help="Set version to JP.") - group.add_argument('-u', dest='lang', action='store_const', const='us', - help="Set version to US.") - group.add_argument('-e', dest='lang', action='store_const', const='eu', - help="Set version to EU.") - group.add_argument('-s', dest='lang', action='store_const', const='sh', - help="Set version to SH.") - -def apply(config, args): - lang = args.lang or 'us' - config['mapfile'] = f'build/us_1.0/dkr.map' - config['myimg'] = f'build/us_1.0/dkr.z64' - config['baseimg'] = f'baseroms/Diddy Kong Racing (USA 1.0).z64' - config['makeflags'] = [f''] - config['source_directories'] = ['src'] diff --git a/include/structs.h b/include/structs.h index 5cd71d69..10cc1bdb 100644 --- a/include/structs.h +++ b/include/structs.h @@ -25,7 +25,7 @@ typedef struct MenuElement { /* 0x14 */ char* asciiText; // Pointer to ascii text to be displayed on the screen. /* 0x14 */ u32* texture; // Pointer to texture to be displayed on the screen. /* 0x14 */ s32* number; // Pointer to a number to be displayed on the screen. - } source; + }; /* 0x18 */ u16 backgroundRed; /* 0x1A */ u16 backgroundGreen; /* 0x1C */ u16 backgroundBlue; diff --git a/rename_sym.sh b/rename.sh similarity index 60% rename from rename_sym.sh rename to rename.sh index ffd68456..4d31a792 100755 --- a/rename_sym.sh +++ b/rename.sh @@ -8,9 +8,11 @@ then exit 1 fi -#echo "Replace $1 with $2?" -#read -grep -rl "$1" asm/**/*.s src/**/*.{c,h} lib/**/*.{c,s} include/*.h data/dkr.data.s undefined_syms.txt | xargs sed -i "s/\b$1\b/$2/g" +# Rename all instances within text files. +grep -rl "$1" asm/**/*.s src/**/*.{c,h} lib/**/*.{c,s} include/*.h undefined_syms.txt | xargs sed -i "s/\b$1\b/$2/g" + +# Rename filenames & directories. +python3 ./tools/python/rename_file.py "$1" "$2" # This removes all the .o files that use the old name. grep -rl "$1" build/**/*.o | xargs rm diff --git a/src/unknown_001050.c b/src/audio.c similarity index 98% rename from src/unknown_001050.c rename to src/audio.c index 096c286b..97808d63 100644 --- a/src/unknown_001050.c +++ b/src/audio.c @@ -1,7 +1,7 @@ /* The comment below is needed for this file to be picked up by generate_ld */ /* RAM_POS: 0x80000450 */ -#include "unknown_001050.h" +#include "audio.h" #include "types.h" #include "macros.h" @@ -568,7 +568,7 @@ u8 musicIsPlaying(void) { } #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_001050/func_800015F8.s") +GLOBAL_ASM("asm/non_matchings/audio/func_800015F8.s") #else f32 func_800015F8(void){ u32 current_cnt = osGetCount(); @@ -749,7 +749,7 @@ u16 func_80001CB8(u16 arg0) { #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_001050/func_80001D04.s") +GLOBAL_ASM("asm/non_matchings/audio/func_80001D04.s") #else #endif @@ -788,7 +788,7 @@ void func_80001F14(u16 sndIndx, u32 *arg1){ } #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_001050/func_80001FB8.s") +GLOBAL_ASM("asm/non_matchings/audio/func_80001FB8.s") #else void func_80001FB8(u16 arg0){ arg0*10 + D_80115D18[0].unk00; @@ -837,7 +837,7 @@ u8 ALBankFile_80115D14_GetSoundDecayTime(u16 sndIndx){ #if 0 -GLOBAL_ASM("asm/non_matchings/unknown_001050/func_80002224.s") +GLOBAL_ASM("asm/non_matchings/audio/func_80002224.s") #else extern void alCSPNew(ALCSPlayer *seqp, ALSeqpConfig *config); extern void alCSPSetBank(ALCSPlayer *seqp, ALBank *b); @@ -879,7 +879,7 @@ void func_800022BC(u8 arg0, ALCSPlayer* arg1) { #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_001050/func_8000232C.s") +GLOBAL_ASM("asm/non_matchings/audio/func_8000232C.s") #else void func_8000232C(ALCSPlayer* seqp, void* ptr, u8* arg2, ALCSeq* seq){ if(alCSPGetState(seqp) == AL_STOPPED && *arg2){ diff --git a/include/unknown_001050.h b/src/audio.h similarity index 100% rename from include/unknown_001050.h rename to src/audio.h diff --git a/src/unknown_080500.c b/src/menu.c similarity index 88% rename from src/unknown_080500.c rename to src/menu.c index f2b7eec6..2806f9df 100644 --- a/src/unknown_080500.c +++ b/src/menu.c @@ -1,7 +1,7 @@ /* The comment below is needed for this file to be picked up by generate_ld */ /* RAM_POS: 0x8007F900 */ -#include "unknown_080500.h" +#include "menu.h" #include "types.h" #include "macros.h" @@ -9,35 +9,35 @@ #include "fast3d.h" typedef enum MENU_ID { - TITLE_SCREEN, - LOGOS_SCREEN, - UNUSED_2, - CHARACTER_SELECT, - UNUSED_4, - UNKNOWN_5, - FILE_SELECT, - UNUSED_7, - UNUSED_8, - UNUSED_9, - MAGIC_CODES, - MAGIC_CODES_LIST, - OPTIONS, - AUDIO_OPTIONS, - SAVE_OPTIONS, - TRACK_SELECT, - UNUSED_16, - RESULTS, - UNUSED_18, - GAME_SELECT, - TROPHY_RACE_ROUND, - TROPHY_RACE_RANKINGS, - UNUSED_22, - UNKNOWN_23, - GHOST_DATA, - CREDITS, - BOOT_SCREEN, - UNUSED_27, - CAUTION_MESSAGE + MENU_TITLE, + MENU_LOGOS, + MENU_UNUSED_2, + MENU_CHARACTER_SELECT, + MENU_UNUSED_4, + MENU_UNKNOWN_5, + MENU_FILE_SELECT, + MENU_UNUSED_7, + MENU_UNUSED_8, + MENU_UNUSED_9, + MENU_MAGIC_CODES, + MENU_MAGIC_CODES_LIST, + MENU_OPTIONS, + MENU_AUDIO_OPTIONS, + MENU_SAVE_OPTIONS, + MENU_TRACK_SELECT, + MENU_UNUSED_16, + MENU_RESULTS, + MENU_UNUSED_18, + MENU_GAME_SELECT, + MENU_TROPHY_RACE_ROUND, + MENU_TROPHY_RACE_RANKINGS, + MENU_UNUSED_22, + MENU_UNKNOWN_23, + MENU_GHOST_DATA, + MENU_CREDITS, + MENU_BOOT, + MENU_UNUSED_27, + MENU_CAUTION } MENU_ID; extern s32 osTvType; @@ -53,9 +53,9 @@ s32 D_80126398; s32 D_8012639C; Gfx *D_801263A0; s32 D_801263A4; -s32 D_801263A8; -s32 D_801263AC; -s32 D_801263B0; +s32 *D_801263A8; +s32 *D_801263AC; +s32 *D_801263B0; s8 D_801263B4; s32 D_801263B8; s32 D_801263BC; @@ -84,7 +84,7 @@ f32 D_80126450; u8 D_80126454[4]; u8 D_80126458[4]; s8 D_8012645C[4]; -s8 D_80126460[4]; +MenuElement *D_80126460; s8 D_80126464[4]; u8 D_80126468[4]; u8 D_8012646C[4]; @@ -154,7 +154,7 @@ s32 D_80126818; s32 D_8012681C; s32 D_80126820; s32 D_80126824; -s32 D_80126828; +s8 D_80126828; s32 D_8012682C; s32 D_80126830; s32 D_80126834; @@ -1522,7 +1522,7 @@ void *func_80070C9C(s32, u32); void func_800C4170(s32 arg0); void func_80000B34(s32 arg0); -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8007F900.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8007F900.s") void func_8007FF88(void) { if (D_800E1DAC[0] != NULL) { @@ -1537,24 +1537,202 @@ void func_8007FF88(void) { D_800E1DBC = 0; } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8007FFEC.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80080580.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80080BC8.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8007FFEC.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80080580.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80080BC8.s") void func_80080E6C(void) { D_800E1DB8 = 0; D_800E1DB4 = (s32) (1 - D_800E1DB4); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80080E90.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80081218.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80080E90.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80081218.s") void func_800813C0(void) { D_800DF458 = 1; } -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuInit.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuLoop.s") +#ifdef NON_MATCHING +void func_8009BE5C(void); +void menu_logos_screen_init(void); +void menu_title_screen_init(void); +void menu_options_init(void); +void menu_audio_options_init(void); +void menu_save_options_init(void); +void menu_magic_codes_init(void); +void menu_magic_codes_list_init(void); +void menu_character_select_init(void); +void menu_game_select_init(void); +void menu_file_select_init(void); +void menu_track_select_init(void); +void menu_5_init(void); +void menu_11_init(void); +void menu_trophy_race_round_init(void); +void menu_trophy_race_rankings_init(void); +void menu_23_init(void); +void menu_ghost_data_init(void); +void menu_credits_init(void); +void menu_boot_init(void); +void menu_caution_init(void); + +// Almost close to matching. +void menu_init(u32 menuId) { + D_800DF470 = menuId; + func_8009BE5C(); + D_801263C4 = 1; + D_801263BC = 0; + D_801263C8 = 0; + D_80126828 = 0; + D_80126808 = 0; + D_8012680C = 0; // This creates an extra lui + D_80126810 = 0; + D_80126814 = 0; // This creates an extra lui + func_80001844(); + switch(D_800DF470) { + case MENU_LOGOS: + menu_logos_screen_init(); + break; + case MENU_TITLE: + menu_title_screen_init(); + break; + case MENU_OPTIONS: + menu_options_init(); + break; + case MENU_AUDIO_OPTIONS: + menu_audio_options_init(); + break; + case MENU_SAVE_OPTIONS: + menu_save_options_init(); + break; + case MENU_MAGIC_CODES: + menu_magic_codes_init(); + break; + case MENU_MAGIC_CODES_LIST: + menu_magic_codes_list_init(); + break; + case MENU_CHARACTER_SELECT: + menu_character_select_init(); + break; + case MENU_GAME_SELECT: + menu_game_select_init(); + break; + case MENU_FILE_SELECT: + menu_file_select_init(); + break; + case MENU_TRACK_SELECT: + menu_track_select_init(); + break; + case MENU_UNKNOWN_5: + menu_5_init(); + break; + case MENU_RESULTS: + menu_11_init(); + break; + case MENU_TROPHY_RACE_ROUND: + menu_trophy_race_round_init(); + break; + case MENU_TROPHY_RACE_RANKINGS: + menu_trophy_race_rankings_init(); + break; + case MENU_UNKNOWN_23: + menu_23_init(); + break; + case MENU_GHOST_DATA: + menu_ghost_data_init(); + break; + case MENU_CREDITS: + menu_credits_init(); + break; + case MENU_BOOT: + menu_boot_init(); + break; + case MENU_CAUTION: + menu_caution_init(); + break; + } + D_80126470 = 0xD000; +} +#else +GLOBAL_ASM("asm/non_matchings/menu/menu_init.s") +#endif + +s32 menu_loop(Gfx **arg0, s32 **arg1, s32 **arg2, s32 **arg3, s32 arg4) { + s32 sp1C; + + D_801263A0 = *arg0; + D_801263A8 = *arg1; + D_801263AC = *arg2; + D_801263B0 = *arg3; + func_8009BF20(); + switch (D_800DF470) { + case MENU_LOGOS: + sp1C = menu_logo_screen_loop(arg4); + break; + case MENU_TITLE: + sp1C = menu_title_screen_loop(arg4); + break; + case MENU_OPTIONS: + sp1C = menu_options_loop(arg4); + break; + case MENU_AUDIO_OPTIONS: + sp1C = menu_audio_options_loop(arg4); + break; + case MENU_SAVE_OPTIONS: + sp1C = menu_save_options_loop(arg4); + break; + case MENU_MAGIC_CODES: + sp1C = menu_magic_codes_loop(arg4); + break; + case MENU_MAGIC_CODES_LIST: + sp1C = menu_magic_codes_list_loop(arg4); + break; + case MENU_CHARACTER_SELECT: + sp1C = menu_character_select_loop(arg4); + break; + case MENU_FILE_SELECT: + sp1C = menu_file_select_loop(arg4); + break; + case MENU_GAME_SELECT: + sp1C = menu_game_select_loop(arg4); + break; + case MENU_TRACK_SELECT: + sp1C = menu_track_select_loop(arg4); + break; + case MENU_UNKNOWN_5: + sp1C = menu_5_loop(arg4); + break; + case MENU_RESULTS: + sp1C = menu_results_loop(arg4); + break; + case MENU_TROPHY_RACE_ROUND: + sp1C = menu_trophy_race_round_loop(arg4); + break; + case MENU_TROPHY_RACE_RANKINGS: + sp1C = menu_trophy_race_rankings_loop(arg4); + break; + case MENU_UNKNOWN_23: + sp1C = menu_23_loop(arg4); + break; + case MENU_GHOST_DATA: + sp1C = menu_ghost_data_loop(arg4); + break; + case MENU_CREDITS: + sp1C = menu_credits_loop(arg4); + break; + case MENU_BOOT: + sp1C = menu_boot_loop(arg4); + break; + case MENU_CAUTION: + sp1C = menu_caution_loop(arg4); + break; + } + *arg0 = (Gfx *)D_801263A0; + *arg1 = (s32 *)D_801263A8; + *arg2 = (s32 *)D_801263AC; + *arg3 = (s32 *)D_801263B0; + return sp1C; +} void func_80081800(s32 arg0, s32 arg1, s32 arg2, u8 arg3, u8 arg4, u8 arg5, u8 arg6) { s32 sp5C; @@ -1627,7 +1805,7 @@ void func_80081800(s32 arg0, s32 arg1, s32 arg2, u8 arg3, u8 arg4, u8 arg5, u8 a D_800DF4AC = (u8)0xFF; } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80081C04.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80081C04.s") void func_80081E54(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5) { D_800DF798 = arg0; @@ -1644,8 +1822,8 @@ void func_80081E54(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5) { } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80081F4C.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/DrawMenuText.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80081F4C.s") +GLOBAL_ASM("asm/non_matchings/menu/DrawMenuText.s") void func_800828B8(void) { s32 i; @@ -1708,7 +1886,7 @@ void menu_logos_screen_init(void) { func_80066818(0, 1); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuLogoScreenLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_logo_screen_loop.s") void set_magic_code_flags(s32 flags); @@ -1730,10 +1908,10 @@ void func_80082FAC(void) { func_8007F900(func_8009EB20()); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80083098.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuTitleScreenInit.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008377C.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuTitleScreenLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80083098.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_title_screen_init.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008377C.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_title_screen_loop.s") void func_80084118(void) { func_8009C4A8((s16*)D_800DF7C4); @@ -1789,13 +1967,13 @@ void func_800841B8(s32 arg0) { } #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuOptionsLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_options_loop.s") #else void func_80084734(void); void set_language(s32 language); -s32 MenuOptionsLoop(s32 arg0) { +s32 menu_options_loop(s32 arg0) { s32 buttonsPressed; s32 analogX; s32 analogY; @@ -1884,15 +2062,15 @@ s32 MenuOptionsLoop(s32 arg0) { switch(D_800DF460) { case 2: func_80084734(); - MenuInit(AUDIO_OPTIONS); + menu_init(MENU_AUDIO_OPTIONS); return 0; case 3: func_80084734(); - MenuInit(SAVE_OPTIONS); + menu_init(MENU_SAVE_OPTIONS); return 0; default: func_80084734(); - MenuInit(MAGIC_CODES); + menu_init(MENU_MAGIC_CODES); return 0; } } @@ -1900,7 +2078,7 @@ s32 MenuOptionsLoop(s32 arg0) { // Change screen back to the title screen. func_80000B28(); func_80084734(); - MenuInit(TITLE_SCREEN); + menu_init(MENU_TITLE); return 0; } D_801263C4 = 0; @@ -1915,7 +2093,7 @@ void func_80084734(void) { void func_8009C8A4(s16 *arg0); -void MenuAudioOptionsInit(void) { +void menu_audio_options_init(void) { D_80126C46 = 0; D_801263BC = 0; D_800DF47C = 0; @@ -1941,10 +2119,10 @@ void MenuAudioOptionsInit(void) { func_800C4170(2); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80084854.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80084854.s") #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuAudioOptionsLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_audio_options_loop.s") #else extern s32 D_800DFABC; @@ -1952,7 +2130,7 @@ extern s32 D_800DFAC8; void func_800851FC(void); -s32 MenuAudioOptionsLoop(s32 arg0) { +s32 menu_audio_options_loop(s32 arg0) { s32 sp40; s32 sp30; s32 phi_a2; @@ -2089,7 +2267,7 @@ s32 MenuAudioOptionsLoop(s32 arg0) { } if (D_800DF47C < -0x1E) { func_800851FC(); - MenuInit(0xC); + menu_init(0xC); return 0; } D_801263C4 = 0; @@ -2146,8 +2324,8 @@ void menu_save_options_init(void) { func_800C01D8(D_800DF77C); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_800853D0.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80085B9C.s") +GLOBAL_ASM("asm/non_matchings/menu/func_800853D0.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80085B9C.s") /* Size: 0x10 Bytes */ typedef struct unk800860A8 { @@ -2214,11 +2392,11 @@ void func_800861C8(unk800861C8* arg0, s32 *arg1) { } } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_800862C4.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_800867D4.s") +GLOBAL_ASM("asm/non_matchings/menu/func_800862C4.s") +GLOBAL_ASM("asm/non_matchings/menu/func_800867D4.s") #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80086A48.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80086A48.s") #else void func_80086A48(s32 arg0) { f32 temp, temp2, temp3; @@ -2237,8 +2415,8 @@ void func_80086A48(s32 arg0) { } #endif -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80086AFC.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_800871D8.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80086AFC.s") +GLOBAL_ASM("asm/non_matchings/menu/func_800871D8.s") s32 func_800874D0(s32 arg0, s32 arg1) { @@ -2306,8 +2484,8 @@ s32 func_800876CC(s32 arg0, s32 arg1) { } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80087734.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuSaveOptionsLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80087734.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_save_options_loop.s") void func_80087EB8(void) { func_800C422C(2); @@ -2318,26 +2496,9 @@ void func_80087EB8(void) { func_80071140(D_80126A64); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80087F14.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008832C.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80087F14.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008832C.s") -#if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuBootInit.s") -#else -// Probably not unqiue to the boot menu. -typedef struct MenuBootDrawTexture { -u32* texture; // Pointer to texture to draw. TODO: Make structure for texture header. -s16 xOffset; // Offset from the center of the screen. -s16 yOffset; // Offset from the center of the screen. -} MenuBootDrawTexture; - -extern s16 D_800DF7C4[11]; -static MenuBootDrawTexture D_800DF7DC[11]; -extern u32* D_80126550[]; // texture lookup table? -extern s32 D_80126C18; -extern s32 D_80126C20; - -// Almost matches, except for an extra `lui` instruction when the loop unrolls. void menu_boot_init(void) { s32 i; @@ -2354,9 +2515,66 @@ void menu_boot_init(void) { D_80126C20 = 0; // D_80126C20 is the current state of the boot screen. Either 0, 1, or 2. D_80126C18 = 0; // D_80126C18 is a timer for the boot screen, counts up to 0x8C frames. } -#endif -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuBootLoop.s") +#ifdef NON_MATCHING +void func_800887E8(void); +void func_800887C4(void); + +s32 menu_boot_loop(s32 arg0) { + s32 sp2C; + s32 phi_v1; + + sp2C = 0; + phi_v1 = 0x78; + if (osTvType == 0) { + phi_v1 = 0x84; + } + + switch(D_80126C20) { + case 0: + if (D_80126C18 < 0x20) { + D_80126C18 += arg0; + if (D_80126C18 >= 0x21) { + D_80126C18 = 0x20; + } + } else { + func_800887E8(); + D_80126C20 = 1; + } + break; + case 1: + if (D_80126C18 < 0x8C) { + D_80126C18 += arg0; + if (D_80126C18 >= 0x8D) { + D_80126C18 = 0x8C; + } + } else { + func_800887C4(); + D_80126C20 = 2; + } + if (D_80126C18 >= 0x81) { + phi_v1 = 0x12C; + } + break; + case 2: + if (D_800DF47C && func_800C018C(arg0, 0x12C) == 0) { + func_800C01D8(&D_800DF76C, arg0); + } + sp2C = func_800890AC(arg0); + phi_v1 = 0x12C; + break; + } + + if (phi_v1 < 0x12C) { + func_80078AB8(&D_801263A0, &D_800DF7DC, 0xA0, phi_v1, 0xFF, 0xFF, 0xFF, 0xFF); + func_8007B3D0(&D_801263A0); + } + + return sp2C; +} +#else +GLOBAL_ASM("asm/non_matchings/menu/MenuBootLoop.s") +#endif void func_800887C4(void) { func_8009C4A8((s16*)D_800DF7C4); @@ -2402,8 +2620,8 @@ void func_800887E8(void) { func_800C4170(2); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80088938.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_800890AC.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80088938.s") +GLOBAL_ASM("asm/non_matchings/menu/func_800890AC.s") void func_800895A4(void) { func_8009C508(0x3F); @@ -2430,8 +2648,8 @@ void menu_magic_codes_init(void) { func_800C4170(2); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_800896A4.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuMagicCodesLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/func_800896A4.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_magic_codes_loop.s") void func_8008A4C8(void) { func_800C422C(2); @@ -2454,7 +2672,7 @@ void menu_magic_codes_list_init(void) { } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008A56C.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008A56C.s") void func_8008A8F8(s32 arg0, s32 arg1, s32 arg2) { if (arg0 & arg1) { @@ -2465,7 +2683,7 @@ void func_8008A8F8(s32 arg0, s32 arg1, s32 arg2) { } #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuMagicCodesListLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_magic_codes_list_loop.s") #else extern s16 D_80126C80[0x1E]; // Array of shorts of the unlocked cheat's bit ids. @@ -2473,7 +2691,7 @@ void func_8008AD1C(void); void func_8008A56C(void); s32 func_8006A554(s32 arg0); -s32 MenuMagicCodesListLoop(s32 arg0) { +s32 menu_magic_codes_list_loop(s32 arg0) { s32 temp_t0; s32 phi_a2; s32 phi_s0; @@ -2582,7 +2800,7 @@ s32 MenuMagicCodesListLoop(s32 arg0) { } if (D_800DF47C < -0x1E) { func_8008AD1C(); - MenuInit(0xA); + menu_init(0xA); return 0; } D_801263C4 = 0; @@ -2595,7 +2813,7 @@ void func_8008AD1C(void) { func_800C422C(2); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008AD44.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008AD44.s") void func_8008AEB4(s32 arg0, s32 *arg1) { switch(arg0) { @@ -2627,7 +2845,7 @@ void func_8008AF00(s32 arg0) { } } -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuCharacterSelectInit.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_character_select_init.s") void func_8008B20C(s32 arg0) { s32 temp; @@ -2650,13 +2868,13 @@ void func_8008B20C(s32 arg0) { } } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008B358.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008B4C8.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008B758.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008BB3C.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008B358.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008B4C8.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008B758.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008BB3C.s") #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuCharacterSelectLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_character_select_loop.s") #else /* Size: 0xE bytes. */ @@ -2669,7 +2887,7 @@ extern unk801263CC *D_801263CC[8]; // unknown number of entries void func_8008C128(void); -s32 MenuCharacterSelectLoop(s32 arg0) { +s32 menu_character_select_loop(s32 arg0) { s32 i; s32 phi_a0; s32 phi_t3; @@ -2725,15 +2943,15 @@ s32 MenuCharacterSelectLoop(s32 arg0) { func_80000B18(); func_8006E2E8(0x27, -1, 0); if (D_800DF4BC == 1 && D_800DF498 == 0) { - MenuInit(CAUTION_MESSAGE); + menu_init(MENU_CAUTION); } else { - MenuInit(GAME_SELECT); + menu_init(MENU_GAME_SELECT); } } else { func_80000B28(); func_800828B8(); func_8006E5BC(); - MenuInit(TRACK_SELECT); + menu_init(MENU_TRACK_SELECT); } } } else if (D_800DF47C < 0) { @@ -2742,7 +2960,7 @@ s32 MenuCharacterSelectLoop(s32 arg0) { func_80000B28(); func_8008C128(); D_800DF4BC = 1; - MenuInit(TITLE_SCREEN); + menu_init(MENU_TITLE); } } return 0; @@ -2788,7 +3006,7 @@ void func_8008C128(void) { D_800DFFD0 = 0; } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008C168.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008C168.s") void menu_caution_init(void) { D_801263C4 = 0x3C; @@ -2819,7 +3037,7 @@ s32 menu_caution_loop(s32 arg0) { } if (D_800DF47C >= 0x1F) { func_8008C4E8(); - MenuInit(GAME_SELECT); + menu_init(MENU_GAME_SELECT); } if (D_801263C4 > 0) { D_801263C4 = (s32) (D_801263C4 - arg0); @@ -2832,20 +3050,8 @@ void func_8008C4E8(void) { func_800C422C(2); } -#if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuGameSelectInit.s") -#else - -typedef struct MenuElementTest { - MenuElement unk0; - MenuElement unk20; -} MenuElementTest; - -extern MenuElementTest *D_80126460; -extern MenuElementTest D_800E0198[4]; -extern MenuElementTest D_800E0278[4]; - -void MenuGameSelectInit(void) { +#ifdef NON_MATCHING +void menu_game_select_init(void) { s32 i, j; D_800DF47C = 0; @@ -2871,21 +3077,24 @@ void MenuGameSelectInit(void) { func_80001114(6); func_80000B18(); if (func_8009EC60()) { - D_80126460 = (MenuElementTest *)D_800E0278; + D_80126460 = D_800E0278; D_801263E0 = 2; } else { - D_80126460 = (MenuElementTest *)D_800E0198; + D_80126460 = D_800E0198; D_801263E0 = 1; } - for(i = 0; D_801263E0 >= i; i++) { - ((MenuElementTest*)(D_80126460 + i + 1))->unk0.source.texture = D_80126550[67]; + // This loop doesn't match. + for(i = 0; i <= D_801263E0; i++) { + D_80126460[i].texture = D_80126550[67]; } } +#else +GLOBAL_ASM("asm/non_matchings/menu/menu_game_select_init.s") #endif #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008C698.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008C698.s") #else typedef struct unk80126460 { MenuElement textShadow; @@ -2929,7 +3138,7 @@ void func_8008C698(s32 arg0) { } #endif -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuFileSelectLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_game_select_loop.s") void func_8008CACC(void) { func_800C422C(2); @@ -2968,14 +3177,14 @@ void menu_file_select_init(void) { func_80000B18(); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008CC28.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008CC28.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008CD74.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008D5F8.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008D8BC.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008CD74.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008D5F8.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008D8BC.s") #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008DC7C.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008DC7C.s") #else /* Size: 0x0C Bytes */ typedef struct unk801264A0 { @@ -3057,7 +3266,7 @@ void func_8008DC7C(s32 arg0) { } #endif -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuGameSelectLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_file_select_loop.s") void func_8008E428(void) { func_8009C4A8(D_800E0398); @@ -3081,15 +3290,15 @@ void func_8008E4B0(void) { D_800E044C.unk0 = D_80126550[62]; } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008E4EC.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008E4EC.s") #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuTrackSelectInit.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_track_select_init.s") #else extern u32 D_800E0418; -void MenuTrackSelectInit(void){ +void menu_track_select_init(void){ u32 sp_7c; u32 sp_78; Settings *settings; @@ -3109,10 +3318,10 @@ void MenuTrackSelectInit(void){ } #endif -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008F00C.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008F00C.s") #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuTrackSelectLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_track_select_loop.s") #else // Close to done with this function. Just a regalloc issue remains. :/ @@ -3128,7 +3337,7 @@ void func_8008E4EC(void); s32 func_800C73E0(void); void musicSetRelativeVolume(u8 arg0); -s32 MenuTrackSelectLoop(s32 arg0) { +s32 menu_track_select_loop(s32 arg0) { s32 phi_a2; Settings *settings; s32 i = 0; @@ -3183,11 +3392,11 @@ s32 MenuTrackSelectLoop(s32 arg0) { } func_8006E2E8(0x16, -1, phi_a2); func_8008AEB4(0, NULL); - MenuInit(CHARACTER_SELECT); + menu_init(MENU_CHARACTER_SELECT); return 0; } func_8006E2E8(0x27, -1, 0); - MenuInit(GAME_SELECT); + menu_init(MENU_GAME_SELECT); return 0; } if (D_801267D0 >= 2) { @@ -3205,7 +3414,7 @@ s32 MenuTrackSelectLoop(s32 arg0) { gTrophyRaceWorldId = D_801269CC + 1; D_800DF450 = 0; D_800E0FEC = 0; - MenuInit(TROPHY_RACE_ROUND); + menu_init(MENU_TROPHY_RACE_ROUND); return 0; } D_801263C4 = 0; @@ -3237,11 +3446,11 @@ void func_8008F534(void) { func_8006F564(0); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008F618.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008FA54.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8008FF1C.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_800904E8.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80090918.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008F618.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008FA54.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8008FF1C.s") +GLOBAL_ASM("asm/non_matchings/menu/func_800904E8.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80090918.s") void func_80090ED8(s32 arg0) { if (D_801263E0 == 1 && D_800E0414 == 0 && D_80126840 == 0) { @@ -3249,9 +3458,9 @@ void func_80090ED8(s32 arg0) { } } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80090F30.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80090F30.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80092188.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80092188.s") s32 func_80092BE0(s32 arg0) { s8 *trackIdArray; @@ -3285,12 +3494,12 @@ s32 func_80092BE0(s32 arg0) { } #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuLoadNewAreaInit.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_5_init.s") #else extern s16 D_800E0758[8]; // Unknown number of entries. -void MenuLoadNewAreaInit(void) { +void menu_5_init(void) { s32 temp_v0_2; s8 temp_s0; Settings *settings; @@ -3354,8 +3563,8 @@ block_7: } #endif -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80092E94.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuLoadNewAreaLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80092E94.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_5_loop.s") void func_80093A0C(void) { func_8009C4A8((s16*)&D_800E0FB4); @@ -3363,9 +3572,9 @@ void func_80093A0C(void) { func_80000B28(); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80093A40.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80093D40.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80094170.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80093A40.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80093D40.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80094170.s") void func_800945B0(void) { func_80072298(1); @@ -3391,8 +3600,8 @@ void func_80094604(void) { D_800E0AE0.unk0 = D_80126550[59]; } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80094688.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80094A5C.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80094688.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80094A5C.s") void func_80094C14(s32 arg0) { D_801263BC = (D_801263BC + arg0) & 0x3F; @@ -3420,9 +3629,9 @@ void func_80094C14(s32 arg0) { } } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80094D28.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80095624.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80095728.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80094D28.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80095624.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80095728.s") void func_800981E8(void); @@ -3486,8 +3695,8 @@ void menu_11_init(void) { func_80000C98(0x80); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80096978.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/Menu11Loop.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80096978.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_results_loop.s") void func_800976CC(void) { func_8009C4A8(D_800E0A24); @@ -3544,7 +3753,7 @@ s32 func_80097744(unsigned char *arg0, s32 arg1) { } #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_800977D0.s") +GLOBAL_ASM("asm/non_matchings/menu/func_800977D0.s") #else s32 func_800977D0(unsigned char *arg0, unsigned char *arg1) { s32 phi_v0 = 0; @@ -3591,8 +3800,8 @@ void func_80097874(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 *arg4, s32 arg5, } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80097918.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80097D10.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80097918.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80097D10.s") void func_800981E8(void) { func_800C422C(2); @@ -3614,9 +3823,9 @@ extern s32 D_800E0980; s8* func_8001E29C(s32 arg0); #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuTrophyRaceRoundInit.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_trophy_race_round_init.s") #else -void MenuTrophyRaceRoundInit(void) { +void menu_trophy_race_round_init(void) { s32 temp; s32 i; Settings *settings; @@ -3679,17 +3888,17 @@ void func_800983C0(s32 arg0) { func_800C4440(&D_801263A0, 0xA0, sp2C + 0xD0, sp24, 0xC); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuTrophyRaceRoundLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_trophy_race_round_loop.s") void func_80098754(void) { func_800C422C(2); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80098774.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuTrophyRaceRankingsInit.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80098774.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_trophy_race_rankings_init.s") #if 1 -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80098EBC.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80098EBC.s") #else void func_80098EBC(s32 arg0) { s32 test; @@ -3722,7 +3931,7 @@ void func_80098EBC(s32 arg0) { } #endif -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuTrophyRaceRankingsLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_trophy_race_rankings_loop.s") void func_80099600(void) { func_8009C4A8(D_800E1024); @@ -3733,11 +3942,11 @@ s32 get_trophy_race_world_id(void) { return gTrophyRaceWorldId; } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8009963C.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_800998E0.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuGhostDataInit.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_80099E8C.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuGhostDataLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8009963C.s") +GLOBAL_ASM("asm/non_matchings/menu/func_800998E0.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_ghost_data_init.s") +GLOBAL_ASM("asm/non_matchings/menu/func_80099E8C.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_ghost_data_loop.s") void func_8009ABAC(void) { func_8009C4A8(D_800E1708); @@ -3769,7 +3978,7 @@ void func_8009ABD8(s8 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5) { D_80126804 = arg5; } -void menu_17_init(void) { +void menu_23_init(void) { if (D_80126804 != 0) { func_8009C674(D_800E1768); func_80094604(); @@ -3779,7 +3988,7 @@ void menu_17_init(void) { D_801263E0 = 0; } -GLOBAL_ASM("asm/non_matchings/unknown_080500/Menu17Loop.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_23_loop.s") void func_8009AF18(void) { if (D_80126804 != 0) { @@ -3852,8 +4061,8 @@ void menu_credits_init(void) { func_8006F564(1); } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8009B1E4.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/MenuCreditsLoop.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8009B1E4.s") +GLOBAL_ASM("asm/non_matchings/menu/menu_credits_loop.s") void func_8009BCF0(void) { func_80000BE0(0x12); @@ -3932,7 +4141,7 @@ void func_8009BE5C(void) { } } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8009BF20.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8009BF20.s") void func_8009C154(void) { s32 i; @@ -4114,7 +4323,7 @@ void func_8009C674(s16 *arg0) { } } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8009C6D4.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8009C6D4.s") void func_8009C904(s32 arg0); @@ -4149,8 +4358,8 @@ void func_8009C904(s32 arg0) { void func_8009CA58(void) { } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8009CA60.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8009CD7C.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8009CA60.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8009CD7C.s") void func_8009CF68(s32 arg0) { if (D_800DF4E4[arg0] == 0) { @@ -4171,7 +4380,7 @@ void func_8009CFB0(void) { } } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8009CFEC.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8009CFEC.s") void func_8009D118(s32 arg0) { if (arg0 == 0) { @@ -4227,7 +4436,7 @@ void func_8009D33C(s32 arg0, s32 arg1) { } } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8009D360.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8009D360.s") s32 func_8009D9F4(void) { s32 state; @@ -4259,9 +4468,9 @@ s32 func_8009D9F4(void) { return state; } -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8009DB3C.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8009E3D0.s") -GLOBAL_ASM("asm/non_matchings/unknown_080500/func_8009E7E8.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8009DB3C.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8009E3D0.s") +GLOBAL_ASM("asm/non_matchings/menu/func_8009E7E8.s") void func_8009E9A0(void) { @@ -4347,10 +4556,17 @@ s32 func_8009EC60(void) { return D_80126448 & 1; } +/** + * Returns 1 if the player is in adventure 2 + */ s32 is_in_adventure_two(void) { return gIsInAdventureTwo; } +/** + * Returns 1 if the player is in the two player adventure mode. + * This will automatically return 0 while in tracks mode. + */ s32 is_in_two_player_adventure(void) { if (is_in_tracks_mode()) { return 0; @@ -4358,10 +4574,16 @@ s32 is_in_two_player_adventure(void) { return gIsInTwoPlayerAdventure; } +/** + * Returns 1 if T.T. is avaliable to use, or 0 if not. + */ s32 is_tt_unlocked(void) { return gActiveMagicCodes & 1; } +/** + * Returns 1 if Drumstick is avaliable to use, or 0 if not. + */ s32 is_drumstick_unlocked(void) { return gActiveMagicCodes & 2; } diff --git a/include/unknown_080500.h b/src/menu.h similarity index 100% rename from include/unknown_080500.h rename to src/menu.h diff --git a/include/unknown_003260.h b/src/unknown_003260.h similarity index 100% rename from include/unknown_003260.h rename to src/unknown_003260.h diff --git a/include/unknown_005740.h b/src/unknown_005740.h similarity index 100% rename from include/unknown_005740.h rename to src/unknown_005740.h diff --git a/include/unknown_00BC20.h b/src/unknown_00BC20.h similarity index 100% rename from include/unknown_00BC20.h rename to src/unknown_00BC20.h diff --git a/include/unknown_0255E0.h b/src/unknown_0255E0.h similarity index 100% rename from include/unknown_0255E0.h rename to src/unknown_0255E0.h diff --git a/include/unknown_032760.h b/src/unknown_032760.h similarity index 100% rename from include/unknown_032760.h rename to src/unknown_032760.h diff --git a/include/unknown_0348C0.h b/src/unknown_0348C0.h similarity index 100% rename from include/unknown_0348C0.h rename to src/unknown_0348C0.h diff --git a/include/unknown_043920.h b/src/unknown_043920.h similarity index 100% rename from include/unknown_043920.h rename to src/unknown_043920.h diff --git a/include/unknown_05CEF0.h b/src/unknown_05CEF0.h similarity index 100% rename from include/unknown_05CEF0.h rename to src/unknown_05CEF0.h diff --git a/include/unknown_05DCD0.h b/src/unknown_05DCD0.h similarity index 100% rename from include/unknown_05DCD0.h rename to src/unknown_05DCD0.h diff --git a/include/unknown_05F0C0.h b/src/unknown_05F0C0.h similarity index 100% rename from include/unknown_05F0C0.h rename to src/unknown_05F0C0.h diff --git a/include/unknown_05F690.h b/src/unknown_05F690.h similarity index 100% rename from include/unknown_05F690.h rename to src/unknown_05F690.h diff --git a/include/unknown_05FF10.h b/src/unknown_05FF10.h similarity index 100% rename from include/unknown_05FF10.h rename to src/unknown_05FF10.h diff --git a/include/unknown_060450.h b/src/unknown_060450.h similarity index 100% rename from include/unknown_060450.h rename to src/unknown_060450.h diff --git a/include/unknown_061D30.h b/src/unknown_061D30.h similarity index 100% rename from include/unknown_061D30.h rename to src/unknown_061D30.h diff --git a/include/unknown_064690.h b/src/unknown_064690.h similarity index 100% rename from include/unknown_064690.h rename to src/unknown_064690.h diff --git a/include/unknown_0646F0.h b/src/unknown_0646F0.h similarity index 100% rename from include/unknown_0646F0.h rename to src/unknown_0646F0.h diff --git a/include/unknown_0647A0.h b/src/unknown_0647A0.h similarity index 100% rename from include/unknown_0647A0.h rename to src/unknown_0647A0.h diff --git a/include/unknown_064800.h b/src/unknown_064800.h similarity index 100% rename from include/unknown_064800.h rename to src/unknown_064800.h diff --git a/include/unknown_064830.h b/src/unknown_064830.h similarity index 100% rename from include/unknown_064830.h rename to src/unknown_064830.h diff --git a/include/unknown_065D30.h b/src/unknown_065D30.h similarity index 100% rename from include/unknown_065D30.h rename to src/unknown_065D30.h diff --git a/include/unknown_066460.h b/src/unknown_066460.h similarity index 100% rename from include/unknown_066460.h rename to src/unknown_066460.h diff --git a/include/unknown_066500.h b/src/unknown_066500.h similarity index 100% rename from include/unknown_066500.h rename to src/unknown_066500.h diff --git a/include/unknown_0667D0.h b/src/unknown_0667D0.h similarity index 100% rename from include/unknown_0667D0.h rename to src/unknown_0667D0.h diff --git a/include/unknown_066AA0.h b/src/unknown_066AA0.h similarity index 100% rename from include/unknown_066AA0.h rename to src/unknown_066AA0.h diff --git a/src/unknown_06B2B0.c b/src/unknown_06B2B0.c index 55cfcfb8..b998ec18 100644 --- a/src/unknown_06B2B0.c +++ b/src/unknown_06B2B0.c @@ -891,7 +891,7 @@ GLOBAL_ASM("asm/non_matchings/unknown_066AA0/func_8006DA28.s") void func_8006DB3C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); void func_800813C0(s32); void func_80004A60(s32, s32); -void MenuInit(s32); +void menu_init(s32); void func_8006DA28(s32 arg0, s32 arg1, s32 arg2) { func_8006ECFC(0); @@ -913,7 +913,7 @@ void func_8006DA28(s32 arg0, s32 arg1, s32 arg2) { if (arg0 == 0 || arg0 == 1 || arg0 == 2) { func_800813C0(arg0); } - MenuInit(arg0); + menu_init(arg0); D_80123504 = 0; } #endif diff --git a/include/unknown_06B2B0.h b/src/unknown_06B2B0.h similarity index 100% rename from include/unknown_06B2B0.h rename to src/unknown_06B2B0.h diff --git a/include/unknown_071730.h b/src/unknown_071730.h similarity index 100% rename from include/unknown_071730.h rename to src/unknown_071730.h diff --git a/include/unknown_072E50.h b/src/unknown_072E50.h similarity index 100% rename from include/unknown_072E50.h rename to src/unknown_072E50.h diff --git a/include/unknown_0777A0.h b/src/unknown_0777A0.h similarity index 100% rename from include/unknown_0777A0.h rename to src/unknown_0777A0.h diff --git a/include/unknown_077C50.h b/src/unknown_077C50.h similarity index 100% rename from include/unknown_077C50.h rename to src/unknown_077C50.h diff --git a/include/unknown_078050.h b/src/unknown_078050.h similarity index 100% rename from include/unknown_078050.h rename to src/unknown_078050.h diff --git a/include/unknown_079F50.h b/src/unknown_079F50.h similarity index 100% rename from include/unknown_079F50.h rename to src/unknown_079F50.h diff --git a/include/unknown_07AF10.h b/src/unknown_07AF10.h similarity index 100% rename from include/unknown_07AF10.h rename to src/unknown_07AF10.h diff --git a/include/unknown_07B870.h b/src/unknown_07B870.h similarity index 100% rename from include/unknown_07B870.h rename to src/unknown_07B870.h diff --git a/include/unknown_080240.h b/src/unknown_080240.h similarity index 100% rename from include/unknown_080240.h rename to src/unknown_080240.h diff --git a/test.sh b/test.sh new file mode 100755 index 00000000..28aceb4b --- /dev/null +++ b/test.sh @@ -0,0 +1,10 @@ +#{ +a=0 +# Rename asm files that use the old name and replace it with a new one. +filenames=$(grep -rl "$1" asm/**/*/"$1".s) +echo $filenames +echo if [[ $filenames =~ "No such file or directory" ]]; then + a=1 +fi +#} &> /dev/null +echo $a \ No newline at end of file diff --git a/diff.py b/tools/python/diff.py similarity index 100% rename from diff.py rename to tools/python/diff.py diff --git a/tools/python/diff_settings.py b/tools/python/diff_settings.py new file mode 100644 index 00000000..db5200ff --- /dev/null +++ b/tools/python/diff_settings.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 + +def add_custom_arguments(parser): + group = parser.add_mutually_exclusive_group(required=False) + # group.add_argument('-j', dest='version', action='store_const', const='jp', + # help="Set version to JP.") + # group.add_argument('-u', dest='version', action='store_const', const='us', + # help="Set version to US.") + # group.add_argument('-e', dest='version', action='store_const', const='eu', + # help="Set version to EU.") + # group.add_argument('-s', dest='version', action='store_const', const='sh', + # help="Set version to SH.") + +def apply(config, args): + version = 'us_1.0' # Right now only us_1.0 is supported + config['mapfile'] = f'build/' + version + '/dkr.map' + config['myimg'] = f'build/' + version + '/dkr.z64' + config['baseimg'] = find_baserom(version) + config['makeflags'] = [f''] + config['source_directories'] = ['src'] + +######################################################################################## + +from os import listdir +from os.path import isfile, join + +CRCS = { + 'us_1.0': (0x53D440E7, 0x7519B011) +} + +def get_filenames_from_directory(directory, extensions=None): + if extensions is None: + return [f for f in listdir(directory) if isfile(join(directory, f))] + else: + return [f for f in listdir(directory) if isfile(join(directory, f)) and f.endswith(extensions)] + +def get_rom_crcs(romPath): + with open(romPath, 'rb') as inFile: + rom = inFile.read() + crc1 = int.from_bytes(rom[0x10:0x14], "big") + crc2 = int.from_bytes(rom[0x14:0x18], "big") + return (crc1, crc2) + +def find_baserom(version): + romFiles = get_filenames_from_directory('baseroms/', ('.z64',)) + for romFilename in romFiles: + romFilepath = 'baseroms/' + romFilename + if get_rom_crcs(romFilepath) == CRCS[version]: + return romFilepath + raise Exception('Could not find a rom file for the version: "' + version + '"') + +######################################################################################## diff --git a/tools/python/file_util.py b/tools/python/file_util.py index 658b359e..694db06e 100644 --- a/tools/python/file_util.py +++ b/tools/python/file_util.py @@ -1,4 +1,4 @@ -from os import chdir, listdir, remove +from os import chdir, listdir, remove, rename from os.path import dirname, isfile, isdir, join, realpath, exists class FileUtil: @@ -43,6 +43,19 @@ class FileUtil: else: filenames += FileUtil.get_filenames_from_directory_recursive(join(directory, f), extensions, subDirectory + '/' + f) return filenames + + @staticmethod + def get_directories_from_directory_recursive(directory, extensions=None, subDirectory=''): + filenames = [] + for f in listdir(directory): + path = join(directory, f) + if isdir(path): + filenames.append(((subDirectory + '/') if subDirectory != '' else '') + f) + if subDirectory == '': + filenames += FileUtil.get_directories_from_directory_recursive(path, extensions, f) + else: + filenames += FileUtil.get_directories_from_directory_recursive(path, extensions, subDirectory + '/' + f) + return filenames @staticmethod def get_text_from_file(filename): @@ -63,7 +76,11 @@ class FileUtil: def write_bytes_to_file(filename, binary): with open(filename, 'wb') as outFile: outFile.write(binary) - + + @staticmethod + def rename_file(old_filename, new_filename): + rename(old_filename, new_filename) + @staticmethod def delete_file(filename): remove(filename) diff --git a/tools/python/rename_file.py b/tools/python/rename_file.py new file mode 100644 index 00000000..7114d251 --- /dev/null +++ b/tools/python/rename_file.py @@ -0,0 +1,37 @@ +import sys + +from file_util import FileUtil + +ASM_DIR = './asm' +LIB_ASM_DIR = './lib/asm' +SRC_DIR = './src' +LIB_SRC_DIR = './lib/src' + +if len(sys.argv) < 2: + print('Usage: rename_file.py old_symbol new_symbol') + +oldSymbol = sys.argv[1] +newSymbol = sys.argv[2] + +def find_and_rename(directory, paths): + for name in paths: + path = directory + '/' + name + if oldSymbol in path: + newPath = path.replace(oldSymbol, newSymbol) + print('Renamed "' + path + '" to "' + newPath + '"') + try: + FileUtil.rename_file(path, newPath) + except FileNotFoundError: + pass + +asmDirectories = FileUtil.get_directories_from_directory_recursive(ASM_DIR) +asmFiles = FileUtil.get_filenames_from_directory_recursive(ASM_DIR) +libAsmDirectories = FileUtil.get_directories_from_directory_recursive(LIB_ASM_DIR) +libAsmFiles = FileUtil.get_filenames_from_directory_recursive(ASM_DIR) +srcFiles = FileUtil.get_filenames_from_directory_recursive(SRC_DIR) +libSrcFiles = FileUtil.get_filenames_from_directory_recursive(LIB_SRC_DIR) + +find_and_rename(ASM_DIR, asmDirectories + asmFiles) +find_and_rename(LIB_ASM_DIR, libAsmDirectories + libAsmFiles) +find_and_rename(SRC_DIR, srcFiles) +find_and_rename(LIB_SRC_DIR, libSrcFiles) diff --git a/tools/python/score.py b/tools/python/score.py index b9b52ac2..2249171e 100644 --- a/tools/python/score.py +++ b/tools/python/score.py @@ -1,6 +1,7 @@ import re import sys import argparse +import time from file_util import FileUtil from score_display import ScoreDisplay @@ -29,9 +30,9 @@ for folder in ASM_FOLDERS: BUILD_DIRECTORY = './build/us_1.0' SRC_DIRECTORY = './src' LIB_SRC_DIRECTORY = './lib/src' -FUNCTION_REGEX = r'((?:[\/][*][*]+[\n])(?:[^\n]*\n)*?(?:.*[*][\/]))?(void|s64|s32|s16|s8|u64|u32|u16|u8|f32|f64)(?:\s|[*])*([0-9A-Za-z_]+)\s*[(][^)]*[)]\s*{' +FUNCTION_REGEX = r'(\/[*][*!]+\n(?:.*\n)+?\s*[*]\/\n)?(void|s64|s32|s16|s8|u64|u32|u16|u8|f32|f64)(?:\s|[*])*?([0-9A-Za-z_]+)\s*[(][^)]*[)]\s*{' GLOBAL_ASM_REGEX = r'GLOBAL_ASM[(]".*(?=\/)\/([^.]+).s"[)]' -WIP_REGEX = r'#if(.|\n)*?(GLOBAL_ASM[(]([^)]*)[)])(.|\n)*?#else(.|\n)*?#endif' +WIP_REGEX = r'#if(?:.|\n)*?(GLOBAL_ASM[(][^)]*[)])(.|\n)*?#endif' CODE_START = 0x80000400 CODE_END = 0x800D75F4 @@ -83,14 +84,13 @@ class ScoreFile: def read_file(self): with open(self.path, "r") as inFile: self.text = inFile.read() - self.text = re.sub(WIP_REGEX, r"GLOBAL_ASM(\3)", self.text) + self.text = re.sub(WIP_REGEX, r"GLOBAL_ASM(\1)", self.text) def get_matches(self): matches = re.finditer(FUNCTION_REGEX, self.text, re.MULTILINE) for matchNum, match in enumerate(matches, start=1): groups = match.groups() self.functions.append(ScoreFileMatch(groups[0], groups[2])) - matches = re.finditer(GLOBAL_ASM_REGEX, self.text, re.MULTILINE) for matchNum, match in enumerate(matches, start=1): groups = match.groups() @@ -160,7 +160,7 @@ def main(): scoreFiles.append(scoreFile) - totalNumberOfFunctions = MAP_FILE.numFunctions + totalNumberOfFunctions = totalNumberOfDecompiledFunctions + totalNumberOfGlobalAsms for asm_function in ASM_LABELS: if asm_function in MAP_FILE.functionSizes: totalSizeOfDecompiledFunctions += MAP_FILE.functionSizes[asm_function]