Update README and deleted asm files.

This commit is contained in:
David
2023-11-02 21:36:34 -05:00
parent 34c465815c
commit 1e20456c79
4 changed files with 181 additions and 2529 deletions
+181 -181
View File
@@ -1,181 +1,181 @@
# Diddy Kong Racing
This repo contains a work-in-progress decompilation of Diddy Kong Racing for the N64. You will need to have a original copy of the ROM to extract the game's assets.
Currently, only the US 1.0 version of the game is supported. US 1.1, EU 1.0, EU 1.1, and JP are not supported at this time.
<!-- README_SCORE_SUMMARY_BEGIN -->
As of October 31, 2023, this is our current score:
&emsp;&emsp;&emsp;&emsp;Decomp progress: 63.04%
&emsp;&emsp;&emsp;&emsp;Documentation progress: 35.21%
<!-- README_SCORE_SUMMARY_END -->
---
## Dependencies
* `libcapstone-dev`
* `gcc`, Version 8.0 or higher
* `make`, Version 4.2 or higher
* `python3`
* `wget`
`sudo apt install build-essential pkg-config git python3 wget libcapstone-dev`
### binutils
You are not required to install a binutils package, but it does speed up the initial setup if you do have it installed.
* Ubuntu/Debian (x86): `sudo apt install binutils-mips-linux-gnu`
## Setup / Building
1. Install the dependencies
2. Place the ROM file within the `baseroms` directory.
**a.** The name of the ROM file does not matter, but it must end with one of these extensions: `.z64`, `.v64`, `.n64`, or `.rom`. It will be detected automatically from an md5 checksum.
**b.** If you use a byte-swapped or little-endian ROM, then it will automatically be converted to a big-endian (.z64) ROM file.
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`.
### Building on MacOS
1. `brew install gcc capstone coreutils`
2. Put GNU-coreutils `bin` on path using by adding `PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"` to your shell rcfile (or update any GNU-util usage in `Makefile` and `tools/Makefile` to use the `g`-prefixed versions).
3. Download latest `macos` build of `ido-static-recomp` from [here](https://github.com/decompals/ido-static-recomp/releases/), and add `cp` the binaries to `tools/ido-static-recomp/build5.3/out`.
4. Take a look at [this gist](https://gist.github.com/tonyspumoni/fc1b4c9217c5f2821a9fc4cbf69b51ef) to see what other updates are needed to get the build to pass, and apply them if they are relevant to your environment. You may need to add specific `-I` and `-L` flags to get things like `openssl` and `gcc-12` includes/libs included.
5. `make` from repository root should work now.
## Modding
If you are modifying the code in the repo, then you should add `NON_MATCHING=1` to the make command.
Example: `make NON_MATCHING=1 -j4`
The `NON_MATCHING` define will include the functions that don't exactly match one-to-one, but should be no different functionality-wise. If you do notice any bugs that occur in a `NON_MATCHING` build that are not in the vanilla game, then please file an issue describing the bug. It would be helpful if you can track down which function is causing the bug, but that is not required.
## Style Guide
The style guide for the project can be found here: https://docs.google.com/document/d/1euQf8nwynGcCZL1MfoMaLs-XRvx3ejjj8fIfykUZ-NQ
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.
---
#### `./extract.sh <version>`
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`.
Example: `./extract.sh us_1.0`
---
#### `./diff.sh <function_name>`
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 <old_name> <new_name>`
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 <ram_address>|<symbol>`
Given either a RAM address or symbol, returns its `(symbol, address)` pairing as defined in `/build/us_1.0/dkr.map`. If specified, the RAM address must be in base 16. The `0x` prefix is not required.
Example:
```
./get_symbol.sh 0xA4001000
0xA4001000 = SP_IMEM
./get_symbol.sh osCicId
0x80000310 = osCicId
```
---
#### `./score.sh`
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;
}
```
<!-- README_SCORE_BEGIN -->
As of November 2nd, 2023, this is our current score:
```
========================================================================
ADVENTURE ONE (ASM -> C Decompilation)
--------------------------- 63.04% Complete ----------------------------
# Decompiled functions: 1661
# GLOBAL_ASM remaining: 184
# NON_MATCHING functions: 14
# NON_EQUIVALENT WIP functions: 52
----------------------------- Game Status ------------------------------
Balloons: 30/47, Keys: 3/4, Trophies: 2/5
T.T. Amulets: 3/4, Wizpig Amulets: 3/4
------------------------------------------------------------------------
We are participating in the Trophy Race of Sherbet Island. (Round Three)
========================================================================
ADVENTURE TWO (Cleanup & Documentation)
--------------------------- 35.21% Complete ----------------------------
# Documented functions: 825
# Undocumented remaining: 743
----------------------------- Game Status ------------------------------
Balloons: 17/47, Keys: 2/4, Trophies: 1/5
T.T. Amulets: 2/4, Wizpig Amulets: 1/4
------------------------------------------------------------------------
We are collecting silver coins in Everfrost Peak. (2/8 silver coins)
========================================================================
```
<!-- README_SCORE_END -->
---
## TODO list
### Major
What should be focused on.
* Decompiling the non-matching asm files into matching C functions.
* 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.
* Add support for the other 4 versions.
# Diddy Kong Racing
This repo contains a work-in-progress decompilation of Diddy Kong Racing for the N64. You will need to have a original copy of the ROM to extract the game's assets.
Currently, only the US 1.0 version of the game is supported. US 1.1, EU 1.0, EU 1.1, and JP are not supported at this time.
<!-- README_SCORE_SUMMARY_BEGIN -->
As of November 2, 2023, this is our current score:
&emsp;&emsp;&emsp;&emsp;Decomp progress: 64.04%
&emsp;&emsp;&emsp;&emsp;Documentation progress: 35.21%
<!-- README_SCORE_SUMMARY_END -->
---
## Dependencies
* `libcapstone-dev`
* `gcc`, Version 8.0 or higher
* `make`, Version 4.2 or higher
* `python3`
* `wget`
`sudo apt install build-essential pkg-config git python3 wget libcapstone-dev`
### binutils
You are not required to install a binutils package, but it does speed up the initial setup if you do have it installed.
* Ubuntu/Debian (x86): `sudo apt install binutils-mips-linux-gnu`
## Setup / Building
1. Install the dependencies
2. Place the ROM file within the `baseroms` directory.
**a.** The name of the ROM file does not matter, but it must end with one of these extensions: `.z64`, `.v64`, `.n64`, or `.rom`. It will be detected automatically from an md5 checksum.
**b.** If you use a byte-swapped or little-endian ROM, then it will automatically be converted to a big-endian (.z64) ROM file.
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`.
### Building on MacOS
1. `brew install gcc capstone coreutils`
2. Put GNU-coreutils `bin` on path using by adding `PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"` to your shell rcfile (or update any GNU-util usage in `Makefile` and `tools/Makefile` to use the `g`-prefixed versions).
3. Download latest `macos` build of `ido-static-recomp` from [here](https://github.com/decompals/ido-static-recomp/releases/), and add `cp` the binaries to `tools/ido-static-recomp/build5.3/out`.
4. Take a look at [this gist](https://gist.github.com/tonyspumoni/fc1b4c9217c5f2821a9fc4cbf69b51ef) to see what other updates are needed to get the build to pass, and apply them if they are relevant to your environment. You may need to add specific `-I` and `-L` flags to get things like `openssl` and `gcc-12` includes/libs included.
5. `make` from repository root should work now.
## Modding
If you are modifying the code in the repo, then you should add `NON_MATCHING=1` to the make command.
Example: `make NON_MATCHING=1 -j4`
The `NON_MATCHING` define will include the functions that don't exactly match one-to-one, but should be no different functionality-wise. If you do notice any bugs that occur in a `NON_MATCHING` build that are not in the vanilla game, then please file an issue describing the bug. It would be helpful if you can track down which function is causing the bug, but that is not required.
## Style Guide
The style guide for the project can be found here: https://docs.google.com/document/d/1euQf8nwynGcCZL1MfoMaLs-XRvx3ejjj8fIfykUZ-NQ
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.
---
#### `./extract.sh <version>`
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`.
Example: `./extract.sh us_1.0`
---
#### `./diff.sh <function_name>`
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 <old_name> <new_name>`
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 <ram_address>|<symbol>`
Given either a RAM address or symbol, returns its `(symbol, address)` pairing as defined in `/build/us_1.0/dkr.map`. If specified, the RAM address must be in base 16. The `0x` prefix is not required.
Example:
```
./get_symbol.sh 0xA4001000
0xA4001000 = SP_IMEM
./get_symbol.sh osCicId
0x80000310 = osCicId
```
---
#### `./score.sh`
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;
}
```
<!-- README_SCORE_BEGIN -->
As of November 2, 2023, this is our current score:
```
====================================================================
ADVENTURE ONE (ASM -> C Decompilation)
--------------------- 64.04% (66.95%) Complete ---------------------
# Decompiled functions: 1664
# GLOBAL_ASM remaining: 181
# NON_MATCHING functions: 16
# NON_EQUIVALENT WIP functions: 50
--------------------------- Game Status ----------------------------
Balloons: 30/47, Keys: 3/4, Trophies: 3/5
T.T. Amulets: 3/4, Wizpig Amulets: 3/4
--------------------------------------------------------------------
We are racing Taj in the Plane Challenge. (Lap 1/3)
====================================================================
ADVENTURE TWO (Cleanup & Documentation)
------------------------- 35.21% Complete --------------------------
# Documented functions: 825
# Undocumented remaining: 743
--------------------------- Game Status ----------------------------
Balloons: 17/47, Keys: 2/4, Trophies: 1/5
T.T. Amulets: 2/4, Wizpig Amulets: 1/4
--------------------------------------------------------------------
We are collecting silver coins in Everfrost Peak. (2/8 silver coins)
====================================================================
```
<!-- README_SCORE_END -->
---
## TODO list
### Major
What should be focused on.
* Decompiling the non-matching asm files into matching C functions.
* 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.
* Add support for the other 4 versions.
-475
View File
@@ -1,475 +0,0 @@
.late_rodata
glabel jpt_800E8418
.word L80086B54, L80086CDC, L80086D54, L80086F74, L80087084, L80087110, L800871C4, L800871C4, L800871C4, L80087158
.text
glabel func_80086AFC
/* 0876FC 80086AFC 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 087700 80086B00 AFBF0014 */ sw $ra, 0x14($sp)
/* 087704 80086B04 0C01BAA4 */ jal get_settings
/* 087708 80086B08 00000000 */ nop
/* 08770C 80086B0C 3C0F8012 */ lui $t7, %hi(D_80126BD4) # $t7, 0x8012
/* 087710 80086B10 8DEF6BD4 */ lw $t7, %lo(D_80126BD4)($t7)
/* 087714 80086B14 3C0E8012 */ lui $t6, %hi(D_80126A0C) # $t6, 0x8012
/* 087718 80086B18 8DCE6A0C */ lw $t6, %lo(D_80126A0C)($t6)
/* 08771C 80086B1C 000FC100 */ sll $t8, $t7, 4
/* 087720 80086B20 01D83821 */ addu $a3, $t6, $t8
/* 087724 80086B24 90F90000 */ lbu $t9, ($a3)
/* 087728 80086B28 00403025 */ move $a2, $v0
/* 08772C 80086B2C 272AFFFF */ addiu $t2, $t9, -1
/* 087730 80086B30 2D41000A */ sltiu $at, $t2, 0xa
/* 087734 80086B34 102001A3 */ beqz $at, .L800871C4
/* 087738 80086B38 000A5080 */ sll $t2, $t2, 2
/* 08773C 80086B3C 3C01800F */ lui $at, %hi(jpt_800E8418) # $at, 0x800f
/* 087740 80086B40 002A0821 */ addu $at, $at, $t2
/* 087744 80086B44 8C2A8418 */ lw $t2, %lo(jpt_800E8418)($at)
/* 087748 80086B48 00000000 */ nop
/* 08774C 80086B4C 01400008 */ jr $t2
/* 087750 80086B50 00000000 */ nop
glabel L80086B54
/* 087754 80086B54 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 087758 80086B58 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 08775C 80086B5C 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 087760 80086B60 8D2C0000 */ lw $t4, ($t1)
/* 087764 80086B64 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 087768 80086B68 8D0B0000 */ lw $t3, ($t0)
/* 08776C 80086B6C 000C6900 */ sll $t5, $t4, 4
/* 087770 80086B70 016D1821 */ addu $v1, $t3, $t5
/* 087774 80086B74 90620000 */ lbu $v0, ($v1)
/* 087778 80086B78 24010001 */ li $at, 1
/* 08777C 80086B7C 10410007 */ beq $v0, $at, .L80086B9C
/* 087780 80086B80 24010007 */ li $at, 7
/* 087784 80086B84 10410043 */ beq $v0, $at, .L80086C94
/* 087788 80086B88 24010008 */ li $at, 8
/* 08778C 80086B8C 1041003C */ beq $v0, $at, .L80086C80
/* 087790 80086B90 00000000 */ nop
/* 087794 80086B94 1000018D */ b .L800871CC
/* 087798 80086B98 8FBF0014 */ lw $ra, 0x14($sp)
.L80086B9C:
/* 08779C 80086B9C 90640006 */ lbu $a0, 6($v1)
/* 0877A0 80086BA0 0C01BB06 */ jal force_mark_write_save_file
/* 0877A4 80086BA4 AFA60028 */ sw $a2, 0x28($sp)
/* 0877A8 80086BA8 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 0877AC 80086BAC 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 0877B0 80086BB0 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 0877B4 80086BB4 8D380000 */ lw $t8, ($t1)
/* 0877B8 80086BB8 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 0877BC 80086BBC 8D0E0000 */ lw $t6, ($t0)
/* 0877C0 80086BC0 0018C900 */ sll $t9, $t8, 4
/* 0877C4 80086BC4 01D95021 */ addu $t2, $t6, $t9
/* 0877C8 80086BC8 914C0006 */ lbu $t4, 6($t2)
/* 0877CC 80086BCC 3C038012 */ lui $v1, %hi(gSavefileData) # $v1, 0x8012
/* 0877D0 80086BD0 8FA60028 */ lw $a2, 0x28($sp)
/* 0877D4 80086BD4 24636530 */ addiu $v1, %lo(gSavefileData) # addiu $v1, $v1, 0x6530
/* 0877D8 80086BD8 000C5880 */ sll $t3, $t4, 2
/* 0877DC 80086BDC 006B6821 */ addu $t5, $v1, $t3
/* 0877E0 80086BE0 8DB80000 */ lw $t8, ($t5)
/* 0877E4 80086BE4 8CCF0010 */ lw $t7, 0x10($a2)
/* 0877E8 80086BE8 00000000 */ nop
/* 0877EC 80086BEC AF0F0010 */ sw $t7, 0x10($t8)
/* 0877F0 80086BF0 8D390000 */ lw $t9, ($t1)
/* 0877F4 80086BF4 8D0E0000 */ lw $t6, ($t0)
/* 0877F8 80086BF8 00195100 */ sll $t2, $t9, 4
/* 0877FC 80086BFC 01CA6021 */ addu $t4, $t6, $t2
/* 087800 80086C00 918B0006 */ lbu $t3, 6($t4)
/* 087804 80086C04 00000000 */ nop
/* 087808 80086C08 000B6880 */ sll $t5, $t3, 2
/* 08780C 80086C0C 006D7821 */ addu $t7, $v1, $t5
/* 087810 80086C10 8DF80000 */ lw $t8, ($t7)
/* 087814 80086C14 00000000 */ nop
/* 087818 80086C18 A300004B */ sb $zero, 0x4b($t8)
/* 08781C 80086C1C 8D2C0000 */ lw $t4, ($t1)
/* 087820 80086C20 8D0A0000 */ lw $t2, ($t0)
/* 087824 80086C24 000C5900 */ sll $t3, $t4, 4
/* 087828 80086C28 014B6821 */ addu $t5, $t2, $t3
/* 08782C 80086C2C 91AF0006 */ lbu $t7, 6($t5)
/* 087830 80086C30 8CD90000 */ lw $t9, ($a2)
/* 087834 80086C34 000FC080 */ sll $t8, $t7, 2
/* 087838 80086C38 872E0000 */ lh $t6, ($t9)
/* 08783C 80086C3C 0078C821 */ addu $t9, $v1, $t8
/* 087840 80086C40 8F2C0000 */ lw $t4, ($t9)
/* 087844 80086C44 00000000 */ nop
/* 087848 80086C48 8D8A0000 */ lw $t2, ($t4)
/* 08784C 80086C4C 00000000 */ nop
/* 087850 80086C50 A54E0000 */ sh $t6, ($t2)
/* 087854 80086C54 8D2F0000 */ lw $t7, ($t1)
/* 087858 80086C58 8D0D0000 */ lw $t5, ($t0)
/* 08785C 80086C5C 000FC100 */ sll $t8, $t7, 4
/* 087860 80086C60 01B8C821 */ addu $t9, $t5, $t8
/* 087864 80086C64 932C0006 */ lbu $t4, 6($t9)
/* 087868 80086C68 8CCB0050 */ lw $t3, 0x50($a2)
/* 08786C 80086C6C 000C7080 */ sll $t6, $t4, 2
/* 087870 80086C70 006E5021 */ addu $t2, $v1, $t6
/* 087874 80086C74 8D4F0000 */ lw $t7, ($t2)
/* 087878 80086C78 10000153 */ b .L800871C8
/* 08787C 80086C7C ADEB0050 */ sw $t3, 0x50($t7)
.L80086C80:
/* 087880 80086C80 90640006 */ lbu $a0, 6($v1)
/* 087884 80086C84 0C01CFD7 */ jal write_game_data_to_controller_pak
/* 087888 80086C88 00C02825 */ move $a1, $a2
/* 08788C 80086C8C 1000014E */ b .L800871C8
/* 087890 80086C90 AFA20038 */ sw $v0, 0x38($sp)
.L80086C94:
/* 087894 80086C94 90E40006 */ lbu $a0, 6($a3)
/* 087898 80086C98 0C01BB2B */ jal mark_save_file_to_erase
/* 08789C 80086C9C 00000000 */ nop
/* 0878A0 80086CA0 3C198012 */ lui $t9, %hi(D_80126BD4) # $t9, 0x8012
/* 0878A4 80086CA4 8F396BD4 */ lw $t9, %lo(D_80126BD4)($t9)
/* 0878A8 80086CA8 3C188012 */ lui $t8, %hi(D_80126A0C) # $t8, 0x8012
/* 0878AC 80086CAC 8F186A0C */ lw $t8, %lo(D_80126A0C)($t8)
/* 0878B0 80086CB0 00196100 */ sll $t4, $t9, 4
/* 0878B4 80086CB4 030C7021 */ addu $t6, $t8, $t4
/* 0878B8 80086CB8 91CA0006 */ lbu $t2, 6($t6)
/* 0878BC 80086CBC 3C038012 */ lui $v1, %hi(gSavefileData) # $v1, 0x8012
/* 0878C0 80086CC0 24636530 */ addiu $v1, %lo(gSavefileData) # addiu $v1, $v1, 0x6530
/* 0878C4 80086CC4 000A5880 */ sll $t3, $t2, 2
/* 0878C8 80086CC8 006B7821 */ addu $t7, $v1, $t3
/* 0878CC 80086CCC 8DF90000 */ lw $t9, ($t7)
/* 0878D0 80086CD0 240D0001 */ li $t5, 1
/* 0878D4 80086CD4 1000013C */ b .L800871C8
/* 0878D8 80086CD8 A32D004B */ sb $t5, 0x4b($t9)
glabel L80086CDC
/* 0878DC 80086CDC 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 0878E0 80086CE0 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 0878E4 80086CE4 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 0878E8 80086CE8 8D2C0000 */ lw $t4, ($t1)
/* 0878EC 80086CEC 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 0878F0 80086CF0 8D180000 */ lw $t8, ($t0)
/* 0878F4 80086CF4 000C7100 */ sll $t6, $t4, 4
/* 0878F8 80086CF8 030E1821 */ addu $v1, $t8, $t6
/* 0878FC 80086CFC 90620000 */ lbu $v0, ($v1)
/* 087900 80086D00 24010007 */ li $at, 7
/* 087904 80086D04 10410009 */ beq $v0, $at, .L80086D2C
/* 087908 80086D08 00C02025 */ move $a0, $a2
/* 08790C 80086D0C 24010008 */ li $at, 8
/* 087910 80086D10 1441012E */ bne $v0, $at, .L800871CC
/* 087914 80086D14 8FBF0014 */ lw $ra, 0x14($sp)
/* 087918 80086D18 90640006 */ lbu $a0, 6($v1)
/* 08791C 80086D1C 0C01D052 */ jal write_time_data_to_controller_pak
/* 087920 80086D20 00C02825 */ move $a1, $a2
/* 087924 80086D24 10000128 */ b .L800871C8
/* 087928 80086D28 AFA20038 */ sw $v0, 0x38($sp)
.L80086D2C:
/* 08792C 80086D2C 0C01B9DC */ jal clear_lap_records
/* 087930 80086D30 24050003 */ li $a1, 3
/* 087934 80086D34 0C01BAFF */ jal mark_to_write_flap_and_course_times
/* 087938 80086D38 00000000 */ nop
/* 08793C 80086D3C 3C0500FF */ lui $a1, (0x00FFFFF0 >> 16) # lui $a1, 0xff
/* 087940 80086D40 34A5FFF0 */ ori $a1, (0x00FFFFF0 & 0xFFFF) # ori $a1, $a1, 0xfff0
/* 087944 80086D44 0C027AAF */ jal unset_eeprom_settings_value
/* 087948 80086D48 24040000 */ li $a0, 0
/* 08794C 80086D4C 1000011F */ b .L800871CC
/* 087950 80086D50 8FBF0014 */ lw $ra, 0x14($sp)
glabel L80086D54
/* 087954 80086D54 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 087958 80086D58 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 08795C 80086D5C 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 087960 80086D60 8D2B0000 */ lw $t3, ($t1)
/* 087964 80086D64 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 087968 80086D68 8D0A0000 */ lw $t2, ($t0)
/* 08796C 80086D6C 000B7900 */ sll $t7, $t3, 4
/* 087970 80086D70 014F6821 */ addu $t5, $t2, $t7
/* 087974 80086D74 91A20000 */ lbu $v0, ($t5)
/* 087978 80086D78 24010001 */ li $at, 1
/* 08797C 80086D7C 10410007 */ beq $v0, $at, .L80086D9C
/* 087980 80086D80 24010007 */ li $at, 7
/* 087984 80086D84 10410075 */ beq $v0, $at, .L80086F5C
/* 087988 80086D88 24010008 */ li $at, 8
/* 08798C 80086D8C 1041005B */ beq $v0, $at, .L80086EFC
/* 087990 80086D90 3C038012 */ lui $v1, %hi(gSavefileData) # $v1, 0x8012
/* 087994 80086D94 1000010D */ b .L800871CC
/* 087998 80086D98 8FBF0014 */ lw $ra, 0x14($sp)
.L80086D9C:
/* 08799C 80086D9C 90E40006 */ lbu $a0, 6($a3)
/* 0879A0 80086DA0 8CE50008 */ lw $a1, 8($a3)
/* 0879A4 80086DA4 0C01CF87 */ jal read_game_data_from_controller_pak
/* 0879A8 80086DA8 AFA60028 */ sw $a2, 0x28($sp)
/* 0879AC 80086DAC 8FA60028 */ lw $a2, 0x28($sp)
/* 0879B0 80086DB0 AFA20038 */ sw $v0, 0x38($sp)
/* 0879B4 80086DB4 8CD90010 */ lw $t9, 0x10($a2)
/* 0879B8 80086DB8 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 0879BC 80086DBC 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 0879C0 80086DC0 332C0004 */ andi $t4, $t9, 4
/* 0879C4 80086DC4 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 0879C8 80086DC8 1180000B */ beqz $t4, .L80086DF8
/* 0879CC 80086DCC 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 0879D0 80086DD0 0C027B18 */ jal is_adventure_two_unlocked
/* 0879D4 80086DD4 AFA60028 */ sw $a2, 0x28($sp)
/* 0879D8 80086DD8 8FA60028 */ lw $a2, 0x28($sp)
/* 0879DC 80086DDC 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 0879E0 80086DE0 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 0879E4 80086DE4 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 0879E8 80086DE8 14400003 */ bnez $v0, .L80086DF8
/* 0879EC 80086DEC 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 0879F0 80086DF0 2418000A */ li $t8, 10
/* 0879F4 80086DF4 AFB80038 */ sw $t8, 0x38($sp)
.L80086DF8:
/* 0879F8 80086DF8 8FAE0038 */ lw $t6, 0x38($sp)
/* 0879FC 80086DFC 00000000 */ nop
/* 087A00 80086E00 15C000F2 */ bnez $t6, .L800871CC
/* 087A04 80086E04 8FBF0014 */ lw $ra, 0x14($sp)
/* 087A08 80086E08 8D2A0000 */ lw $t2, ($t1)
/* 087A0C 80086E0C 8D0B0000 */ lw $t3, ($t0)
/* 087A10 80086E10 000A7900 */ sll $t7, $t2, 4
/* 087A14 80086E14 016F6821 */ addu $t5, $t3, $t7
/* 087A18 80086E18 91A40006 */ lbu $a0, 6($t5)
/* 087A1C 80086E1C 0C01BB06 */ jal force_mark_write_save_file
/* 087A20 80086E20 AFA60028 */ sw $a2, 0x28($sp)
/* 087A24 80086E24 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 087A28 80086E28 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 087A2C 80086E2C 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 087A30 80086E30 8D380000 */ lw $t8, ($t1)
/* 087A34 80086E34 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 087A38 80086E38 8D0C0000 */ lw $t4, ($t0)
/* 087A3C 80086E3C 00187100 */ sll $t6, $t8, 4
/* 087A40 80086E40 018E5021 */ addu $t2, $t4, $t6
/* 087A44 80086E44 914B0006 */ lbu $t3, 6($t2)
/* 087A48 80086E48 3C038012 */ lui $v1, %hi(gSavefileData) # $v1, 0x8012
/* 087A4C 80086E4C 8FA60028 */ lw $a2, 0x28($sp)
/* 087A50 80086E50 24636530 */ addiu $v1, %lo(gSavefileData) # addiu $v1, $v1, 0x6530
/* 087A54 80086E54 000B7880 */ sll $t7, $t3, 2
/* 087A58 80086E58 006F6821 */ addu $t5, $v1, $t7
/* 087A5C 80086E5C 8DB80000 */ lw $t8, ($t5)
/* 087A60 80086E60 8CD90010 */ lw $t9, 0x10($a2)
/* 087A64 80086E64 00000000 */ nop
/* 087A68 80086E68 AF190010 */ sw $t9, 0x10($t8)
/* 087A6C 80086E6C 8D2E0000 */ lw $t6, ($t1)
/* 087A70 80086E70 8D0C0000 */ lw $t4, ($t0)
/* 087A74 80086E74 000E5100 */ sll $t2, $t6, 4
/* 087A78 80086E78 018A5821 */ addu $t3, $t4, $t2
/* 087A7C 80086E7C 916F0006 */ lbu $t7, 6($t3)
/* 087A80 80086E80 00000000 */ nop
/* 087A84 80086E84 000F6880 */ sll $t5, $t7, 2
/* 087A88 80086E88 006DC821 */ addu $t9, $v1, $t5
/* 087A8C 80086E8C 8F380000 */ lw $t8, ($t9)
/* 087A90 80086E90 00000000 */ nop
/* 087A94 80086E94 A300004B */ sb $zero, 0x4b($t8)
/* 087A98 80086E98 8D2B0000 */ lw $t3, ($t1)
/* 087A9C 80086E9C 8D0A0000 */ lw $t2, ($t0)
/* 087AA0 80086EA0 000B7900 */ sll $t7, $t3, 4
/* 087AA4 80086EA4 014F6821 */ addu $t5, $t2, $t7
/* 087AA8 80086EA8 91B90006 */ lbu $t9, 6($t5)
/* 087AAC 80086EAC 8CCE0000 */ lw $t6, ($a2)
/* 087AB0 80086EB0 0019C080 */ sll $t8, $t9, 2
/* 087AB4 80086EB4 85CC0000 */ lh $t4, ($t6)
/* 087AB8 80086EB8 00787021 */ addu $t6, $v1, $t8
/* 087ABC 80086EBC 8DCB0000 */ lw $t3, ($t6)
/* 087AC0 80086EC0 00000000 */ nop
/* 087AC4 80086EC4 8D6A0000 */ lw $t2, ($t3)
/* 087AC8 80086EC8 00000000 */ nop
/* 087ACC 80086ECC A54C0000 */ sh $t4, ($t2)
/* 087AD0 80086ED0 8D390000 */ lw $t9, ($t1)
/* 087AD4 80086ED4 8D0D0000 */ lw $t5, ($t0)
/* 087AD8 80086ED8 0019C100 */ sll $t8, $t9, 4
/* 087ADC 80086EDC 01B87021 */ addu $t6, $t5, $t8
/* 087AE0 80086EE0 91CB0006 */ lbu $t3, 6($t6)
/* 087AE4 80086EE4 8CCF0050 */ lw $t7, 0x50($a2)
/* 087AE8 80086EE8 000B6080 */ sll $t4, $t3, 2
/* 087AEC 80086EEC 006C5021 */ addu $t2, $v1, $t4
/* 087AF0 80086EF0 8D590000 */ lw $t9, ($t2)
/* 087AF4 80086EF4 100000B4 */ b .L800871C8
/* 087AF8 80086EF8 AF2F0050 */ sw $t7, 0x50($t9)
.L80086EFC:
/* 087AFC 80086EFC 24636530 */ addiu $v1, %lo(gSavefileData) # addiu $v1, $v1, 0x6530
/* 087B00 80086F00 8C66000C */ lw $a2, 0xc($v1)
/* 087B04 80086F04 90E40006 */ lbu $a0, 6($a3)
/* 087B08 80086F08 8CE50008 */ lw $a1, 8($a3)
/* 087B0C 80086F0C 0C01CF87 */ jal read_game_data_from_controller_pak
/* 087B10 80086F10 00000000 */ nop
/* 087B14 80086F14 3C038012 */ lui $v1, %hi(gSavefileData) # $v1, 0x8012
/* 087B18 80086F18 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 087B1C 80086F1C 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 087B20 80086F20 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 087B24 80086F24 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 087B28 80086F28 24636530 */ addiu $v1, %lo(gSavefileData) # addiu $v1, $v1, 0x6530
/* 087B2C 80086F2C 144000A6 */ bnez $v0, .L800871C8
/* 087B30 80086F30 AFA20038 */ sw $v0, 0x38($sp)
/* 087B34 80086F34 8D380000 */ lw $t8, ($t1)
/* 087B38 80086F38 8D0D0000 */ lw $t5, ($t0)
/* 087B3C 80086F3C 00187100 */ sll $t6, $t8, 4
/* 087B40 80086F40 01AE5821 */ addu $t3, $t5, $t6
/* 087B44 80086F44 91640006 */ lbu $a0, 6($t3)
/* 087B48 80086F48 8C65000C */ lw $a1, 0xc($v1)
/* 087B4C 80086F4C 0C01CFD7 */ jal write_game_data_to_controller_pak
/* 087B50 80086F50 00000000 */ nop
/* 087B54 80086F54 1000009C */ b .L800871C8
/* 087B58 80086F58 AFA20038 */ sw $v0, 0x38($sp)
.L80086F5C:
/* 087B5C 80086F5C 90E40006 */ lbu $a0, 6($a3)
/* 087B60 80086F60 90E50007 */ lbu $a1, 7($a3)
/* 087B64 80086F64 0C01D8B2 */ jal delete_file
/* 087B68 80086F68 00000000 */ nop
/* 087B6C 80086F6C 10000096 */ b .L800871C8
/* 087B70 80086F70 AFA20038 */ sw $v0, 0x38($sp)
glabel L80086F74
/* 087B74 80086F74 8CE40008 */ lw $a0, 8($a3)
/* 087B78 80086F78 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 087B7C 80086F7C 908C0000 */ lbu $t4, ($a0)
/* 087B80 80086F80 00001825 */ move $v1, $zero
/* 087B84 80086F84 11800006 */ beqz $t4, .L80086FA0
/* 087B88 80086F88 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 087B8C 80086F8C 00801025 */ move $v0, $a0
.L80086F90:
/* 087B90 80086F90 904A0001 */ lbu $t2, 1($v0)
/* 087B94 80086F94 24630001 */ addiu $v1, $v1, 1
/* 087B98 80086F98 1540FFFD */ bnez $t2, .L80086F90
/* 087B9C 80086F9C 24420001 */ addiu $v0, $v0, 1
.L80086FA0:
/* 087BA0 80086FA0 18600005 */ blez $v1, .L80086FB8
/* 087BA4 80086FA4 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 087BA8 80086FA8 00837821 */ addu $t7, $a0, $v1
/* 087BAC 80086FAC 91F9FFFF */ lbu $t9, -1($t7)
/* 087BB0 80086FB0 10000003 */ b .L80086FC0
/* 087BB4 80086FB4 A3B9002C */ sb $t9, 0x2c($sp)
.L80086FB8:
/* 087BB8 80086FB8 24180041 */ li $t8, 65
/* 087BBC 80086FBC A3B8002C */ sb $t8, 0x2c($sp)
.L80086FC0:
/* 087BC0 80086FC0 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 087BC4 80086FC4 8D2E0000 */ lw $t6, ($t1)
/* 087BC8 80086FC8 8D0D0000 */ lw $t5, ($t0)
/* 087BCC 80086FCC 000E5900 */ sll $t3, $t6, 4
/* 087BD0 80086FD0 A3A0002D */ sb $zero, 0x2d($sp)
/* 087BD4 80086FD4 01AB6021 */ addu $t4, $t5, $t3
/* 087BD8 80086FD8 91820000 */ lbu $v0, ($t4)
/* 087BDC 80086FDC 24010002 */ li $at, 2
/* 087BE0 80086FE0 10410007 */ beq $v0, $at, .L80087000
/* 087BE4 80086FE4 24010007 */ li $at, 7
/* 087BE8 80086FE8 10410020 */ beq $v0, $at, .L8008706C
/* 087BEC 80086FEC 24010008 */ li $at, 8
/* 087BF0 80086FF0 10410008 */ beq $v0, $at, .L80087014
/* 087BF4 80086FF4 27A5002C */ addiu $a1, $sp, 0x2c
/* 087BF8 80086FF8 10000074 */ b .L800871CC
/* 087BFC 80086FFC 8FBF0014 */ lw $ra, 0x14($sp)
.L80087000:
/* 087C00 80087000 90E40006 */ lbu $a0, 6($a3)
/* 087C04 80087004 0C01D006 */ jal read_time_data_from_controller_pak
/* 087C08 80087008 27A5002C */ addiu $a1, $sp, 0x2c
/* 087C0C 8008700C 1000006E */ b .L800871C8
/* 087C10 80087010 AFA20038 */ sw $v0, 0x38($sp)
.L80087014:
/* 087C14 80087014 90E40006 */ lbu $a0, 6($a3)
/* 087C18 80087018 0C01D006 */ jal read_time_data_from_controller_pak
/* 087C1C 8008701C AFA60028 */ sw $a2, 0x28($sp)
/* 087C20 80087020 8FA60028 */ lw $a2, 0x28($sp)
/* 087C24 80087024 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 087C28 80087028 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 087C2C 8008702C 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 087C30 80087030 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 087C34 80087034 14400009 */ bnez $v0, .L8008705C
/* 087C38 80087038 AFA20038 */ sw $v0, 0x38($sp)
/* 087C3C 8008703C 8D2F0000 */ lw $t7, ($t1)
/* 087C40 80087040 8D0A0000 */ lw $t2, ($t0)
/* 087C44 80087044 000FC900 */ sll $t9, $t7, 4
/* 087C48 80087048 0159C021 */ addu $t8, $t2, $t9
/* 087C4C 8008704C 93040006 */ lbu $a0, 6($t8)
/* 087C50 80087050 0C01D052 */ jal write_time_data_to_controller_pak
/* 087C54 80087054 00C02825 */ move $a1, $a2
/* 087C58 80087058 AFA20038 */ sw $v0, 0x38($sp)
.L8008705C:
/* 087C5C 8008705C 0C01BAD7 */ jal mark_to_read_flap_and_course_times
/* 087C60 80087060 00000000 */ nop
/* 087C64 80087064 10000059 */ b .L800871CC
/* 087C68 80087068 8FBF0014 */ lw $ra, 0x14($sp)
.L8008706C:
/* 087C6C 8008706C 90E40006 */ lbu $a0, 6($a3)
/* 087C70 80087070 90E50007 */ lbu $a1, 7($a3)
/* 087C74 80087074 0C01D8B2 */ jal delete_file
/* 087C78 80087078 00000000 */ nop
/* 087C7C 8008707C 10000052 */ b .L800871C8
/* 087C80 80087080 AFA20038 */ sw $v0, 0x38($sp)
glabel L80087084
/* 087C84 80087084 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 087C88 80087088 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 087C8C 8008708C 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 087C90 80087090 8D2D0000 */ lw $t5, ($t1)
/* 087C94 80087094 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 087C98 80087098 8D0E0000 */ lw $t6, ($t0)
/* 087C9C 8008709C 000D5900 */ sll $t3, $t5, 4
/* 087CA0 800870A0 01CB1821 */ addu $v1, $t6, $t3
/* 087CA4 800870A4 90620000 */ lbu $v0, ($v1)
/* 087CA8 800870A8 24010007 */ li $at, 7
/* 087CAC 800870AC 10410012 */ beq $v0, $at, .L800870F8
/* 087CB0 800870B0 24010008 */ li $at, 8
/* 087CB4 800870B4 10410009 */ beq $v0, $at, .L800870DC
/* 087CB8 800870B8 24010009 */ li $at, 9
/* 087CBC 800870BC 14410042 */ bne $v0, $at, .L800871C8
/* 087CC0 800870C0 240C0001 */ li $t4, 1
/* 087CC4 800870C4 3C01800E */ lui $at, %hi(gMenuDelay) # $at, 0x800e
/* 087CC8 800870C8 AC2CF47C */ sw $t4, %lo(gMenuDelay)($at)
/* 087CCC 800870CC 90EF0006 */ lbu $t7, 6($a3)
/* 087CD0 800870D0 3C018012 */ lui $at, %hi(D_801264D0) # $at, 0x8012
/* 087CD4 800870D4 1000003C */ b .L800871C8
/* 087CD8 800870D8 AC2F64D0 */ sw $t7, %lo(D_801264D0)($at)
.L800870DC:
/* 087CDC 800870DC 90E40006 */ lbu $a0, 6($a3)
/* 087CE0 800870E0 90E50007 */ lbu $a1, 7($a3)
/* 087CE4 800870E4 90660006 */ lbu $a2, 6($v1)
/* 087CE8 800870E8 0C01D8E2 */ jal copy_controller_pak_data
/* 087CEC 800870EC 00000000 */ nop
/* 087CF0 800870F0 10000035 */ b .L800871C8
/* 087CF4 800870F4 AFA20038 */ sw $v0, 0x38($sp)
.L800870F8:
/* 087CF8 800870F8 90E40006 */ lbu $a0, 6($a3)
/* 087CFC 800870FC 90E50007 */ lbu $a1, 7($a3)
/* 087D00 80087100 0C01D8B2 */ jal delete_file
/* 087D04 80087104 00000000 */ nop
/* 087D08 80087108 1000002F */ b .L800871C8
/* 087D0C 8008710C AFA20038 */ sw $v0, 0x38($sp)
glabel L80087110
/* 087D10 80087110 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 087D14 80087114 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 087D18 80087118 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 087D1C 8008711C 8D390000 */ lw $t9, ($t1)
/* 087D20 80087120 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 087D24 80087124 8D0A0000 */ lw $t2, ($t0)
/* 087D28 80087128 0019C100 */ sll $t8, $t9, 4
/* 087D2C 8008712C 01586821 */ addu $t5, $t2, $t8
/* 087D30 80087130 91AE0000 */ lbu $t6, ($t5)
/* 087D34 80087134 24010007 */ li $at, 7
/* 087D38 80087138 15C10024 */ bne $t6, $at, .L800871CC
/* 087D3C 8008713C 8FBF0014 */ lw $ra, 0x14($sp)
/* 087D40 80087140 90E40006 */ lbu $a0, 6($a3)
/* 087D44 80087144 90E50007 */ lbu $a1, 7($a3)
/* 087D48 80087148 0C01D8B2 */ jal delete_file
/* 087D4C 8008714C 00000000 */ nop
/* 087D50 80087150 1000001D */ b .L800871C8
/* 087D54 80087154 AFA20038 */ sw $v0, 0x38($sp)
glabel L80087158
/* 087D58 80087158 3C098012 */ lui $t1, %hi(D_80126BE4) # $t1, 0x8012
/* 087D5C 8008715C 25296BE4 */ addiu $t1, %lo(D_80126BE4) # addiu $t1, $t1, 0x6be4
/* 087D60 80087160 3C088012 */ lui $t0, %hi(D_80126A04) # $t0, 0x8012
/* 087D64 80087164 8D2C0000 */ lw $t4, ($t1)
/* 087D68 80087168 25086A04 */ addiu $t0, %lo(D_80126A04) # addiu $t0, $t0, 0x6a04
/* 087D6C 8008716C 8D0B0000 */ lw $t3, ($t0)
/* 087D70 80087170 000C7900 */ sll $t7, $t4, 4
/* 087D74 80087174 016FC821 */ addu $t9, $t3, $t7
/* 087D78 80087178 932A0000 */ lbu $t2, ($t9)
/* 087D7C 8008717C 24010007 */ li $at, 7
/* 087D80 80087180 15410011 */ bne $t2, $at, .L800871C8
/* 087D84 80087184 24040000 */ li $a0, 0
/* 087D88 80087188 3C0500FF */ lui $a1, (0x00FFFFF3 >> 16) # lui $a1, 0xff
/* 087D8C 8008718C 0C027AAF */ jal unset_eeprom_settings_value
/* 087D90 80087190 34A5FFF3 */ ori $a1, (0x00FFFFF3 & 0xFFFF) # ori $a1, $a1, 0xfff3
/* 087D94 80087194 3C03800E */ lui $v1, %hi(gActiveMagicCodes) # $v1, 0x800e
/* 087D98 80087198 3C05800E */ lui $a1, %hi(gUnlockedMagicCodes) # $a1, 0x800e
/* 087D9C 8008719C 24A5FD9C */ addiu $a1, %lo(gUnlockedMagicCodes) # addiu $a1, $a1, -0x264
/* 087DA0 800871A0 2463FD98 */ addiu $v1, %lo(gActiveMagicCodes) # addiu $v1, $v1, -0x268
/* 087DA4 800871A4 8C780000 */ lw $t8, ($v1)
/* 087DA8 800871A8 8CAE0000 */ lw $t6, ($a1)
/* 087DAC 800871AC 2404FFFC */ li $a0, -4
/* 087DB0 800871B0 03046824 */ and $t5, $t8, $a0
/* 087DB4 800871B4 01C46024 */ and $t4, $t6, $a0
/* 087DB8 800871B8 AC6D0000 */ sw $t5, ($v1)
/* 087DBC 800871BC 10000002 */ b .L800871C8
/* 087DC0 800871C0 ACAC0000 */ sw $t4, ($a1)
.L800871C4:
glabel L800871C4
/* 087DC4 800871C4 AFA00038 */ sw $zero, 0x38($sp)
.L800871C8:
/* 087DC8 800871C8 8FBF0014 */ lw $ra, 0x14($sp)
.L800871CC:
/* 087DCC 800871CC 8FA20038 */ lw $v0, 0x38($sp)
/* 087DD0 800871D0 03E00008 */ jr $ra
/* 087DD4 800871D4 27BD0040 */ addiu $sp, $sp, 0x40
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff