diff --git a/.vscode/settings.json b/.vscode/settings.json index a9f885c65d..869206fe21 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,5 +11,4 @@ "-Isrc", "-D_LANGUAGE_C", ], - "python.pythonPath": "/usr/bin/python3", } diff --git a/Makefile b/Makefile index 5f76096794..6cf2218531 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ TARGET = papermario CPPFLAGS = -Iinclude -D _LANGUAGE_C -ffreestanding -DF3DEX_GBI_2 ASFLAGS = -EB -Iinclude -march=vr4300 -mtune=vr4300 -OLDASFLAGS = -EB -Iinclude +OLDASFLAGS = -EB -Iinclude -G 0 CFLAGS = -O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 LDFLAGS = -T undefined_syms.txt -T $(LD_SCRIPT) -Map $(BUILD_DIR)/papermario.map --no-check-sections @@ -68,7 +68,7 @@ submodules: git submodule update --init --recursive split: - rm -rf $(DATA_DIRS) && ./tools/n64splat/split.py baserom.z64 tools/splat.yaml . + rm -rf $(DATA_DIRS) && ./tools/n64splat/split.py baserom.z64 tools/splat.yaml . --modes ld bin setup: clean submodules split diff --git a/README.md b/README.md index f148ad9d22..f1aa3786ce 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Discord: [Paper Mario Modding](https://discord.gg/urUm3VG) ## Setup -You'll need Linux, a Linux VM, or Windows 10 (WSL) to work on this project. +You'll need Linux, a Linux VM, or Windows 10 (WSL) to work on this project. For WSL, we've included `windows_termainl.bat` under tools that you can use to quickly spin up a terminal for your default distro set using `wsl --set-default `. #### Clone the repository @@ -76,6 +76,29 @@ Decide on a function to match. These can be found in the subdirectories of `asm/ Take the relevant `.s` file and pass it to [mips_to_c](https://github.com/matt-kempster/mips_to_c) ([web version](https://simonsoftware.se/other/mips_to_c.py)). +You can also use mips_to_c locally installed to a destination of your choice. Then register a function in `~/.bashrc` that calls `path/to/mips_to_c.py (with args)`: +``` +sudo apt update +sudo apt install python3-pip +sudo git clone https://github.com/matt-kempster/mips_to_c.git path/to/mips_to_c +``` + +Here's a starter function you can use: +```sh +# don't forget to replace /path/to/mips_to_c with your path +function mipstoc() { + if [ "$#" -gt 1 ]; then + /path/to/mips_to_c/mips_to_c.py $@; + else + printf "Please call mipstoc using this format and make sure you're at the repo root:"; + printf "\nmipstoc \033[0;31marg1 - the nonmatching asm file\033[0m \033[0;34marg2 - the target function\033[0m \033[0;33margN - any of the optional mips_to_c.py flags\033[0m"; + printf "\nmipstoc \033[0;31m./asm/nonmatchings/code_13870_len_6980/func_8003B3D0.s\033[0m \033[0;34mfunc_8003B3D0\033[0m \033[0;33m--flag1 --flag2 --flagN\033[0m\n"; + /path/to/mips_to_c/mips_to_c.py; + fi +} +export -f mipstoc +``` + Open up the relevant `.c` file and replace the function's `INCLUDE_ASM` macro with the output from mips_to_c. Run the following command to attempt to compile, replacing `function_name` with the name of the function you're working with: ```sh diff --git a/asm/nonmatchings/code_13480_len_3f0/init_demo_data.s b/asm/nonmatchings/code_13480_len_3f0/init_demo_data.s deleted file mode 100644 index de9512caf6..0000000000 --- a/asm/nonmatchings/code_13480_len_3f0/init_demo_data.s +++ /dev/null @@ -1,34 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel init_demo_data -/* 13480 80038080 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 13484 80038084 3C048007 */ lui $a0, %hi(gGameStatusPtr) -/* 13488 80038088 2484419C */ addiu $a0, $a0, %lo(gGameStatusPtr) -/* 1348C 8003808C AFBF0010 */ sw $ra, 0x10($sp) -/* 13490 80038090 8C830000 */ lw $v1, ($a0) -/* 13494 80038094 80620071 */ lb $v0, 0x71($v1) -/* 13498 80038098 14400004 */ bnez $v0, .L800380AC -/* 1349C 8003809C 24020001 */ addiu $v0, $zero, 1 -/* 134A0 800380A0 A0600072 */ sb $zero, 0x72($v1) -/* 134A4 800380A4 8C830000 */ lw $v1, ($a0) -/* 134A8 800380A8 A0620071 */ sb $v0, 0x71($v1) -.L800380AC: -/* 134AC 800380AC 8C820000 */ lw $v0, ($a0) -/* 134B0 800380B0 A040006A */ sb $zero, 0x6a($v0) -/* 134B4 800380B4 8C830000 */ lw $v1, ($a0) -/* 134B8 800380B8 A4400068 */ sh $zero, 0x68($v0) -/* 134BC 800380BC 0C01588A */ jal func_80056228 -/* 134C0 800380C0 A060006B */ sb $zero, 0x6b($v1) -/* 134C4 800380C4 0C04E0A8 */ jal set_map_transition_effect -/* 134C8 800380C8 24040002 */ addiu $a0, $zero, 2 -/* 134CC 800380CC 3C05437F */ lui $a1, 0x437f -/* 134D0 800380D0 0C04DF62 */ jal func_80137D88 -/* 134D4 800380D4 0000202D */ daddu $a0, $zero, $zero -/* 134D8 800380D8 0C0514C8 */ jal clear_saved_variables -/* 134DC 800380DC 00000000 */ nop -/* 134E0 800380E0 0C0B0C77 */ jal clear_script_list -/* 134E4 800380E4 00000000 */ nop -/* 134E8 800380E8 8FBF0010 */ lw $ra, 0x10($sp) -/* 134EC 800380EC 03E00008 */ jr $ra -/* 134F0 800380F0 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_13870_len_6980/disable_npc_blur.s b/asm/nonmatchings/code_13870_len_6980/disable_npc_blur.s deleted file mode 100644 index e40433c2bf..0000000000 --- a/asm/nonmatchings/code_13870_len_6980/disable_npc_blur.s +++ /dev/null @@ -1,24 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel disable_npc_blur -/* 161AC 8003ADAC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 161B0 8003ADB0 AFB00010 */ sw $s0, 0x10($sp) -/* 161B4 8003ADB4 0080802D */ daddu $s0, $a0, $zero -/* 161B8 8003ADB8 AFBF0014 */ sw $ra, 0x14($sp) -/* 161BC 8003ADBC 8E030000 */ lw $v1, ($s0) -/* 161C0 8003ADC0 3C020010 */ lui $v0, 0x10 -/* 161C4 8003ADC4 00621024 */ and $v0, $v1, $v0 -/* 161C8 8003ADC8 10400007 */ beqz $v0, .L8003ADE8 -/* 161CC 8003ADCC 3C02FFEF */ lui $v0, 0xffef -/* 161D0 8003ADD0 3442FFFF */ ori $v0, $v0, 0xffff -/* 161D4 8003ADD4 8E040020 */ lw $a0, 0x20($s0) -/* 161D8 8003ADD8 00621024 */ and $v0, $v1, $v0 -/* 161DC 8003ADDC 0C00AB4B */ jal heap_free -/* 161E0 8003ADE0 AE020000 */ sw $v0, ($s0) -/* 161E4 8003ADE4 AE000020 */ sw $zero, 0x20($s0) -.L8003ADE8: -/* 161E8 8003ADE8 8FBF0014 */ lw $ra, 0x14($sp) -/* 161EC 8003ADEC 8FB00010 */ lw $s0, 0x10($sp) -/* 161F0 8003ADF0 03E00008 */ jr $ra -/* 161F4 8003ADF4 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_13870_len_6980/mtx_ident_mirror_y.s b/asm/nonmatchings/code_13870_len_6980/mtx_ident_mirror_y.s deleted file mode 100644 index d0941074a0..0000000000 --- a/asm/nonmatchings/code_13870_len_6980/mtx_ident_mirror_y.s +++ /dev/null @@ -1,21 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel mtx_ident_mirror_y -/* 13878 80038478 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 1387C 8003847C AFB00010 */ sw $s0, 0x10($sp) -/* 13880 80038480 AFBF0014 */ sw $ra, 0x14($sp) -/* 13884 80038484 0C019D28 */ jal guMtxIdentF -/* 13888 80038488 0080802D */ daddu $s0, $a0, $zero -/* 1388C 8003848C 3C013F80 */ lui $at, 0x3f80 -/* 13890 80038490 44810000 */ mtc1 $at, $f0 -/* 13894 80038494 3C01BF80 */ lui $at, 0xbf80 -/* 13898 80038498 44811000 */ mtc1 $at, $f2 -/* 1389C 8003849C E6000000 */ swc1 $f0, ($s0) -/* 138A0 800384A0 E6020014 */ swc1 $f2, 0x14($s0) -/* 138A4 800384A4 E6000028 */ swc1 $f0, 0x28($s0) -/* 138A8 800384A8 E600003C */ swc1 $f0, 0x3c($s0) -/* 138AC 800384AC 8FBF0014 */ lw $ra, 0x14($sp) -/* 138B0 800384B0 8FB00010 */ lw $s0, 0x10($sp) -/* 138B4 800384B4 03E00008 */ jr $ra -/* 138B8 800384B8 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_13870_len_6980/update_npc_blur.s b/asm/nonmatchings/code_13870_len_6980/update_npc_blur.s deleted file mode 100644 index f7c34f2ea0..0000000000 --- a/asm/nonmatchings/code_13870_len_6980/update_npc_blur.s +++ /dev/null @@ -1,21 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel update_npc_blur -/* 161F8 8003ADF8 8C850020 */ lw $a1, 0x20($a0) -/* 161FC 8003ADFC 80A30001 */ lb $v1, 1($a1) -/* 16200 8003AE00 C4800038 */ lwc1 $f0, 0x38($a0) -/* 16204 8003AE04 00031080 */ sll $v0, $v1, 2 -/* 16208 8003AE08 00A21021 */ addu $v0, $a1, $v0 -/* 1620C 8003AE0C E4400004 */ swc1 $f0, 4($v0) -/* 16210 8003AE10 C480003C */ lwc1 $f0, 0x3c($a0) -/* 16214 8003AE14 E4400054 */ swc1 $f0, 0x54($v0) -/* 16218 8003AE18 C4800040 */ lwc1 $f0, 0x40($a0) -/* 1621C 8003AE1C 24630001 */ addiu $v1, $v1, 1 -/* 16220 8003AE20 E44000A4 */ swc1 $f0, 0xa4($v0) -/* 16224 8003AE24 28620014 */ slti $v0, $v1, 0x14 -/* 16228 8003AE28 50400001 */ beql $v0, $zero, .L8003AE30 -/* 1622C 8003AE2C 0000182D */ daddu $v1, $zero, $zero -.L8003AE30: -/* 16230 8003AE30 03E00008 */ jr $ra -/* 16234 8003AE34 A0A30001 */ sb $v1, 1($a1) diff --git a/asm/nonmatchings/code_163400/func_802431A0.s b/asm/nonmatchings/code_163400/func_802431A0.s index d9df79fdf0..985efa6c21 100644 --- a/asm/nonmatchings/code_163400/func_802431A0.s +++ b/asm/nonmatchings/code_163400/func_802431A0.s @@ -37,8 +37,8 @@ glabel func_802431A0 .L80243214: /* 163A74 80243214 1440000B */ bnez $v0, .L80243244 /* 163A78 80243218 00000000 */ nop -/* 163A7C 8024321C 3C028007 */ lui $v0, 0x8007 -/* 163A80 80243220 8C42419C */ lw $v0, 0x419c($v0) +/* 163A7C 8024321C 3C028007 */ lui $v0, %hi(gGameStatusPtr) +/* 163A80 80243220 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) /* 163A84 80243224 8C430020 */ lw $v1, 0x20($v0) /* 163A88 80243228 8C420010 */ lw $v0, 0x10($v0) /* 163A8C 8024322C 3C018025 */ lui $at, 0x8025 diff --git a/asm/nonmatchings/code_163400/func_80243CCC.s b/asm/nonmatchings/code_163400/func_80243CCC.s index a3a0ef9c96..ed1616196b 100644 --- a/asm/nonmatchings/code_163400/func_80243CCC.s +++ b/asm/nonmatchings/code_163400/func_80243CCC.s @@ -67,7 +67,7 @@ glabel func_80243CCC /* 164624 80243DC4 AFA00014 */ sw $zero, 0x14($sp) /* 164628 80243DC8 AFA00018 */ sw $zero, 0x18($sp) /* 16462C 80243DCC AFA0001C */ sw $zero, 0x1c($sp) -/* 164630 80243DD0 0C090AE8 */ jal func_80242BA0 +/* 164630 80243DD0 0C090AE8 */ jal pause_set_cursor_opacity /* 164634 80243DD4 AFA00020 */ sw $zero, 0x20($sp) /* 164638 80243DD8 0000202D */ daddu $a0, $zero, $zero /* 16463C 80243DDC 241100F0 */ addiu $s1, $zero, 0xf0 @@ -80,7 +80,7 @@ glabel func_80243CCC /* 164658 80243DF8 AFA00014 */ sw $zero, 0x14($sp) /* 16465C 80243DFC AFA00018 */ sw $zero, 0x18($sp) /* 164660 80243E00 AFA0001C */ sw $zero, 0x1c($sp) -/* 164664 80243E04 0C090AE8 */ jal func_80242BA0 +/* 164664 80243E04 0C090AE8 */ jal pause_set_cursor_opacity /* 164668 80243E08 AFA00020 */ sw $zero, 0x20($sp) /* 16466C 80243E0C 0000202D */ daddu $a0, $zero, $zero /* 164670 80243E10 0240282D */ daddu $a1, $s2, $zero @@ -90,7 +90,7 @@ glabel func_80243CCC /* 164680 80243E20 AFA00014 */ sw $zero, 0x14($sp) /* 164684 80243E24 AFA00018 */ sw $zero, 0x18($sp) /* 164688 80243E28 AFA0001C */ sw $zero, 0x1c($sp) -/* 16468C 80243E2C 0C090AE8 */ jal func_80242BA0 +/* 16468C 80243E2C 0C090AE8 */ jal pause_set_cursor_opacity /* 164690 80243E30 AFA00020 */ sw $zero, 0x20($sp) /* 164694 80243E34 00131100 */ sll $v0, $s3, 4 /* 164698 80243E38 24040140 */ addiu $a0, $zero, 0x140 @@ -109,7 +109,7 @@ glabel func_80243CCC /* 1646C4 80243E64 AFA00014 */ sw $zero, 0x14($sp) /* 1646C8 80243E68 AFA00018 */ sw $zero, 0x18($sp) /* 1646CC 80243E6C AFA0001C */ sw $zero, 0x1c($sp) -/* 1646D0 80243E70 0C090AE8 */ jal func_80242BA0 +/* 1646D0 80243E70 0C090AE8 */ jal pause_set_cursor_opacity /* 1646D4 80243E74 AFA00020 */ sw $zero, 0x20($sp) /* 1646D8 80243E78 2663FFF6 */ addiu $v1, $s3, -0xa /* 1646DC 80243E7C 2C62000A */ sltiu $v0, $v1, 0xa diff --git a/asm/nonmatchings/code_163400/func_80243EEC.s b/asm/nonmatchings/code_163400/func_80243EEC.s index 8a5f8d5753..0d472d012a 100644 --- a/asm/nonmatchings/code_163400/func_80243EEC.s +++ b/asm/nonmatchings/code_163400/func_80243EEC.s @@ -64,7 +64,7 @@ glabel func_80243EEC /* 164838 80243FD8 AFA00014 */ sw $zero, 0x14($sp) /* 16483C 80243FDC AFA00018 */ sw $zero, 0x18($sp) /* 164840 80243FE0 AFA0001C */ sw $zero, 0x1c($sp) -/* 164844 80243FE4 0C090AE8 */ jal func_80242BA0 +/* 164844 80243FE4 0C090AE8 */ jal pause_set_cursor_opacity /* 164848 80243FE8 AFA00020 */ sw $zero, 0x20($sp) /* 16484C 80243FEC 00101040 */ sll $v0, $s0, 1 /* 164850 80243FF0 3C038025 */ lui $v1, 0x8025 diff --git a/asm/nonmatchings/code_163400/func_802440BC.s b/asm/nonmatchings/code_163400/func_802440BC.s index e45ad8df02..c5fb3a1993 100644 --- a/asm/nonmatchings/code_163400/func_802440BC.s +++ b/asm/nonmatchings/code_163400/func_802440BC.s @@ -248,8 +248,8 @@ glabel func_802440BC /* 164CB0 80244450 0C019D40 */ jal guMtxF2L /* 164CB4 80244454 00452821 */ addu $a1, $v0, $a1 /* 164CB8 80244458 0200202D */ daddu $a0, $s0, $zero -/* 164CBC 8024445C 3C1E8007 */ lui $fp, 0x8007 -/* 164CC0 80244460 27DE419C */ addiu $fp, $fp, 0x419c +/* 164CBC 8024445C 3C1E8007 */ lui $fp, %hi(gGameStatusPtr) +/* 164CC0 80244460 27DE419C */ addiu $fp, $fp, %lo(gGameStatusPtr) /* 164CC4 80244464 8E280000 */ lw $t0, ($s1) /* 164CC8 80244468 4406A000 */ mfc1 $a2, $f20 /* 164CCC 8024446C 4407A000 */ mfc1 $a3, $f20 diff --git a/asm/nonmatchings/code_163400/func_802448E0.s b/asm/nonmatchings/code_163400/func_802448E0.s index 3aa2bf8260..50b75ab3fc 100644 --- a/asm/nonmatchings/code_163400/func_802448E0.s +++ b/asm/nonmatchings/code_163400/func_802448E0.s @@ -64,8 +64,8 @@ glabel func_802448E0 /* 16521C 802449BC 14400031 */ bnez $v0, .L80244A84 /* 165220 802449C0 0260202D */ daddu $a0, $s3, $zero /* 165224 802449C4 0000802D */ daddu $s0, $zero, $zero -/* 165228 802449C8 3C15800E */ lui $s5, 0x800e -/* 16522C 802449CC 26B5ACC0 */ addiu $s5, $s5, -0x5340 +/* 165228 802449C8 3C15800E */ lui $s5, %hi(gCurrentSaveFile) +/* 16522C 802449CC 26B5ACC0 */ addiu $s5, $s5, %lo(gCurrentSaveFile) /* 165230 802449D0 24140001 */ addiu $s4, $zero, 1 /* 165234 802449D4 3C118007 */ lui $s1, 0x8007 /* 165238 802449D8 26317A24 */ addiu $s1, $s1, 0x7a24 @@ -110,14 +110,14 @@ glabel func_802448E0 /* 1652C8 80244A68 50400001 */ beql $v0, $zero, .L80244A70 /* 1652CC 80244A6C AC80003C */ sw $zero, 0x3c($a0) .L80244A70: -/* 1652D0 80244A70 3C038007 */ lui $v1, 0x8007 -/* 1652D4 80244A74 8C63419C */ lw $v1, 0x419c($v1) +/* 1652D0 80244A70 3C038007 */ lui $v1, %hi(gGameStatusPtr) +/* 1652D4 80244A74 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1) /* 1652D8 80244A78 9082003F */ lbu $v0, 0x3f($a0) /* 1652DC 80244A7C A0620166 */ sb $v0, 0x166($v1) /* 1652E0 80244A80 0260202D */ daddu $a0, $s3, $zero .L80244A84: -/* 1652E4 80244A84 3C028007 */ lui $v0, 0x8007 -/* 1652E8 80244A88 8C42419C */ lw $v0, 0x419c($v0) +/* 1652E4 80244A84 3C028007 */ lui $v0, %hi(gGameStatusPtr) +/* 1652E8 80244A88 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) /* 1652EC 80244A8C 3C118025 */ lui $s1, 0x8025 /* 1652F0 80244A90 26319B84 */ addiu $s1, $s1, -0x647c /* 1652F4 80244A94 90460166 */ lbu $a2, 0x166($v0) diff --git a/asm/nonmatchings/code_163400/func_80244CEC.s b/asm/nonmatchings/code_163400/func_80244CEC.s index 5124e62e1d..7c470f5124 100644 --- a/asm/nonmatchings/code_163400/func_80244CEC.s +++ b/asm/nonmatchings/code_163400/func_80244CEC.s @@ -2,8 +2,8 @@ .set noreorder # don't insert nops after branches glabel func_80244CEC -/* 16554C 80244CEC 3C028007 */ lui $v0, 0x8007 -/* 165550 80244CF0 8C42419C */ lw $v0, 0x419c($v0) +/* 16554C 80244CEC 3C028007 */ lui $v0, %hi(gGameStatusPtr) +/* 165550 80244CF0 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) /* 165554 80244CF4 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 165558 80244CF8 AFBF0014 */ sw $ra, 0x14($sp) /* 16555C 80244CFC AFB00010 */ sw $s0, 0x10($sp) diff --git a/asm/nonmatchings/code_163400/func_80244D60.s b/asm/nonmatchings/code_163400/func_80244D60.s index 984c62b995..55993729f2 100644 --- a/asm/nonmatchings/code_163400/func_80244D60.s +++ b/asm/nonmatchings/code_163400/func_80244D60.s @@ -2,8 +2,8 @@ .set noreorder # don't insert nops after branches glabel func_80244D60 -/* 1655C0 80244D60 3C028007 */ lui $v0, 0x8007 -/* 1655C4 80244D64 8C42419C */ lw $v0, 0x419c($v0) +/* 1655C0 80244D60 3C028007 */ lui $v0, %hi(gGameStatusPtr) +/* 1655C4 80244D64 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) /* 1655C8 80244D68 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 1655CC 80244D6C AFBF0014 */ sw $ra, 0x14($sp) /* 1655D0 80244D70 AFB00010 */ sw $s0, 0x10($sp) diff --git a/asm/nonmatchings/code_163400/func_80245A40.s b/asm/nonmatchings/code_163400/func_80245A40.s index afc6959f2c..1f5e8ad5b9 100644 --- a/asm/nonmatchings/code_163400/func_80245A40.s +++ b/asm/nonmatchings/code_163400/func_80245A40.s @@ -178,8 +178,8 @@ glabel func_80245A40 /* 16652C 80245CCC 82620004 */ lb $v0, 4($s3) /* 166530 80245CD0 14400022 */ bnez $v0, .L80245D5C /* 166534 80245CD4 00000000 */ nop -/* 166538 80245CD8 3C108007 */ lui $s0, 0x8007 -/* 16653C 80245CDC 2610419C */ addiu $s0, $s0, 0x419c +/* 166538 80245CD8 3C108007 */ lui $s0, %hi(gGameStatusPtr) +/* 16653C 80245CDC 2610419C */ addiu $s0, $s0, %lo(gGameStatusPtr) /* 166540 80245CE0 3C058025 */ lui $a1, 0x8025 /* 166544 80245CE4 24A5C084 */ addiu $a1, $a1, -0x3f7c /* 166548 80245CE8 8CA20000 */ lw $v0, ($a1) diff --git a/asm/nonmatchings/code_16c8e0/draw_main_battle_ui.s b/asm/nonmatchings/code_16c8e0/draw_main_battle_ui.s index 0b7a2f92f3..e8ebdf3068 100644 --- a/asm/nonmatchings/code_16c8e0/draw_main_battle_ui.s +++ b/asm/nonmatchings/code_16c8e0/draw_main_battle_ui.s @@ -134,7 +134,7 @@ glabel draw_main_battle_ui /* 16D554 8023EC74 00000000 */ nop /* 16D558 8023EC78 0808FB4E */ j .L8023ED38 /* 16D55C 8023EC7C 00000000 */ nop -/* 16D560 8023EC80 0C0911C2 */ jal func_80244708 +/* 16D560 8023EC80 0C0911C2 */ jal pause_cleanup /* 16D564 8023EC84 00000000 */ nop /* 16D568 8023EC88 0808FB4E */ j .L8023ED38 /* 16D56C 8023EC8C 00000000 */ nop diff --git a/asm/nonmatchings/code_1f580_len_1940/BindNpcAux.s b/asm/nonmatchings/code_1f580_len_1940/BindNpcAux.s deleted file mode 100644 index 2e752feed5..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/BindNpcAux.s +++ /dev/null @@ -1,37 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel BindNpcAux -/* 202B8 80044EB8 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 202BC 80044EBC AFB10014 */ sw $s1, 0x14($sp) -/* 202C0 80044EC0 0080882D */ daddu $s1, $a0, $zero -/* 202C4 80044EC4 AFBF0020 */ sw $ra, 0x20($sp) -/* 202C8 80044EC8 AFB3001C */ sw $s3, 0x1c($sp) -/* 202CC 80044ECC AFB20018 */ sw $s2, 0x18($sp) -/* 202D0 80044ED0 AFB00010 */ sw $s0, 0x10($sp) -/* 202D4 80044ED4 8E30000C */ lw $s0, 0xc($s1) -/* 202D8 80044ED8 8E330148 */ lw $s3, 0x148($s1) -/* 202DC 80044EDC 8E050000 */ lw $a1, ($s0) -/* 202E0 80044EE0 0C0B1EAF */ jal get_variable -/* 202E4 80044EE4 26100004 */ addiu $s0, $s0, 4 -/* 202E8 80044EE8 0040902D */ daddu $s2, $v0, $zero -/* 202EC 80044EEC 8E050000 */ lw $a1, ($s0) -/* 202F0 80044EF0 0C0B1EAF */ jal get_variable -/* 202F4 80044EF4 0220202D */ daddu $a0, $s1, $zero -/* 202F8 80044EF8 0040802D */ daddu $s0, $v0, $zero -/* 202FC 80044EFC 2402FFFF */ addiu $v0, $zero, -1 -/* 20300 80044F00 16420002 */ bne $s2, $v0, .L80044F0C -/* 20304 80044F04 00000000 */ nop -/* 20308 80044F08 86720008 */ lh $s2, 8($s3) -.L80044F0C: -/* 2030C 80044F0C 0C00FB3A */ jal get_enemy -/* 20310 80044F10 0240202D */ daddu $a0, $s2, $zero -/* 20314 80044F14 AC50002C */ sw $s0, 0x2c($v0) -/* 20318 80044F18 8FBF0020 */ lw $ra, 0x20($sp) -/* 2031C 80044F1C 8FB3001C */ lw $s3, 0x1c($sp) -/* 20320 80044F20 8FB20018 */ lw $s2, 0x18($sp) -/* 20324 80044F24 8FB10014 */ lw $s1, 0x14($sp) -/* 20328 80044F28 8FB00010 */ lw $s0, 0x10($sp) -/* 2032C 80044F2C 24020002 */ addiu $v0, $zero, 2 -/* 20330 80044F30 03E00008 */ jr $ra -/* 20334 80044F34 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/BindNpcDefeat.s b/asm/nonmatchings/code_1f580_len_1940/BindNpcDefeat.s deleted file mode 100644 index 5904f6628e..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/BindNpcDefeat.s +++ /dev/null @@ -1,37 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel BindNpcDefeat -/* 205DC 800451DC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 205E0 800451E0 AFB10014 */ sw $s1, 0x14($sp) -/* 205E4 800451E4 0080882D */ daddu $s1, $a0, $zero -/* 205E8 800451E8 AFBF0020 */ sw $ra, 0x20($sp) -/* 205EC 800451EC AFB3001C */ sw $s3, 0x1c($sp) -/* 205F0 800451F0 AFB20018 */ sw $s2, 0x18($sp) -/* 205F4 800451F4 AFB00010 */ sw $s0, 0x10($sp) -/* 205F8 800451F8 8E30000C */ lw $s0, 0xc($s1) -/* 205FC 800451FC 8E330148 */ lw $s3, 0x148($s1) -/* 20600 80045200 8E050000 */ lw $a1, ($s0) -/* 20604 80045204 0C0B1EAF */ jal get_variable -/* 20608 80045208 26100004 */ addiu $s0, $s0, 4 -/* 2060C 8004520C 0040902D */ daddu $s2, $v0, $zero -/* 20610 80045210 8E050000 */ lw $a1, ($s0) -/* 20614 80045214 0C0B1EAF */ jal get_variable -/* 20618 80045218 0220202D */ daddu $a0, $s1, $zero -/* 2061C 8004521C 0040802D */ daddu $s0, $v0, $zero -/* 20620 80045220 2402FFFF */ addiu $v0, $zero, -1 -/* 20624 80045224 16420002 */ bne $s2, $v0, .L80045230 -/* 20628 80045228 00000000 */ nop -/* 2062C 8004522C 86720008 */ lh $s2, 8($s3) -.L80045230: -/* 20630 80045230 0C00FB3A */ jal get_enemy -/* 20634 80045234 0240202D */ daddu $a0, $s2, $zero -/* 20638 80045238 AC500030 */ sw $s0, 0x30($v0) -/* 2063C 8004523C 8FBF0020 */ lw $ra, 0x20($sp) -/* 20640 80045240 8FB3001C */ lw $s3, 0x1c($sp) -/* 20644 80045244 8FB20018 */ lw $s2, 0x18($sp) -/* 20648 80045248 8FB10014 */ lw $s1, 0x14($sp) -/* 2064C 8004524C 8FB00010 */ lw $s0, 0x10($sp) -/* 20650 80045250 24020002 */ addiu $v0, $zero, 2 -/* 20654 80045254 03E00008 */ jr $ra -/* 20658 80045258 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/BindNpcHit.s b/asm/nonmatchings/code_1f580_len_1940/BindNpcHit.s deleted file mode 100644 index 77c8217f3f..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/BindNpcHit.s +++ /dev/null @@ -1,45 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel BindNpcHit -/* 20540 80045140 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 20544 80045144 AFB10014 */ sw $s1, 0x14($sp) -/* 20548 80045148 0080882D */ daddu $s1, $a0, $zero -/* 2054C 8004514C AFBF0020 */ sw $ra, 0x20($sp) -/* 20550 80045150 AFB3001C */ sw $s3, 0x1c($sp) -/* 20554 80045154 AFB20018 */ sw $s2, 0x18($sp) -/* 20558 80045158 AFB00010 */ sw $s0, 0x10($sp) -/* 2055C 8004515C 8E30000C */ lw $s0, 0xc($s1) -/* 20560 80045160 8E330148 */ lw $s3, 0x148($s1) -/* 20564 80045164 8E050000 */ lw $a1, ($s0) -/* 20568 80045168 0C0B1EAF */ jal get_variable -/* 2056C 8004516C 26100004 */ addiu $s0, $s0, 4 -/* 20570 80045170 0040902D */ daddu $s2, $v0, $zero -/* 20574 80045174 8E050000 */ lw $a1, ($s0) -/* 20578 80045178 0C0B1EAF */ jal get_variable -/* 2057C 8004517C 0220202D */ daddu $a0, $s1, $zero -/* 20580 80045180 0040802D */ daddu $s0, $v0, $zero -/* 20584 80045184 2402FFFF */ addiu $v0, $zero, -1 -/* 20588 80045188 16420002 */ bne $s2, $v0, .L80045194 -/* 2058C 8004518C 00000000 */ nop -/* 20590 80045190 86720008 */ lh $s2, 8($s3) -.L80045194: -/* 20594 80045194 0C00FB3A */ jal get_enemy -/* 20598 80045198 0240202D */ daddu $a0, $s2, $zero -/* 2059C 8004519C 0040982D */ daddu $s3, $v0, $zero -/* 205A0 800451A0 8E620040 */ lw $v0, 0x40($s3) -/* 205A4 800451A4 50400005 */ beql $v0, $zero, .L800451BC -/* 205A8 800451A8 AE700028 */ sw $s0, 0x28($s3) -/* 205AC 800451AC 8E640058 */ lw $a0, 0x58($s3) -/* 205B0 800451B0 0C0B102B */ jal kill_script_by_ID -/* 205B4 800451B4 00000000 */ nop -/* 205B8 800451B8 AE700028 */ sw $s0, 0x28($s3) -.L800451BC: -/* 205BC 800451BC 8FBF0020 */ lw $ra, 0x20($sp) -/* 205C0 800451C0 8FB3001C */ lw $s3, 0x1c($sp) -/* 205C4 800451C4 8FB20018 */ lw $s2, 0x18($sp) -/* 205C8 800451C8 8FB10014 */ lw $s1, 0x14($sp) -/* 205CC 800451CC 8FB00010 */ lw $s0, 0x10($sp) -/* 205D0 800451D0 24020002 */ addiu $v0, $zero, 2 -/* 205D4 800451D4 03E00008 */ jr $ra -/* 205D8 800451D8 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/BindNpcIdle.s b/asm/nonmatchings/code_1f580_len_1940/BindNpcIdle.s deleted file mode 100644 index 05391081e7..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/BindNpcIdle.s +++ /dev/null @@ -1,37 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel BindNpcIdle -/* 1FFAC 80044BAC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 1FFB0 80044BB0 AFB10014 */ sw $s1, 0x14($sp) -/* 1FFB4 80044BB4 0080882D */ daddu $s1, $a0, $zero -/* 1FFB8 80044BB8 AFBF0020 */ sw $ra, 0x20($sp) -/* 1FFBC 80044BBC AFB3001C */ sw $s3, 0x1c($sp) -/* 1FFC0 80044BC0 AFB20018 */ sw $s2, 0x18($sp) -/* 1FFC4 80044BC4 AFB00010 */ sw $s0, 0x10($sp) -/* 1FFC8 80044BC8 8E30000C */ lw $s0, 0xc($s1) -/* 1FFCC 80044BCC 8E330148 */ lw $s3, 0x148($s1) -/* 1FFD0 80044BD0 8E050000 */ lw $a1, ($s0) -/* 1FFD4 80044BD4 0C0B1EAF */ jal get_variable -/* 1FFD8 80044BD8 26100004 */ addiu $s0, $s0, 4 -/* 1FFDC 80044BDC 0040902D */ daddu $s2, $v0, $zero -/* 1FFE0 80044BE0 8E050000 */ lw $a1, ($s0) -/* 1FFE4 80044BE4 0C0B1EAF */ jal get_variable -/* 1FFE8 80044BE8 0220202D */ daddu $a0, $s1, $zero -/* 1FFEC 80044BEC 0040802D */ daddu $s0, $v0, $zero -/* 1FFF0 80044BF0 2402FFFF */ addiu $v0, $zero, -1 -/* 1FFF4 80044BF4 16420002 */ bne $s2, $v0, .L80044C00 -/* 1FFF8 80044BF8 00000000 */ nop -/* 1FFFC 80044BFC 86720008 */ lh $s2, 8($s3) -.L80044C00: -/* 20000 80044C00 0C00FB3A */ jal get_enemy -/* 20004 80044C04 0240202D */ daddu $a0, $s2, $zero -/* 20008 80044C08 AC500024 */ sw $s0, 0x24($v0) -/* 2000C 80044C0C 8FBF0020 */ lw $ra, 0x20($sp) -/* 20010 80044C10 8FB3001C */ lw $s3, 0x1c($sp) -/* 20014 80044C14 8FB20018 */ lw $s2, 0x18($sp) -/* 20018 80044C18 8FB10014 */ lw $s1, 0x14($sp) -/* 2001C 80044C1C 8FB00010 */ lw $s0, 0x10($sp) -/* 20020 80044C20 24020002 */ addiu $v0, $zero, 2 -/* 20024 80044C24 03E00008 */ jr $ra -/* 20028 80044C28 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/BindNpcInteract.s b/asm/nonmatchings/code_1f580_len_1940/BindNpcInteract.s deleted file mode 100644 index d73d02cc72..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/BindNpcInteract.s +++ /dev/null @@ -1,45 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel BindNpcInteract -/* 204A4 800450A4 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 204A8 800450A8 AFB10014 */ sw $s1, 0x14($sp) -/* 204AC 800450AC 0080882D */ daddu $s1, $a0, $zero -/* 204B0 800450B0 AFBF0020 */ sw $ra, 0x20($sp) -/* 204B4 800450B4 AFB3001C */ sw $s3, 0x1c($sp) -/* 204B8 800450B8 AFB20018 */ sw $s2, 0x18($sp) -/* 204BC 800450BC AFB00010 */ sw $s0, 0x10($sp) -/* 204C0 800450C0 8E30000C */ lw $s0, 0xc($s1) -/* 204C4 800450C4 8E330148 */ lw $s3, 0x148($s1) -/* 204C8 800450C8 8E050000 */ lw $a1, ($s0) -/* 204CC 800450CC 0C0B1EAF */ jal get_variable -/* 204D0 800450D0 26100004 */ addiu $s0, $s0, 4 -/* 204D4 800450D4 0040902D */ daddu $s2, $v0, $zero -/* 204D8 800450D8 8E050000 */ lw $a1, ($s0) -/* 204DC 800450DC 0C0B1EAF */ jal get_variable -/* 204E0 800450E0 0220202D */ daddu $a0, $s1, $zero -/* 204E4 800450E4 0040802D */ daddu $s0, $v0, $zero -/* 204E8 800450E8 2402FFFF */ addiu $v0, $zero, -1 -/* 204EC 800450EC 16420002 */ bne $s2, $v0, .L800450F8 -/* 204F0 800450F0 00000000 */ nop -/* 204F4 800450F4 86720008 */ lh $s2, 8($s3) -.L800450F8: -/* 204F8 800450F8 0C00FB3A */ jal get_enemy -/* 204FC 800450FC 0240202D */ daddu $a0, $s2, $zero -/* 20500 80045100 0040982D */ daddu $s3, $v0, $zero -/* 20504 80045104 8E620038 */ lw $v0, 0x38($s3) -/* 20508 80045108 50400005 */ beql $v0, $zero, .L80045120 -/* 2050C 8004510C AE700020 */ sw $s0, 0x20($s3) -/* 20510 80045110 8E640050 */ lw $a0, 0x50($s3) -/* 20514 80045114 0C0B102B */ jal kill_script_by_ID -/* 20518 80045118 00000000 */ nop -/* 2051C 8004511C AE700020 */ sw $s0, 0x20($s3) -.L80045120: -/* 20520 80045120 8FBF0020 */ lw $ra, 0x20($sp) -/* 20524 80045124 8FB3001C */ lw $s3, 0x1c($sp) -/* 20528 80045128 8FB20018 */ lw $s2, 0x18($sp) -/* 2052C 8004512C 8FB10014 */ lw $s1, 0x14($sp) -/* 20530 80045130 8FB00010 */ lw $s0, 0x10($sp) -/* 20534 80045134 24020002 */ addiu $v0, $zero, 2 -/* 20538 80045138 03E00008 */ jr $ra -/* 2053C 8004513C 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/ClearDefeatedEnemies.s b/asm/nonmatchings/code_1f580_len_1940/ClearDefeatedEnemies.s deleted file mode 100644 index 578d73057c..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/ClearDefeatedEnemies.s +++ /dev/null @@ -1,24 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel ClearDefeatedEnemies -/* 20A40 80045640 3C07800B */ lui $a3, %hi(gCurrentEncounter) -/* 20A44 80045644 24E70F10 */ addiu $a3, $a3, %lo(gCurrentEncounter) -/* 20A48 80045648 0000302D */ daddu $a2, $zero, $zero -/* 20A4C 8004564C 00C0282D */ daddu $a1, $a2, $zero -.L80045650: -/* 20A50 80045650 0000202D */ daddu $a0, $zero, $zero -/* 20A54 80045654 00A0182D */ daddu $v1, $a1, $zero -.L80045658: -/* 20A58 80045658 00E31021 */ addu $v0, $a3, $v1 -/* 20A5C 8004565C AC4000B0 */ sw $zero, 0xb0($v0) -/* 20A60 80045660 24840001 */ addiu $a0, $a0, 1 -/* 20A64 80045664 2882000C */ slti $v0, $a0, 0xc -/* 20A68 80045668 1440FFFB */ bnez $v0, .L80045658 -/* 20A6C 8004566C 24630004 */ addiu $v1, $v1, 4 -/* 20A70 80045670 24C60001 */ addiu $a2, $a2, 1 -/* 20A74 80045674 28C2003C */ slti $v0, $a2, 0x3c -/* 20A78 80045678 1440FFF5 */ bnez $v0, .L80045650 -/* 20A7C 8004567C 24A50030 */ addiu $a1, $a1, 0x30 -/* 20A80 80045680 03E00008 */ jr $ra -/* 20A84 80045684 24020002 */ addiu $v0, $zero, 2 diff --git a/asm/nonmatchings/code_1f580_len_1940/DoNpcDefeat.s b/asm/nonmatchings/code_1f580_len_1940/DoNpcDefeat.s deleted file mode 100644 index 3887b5dfc6..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/DoNpcDefeat.s +++ /dev/null @@ -1,38 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel DoNpcDefeat -/* 1FA2C 8004462C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 1FA30 80044630 AFB10014 */ sw $s1, 0x14($sp) -/* 1FA34 80044634 0080882D */ daddu $s1, $a0, $zero -/* 1FA38 80044638 AFBF0018 */ sw $ra, 0x18($sp) -/* 1FA3C 8004463C AFB00010 */ sw $s0, 0x10($sp) -/* 1FA40 80044640 8E300148 */ lw $s0, 0x148($s1) -/* 1FA44 80044644 0C00EABB */ jal get_npc_unsafe -/* 1FA48 80044648 86040008 */ lh $a0, 8($s0) -/* 1FA4C 8004464C 0220202D */ daddu $a0, $s1, $zero -/* 1FA50 80044650 0C0B0FCF */ jal kill_script -/* 1FA54 80044654 0040882D */ daddu $s1, $v0, $zero -/* 1FA58 80044658 3C048007 */ lui $a0, 0x8007 -/* 1FA5C 8004465C 24847E38 */ addiu $a0, $a0, 0x7e38 -/* 1FA60 80044660 8E0200CC */ lw $v0, 0xcc($s0) -/* 1FA64 80044664 2405000A */ addiu $a1, $zero, 0xa -/* 1FA68 80044668 8C420018 */ lw $v0, 0x18($v0) -/* 1FA6C 8004466C 0000302D */ daddu $a2, $zero, $zero -/* 1FA70 80044670 0C0B0CF8 */ jal start_script -/* 1FA74 80044674 AE220028 */ sw $v0, 0x28($s1) -/* 1FA78 80044678 0040182D */ daddu $v1, $v0, $zero -/* 1FA7C 8004467C AE030048 */ sw $v1, 0x48($s0) -/* 1FA80 80044680 8C620144 */ lw $v0, 0x144($v1) -/* 1FA84 80044684 AE020060 */ sw $v0, 0x60($s0) -/* 1FA88 80044688 AC700148 */ sw $s0, 0x148($v1) -/* 1FA8C 8004468C 86020008 */ lh $v0, 8($s0) -/* 1FA90 80044690 AC62014C */ sw $v0, 0x14c($v1) -/* 1FA94 80044694 92040006 */ lbu $a0, 6($s0) -/* 1FA98 80044698 A0640004 */ sb $a0, 4($v1) -/* 1FA9C 8004469C 8FBF0018 */ lw $ra, 0x18($sp) -/* 1FAA0 800446A0 8FB10014 */ lw $s1, 0x14($sp) -/* 1FAA4 800446A4 8FB00010 */ lw $s0, 0x10($sp) -/* 1FAA8 800446A8 240200FF */ addiu $v0, $zero, 0xff -/* 1FAAC 800446AC 03E00008 */ jr $ra -/* 1FAB0 800446B0 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_1f580_len_1940/EnableNpcAI.s b/asm/nonmatchings/code_1f580_len_1940/EnableNpcAI.s deleted file mode 100644 index ab8def65a7..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/EnableNpcAI.s +++ /dev/null @@ -1,52 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel EnableNpcAI -/* 200F0 80044CF0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 200F4 80044CF4 AFB10014 */ sw $s1, 0x14($sp) -/* 200F8 80044CF8 0080882D */ daddu $s1, $a0, $zero -/* 200FC 80044CFC AFBF0020 */ sw $ra, 0x20($sp) -/* 20100 80044D00 AFB3001C */ sw $s3, 0x1c($sp) -/* 20104 80044D04 AFB20018 */ sw $s2, 0x18($sp) -/* 20108 80044D08 AFB00010 */ sw $s0, 0x10($sp) -/* 2010C 80044D0C 8E30000C */ lw $s0, 0xc($s1) -/* 20110 80044D10 8E330148 */ lw $s3, 0x148($s1) -/* 20114 80044D14 8E050000 */ lw $a1, ($s0) -/* 20118 80044D18 0C0B1EAF */ jal get_variable -/* 2011C 80044D1C 26100004 */ addiu $s0, $s0, 4 -/* 20120 80044D20 0040902D */ daddu $s2, $v0, $zero -/* 20124 80044D24 8E050000 */ lw $a1, ($s0) -/* 20128 80044D28 0C0B1EAF */ jal get_variable -/* 2012C 80044D2C 0220202D */ daddu $a0, $s1, $zero -/* 20130 80044D30 0040802D */ daddu $s0, $v0, $zero -/* 20134 80044D34 2402FFFF */ addiu $v0, $zero, -1 -/* 20138 80044D38 16420002 */ bne $s2, $v0, .L80044D44 -/* 2013C 80044D3C 00000000 */ nop -/* 20140 80044D40 86720008 */ lh $s2, 8($s3) -.L80044D44: -/* 20144 80044D44 0C00FB3A */ jal get_enemy -/* 20148 80044D48 0240202D */ daddu $a0, $s2, $zero -/* 2014C 80044D4C 12000008 */ beqz $s0, .L80044D70 -/* 20150 80044D50 0040982D */ daddu $s3, $v0, $zero -/* 20154 80044D54 8E62003C */ lw $v0, 0x3c($s3) -/* 20158 80044D58 1040000A */ beqz $v0, .L80044D84 -/* 2015C 80044D5C 00000000 */ nop -/* 20160 80044D60 0C0B1123 */ jal resume_all_script -/* 20164 80044D64 8E640054 */ lw $a0, 0x54($s3) -/* 20168 80044D68 08011361 */ j .L80044D84 -/* 2016C 80044D6C 00000000 */ nop -.L80044D70: -/* 20170 80044D70 8E62003C */ lw $v0, 0x3c($s3) -/* 20174 80044D74 10400003 */ beqz $v0, .L80044D84 -/* 20178 80044D78 00000000 */ nop -/* 2017C 80044D7C 0C0B1108 */ jal suspend_all_script -/* 20180 80044D80 8E640054 */ lw $a0, 0x54($s3) -.L80044D84: -/* 20184 80044D84 8FBF0020 */ lw $ra, 0x20($sp) -/* 20188 80044D88 8FB3001C */ lw $s3, 0x1c($sp) -/* 2018C 80044D8C 8FB20018 */ lw $s2, 0x18($sp) -/* 20190 80044D90 8FB10014 */ lw $s1, 0x14($sp) -/* 20194 80044D94 8FB00010 */ lw $s0, 0x10($sp) -/* 20198 80044D98 24020002 */ addiu $v0, $zero, 2 -/* 2019C 80044D9C 03E00008 */ jr $ra -/* 201A0 80044DA0 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/EnableNpcAux.s b/asm/nonmatchings/code_1f580_len_1940/EnableNpcAux.s deleted file mode 100644 index d2af813f1d..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/EnableNpcAux.s +++ /dev/null @@ -1,52 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel EnableNpcAux -/* 203F0 80044FF0 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 203F4 80044FF4 AFB10014 */ sw $s1, 0x14($sp) -/* 203F8 80044FF8 0080882D */ daddu $s1, $a0, $zero -/* 203FC 80044FFC AFBF0020 */ sw $ra, 0x20($sp) -/* 20400 80045000 AFB3001C */ sw $s3, 0x1c($sp) -/* 20404 80045004 AFB20018 */ sw $s2, 0x18($sp) -/* 20408 80045008 AFB00010 */ sw $s0, 0x10($sp) -/* 2040C 8004500C 8E30000C */ lw $s0, 0xc($s1) -/* 20410 80045010 8E330148 */ lw $s3, 0x148($s1) -/* 20414 80045014 8E050000 */ lw $a1, ($s0) -/* 20418 80045018 0C0B1EAF */ jal get_variable -/* 2041C 8004501C 26100004 */ addiu $s0, $s0, 4 -/* 20420 80045020 0040902D */ daddu $s2, $v0, $zero -/* 20424 80045024 8E050000 */ lw $a1, ($s0) -/* 20428 80045028 0C0B1EAF */ jal get_variable -/* 2042C 8004502C 0220202D */ daddu $a0, $s1, $zero -/* 20430 80045030 0040802D */ daddu $s0, $v0, $zero -/* 20434 80045034 2402FFFF */ addiu $v0, $zero, -1 -/* 20438 80045038 16420002 */ bne $s2, $v0, .L80045044 -/* 2043C 8004503C 00000000 */ nop -/* 20440 80045040 86720008 */ lh $s2, 8($s3) -.L80045044: -/* 20444 80045044 0C00FB3A */ jal get_enemy -/* 20448 80045048 0240202D */ daddu $a0, $s2, $zero -/* 2044C 8004504C 12000008 */ beqz $s0, .L80045070 -/* 20450 80045050 0040982D */ daddu $s3, $v0, $zero -/* 20454 80045054 8E620044 */ lw $v0, 0x44($s3) -/* 20458 80045058 1040000A */ beqz $v0, .L80045084 -/* 2045C 8004505C 00000000 */ nop -/* 20460 80045060 0C0B1123 */ jal resume_all_script -/* 20464 80045064 8E64005C */ lw $a0, 0x5c($s3) -/* 20468 80045068 08011421 */ j .L80045084 -/* 2046C 8004506C 00000000 */ nop -.L80045070: -/* 20470 80045070 8E620044 */ lw $v0, 0x44($s3) -/* 20474 80045074 10400003 */ beqz $v0, .L80045084 -/* 20478 80045078 00000000 */ nop -/* 2047C 8004507C 0C0B1108 */ jal suspend_all_script -/* 20480 80045080 8E64005C */ lw $a0, 0x5c($s3) -.L80045084: -/* 20484 80045084 8FBF0020 */ lw $ra, 0x20($sp) -/* 20488 80045088 8FB3001C */ lw $s3, 0x1c($sp) -/* 2048C 8004508C 8FB20018 */ lw $s2, 0x18($sp) -/* 20490 80045090 8FB10014 */ lw $s1, 0x14($sp) -/* 20494 80045094 8FB00010 */ lw $s0, 0x10($sp) -/* 20498 80045098 24020002 */ addiu $v0, $zero, 2 -/* 2049C 8004509C 03E00008 */ jr $ra -/* 204A0 800450A0 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/GetNpcVar.s b/asm/nonmatchings/code_1f580_len_1940/GetNpcVar.s deleted file mode 100644 index 81f23427c2..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/GetNpcVar.s +++ /dev/null @@ -1,45 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel GetNpcVar -/* 207BC 800453BC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 207C0 800453C0 AFB3001C */ sw $s3, 0x1c($sp) -/* 207C4 800453C4 0080982D */ daddu $s3, $a0, $zero -/* 207C8 800453C8 AFBF0024 */ sw $ra, 0x24($sp) -/* 207CC 800453CC AFB40020 */ sw $s4, 0x20($sp) -/* 207D0 800453D0 AFB20018 */ sw $s2, 0x18($sp) -/* 207D4 800453D4 AFB10014 */ sw $s1, 0x14($sp) -/* 207D8 800453D8 AFB00010 */ sw $s0, 0x10($sp) -/* 207DC 800453DC 8E70000C */ lw $s0, 0xc($s3) -/* 207E0 800453E0 8E720148 */ lw $s2, 0x148($s3) -/* 207E4 800453E4 8E050000 */ lw $a1, ($s0) -/* 207E8 800453E8 0C0B1EAF */ jal get_variable -/* 207EC 800453EC 26100004 */ addiu $s0, $s0, 4 -/* 207F0 800453F0 0040882D */ daddu $s1, $v0, $zero -/* 207F4 800453F4 8E050000 */ lw $a1, ($s0) -/* 207F8 800453F8 26100004 */ addiu $s0, $s0, 4 -/* 207FC 800453FC 0C0B1EAF */ jal get_variable -/* 20800 80045400 0260202D */ daddu $a0, $s3, $zero -/* 20804 80045404 0040A02D */ daddu $s4, $v0, $zero -/* 20808 80045408 2402FFFF */ addiu $v0, $zero, -1 -/* 2080C 8004540C 16220002 */ bne $s1, $v0, .L80045418 -/* 20810 80045410 8E100000 */ lw $s0, ($s0) -/* 20814 80045414 86510008 */ lh $s1, 8($s2) -.L80045418: -/* 20818 80045418 0C00FB3A */ jal get_enemy -/* 2081C 8004541C 0220202D */ daddu $a0, $s1, $zero -/* 20820 80045420 0260202D */ daddu $a0, $s3, $zero -/* 20824 80045424 00141880 */ sll $v1, $s4, 2 -/* 20828 80045428 00431021 */ addu $v0, $v0, $v1 -/* 2082C 8004542C 8C46006C */ lw $a2, 0x6c($v0) -/* 20830 80045430 0C0B2026 */ jal set_variable -/* 20834 80045434 0200282D */ daddu $a1, $s0, $zero -/* 20838 80045438 8FBF0024 */ lw $ra, 0x24($sp) -/* 2083C 8004543C 8FB40020 */ lw $s4, 0x20($sp) -/* 20840 80045440 8FB3001C */ lw $s3, 0x1c($sp) -/* 20844 80045444 8FB20018 */ lw $s2, 0x18($sp) -/* 20848 80045448 8FB10014 */ lw $s1, 0x14($sp) -/* 2084C 8004544C 8FB00010 */ lw $s0, 0x10($sp) -/* 20850 80045450 24020002 */ addiu $v0, $zero, 2 -/* 20854 80045454 03E00008 */ jr $ra -/* 20858 80045458 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/GetSelfAnimationFromTable.s b/asm/nonmatchings/code_1f580_len_1940/GetSelfAnimationFromTable.s deleted file mode 100644 index d7b832c27a..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/GetSelfAnimationFromTable.s +++ /dev/null @@ -1,29 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel GetSelfAnimationFromTable -/* 20B34 80045734 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 20B38 80045738 AFB10014 */ sw $s1, 0x14($sp) -/* 20B3C 8004573C 0080882D */ daddu $s1, $a0, $zero -/* 20B40 80045740 AFBF001C */ sw $ra, 0x1c($sp) -/* 20B44 80045744 AFB20018 */ sw $s2, 0x18($sp) -/* 20B48 80045748 AFB00010 */ sw $s0, 0x10($sp) -/* 20B4C 8004574C 8E30000C */ lw $s0, 0xc($s1) -/* 20B50 80045750 8E320148 */ lw $s2, 0x148($s1) -/* 20B54 80045754 8E050000 */ lw $a1, ($s0) -/* 20B58 80045758 0C0B1EAF */ jal get_variable -/* 20B5C 8004575C 26100004 */ addiu $s0, $s0, 4 -/* 20B60 80045760 00021080 */ sll $v0, $v0, 2 -/* 20B64 80045764 8E4300CC */ lw $v1, 0xcc($s2) -/* 20B68 80045768 8E050000 */ lw $a1, ($s0) -/* 20B6C 8004576C 00431021 */ addu $v0, $v0, $v1 -/* 20B70 80045770 8C460000 */ lw $a2, ($v0) -/* 20B74 80045774 0C0B2026 */ jal set_variable -/* 20B78 80045778 0220202D */ daddu $a0, $s1, $zero -/* 20B7C 8004577C 8FBF001C */ lw $ra, 0x1c($sp) -/* 20B80 80045780 8FB20018 */ lw $s2, 0x18($sp) -/* 20B84 80045784 8FB10014 */ lw $s1, 0x14($sp) -/* 20B88 80045788 8FB00010 */ lw $s0, 0x10($sp) -/* 20B8C 8004578C 24020002 */ addiu $v0, $zero, 2 -/* 20B90 80045790 03E00008 */ jr $ra -/* 20B94 80045794 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_1f580_len_1940/GetSelfVar.s b/asm/nonmatchings/code_1f580_len_1940/GetSelfVar.s deleted file mode 100644 index e73f76a3e0..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/GetSelfVar.s +++ /dev/null @@ -1,28 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel GetSelfVar -/* 206C0 800452C0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 206C4 800452C4 AFB20018 */ sw $s2, 0x18($sp) -/* 206C8 800452C8 0080902D */ daddu $s2, $a0, $zero -/* 206CC 800452CC AFBF001C */ sw $ra, 0x1c($sp) -/* 206D0 800452D0 AFB10014 */ sw $s1, 0x14($sp) -/* 206D4 800452D4 AFB00010 */ sw $s0, 0x10($sp) -/* 206D8 800452D8 8E51000C */ lw $s1, 0xc($s2) -/* 206DC 800452DC 8E500148 */ lw $s0, 0x148($s2) -/* 206E0 800452E0 8E250000 */ lw $a1, ($s1) -/* 206E4 800452E4 0C0B1EAF */ jal get_variable -/* 206E8 800452E8 26310004 */ addiu $s1, $s1, 4 -/* 206EC 800452EC 00021080 */ sll $v0, $v0, 2 -/* 206F0 800452F0 02028021 */ addu $s0, $s0, $v0 -/* 206F4 800452F4 8E250000 */ lw $a1, ($s1) -/* 206F8 800452F8 8E06006C */ lw $a2, 0x6c($s0) -/* 206FC 800452FC 0C0B2026 */ jal set_variable -/* 20700 80045300 0240202D */ daddu $a0, $s2, $zero -/* 20704 80045304 8FBF001C */ lw $ra, 0x1c($sp) -/* 20708 80045308 8FB20018 */ lw $s2, 0x18($sp) -/* 2070C 8004530C 8FB10014 */ lw $s1, 0x14($sp) -/* 20710 80045310 8FB00010 */ lw $s0, 0x10($sp) -/* 20714 80045314 24020002 */ addiu $v0, $zero, 2 -/* 20718 80045318 03E00008 */ jr $ra -/* 2071C 8004531C 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_1f580_len_1940/RestartNpcAI.s b/asm/nonmatchings/code_1f580_len_1940/RestartNpcAI.s deleted file mode 100644 index 3f9e96ce9f..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/RestartNpcAI.s +++ /dev/null @@ -1,56 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel RestartNpcAI -/* 2002C 80044C2C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 20030 80044C30 AFB10014 */ sw $s1, 0x14($sp) -/* 20034 80044C34 0080882D */ daddu $s1, $a0, $zero -/* 20038 80044C38 AFBF001C */ sw $ra, 0x1c($sp) -/* 2003C 80044C3C AFB20018 */ sw $s2, 0x18($sp) -/* 20040 80044C40 AFB00010 */ sw $s0, 0x10($sp) -/* 20044 80044C44 8E22000C */ lw $v0, 0xc($s1) -/* 20048 80044C48 8C450000 */ lw $a1, ($v0) -/* 2004C 80044C4C 0C0B1EAF */ jal get_variable -/* 20050 80044C50 8E300148 */ lw $s0, 0x148($s1) -/* 20054 80044C54 0040202D */ daddu $a0, $v0, $zero -/* 20058 80044C58 2402FFFF */ addiu $v0, $zero, -1 -/* 2005C 80044C5C 14820002 */ bne $a0, $v0, .L80044C68 -/* 20060 80044C60 00000000 */ nop -/* 20064 80044C64 86040008 */ lh $a0, 8($s0) -.L80044C68: -/* 20068 80044C68 0C00FB3A */ jal get_enemy -/* 2006C 80044C6C 2412000B */ addiu $s2, $zero, 0xb -/* 20070 80044C70 0040802D */ daddu $s0, $v0, $zero -/* 20074 80044C74 8E020000 */ lw $v0, ($s0) -/* 20078 80044C78 30420001 */ andi $v0, $v0, 1 -/* 2007C 80044C7C 54400001 */ bnel $v0, $zero, .L80044C84 -/* 20080 80044C80 2412000A */ addiu $s2, $zero, 0xa -.L80044C84: -/* 20084 80044C84 8E02003C */ lw $v0, 0x3c($s0) -/* 20088 80044C88 10400005 */ beqz $v0, .L80044CA0 -/* 2008C 80044C8C 2405000A */ addiu $a1, $zero, 0xa -/* 20090 80044C90 8E040054 */ lw $a0, 0x54($s0) -/* 20094 80044C94 0C0B102B */ jal kill_script_by_ID -/* 20098 80044C98 00000000 */ nop -/* 2009C 80044C9C 2405000A */ addiu $a1, $zero, 0xa -.L80044CA0: -/* 200A0 80044CA0 24020064 */ addiu $v0, $zero, 0x64 -/* 200A4 80044CA4 8E040024 */ lw $a0, 0x24($s0) -/* 200A8 80044CA8 0000302D */ daddu $a2, $zero, $zero -/* 200AC 80044CAC 0C0B0CF8 */ jal start_script -/* 200B0 80044CB0 AE0200C8 */ sw $v0, 0xc8($s0) -/* 200B4 80044CB4 0040182D */ daddu $v1, $v0, $zero -/* 200B8 80044CB8 AE03003C */ sw $v1, 0x3c($s0) -/* 200BC 80044CBC 8C620144 */ lw $v0, 0x144($v1) -/* 200C0 80044CC0 AE020054 */ sw $v0, 0x54($s0) -/* 200C4 80044CC4 AC700148 */ sw $s0, 0x148($v1) -/* 200C8 80044CC8 8E24014C */ lw $a0, 0x14c($s1) -/* 200CC 80044CCC A0720004 */ sb $s2, 4($v1) -/* 200D0 80044CD0 AC64014C */ sw $a0, 0x14c($v1) -/* 200D4 80044CD4 8FBF001C */ lw $ra, 0x1c($sp) -/* 200D8 80044CD8 8FB20018 */ lw $s2, 0x18($sp) -/* 200DC 80044CDC 8FB10014 */ lw $s1, 0x14($sp) -/* 200E0 80044CE0 8FB00010 */ lw $s0, 0x10($sp) -/* 200E4 80044CE4 24020002 */ addiu $v0, $zero, 2 -/* 200E8 80044CE8 03E00008 */ jr $ra -/* 200EC 80044CEC 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_1f580_len_1940/RestartNpcAux.s b/asm/nonmatchings/code_1f580_len_1940/RestartNpcAux.s deleted file mode 100644 index c415264527..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/RestartNpcAux.s +++ /dev/null @@ -1,53 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel RestartNpcAux -/* 20338 80044F38 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 2033C 80044F3C AFBF001C */ sw $ra, 0x1c($sp) -/* 20340 80044F40 AFB20018 */ sw $s2, 0x18($sp) -/* 20344 80044F44 AFB10014 */ sw $s1, 0x14($sp) -/* 20348 80044F48 AFB00010 */ sw $s0, 0x10($sp) -/* 2034C 80044F4C 8C82000C */ lw $v0, 0xc($a0) -/* 20350 80044F50 8C450000 */ lw $a1, ($v0) -/* 20354 80044F54 0C0B1EAF */ jal get_variable -/* 20358 80044F58 8C900148 */ lw $s0, 0x148($a0) -/* 2035C 80044F5C 0040882D */ daddu $s1, $v0, $zero -/* 20360 80044F60 2402FFFF */ addiu $v0, $zero, -1 -/* 20364 80044F64 16220002 */ bne $s1, $v0, .L80044F70 -/* 20368 80044F68 00000000 */ nop -/* 2036C 80044F6C 86110008 */ lh $s1, 8($s0) -.L80044F70: -/* 20370 80044F70 0C00FB3A */ jal get_enemy -/* 20374 80044F74 0220202D */ daddu $a0, $s1, $zero -/* 20378 80044F78 0040802D */ daddu $s0, $v0, $zero -/* 2037C 80044F7C 8E020000 */ lw $v0, ($s0) -/* 20380 80044F80 30420001 */ andi $v0, $v0, 1 -/* 20384 80044F84 10400002 */ beqz $v0, .L80044F90 -/* 20388 80044F88 2412000B */ addiu $s2, $zero, 0xb -/* 2038C 80044F8C 2412000A */ addiu $s2, $zero, 0xa -.L80044F90: -/* 20390 80044F90 8E020044 */ lw $v0, 0x44($s0) -/* 20394 80044F94 10400005 */ beqz $v0, .L80044FAC -/* 20398 80044F98 2405000A */ addiu $a1, $zero, 0xa -/* 2039C 80044F9C 8E04005C */ lw $a0, 0x5c($s0) -/* 203A0 80044FA0 0C0B102B */ jal kill_script_by_ID -/* 203A4 80044FA4 00000000 */ nop -/* 203A8 80044FA8 2405000A */ addiu $a1, $zero, 0xa -.L80044FAC: -/* 203AC 80044FAC 8E04002C */ lw $a0, 0x2c($s0) -/* 203B0 80044FB0 0C0B0CF8 */ jal start_script -/* 203B4 80044FB4 0000302D */ daddu $a2, $zero, $zero -/* 203B8 80044FB8 0040182D */ daddu $v1, $v0, $zero -/* 203BC 80044FBC AE030044 */ sw $v1, 0x44($s0) -/* 203C0 80044FC0 8C640144 */ lw $a0, 0x144($v1) -/* 203C4 80044FC4 AE04005C */ sw $a0, 0x5c($s0) -/* 203C8 80044FC8 AC700148 */ sw $s0, 0x148($v1) -/* 203CC 80044FCC AC71014C */ sw $s1, 0x14c($v1) -/* 203D0 80044FD0 A0720004 */ sb $s2, 4($v1) -/* 203D4 80044FD4 8FBF001C */ lw $ra, 0x1c($sp) -/* 203D8 80044FD8 8FB20018 */ lw $s2, 0x18($sp) -/* 203DC 80044FDC 8FB10014 */ lw $s1, 0x14($sp) -/* 203E0 80044FE0 8FB00010 */ lw $s0, 0x10($sp) -/* 203E4 80044FE4 24020002 */ addiu $v0, $zero, 2 -/* 203E8 80044FE8 03E00008 */ jr $ra -/* 203EC 80044FEC 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_1f580_len_1940/SetEncounterStatusFlags.s b/asm/nonmatchings/code_1f580_len_1940/SetEncounterStatusFlags.s deleted file mode 100644 index 30b87c9b32..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/SetEncounterStatusFlags.s +++ /dev/null @@ -1,34 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel SetEncounterStatusFlags -/* 1F580 80044180 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 1F584 80044184 AFB10014 */ sw $s1, 0x14($sp) -/* 1F588 80044188 3C11800B */ lui $s1, %hi(gCurrentEncounter) -/* 1F58C 8004418C 26310F10 */ addiu $s1, $s1, %lo(gCurrentEncounter) -/* 1F590 80044190 AFBF001C */ sw $ra, 0x1c($sp) -/* 1F594 80044194 AFB20018 */ sw $s2, 0x18($sp) -/* 1F598 80044198 AFB00010 */ sw $s0, 0x10($sp) -/* 1F59C 8004419C 8C82000C */ lw $v0, 0xc($a0) -/* 1F5A0 800441A0 8C450004 */ lw $a1, 4($v0) -/* 1F5A4 800441A4 8C500000 */ lw $s0, ($v0) -/* 1F5A8 800441A8 0C0B1EAF */ jal get_variable -/* 1F5AC 800441AC 0220902D */ daddu $s2, $s1, $zero -/* 1F5B0 800441B0 10400005 */ beqz $v0, .L800441C8 -/* 1F5B4 800441B4 00101827 */ nor $v1, $zero, $s0 -/* 1F5B8 800441B8 8E220000 */ lw $v0, ($s1) -/* 1F5BC 800441BC 00501025 */ or $v0, $v0, $s0 -/* 1F5C0 800441C0 08011075 */ j .L800441D4 -/* 1F5C4 800441C4 AE220000 */ sw $v0, ($s1) -.L800441C8: -/* 1F5C8 800441C8 8E420000 */ lw $v0, ($s2) -/* 1F5CC 800441CC 00431024 */ and $v0, $v0, $v1 -/* 1F5D0 800441D0 AE420000 */ sw $v0, ($s2) -.L800441D4: -/* 1F5D4 800441D4 8FBF001C */ lw $ra, 0x1c($sp) -/* 1F5D8 800441D8 8FB20018 */ lw $s2, 0x18($sp) -/* 1F5DC 800441DC 8FB10014 */ lw $s1, 0x14($sp) -/* 1F5E0 800441E0 8FB00010 */ lw $s0, 0x10($sp) -/* 1F5E4 800441E4 24020002 */ addiu $v0, $zero, 2 -/* 1F5E8 800441E8 03E00008 */ jr $ra -/* 1F5EC 800441EC 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_1f580_len_1940/SetEnemyFlagBits.s b/asm/nonmatchings/code_1f580_len_1940/SetEnemyFlagBits.s deleted file mode 100644 index 0091c74ea5..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/SetEnemyFlagBits.s +++ /dev/null @@ -1,48 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel SetEnemyFlagBits -/* 20A88 80045688 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 20A8C 8004568C AFB10014 */ sw $s1, 0x14($sp) -/* 20A90 80045690 0080882D */ daddu $s1, $a0, $zero -/* 20A94 80045694 AFBF0020 */ sw $ra, 0x20($sp) -/* 20A98 80045698 AFB3001C */ sw $s3, 0x1c($sp) -/* 20A9C 8004569C AFB20018 */ sw $s2, 0x18($sp) -/* 20AA0 800456A0 AFB00010 */ sw $s0, 0x10($sp) -/* 20AA4 800456A4 8E30000C */ lw $s0, 0xc($s1) -/* 20AA8 800456A8 8E330148 */ lw $s3, 0x148($s1) -/* 20AAC 800456AC 8E050000 */ lw $a1, ($s0) -/* 20AB0 800456B0 0C0B1EAF */ jal get_variable -/* 20AB4 800456B4 26100004 */ addiu $s0, $s0, 4 -/* 20AB8 800456B8 0040902D */ daddu $s2, $v0, $zero -/* 20ABC 800456BC 8E050004 */ lw $a1, 4($s0) -/* 20AC0 800456C0 8E100000 */ lw $s0, ($s0) -/* 20AC4 800456C4 0C0B1EAF */ jal get_variable -/* 20AC8 800456C8 0220202D */ daddu $a0, $s1, $zero -/* 20ACC 800456CC 0040882D */ daddu $s1, $v0, $zero -/* 20AD0 800456D0 2402FFFF */ addiu $v0, $zero, -1 -/* 20AD4 800456D4 16420002 */ bne $s2, $v0, .L800456E0 -/* 20AD8 800456D8 00000000 */ nop -/* 20ADC 800456DC 86720008 */ lh $s2, 8($s3) -.L800456E0: -/* 20AE0 800456E0 0C00FB3A */ jal get_enemy -/* 20AE4 800456E4 0240202D */ daddu $a0, $s2, $zero -/* 20AE8 800456E8 12200004 */ beqz $s1, .L800456FC -/* 20AEC 800456EC 0040982D */ daddu $s3, $v0, $zero -/* 20AF0 800456F0 8E620000 */ lw $v0, ($s3) -/* 20AF4 800456F4 080115C2 */ j .L80045708 -/* 20AF8 800456F8 00501025 */ or $v0, $v0, $s0 -.L800456FC: -/* 20AFC 800456FC 8E620000 */ lw $v0, ($s3) -/* 20B00 80045700 00101827 */ nor $v1, $zero, $s0 -/* 20B04 80045704 00431024 */ and $v0, $v0, $v1 -.L80045708: -/* 20B08 80045708 AE620000 */ sw $v0, ($s3) -/* 20B0C 8004570C 8FBF0020 */ lw $ra, 0x20($sp) -/* 20B10 80045710 8FB3001C */ lw $s3, 0x1c($sp) -/* 20B14 80045714 8FB20018 */ lw $s2, 0x18($sp) -/* 20B18 80045718 8FB10014 */ lw $s1, 0x14($sp) -/* 20B1C 8004571C 8FB00010 */ lw $s0, 0x10($sp) -/* 20B20 80045720 24020002 */ addiu $v0, $zero, 2 -/* 20B24 80045724 03E00008 */ jr $ra -/* 20B28 80045728 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/SetNpcVar.s b/asm/nonmatchings/code_1f580_len_1940/SetNpcVar.s deleted file mode 100644 index c6aa803629..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/SetNpcVar.s +++ /dev/null @@ -1,44 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel SetNpcVar -/* 20720 80045320 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 20724 80045324 AFB10014 */ sw $s1, 0x14($sp) -/* 20728 80045328 0080882D */ daddu $s1, $a0, $zero -/* 2072C 8004532C AFBF0020 */ sw $ra, 0x20($sp) -/* 20730 80045330 AFB3001C */ sw $s3, 0x1c($sp) -/* 20734 80045334 AFB20018 */ sw $s2, 0x18($sp) -/* 20738 80045338 AFB00010 */ sw $s0, 0x10($sp) -/* 2073C 8004533C 8E30000C */ lw $s0, 0xc($s1) -/* 20740 80045340 8E330148 */ lw $s3, 0x148($s1) -/* 20744 80045344 8E050000 */ lw $a1, ($s0) -/* 20748 80045348 0C0B1EAF */ jal get_variable -/* 2074C 8004534C 26100004 */ addiu $s0, $s0, 4 -/* 20750 80045350 0040902D */ daddu $s2, $v0, $zero -/* 20754 80045354 8E050000 */ lw $a1, ($s0) -/* 20758 80045358 26100004 */ addiu $s0, $s0, 4 -/* 2075C 8004535C 0C0B1EAF */ jal get_variable -/* 20760 80045360 0220202D */ daddu $a0, $s1, $zero -/* 20764 80045364 0220202D */ daddu $a0, $s1, $zero -/* 20768 80045368 8E050000 */ lw $a1, ($s0) -/* 2076C 8004536C 0C0B1EAF */ jal get_variable -/* 20770 80045370 0040802D */ daddu $s0, $v0, $zero -/* 20774 80045374 0040882D */ daddu $s1, $v0, $zero -/* 20778 80045378 2402FFFF */ addiu $v0, $zero, -1 -/* 2077C 8004537C 16420002 */ bne $s2, $v0, .L80045388 -/* 20780 80045380 00000000 */ nop -/* 20784 80045384 86720008 */ lh $s2, 8($s3) -.L80045388: -/* 20788 80045388 0C00FB3A */ jal get_enemy -/* 2078C 8004538C 0240202D */ daddu $a0, $s2, $zero -/* 20790 80045390 00101880 */ sll $v1, $s0, 2 -/* 20794 80045394 00431021 */ addu $v0, $v0, $v1 -/* 20798 80045398 AC51006C */ sw $s1, 0x6c($v0) -/* 2079C 8004539C 8FBF0020 */ lw $ra, 0x20($sp) -/* 207A0 800453A0 8FB3001C */ lw $s3, 0x1c($sp) -/* 207A4 800453A4 8FB20018 */ lw $s2, 0x18($sp) -/* 207A8 800453A8 8FB10014 */ lw $s1, 0x14($sp) -/* 207AC 800453AC 8FB00010 */ lw $s0, 0x10($sp) -/* 207B0 800453B0 24020002 */ addiu $v0, $zero, 2 -/* 207B4 800453B4 03E00008 */ jr $ra -/* 207B8 800453B8 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/SetSelfRotation.s b/asm/nonmatchings/code_1f580_len_1940/SetSelfRotation.s deleted file mode 100644 index f3f8b86db2..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/SetSelfRotation.s +++ /dev/null @@ -1,48 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel SetSelfRotation -/* 2085C 8004545C 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 20860 80045460 AFB10014 */ sw $s1, 0x14($sp) -/* 20864 80045464 0080882D */ daddu $s1, $a0, $zero -/* 20868 80045468 AFBF0020 */ sw $ra, 0x20($sp) -/* 2086C 8004546C AFB3001C */ sw $s3, 0x1c($sp) -/* 20870 80045470 AFB20018 */ sw $s2, 0x18($sp) -/* 20874 80045474 AFB00010 */ sw $s0, 0x10($sp) -/* 20878 80045478 8E24014C */ lw $a0, 0x14c($s1) -/* 2087C 8004547C 0C00EABB */ jal get_npc_unsafe -/* 20880 80045480 8E30000C */ lw $s0, 0xc($s1) -/* 20884 80045484 8E050000 */ lw $a1, ($s0) -/* 20888 80045488 26100004 */ addiu $s0, $s0, 4 -/* 2088C 8004548C 0220202D */ daddu $a0, $s1, $zero -/* 20890 80045490 0C0B1EAF */ jal get_variable -/* 20894 80045494 0040902D */ daddu $s2, $v0, $zero -/* 20898 80045498 8E050000 */ lw $a1, ($s0) -/* 2089C 8004549C 26100004 */ addiu $s0, $s0, 4 -/* 208A0 800454A0 0220202D */ daddu $a0, $s1, $zero -/* 208A4 800454A4 0C0B1EAF */ jal get_variable -/* 208A8 800454A8 0040982D */ daddu $s3, $v0, $zero -/* 208AC 800454AC 0220202D */ daddu $a0, $s1, $zero -/* 208B0 800454B0 8E050000 */ lw $a1, ($s0) -/* 208B4 800454B4 0C0B1EAF */ jal get_variable -/* 208B8 800454B8 0040802D */ daddu $s0, $v0, $zero -/* 208BC 800454BC 44821000 */ mtc1 $v0, $f2 -/* 208C0 800454C0 00000000 */ nop -/* 208C4 800454C4 468010A0 */ cvt.s.w $f2, $f2 -/* 208C8 800454C8 44930000 */ mtc1 $s3, $f0 -/* 208CC 800454CC 00000000 */ nop -/* 208D0 800454D0 46800020 */ cvt.s.w $f0, $f0 -/* 208D4 800454D4 E6400044 */ swc1 $f0, 0x44($s2) -/* 208D8 800454D8 44900000 */ mtc1 $s0, $f0 -/* 208DC 800454DC 00000000 */ nop -/* 208E0 800454E0 46800020 */ cvt.s.w $f0, $f0 -/* 208E4 800454E4 E6400048 */ swc1 $f0, 0x48($s2) -/* 208E8 800454E8 E642004C */ swc1 $f2, 0x4c($s2) -/* 208EC 800454EC 8FBF0020 */ lw $ra, 0x20($sp) -/* 208F0 800454F0 8FB3001C */ lw $s3, 0x1c($sp) -/* 208F4 800454F4 8FB20018 */ lw $s2, 0x18($sp) -/* 208F8 800454F8 8FB10014 */ lw $s1, 0x14($sp) -/* 208FC 800454FC 8FB00010 */ lw $s0, 0x10($sp) -/* 20900 80045500 24020002 */ addiu $v0, $zero, 2 -/* 20904 80045504 03E00008 */ jr $ra -/* 20908 80045508 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/SetSelfVar.s b/asm/nonmatchings/code_1f580_len_1940/SetSelfVar.s deleted file mode 100644 index 66f70060b7..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/SetSelfVar.s +++ /dev/null @@ -1,29 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel SetSelfVar -/* 2065C 8004525C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 20660 80045260 AFB00010 */ sw $s0, 0x10($sp) -/* 20664 80045264 0080802D */ daddu $s0, $a0, $zero -/* 20668 80045268 AFBF001C */ sw $ra, 0x1c($sp) -/* 2066C 8004526C AFB20018 */ sw $s2, 0x18($sp) -/* 20670 80045270 AFB10014 */ sw $s1, 0x14($sp) -/* 20674 80045274 8E11000C */ lw $s1, 0xc($s0) -/* 20678 80045278 8E120148 */ lw $s2, 0x148($s0) -/* 2067C 8004527C 8E250000 */ lw $a1, ($s1) -/* 20680 80045280 0C0B1EAF */ jal get_variable -/* 20684 80045284 26310004 */ addiu $s1, $s1, 4 -/* 20688 80045288 0200202D */ daddu $a0, $s0, $zero -/* 2068C 8004528C 8E250000 */ lw $a1, ($s1) -/* 20690 80045290 0C0B1EAF */ jal get_variable -/* 20694 80045294 0040802D */ daddu $s0, $v0, $zero -/* 20698 80045298 00108080 */ sll $s0, $s0, 2 -/* 2069C 8004529C 02509021 */ addu $s2, $s2, $s0 -/* 206A0 800452A0 AE42006C */ sw $v0, 0x6c($s2) -/* 206A4 800452A4 8FBF001C */ lw $ra, 0x1c($sp) -/* 206A8 800452A8 8FB20018 */ lw $s2, 0x18($sp) -/* 206AC 800452AC 8FB10014 */ lw $s1, 0x14($sp) -/* 206B0 800452B0 8FB00010 */ lw $s0, 0x10($sp) -/* 206B4 800452B4 24020002 */ addiu $v0, $zero, 2 -/* 206B8 800452B8 03E00008 */ jr $ra -/* 206BC 800452BC 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_1f580_len_1940/func_80045580.s b/asm/nonmatchings/code_1f580_len_1940/func_80045580.s deleted file mode 100644 index a87321ce16..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/func_80045580.s +++ /dev/null @@ -1,41 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80045580 -/* 20980 80045580 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 20984 80045584 AFB00010 */ sw $s0, 0x10($sp) -/* 20988 80045588 0080802D */ daddu $s0, $a0, $zero -/* 2098C 8004558C AFBF001C */ sw $ra, 0x1c($sp) -/* 20990 80045590 AFB20018 */ sw $s2, 0x18($sp) -/* 20994 80045594 AFB10014 */ sw $s1, 0x14($sp) -/* 20998 80045598 8E04014C */ lw $a0, 0x14c($s0) -/* 2099C 8004559C 8E12000C */ lw $s2, 0xc($s0) -/* 209A0 800455A0 0C00EABB */ jal get_npc_unsafe -/* 209A4 800455A4 8E110148 */ lw $s1, 0x148($s0) -/* 209A8 800455A8 0200202D */ daddu $a0, $s0, $zero -/* 209AC 800455AC 8E450000 */ lw $a1, ($s2) -/* 209B0 800455B0 0C0B1EAF */ jal get_variable -/* 209B4 800455B4 0040802D */ daddu $s0, $v0, $zero -/* 209B8 800455B8 A2220007 */ sb $v0, 7($s1) -/* 209BC 800455BC C6000038 */ lwc1 $f0, 0x38($s0) -/* 209C0 800455C0 4600008D */ trunc.w.s $f2, $f0 -/* 209C4 800455C4 44021000 */ mfc1 $v0, $f2 -/* 209C8 800455C8 00000000 */ nop -/* 209CC 800455CC A6220010 */ sh $v0, 0x10($s1) -/* 209D0 800455D0 C600003C */ lwc1 $f0, 0x3c($s0) -/* 209D4 800455D4 4600008D */ trunc.w.s $f2, $f0 -/* 209D8 800455D8 44021000 */ mfc1 $v0, $f2 -/* 209DC 800455DC 00000000 */ nop -/* 209E0 800455E0 A6220012 */ sh $v0, 0x12($s1) -/* 209E4 800455E4 C6000040 */ lwc1 $f0, 0x40($s0) -/* 209E8 800455E8 4600008D */ trunc.w.s $f2, $f0 -/* 209EC 800455EC 44031000 */ mfc1 $v1, $f2 -/* 209F0 800455F0 00000000 */ nop -/* 209F4 800455F4 A6230014 */ sh $v1, 0x14($s1) -/* 209F8 800455F8 8FBF001C */ lw $ra, 0x1c($sp) -/* 209FC 800455FC 8FB20018 */ lw $s2, 0x18($sp) -/* 20A00 80045600 8FB10014 */ lw $s1, 0x14($sp) -/* 20A04 80045604 8FB00010 */ lw $s0, 0x10($sp) -/* 20A08 80045608 24020002 */ addiu $v0, $zero, 2 -/* 20A0C 8004560C 03E00008 */ jr $ra -/* 20A10 80045610 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_1f580_len_1940/func_80045838.s b/asm/nonmatchings/code_1f580_len_1940/func_80045838.s deleted file mode 100644 index 555f6d14da..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/func_80045838.s +++ /dev/null @@ -1,42 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80045838 -/* 20C38 80045838 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 20C3C 8004583C AFB10014 */ sw $s1, 0x14($sp) -/* 20C40 80045840 0080882D */ daddu $s1, $a0, $zero -/* 20C44 80045844 AFBF0020 */ sw $ra, 0x20($sp) -/* 20C48 80045848 AFB3001C */ sw $s3, 0x1c($sp) -/* 20C4C 8004584C AFB20018 */ sw $s2, 0x18($sp) -/* 20C50 80045850 AFB00010 */ sw $s0, 0x10($sp) -/* 20C54 80045854 8E30000C */ lw $s0, 0xc($s1) -/* 20C58 80045858 8E050000 */ lw $a1, ($s0) -/* 20C5C 8004585C 0C0B1EAF */ jal get_variable -/* 20C60 80045860 26100004 */ addiu $s0, $s0, 4 -/* 20C64 80045864 8E050000 */ lw $a1, ($s0) -/* 20C68 80045868 26100004 */ addiu $s0, $s0, 4 -/* 20C6C 8004586C 0220202D */ daddu $a0, $s1, $zero -/* 20C70 80045870 0C0B1EAF */ jal get_variable -/* 20C74 80045874 0040902D */ daddu $s2, $v0, $zero -/* 20C78 80045878 0220202D */ daddu $a0, $s1, $zero -/* 20C7C 8004587C 8E050000 */ lw $a1, ($s0) -/* 20C80 80045880 0C0B1EAF */ jal get_variable -/* 20C84 80045884 0040982D */ daddu $s3, $v0, $zero -/* 20C88 80045888 0220202D */ daddu $a0, $s1, $zero -/* 20C8C 8004588C 0240282D */ daddu $a1, $s2, $zero -/* 20C90 80045890 0C0B36B0 */ jal resolve_npc -/* 20C94 80045894 0040802D */ daddu $s0, $v0, $zero -/* 20C98 80045898 10400004 */ beqz $v0, .L800458AC -/* 20C9C 8004589C 0040202D */ daddu $a0, $v0, $zero -/* 20CA0 800458A0 0260282D */ daddu $a1, $s3, $zero -/* 20CA4 800458A4 0C012530 */ jal func_800494C0 -/* 20CA8 800458A8 0200302D */ daddu $a2, $s0, $zero -.L800458AC: -/* 20CAC 800458AC 24020002 */ addiu $v0, $zero, 2 -/* 20CB0 800458B0 8FBF0020 */ lw $ra, 0x20($sp) -/* 20CB4 800458B4 8FB3001C */ lw $s3, 0x1c($sp) -/* 20CB8 800458B8 8FB20018 */ lw $s2, 0x18($sp) -/* 20CBC 800458BC 8FB10014 */ lw $s1, 0x14($sp) -/* 20CC0 800458C0 8FB00010 */ lw $s0, 0x10($sp) -/* 20CC4 800458C4 03E00008 */ jr $ra -/* 20CC8 800458C8 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_1f580_len_1940/func_80045A58.s b/asm/nonmatchings/code_1f580_len_1940/func_80045A58.s deleted file mode 100644 index aeb9b57cce..0000000000 --- a/asm/nonmatchings/code_1f580_len_1940/func_80045A58.s +++ /dev/null @@ -1,30 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80045A58 -/* 20E58 80045A58 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 20E5C 80045A5C AFB10014 */ sw $s1, 0x14($sp) -/* 20E60 80045A60 0080882D */ daddu $s1, $a0, $zero -/* 20E64 80045A64 AFBF0018 */ sw $ra, 0x18($sp) -/* 20E68 80045A68 AFB00010 */ sw $s0, 0x10($sp) -/* 20E6C 80045A6C 8E30000C */ lw $s0, 0xc($s1) -/* 20E70 80045A70 8E050000 */ lw $a1, ($s0) -/* 20E74 80045A74 0C0B1EAF */ jal get_variable -/* 20E78 80045A78 26100004 */ addiu $s0, $s0, 4 -/* 20E7C 80045A7C 0220202D */ daddu $a0, $s1, $zero -/* 20E80 80045A80 8E050000 */ lw $a1, ($s0) -/* 20E84 80045A84 0C0B1EAF */ jal get_variable -/* 20E88 80045A88 0040802D */ daddu $s0, $v0, $zero -/* 20E8C 80045A8C 0200202D */ daddu $a0, $s0, $zero -/* 20E90 80045A90 0C00FB3A */ jal get_enemy -/* 20E94 80045A94 0040802D */ daddu $s0, $v0, $zero -/* 20E98 80045A98 AC5000D8 */ sw $s0, 0xd8($v0) -/* 20E9C 80045A9C 8FBF0018 */ lw $ra, 0x18($sp) -/* 20EA0 80045AA0 8FB10014 */ lw $s1, 0x14($sp) -/* 20EA4 80045AA4 8FB00010 */ lw $s0, 0x10($sp) -/* 20EA8 80045AA8 24020002 */ addiu $v0, $zero, 2 -/* 20EAC 80045AAC 03E00008 */ jr $ra -/* 20EB0 80045AB0 27BD0020 */ addiu $sp, $sp, 0x20 -/* 20EB4 80045AB4 00000000 */ nop -/* 20EB8 80045AB8 00000000 */ nop -/* 20EBC 80045ABC 00000000 */ nop diff --git a/asm/nonmatchings/code_20ec0_len_5040/is_point_within_region.s b/asm/nonmatchings/code_20ec0_len_5040/is_point_within_region.s deleted file mode 100644 index f87064c5d0..0000000000 --- a/asm/nonmatchings/code_20ec0_len_5040/is_point_within_region.s +++ /dev/null @@ -1,64 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel is_point_within_region -/* 243D4 80048FD4 44856000 */ mtc1 $a1, $f12 -/* 243D8 80048FD8 27BDFFC8 */ addiu $sp, $sp, -0x38 -/* 243DC 80048FDC F7B60020 */ sdc1 $f22, 0x20($sp) -/* 243E0 80048FE0 4486B000 */ mtc1 $a2, $f22 -/* 243E4 80048FE4 44870000 */ mtc1 $a3, $f0 -/* 243E8 80048FE8 F7B80028 */ sdc1 $f24, 0x28($sp) -/* 243EC 80048FEC C7B80048 */ lwc1 $f24, 0x48($sp) -/* 243F0 80048FF0 F7BA0030 */ sdc1 $f26, 0x30($sp) -/* 243F4 80048FF4 C7BA004C */ lwc1 $f26, 0x4c($sp) -/* 243F8 80048FF8 AFBF0010 */ sw $ra, 0x10($sp) -/* 243FC 80048FFC F7B40018 */ sdc1 $f20, 0x18($sp) -/* 24400 80049000 10800005 */ beqz $a0, .L80049018 -/* 24404 80049004 24020001 */ addiu $v0, $zero, 1 -/* 24408 80049008 1082000D */ beq $a0, $v0, .L80049040 -/* 2440C 8004900C 0000102D */ daddu $v0, $zero, $zero -/* 24410 80049010 08012426 */ j .L80049098 -/* 24414 80049014 00000000 */ nop -.L80049018: -/* 24418 80049018 44060000 */ mfc1 $a2, $f0 -/* 2441C 8004901C 4407C000 */ mfc1 $a3, $f24 -/* 24420 80049020 0C00A7B5 */ jal dist2D -/* 24424 80049024 4600B386 */ mov.s $f14, $f22 -/* 24428 80049028 4600D03C */ c.lt.s $f26, $f0 -/* 2442C 8004902C 00000000 */ nop -/* 24430 80049030 45010019 */ bc1t .L80049098 -/* 24434 80049034 24020001 */ addiu $v0, $zero, 1 -/* 24438 80049038 08012426 */ j .L80049098 -/* 2443C 8004903C 0000102D */ daddu $v0, $zero, $zero -.L80049040: -/* 24440 80049040 4480A000 */ mtc1 $zero, $f20 -/* 24444 80049044 44060000 */ mfc1 $a2, $f0 -/* 24448 80049048 4407A000 */ mfc1 $a3, $f20 -/* 2444C 8004904C 0C00A7B5 */ jal dist2D -/* 24450 80049050 4600A386 */ mov.s $f14, $f20 -/* 24454 80049054 4600A306 */ mov.s $f12, $f20 -/* 24458 80049058 4600B386 */ mov.s $f14, $f22 -/* 2445C 8004905C 44066000 */ mfc1 $a2, $f12 -/* 24460 80049060 4407C000 */ mfc1 $a3, $f24 -/* 24464 80049064 0C00A7B5 */ jal dist2D -/* 24468 80049068 46000506 */ mov.s $f20, $f0 -/* 2446C 8004906C 0000102D */ daddu $v0, $zero, $zero -/* 24470 80049070 4614D03C */ c.lt.s $f26, $f20 -/* 24474 80049074 00000000 */ nop -/* 24478 80049078 45010006 */ bc1t .L80049094 -/* 2447C 8004907C 46000086 */ mov.s $f2, $f0 -/* 24480 80049080 C7A00050 */ lwc1 $f0, 0x50($sp) -/* 24484 80049084 4602003C */ c.lt.s $f0, $f2 -/* 24488 80049088 00000000 */ nop -/* 2448C 8004908C 45000002 */ bc1f .L80049098 -/* 24490 80049090 00000000 */ nop -.L80049094: -/* 24494 80049094 24020001 */ addiu $v0, $zero, 1 -.L80049098: -/* 24498 80049098 8FBF0010 */ lw $ra, 0x10($sp) -/* 2449C 8004909C D7BA0030 */ ldc1 $f26, 0x30($sp) -/* 244A0 800490A0 D7B80028 */ ldc1 $f24, 0x28($sp) -/* 244A4 800490A4 D7B60020 */ ldc1 $f22, 0x20($sp) -/* 244A8 800490A8 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 244AC 800490AC 03E00008 */ jr $ra -/* 244B0 800490B0 27BD0038 */ addiu $sp, $sp, 0x38 diff --git a/asm/nonmatchings/code_6240_len_c00/func_8002B608.s b/asm/nonmatchings/code_6240_len_c00/func_8002B608.s deleted file mode 100644 index f262935683..0000000000 --- a/asm/nonmatchings/code_6240_len_c00/func_8002B608.s +++ /dev/null @@ -1,14 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8002B608 -/* 6A08 8002B608 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 6A0C 8002B60C 3C038007 */ lui $v1, %hi(gGameStatusPtr) -/* 6A10 8002B610 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1) -/* 6A14 8002B614 2402000A */ addiu $v0, $zero, 0xa -/* 6A18 8002B618 AFBF0010 */ sw $ra, 0x10($sp) -/* 6A1C 8002B61C 0C00AD8C */ jal fio_serialize_state -/* 6A20 8002B620 A462008E */ sh $v0, 0x8e($v1) -/* 6A24 8002B624 8FBF0010 */ lw $ra, 0x10($sp) -/* 6A28 8002B628 03E00008 */ jr $ra -/* 6A2C 8002B62C 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_7E3700/CheckActionState.s b/asm/nonmatchings/code_7E3700/CheckActionState.s deleted file mode 100644 index d959231a52..0000000000 --- a/asm/nonmatchings/code_7E3700/CheckActionState.s +++ /dev/null @@ -1,29 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel CheckActionState -/* 7E405C 802831DC 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 7E4060 802831E0 AFB00010 */ sw $s0, 0x10($sp) -/* 7E4064 802831E4 0080802D */ daddu $s0, $a0, $zero -/* 7E4068 802831E8 AFBF0018 */ sw $ra, 0x18($sp) -/* 7E406C 802831EC AFB10014 */ sw $s1, 0x14($sp) -/* 7E4070 802831F0 8E02000C */ lw $v0, 0xc($s0) -/* 7E4074 802831F4 8C450004 */ lw $a1, 4($v0) -/* 7E4078 802831F8 0C0B210B */ jal get_float_variable -/* 7E407C 802831FC 8C510000 */ lw $s1, ($v0) -/* 7E4080 80283200 0200202D */ daddu $a0, $s0, $zero -/* 7E4084 80283204 0220282D */ daddu $a1, $s1, $zero -/* 7E4088 80283208 3C068011 */ lui $a2, %hi(gPlayerActionState) -/* 7E408C 8028320C 80C6F07C */ lb $a2, %lo(gPlayerActionState)($a2) -/* 7E4090 80283210 4600008D */ trunc.w.s $f2, $f0 -/* 7E4094 80283214 44021000 */ mfc1 $v0, $f2 -/* 7E4098 80283218 00000000 */ nop -/* 7E409C 8028321C 00C23026 */ xor $a2, $a2, $v0 -/* 7E40A0 80283220 0C0B2026 */ jal set_variable -/* 7E40A4 80283224 2CC60001 */ sltiu $a2, $a2, 1 -/* 7E40A8 80283228 8FBF0018 */ lw $ra, 0x18($sp) -/* 7E40AC 8028322C 8FB10014 */ lw $s1, 0x14($sp) -/* 7E40B0 80283230 8FB00010 */ lw $s0, 0x10($sp) -/* 7E40B4 80283234 24020002 */ addiu $v0, $zero, 2 -/* 7E40B8 80283238 03E00008 */ jr $ra -/* 7E40BC 8028323C 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_7bb60_len_41b0/func_800E26B0.s b/asm/nonmatchings/code_7bb60_len_41b0/func_800E26B0.s deleted file mode 100644 index 51c2b806ed..0000000000 --- a/asm/nonmatchings/code_7bb60_len_41b0/func_800E26B0.s +++ /dev/null @@ -1,9 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_800E26B0 -/* 7BB60 800E26B0 3C028011 */ lui $v0, %hi(gPlayerStatus) -/* 7BB64 800E26B4 2442EFC8 */ addiu $v0, $v0, %lo(gPlayerStatus) -/* 7BB68 800E26B8 C440002C */ lwc1 $f0, 0x2c($v0) -/* 7BB6C 800E26BC 03E00008 */ jr $ra -/* 7BB70 800E26C0 E4400050 */ swc1 $f0, 0x50($v0) diff --git a/asm/nonmatchings/code_7bb60_len_41b0/func_800E34D8.s b/asm/nonmatchings/code_7bb60_len_41b0/func_800E34D8.s deleted file mode 100644 index 63f722f47f..0000000000 --- a/asm/nonmatchings/code_7bb60_len_41b0/func_800E34D8.s +++ /dev/null @@ -1,20 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_800E34D8 -/* 7C988 800E34D8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 7C98C 800E34DC AFBF0010 */ sw $ra, 0x10($sp) -/* 7C990 800E34E0 0C038D12 */ jal integrate_gravity -/* 7C994 800E34E4 F7B40018 */ sdc1 $f20, 0x18($sp) -/* 7C998 800E34E8 0C038082 */ jal func_800E0208 -/* 7C99C 800E34EC 46000506 */ mov.s $f20, $f0 -/* 7C9A0 800E34F0 10400004 */ beqz $v0, .L800E3504 -/* 7C9A4 800E34F4 4600A006 */ mov.s $f0, $f20 -/* 7C9A8 800E34F8 4480A000 */ mtc1 $zero, $f20 -/* 7C9AC 800E34FC 00000000 */ nop -/* 7C9B0 800E3500 4600A006 */ mov.s $f0, $f20 -.L800E3504: -/* 7C9B4 800E3504 8FBF0010 */ lw $ra, 0x10($sp) -/* 7C9B8 800E3508 D7B40018 */ ldc1 $f20, 0x18($sp) -/* 7C9BC 800E350C 03E00008 */ jr $ra -/* 7C9C0 800E3510 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_7bb60_len_41b0/get_current_partner_id.s b/asm/nonmatchings/code_7bb60_len_41b0/get_current_partner_id.s deleted file mode 100644 index efde165eb9..0000000000 --- a/asm/nonmatchings/code_7bb60_len_41b0/get_current_partner_id.s +++ /dev/null @@ -1,8 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel get_current_partner_id -/* 7E538 800E5088 3C028011 */ lui $v0, 0x8011 -/* 7E53C 800E508C 8042F2A2 */ lb $v0, -0xd5e($v0) -/* 7E540 800E5090 03E00008 */ jr $ra -/* 7E544 800E5094 00000000 */ nop diff --git a/asm/nonmatchings/code_7bb60_len_41b0/integrate_gravity.s b/asm/nonmatchings/code_7bb60_len_41b0/integrate_gravity.s deleted file mode 100644 index 8ee933f2c9..0000000000 --- a/asm/nonmatchings/code_7bb60_len_41b0/integrate_gravity.s +++ /dev/null @@ -1,42 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel integrate_gravity -/* 7C8F8 800E3448 3C048011 */ lui $a0, %hi(gPlayerStatus) -/* 7C8FC 800E344C 2484EFC8 */ addiu $a0, $a0, %lo(gPlayerStatus) -/* 7C900 800E3450 8C820000 */ lw $v0, ($a0) -/* 7C904 800E3454 3C030004 */ lui $v1, 4 -/* 7C908 800E3458 00431024 */ and $v0, $v0, $v1 -/* 7C90C 800E345C 10400012 */ beqz $v0, .L800E34A8 -/* 7C910 800E3460 00000000 */ nop -/* 7C914 800E3464 C480007C */ lwc1 $f0, 0x7c($a0) -/* 7C918 800E3468 3C013FD9 */ lui $at, 0x3fd9 -/* 7C91C 800E346C 3421999A */ ori $at, $at, 0x999a -/* 7C920 800E3470 44812000 */ mtc1 $at, $f4 -/* 7C924 800E3474 C4860078 */ lwc1 $f6, 0x78($a0) -/* 7C928 800E3478 46040003 */ div.s $f0, $f0, $f4 -/* 7C92C 800E347C 46003180 */ add.s $f6, $f6, $f0 -/* 7C930 800E3480 C4820074 */ lwc1 $f2, 0x74($a0) -/* 7C934 800E3484 46043003 */ div.s $f0, $f6, $f4 -/* 7C938 800E3488 46001080 */ add.s $f2, $f2, $f0 -/* 7C93C 800E348C C4800070 */ lwc1 $f0, 0x70($a0) -/* 7C940 800E3490 46041103 */ div.s $f4, $f2, $f4 -/* 7C944 800E3494 46040000 */ add.s $f0, $f0, $f4 -/* 7C948 800E3498 E4860078 */ swc1 $f6, 0x78($a0) -/* 7C94C 800E349C E4820074 */ swc1 $f2, 0x74($a0) -/* 7C950 800E34A0 08038D34 */ j .L800E34D0 -/* 7C954 800E34A4 E4800070 */ swc1 $f0, 0x70($a0) -.L800E34A8: -/* 7C958 800E34A8 C4840078 */ lwc1 $f4, 0x78($a0) -/* 7C95C 800E34AC C480007C */ lwc1 $f0, 0x7c($a0) -/* 7C960 800E34B0 46002100 */ add.s $f4, $f4, $f0 -/* 7C964 800E34B4 C4800074 */ lwc1 $f0, 0x74($a0) -/* 7C968 800E34B8 46040000 */ add.s $f0, $f0, $f4 -/* 7C96C 800E34BC C4820070 */ lwc1 $f2, 0x70($a0) -/* 7C970 800E34C0 46001080 */ add.s $f2, $f2, $f0 -/* 7C974 800E34C4 E4840078 */ swc1 $f4, 0x78($a0) -/* 7C978 800E34C8 E4800074 */ swc1 $f0, 0x74($a0) -/* 7C97C 800E34CC E4820070 */ swc1 $f2, 0x70($a0) -.L800E34D0: -/* 7C980 800E34D0 03E00008 */ jr $ra -/* 7C984 800E34D4 C4800070 */ lwc1 $f0, 0x70($a0) diff --git a/asm/nonmatchings/code_7bb60_len_41b0/save_ground_pos.s b/asm/nonmatchings/code_7bb60_len_41b0/save_ground_pos.s deleted file mode 100644 index ac377d5c91..0000000000 --- a/asm/nonmatchings/code_7bb60_len_41b0/save_ground_pos.s +++ /dev/null @@ -1,20 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel save_ground_pos -/* 7E990 800E54E0 3C038011 */ lui $v1, %hi(gPlayerStatus) -/* 7E994 800E54E4 2463EFC8 */ addiu $v1, $v1, %lo(gPlayerStatus) -/* 7E998 800E54E8 C4600028 */ lwc1 $f0, 0x28($v1) -/* 7E99C 800E54EC C4620030 */ lwc1 $f2, 0x30($v1) -/* 7E9A0 800E54F0 4600010D */ trunc.w.s $f4, $f0 -/* 7E9A4 800E54F4 44022000 */ mfc1 $v0, $f4 -/* 7E9A8 800E54F8 C460002C */ lwc1 $f0, 0x2c($v1) -/* 7E9AC 800E54FC A4620016 */ sh $v0, 0x16($v1) -/* 7E9B0 800E5500 4600010D */ trunc.w.s $f4, $f0 -/* 7E9B4 800E5504 44022000 */ mfc1 $v0, $f4 -/* 7E9B8 800E5508 00000000 */ nop -/* 7E9BC 800E550C A4620018 */ sh $v0, 0x18($v1) -/* 7E9C0 800E5510 4600110D */ trunc.w.s $f4, $f2 -/* 7E9C4 800E5514 44022000 */ mfc1 $v0, $f4 -/* 7E9C8 800E5518 03E00008 */ jr $ra -/* 7E9CC 800E551C A462001A */ sh $v0, 0x1a($v1) diff --git a/asm/nonmatchings/code_7bb60_len_41b0/start_bounce_a.s b/asm/nonmatchings/code_7bb60_len_41b0/start_bounce_a.s deleted file mode 100644 index e5309869c7..0000000000 --- a/asm/nonmatchings/code_7bb60_len_41b0/start_bounce_a.s +++ /dev/null @@ -1,26 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel start_bounce_a -/* 7F4E4 800E6034 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 7F4E8 800E6038 AFBF0010 */ sw $ra, 0x10($sp) -/* 7F4EC 800E603C 0C039769 */ jal set_action_state -/* 7F4F0 800E6040 24040004 */ addiu $a0, $zero, 4 -/* 7F4F4 800E6044 3C014120 */ lui $at, 0x4120 -/* 7F4F8 800E6048 44810000 */ mtc1 $at, $f0 -/* 7F4FC 800E604C 3C01C000 */ lui $at, 0xc000 -/* 7F500 800E6050 44811000 */ mtc1 $at, $f2 -/* 7F504 800E6054 3C013F4C */ lui $at, 0x3f4c -/* 7F508 800E6058 3421CCCD */ ori $at, $at, 0xcccd -/* 7F50C 800E605C 44812000 */ mtc1 $at, $f4 -/* 7F510 800E6060 3C01BF40 */ lui $at, 0xbf40 -/* 7F514 800E6064 44813000 */ mtc1 $at, $f6 -/* 7F518 800E6068 3C028011 */ lui $v0, %hi(gPlayerStatus) -/* 7F51C 800E606C 2442EFC8 */ addiu $v0, $v0, %lo(gPlayerStatus) -/* 7F520 800E6070 E4400070 */ swc1 $f0, 0x70($v0) -/* 7F524 800E6074 E4420074 */ swc1 $f2, 0x74($v0) -/* 7F528 800E6078 E4440078 */ swc1 $f4, 0x78($v0) -/* 7F52C 800E607C E446007C */ swc1 $f6, 0x7c($v0) -/* 7F530 800E6080 8FBF0010 */ lw $ra, 0x10($sp) -/* 7F534 800E6084 03E00008 */ jr $ra -/* 7F538 800E6088 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_7bb60_len_41b0/start_bounce_b.s b/asm/nonmatchings/code_7bb60_len_41b0/start_bounce_b.s deleted file mode 100644 index ae0a712765..0000000000 --- a/asm/nonmatchings/code_7bb60_len_41b0/start_bounce_b.s +++ /dev/null @@ -1,25 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel start_bounce_b -/* 7F53C 800E608C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 7F540 800E6090 AFBF0010 */ sw $ra, 0x10($sp) -/* 7F544 800E6094 0C039769 */ jal set_action_state -/* 7F548 800E6098 24040004 */ addiu $a0, $zero, 4 -/* 7F54C 800E609C 3C048011 */ lui $a0, %hi(gPlayerStatus) -/* 7F550 800E60A0 2484EFC8 */ addiu $a0, $a0, %lo(gPlayerStatus) -/* 7F554 800E60A4 3C014100 */ lui $at, 0x4100 -/* 7F558 800E60A8 44810000 */ mtc1 $at, $f0 -/* 7F55C 800E60AC 3C01BF80 */ lui $at, 0xbf80 -/* 7F560 800E60B0 44811000 */ mtc1 $at, $f2 -/* 7F564 800E60B4 8C820000 */ lw $v0, ($a0) -/* 7F568 800E60B8 3C030080 */ lui $v1, 0x80 -/* 7F56C 800E60BC AC800078 */ sw $zero, 0x78($a0) -/* 7F570 800E60C0 AC80007C */ sw $zero, 0x7c($a0) -/* 7F574 800E60C4 00431025 */ or $v0, $v0, $v1 -/* 7F578 800E60C8 E4800070 */ swc1 $f0, 0x70($a0) -/* 7F57C 800E60CC E4820074 */ swc1 $f2, 0x74($a0) -/* 7F580 800E60D0 AC820000 */ sw $v0, ($a0) -/* 7F584 800E60D4 8FBF0010 */ lw $ra, 0x10($sp) -/* 7F588 800E60D8 03E00008 */ jr $ra -/* 7F58C 800E60DC 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_7bb60_len_41b0/start_falling.s b/asm/nonmatchings/code_7bb60_len_41b0/start_falling.s deleted file mode 100644 index 81cd6b58eb..0000000000 --- a/asm/nonmatchings/code_7bb60_len_41b0/start_falling.s +++ /dev/null @@ -1,29 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel start_falling -/* 7F480 800E5FD0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 7F484 800E5FD4 AFBF0010 */ sw $ra, 0x10($sp) -/* 7F488 800E5FD8 0C039769 */ jal set_action_state -/* 7F48C 800E5FDC 24040008 */ addiu $a0, $zero, 8 -/* 7F490 800E5FE0 3C013DEA */ lui $at, 0x3dea -/* 7F494 800E5FE4 3421161E */ ori $at, $at, 0x161e -/* 7F498 800E5FE8 44810000 */ mtc1 $at, $f0 -/* 7F49C 800E5FEC 3C01BE92 */ lui $at, 0xbe92 -/* 7F4A0 800E5FF0 3421FEC5 */ ori $at, $at, 0xfec5 -/* 7F4A4 800E5FF4 44811000 */ mtc1 $at, $f2 -/* 7F4A8 800E5FF8 3C01BE3A */ lui $at, 0xbe3a -/* 7F4AC 800E5FFC 3421ACDA */ ori $at, $at, 0xacda -/* 7F4B0 800E6000 44812000 */ mtc1 $at, $f4 -/* 7F4B4 800E6004 3C013C3C */ lui $at, 0x3c3c -/* 7F4B8 800E6008 3421BE62 */ ori $at, $at, 0xbe62 -/* 7F4BC 800E600C 44813000 */ mtc1 $at, $f6 -/* 7F4C0 800E6010 3C028011 */ lui $v0, %hi(gPlayerStatus) -/* 7F4C4 800E6014 2442EFC8 */ addiu $v0, $v0, %lo(gPlayerStatus) -/* 7F4C8 800E6018 E4400070 */ swc1 $f0, 0x70($v0) -/* 7F4CC 800E601C E4420074 */ swc1 $f2, 0x74($v0) -/* 7F4D0 800E6020 E4440078 */ swc1 $f4, 0x78($v0) -/* 7F4D4 800E6024 E446007C */ swc1 $f6, 0x7c($v0) -/* 7F4D8 800E6028 8FBF0010 */ lw $ra, 0x10($sp) -/* 7F4DC 800E602C 03E00008 */ jr $ra -/* 7F4E0 800E6030 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_7bb60_len_41b0/update_locomotion_state.s b/asm/nonmatchings/code_7bb60_len_41b0/update_locomotion_state.s deleted file mode 100644 index 10cf6835a2..0000000000 --- a/asm/nonmatchings/code_7bb60_len_41b0/update_locomotion_state.s +++ /dev/null @@ -1,31 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel update_locomotion_state -/* 7F418 800E5F68 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 7F41C 800E5F6C AFB00010 */ sw $s0, 0x10($sp) -/* 7F420 800E5F70 3C108011 */ lui $s0, %hi(gPlayerStatus) -/* 7F424 800E5F74 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus) -/* 7F428 800E5F78 AFBF0014 */ sw $ra, 0x14($sp) -/* 7F42C 800E5F7C 0C03A752 */ jal is_ability_active -/* 7F430 800E5F80 2404000B */ addiu $a0, $zero, 0xb -/* 7F434 800E5F84 1440000C */ bnez $v0, .L800E5FB8 -/* 7F438 800E5F88 24040001 */ addiu $a0, $zero, 1 -/* 7F43C 800E5F8C 8E0200E8 */ lw $v0, 0xe8($s0) -/* 7F440 800E5F90 00420018 */ mult $v0, $v0 -/* 7F444 800E5F94 00001812 */ mflo $v1 -/* 7F448 800E5F98 8E0200EC */ lw $v0, 0xec($s0) -/* 7F44C 800E5F9C 00000000 */ nop -/* 7F450 800E5FA0 00420018 */ mult $v0, $v0 -/* 7F454 800E5FA4 00003012 */ mflo $a2 -/* 7F458 800E5FA8 00661021 */ addu $v0, $v1, $a2 -/* 7F45C 800E5FAC 28420BD2 */ slti $v0, $v0, 0xbd2 -/* 7F460 800E5FB0 50400001 */ beql $v0, $zero, .L800E5FB8 -/* 7F464 800E5FB4 24040002 */ addiu $a0, $zero, 2 -.L800E5FB8: -/* 7F468 800E5FB8 0C039769 */ jal set_action_state -/* 7F46C 800E5FBC 00000000 */ nop -/* 7F470 800E5FC0 8FBF0014 */ lw $ra, 0x14($sp) -/* 7F474 800E5FC4 8FB00010 */ lw $s0, 0x10($sp) -/* 7F478 800E5FC8 03E00008 */ jr $ra -/* 7F47C 800E5FCC 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/EnableGroup.s b/asm/nonmatchings/code_ED510/EnableGroup.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/EnableGroup.s rename to asm/nonmatchings/code_ED510/EnableGroup.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/ModifyColliderFlags.s b/asm/nonmatchings/code_ED510/ModifyColliderFlags.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/ModifyColliderFlags.s rename to asm/nonmatchings/code_ED510/ModifyColliderFlags.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/PlaySoundAtCollider.s b/asm/nonmatchings/code_ED510/PlaySoundAtCollider.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/PlaySoundAtCollider.s rename to asm/nonmatchings/code_ED510/PlaySoundAtCollider.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/PlaySoundAtModel.s b/asm/nonmatchings/code_ED510/PlaySoundAtModel.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/PlaySoundAtModel.s rename to asm/nonmatchings/code_ED510/PlaySoundAtModel.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/ResetFromLava.s b/asm/nonmatchings/code_ED510/ResetFromLava.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/ResetFromLava.s rename to asm/nonmatchings/code_ED510/ResetFromLava.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/RotateGroup.s b/asm/nonmatchings/code_ED510/RotateGroup.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/RotateGroup.s rename to asm/nonmatchings/code_ED510/RotateGroup.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/RotateModel.s b/asm/nonmatchings/code_ED510/RotateModel.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/RotateModel.s rename to asm/nonmatchings/code_ED510/RotateModel.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/ScaleGroup.s b/asm/nonmatchings/code_ED510/ScaleGroup.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/ScaleGroup.s rename to asm/nonmatchings/code_ED510/ScaleGroup.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/ScaleModel.s b/asm/nonmatchings/code_ED510/ScaleModel.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/ScaleModel.s rename to asm/nonmatchings/code_ED510/ScaleModel.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/SetModelFlags.s b/asm/nonmatchings/code_ED510/SetModelFlags.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/SetModelFlags.s rename to asm/nonmatchings/code_ED510/SetModelFlags.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/SetTexPanOffset.s b/asm/nonmatchings/code_ED510/SetTexPanOffset.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/SetTexPanOffset.s rename to asm/nonmatchings/code_ED510/SetTexPanOffset.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/SetZoneEnabled.s b/asm/nonmatchings/code_ED510/SetZoneEnabled.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/SetZoneEnabled.s rename to asm/nonmatchings/code_ED510/SetZoneEnabled.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/TranslateGroup.s b/asm/nonmatchings/code_ED510/TranslateGroup.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/TranslateGroup.s rename to asm/nonmatchings/code_ED510/TranslateGroup.s diff --git a/asm/nonmatchings/code_ED510/TranslateModel.s b/asm/nonmatchings/code_ED510/TranslateModel.s new file mode 100644 index 0000000000..ac7e22627e --- /dev/null +++ b/asm/nonmatchings/code_ED510/TranslateModel.s @@ -0,0 +1,71 @@ +.set noat # allow manual use of $at +.set noreorder # don't insert nops after branches + +glabel TranslateModel +/* ED510 802C8B60 27BDFF88 */ addiu $sp, $sp, -0x78 +/* ED514 802C8B64 AFB20058 */ sw $s2, 0x58($sp) +/* ED518 802C8B68 0080902D */ daddu $s2, $a0, $zero +/* ED51C 802C8B6C AFBF005C */ sw $ra, 0x5c($sp) +/* ED520 802C8B70 AFB10054 */ sw $s1, 0x54($sp) +/* ED524 802C8B74 AFB00050 */ sw $s0, 0x50($sp) +/* ED528 802C8B78 F7B80070 */ sdc1 $f24, 0x70($sp) +/* ED52C 802C8B7C F7B60068 */ sdc1 $f22, 0x68($sp) +/* ED530 802C8B80 F7B40060 */ sdc1 $f20, 0x60($sp) +/* ED534 802C8B84 8E50000C */ lw $s0, 0xc($s2) +/* ED538 802C8B88 8E050000 */ lw $a1, ($s0) +/* ED53C 802C8B8C 0C0B1EAF */ jal get_variable +/* ED540 802C8B90 26100004 */ addiu $s0, $s0, 4 +/* ED544 802C8B94 0C046C04 */ jal get_model_list_index_from_tree_index +/* ED548 802C8B98 0040202D */ daddu $a0, $v0, $zero +/* ED54C 802C8B9C 8E050000 */ lw $a1, ($s0) +/* ED550 802C8BA0 26100004 */ addiu $s0, $s0, 4 +/* ED554 802C8BA4 0240202D */ daddu $a0, $s2, $zero +/* ED558 802C8BA8 0C0B210B */ jal get_float_variable +/* ED55C 802C8BAC 0040882D */ daddu $s1, $v0, $zero +/* ED560 802C8BB0 8E050000 */ lw $a1, ($s0) +/* ED564 802C8BB4 26100004 */ addiu $s0, $s0, 4 +/* ED568 802C8BB8 0240202D */ daddu $a0, $s2, $zero +/* ED56C 802C8BBC 0C0B210B */ jal get_float_variable +/* ED570 802C8BC0 46000606 */ mov.s $f24, $f0 +/* ED574 802C8BC4 0240202D */ daddu $a0, $s2, $zero +/* ED578 802C8BC8 8E050000 */ lw $a1, ($s0) +/* ED57C 802C8BCC 0C0B210B */ jal get_float_variable +/* ED580 802C8BD0 46000586 */ mov.s $f22, $f0 +/* ED584 802C8BD4 0220202D */ daddu $a0, $s1, $zero +/* ED588 802C8BD8 0C046B4C */ jal get_model_from_list_index +/* ED58C 802C8BDC 46000506 */ mov.s $f20, $f0 +/* ED590 802C8BE0 0040802D */ daddu $s0, $v0, $zero +/* ED594 802C8BE4 96020000 */ lhu $v0, ($s0) +/* ED598 802C8BE8 30420400 */ andi $v0, $v0, 0x400 +/* ED59C 802C8BEC 1440000A */ bnez $v0, .L802C8C18 +/* ED5A0 802C8BF0 00000000 */ nop +/* ED5A4 802C8BF4 4405C000 */ mfc1 $a1, $f24 +/* ED5A8 802C8BF8 4406B000 */ mfc1 $a2, $f22 +/* ED5AC 802C8BFC 4407A000 */ mfc1 $a3, $f20 +/* ED5B0 802C8C00 0C019E40 */ jal guTranslateF +/* ED5B4 802C8C04 26040058 */ addiu $a0, $s0, 0x58 +/* ED5B8 802C8C08 96020000 */ lhu $v0, ($s0) +/* ED5BC 802C8C0C 34421400 */ ori $v0, $v0, 0x1400 +/* ED5C0 802C8C10 080B230F */ j .L802C8C3C +/* ED5C4 802C8C14 A6020000 */ sh $v0, ($s0) +.L802C8C18: +/* ED5C8 802C8C18 4405C000 */ mfc1 $a1, $f24 +/* ED5CC 802C8C1C 4406B000 */ mfc1 $a2, $f22 +/* ED5D0 802C8C20 4407A000 */ mfc1 $a3, $f20 +/* ED5D4 802C8C24 0C019E40 */ jal guTranslateF +/* ED5D8 802C8C28 27A40010 */ addiu $a0, $sp, 0x10 +/* ED5DC 802C8C2C 27A40010 */ addiu $a0, $sp, 0x10 +/* ED5E0 802C8C30 26050058 */ addiu $a1, $s0, 0x58 +/* ED5E4 802C8C34 0C019D80 */ jal guMtxCatF +/* ED5E8 802C8C38 00A0302D */ daddu $a2, $a1, $zero +.L802C8C3C: +/* ED5EC 802C8C3C 8FBF005C */ lw $ra, 0x5c($sp) +/* ED5F0 802C8C40 8FB20058 */ lw $s2, 0x58($sp) +/* ED5F4 802C8C44 8FB10054 */ lw $s1, 0x54($sp) +/* ED5F8 802C8C48 8FB00050 */ lw $s0, 0x50($sp) +/* ED5FC 802C8C4C D7B80070 */ ldc1 $f24, 0x70($sp) +/* ED600 802C8C50 D7B60068 */ ldc1 $f22, 0x68($sp) +/* ED604 802C8C54 D7B40060 */ ldc1 $f20, 0x60($sp) +/* ED608 802C8C58 24020002 */ addiu $v0, $zero, 2 +/* ED60C 802C8C5C 03E00008 */ jr $ra +/* ED610 802C8C60 27BD0078 */ addiu $sp, $sp, 0x78 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/func_802C90FC.s b/asm/nonmatchings/code_ED510/func_802C90FC.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/func_802C90FC.s rename to asm/nonmatchings/code_ED510/func_802C90FC.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/func_802C95A0.s b/asm/nonmatchings/code_ED510/func_802C95A0.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/func_802C95A0.s rename to asm/nonmatchings/code_ED510/func_802C95A0.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/func_802C9FD4.s b/asm/nonmatchings/code_ED510/func_802C9FD4.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/func_802C9FD4.s rename to asm/nonmatchings/code_ED510/func_802C9FD4.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/goto_map.s b/asm/nonmatchings/code_ED510/goto_map.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/goto_map.s rename to asm/nonmatchings/code_ED510/goto_map.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/modify_collider_family_flags.s b/asm/nonmatchings/code_ED510/modify_collider_family_flags.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/modify_collider_family_flags.s rename to asm/nonmatchings/code_ED510/modify_collider_family_flags.s diff --git a/asm/nonmatchings/code_e92d0_len_5da0/set_zone_enabled.s b/asm/nonmatchings/code_ED510/set_zone_enabled.s similarity index 100% rename from asm/nonmatchings/code_e92d0_len_5da0/set_zone_enabled.s rename to asm/nonmatchings/code_ED510/set_zone_enabled.s diff --git a/asm/nonmatchings/code_F5750/Disable8bitMario.s b/asm/nonmatchings/code_F5750/Disable8bitMario.s deleted file mode 100644 index 3d529c9f18..0000000000 --- a/asm/nonmatchings/code_F5750/Disable8bitMario.s +++ /dev/null @@ -1,41 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel Disable8bitMario -/* F7538 802D2B88 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* F753C 802D2B8C AFBF0018 */ sw $ra, 0x18($sp) -/* F7540 802D2B90 AFB10014 */ sw $s1, 0x14($sp) -/* F7544 802D2B94 AFB00010 */ sw $s0, 0x10($sp) -/* F7548 802D2B98 8C82000C */ lw $v0, 0xc($a0) -/* F754C 802D2B9C 3C108011 */ lui $s0, %hi(gPlayerStatus) -/* F7550 802D2BA0 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus) -/* F7554 802D2BA4 8C450000 */ lw $a1, ($v0) -/* F7558 802D2BA8 0C0B1EAF */ jal get_variable -/* F755C 802D2BAC 0200882D */ daddu $s1, $s0, $zero -/* F7560 802D2BB0 10400009 */ beqz $v0, .L802D2BD8 -/* F7564 802D2BB4 24020025 */ addiu $v0, $zero, 0x25 -/* F7568 802D2BB8 A60200B0 */ sh $v0, 0xb0($s0) -/* F756C 802D2BBC 2402001A */ addiu $v0, $zero, 0x1a -/* F7570 802D2BC0 A60200B2 */ sh $v0, 0xb2($s0) -/* F7574 802D2BC4 8E020004 */ lw $v0, 4($s0) -/* F7578 802D2BC8 2403BFFF */ addiu $v1, $zero, -0x4001 -/* F757C 802D2BCC 00431024 */ and $v0, $v0, $v1 -/* F7580 802D2BD0 080B4AFF */ j .L802D2BFC -/* F7584 802D2BD4 AE020004 */ sw $v0, 4($s0) -.L802D2BD8: -/* F7588 802D2BD8 3C040004 */ lui $a0, 4 -/* F758C 802D2BDC 34844004 */ ori $a0, $a0, 0x4004 -/* F7590 802D2BE0 24020013 */ addiu $v0, $zero, 0x13 -/* F7594 802D2BE4 A62200B0 */ sh $v0, 0xb0($s1) -/* F7598 802D2BE8 8E220004 */ lw $v0, 4($s1) -/* F759C 802D2BEC 2403001A */ addiu $v1, $zero, 0x1a -/* F75A0 802D2BF0 A62300B2 */ sh $v1, 0xb2($s1) -/* F75A4 802D2BF4 00441025 */ or $v0, $v0, $a0 -/* F75A8 802D2BF8 AE220004 */ sw $v0, 4($s1) -.L802D2BFC: -/* F75AC 802D2BFC 8FBF0018 */ lw $ra, 0x18($sp) -/* F75B0 802D2C00 8FB10014 */ lw $s1, 0x14($sp) -/* F75B4 802D2C04 8FB00010 */ lw $s0, 0x10($sp) -/* F75B8 802D2C08 24020002 */ addiu $v0, $zero, 2 -/* F75BC 802D2C0C 03E00008 */ jr $ra -/* F75C0 802D2C10 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_F5750/DisablePartner.s b/asm/nonmatchings/code_F5750/DisablePartner.s deleted file mode 100644 index 487c78a88a..0000000000 --- a/asm/nonmatchings/code_F5750/DisablePartner.s +++ /dev/null @@ -1,18 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel DisablePartner -/* F68E8 802D1F38 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* F68EC 802D1F3C AFBF0010 */ sw $ra, 0x10($sp) -/* F68F0 802D1F40 8C82000C */ lw $v0, 0xc($a0) -/* F68F4 802D1F44 0C0B1EAF */ jal get_variable -/* F68F8 802D1F48 8C450000 */ lw $a1, ($v0) -/* F68FC 802D1F4C 2443FFFF */ addiu $v1, $v0, -1 -/* F6900 802D1F50 000318C0 */ sll $v1, $v1, 3 -/* F6904 802D1F54 3C018011 */ lui $at, 0x8011 -/* F6908 802D1F58 00230821 */ addu $at, $at, $v1 -/* F690C 802D1F5C A020F2A4 */ sb $zero, -0xd5c($at) -/* F6910 802D1F60 8FBF0010 */ lw $ra, 0x10($sp) -/* F6914 802D1F64 24020002 */ addiu $v0, $zero, 2 -/* F6918 802D1F68 03E00008 */ jr $ra -/* F691C 802D1F6C 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_F5750/DisablePulseStone.s b/asm/nonmatchings/code_F5750/DisablePulseStone.s deleted file mode 100644 index ae1d9f3345..0000000000 --- a/asm/nonmatchings/code_F5750/DisablePulseStone.s +++ /dev/null @@ -1,31 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel DisablePulseStone -/* F7458 802D2AA8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* F745C 802D2AAC AFBF0018 */ sw $ra, 0x18($sp) -/* F7460 802D2AB0 AFB10014 */ sw $s1, 0x14($sp) -/* F7464 802D2AB4 AFB00010 */ sw $s0, 0x10($sp) -/* F7468 802D2AB8 8C82000C */ lw $v0, 0xc($a0) -/* F746C 802D2ABC 3C108011 */ lui $s0, %hi(gPlayerStatus) -/* F7470 802D2AC0 2610EFC8 */ addiu $s0, $s0, %lo(gPlayerStatus) -/* F7474 802D2AC4 8C450000 */ lw $a1, ($v0) -/* F7478 802D2AC8 0C0B1EAF */ jal get_variable -/* F747C 802D2ACC 0200882D */ daddu $s1, $s0, $zero -/* F7480 802D2AD0 10400005 */ beqz $v0, .L802D2AE8 -/* F7484 802D2AD4 2403FF7F */ addiu $v1, $zero, -0x81 -/* F7488 802D2AD8 8E020004 */ lw $v0, 4($s0) -/* F748C 802D2ADC 00431024 */ and $v0, $v0, $v1 -/* F7490 802D2AE0 080B4ABD */ j .L802D2AF4 -/* F7494 802D2AE4 AE020004 */ sw $v0, 4($s0) -.L802D2AE8: -/* F7498 802D2AE8 8E220004 */ lw $v0, 4($s1) -/* F749C 802D2AEC 34420080 */ ori $v0, $v0, 0x80 -/* F74A0 802D2AF0 AE220004 */ sw $v0, 4($s1) -.L802D2AF4: -/* F74A4 802D2AF4 8FBF0018 */ lw $ra, 0x18($sp) -/* F74A8 802D2AF8 8FB10014 */ lw $s1, 0x14($sp) -/* F74AC 802D2AFC 8FB00010 */ lw $s0, 0x10($sp) -/* F74B0 802D2B00 24020002 */ addiu $v0, $zero, 2 -/* F74B4 802D2B04 03E00008 */ jr $ra -/* F74B8 802D2B08 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_F5750/EnablePartner.s b/asm/nonmatchings/code_F5750/EnablePartner.s deleted file mode 100644 index c6cc4275f5..0000000000 --- a/asm/nonmatchings/code_F5750/EnablePartner.s +++ /dev/null @@ -1,19 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel EnablePartner -/* F68AC 802D1EFC 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* F68B0 802D1F00 AFBF0010 */ sw $ra, 0x10($sp) -/* F68B4 802D1F04 8C82000C */ lw $v0, 0xc($a0) -/* F68B8 802D1F08 0C0B1EAF */ jal get_variable -/* F68BC 802D1F0C 8C450000 */ lw $a1, ($v0) -/* F68C0 802D1F10 2443FFFF */ addiu $v1, $v0, -1 -/* F68C4 802D1F14 000318C0 */ sll $v1, $v1, 3 -/* F68C8 802D1F18 24040001 */ addiu $a0, $zero, 1 -/* F68CC 802D1F1C 3C018011 */ lui $at, 0x8011 -/* F68D0 802D1F20 00230821 */ addu $at, $at, $v1 -/* F68D4 802D1F24 A024F2A4 */ sb $a0, -0xd5c($at) -/* F68D8 802D1F28 8FBF0010 */ lw $ra, 0x10($sp) -/* F68DC 802D1F2C 24020002 */ addiu $v0, $zero, 2 -/* F68E0 802D1F30 03E00008 */ jr $ra -/* F68E4 802D1F34 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_F5750/FullyRestoreSP.s b/asm/nonmatchings/code_F5750/FullyRestoreSP.s deleted file mode 100644 index 5d06ca36a3..0000000000 --- a/asm/nonmatchings/code_F5750/FullyRestoreSP.s +++ /dev/null @@ -1,11 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel FullyRestoreSP -/* F6890 802D1EE0 3C038011 */ lui $v1, %hi(gPlayerData) -/* F6894 802D1EE4 2463F290 */ addiu $v1, $v1, %lo(gPlayerData) -/* F6898 802D1EE8 8062028E */ lb $v0, 0x28e($v1) -/* F689C 802D1EEC 00021200 */ sll $v0, $v0, 8 -/* F68A0 802D1EF0 A4620290 */ sh $v0, 0x290($v1) -/* F68A4 802D1EF4 03E00008 */ jr $ra -/* F68A8 802D1EF8 24020002 */ addiu $v0, $zero, 2 diff --git a/asm/nonmatchings/code_F5750/GetCurrentPartner.s b/asm/nonmatchings/code_F5750/GetCurrentPartner.s deleted file mode 100644 index 2b108a526c..0000000000 --- a/asm/nonmatchings/code_F5750/GetCurrentPartner.s +++ /dev/null @@ -1,22 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel GetCurrentPartner -/* F74BC 802D2B0C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* F74C0 802D2B10 AFBF0010 */ sw $ra, 0x10($sp) -/* F74C4 802D2B14 8C82000C */ lw $v0, 0xc($a0) -/* F74C8 802D2B18 3C038011 */ lui $v1, %hi(D_8010EBB0) -/* F74CC 802D2B1C 8063EBB0 */ lb $v1, %lo(D_8010EBB0)($v1) -/* F74D0 802D2B20 8C450000 */ lw $a1, ($v0) -/* F74D4 802D2B24 10600004 */ beqz $v1, .L802D2B38 -/* F74D8 802D2B28 0000302D */ daddu $a2, $zero, $zero -/* F74DC 802D2B2C 3C028011 */ lui $v0, %hi(gPlayerData) -/* F74E0 802D2B30 2442F290 */ addiu $v0, $v0, %lo(gPlayerData) -/* F74E4 802D2B34 80460012 */ lb $a2, 0x12($v0) -.L802D2B38: -/* F74E8 802D2B38 0C0B2026 */ jal set_variable -/* F74EC 802D2B3C 00000000 */ nop -/* F74F0 802D2B40 8FBF0010 */ lw $ra, 0x10($sp) -/* F74F4 802D2B44 24020002 */ addiu $v0, $zero, 2 -/* F74F8 802D2B48 03E00008 */ jr $ra -/* F74FC 802D2B4C 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_F5750/PlaySoundAtPlayer.s b/asm/nonmatchings/code_F5750/PlaySoundAtPlayer.s deleted file mode 100644 index a030261256..0000000000 --- a/asm/nonmatchings/code_F5750/PlaySoundAtPlayer.s +++ /dev/null @@ -1,26 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel PlaySoundAtPlayer -/* F7688 802D2CD8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* F768C 802D2CDC AFB10014 */ sw $s1, 0x14($sp) -/* F7690 802D2CE0 0080882D */ daddu $s1, $a0, $zero -/* F7694 802D2CE4 AFBF0018 */ sw $ra, 0x18($sp) -/* F7698 802D2CE8 AFB00010 */ sw $s0, 0x10($sp) -/* F769C 802D2CEC 8E30000C */ lw $s0, 0xc($s1) -/* F76A0 802D2CF0 8E050000 */ lw $a1, ($s0) -/* F76A4 802D2CF4 0C0B1EAF */ jal get_variable -/* F76A8 802D2CF8 26100004 */ addiu $s0, $s0, 4 -/* F76AC 802D2CFC 0220202D */ daddu $a0, $s1, $zero -/* F76B0 802D2D00 8E050000 */ lw $a1, ($s0) -/* F76B4 802D2D04 0C0B1EAF */ jal get_variable -/* F76B8 802D2D08 0040802D */ daddu $s0, $v0, $zero -/* F76BC 802D2D0C 0200202D */ daddu $a0, $s0, $zero -/* F76C0 802D2D10 0C052736 */ jal play_sound_at_player -/* F76C4 802D2D14 0040282D */ daddu $a1, $v0, $zero -/* F76C8 802D2D18 8FBF0018 */ lw $ra, 0x18($sp) -/* F76CC 802D2D1C 8FB10014 */ lw $s1, 0x14($sp) -/* F76D0 802D2D20 8FB00010 */ lw $s0, 0x10($sp) -/* F76D4 802D2D24 24020002 */ addiu $v0, $zero, 2 -/* F76D8 802D2D28 03E00008 */ jr $ra -/* F76DC 802D2D2C 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_F5750/SetPlayerCollisionSize.s b/asm/nonmatchings/code_F5750/SetPlayerCollisionSize.s deleted file mode 100644 index 2a94d380fe..0000000000 --- a/asm/nonmatchings/code_F5750/SetPlayerCollisionSize.s +++ /dev/null @@ -1,33 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel SetPlayerCollisionSize -/* F5960 802D0FB0 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* F5964 802D0FB4 AFB10014 */ sw $s1, 0x14($sp) -/* F5968 802D0FB8 0080882D */ daddu $s1, $a0, $zero -/* F596C 802D0FBC AFBF0018 */ sw $ra, 0x18($sp) -/* F5970 802D0FC0 AFB00010 */ sw $s0, 0x10($sp) -/* F5974 802D0FC4 8E30000C */ lw $s0, 0xc($s1) -/* F5978 802D0FC8 8E050000 */ lw $a1, ($s0) -/* F597C 802D0FCC 0C0B1EAF */ jal get_variable -/* F5980 802D0FD0 26100004 */ addiu $s0, $s0, 4 -/* F5984 802D0FD4 0220202D */ daddu $a0, $s1, $zero -/* F5988 802D0FD8 8E050000 */ lw $a1, ($s0) -/* F598C 802D0FDC 0C0B1EAF */ jal get_variable -/* F5990 802D0FE0 0040802D */ daddu $s0, $v0, $zero -/* F5994 802D0FE4 3C03802E */ lui $v1, %hi(gPlayerNpcPtr) -/* F5998 802D0FE8 8C639D20 */ lw $v1, %lo(gPlayerNpcPtr)($v1) -/* F599C 802D0FEC 3C048011 */ lui $a0, %hi(gPlayerStatus) -/* F59A0 802D0FF0 2484EFC8 */ addiu $a0, $a0, %lo(gPlayerStatus) -/* F59A4 802D0FF4 A47000A8 */ sh $s0, 0xa8($v1) -/* F59A8 802D0FF8 A46200A6 */ sh $v0, 0xa6($v1) -/* F59AC 802D0FFC 0200102D */ daddu $v0, $s0, $zero -/* F59B0 802D1000 A48200B0 */ sh $v0, 0xb0($a0) -/* F59B4 802D1004 946300A6 */ lhu $v1, 0xa6($v1) -/* F59B8 802D1008 A48300B2 */ sh $v1, 0xb2($a0) -/* F59BC 802D100C 8FBF0018 */ lw $ra, 0x18($sp) -/* F59C0 802D1010 8FB10014 */ lw $s1, 0x14($sp) -/* F59C4 802D1014 8FB00010 */ lw $s0, 0x10($sp) -/* F59C8 802D1018 24020002 */ addiu $v0, $zero, 2 -/* F59CC 802D101C 03E00008 */ jr $ra -/* F59D0 802D1020 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_F5750/SetPlayerFlagBits.s b/asm/nonmatchings/code_F5750/SetPlayerFlagBits.s deleted file mode 100644 index da838acd3f..0000000000 --- a/asm/nonmatchings/code_F5750/SetPlayerFlagBits.s +++ /dev/null @@ -1,34 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel SetPlayerFlagBits -/* F6710 802D1D60 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* F6714 802D1D64 AFB10014 */ sw $s1, 0x14($sp) -/* F6718 802D1D68 3C118011 */ lui $s1, %hi(gPlayerStatus) -/* F671C 802D1D6C 2631EFC8 */ addiu $s1, $s1, %lo(gPlayerStatus) -/* F6720 802D1D70 AFBF001C */ sw $ra, 0x1c($sp) -/* F6724 802D1D74 AFB20018 */ sw $s2, 0x18($sp) -/* F6728 802D1D78 AFB00010 */ sw $s0, 0x10($sp) -/* F672C 802D1D7C 8C82000C */ lw $v0, 0xc($a0) -/* F6730 802D1D80 8C450004 */ lw $a1, 4($v0) -/* F6734 802D1D84 8C500000 */ lw $s0, ($v0) -/* F6738 802D1D88 0C0B1EAF */ jal get_variable -/* F673C 802D1D8C 0220902D */ daddu $s2, $s1, $zero -/* F6740 802D1D90 10400005 */ beqz $v0, .L802D1DA8 -/* F6744 802D1D94 00101827 */ nor $v1, $zero, $s0 -/* F6748 802D1D98 8E220000 */ lw $v0, ($s1) -/* F674C 802D1D9C 00501025 */ or $v0, $v0, $s0 -/* F6750 802D1DA0 080B476D */ j .L802D1DB4 -/* F6754 802D1DA4 AE220000 */ sw $v0, ($s1) -.L802D1DA8: -/* F6758 802D1DA8 8E420000 */ lw $v0, ($s2) -/* F675C 802D1DAC 00431024 */ and $v0, $v0, $v1 -/* F6760 802D1DB0 AE420000 */ sw $v0, ($s2) -.L802D1DB4: -/* F6764 802D1DB4 8FBF001C */ lw $ra, 0x1c($sp) -/* F6768 802D1DB8 8FB20018 */ lw $s2, 0x18($sp) -/* F676C 802D1DBC 8FB10014 */ lw $s1, 0x14($sp) -/* F6770 802D1DC0 8FB00010 */ lw $s0, 0x10($sp) -/* F6774 802D1DC4 24020002 */ addiu $v0, $zero, 2 -/* F6778 802D1DC8 03E00008 */ jr $ra -/* F677C 802D1DCC 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_F5750/SetPlayerPos.s b/asm/nonmatchings/code_F5750/SetPlayerPos.s deleted file mode 100644 index a995a07155..0000000000 --- a/asm/nonmatchings/code_F5750/SetPlayerPos.s +++ /dev/null @@ -1,52 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel SetPlayerPos -/* F58A0 802D0EF0 27BDFFD0 */ addiu $sp, $sp, -0x30 -/* F58A4 802D0EF4 AFB10014 */ sw $s1, 0x14($sp) -/* F58A8 802D0EF8 0080882D */ daddu $s1, $a0, $zero -/* F58AC 802D0EFC AFBF0018 */ sw $ra, 0x18($sp) -/* F58B0 802D0F00 AFB00010 */ sw $s0, 0x10($sp) -/* F58B4 802D0F04 F7B60028 */ sdc1 $f22, 0x28($sp) -/* F58B8 802D0F08 F7B40020 */ sdc1 $f20, 0x20($sp) -/* F58BC 802D0F0C 8E30000C */ lw $s0, 0xc($s1) -/* F58C0 802D0F10 8E050000 */ lw $a1, ($s0) -/* F58C4 802D0F14 0C0B1EAF */ jal get_variable -/* F58C8 802D0F18 26100004 */ addiu $s0, $s0, 4 -/* F58CC 802D0F1C 8E050000 */ lw $a1, ($s0) -/* F58D0 802D0F20 26100004 */ addiu $s0, $s0, 4 -/* F58D4 802D0F24 4482B000 */ mtc1 $v0, $f22 -/* F58D8 802D0F28 00000000 */ nop -/* F58DC 802D0F2C 4680B5A0 */ cvt.s.w $f22, $f22 -/* F58E0 802D0F30 0C0B1EAF */ jal get_variable -/* F58E4 802D0F34 0220202D */ daddu $a0, $s1, $zero -/* F58E8 802D0F38 8E050000 */ lw $a1, ($s0) -/* F58EC 802D0F3C 4482A000 */ mtc1 $v0, $f20 -/* F58F0 802D0F40 00000000 */ nop -/* F58F4 802D0F44 4680A520 */ cvt.s.w $f20, $f20 -/* F58F8 802D0F48 0C0B1EAF */ jal get_variable -/* F58FC 802D0F4C 0220202D */ daddu $a0, $s1, $zero -/* F5900 802D0F50 44820000 */ mtc1 $v0, $f0 -/* F5904 802D0F54 00000000 */ nop -/* F5908 802D0F58 46800020 */ cvt.s.w $f0, $f0 -/* F590C 802D0F5C 3C03802E */ lui $v1, %hi(gPlayerNpcPtr) -/* F5910 802D0F60 8C639D20 */ lw $v1, %lo(gPlayerNpcPtr)($v1) -/* F5914 802D0F64 3C048011 */ lui $a0, %hi(gPlayerStatus) -/* F5918 802D0F68 2484EFC8 */ addiu $a0, $a0, %lo(gPlayerStatus) -/* F591C 802D0F6C E4760038 */ swc1 $f22, 0x38($v1) -/* F5920 802D0F70 E4600040 */ swc1 $f0, 0x40($v1) -/* F5924 802D0F74 4600B006 */ mov.s $f0, $f22 -/* F5928 802D0F78 E474003C */ swc1 $f20, 0x3c($v1) -/* F592C 802D0F7C E4800028 */ swc1 $f0, 0x28($a0) -/* F5930 802D0F80 C460003C */ lwc1 $f0, 0x3c($v1) -/* F5934 802D0F84 E480002C */ swc1 $f0, 0x2c($a0) -/* F5938 802D0F88 C4600040 */ lwc1 $f0, 0x40($v1) -/* F593C 802D0F8C E4800030 */ swc1 $f0, 0x30($a0) -/* F5940 802D0F90 8FBF0018 */ lw $ra, 0x18($sp) -/* F5944 802D0F94 8FB10014 */ lw $s1, 0x14($sp) -/* F5948 802D0F98 8FB00010 */ lw $s0, 0x10($sp) -/* F594C 802D0F9C D7B60028 */ ldc1 $f22, 0x28($sp) -/* F5950 802D0FA0 D7B40020 */ ldc1 $f20, 0x20($sp) -/* F5954 802D0FA4 24020002 */ addiu $v0, $zero, 2 -/* F5958 802D0FA8 03E00008 */ jr $ra -/* F595C 802D0FAC 27BD0030 */ addiu $sp, $sp, 0x30 diff --git a/asm/nonmatchings/code_a5dd0_len_114e0/AssignFlag.s b/asm/nonmatchings/code_a5dd0_len_114e0/AssignFlag.s deleted file mode 100644 index 95970d4c53..0000000000 --- a/asm/nonmatchings/code_a5dd0_len_114e0/AssignFlag.s +++ /dev/null @@ -1,28 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel AssignFlag -/* A87B8 801120B8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* A87BC 801120BC AFB10014 */ sw $s1, 0x14($sp) -/* A87C0 801120C0 0080882D */ daddu $s1, $a0, $zero -/* A87C4 801120C4 24020001 */ addiu $v0, $zero, 1 -/* A87C8 801120C8 AFBF0018 */ sw $ra, 0x18($sp) -/* A87CC 801120CC AFB00010 */ sw $s0, 0x10($sp) -/* A87D0 801120D0 14A2000B */ bne $a1, $v0, .L80112100 -/* A87D4 801120D4 8E30000C */ lw $s0, 0xc($s1) -/* A87D8 801120D8 3C048015 */ lui $a0, 0x8015 -/* A87DC 801120DC 8C8412EC */ lw $a0, 0x12ec($a0) -/* A87E0 801120E0 0C04417A */ jal get_entity_by_index -/* A87E4 801120E4 00000000 */ nop -/* A87E8 801120E8 8E050000 */ lw $a1, ($s0) -/* A87EC 801120EC 8C500040 */ lw $s0, 0x40($v0) -/* A87F0 801120F0 0C0B1F6A */ jal get_variable_index -/* A87F4 801120F4 0220202D */ daddu $a0, $s1, $zero -/* A87F8 801120F8 A6020000 */ sh $v0, ($s0) -/* A87FC 801120FC 24020002 */ addiu $v0, $zero, 2 -.L80112100: -/* A8800 80112100 8FBF0018 */ lw $ra, 0x18($sp) -/* A8804 80112104 8FB10014 */ lw $s1, 0x14($sp) -/* A8808 80112108 8FB00010 */ lw $s0, 0x10($sp) -/* A880C 8011210C 03E00008 */ jr $ra -/* A8810 80112110 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_dba20_len_350/clear_area_flags.s b/asm/nonmatchings/code_dba20_len_350/clear_area_flags.s deleted file mode 100644 index d88b76ee13..0000000000 --- a/asm/nonmatchings/code_dba20_len_350/clear_area_flags.s +++ /dev/null @@ -1,27 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel clear_area_flags -/* DBA90 80145390 3C028007 */ lui $v0, %hi(gGameStatusPtr) -/* DBA94 80145394 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) -/* DBA98 80145398 8442008A */ lh $v0, 0x8a($v0) -/* DBA9C 8014539C 3C04800E */ lui $a0, %hi(gCurrentSaveFile) -/* DBAA0 801453A0 2484ACC0 */ addiu $a0, $a0, %lo(gCurrentSaveFile) -/* DBAA4 801453A4 1040000C */ beqz $v0, .L801453D8 -/* DBAA8 801453A8 24020007 */ addiu $v0, $zero, 7 -/* DBAAC 801453AC 2483001C */ addiu $v1, $a0, 0x1c -.L801453B0: -/* DBAB0 801453B0 AC6012B0 */ sw $zero, 0x12b0($v1) -/* DBAB4 801453B4 2442FFFF */ addiu $v0, $v0, -1 -/* DBAB8 801453B8 0441FFFD */ bgez $v0, .L801453B0 -/* DBABC 801453BC 2463FFFC */ addiu $v1, $v1, -4 -/* DBAC0 801453C0 2402000F */ addiu $v0, $zero, 0xf -/* DBAC4 801453C4 00821821 */ addu $v1, $a0, $v0 -.L801453C8: -/* DBAC8 801453C8 A06012D0 */ sb $zero, 0x12d0($v1) -/* DBACC 801453CC 2442FFFF */ addiu $v0, $v0, -1 -/* DBAD0 801453D0 0441FFFD */ bgez $v0, .L801453C8 -/* DBAD4 801453D4 2463FFFF */ addiu $v1, $v1, -1 -.L801453D8: -/* DBAD8 801453D8 03E00008 */ jr $ra -/* DBADC 801453DC 00000000 */ nop diff --git a/asm/nonmatchings/code_dba20_len_350/clear_saved_variables.s b/asm/nonmatchings/code_dba20_len_350/clear_saved_variables.s deleted file mode 100644 index 799a35954d..0000000000 --- a/asm/nonmatchings/code_dba20_len_350/clear_saved_variables.s +++ /dev/null @@ -1,36 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel clear_saved_variables -/* DBA20 80145320 2402003F */ addiu $v0, $zero, 0x3f -/* DBA24 80145324 3C04800E */ lui $a0, %hi(gCurrentSaveFile) -/* DBA28 80145328 2484ACC0 */ addiu $a0, $a0, %lo(gCurrentSaveFile) -/* DBA2C 8014532C 248300FC */ addiu $v1, $a0, 0xfc -.L80145330: -/* DBA30 80145330 AC600FB0 */ sw $zero, 0xfb0($v1) -/* DBA34 80145334 2442FFFF */ addiu $v0, $v0, -1 -/* DBA38 80145338 0441FFFD */ bgez $v0, .L80145330 -/* DBA3C 8014533C 2463FFFC */ addiu $v1, $v1, -4 -/* DBA40 80145340 240201FF */ addiu $v0, $zero, 0x1ff -/* DBA44 80145344 00821821 */ addu $v1, $a0, $v0 -.L80145348: -/* DBA48 80145348 A06010B0 */ sb $zero, 0x10b0($v1) -/* DBA4C 8014534C 2442FFFF */ addiu $v0, $v0, -1 -/* DBA50 80145350 0441FFFD */ bgez $v0, .L80145348 -/* DBA54 80145354 2463FFFF */ addiu $v1, $v1, -1 -/* DBA58 80145358 24020007 */ addiu $v0, $zero, 7 -/* DBA5C 8014535C 2483001C */ addiu $v1, $a0, 0x1c -.L80145360: -/* DBA60 80145360 AC6012B0 */ sw $zero, 0x12b0($v1) -/* DBA64 80145364 2442FFFF */ addiu $v0, $v0, -1 -/* DBA68 80145368 0441FFFD */ bgez $v0, .L80145360 -/* DBA6C 8014536C 2463FFFC */ addiu $v1, $v1, -4 -/* DBA70 80145370 2402000F */ addiu $v0, $zero, 0xf -/* DBA74 80145374 00821821 */ addu $v1, $a0, $v0 -.L80145378: -/* DBA78 80145378 A06012D0 */ sb $zero, 0x12d0($v1) -/* DBA7C 8014537C 2442FFFF */ addiu $v0, $v0, -1 -/* DBA80 80145380 0441FFFD */ bgez $v0, .L80145378 -/* DBA84 80145384 2463FFFF */ addiu $v1, $v1, -1 -/* DBA88 80145388 03E00008 */ jr $ra -/* DBA8C 8014538C 00000000 */ nop diff --git a/asm/nonmatchings/code_dbd70_len_700/func_80145CE8.s b/asm/nonmatchings/code_dbd70_len_700/func_80145CE8.s deleted file mode 100644 index 953ab8b807..0000000000 --- a/asm/nonmatchings/code_dbd70_len_700/func_80145CE8.s +++ /dev/null @@ -1,42 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_80145CE8 -/* DC3E8 80145CE8 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* DC3EC 80145CEC AFB00010 */ sw $s0, 0x10($sp) -/* DC3F0 80145CF0 AFBF0014 */ sw $ra, 0x14($sp) -/* DC3F4 80145CF4 0C0394BE */ jal func_800E52F8 -/* DC3F8 80145CF8 0080802D */ daddu $s0, $a0, $zero -/* DC3FC 80145CFC 14400003 */ bnez $v0, .L80145D0C -/* DC400 80145D00 0000282D */ daddu $a1, $zero, $zero -/* DC404 80145D04 08051756 */ j .L80145D58 -/* DC408 80145D08 0000102D */ daddu $v0, $zero, $zero -.L80145D0C: -/* DC40C 80145D0C 3C048016 */ lui $a0, %hi(gCurrentTriggerListPtr) -/* DC410 80145D10 8C849390 */ lw $a0, %lo(gCurrentTriggerListPtr)($a0) -.L80145D14: -/* DC414 80145D14 8C830000 */ lw $v1, ($a0) -/* DC418 80145D18 5060000B */ beql $v1, $zero, .L80145D48 -/* DC41C 80145D1C 24A50001 */ addiu $a1, $a1, 1 -/* DC420 80145D20 90620030 */ lbu $v0, 0x30($v1) -/* DC424 80145D24 10400008 */ beqz $v0, .L80145D48 -/* DC428 80145D28 24A50001 */ addiu $a1, $a1, 1 -/* DC42C 80145D2C 8C620008 */ lw $v0, 8($v1) -/* DC430 80145D30 14500005 */ bne $v0, $s0, .L80145D48 -/* DC434 80145D34 00000000 */ nop -/* DC438 80145D38 8C620000 */ lw $v0, ($v1) -/* DC43C 80145D3C 30420100 */ andi $v0, $v0, 0x100 -/* DC440 80145D40 14400005 */ bnez $v0, .L80145D58 -/* DC444 80145D44 24020001 */ addiu $v0, $zero, 1 -.L80145D48: -/* DC448 80145D48 28A20040 */ slti $v0, $a1, 0x40 -/* DC44C 80145D4C 1440FFF1 */ bnez $v0, .L80145D14 -/* DC450 80145D50 24840004 */ addiu $a0, $a0, 4 -/* DC454 80145D54 0000102D */ daddu $v0, $zero, $zero -.L80145D58: -/* DC458 80145D58 8FBF0014 */ lw $ra, 0x14($sp) -/* DC45C 80145D5C 8FB00010 */ lw $s0, 0x10($sp) -/* DC460 80145D60 03E00008 */ jr $ra -/* DC464 80145D64 27BD0018 */ addiu $sp, $sp, 0x18 -/* DC468 80145D68 00000000 */ nop -/* DC46C 80145D6C 00000000 */ nop diff --git a/asm/nonmatchings/code_e92d0_len_5da0/_bound_script_trigger_handler.s b/asm/nonmatchings/code_e92d0_len_5da0/_bound_script_trigger_handler.s deleted file mode 100644 index dbcb51a87d..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/_bound_script_trigger_handler.s +++ /dev/null @@ -1,44 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel _bound_script_trigger_handler -/* EB02C 802C667C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* EB030 802C6680 AFB00010 */ sw $s0, 0x10($sp) -/* EB034 802C6684 0080802D */ daddu $s0, $a0, $zero -/* EB038 802C6688 AFBF0018 */ sw $ra, 0x18($sp) -/* EB03C 802C668C AFB10014 */ sw $s1, 0x14($sp) -/* EB040 802C6690 8E020014 */ lw $v0, 0x14($s0) -/* EB044 802C6694 14400014 */ bnez $v0, .L802C66E8 -/* EB048 802C6698 00000000 */ nop -/* EB04C 802C669C 8E110010 */ lw $s1, 0x10($s0) -/* EB050 802C66A0 0C05171B */ jal is_trigger_bound -/* EB054 802C66A4 0220282D */ daddu $a1, $s1, $zero -/* EB058 802C66A8 14400015 */ bnez $v0, .L802C6700 -/* EB05C 802C66AC 0000102D */ daddu $v0, $zero, $zero -/* EB060 802C66B0 0220202D */ daddu $a0, $s1, $zero -/* EB064 802C66B4 8E050018 */ lw $a1, 0x18($s0) -/* EB068 802C66B8 0C0B0CF8 */ jal start_script -/* EB06C 802C66BC 24060020 */ addiu $a2, $zero, 0x20 -/* EB070 802C66C0 AE020014 */ sw $v0, 0x14($s0) -/* EB074 802C66C4 8C430144 */ lw $v1, 0x144($v0) -/* EB078 802C66C8 8E04001C */ lw $a0, 0x1c($s0) -/* EB07C 802C66CC AE030034 */ sw $v1, 0x34($s0) -/* EB080 802C66D0 AC440084 */ sw $a0, 0x84($v0) -/* EB084 802C66D4 8E030020 */ lw $v1, 0x20($s0) -/* EB088 802C66D8 AC430088 */ sw $v1, 0x88($v0) -/* EB08C 802C66DC 8E030024 */ lw $v1, 0x24($s0) -/* EB090 802C66E0 AC50014C */ sw $s0, 0x14c($v0) -/* EB094 802C66E4 AC43008C */ sw $v1, 0x8c($v0) -.L802C66E8: -/* EB098 802C66E8 0C0B1059 */ jal does_script_exist -/* EB09C 802C66EC 8E040034 */ lw $a0, 0x34($s0) -/* EB0A0 802C66F0 14400003 */ bnez $v0, .L802C6700 -/* EB0A4 802C66F4 24020001 */ addiu $v0, $zero, 1 -/* EB0A8 802C66F8 AE000014 */ sw $zero, 0x14($s0) -/* EB0AC 802C66FC 0000102D */ daddu $v0, $zero, $zero -.L802C6700: -/* EB0B0 802C6700 8FBF0018 */ lw $ra, 0x18($sp) -/* EB0B4 802C6704 8FB10014 */ lw $s1, 0x14($sp) -/* EB0B8 802C6708 8FB00010 */ lw $s0, 0x10($sp) -/* EB0BC 802C670C 03E00008 */ jr $ra -/* EB0C0 802C6710 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/func_802C6AD0.s b/asm/nonmatchings/code_e92d0_len_5da0/func_802C6AD0.s deleted file mode 100644 index b6570d6110..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/func_802C6AD0.s +++ /dev/null @@ -1,39 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802C6AD0 -/* EB480 802C6AD0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* EB484 802C6AD4 AFB00010 */ sw $s0, 0x10($sp) -/* EB488 802C6AD8 0080802D */ daddu $s0, $a0, $zero -/* EB48C 802C6ADC AFBF0014 */ sw $ra, 0x14($sp) -/* EB490 802C6AE0 8E020014 */ lw $v0, 0x14($s0) -/* EB494 802C6AE4 1440000F */ bnez $v0, .L802C6B24 -/* EB498 802C6AE8 00000000 */ nop -/* EB49C 802C6AEC 8E040010 */ lw $a0, 0x10($s0) -/* EB4A0 802C6AF0 8E050018 */ lw $a1, 0x18($s0) -/* EB4A4 802C6AF4 0C0B0CF8 */ jal start_script -/* EB4A8 802C6AF8 24060020 */ addiu $a2, $zero, 0x20 -/* EB4AC 802C6AFC AE020014 */ sw $v0, 0x14($s0) -/* EB4B0 802C6B00 8C430144 */ lw $v1, 0x144($v0) -/* EB4B4 802C6B04 8E04001C */ lw $a0, 0x1c($s0) -/* EB4B8 802C6B08 AE030034 */ sw $v1, 0x34($s0) -/* EB4BC 802C6B0C AC440084 */ sw $a0, 0x84($v0) -/* EB4C0 802C6B10 8E030020 */ lw $v1, 0x20($s0) -/* EB4C4 802C6B14 AC430088 */ sw $v1, 0x88($v0) -/* EB4C8 802C6B18 8E030024 */ lw $v1, 0x24($s0) -/* EB4CC 802C6B1C AC50014C */ sw $s0, 0x14c($v0) -/* EB4D0 802C6B20 AC43008C */ sw $v1, 0x8c($v0) -.L802C6B24: -/* EB4D4 802C6B24 0C0B1059 */ jal does_script_exist -/* EB4D8 802C6B28 8E040034 */ lw $a0, 0x34($s0) -/* EB4DC 802C6B2C 14400005 */ bnez $v0, .L802C6B44 -/* EB4E0 802C6B30 2403FFFD */ addiu $v1, $zero, -3 -/* EB4E4 802C6B34 8E020000 */ lw $v0, ($s0) -/* EB4E8 802C6B38 AE000014 */ sw $zero, 0x14($s0) -/* EB4EC 802C6B3C 00431024 */ and $v0, $v0, $v1 -/* EB4F0 802C6B40 AE020000 */ sw $v0, ($s0) -.L802C6B44: -/* EB4F4 802C6B44 8FBF0014 */ lw $ra, 0x14($sp) -/* EB4F8 802C6B48 8FB00010 */ lw $s0, 0x10($sp) -/* EB4FC 802C6B4C 03E00008 */ jr $ra -/* EB500 802C6B50 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/get_variable_index.s b/asm/nonmatchings/code_e92d0_len_5da0/get_variable_index.s deleted file mode 100644 index bc393a6f00..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/get_variable_index.s +++ /dev/null @@ -1,109 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel get_variable_index -/* EC758 802C7DA8 3C02EFE8 */ lui $v0, 0xefe8 -/* EC75C 802C7DAC 34422080 */ ori $v0, $v0, 0x2080 -/* EC760 802C7DB0 0045102A */ slt $v0, $v0, $a1 -/* EC764 802C7DB4 14400003 */ bnez $v0, .L802C7DC4 -/* EC768 802C7DB8 3C02F119 */ lui $v0, 0xf119 -.L802C7DBC: -/* EC76C 802C7DBC 03E00008 */ jr $ra -/* EC770 802C7DC0 00A0102D */ daddu $v0, $a1, $zero -.L802C7DC4: -/* EC774 802C7DC4 34424D80 */ ori $v0, $v0, 0x4d80 -/* EC778 802C7DC8 0045102A */ slt $v0, $v0, $a1 -/* EC77C 802C7DCC 1040FFFB */ beqz $v0, .L802C7DBC -/* EC780 802C7DD0 3C02F2E3 */ lui $v0, 0xf2e3 -/* EC784 802C7DD4 34421100 */ ori $v0, $v0, 0x1100 -/* EC788 802C7DD8 0045102A */ slt $v0, $v0, $a1 -/* EC78C 802C7DDC 1040FFF7 */ beqz $v0, .L802C7DBC -/* EC790 802C7DE0 3C02F414 */ lui $v0, 0xf414 -/* EC794 802C7DE4 34423E00 */ ori $v0, $v0, 0x3e00 -/* EC798 802C7DE8 0045102A */ slt $v0, $v0, $a1 -/* EC79C 802C7DEC 54400005 */ bnel $v0, $zero, .L802C7E04 -/* EC7A0 802C7DF0 3C02F545 */ lui $v0, 0xf545 -/* EC7A4 802C7DF4 3C020C84 */ lui $v0, 0xc84 -/* EC7A8 802C7DF8 34425880 */ ori $v0, $v0, 0x5880 -/* EC7AC 802C7DFC 03E00008 */ jr $ra -/* EC7B0 802C7E00 00A21021 */ addu $v0, $a1, $v0 -.L802C7E04: -/* EC7B4 802C7E04 34426B00 */ ori $v0, $v0, 0x6b00 -/* EC7B8 802C7E08 0045102A */ slt $v0, $v0, $a1 -/* EC7BC 802C7E0C 54400005 */ bnel $v0, $zero, .L802C7E24 -/* EC7C0 802C7E10 3C02F676 */ lui $v0, 0xf676 -/* EC7C4 802C7E14 3C020B53 */ lui $v0, 0xb53 -/* EC7C8 802C7E18 34422B80 */ ori $v0, $v0, 0x2b80 -/* EC7CC 802C7E1C 03E00008 */ jr $ra -/* EC7D0 802C7E20 00A21021 */ addu $v0, $a1, $v0 -.L802C7E24: -/* EC7D4 802C7E24 34429800 */ ori $v0, $v0, 0x9800 -/* EC7D8 802C7E28 0045102A */ slt $v0, $v0, $a1 -/* EC7DC 802C7E2C 54400005 */ bnel $v0, $zero, .L802C7E44 -/* EC7E0 802C7E30 3C02F7A7 */ lui $v0, 0xf7a7 -/* EC7E4 802C7E34 3C020A21 */ lui $v0, 0xa21 -/* EC7E8 802C7E38 3442FE80 */ ori $v0, $v0, 0xfe80 -/* EC7EC 802C7E3C 03E00008 */ jr $ra -/* EC7F0 802C7E40 00A21021 */ addu $v0, $a1, $v0 -.L802C7E44: -/* EC7F4 802C7E44 3442C500 */ ori $v0, $v0, 0xc500 -/* EC7F8 802C7E48 0045102A */ slt $v0, $v0, $a1 -/* EC7FC 802C7E4C 54400005 */ bnel $v0, $zero, .L802C7E64 -/* EC800 802C7E50 3C02F8D8 */ lui $v0, 0xf8d8 -/* EC804 802C7E54 3C0208F0 */ lui $v0, 0x8f0 -/* EC808 802C7E58 3442D180 */ ori $v0, $v0, 0xd180 -/* EC80C 802C7E5C 03E00008 */ jr $ra -/* EC810 802C7E60 00A21021 */ addu $v0, $a1, $v0 -.L802C7E64: -/* EC814 802C7E64 3442F200 */ ori $v0, $v0, 0xf200 -/* EC818 802C7E68 0045102A */ slt $v0, $v0, $a1 -/* EC81C 802C7E6C 54400005 */ bnel $v0, $zero, .L802C7E84 -/* EC820 802C7E70 3C02FA0A */ lui $v0, 0xfa0a -/* EC824 802C7E74 3C0207BF */ lui $v0, 0x7bf -/* EC828 802C7E78 3442A480 */ ori $v0, $v0, 0xa480 -/* EC82C 802C7E7C 03E00008 */ jr $ra -/* EC830 802C7E80 00A21021 */ addu $v0, $a1, $v0 -.L802C7E84: -/* EC834 802C7E84 34421F00 */ ori $v0, $v0, 0x1f00 -/* EC838 802C7E88 0045102A */ slt $v0, $v0, $a1 -/* EC83C 802C7E8C 54400005 */ bnel $v0, $zero, .L802C7EA4 -/* EC840 802C7E90 3C02FB3B */ lui $v0, 0xfb3b -/* EC844 802C7E94 3C02068E */ lui $v0, 0x68e -/* EC848 802C7E98 34427780 */ ori $v0, $v0, 0x7780 -/* EC84C 802C7E9C 03E00008 */ jr $ra -/* EC850 802C7EA0 00A21021 */ addu $v0, $a1, $v0 -.L802C7EA4: -/* EC854 802C7EA4 34424C00 */ ori $v0, $v0, 0x4c00 -/* EC858 802C7EA8 0045102A */ slt $v0, $v0, $a1 -/* EC85C 802C7EAC 54400005 */ bnel $v0, $zero, .L802C7EC4 -/* EC860 802C7EB0 3C02FC6C */ lui $v0, 0xfc6c -/* EC864 802C7EB4 3C02055D */ lui $v0, 0x55d -/* EC868 802C7EB8 34424A80 */ ori $v0, $v0, 0x4a80 -/* EC86C 802C7EBC 03E00008 */ jr $ra -/* EC870 802C7EC0 00A21021 */ addu $v0, $a1, $v0 -.L802C7EC4: -/* EC874 802C7EC4 34427900 */ ori $v0, $v0, 0x7900 -/* EC878 802C7EC8 0045102A */ slt $v0, $v0, $a1 -/* EC87C 802C7ECC 54400005 */ bnel $v0, $zero, .L802C7EE4 -/* EC880 802C7ED0 3C02FD9D */ lui $v0, 0xfd9d -/* EC884 802C7ED4 3C02042C */ lui $v0, 0x42c -/* EC888 802C7ED8 34421D80 */ ori $v0, $v0, 0x1d80 -/* EC88C 802C7EDC 03E00008 */ jr $ra -/* EC890 802C7EE0 00A21021 */ addu $v0, $a1, $v0 -.L802C7EE4: -/* EC894 802C7EE4 3442A600 */ ori $v0, $v0, 0xa600 -/* EC898 802C7EE8 0045102A */ slt $v0, $v0, $a1 -/* EC89C 802C7EEC 54400005 */ bnel $v0, $zero, .L802C7F04 -/* EC8A0 802C7EF0 3C02FECE */ lui $v0, 0xfece -/* EC8A4 802C7EF4 3C0202FA */ lui $v0, 0x2fa -/* EC8A8 802C7EF8 3442F080 */ ori $v0, $v0, 0xf080 -/* EC8AC 802C7EFC 03E00008 */ jr $ra -/* EC8B0 802C7F00 00A21021 */ addu $v0, $a1, $v0 -.L802C7F04: -/* EC8B4 802C7F04 3442D300 */ ori $v0, $v0, 0xd300 -/* EC8B8 802C7F08 0045102A */ slt $v0, $v0, $a1 -/* EC8BC 802C7F0C 1440FFAB */ bnez $v0, .L802C7DBC -/* EC8C0 802C7F10 3C0201C9 */ lui $v0, 0x1c9 -/* EC8C4 802C7F14 3442C380 */ ori $v0, $v0, 0xc380 -/* EC8C8 802C7F18 03E00008 */ jr $ra -/* EC8CC 802C7F1C 00A21021 */ addu $v0, $a1, $v0 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/get_variable_index_alt.s b/asm/nonmatchings/code_e92d0_len_5da0/get_variable_index_alt.s deleted file mode 100644 index 932641988c..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/get_variable_index_alt.s +++ /dev/null @@ -1,109 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel get_variable_index_alt -/* EC8D0 802C7F20 3C02EFE8 */ lui $v0, 0xefe8 -/* EC8D4 802C7F24 34422080 */ ori $v0, $v0, 0x2080 -/* EC8D8 802C7F28 0044102A */ slt $v0, $v0, $a0 -/* EC8DC 802C7F2C 14400003 */ bnez $v0, .L802C7F3C -/* EC8E0 802C7F30 3C02F119 */ lui $v0, 0xf119 -.L802C7F34: -/* EC8E4 802C7F34 03E00008 */ jr $ra -/* EC8E8 802C7F38 0080102D */ daddu $v0, $a0, $zero -.L802C7F3C: -/* EC8EC 802C7F3C 34424D80 */ ori $v0, $v0, 0x4d80 -/* EC8F0 802C7F40 0044102A */ slt $v0, $v0, $a0 -/* EC8F4 802C7F44 1040FFFB */ beqz $v0, .L802C7F34 -/* EC8F8 802C7F48 3C02F2E3 */ lui $v0, 0xf2e3 -/* EC8FC 802C7F4C 34421100 */ ori $v0, $v0, 0x1100 -/* EC900 802C7F50 0044102A */ slt $v0, $v0, $a0 -/* EC904 802C7F54 1040FFF7 */ beqz $v0, .L802C7F34 -/* EC908 802C7F58 3C02F414 */ lui $v0, 0xf414 -/* EC90C 802C7F5C 34423E00 */ ori $v0, $v0, 0x3e00 -/* EC910 802C7F60 0044102A */ slt $v0, $v0, $a0 -/* EC914 802C7F64 54400005 */ bnel $v0, $zero, .L802C7F7C -/* EC918 802C7F68 3C02F545 */ lui $v0, 0xf545 -/* EC91C 802C7F6C 3C020C84 */ lui $v0, 0xc84 -/* EC920 802C7F70 34425880 */ ori $v0, $v0, 0x5880 -/* EC924 802C7F74 03E00008 */ jr $ra -/* EC928 802C7F78 00821021 */ addu $v0, $a0, $v0 -.L802C7F7C: -/* EC92C 802C7F7C 34426B00 */ ori $v0, $v0, 0x6b00 -/* EC930 802C7F80 0044102A */ slt $v0, $v0, $a0 -/* EC934 802C7F84 54400005 */ bnel $v0, $zero, .L802C7F9C -/* EC938 802C7F88 3C02F676 */ lui $v0, 0xf676 -/* EC93C 802C7F8C 3C020B53 */ lui $v0, 0xb53 -/* EC940 802C7F90 34422B80 */ ori $v0, $v0, 0x2b80 -/* EC944 802C7F94 03E00008 */ jr $ra -/* EC948 802C7F98 00821021 */ addu $v0, $a0, $v0 -.L802C7F9C: -/* EC94C 802C7F9C 34429800 */ ori $v0, $v0, 0x9800 -/* EC950 802C7FA0 0044102A */ slt $v0, $v0, $a0 -/* EC954 802C7FA4 54400005 */ bnel $v0, $zero, .L802C7FBC -/* EC958 802C7FA8 3C02F7A7 */ lui $v0, 0xf7a7 -/* EC95C 802C7FAC 3C020A21 */ lui $v0, 0xa21 -/* EC960 802C7FB0 3442FE80 */ ori $v0, $v0, 0xfe80 -/* EC964 802C7FB4 03E00008 */ jr $ra -/* EC968 802C7FB8 00821021 */ addu $v0, $a0, $v0 -.L802C7FBC: -/* EC96C 802C7FBC 3442C500 */ ori $v0, $v0, 0xc500 -/* EC970 802C7FC0 0044102A */ slt $v0, $v0, $a0 -/* EC974 802C7FC4 54400005 */ bnel $v0, $zero, .L802C7FDC -/* EC978 802C7FC8 3C02F8D8 */ lui $v0, 0xf8d8 -/* EC97C 802C7FCC 3C0208F0 */ lui $v0, 0x8f0 -/* EC980 802C7FD0 3442D180 */ ori $v0, $v0, 0xd180 -/* EC984 802C7FD4 03E00008 */ jr $ra -/* EC988 802C7FD8 00821021 */ addu $v0, $a0, $v0 -.L802C7FDC: -/* EC98C 802C7FDC 3442F200 */ ori $v0, $v0, 0xf200 -/* EC990 802C7FE0 0044102A */ slt $v0, $v0, $a0 -/* EC994 802C7FE4 54400005 */ bnel $v0, $zero, .L802C7FFC -/* EC998 802C7FE8 3C02FA0A */ lui $v0, 0xfa0a -/* EC99C 802C7FEC 3C0207BF */ lui $v0, 0x7bf -/* EC9A0 802C7FF0 3442A480 */ ori $v0, $v0, 0xa480 -/* EC9A4 802C7FF4 03E00008 */ jr $ra -/* EC9A8 802C7FF8 00821021 */ addu $v0, $a0, $v0 -.L802C7FFC: -/* EC9AC 802C7FFC 34421F00 */ ori $v0, $v0, 0x1f00 -/* EC9B0 802C8000 0044102A */ slt $v0, $v0, $a0 -/* EC9B4 802C8004 54400005 */ bnel $v0, $zero, .L802C801C -/* EC9B8 802C8008 3C02FB3B */ lui $v0, 0xfb3b -/* EC9BC 802C800C 3C02068E */ lui $v0, 0x68e -/* EC9C0 802C8010 34427780 */ ori $v0, $v0, 0x7780 -/* EC9C4 802C8014 03E00008 */ jr $ra -/* EC9C8 802C8018 00821021 */ addu $v0, $a0, $v0 -.L802C801C: -/* EC9CC 802C801C 34424C00 */ ori $v0, $v0, 0x4c00 -/* EC9D0 802C8020 0044102A */ slt $v0, $v0, $a0 -/* EC9D4 802C8024 54400005 */ bnel $v0, $zero, .L802C803C -/* EC9D8 802C8028 3C02FC6C */ lui $v0, 0xfc6c -/* EC9DC 802C802C 3C02055D */ lui $v0, 0x55d -/* EC9E0 802C8030 34424A80 */ ori $v0, $v0, 0x4a80 -/* EC9E4 802C8034 03E00008 */ jr $ra -/* EC9E8 802C8038 00821021 */ addu $v0, $a0, $v0 -.L802C803C: -/* EC9EC 802C803C 34427900 */ ori $v0, $v0, 0x7900 -/* EC9F0 802C8040 0044102A */ slt $v0, $v0, $a0 -/* EC9F4 802C8044 54400005 */ bnel $v0, $zero, .L802C805C -/* EC9F8 802C8048 3C02FD9D */ lui $v0, 0xfd9d -/* EC9FC 802C804C 3C02042C */ lui $v0, 0x42c -/* ECA00 802C8050 34421D80 */ ori $v0, $v0, 0x1d80 -/* ECA04 802C8054 03E00008 */ jr $ra -/* ECA08 802C8058 00821021 */ addu $v0, $a0, $v0 -.L802C805C: -/* ECA0C 802C805C 3442A600 */ ori $v0, $v0, 0xa600 -/* ECA10 802C8060 0044102A */ slt $v0, $v0, $a0 -/* ECA14 802C8064 54400005 */ bnel $v0, $zero, .L802C807C -/* ECA18 802C8068 3C02FECE */ lui $v0, 0xfece -/* ECA1C 802C806C 3C0202FA */ lui $v0, 0x2fa -/* ECA20 802C8070 3442F080 */ ori $v0, $v0, 0xf080 -/* ECA24 802C8074 03E00008 */ jr $ra -/* ECA28 802C8078 00821021 */ addu $v0, $a0, $v0 -.L802C807C: -/* ECA2C 802C807C 3442D300 */ ori $v0, $v0, 0xd300 -/* ECA30 802C8080 0044102A */ slt $v0, $v0, $a0 -/* ECA34 802C8084 1440FFAB */ bnez $v0, .L802C7F34 -/* ECA38 802C8088 3C0201C9 */ lui $v0, 0x1c9 -/* ECA3C 802C808C 3442C380 */ ori $v0, $v0, 0xc380 -/* ECA40 802C8090 03E00008 */ jr $ra -/* ECA44 802C8094 00821021 */ addu $v0, $a0, $v0 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_goto_end_loop.s b/asm/nonmatchings/code_e92d0_len_5da0/si_goto_end_loop.s index e88ccb843c..10bd005521 100644 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_goto_end_loop.s +++ b/asm/nonmatchings/code_e92d0_len_5da0/si_goto_end_loop.s @@ -38,70 +38,3 @@ glabel si_goto_end_loop .L802C8B58: /* ED508 802C8B58 080B22BE */ j .L802C8AF8 /* ED50C 802C8B5C 24A50001 */ addiu $a1, $a1, 1 -/* ED510 802C8B60 27BDFF88 */ addiu $sp, $sp, -0x78 -/* ED514 802C8B64 AFB20058 */ sw $s2, 0x58($sp) -/* ED518 802C8B68 0080902D */ daddu $s2, $a0, $zero -/* ED51C 802C8B6C AFBF005C */ sw $ra, 0x5c($sp) -/* ED520 802C8B70 AFB10054 */ sw $s1, 0x54($sp) -/* ED524 802C8B74 AFB00050 */ sw $s0, 0x50($sp) -/* ED528 802C8B78 F7B80070 */ sdc1 $f24, 0x70($sp) -/* ED52C 802C8B7C F7B60068 */ sdc1 $f22, 0x68($sp) -/* ED530 802C8B80 F7B40060 */ sdc1 $f20, 0x60($sp) -/* ED534 802C8B84 8E50000C */ lw $s0, 0xc($s2) -/* ED538 802C8B88 8E050000 */ lw $a1, ($s0) -/* ED53C 802C8B8C 0C0B1EAF */ jal get_variable -/* ED540 802C8B90 26100004 */ addiu $s0, $s0, 4 -/* ED544 802C8B94 0C046C04 */ jal get_model_list_index_from_tree_index -/* ED548 802C8B98 0040202D */ daddu $a0, $v0, $zero -/* ED54C 802C8B9C 8E050000 */ lw $a1, ($s0) -/* ED550 802C8BA0 26100004 */ addiu $s0, $s0, 4 -/* ED554 802C8BA4 0240202D */ daddu $a0, $s2, $zero -/* ED558 802C8BA8 0C0B210B */ jal get_float_variable -/* ED55C 802C8BAC 0040882D */ daddu $s1, $v0, $zero -/* ED560 802C8BB0 8E050000 */ lw $a1, ($s0) -/* ED564 802C8BB4 26100004 */ addiu $s0, $s0, 4 -/* ED568 802C8BB8 0240202D */ daddu $a0, $s2, $zero -/* ED56C 802C8BBC 0C0B210B */ jal get_float_variable -/* ED570 802C8BC0 46000606 */ mov.s $f24, $f0 -/* ED574 802C8BC4 0240202D */ daddu $a0, $s2, $zero -/* ED578 802C8BC8 8E050000 */ lw $a1, ($s0) -/* ED57C 802C8BCC 0C0B210B */ jal get_float_variable -/* ED580 802C8BD0 46000586 */ mov.s $f22, $f0 -/* ED584 802C8BD4 0220202D */ daddu $a0, $s1, $zero -/* ED588 802C8BD8 0C046B4C */ jal get_model_from_list_index -/* ED58C 802C8BDC 46000506 */ mov.s $f20, $f0 -/* ED590 802C8BE0 0040802D */ daddu $s0, $v0, $zero -/* ED594 802C8BE4 96020000 */ lhu $v0, ($s0) -/* ED598 802C8BE8 30420400 */ andi $v0, $v0, 0x400 -/* ED59C 802C8BEC 1440000A */ bnez $v0, .L802C8C18 -/* ED5A0 802C8BF0 00000000 */ nop -/* ED5A4 802C8BF4 4405C000 */ mfc1 $a1, $f24 -/* ED5A8 802C8BF8 4406B000 */ mfc1 $a2, $f22 -/* ED5AC 802C8BFC 4407A000 */ mfc1 $a3, $f20 -/* ED5B0 802C8C00 0C019E40 */ jal guTranslateF -/* ED5B4 802C8C04 26040058 */ addiu $a0, $s0, 0x58 -/* ED5B8 802C8C08 96020000 */ lhu $v0, ($s0) -/* ED5BC 802C8C0C 34421400 */ ori $v0, $v0, 0x1400 -/* ED5C0 802C8C10 080B230F */ j .L802C8C3C -/* ED5C4 802C8C14 A6020000 */ sh $v0, ($s0) -.L802C8C18: -/* ED5C8 802C8C18 4405C000 */ mfc1 $a1, $f24 -/* ED5CC 802C8C1C 4406B000 */ mfc1 $a2, $f22 -/* ED5D0 802C8C20 4407A000 */ mfc1 $a3, $f20 -/* ED5D4 802C8C24 0C019E40 */ jal guTranslateF -/* ED5D8 802C8C28 27A40010 */ addiu $a0, $sp, 0x10 -/* ED5DC 802C8C2C 27A40010 */ addiu $a0, $sp, 0x10 -/* ED5E0 802C8C30 26050058 */ addiu $a1, $s0, 0x58 -/* ED5E4 802C8C34 0C019D80 */ jal guMtxCatF -/* ED5E8 802C8C38 00A0302D */ daddu $a2, $a1, $zero -.L802C8C3C: -/* ED5EC 802C8C3C 8FBF005C */ lw $ra, 0x5c($sp) -/* ED5F0 802C8C40 8FB20058 */ lw $s2, 0x58($sp) -/* ED5F4 802C8C44 8FB10054 */ lw $s1, 0x54($sp) -/* ED5F8 802C8C48 8FB00050 */ lw $s0, 0x50($sp) -/* ED5FC 802C8C4C D7B80070 */ ldc1 $f24, 0x70($sp) -/* ED600 802C8C50 D7B60068 */ ldc1 $f22, 0x68($sp) -/* ED604 802C8C54 D7B40060 */ ldc1 $f20, 0x60($sp) -/* ED608 802C8C58 24020002 */ addiu $v0, $zero, 2 -/* ED60C 802C8C5C 03E00008 */ jr $ra -/* ED610 802C8C60 27BD0078 */ addiu $sp, $sp, 0x78 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_bind.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_bind.s deleted file mode 100644 index 73b13b52cf..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_bind.s +++ /dev/null @@ -1,73 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_bind -/* EB0C4 802C6714 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* EB0C8 802C6718 AFB3003C */ sw $s3, 0x3c($sp) -/* EB0CC 802C671C 0080982D */ daddu $s3, $a0, $zero -/* EB0D0 802C6720 AFBF0044 */ sw $ra, 0x44($sp) -/* EB0D4 802C6724 AFB40040 */ sw $s4, 0x40($sp) -/* EB0D8 802C6728 AFB20038 */ sw $s2, 0x38($sp) -/* EB0DC 802C672C AFB10034 */ sw $s1, 0x34($sp) -/* EB0E0 802C6730 AFB00030 */ sw $s0, 0x30($sp) -/* EB0E4 802C6734 8E70000C */ lw $s0, 0xc($s3) -/* EB0E8 802C6738 8E050000 */ lw $a1, ($s0) -/* EB0EC 802C673C 0C0B1EAF */ jal get_variable -/* EB0F0 802C6740 26100004 */ addiu $s0, $s0, 4 -/* EB0F4 802C6744 8E030000 */ lw $v1, ($s0) -/* EB0F8 802C6748 26100004 */ addiu $s0, $s0, 4 -/* EB0FC 802C674C 8E110000 */ lw $s1, ($s0) -/* EB100 802C6750 26100004 */ addiu $s0, $s0, 4 -/* EB104 802C6754 0260202D */ daddu $a0, $s3, $zero -/* EB108 802C6758 3C060100 */ lui $a2, 0x100 -/* EB10C 802C675C 8E120000 */ lw $s2, ($s0) -/* EB110 802C6760 8E140004 */ lw $s4, 4($s0) -/* EB114 802C6764 0040802D */ daddu $s0, $v0, $zero -/* EB118 802C6768 0220282D */ daddu $a1, $s1, $zero -/* EB11C 802C676C 00661825 */ or $v1, $v1, $a2 -/* EB120 802C6770 0C0B1EAF */ jal get_variable -/* EB124 802C6774 AFA30010 */ sw $v1, 0x10($sp) -/* EB128 802C6778 0260202D */ daddu $a0, $s3, $zero -/* EB12C 802C677C 0220282D */ daddu $a1, $s1, $zero -/* EB130 802C6780 0C0B1F6A */ jal get_variable_index -/* EB134 802C6784 AFA20018 */ sw $v0, 0x18($sp) -/* EB138 802C6788 27A40010 */ addiu $a0, $sp, 0x10 -/* EB13C 802C678C A7A20014 */ sh $v0, 0x14($sp) -/* EB140 802C6790 3C02802C */ lui $v0, 0x802c -/* EB144 802C6794 2442667C */ addiu $v0, $v0, 0x667c -/* EB148 802C6798 AFB20028 */ sw $s2, 0x28($sp) -/* EB14C 802C679C AFA00024 */ sw $zero, 0x24($sp) -/* EB150 802C67A0 0C0515DB */ jal create_trigger -/* EB154 802C67A4 AFA2001C */ sw $v0, 0x1c($sp) -/* EB158 802C67A8 0040882D */ daddu $s1, $v0, $zero -/* EB15C 802C67AC AE300010 */ sw $s0, 0x10($s1) -/* EB160 802C67B0 AE200014 */ sw $zero, 0x14($s1) -/* EB164 802C67B4 92620003 */ lbu $v0, 3($s3) -/* EB168 802C67B8 AE220018 */ sw $v0, 0x18($s1) -/* EB16C 802C67BC 8E650084 */ lw $a1, 0x84($s3) -/* EB170 802C67C0 0C0B1EAF */ jal get_variable -/* EB174 802C67C4 0260202D */ daddu $a0, $s3, $zero -/* EB178 802C67C8 AE22001C */ sw $v0, 0x1c($s1) -/* EB17C 802C67CC 8E650088 */ lw $a1, 0x88($s3) -/* EB180 802C67D0 0C0B1EAF */ jal get_variable -/* EB184 802C67D4 0260202D */ daddu $a0, $s3, $zero -/* EB188 802C67D8 AE220020 */ sw $v0, 0x20($s1) -/* EB18C 802C67DC 8E65008C */ lw $a1, 0x8c($s3) -/* EB190 802C67E0 0C0B1EAF */ jal get_variable -/* EB194 802C67E4 0260202D */ daddu $a0, $s3, $zero -/* EB198 802C67E8 12800005 */ beqz $s4, .L802C6800 -/* EB19C 802C67EC AE220024 */ sw $v0, 0x24($s1) -/* EB1A0 802C67F0 0260202D */ daddu $a0, $s3, $zero -/* EB1A4 802C67F4 0280282D */ daddu $a1, $s4, $zero -/* EB1A8 802C67F8 0C0B2026 */ jal set_variable -/* EB1AC 802C67FC 0220302D */ daddu $a2, $s1, $zero -.L802C6800: -/* EB1B0 802C6800 8FBF0044 */ lw $ra, 0x44($sp) -/* EB1B4 802C6804 8FB40040 */ lw $s4, 0x40($sp) -/* EB1B8 802C6808 8FB3003C */ lw $s3, 0x3c($sp) -/* EB1BC 802C680C 8FB20038 */ lw $s2, 0x38($sp) -/* EB1C0 802C6810 8FB10034 */ lw $s1, 0x34($sp) -/* EB1C4 802C6814 8FB00030 */ lw $s0, 0x30($sp) -/* EB1C8 802C6818 24020002 */ addiu $v0, $zero, 2 -/* EB1CC 802C681C 03E00008 */ jr $ra -/* EB1D0 802C6820 27BD0048 */ addiu $sp, $sp, 0x48 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_call.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_call.s deleted file mode 100644 index d87e1d5c7b..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_call.s +++ /dev/null @@ -1,39 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_call -/* EAD98 802C63E8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* EAD9C 802C63EC AFB10014 */ sw $s1, 0x14($sp) -/* EADA0 802C63F0 0080882D */ daddu $s1, $a0, $zero -/* EADA4 802C63F4 AFBF0018 */ sw $ra, 0x18($sp) -/* EADA8 802C63F8 AFB00010 */ sw $s0, 0x10($sp) -/* EADAC 802C63FC 82220005 */ lb $v0, 5($s1) -/* EADB0 802C6400 8E30000C */ lw $s0, 0xc($s1) -/* EADB4 802C6404 10400004 */ beqz $v0, .L802C6418 -/* EADB8 802C6408 0000282D */ daddu $a1, $zero, $zero -/* EADBC 802C640C 8E260080 */ lw $a2, 0x80($s1) -/* EADC0 802C6410 080B1914 */ j .L802C6450 -/* EADC4 802C6414 00000000 */ nop -.L802C6418: -/* EADC8 802C6418 8E050000 */ lw $a1, ($s0) -/* EADCC 802C641C 26100004 */ addiu $s0, $s0, 4 -/* EADD0 802C6420 0C0B1EAF */ jal get_variable -/* EADD4 802C6424 0220202D */ daddu $a0, $s1, $zero -/* EADD8 802C6428 0220202D */ daddu $a0, $s1, $zero -/* EADDC 802C642C AC820080 */ sw $v0, 0x80($a0) -/* EADE0 802C6430 0040302D */ daddu $a2, $v0, $zero -/* EADE4 802C6434 24050001 */ addiu $a1, $zero, 1 -/* EADE8 802C6438 90820001 */ lbu $v0, 1($a0) -/* EADEC 802C643C 00A0182D */ daddu $v1, $a1, $zero -/* EADF0 802C6440 AC90000C */ sw $s0, 0xc($a0) -/* EADF4 802C6444 A0830005 */ sb $v1, 5($a0) -/* EADF8 802C6448 2442FFFF */ addiu $v0, $v0, -1 -/* EADFC 802C644C A0820001 */ sb $v0, 1($a0) -.L802C6450: -/* EAE00 802C6450 00C0F809 */ jalr $a2 -/* EAE04 802C6454 00000000 */ nop -/* EAE08 802C6458 8FBF0018 */ lw $ra, 0x18($sp) -/* EAE0C 802C645C 8FB10014 */ lw $s1, 0x14($sp) -/* EAE10 802C6460 8FB00010 */ lw $s0, 0x10($sp) -/* EAE14 802C6464 03E00008 */ jr $ra -/* EAE18 802C6468 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_AND.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_AND.s deleted file mode 100644 index 6a9b158fdc..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_AND.s +++ /dev/null @@ -1,39 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_case_AND -/* E9E4C 802C549C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* E9E50 802C54A0 AFB00010 */ sw $s0, 0x10($sp) -/* E9E54 802C54A4 0080802D */ daddu $s0, $a0, $zero -/* E9E58 802C54A8 AFBF0014 */ sw $ra, 0x14($sp) -/* E9E5C 802C54AC 82030007 */ lb $v1, 7($s0) -/* E9E60 802C54B0 8E04000C */ lw $a0, 0xc($s0) -/* E9E64 802C54B4 04610003 */ bgez $v1, .L802C54C4 -/* E9E68 802C54B8 00031080 */ sll $v0, $v1, 2 -.L802C54BC: -/* E9E6C 802C54BC 080B152F */ j .L802C54BC -/* E9E70 802C54C0 00000000 */ nop -.L802C54C4: -/* E9E74 802C54C4 02021021 */ addu $v0, $s0, $v0 -/* E9E78 802C54C8 02032821 */ addu $a1, $s0, $v1 -/* E9E7C 802C54CC 8C840000 */ lw $a0, ($a0) -/* E9E80 802C54D0 80A30110 */ lb $v1, 0x110($a1) -/* E9E84 802C54D4 8C420118 */ lw $v0, 0x118($v0) -/* E9E88 802C54D8 1C600005 */ bgtz $v1, .L802C54F0 -/* E9E8C 802C54DC 00821024 */ and $v0, $a0, $v0 -/* E9E90 802C54E0 0C0B2279 */ jal si_goto_end_case -/* E9E94 802C54E4 0200202D */ daddu $a0, $s0, $zero -/* E9E98 802C54E8 080B1541 */ j .L802C5504 -/* E9E9C 802C54EC AE020008 */ sw $v0, 8($s0) -.L802C54F0: -/* E9EA0 802C54F0 54400004 */ bnel $v0, $zero, .L802C5504 -/* E9EA4 802C54F4 A0A00110 */ sb $zero, 0x110($a1) -/* E9EA8 802C54F8 0C0B2298 */ jal si_goto_next_case -/* E9EAC 802C54FC 0200202D */ daddu $a0, $s0, $zero -/* E9EB0 802C5500 AE020008 */ sw $v0, 8($s0) -.L802C5504: -/* E9EB4 802C5504 24020002 */ addiu $v0, $zero, 2 -/* E9EB8 802C5508 8FBF0014 */ lw $ra, 0x14($sp) -/* E9EBC 802C550C 8FB00010 */ lw $s0, 0x10($sp) -/* E9EC0 802C5510 03E00008 */ jr $ra -/* E9EC4 802C5514 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_equal.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_equal.s deleted file mode 100644 index eebfc7c815..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_equal.s +++ /dev/null @@ -1,43 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_case_equal -/* E99E0 802C5030 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* E99E4 802C5034 AFB10014 */ sw $s1, 0x14($sp) -/* E99E8 802C5038 0080882D */ daddu $s1, $a0, $zero -/* E99EC 802C503C AFBF0018 */ sw $ra, 0x18($sp) -/* E99F0 802C5040 AFB00010 */ sw $s0, 0x10($sp) -/* E99F4 802C5044 82300007 */ lb $s0, 7($s1) -/* E99F8 802C5048 06010003 */ bgez $s0, .L802C5058 -/* E99FC 802C504C 8E25000C */ lw $a1, 0xc($s1) -.L802C5050: -/* E9A00 802C5050 080B1414 */ j .L802C5050 -/* E9A04 802C5054 00000000 */ nop -.L802C5058: -/* E9A08 802C5058 8CA50000 */ lw $a1, ($a1) -/* E9A0C 802C505C 0C0B1EAF */ jal get_variable -/* E9A10 802C5060 0220202D */ daddu $a0, $s1, $zero -/* E9A14 802C5064 0040282D */ daddu $a1, $v0, $zero -/* E9A18 802C5068 00101080 */ sll $v0, $s0, 2 -/* E9A1C 802C506C 02221021 */ addu $v0, $s1, $v0 -/* E9A20 802C5070 02302021 */ addu $a0, $s1, $s0 -/* E9A24 802C5074 80830110 */ lb $v1, 0x110($a0) -/* E9A28 802C5078 1C600005 */ bgtz $v1, .L802C5090 -/* E9A2C 802C507C 8C420118 */ lw $v0, 0x118($v0) -/* E9A30 802C5080 0C0B2279 */ jal si_goto_end_case -/* E9A34 802C5084 0220202D */ daddu $a0, $s1, $zero -/* E9A38 802C5088 080B1429 */ j .L802C50A4 -/* E9A3C 802C508C AE220008 */ sw $v0, 8($s1) -.L802C5090: -/* E9A40 802C5090 50A20004 */ beql $a1, $v0, .L802C50A4 -/* E9A44 802C5094 A0800110 */ sb $zero, 0x110($a0) -/* E9A48 802C5098 0C0B2298 */ jal si_goto_next_case -/* E9A4C 802C509C 0220202D */ daddu $a0, $s1, $zero -/* E9A50 802C50A0 AE220008 */ sw $v0, 8($s1) -.L802C50A4: -/* E9A54 802C50A4 24020002 */ addiu $v0, $zero, 2 -/* E9A58 802C50A8 8FBF0018 */ lw $ra, 0x18($sp) -/* E9A5C 802C50AC 8FB10014 */ lw $s1, 0x14($sp) -/* E9A60 802C50B0 8FB00010 */ lw $s0, 0x10($sp) -/* E9A64 802C50B4 03E00008 */ jr $ra -/* E9A68 802C50B8 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_greater.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_greater.s deleted file mode 100644 index 5c552ed26a..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_greater.s +++ /dev/null @@ -1,44 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_case_greater -/* E9C18 802C5268 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* E9C1C 802C526C AFB10014 */ sw $s1, 0x14($sp) -/* E9C20 802C5270 0080882D */ daddu $s1, $a0, $zero -/* E9C24 802C5274 AFBF0018 */ sw $ra, 0x18($sp) -/* E9C28 802C5278 AFB00010 */ sw $s0, 0x10($sp) -/* E9C2C 802C527C 82300007 */ lb $s0, 7($s1) -/* E9C30 802C5280 06010003 */ bgez $s0, .L802C5290 -/* E9C34 802C5284 8E25000C */ lw $a1, 0xc($s1) -.L802C5288: -/* E9C38 802C5288 080B14A2 */ j .L802C5288 -/* E9C3C 802C528C 00000000 */ nop -.L802C5290: -/* E9C40 802C5290 8CA50000 */ lw $a1, ($a1) -/* E9C44 802C5294 0C0B1EAF */ jal get_variable -/* E9C48 802C5298 0220202D */ daddu $a0, $s1, $zero -/* E9C4C 802C529C 0040282D */ daddu $a1, $v0, $zero -/* E9C50 802C52A0 00101080 */ sll $v0, $s0, 2 -/* E9C54 802C52A4 02221021 */ addu $v0, $s1, $v0 -/* E9C58 802C52A8 02302021 */ addu $a0, $s1, $s0 -/* E9C5C 802C52AC 80830110 */ lb $v1, 0x110($a0) -/* E9C60 802C52B0 8C420118 */ lw $v0, 0x118($v0) -/* E9C64 802C52B4 1C600005 */ bgtz $v1, .L802C52CC -/* E9C68 802C52B8 00A2102A */ slt $v0, $a1, $v0 -/* E9C6C 802C52BC 0C0B2279 */ jal si_goto_end_case -/* E9C70 802C52C0 0220202D */ daddu $a0, $s1, $zero -/* E9C74 802C52C4 080B14B8 */ j .L802C52E0 -/* E9C78 802C52C8 AE220008 */ sw $v0, 8($s1) -.L802C52CC: -/* E9C7C 802C52CC 54400004 */ bnel $v0, $zero, .L802C52E0 -/* E9C80 802C52D0 A0800110 */ sb $zero, 0x110($a0) -/* E9C84 802C52D4 0C0B2298 */ jal si_goto_next_case -/* E9C88 802C52D8 0220202D */ daddu $a0, $s1, $zero -/* E9C8C 802C52DC AE220008 */ sw $v0, 8($s1) -.L802C52E0: -/* E9C90 802C52E0 24020002 */ addiu $v0, $zero, 2 -/* E9C94 802C52E4 8FBF0018 */ lw $ra, 0x18($sp) -/* E9C98 802C52E8 8FB10014 */ lw $s1, 0x14($sp) -/* E9C9C 802C52EC 8FB00010 */ lw $s0, 0x10($sp) -/* E9CA0 802C52F0 03E00008 */ jr $ra -/* E9CA4 802C52F4 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_greater_equal.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_greater_equal.s deleted file mode 100644 index d658b5799b..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_greater_equal.s +++ /dev/null @@ -1,44 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_case_greater_equal -/* E9CA8 802C52F8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* E9CAC 802C52FC AFB10014 */ sw $s1, 0x14($sp) -/* E9CB0 802C5300 0080882D */ daddu $s1, $a0, $zero -/* E9CB4 802C5304 AFBF0018 */ sw $ra, 0x18($sp) -/* E9CB8 802C5308 AFB00010 */ sw $s0, 0x10($sp) -/* E9CBC 802C530C 82300007 */ lb $s0, 7($s1) -/* E9CC0 802C5310 06010003 */ bgez $s0, .L802C5320 -/* E9CC4 802C5314 8E25000C */ lw $a1, 0xc($s1) -.L802C5318: -/* E9CC8 802C5318 080B14C6 */ j .L802C5318 -/* E9CCC 802C531C 00000000 */ nop -.L802C5320: -/* E9CD0 802C5320 8CA50000 */ lw $a1, ($a1) -/* E9CD4 802C5324 0C0B1EAF */ jal get_variable -/* E9CD8 802C5328 0220202D */ daddu $a0, $s1, $zero -/* E9CDC 802C532C 0040282D */ daddu $a1, $v0, $zero -/* E9CE0 802C5330 00101080 */ sll $v0, $s0, 2 -/* E9CE4 802C5334 02221021 */ addu $v0, $s1, $v0 -/* E9CE8 802C5338 02302021 */ addu $a0, $s1, $s0 -/* E9CEC 802C533C 80830110 */ lb $v1, 0x110($a0) -/* E9CF0 802C5340 8C420118 */ lw $v0, 0x118($v0) -/* E9CF4 802C5344 1C600005 */ bgtz $v1, .L802C535C -/* E9CF8 802C5348 0045102A */ slt $v0, $v0, $a1 -/* E9CFC 802C534C 0C0B2279 */ jal si_goto_end_case -/* E9D00 802C5350 0220202D */ daddu $a0, $s1, $zero -/* E9D04 802C5354 080B14DC */ j .L802C5370 -/* E9D08 802C5358 AE220008 */ sw $v0, 8($s1) -.L802C535C: -/* E9D0C 802C535C 50400004 */ beql $v0, $zero, .L802C5370 -/* E9D10 802C5360 A0800110 */ sb $zero, 0x110($a0) -/* E9D14 802C5364 0C0B2298 */ jal si_goto_next_case -/* E9D18 802C5368 0220202D */ daddu $a0, $s1, $zero -/* E9D1C 802C536C AE220008 */ sw $v0, 8($s1) -.L802C5370: -/* E9D20 802C5370 24020002 */ addiu $v0, $zero, 2 -/* E9D24 802C5374 8FBF0018 */ lw $ra, 0x18($sp) -/* E9D28 802C5378 8FB10014 */ lw $s1, 0x14($sp) -/* E9D2C 802C537C 8FB00010 */ lw $s0, 0x10($sp) -/* E9D30 802C5380 03E00008 */ jr $ra -/* E9D34 802C5384 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_less.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_less.s deleted file mode 100644 index 817b69315e..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_less.s +++ /dev/null @@ -1,44 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_case_less -/* E9AF8 802C5148 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* E9AFC 802C514C AFB10014 */ sw $s1, 0x14($sp) -/* E9B00 802C5150 0080882D */ daddu $s1, $a0, $zero -/* E9B04 802C5154 AFBF0018 */ sw $ra, 0x18($sp) -/* E9B08 802C5158 AFB00010 */ sw $s0, 0x10($sp) -/* E9B0C 802C515C 82300007 */ lb $s0, 7($s1) -/* E9B10 802C5160 06010003 */ bgez $s0, .L802C5170 -/* E9B14 802C5164 8E25000C */ lw $a1, 0xc($s1) -.L802C5168: -/* E9B18 802C5168 080B145A */ j .L802C5168 -/* E9B1C 802C516C 00000000 */ nop -.L802C5170: -/* E9B20 802C5170 8CA50000 */ lw $a1, ($a1) -/* E9B24 802C5174 0C0B1EAF */ jal get_variable -/* E9B28 802C5178 0220202D */ daddu $a0, $s1, $zero -/* E9B2C 802C517C 0040282D */ daddu $a1, $v0, $zero -/* E9B30 802C5180 00101080 */ sll $v0, $s0, 2 -/* E9B34 802C5184 02221021 */ addu $v0, $s1, $v0 -/* E9B38 802C5188 02302021 */ addu $a0, $s1, $s0 -/* E9B3C 802C518C 80830110 */ lb $v1, 0x110($a0) -/* E9B40 802C5190 8C420118 */ lw $v0, 0x118($v0) -/* E9B44 802C5194 1C600005 */ bgtz $v1, .L802C51AC -/* E9B48 802C5198 0045102A */ slt $v0, $v0, $a1 -/* E9B4C 802C519C 0C0B2279 */ jal si_goto_end_case -/* E9B50 802C51A0 0220202D */ daddu $a0, $s1, $zero -/* E9B54 802C51A4 080B1470 */ j .L802C51C0 -/* E9B58 802C51A8 AE220008 */ sw $v0, 8($s1) -.L802C51AC: -/* E9B5C 802C51AC 54400004 */ bnel $v0, $zero, .L802C51C0 -/* E9B60 802C51B0 A0800110 */ sb $zero, 0x110($a0) -/* E9B64 802C51B4 0C0B2298 */ jal si_goto_next_case -/* E9B68 802C51B8 0220202D */ daddu $a0, $s1, $zero -/* E9B6C 802C51BC AE220008 */ sw $v0, 8($s1) -.L802C51C0: -/* E9B70 802C51C0 24020002 */ addiu $v0, $zero, 2 -/* E9B74 802C51C4 8FBF0018 */ lw $ra, 0x18($sp) -/* E9B78 802C51C8 8FB10014 */ lw $s1, 0x14($sp) -/* E9B7C 802C51CC 8FB00010 */ lw $s0, 0x10($sp) -/* E9B80 802C51D0 03E00008 */ jr $ra -/* E9B84 802C51D4 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_less_equal.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_less_equal.s deleted file mode 100644 index ea95c90a38..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_less_equal.s +++ /dev/null @@ -1,44 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_case_less_equal -/* E9B88 802C51D8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* E9B8C 802C51DC AFB10014 */ sw $s1, 0x14($sp) -/* E9B90 802C51E0 0080882D */ daddu $s1, $a0, $zero -/* E9B94 802C51E4 AFBF0018 */ sw $ra, 0x18($sp) -/* E9B98 802C51E8 AFB00010 */ sw $s0, 0x10($sp) -/* E9B9C 802C51EC 82300007 */ lb $s0, 7($s1) -/* E9BA0 802C51F0 06010003 */ bgez $s0, .L802C5200 -/* E9BA4 802C51F4 8E25000C */ lw $a1, 0xc($s1) -.L802C51F8: -/* E9BA8 802C51F8 080B147E */ j .L802C51F8 -/* E9BAC 802C51FC 00000000 */ nop -.L802C5200: -/* E9BB0 802C5200 8CA50000 */ lw $a1, ($a1) -/* E9BB4 802C5204 0C0B1EAF */ jal get_variable -/* E9BB8 802C5208 0220202D */ daddu $a0, $s1, $zero -/* E9BBC 802C520C 0040282D */ daddu $a1, $v0, $zero -/* E9BC0 802C5210 00101080 */ sll $v0, $s0, 2 -/* E9BC4 802C5214 02221021 */ addu $v0, $s1, $v0 -/* E9BC8 802C5218 02302021 */ addu $a0, $s1, $s0 -/* E9BCC 802C521C 80830110 */ lb $v1, 0x110($a0) -/* E9BD0 802C5220 8C420118 */ lw $v0, 0x118($v0) -/* E9BD4 802C5224 1C600005 */ bgtz $v1, .L802C523C -/* E9BD8 802C5228 00A2102A */ slt $v0, $a1, $v0 -/* E9BDC 802C522C 0C0B2279 */ jal si_goto_end_case -/* E9BE0 802C5230 0220202D */ daddu $a0, $s1, $zero -/* E9BE4 802C5234 080B1494 */ j .L802C5250 -/* E9BE8 802C5238 AE220008 */ sw $v0, 8($s1) -.L802C523C: -/* E9BEC 802C523C 50400004 */ beql $v0, $zero, .L802C5250 -/* E9BF0 802C5240 A0800110 */ sb $zero, 0x110($a0) -/* E9BF4 802C5244 0C0B2298 */ jal si_goto_next_case -/* E9BF8 802C5248 0220202D */ daddu $a0, $s1, $zero -/* E9BFC 802C524C AE220008 */ sw $v0, 8($s1) -.L802C5250: -/* E9C00 802C5250 24020002 */ addiu $v0, $zero, 2 -/* E9C04 802C5254 8FBF0018 */ lw $ra, 0x18($sp) -/* E9C08 802C5258 8FB10014 */ lw $s1, 0x14($sp) -/* E9C0C 802C525C 8FB00010 */ lw $s0, 0x10($sp) -/* E9C10 802C5260 03E00008 */ jr $ra -/* E9C14 802C5264 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_not_equal.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_not_equal.s deleted file mode 100644 index 504266e787..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_not_equal.s +++ /dev/null @@ -1,43 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_case_not_equal -/* E9A6C 802C50BC 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* E9A70 802C50C0 AFB10014 */ sw $s1, 0x14($sp) -/* E9A74 802C50C4 0080882D */ daddu $s1, $a0, $zero -/* E9A78 802C50C8 AFBF0018 */ sw $ra, 0x18($sp) -/* E9A7C 802C50CC AFB00010 */ sw $s0, 0x10($sp) -/* E9A80 802C50D0 82300007 */ lb $s0, 7($s1) -/* E9A84 802C50D4 06010003 */ bgez $s0, .L802C50E4 -/* E9A88 802C50D8 8E25000C */ lw $a1, 0xc($s1) -.L802C50DC: -/* E9A8C 802C50DC 080B1437 */ j .L802C50DC -/* E9A90 802C50E0 00000000 */ nop -.L802C50E4: -/* E9A94 802C50E4 8CA50000 */ lw $a1, ($a1) -/* E9A98 802C50E8 0C0B1EAF */ jal get_variable -/* E9A9C 802C50EC 0220202D */ daddu $a0, $s1, $zero -/* E9AA0 802C50F0 0040282D */ daddu $a1, $v0, $zero -/* E9AA4 802C50F4 00101080 */ sll $v0, $s0, 2 -/* E9AA8 802C50F8 02221021 */ addu $v0, $s1, $v0 -/* E9AAC 802C50FC 02302021 */ addu $a0, $s1, $s0 -/* E9AB0 802C5100 80830110 */ lb $v1, 0x110($a0) -/* E9AB4 802C5104 1C600005 */ bgtz $v1, .L802C511C -/* E9AB8 802C5108 8C420118 */ lw $v0, 0x118($v0) -/* E9ABC 802C510C 0C0B2279 */ jal si_goto_end_case -/* E9AC0 802C5110 0220202D */ daddu $a0, $s1, $zero -/* E9AC4 802C5114 080B144C */ j .L802C5130 -/* E9AC8 802C5118 AE220008 */ sw $v0, 8($s1) -.L802C511C: -/* E9ACC 802C511C 54A20004 */ bnel $a1, $v0, .L802C5130 -/* E9AD0 802C5120 A0800110 */ sb $zero, 0x110($a0) -/* E9AD4 802C5124 0C0B2298 */ jal si_goto_next_case -/* E9AD8 802C5128 0220202D */ daddu $a0, $s1, $zero -/* E9ADC 802C512C AE220008 */ sw $v0, 8($s1) -.L802C5130: -/* E9AE0 802C5130 24020002 */ addiu $v0, $zero, 2 -/* E9AE4 802C5134 8FBF0018 */ lw $ra, 0x18($sp) -/* E9AE8 802C5138 8FB10014 */ lw $s1, 0x14($sp) -/* E9AEC 802C513C 8FB00010 */ lw $s0, 0x10($sp) -/* E9AF0 802C5140 03E00008 */ jr $ra -/* E9AF4 802C5144 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_range.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_range.s deleted file mode 100644 index 22a154f37d..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_case_range.s +++ /dev/null @@ -1,56 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_case_range -/* E9D38 802C5388 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* E9D3C 802C538C AFB10014 */ sw $s1, 0x14($sp) -/* E9D40 802C5390 0080882D */ daddu $s1, $a0, $zero -/* E9D44 802C5394 AFBF001C */ sw $ra, 0x1c($sp) -/* E9D48 802C5398 AFB20018 */ sw $s2, 0x18($sp) -/* E9D4C 802C539C AFB00010 */ sw $s0, 0x10($sp) -/* E9D50 802C53A0 82320007 */ lb $s2, 7($s1) -/* E9D54 802C53A4 06410003 */ bgez $s2, .L802C53B4 -/* E9D58 802C53A8 8E30000C */ lw $s0, 0xc($s1) -.L802C53AC: -/* E9D5C 802C53AC 080B14EB */ j .L802C53AC -/* E9D60 802C53B0 00000000 */ nop -.L802C53B4: -/* E9D64 802C53B4 8E050000 */ lw $a1, ($s0) -/* E9D68 802C53B8 26100004 */ addiu $s0, $s0, 4 -/* E9D6C 802C53BC 0C0B1EAF */ jal get_variable -/* E9D70 802C53C0 0220202D */ daddu $a0, $s1, $zero -/* E9D74 802C53C4 0220202D */ daddu $a0, $s1, $zero -/* E9D78 802C53C8 8E050000 */ lw $a1, ($s0) -/* E9D7C 802C53CC 0C0B1EAF */ jal get_variable -/* E9D80 802C53D0 0040802D */ daddu $s0, $v0, $zero -/* E9D84 802C53D4 0040302D */ daddu $a2, $v0, $zero -/* E9D88 802C53D8 00121080 */ sll $v0, $s2, 2 -/* E9D8C 802C53DC 02221021 */ addu $v0, $s1, $v0 -/* E9D90 802C53E0 02322821 */ addu $a1, $s1, $s2 -/* E9D94 802C53E4 80A30110 */ lb $v1, 0x110($a1) -/* E9D98 802C53E8 8C440118 */ lw $a0, 0x118($v0) -/* E9D9C 802C53EC 1C600005 */ bgtz $v1, .L802C5404 -/* E9DA0 802C53F0 0090102A */ slt $v0, $a0, $s0 -/* E9DA4 802C53F4 0C0B2279 */ jal si_goto_end_case -/* E9DA8 802C53F8 0220202D */ daddu $a0, $s1, $zero -/* E9DAC 802C53FC 080B150A */ j .L802C5428 -/* E9DB0 802C5400 AE220008 */ sw $v0, 8($s1) -.L802C5404: -/* E9DB4 802C5404 14400005 */ bnez $v0, .L802C541C -/* E9DB8 802C5408 00C4102A */ slt $v0, $a2, $a0 -/* E9DBC 802C540C 14400003 */ bnez $v0, .L802C541C -/* E9DC0 802C5410 00000000 */ nop -/* E9DC4 802C5414 080B150A */ j .L802C5428 -/* E9DC8 802C5418 A0A00110 */ sb $zero, 0x110($a1) -.L802C541C: -/* E9DCC 802C541C 0C0B2298 */ jal si_goto_next_case -/* E9DD0 802C5420 0220202D */ daddu $a0, $s1, $zero -/* E9DD4 802C5424 AE220008 */ sw $v0, 8($s1) -.L802C5428: -/* E9DD8 802C5428 24020002 */ addiu $v0, $zero, 2 -/* E9DDC 802C542C 8FBF001C */ lw $ra, 0x1c($sp) -/* E9DE0 802C5430 8FB20018 */ lw $s2, 0x18($sp) -/* E9DE4 802C5434 8FB10014 */ lw $s1, 0x14($sp) -/* E9DE8 802C5438 8FB00010 */ lw $s0, 0x10($sp) -/* E9DEC 802C543C 03E00008 */ jr $ra -/* E9DF0 802C5440 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_end_case_group.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_end_case_group.s deleted file mode 100644 index 4efec3fe91..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_end_case_group.s +++ /dev/null @@ -1,40 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_end_case_group -/* EA00C 802C565C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* EA010 802C5660 AFB00010 */ sw $s0, 0x10($sp) -/* EA014 802C5664 0080802D */ daddu $s0, $a0, $zero -/* EA018 802C5668 AFBF0014 */ sw $ra, 0x14($sp) -/* EA01C 802C566C 82020007 */ lb $v0, 7($s0) -/* EA020 802C5670 04410003 */ bgez $v0, .L802C5680 -/* EA024 802C5674 02021821 */ addu $v1, $s0, $v0 -.L802C5678: -/* EA028 802C5678 080B159E */ j .L802C5678 -/* EA02C 802C567C 00000000 */ nop -.L802C5680: -/* EA030 802C5680 80640110 */ lb $a0, 0x110($v1) -/* EA034 802C5684 14800003 */ bnez $a0, .L802C5694 -/* EA038 802C5688 2402FFFF */ addiu $v0, $zero, -1 -/* EA03C 802C568C 080B15AD */ j .L802C56B4 -/* EA040 802C5690 0200202D */ daddu $a0, $s0, $zero -.L802C5694: -/* EA044 802C5694 10820006 */ beq $a0, $v0, .L802C56B0 -/* EA048 802C5698 0200202D */ daddu $a0, $s0, $zero -/* EA04C 802C569C 24020001 */ addiu $v0, $zero, 1 -/* EA050 802C56A0 0C0B2298 */ jal si_goto_next_case -/* EA054 802C56A4 A0620110 */ sb $v0, 0x110($v1) -/* EA058 802C56A8 080B15B0 */ j .L802C56C0 -/* EA05C 802C56AC AE020008 */ sw $v0, 8($s0) -.L802C56B0: -/* EA060 802C56B0 A0600110 */ sb $zero, 0x110($v1) -.L802C56B4: -/* EA064 802C56B4 0C0B2279 */ jal si_goto_end_case -/* EA068 802C56B8 00000000 */ nop -/* EA06C 802C56BC AE020008 */ sw $v0, 8($s0) -.L802C56C0: -/* EA070 802C56C0 24020002 */ addiu $v0, $zero, 2 -/* EA074 802C56C4 8FBF0014 */ lw $ra, 0x14($sp) -/* EA078 802C56C8 8FB00010 */ lw $s0, 0x10($sp) -/* EA07C 802C56CC 03E00008 */ jr $ra -/* EA080 802C56D0 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_end_loop.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_end_loop.s deleted file mode 100644 index dae865f402..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_end_loop.s +++ /dev/null @@ -1,61 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_end_loop -/* E93F8 802C4A48 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* E93FC 802C4A4C AFB10014 */ sw $s1, 0x14($sp) -/* E9400 802C4A50 0080882D */ daddu $s1, $a0, $zero -/* E9404 802C4A54 AFBF001C */ sw $ra, 0x1c($sp) -/* E9408 802C4A58 AFB20018 */ sw $s2, 0x18($sp) -/* E940C 802C4A5C AFB00010 */ sw $s0, 0x10($sp) -/* E9410 802C4A60 82320006 */ lb $s2, 6($s1) -/* E9414 802C4A64 06410003 */ bgez $s2, .L802C4A74 -/* E9418 802C4A68 00121080 */ sll $v0, $s2, 2 -.L802C4A6C: -/* E941C 802C4A6C 080B129B */ j .L802C4A6C -/* E9420 802C4A70 00000000 */ nop -.L802C4A74: -/* E9424 802C4A74 02221821 */ addu $v1, $s1, $v0 -/* E9428 802C4A78 8C7000F0 */ lw $s0, 0xf0($v1) -/* E942C 802C4A7C 16000004 */ bnez $s0, .L802C4A90 -/* E9430 802C4A80 3C02FF67 */ lui $v0, 0xff67 -/* E9434 802C4A84 8C6300D0 */ lw $v1, 0xd0($v1) -/* E9438 802C4A88 080B12BC */ j .L802C4AF0 -/* E943C 802C4A8C 24020002 */ addiu $v0, $zero, 2 -.L802C4A90: -/* E9440 802C4A90 34426980 */ ori $v0, $v0, 0x6980 -/* E9444 802C4A94 0202102A */ slt $v0, $s0, $v0 -/* E9448 802C4A98 14400004 */ bnez $v0, .L802C4AAC -/* E944C 802C4A9C 0220202D */ daddu $a0, $s1, $zero -/* E9450 802C4AA0 2610FFFF */ addiu $s0, $s0, -1 -/* E9454 802C4AA4 080B12B2 */ j .L802C4AC8 -/* E9458 802C4AA8 AC7000F0 */ sw $s0, 0xf0($v1) -.L802C4AAC: -/* E945C 802C4AAC 0C0B1EAF */ jal get_variable -/* E9460 802C4AB0 0200282D */ daddu $a1, $s0, $zero -/* E9464 802C4AB4 0220202D */ daddu $a0, $s1, $zero -/* E9468 802C4AB8 0200282D */ daddu $a1, $s0, $zero -/* E946C 802C4ABC 2450FFFF */ addiu $s0, $v0, -1 -/* E9470 802C4AC0 0C0B2026 */ jal set_variable -/* E9474 802C4AC4 0200302D */ daddu $a2, $s0, $zero -.L802C4AC8: -/* E9478 802C4AC8 16000006 */ bnez $s0, .L802C4AE4 -/* E947C 802C4ACC 00121080 */ sll $v0, $s2, 2 -/* E9480 802C4AD0 92230006 */ lbu $v1, 6($s1) -/* E9484 802C4AD4 24020002 */ addiu $v0, $zero, 2 -/* E9488 802C4AD8 2463FFFF */ addiu $v1, $v1, -1 -/* E948C 802C4ADC 080B12BD */ j .L802C4AF4 -/* E9490 802C4AE0 A2230006 */ sb $v1, 6($s1) -.L802C4AE4: -/* E9494 802C4AE4 02221021 */ addu $v0, $s1, $v0 -/* E9498 802C4AE8 8C4300D0 */ lw $v1, 0xd0($v0) -/* E949C 802C4AEC 24020002 */ addiu $v0, $zero, 2 -.L802C4AF0: -/* E94A0 802C4AF0 AE230008 */ sw $v1, 8($s1) -.L802C4AF4: -/* E94A4 802C4AF4 8FBF001C */ lw $ra, 0x1c($sp) -/* E94A8 802C4AF8 8FB20018 */ lw $s2, 0x18($sp) -/* E94AC 802C4AFC 8FB10014 */ lw $s1, 0x14($sp) -/* E94B0 802C4B00 8FB00010 */ lw $s0, 0x10($sp) -/* E94B4 802C4B04 03E00008 */ jr $ra -/* E94B8 802C4B08 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_exec1.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_exec1.s deleted file mode 100644 index b75904cbae..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_exec1.s +++ /dev/null @@ -1,52 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_exec1 -/* EAE1C 802C646C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* EAE20 802C6470 AFB00010 */ sw $s0, 0x10($sp) -/* EAE24 802C6474 0080802D */ daddu $s0, $a0, $zero -/* EAE28 802C6478 AFBF0014 */ sw $ra, 0x14($sp) -/* EAE2C 802C647C 8E02000C */ lw $v0, 0xc($s0) -/* EAE30 802C6480 0C0B1EAF */ jal get_variable -/* EAE34 802C6484 8C450000 */ lw $a1, ($v0) -/* EAE38 802C6488 0040202D */ daddu $a0, $v0, $zero -/* EAE3C 802C648C 92050003 */ lbu $a1, 3($s0) -/* EAE40 802C6490 92070004 */ lbu $a3, 4($s0) -/* EAE44 802C6494 0C0B0D74 */ jal start_script_in_group -/* EAE48 802C6498 0000302D */ daddu $a2, $zero, $zero -/* EAE4C 802C649C 0000202D */ daddu $a0, $zero, $zero -/* EAE50 802C64A0 0200282D */ daddu $a1, $s0, $zero -/* EAE54 802C64A4 8E030148 */ lw $v1, 0x148($s0) -/* EAE58 802C64A8 0040302D */ daddu $a2, $v0, $zero -/* EAE5C 802C64AC ACC30148 */ sw $v1, 0x148($a2) -/* EAE60 802C64B0 8E02014C */ lw $v0, 0x14c($s0) -/* EAE64 802C64B4 00C0182D */ daddu $v1, $a2, $zero -/* EAE68 802C64B8 ACC2014C */ sw $v0, 0x14c($a2) -.L802C64BC: -/* EAE6C 802C64BC 8CA20084 */ lw $v0, 0x84($a1) -/* EAE70 802C64C0 24A50004 */ addiu $a1, $a1, 4 -/* EAE74 802C64C4 24840001 */ addiu $a0, $a0, 1 -/* EAE78 802C64C8 AC620084 */ sw $v0, 0x84($v1) -/* EAE7C 802C64CC 28820010 */ slti $v0, $a0, 0x10 -/* EAE80 802C64D0 1440FFFA */ bnez $v0, .L802C64BC -/* EAE84 802C64D4 24630004 */ addiu $v1, $v1, 4 -/* EAE88 802C64D8 0000202D */ daddu $a0, $zero, $zero -/* EAE8C 802C64DC 0200282D */ daddu $a1, $s0, $zero -/* EAE90 802C64E0 00C0182D */ daddu $v1, $a2, $zero -.L802C64E4: -/* EAE94 802C64E4 8CA200C4 */ lw $v0, 0xc4($a1) -/* EAE98 802C64E8 24A50004 */ addiu $a1, $a1, 4 -/* EAE9C 802C64EC 24840001 */ addiu $a0, $a0, 1 -/* EAEA0 802C64F0 AC6200C4 */ sw $v0, 0xc4($v1) -/* EAEA4 802C64F4 28820003 */ slti $v0, $a0, 3 -/* EAEA8 802C64F8 1440FFFA */ bnez $v0, .L802C64E4 -/* EAEAC 802C64FC 24630004 */ addiu $v1, $v1, 4 -/* EAEB0 802C6500 8E02013C */ lw $v0, 0x13c($s0) -/* EAEB4 802C6504 ACC2013C */ sw $v0, 0x13c($a2) -/* EAEB8 802C6508 8E030140 */ lw $v1, 0x140($s0) -/* EAEBC 802C650C ACC30140 */ sw $v1, 0x140($a2) -/* EAEC0 802C6510 8FBF0014 */ lw $ra, 0x14($sp) -/* EAEC4 802C6514 8FB00010 */ lw $s0, 0x10($sp) -/* EAEC8 802C6518 24020002 */ addiu $v0, $zero, 2 -/* EAECC 802C651C 03E00008 */ jr $ra -/* EAED0 802C6520 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_exec2.s b/asm/nonmatchings/code_e92d0_len_5da0/si_handle_exec2.s deleted file mode 100644 index 1c71afbc3e..0000000000 --- a/asm/nonmatchings/code_e92d0_len_5da0/si_handle_exec2.s +++ /dev/null @@ -1,60 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel si_handle_exec2 -/* EAED4 802C6524 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* EAED8 802C6528 AFB10014 */ sw $s1, 0x14($sp) -/* EAEDC 802C652C 0080882D */ daddu $s1, $a0, $zero -/* EAEE0 802C6530 AFBF0018 */ sw $ra, 0x18($sp) -/* EAEE4 802C6534 AFB00010 */ sw $s0, 0x10($sp) -/* EAEE8 802C6538 8E30000C */ lw $s0, 0xc($s1) -/* EAEEC 802C653C 8E050000 */ lw $a1, ($s0) -/* EAEF0 802C6540 0C0B1EAF */ jal get_variable -/* EAEF4 802C6544 26100004 */ addiu $s0, $s0, 4 -/* EAEF8 802C6548 0040202D */ daddu $a0, $v0, $zero -/* EAEFC 802C654C 92250003 */ lbu $a1, 3($s1) -/* EAF00 802C6550 92270004 */ lbu $a3, 4($s1) -/* EAF04 802C6554 8E100000 */ lw $s0, ($s0) -/* EAF08 802C6558 0C0B0D74 */ jal start_script_in_group -/* EAF0C 802C655C 0000302D */ daddu $a2, $zero, $zero -/* EAF10 802C6560 0000202D */ daddu $a0, $zero, $zero -/* EAF14 802C6564 0220282D */ daddu $a1, $s1, $zero -/* EAF18 802C6568 8E230148 */ lw $v1, 0x148($s1) -/* EAF1C 802C656C 0040382D */ daddu $a3, $v0, $zero -/* EAF20 802C6570 ACE30148 */ sw $v1, 0x148($a3) -/* EAF24 802C6574 8E22014C */ lw $v0, 0x14c($s1) -/* EAF28 802C6578 00E0182D */ daddu $v1, $a3, $zero -/* EAF2C 802C657C ACE2014C */ sw $v0, 0x14c($a3) -.L802C6580: -/* EAF30 802C6580 8CA20084 */ lw $v0, 0x84($a1) -/* EAF34 802C6584 24A50004 */ addiu $a1, $a1, 4 -/* EAF38 802C6588 24840001 */ addiu $a0, $a0, 1 -/* EAF3C 802C658C AC620084 */ sw $v0, 0x84($v1) -/* EAF40 802C6590 28820010 */ slti $v0, $a0, 0x10 -/* EAF44 802C6594 1440FFFA */ bnez $v0, .L802C6580 -/* EAF48 802C6598 24630004 */ addiu $v1, $v1, 4 -/* EAF4C 802C659C 0000202D */ daddu $a0, $zero, $zero -/* EAF50 802C65A0 0220282D */ daddu $a1, $s1, $zero -/* EAF54 802C65A4 00E0182D */ daddu $v1, $a3, $zero -.L802C65A8: -/* EAF58 802C65A8 8CA200C4 */ lw $v0, 0xc4($a1) -/* EAF5C 802C65AC 24A50004 */ addiu $a1, $a1, 4 -/* EAF60 802C65B0 24840001 */ addiu $a0, $a0, 1 -/* EAF64 802C65B4 AC6200C4 */ sw $v0, 0xc4($v1) -/* EAF68 802C65B8 28820003 */ slti $v0, $a0, 3 -/* EAF6C 802C65BC 1440FFFA */ bnez $v0, .L802C65A8 -/* EAF70 802C65C0 24630004 */ addiu $v1, $v1, 4 -/* EAF74 802C65C4 8CE60144 */ lw $a2, 0x144($a3) -/* EAF78 802C65C8 8E22013C */ lw $v0, 0x13c($s1) -/* EAF7C 802C65CC 0220202D */ daddu $a0, $s1, $zero -/* EAF80 802C65D0 ACE2013C */ sw $v0, 0x13c($a3) -/* EAF84 802C65D4 8C820140 */ lw $v0, 0x140($a0) -/* EAF88 802C65D8 0200282D */ daddu $a1, $s0, $zero -/* EAF8C 802C65DC 0C0B2026 */ jal set_variable -/* EAF90 802C65E0 ACE20140 */ sw $v0, 0x140($a3) -/* EAF94 802C65E4 8FBF0018 */ lw $ra, 0x18($sp) -/* EAF98 802C65E8 8FB10014 */ lw $s1, 0x14($sp) -/* EAF9C 802C65EC 8FB00010 */ lw $s0, 0x10($sp) -/* EAFA0 802C65F0 24020002 */ addiu $v0, $zero, 2 -/* EAFA4 802C65F4 03E00008 */ jr $ra -/* EAFA8 802C65F8 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/asm/nonmatchings/code_e940_len_290/step_init_state.s b/asm/nonmatchings/code_e940_len_290/step_init_state.s deleted file mode 100644 index 054f5b046f..0000000000 --- a/asm/nonmatchings/code_e940_len_290/step_init_state.s +++ /dev/null @@ -1,145 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel step_init_state -/* E968 80033568 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* E96C 8003356C AFB00010 */ sw $s0, 0x10($sp) -/* E970 80033570 3C108007 */ lui $s0, %hi(gGameStatusPtr) -/* E974 80033574 2610419C */ addiu $s0, $s0, %lo(gGameStatusPtr) -/* E978 80033578 AFBF0014 */ sw $ra, 0x14($sp) -/* E97C 8003357C 8E040000 */ lw $a0, ($s0) -/* E980 80033580 808200AC */ lb $v0, 0xac($a0) -/* E984 80033584 908300AC */ lbu $v1, 0xac($a0) -/* E988 80033588 10400003 */ beqz $v0, .L80033598 -/* E98C 8003358C 2462FFFF */ addiu $v0, $v1, -1 -/* E990 80033590 0800CDDE */ j .L80033778 -/* E994 80033594 A08200AC */ sb $v0, 0xac($a0) -.L80033598: -/* E998 80033598 3C01800A */ lui $at, %hi(D_8009A650) -/* E99C 8003359C AC20A650 */ sw $zero, %lo(D_8009A650)($at) -/* E9A0 800335A0 A4800086 */ sh $zero, 0x86($a0) -/* E9A4 800335A4 A0800070 */ sb $zero, 0x70($a0) -/* E9A8 800335A8 8E020000 */ lw $v0, ($s0) -/* E9AC 800335AC 2403FFFF */ addiu $v1, $zero, -1 -/* E9B0 800335B0 A4830088 */ sh $v1, 0x88($a0) -/* E9B4 800335B4 A480008C */ sh $zero, 0x8c($a0) -/* E9B8 800335B8 A480008E */ sh $zero, 0x8e($a0) -/* E9BC 800335BC A0400076 */ sb $zero, 0x76($v0) -/* E9C0 800335C0 8E020000 */ lw $v0, ($s0) -/* E9C4 800335C4 A0400078 */ sb $zero, 0x78($v0) -/* E9C8 800335C8 8E020000 */ lw $v0, ($s0) -/* E9CC 800335CC A040007D */ sb $zero, 0x7d($v0) -/* E9D0 800335D0 8E020000 */ lw $v0, ($s0) -/* E9D4 800335D4 A04300A8 */ sb $v1, 0xa8($v0) -/* E9D8 800335D8 8E020000 */ lw $v0, ($s0) -/* E9DC 800335DC A04000AA */ sb $zero, 0xaa($v0) -/* E9E0 800335E0 8E020000 */ lw $v0, ($s0) -/* E9E4 800335E4 A04300A9 */ sb $v1, 0xa9($v0) -/* E9E8 800335E8 8E020000 */ lw $v0, ($s0) -/* E9EC 800335EC 0C00AB00 */ jal general_heap_create -/* E9F0 800335F0 A0400071 */ sb $zero, 0x71($v0) -/* E9F4 800335F4 0C047624 */ jal func_8011D890 -/* E9F8 800335F8 00000000 */ nop -/* E9FC 800335FC 0C048C2E */ jal clear_dynamic_entity_list -/* EA00 80033600 00000000 */ nop -/* EA04 80033604 0C0B0C77 */ jal clear_script_list -/* EA08 80033608 00000000 */ nop -/* EA0C 8003360C 0C00B7BD */ jal create_cameras_a -/* EA10 80033610 00000000 */ nop -/* EA14 80033614 0C0B763E */ jal func_802DD8F8 -/* EA18 80033618 0000202D */ daddu $a0, $zero, $zero -/* EA1C 8003361C 0C0482EC */ jal clear_virtual_models -/* EA20 80033620 00000000 */ nop -/* EA24 80033624 0C047889 */ jal func_8011E224 -/* EA28 80033628 00000000 */ nop -/* EA2C 8003362C 0C045751 */ jal clear_model_data -/* EA30 80033630 00000000 */ nop -/* EA34 80033634 0C052010 */ jal func_80148040 -/* EA38 80033638 00000000 */ nop -/* EA3C 8003363C 0C05177E */ jal func_80145DF8 -/* EA40 80033640 00000000 */ nop -/* EA44 80033644 0000202D */ daddu $a0, $zero, $zero -/* EA48 80033648 0C0514BA */ jal func_801452E8 -/* EA4C 8003364C 0080282D */ daddu $a1, $a0, $zero -/* EA50 80033650 0C050440 */ jal func_80141100 -/* EA54 80033654 00000000 */ nop -/* EA58 80033658 0C0515A0 */ jal clear_trigger_data -/* EA5C 8003365C 00000000 */ nop -/* EA60 80033660 0C048D9D */ jal clear_printers -/* EA64 80033664 00000000 */ nop -/* EA68 80033668 0C04432E */ jal clear_entity_data -/* EA6C 8003366C 0000202D */ daddu $a0, $zero, $zero -/* EA70 80033670 0C04E042 */ jal func_80138108 -/* EA74 80033674 00000000 */ nop -/* EA78 80033678 0C037F14 */ jal clear_player_status -/* EA7C 8003367C 00000000 */ nop -/* EA80 80033680 0C00E12F */ jal clear_npcs -/* EA84 80033684 00000000 */ nop -/* EA88 80033688 0C039CE8 */ jal clear_player_data -/* EA8C 8003368C 00000000 */ nop -/* EA90 80033690 0C01CACC */ jal func_80072B30 -/* EA94 80033694 00000000 */ nop -/* EA98 80033698 0C00F8CE */ jal func_8003E338 -/* EA9C 8003369C 00000000 */ nop -/* EAA0 800336A0 0C016727 */ jal func_80059C9C -/* EAA4 800336A4 00000000 */ nop -/* EAA8 800336A8 0C04C3FC */ jal clear_item_entity_data -/* EAAC 800336AC 00000000 */ nop -/* EAB0 800336B0 0C0514C8 */ jal clear_saved_variables -/* EAB4 800336B4 00000000 */ nop -/* EAB8 800336B8 0C016BE5 */ jal initialize_collision -/* EABC 800336BC 00000000 */ nop -/* EAC0 800336C0 0C052B02 */ jal func_8014AC08 -/* EAC4 800336C4 00000000 */ nop -/* EAC8 800336C8 0C051CFC */ jal func_801473F0 -/* EACC 800336CC 00000000 */ nop -/* EAD0 800336D0 0C03AD60 */ jal partner_initialize_data -/* EAD4 800336D4 00000000 */ nop -/* EAD8 800336D8 0C052586 */ jal func_80149618 -/* EADC 800336DC 00000000 */ nop -/* EAE0 800336E0 0C05294B */ jal func_8014A52C -/* EAE4 800336E4 00000000 */ nop -/* EAE8 800336E8 0C00AE90 */ jal initialize_curtains -/* EAEC 800336EC 00000000 */ nop -/* EAF0 800336F0 0000202D */ daddu $a0, $zero, $zero -/* EAF4 800336F4 24060004 */ addiu $a2, $zero, 4 -/* EAF8 800336F8 2405000F */ addiu $a1, $zero, 0xf -/* EAFC 800336FC 8E030000 */ lw $v1, ($s0) -.L80033700: -/* EB00 80033700 A4660050 */ sh $a2, 0x50($v1) -/* EB04 80033704 A4650048 */ sh $a1, 0x48($v1) -/* EB08 80033708 24840001 */ addiu $a0, $a0, 1 -/* EB0C 8003370C 28820004 */ slti $v0, $a0, 4 -/* EB10 80033710 1440FFFB */ bnez $v0, .L80033700 -/* EB14 80033714 24630002 */ addiu $v1, $v1, 2 -/* EB18 80033718 0C00ABF6 */ jal fio_has_valid_backup -/* EB1C 8003371C 00000000 */ nop -/* EB20 80033720 3C02800E */ lui $v0, 0x800e -/* EB24 80033724 8C429620 */ lw $v0, -0x69e0($v0) -/* EB28 80033728 14400007 */ bnez $v0, .L80033748 -/* EB2C 8003372C 24020001 */ addiu $v0, $zero, 1 -/* EB30 80033730 3C038007 */ lui $v1, %hi(gGameStatusPtr) -/* EB34 80033734 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1) -/* EB38 80033738 0C015857 */ jal func_8005615C -/* EB3C 8003373C A06200AB */ sb $v0, 0xab($v1) -/* EB40 80033740 0800CDD7 */ j .L8003375C -/* EB44 80033744 24040001 */ addiu $a0, $zero, 1 -.L80033748: -/* EB48 80033748 3C028007 */ lui $v0, %hi(gGameStatusPtr) -/* EB4C 8003374C 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) -/* EB50 80033750 0C015860 */ jal func_80056180 -/* EB54 80033754 A04000AB */ sb $zero, 0xab($v0) -/* EB58 80033758 24040001 */ addiu $a0, $zero, 1 -.L8003375C: -/* EB5C 8003375C 3C02800A */ lui $v0, %hi(D_8009A650) -/* EB60 80033760 2442A650 */ addiu $v0, $v0, %lo(D_8009A650) -/* EB64 80033764 8C430000 */ lw $v1, ($v0) -/* EB68 80033768 2405FFF7 */ addiu $a1, $zero, -9 -/* EB6C 8003376C 00651824 */ and $v1, $v1, $a1 -/* EB70 80033770 0C00CD3C */ jal set_game_mode -/* EB74 80033774 AC430000 */ sw $v1, ($v0) -.L80033778: -/* EB78 80033778 8FBF0014 */ lw $ra, 0x14($sp) -/* EB7C 8003377C 8FB00010 */ lw $s0, 0x10($sp) -/* EB80 80033780 03E00008 */ jr $ra -/* EB84 80033784 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_fa4c0_len_3bf0/ClearAmbientSounds.s b/asm/nonmatchings/code_fa4c0_len_3bf0/ClearAmbientSounds.s deleted file mode 100644 index afb72405f8..0000000000 --- a/asm/nonmatchings/code_fa4c0_len_3bf0/ClearAmbientSounds.s +++ /dev/null @@ -1,17 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel ClearAmbientSounds -/* FAA98 802D60E8 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* FAA9C 802D60EC AFBF0010 */ sw $ra, 0x10($sp) -/* FAAA0 802D60F0 8C82000C */ lw $v0, 0xc($a0) -/* FAAA4 802D60F4 0C0B1EAF */ jal get_variable -/* FAAA8 802D60F8 8C450000 */ lw $a1, ($v0) -/* FAAAC 802D60FC 2404FFFF */ addiu $a0, $zero, -1 -/* FAAB0 802D6100 0C051CDA */ jal play_ambient_sounds -/* FAAB4 802D6104 0040282D */ daddu $a1, $v0, $zero -/* FAAB8 802D6108 0002102B */ sltu $v0, $zero, $v0 -/* FAABC 802D610C 8FBF0010 */ lw $ra, 0x10($sp) -/* FAAC0 802D6110 00021040 */ sll $v0, $v0, 1 -/* FAAC4 802D6114 03E00008 */ jr $ra -/* FAAC8 802D6118 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/asm/nonmatchings/code_fa4c0_len_3bf0/GetItemPower.s b/asm/nonmatchings/code_fa4c0_len_3bf0/GetItemPower.s deleted file mode 100644 index 9a4a182979..0000000000 --- a/asm/nonmatchings/code_fa4c0_len_3bf0/GetItemPower.s +++ /dev/null @@ -1,34 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel GetItemPower -/* FBCDC 802D732C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* FBCE0 802D7330 AFB20018 */ sw $s2, 0x18($sp) -/* FBCE4 802D7334 0080902D */ daddu $s2, $a0, $zero -/* FBCE8 802D7338 AFBF001C */ sw $ra, 0x1c($sp) -/* FBCEC 802D733C AFB10014 */ sw $s1, 0x14($sp) -/* FBCF0 802D7340 AFB00010 */ sw $s0, 0x10($sp) -/* FBCF4 802D7344 8E50000C */ lw $s0, 0xc($s2) -/* FBCF8 802D7348 8E050000 */ lw $a1, ($s0) -/* FBCFC 802D734C 0C0B1EAF */ jal get_variable -/* FBD00 802D7350 26100004 */ addiu $s0, $s0, 4 -/* FBD04 802D7354 3C038008 */ lui $v1, %hi(gItemTable) -/* FBD08 802D7358 246378E0 */ addiu $v1, $v1, %lo(gItemTable) -/* FBD0C 802D735C 00028940 */ sll $s1, $v0, 5 -/* FBD10 802D7360 02238821 */ addu $s1, $s1, $v1 -/* FBD14 802D7364 8E050000 */ lw $a1, ($s0) -/* FBD18 802D7368 8226001B */ lb $a2, 0x1b($s1) -/* FBD1C 802D736C 8E100004 */ lw $s0, 4($s0) -/* FBD20 802D7370 0C0B2026 */ jal set_variable -/* FBD24 802D7374 0240202D */ daddu $a0, $s2, $zero -/* FBD28 802D7378 0240202D */ daddu $a0, $s2, $zero -/* FBD2C 802D737C 8226001C */ lb $a2, 0x1c($s1) -/* FBD30 802D7380 0C0B2026 */ jal set_variable -/* FBD34 802D7384 0200282D */ daddu $a1, $s0, $zero -/* FBD38 802D7388 8FBF001C */ lw $ra, 0x1c($sp) -/* FBD3C 802D738C 8FB20018 */ lw $s2, 0x18($sp) -/* FBD40 802D7390 8FB10014 */ lw $s1, 0x14($sp) -/* FBD44 802D7394 8FB00010 */ lw $s0, 0x10($sp) -/* FBD48 802D7398 24020002 */ addiu $v0, $zero, 2 -/* FBD4C 802D739C 03E00008 */ jr $ra -/* FBD50 802D73A0 27BD0020 */ addiu $sp, $sp, 0x20 diff --git a/diff.py b/diff.py index 0e1da09deb..1f7ff7e12e 100755 --- a/diff.py +++ b/diff.py @@ -64,7 +64,7 @@ if argcomplete: pos = data.find(search, endPos) completes.append(match) return completes - start_argument.completer = complete_symbol + setattr(start_argument, "completer", complete_symbol) parser.add_argument("end", nargs="?", help="Address to end diff at.") parser.add_argument( @@ -130,6 +130,12 @@ parser.add_argument( action="store_true", help="Pretend all large enough immediates are the same.", ) +parser.add_argument( + "-I", + "--ignore-addr-diffs", + action="store_true", + help="Ignore address differences. Currently only affects AArch64.", +) parser.add_argument( "-B", "--no-show-branches", @@ -612,13 +618,82 @@ class Line(NamedTuple): mnemonic: str diff_row: str original: str + normalized_original: str line_num: str branch_target: Optional[str] source_lines: List[str] comment: Optional[str] +class DifferenceNormalizer: + def normalize(self, mnemonic: str, row: str) -> str: + """This should be called exactly once for each line.""" + row = self._normalize_arch_specific(mnemonic, row) + if args.ignore_large_imms: + row = re.sub(re_large_imm, "", row) + return row + + def _normalize_arch_specific(self, mnemonic: str, row: str) -> str: + return row + + +class DifferenceNormalizerAArch64(DifferenceNormalizer): + def __init__(self) -> None: + super().__init__() + self._adrp_pair_registers: Set[str] = set() + + def _normalize_arch_specific(self, mnemonic: str, row: str) -> str: + if args.ignore_addr_diffs: + row = self._normalize_adrp_differences(mnemonic, row) + row = self._normalize_bl(mnemonic, row) + return row + + def _normalize_bl(self, mnemonic: str, row: str) -> str: + if mnemonic != "bl": + return row + + row, _ = split_off_branch(row) + return row + + def _normalize_adrp_differences(self, mnemonic: str, row: str) -> str: + """Identifies ADRP + LDR/ADD pairs that are used to access the GOT and + suppresses any immediate differences. + + Whenever an ADRP is seen, the destination register is added to the set of registers + that are part of an ADRP + LDR/ADD pair. Registers are removed from the set as soon + as they are used for an LDR or ADD instruction which completes the pair. + + This method is somewhat crude but should manage to detect most such pairs. + """ + row_parts = row.split("\t", 1) + if mnemonic == "adrp": + self._adrp_pair_registers.add(row_parts[1].strip().split(",")[0]) + row, _ = split_off_branch(row) + elif mnemonic == "ldr": + for reg in self._adrp_pair_registers: + # ldr xxx, [reg] + # ldr xxx, [reg, ] + if f", [{reg}" in row_parts[1]: + self._adrp_pair_registers.remove(reg) + return normalize_imms(row) + elif mnemonic == "add": + for reg in self._adrp_pair_registers: + # add reg, reg, + if row_parts[1].startswith(f"{reg}, {reg}, "): + self._adrp_pair_registers.remove(reg) + return normalize_imms(row) + + return row + + +def make_difference_normalizer() -> DifferenceNormalizer: + if arch == "aarch64": + return DifferenceNormalizerAArch64() + return DifferenceNormalizer() + + def process(lines): + normalizer = make_difference_normalizer() skip_next = False source_lines = [] if not args.diff_obj: @@ -660,6 +735,7 @@ def process(lines): if mnemonic not in instructions_with_address_immediates: row = re.sub(re_int, lambda s: hexify_int(row, s), row) original = row + normalized_original = normalizer.normalize(mnemonic, original) if skip_next: skip_next = False row = "" @@ -688,6 +764,7 @@ def process(lines): mnemonic=mnemonic, diff_row=row, original=original, + normalized_original=normalized_original, line_num=line_num, branch_target=branch_target, source_lines=source_lines, @@ -724,12 +801,6 @@ class SymbolColorer: return f"{color}{t}{Fore.RESET}" -def maybe_normalize_large_imms(row): - if args.ignore_large_imms: - row = re.sub(re_large_imm, "", row) - return row - - def normalize_imms(row): return re.sub(re_imm, "", row) @@ -865,9 +936,7 @@ def do_diff(basedump: str, mydump: str) -> List[OutputLine]: line_color1 = line_color2 = sym_color = Fore.RESET line_prefix = " " if line1 and line2 and line1.diff_row == line2.diff_row: - if maybe_normalize_large_imms( - line1.original - ) == maybe_normalize_large_imms(line2.original): + if line1.normalized_original == line2.normalized_original: out1 = line1.original out2 = line2.original elif line1.diff_row == "": diff --git a/include/PR/ramrom.h b/include/PR/ramrom.h index 153da028e9..8dc70c41cb 100755 --- a/include/PR/ramrom.h +++ b/include/PR/ramrom.h @@ -38,7 +38,7 @@ #define RAMROM_BUF_SIZE (4096) #define RAMROM_MSG_SIZE (RAMROM_BUF_SIZE*6) #define RAMROM_MSG_ADDR (RAMROM_SIZE - RAMROM_MSG_SIZE) -#define RAMROM_MSG_HDR_SIZE (3*sizeof(long)) +#define RAMROM_MSG_HDR_SIZE (3*4) // TODO: Used to be (3*sizeof(long)) #define RAMROM_USER_DATA_SIZE (RAMROM_MSG_SIZE-RAMROM_MSG_HDR_SIZE) #define RAMROM_APP_READ_ADDR (RAMROM_MSG_ADDR + (0*RAMROM_BUF_SIZE)) diff --git a/include/common_structs.h b/include/common_structs.h index acc21fe13a..90a8052da6 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -6,12 +6,22 @@ #include "types.h" #include "si.h" +struct ScriptInstance; + +typedef ApiStatus(*ApiFunc)(struct ScriptInstance*, s32); + typedef struct Vec3f { /* 0x00 */ f32 x; /* 0x04 */ f32 y; /* 0x08 */ f32 z; } Vec3f; // size = 0x0C +typedef struct Vec3s { + /* 0x00 */ s16 x; + /* 0x02 */ s16 y; + /* 0x04 */ s16 z; +} Vec3s; // size = 0x06 + typedef struct Matrix4f { /* 0x00 */ f32 mtx[4][4]; } Matrix4f; // size = 0x40 @@ -44,7 +54,9 @@ typedef struct HeapNode { } HeapNode; // size = 0x10 typedef struct NpcBlurData { - /* 0x00 */ char unk_00[4]; + /* 0x00 */ char unk_00; + /* 0x01 */ s8 unk_01; + /* 0x02 */ char unk_02[2]; /* 0x04 */ f32 xpos[20]; /* 0x54 */ f32 ypos[20]; /* 0xA4 */ f32 zpos[20]; @@ -154,9 +166,16 @@ typedef struct PlayerData { /* 0x33E */ char unk_33E[2]; } PlayerData; // size = 0x340 +typedef union { + struct { + /* 0x0 */ s16 genericFlagIndex; + /* 0x2 */ char unk_2; + } bytes; + s32 flags; +} TriggerFlags; + typedef struct Trigger { - /* 0x00 */ s16 genericFlagIndex; - /* 0x02 */ char unk_02[2]; + /* 0x00 */ TriggerFlags flags; /* 0x04 */ s32 params1; /* 0x08 */ s32 params2; /* 0x0C */ UNK_FUN_PTR(functionHandler); @@ -164,7 +183,9 @@ typedef struct Trigger { /* 0x14 */ struct ScriptInstance* runningScript; /* 0x18 */ s32 priority; /* 0x1C */ s32 scriptVars[3]; - /* 0x28 */ char unk_28[12]; + /* 0x28 */ char unk_28[8]; + /* 0x30 */ u8 unk_30; + /* 0x31 */ char unk_31[3]; /* 0x34 */ s32 runningScriptID; } Trigger; // size = 0x38 @@ -173,10 +194,11 @@ typedef struct Enemy { /* 0x04 */ u8 encounterIndex; /* 0x05 */ s8 encountered; /* 0x06 */ u8 scriptGroup; /* scripts launched for this npc controller will be assigned this group */ - /* 0x07 */ char unk_07; + /* 0x07 */ s8 unk_07; /* 0x08 */ s16 npcID; /* 0x0A */ s16 spawnPos[3]; - /* 0x10 */ char unk_10[8]; + /* 0x10 */ Vec3s unk_10; + /* 0x16 */ char unk_16[2]; /* 0x18 */ struct StaticNpcSettings* npcSettings; /* 0x1C */ Bytecode* initBytecode; /* 0x20 */ Bytecode* interactBytecode; @@ -205,9 +227,9 @@ typedef struct Enemy { /* 0xBC */ char unk_BC[8]; /* 0xC4 */ s32 unk_C4; /* 0xC8 */ s32 unk_C8; - /* 0xCC */ UNK_PTR animList; + /* 0xCC */ s32* animList; /* 0xD0 */ UNK_PTR territoryData; - /* 0xD4 */ UNK_PTR dropTables; + /* 0xD4 */ s16* dropTables; /* 0xD8 */ u32 tattleString; /* 0xDC */ char unk_DC[20]; } Enemy; // size = 0xF0 @@ -246,7 +268,7 @@ typedef struct ScriptInstance { /* 0x068 */ struct ScriptInstance* childScript; /* 0x06C */ struct ScriptInstance* parentScript; /* brother? */ /* 0x070 */ s32 functionTemp[4]; - /* 0x080 */ API_FUN(callFunction); + /* 0x080 */ ApiFunc callFunction; /* 0x084 */ s32 varTable[16]; /* 0x0C4 */ s32 varFlags[3]; /* 0x0D0 */ s32 loopStartTable[8]; @@ -285,9 +307,9 @@ typedef struct Entity { /* 0x3C */ char unk_3C[4]; /* 0x40 */ struct Trigger* trigger; /* 0x44 */ s32* vertexData; - /* 0x48 */ f32 position[3]; - /* 0x54 */ f32 scale[3]; - /* 0x60 */ f32 rotation[3]; + /* 0x48 */ Vec3f position; + /* 0x54 */ Vec3f scale; + /* 0x60 */ Vec3f rotation; /* 0x6C */ char unk_6C[4]; /* 0x70 */ struct Matrix4f* inverseTransformMatrix; /* world-to-local */ /* 0x74 */ char unk_74[60]; @@ -848,10 +870,8 @@ typedef struct GameStatus { /* 0x044 */ u8 stickY; /* with deadzone */ /* 0x045 */ u8 altStickY; /* input used for batte when flag 80000 set */ /* 0x046 */ char unk_46[2]; - /* 0x048 */ s16 unk_48; - /* 0x04A */ char unk_4A[6]; - /* 0x050 */ s16 unk_50; - /* 0x052 */ char unk_52[6]; + /* 0x048 */ s16 unk_48[4]; + /* 0x050 */ s16 unk_50[4]; /* 0x058 */ s16 unk_58; /* 0x05A */ char unk_5A[6]; /* 0x060 */ s16 unk_60; @@ -864,11 +884,14 @@ typedef struct GameStatus { /* 0x071 */ s8 demoState; /* (0 = not demo, 1 = map demo, 2 = demo map changing) */ /* 0x072 */ u8 nextDemoScene; /* which part of the demo to play next */ /* 0x073 */ u8 contBitPattern; - /* 0x074 */ char unk_74[4]; + /* 0x074 */ char unk_74[2]; + /* 0x076 */ s8 unk_76; + /* 0x077 */ char unk_77; /* 0x078 */ s8 disableScripts; /* 0x079 */ char unk_79; /* 0x07A */ s8 musicEnabled; - /* 0x07B */ char unk_7B[3]; + /* 0x07B */ char unk_7B[2]; + /* 0x07D */ s8 unk_7D; /* 0x07E */ u8 peachFlags; /* (1 = isPeach, 2 = isTransformed, 4 = hasUmbrella) */ /* 0x07F */ u8 peachDisguise; /* (1 = koopatrol, 2 = hammer bros, 3 = clubba) */ /* 0x080 */ char unk_80[6]; @@ -881,7 +904,10 @@ typedef struct GameStatus { /* 0x094 */ f32 exitAngle; /* 0x098 */ struct Vec3f playerPos; /* 0x0A4 */ f32 playerYaw; - /* 0x0A8 */ char unk_A8[4]; + /* 0x0A8 */ s8 unk_A8; + /* 0x0A9 */ s8 unk_A9; + /* 0x0AA */ s8 unk_AA; + /* 0x0AB */ s8 unk_AB; /* 0x0AC */ s8 loadMenuState; /* 0x0AD */ u8 menuCounter; /* 0x0AE */ char unk_AE[8]; @@ -1354,7 +1380,7 @@ typedef struct PlayerStatus { /* 0x012 */ s16 moveFrames; /* 0x014 */ s8 enableCollisionOverlapsCheck; /* 0x015 */ s8 statusMenuCounterinputEnabledCounter; /* whether the C-up menu can appear */ - /* 0x016 */ s16 lastGoodPosition[3]; + /* 0x016 */ Vec3s lastGoodPosition; /* 0x01C */ struct Vec3f extraVelocity; /* 0x028 */ struct Vec3f position; /* 0x034 */ char unk_34[16]; @@ -1394,7 +1420,7 @@ typedef struct PlayerStatus { /* 0x0DC */ s32 currentButtons; /* 0x0E0 */ s32 pressedButtons; /* 0x0E4 */ s32 heldButtons; - /* 0x0E8 */ f32 stickAxis[2]; + /* 0x0E8 */ s32 stickAxis[2]; /* 0x0F0 */ s32 currentButtonsBuffer[10]; /* 0x118 */ s32 pressedButtonsBuffer[10]; /* 0x140 */ s32 heldButtonsBuffer[10]; @@ -1418,7 +1444,7 @@ typedef struct EncounterStatus { /* 0x07 */ char unk_07[2]; /* 0x09 */ s8 battleOutcome; /* 0 = won, 1 = lost */ /* 0x0A */ char unk_0A; - /* 0x0B */ u8 merleeCoinBonus; /* triple coins when != 0 */ + /* 0x0B */ s8 merleeCoinBonus; /* triple coins when != 0 */ /* 0x0C */ u8 damageTaken; /* valid after battle */ /* 0x0D */ char unk_0D; /* 0x0E */ s16 coinsEarned; /* valid after battle */ @@ -1429,7 +1455,9 @@ typedef struct EncounterStatus { /* 0x14 */ s32 songID; /* 0x18 */ s32 unk_18; /* 0x1C */ u8 numEncounters; /* number of encounters for current map (in list) */ - /* 0x1D */ char unk_1D[3]; + /* 0x1D */ s8 currentAreaIndex; + /* 0x1E */ u8 currentMapIndex; + /* 0x1F */ u8 currentEntryIndex; /* 0x20 */ u8 mapID; /* 0x21 */ char unk_21[3]; /* 0x24 */ s32* npcGroupList; @@ -1437,9 +1465,11 @@ typedef struct EncounterStatus { /* 0x88 */ struct Encounter* currentEncounter; /* 0x8C */ struct Enemy* currentEnemy; /* 0x90 */ s32 unk_90; - /* 0x94 */ char unk_94[4]; + /* 0x94 */ s32 unk_94; /* 0x98 */ s32 unk_98; -} EncounterStatus; // size = 0x9C + /* 0x9C */ char unk_9C[20]; + /* 0xB0 */ s32 defeatFlags[60][12]; +} EncounterStatus; // size = 0xE0 typedef struct SaveData { /* 0x0000 */ char magicString[16]; /* "Mario Story 006" string */ diff --git a/include/enums.h b/include/enums.h index 8c06a6d716..e65654e723 100644 --- a/include/enums.h +++ b/include/enums.h @@ -11,6 +11,7 @@ typedef UNK_TYPE EncounterTriggerFlags; #define EncounterTriggerFlags_HAMMER 0x00000004 #define EncounterTriggerFlags_PARTNER 0x00000006 +typedef s8 PartnerId; #define PartnerId_NONE 0x00 #define PartnerId_GOOMBARIO 0x01 #define PartnerId_KOOPER 0x02 @@ -994,7 +995,7 @@ typedef UNK_TYPE HitResult; #define HitResult_MISS 0x00000006 #define HitResult_HIT_STATIC 0x00000007 #define HitResult_IMMUNE 0x00000008 -#define HitResult_TriggerFlagsED_EXPLODE -1 +#define HitResult_ED_EXPLODE -1 typedef UNK_TYPE Iter; #define Iter_FIRST 0xFFFFFFFF @@ -1257,35 +1258,35 @@ typedef s32 NpcId; #define NpcId_PLAYER 0xFFFFFFFE #define NpcId_PARTNER 0xFFFFFFFC -typedef UNK_TYPE TriggerFlags; -#define TriggerFlags_FLOOR_TOUCH 0x00000080 -#define TriggerFlags_FLOOR_ABOVE 0x00080000 -#define TriggerFlags_FLOOR_PRESS_A 0x00000800 -#define TriggerFlags_FLOOR_JUMP 0x00000200 -#define TriggerFlags_WALL_TOUCH 0x00000400 -#define TriggerFlags_WALL_PUSH 0x00000040 -#define TriggerFlags_WALL_PRESS_A 0x00000100 -#define TriggerFlags_WALL_HAMMER 0x00001000 -#define TriggerFlags_CEILING_TOUCH 0x00040000 -#define TriggerFlags_POINT_BOMB 0x00100000 -#define TriggerFlags_GAME_FLAG_SET 0x00010000 -#define TriggerFlags_AREA_FLAG_SET 0x00020000 +typedef UNK_TYPE TriggerFlag; +#define TriggerFlag_FLOOR_TOUCH 0x00000080 +#define TriggerFlag_FLOOR_ABOVE 0x00080000 +#define TriggerFlag_FLOOR_PRESS_A 0x00000800 +#define TriggerFlag_FLOOR_JUMP 0x00000200 +#define TriggerFlag_WALL_TOUCH 0x00000400 +#define TriggerFlag_WALL_PUSH 0x00000040 +#define TriggerFlag_WALL_PRESS_A 0x00000100 +#define TriggerFlag_WALL_HAMMER 0x00001000 +#define TriggerFlag_CEILING_TOUCH 0x00040000 +#define TriggerFlag_POINT_BOMB 0x00100000 +#define TriggerFlag_GAME_FLAG_SET 0x00010000 +#define TriggerFlag_AREA_FLAG_SET 0x00020000 -typedef UNK_TYPE Buttons; -#define Buttons_A 0x00008000 -#define Buttons_B 0x00004000 -#define Buttons_Z 0x00002000 -#define Buttons_START 0x00001000 -#define Buttons_D_UP 0x00000800 -#define Buttons_D_DOWN 0x00000400 -#define Buttons_D_LEFT 0x00000200 -#define Buttons_D_RIGHT 0x00000100 -#define Buttons_L 0x00000020 -#define Buttons_R 0x00000010 -#define Buttons_C_UP 0x00000008 -#define Buttons_C_DOWN 0x00000004 -#define Buttons_C_LEFT 0x00000002 -#define Buttons_C_RIGHT 0x00000001 +typedef UNK_TYPE Button; +#define Button_A 0x00008000 +#define Button_B 0x00004000 +#define Button_Z 0x00002000 +#define Button_START 0x00001000 +#define Button_D_UP 0x00000800 +#define Button_D_DOWN 0x00000400 +#define Button_D_LEFT 0x00000200 +#define Button_D_RIGHT 0x00000100 +#define Button_L 0x00000020 +#define Button_R 0x00000010 +#define Button_C_UP 0x00000008 +#define Button_C_DOWN 0x00000004 +#define Button_C_LEFT 0x00000002 +#define Button_C_RIGHT 0x00000001 typedef UNK_TYPE PlayerBuff; #define PlayerBuff_ALL 0x0FFFFFFF diff --git a/include/functions.h b/include/functions.h index b05ab55056..472f3b5d8a 100644 --- a/include/functions.h +++ b/include/functions.h @@ -19,6 +19,8 @@ Shadow* get_shadow_by_index(s32 index); void render_player_model(); +f32 integrate_gravity(void); + void parent_collider_to_model(s32 colliderID, s16 modelIndex); void clone_model(u16 srcModelID, u16 newModelID); Model* get_model_from_list_index(s32 listIndex); @@ -29,9 +31,13 @@ void get_model_center_and_size(s32 modelID, f32* centerX, f32* centerY, f32* cen void update_collider_transform(s16 colliderID); void get_collider_center(s32 colliderID, f32* x, f32* y, f32* z); +s32 is_trigger_bound(Trigger*, Bytecode* script); Trigger* create_trigger(TriggerDefinition* def); s32 _bound_script_trigger_handler(Trigger* trigger); + +s32 func_800494C0(Npc* npc, s32 arg1, s32 arg2); + s32 get_variable(ScriptInstance* script, Bytecode var); s32 set_variable(ScriptInstance* script, Bytecode var, s32 value); f32 get_float_variable(ScriptInstance* script, Bytecode var); @@ -51,6 +57,8 @@ s32 osGetId(); s32 func_800EF394(f32); s32 does_script_exist(s32 id); +ScriptInstance* start_script(Bytecode* script, s32 priority, s32 flags); +ScriptInstance* start_script_in_group(ScriptInstance* script, s32 priority, s32 flags, s32 groups); void func_8011B7C0(u16, s32, s32); void func_80137D88(s32, f32); @@ -73,6 +81,8 @@ Npc* get_npc_unsafe(NpcId npcId); Npc* resolve_npc(ScriptInstance* script, NpcId npcIdOrPtr); void set_npc_yaw(Npc* npcPtr, f32 angle); +Enemy* get_enemy(NpcId npcId); + f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by); f32 dist3D(f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz); void add_vec2D_polar(f32* x, f32* y, f32 r, f32 theta); diff --git a/include/si.h b/include/si.h index efb6b05ca1..f2dbd3883f 100644 --- a/include/si.h +++ b/include/si.h @@ -2,8 +2,6 @@ #define _SI_H_ #include "ultra64.h" -#include "types.h" -#include "macros.h" #define SI_VAR_0 0xFE363C80 @@ -20,6 +18,4 @@ typedef s32 ApiStatus; #define ApiStatus_REPEAT 3 /* Call again immediately */ #define ApiStatus_FINISH 255 /* Corresponds to SI_FINISH */ -#define API_FUN(NAME) ApiStatus (*NAME)(struct ScriptInstance* script, s32 isInitialCall) - #endif diff --git a/include/variables.h b/include/variables.h index a713ed7d9b..b864472652 100644 --- a/include/variables.h +++ b/include/variables.h @@ -13,6 +13,7 @@ extern ActionState gPlayerActionState; extern PlayerAnim gPlayerAnimation; extern PlayerStatus gPlayerStatus; extern PlayerStatus* gPlayerStatusPtr; +extern CollisionStatus gCollisionStatus; extern GameStatus* gGameStatusPtr[1]; extern s32 gRandSeed; extern StaticItem gItemTable[364]; @@ -44,6 +45,7 @@ extern u32** gCurrentModelSpecialDlsPtr[32]; extern Entity* gWorldEntityList[30]; extern Entity* gBattleEntityList[30]; extern Entity** gCurrentEntityListPtr[30]; +extern s32 gLastCreatedEntityIndex; extern UNK_TYPE* gWorldDynamicEntityList[16]; extern UNK_TYPE* gBattleDynamicEntityList[16]; @@ -104,13 +106,14 @@ extern s32 D_8009BAA0; // curtain draw callback extern s16 gCurrentDoorSoundsSet; +extern s32 D_800D9620; extern UNK_TYPE D_800E92D8; extern UNK_TYPE D_80147474; extern UNK_TYPE D_80147574; extern UNK_TYPE D_80109270; extern UNK_TYPE D_80108558; extern UNK_TYPE D_8010F250; // play_sound state struct? -extern s8 D_8010EBB0; +extern s8 D_8010EBB0[]; extern SaveData gCurrentSaveFile; @@ -129,4 +132,7 @@ extern u32 gBattleMapFlags[MAX_MAPFLAGS]; extern s32 D_8009A5D8; +// Scripts +extern Bytecode* SCRIPT_NpcDefeat; + #endif diff --git a/papermario.ld b/papermario.ld index e2d636069f..3d6ad7c9c6 100644 --- a/papermario.ld +++ b/papermario.ld @@ -218,6 +218,7 @@ SECTIONS .text_E79B0 0x802C3000 : AT(0xE79B0) { build/src/code_e79b0_len_1920.o(.text); build/src/code_e92d0_len_5da0.o(.text); + build/src/code_ED510.o(.text); build/src/code_ef070_len_3400.o(.text); build/src/code_f2470_len_27f0.o(.text); build/src/code_f4c60_len_4300.o(.text); diff --git a/src/code_111f0_len_860.c b/src/code_111f0_len_860.c index 750a84062d..edfea5e2c3 100644 --- a/src/code_111f0_len_860.c +++ b/src/code_111f0_len_860.c @@ -2,6 +2,7 @@ void func_80035DF0(s16 arg0) { s16* tempPtr = &D_800A0942; + *tempPtr = arg0; } @@ -14,7 +15,7 @@ INCLUDE_ASM(s32, "code_111f0_len_860", func_80035E54); INCLUDE_ASM(s32, "code_111f0_len_860", func_80035EEC); void func_800360FC(void) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; if (gameStatus->loadMenuState == 2) { draw_status_ui(); @@ -22,7 +23,7 @@ void func_800360FC(void) { } void func_80036130(void) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; gMapTransitionAlpha = 0x00; D_800A0942 = 0x14; @@ -38,13 +39,10 @@ void func_80036130(void) { INCLUDE_ASM(s32, "code_111f0_len_860", func_8003617C); -s32 func_800363FC(void) { - s32 phi_return; - - if ((D_800A0944 == 4) || (phi_return = 4, (D_800A0944 == 0))) { - phi_return = draw_status_ui(); +void func_800363FC(void) { + if (D_800A0944 == 4 || D_800A0944 == 0) { + draw_status_ui(); } - return phi_return; } s32 func_80036430(void) { diff --git a/src/code_13480_len_3f0.c b/src/code_13480_len_3f0.c index 422d2b3c21..6f90505eb5 100644 --- a/src/code_13480_len_3f0.c +++ b/src/code_13480_len_3f0.c @@ -1,15 +1,19 @@ #include "common.h" -#ifdef NON_MATCHING void init_demo_data(void) { + GameStatus* gameStatus; + GameStatus* gameStatus2; + if (GAME_STATUS->demoState == 0) { GAME_STATUS->nextDemoScene = 0; GAME_STATUS->demoState = 1; } + gameStatus = GAME_STATUS; GAME_STATUS->demoStickX = 0; - GAME_STATUS->demoButtonInput = 0; - GAME_STATUS->demoStickY = 0; + gameStatus2 = GAME_STATUS; + gameStatus->demoButtonInput = 0; + gameStatus2->demoStickY = 0; func_80056228(); set_map_transition_effect(2); @@ -17,9 +21,6 @@ void init_demo_data(void) { clear_saved_variables(); clear_script_list(); } -#else -INCLUDE_ASM(s32, "code_13480_len_3f0", init_demo_data); -#endif INCLUDE_ASM(s32, "code_13480_len_3f0", next_demo_scene); diff --git a/src/code_13870_len_6980.c b/src/code_13870_len_6980.c index 73c9a47842..8206b559bf 100644 --- a/src/code_13870_len_6980.c +++ b/src/code_13870_len_6980.c @@ -3,7 +3,13 @@ void NOP_npc_callback(void) { } -INCLUDE_ASM(s32, "code_13870_len_6980", mtx_ident_mirror_y); +void mtx_ident_mirror_y(Matrix4f* mtx) { + guMtxIdentF(mtx); + mtx->mtx[0][0] = 1.0f; + mtx->mtx[1][1] = -1.0f; + mtx->mtx[2][2] = 1.0f; + mtx->mtx[3][3] = 1.0f; +} INCLUDE_ASM(s32, "code_13870_len_6980", clear_npcs); @@ -59,9 +65,29 @@ INCLUDE_ASM(s32, "code_13870_len_6980", func_8003AC5C); INCLUDE_ASM(s32, "code_13870_len_6980", enable_npc_blur); -INCLUDE_ASM(s32, "code_13870_len_6980", disable_npc_blur); +void disable_npc_blur(Npc* npc) { + if (npc->flags & 0x100000) { + npc->flags &= ~0x100000; + heap_free(npc->blurData); + npc->blurData = NULL; + } +} -INCLUDE_ASM(s32, "code_13870_len_6980", update_npc_blur); +void update_npc_blur(Npc* npc) { + NpcBlurData* blurData = npc->blurData; + s32 index = blurData->unk_01; + + blurData->xpos[index] = npc->pos.x; + blurData->ypos[index] = npc->pos.y; + blurData->zpos[index] = npc->pos.z; + + index++; + if (index >= 20) { + index = 0; + } + + blurData->unk_01 = index; +} INCLUDE_ASM(s32, "code_13870_len_6980", appedGfx_npc_blur); @@ -199,6 +225,6 @@ INCLUDE_ASM(s32, "code_13870_len_6980", bind_npc_aux); INCLUDE_ASM(s32, "code_13870_len_6980", bind_npc_interact); -INCLUDE_ASM(s32, "code_13870_len_6980", get_enemy); +INCLUDE_ASM(Enemy*, "code_13870_len_6980", get_enemy, NpcId npcId); INCLUDE_ASM(s32, "code_13870_len_6980", get_enemy_safe); diff --git a/src/code_1f580_len_1940.c b/src/code_1f580_len_1940.c index 312904464f..929fc7d424 100644 --- a/src/code_1f580_len_1940.c +++ b/src/code_1f580_len_1940.c @@ -1,6 +1,19 @@ #include "common.h" -INCLUDE_ASM(s32, "code_1f580_len_1940", SetEncounterStatusFlags, ScriptInstance* script, s32 isInitialCall); +ApiStatus SetEncounterStatusFlags(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + EncounterStatus* currentEncounter = &gCurrentEncounter; + EncounterStatus* currentEncounter2 = &gCurrentEncounter; + s32 a0 = *args++; + + if (get_variable(script, *args)) { + currentEncounter->flags |= a0; + } else { + currentEncounter2->flags &= ~a0; + } + + return ApiStatus_DONE2; +} ApiStatus func_800441F0(ScriptInstance* script, s32 isInitialCall) { Bytecode arg1 = *script->ptrReadPos; @@ -49,7 +62,22 @@ ApiStatus GetOwnerEncounterTrigger(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_1f580_len_1940", DoNpcDefeat, ScriptInstance* script, s32 isInitialCall); +ApiStatus DoNpcDefeat(ScriptInstance* script, s32 isInitialCall) { + Enemy* owner = script->ownerActorID; + Npc* temp_s1 = get_npc_unsafe(owner->npcID); + ScriptInstance* newScript; + + kill_script(script); + temp_s1->currentAnim = owner->animList[6]; + newScript = start_script(&SCRIPT_NpcDefeat, 10, 0); + owner->defeatScript = newScript; + owner->defeatScriptID = newScript->uniqueID; + newScript->ownerActorID = owner; + newScript->ownerID = owner->npcID; + newScript->groupFlags = owner->scriptGroup; + + return ApiStatus_FINISH; +} INCLUDE_ASM(s32, "code_1f580_len_1940", start_battle); @@ -77,35 +105,278 @@ ApiStatus SetBattleMusic(ScriptInstance* script, s32 isInitialCall) { INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcAI, ScriptInstance* script, s32 isInitialCall); -INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcIdle, ScriptInstance* script, s32 isInitialCall); +ApiStatus BindNpcIdle(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* owner = script->ownerActorID; + NpcId npcID = get_variable(script, *args++); + Bytecode* aiBytecode = (Bytecode*)get_variable(script, *args); -INCLUDE_ASM(s32, "code_1f580_len_1940", RestartNpcAI, ScriptInstance* script, s32 isInitialCall); + if (npcID == NpcId_SELF) { + npcID = owner->npcID; + } -INCLUDE_ASM(s32, "code_1f580_len_1940", EnableNpcAI, ScriptInstance* script, s32 isInitialCall); + owner = get_enemy(npcID); + owner->aiBytecode = aiBytecode; + + return ApiStatus_DONE2; +} + +ApiStatus RestartNpcAI(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* npc = script->ownerActorID; + NpcId npcId = get_variable(script, *args++); + ScriptInstance* newScript; + s32 groupFlags; + + if (npcId == NpcId_SELF) { + npcId = npc->npcID; + } + + npc = get_enemy(npcId); + + if (npc->flags & 1) { + groupFlags = 10; + } else { + groupFlags = 11; + } + + if (npc->aiScript != NULL) { + kill_script_by_ID(npc->aiScriptID); + } + + npc->unk_C8 = 100; + newScript = start_script(npc->aiBytecode, 10, 0); + npc->aiScript = newScript; + npc->aiScriptID = newScript->uniqueID; + newScript->ownerActorID = npc; + newScript->ownerID = script->ownerID; + newScript->groupFlags = groupFlags; + + return ApiStatus_DONE2; +} + +ApiStatus EnableNpcAI(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* npc = script->ownerActorID; + NpcId npcId = get_variable(script, *args++); + s32 var2 = get_variable(script, *args); + + if (npcId == NpcId_SELF) { + npcId = npc->npcID; + } + + npc = get_enemy(npcId); + + if (var2 != 0) { + if (npc->aiScript != NULL) { + resume_all_script(npc->aiScriptID); + } + } else if (npc->aiScript != NULL) { + suspend_all_script(npc->aiScriptID); + } + + return ApiStatus_DONE2; +} INCLUDE_ASM(s32, "code_1f580_len_1940", SetNpcAux, ScriptInstance* script, s32 isInitialCall); -INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcAux, ScriptInstance* script, s32 isInitialCall); +ApiStatus BindNpcAux(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* npc = script->ownerActorID; + NpcId npcId = get_variable(script, *args++); + Bytecode* auxBytecode = (Bytecode*)get_variable(script, *args); -INCLUDE_ASM(s32, "code_1f580_len_1940", RestartNpcAux, ScriptInstance* script, s32 isInitialCall); + if (npcId == NpcId_SELF) { + npcId = npc->npcID; + } -INCLUDE_ASM(s32, "code_1f580_len_1940", EnableNpcAux, ScriptInstance* script, s32 isInitialCall); + npc = get_enemy(npcId); + npc->auxBytecode = auxBytecode; -INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcInteract, ScriptInstance* script, s32 isInitialCall); + return ApiStatus_DONE2; +} -INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcHit, ScriptInstance* script, s32 isInitialCall); +ApiStatus RestartNpcAux(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* npc = script->ownerActorID; + NpcId npcId = get_variable(script, *args++); + ScriptInstance* newScript; + s32 groupFlags; -INCLUDE_ASM(s32, "code_1f580_len_1940", BindNpcDefeat, ScriptInstance* script, s32 isInitialCall); + if (npcId == NpcId_SELF) { + npcId = npc->npcID; + } -INCLUDE_ASM(s32, "code_1f580_len_1940", SetSelfVar, ScriptInstance* script, s32 isInitialCall); + npc = get_enemy(npcId); -INCLUDE_ASM(s32, "code_1f580_len_1940", GetSelfVar, ScriptInstance* script, s32 isInitialCall); + if (npc->flags & 1) { + groupFlags = 10; + } else { + groupFlags = 11; + } -INCLUDE_ASM(s32, "code_1f580_len_1940", SetNpcVar, ScriptInstance* script, s32 isInitialCall); + if (npc->auxScript != NULL) { + kill_script_by_ID(npc->auxScriptID); + } -INCLUDE_ASM(s32, "code_1f580_len_1940", GetNpcVar, ScriptInstance* script, s32 isInitialCall); + newScript = start_script(npc->auxBytecode, 10, 0); + npc->auxScript = newScript; + npc->auxScriptID = newScript->uniqueID; + newScript->ownerActorID = npc; + newScript->ownerID = npcId; + newScript->groupFlags = groupFlags; -INCLUDE_ASM(s32, "code_1f580_len_1940", SetSelfRotation, ScriptInstance* script, s32 isInitialCall); + return ApiStatus_DONE2; +} + +ApiStatus EnableNpcAux(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* npc = script->ownerActorID; + NpcId npcId = get_variable(script, *args++); + s32 var2 = get_variable(script, *args); + + if (npcId == NpcId_SELF) { + npcId = npc->npcID; + } + + npc = get_enemy(npcId); + + if (var2 != 0) { + if (npc->auxScript != NULL) { + resume_all_script(npc->auxScriptID); + } + } else if (npc->auxScript != NULL) { + suspend_all_script(npc->auxScriptID); + } + + return ApiStatus_DONE2; +} + +ApiStatus BindNpcInteract(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* npc = script->ownerActorID; + NpcId npcId = get_variable(script, *args++); + Bytecode* interactBytecode = (Bytecode*)get_variable(script, *args); + + if (npcId == NpcId_SELF) { + npcId = npc->npcID; + } + + npc = get_enemy(npcId); + + if (npc->interactScript != NULL) { + kill_script_by_ID(npc->interactScriptID); + } + npc->interactBytecode = interactBytecode; + + return ApiStatus_DONE2; +} + +ApiStatus BindNpcHit(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* npc = script->ownerActorID; + NpcId npcId = get_variable(script, *args++); + Bytecode* hitBytecode = (Bytecode*)get_variable(script, *args); + + if (npcId == NpcId_SELF) { + npcId = npc->npcID; + } + + npc = get_enemy(npcId); + + if (npc->hitScript != NULL) { + kill_script_by_ID(npc->hitScriptID); + } + npc->hitBytecode = hitBytecode; + + return ApiStatus_DONE2; +} + +ApiStatus BindNpcDefeat(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* npc = script->ownerActorID; + s32 npcId = get_variable(script, *args++); + Bytecode* defeatBytecode = (Bytecode*)get_variable(script, *args); + + if (npcId == -1) { + npcId = npc->npcID; + } + + npc = get_enemy(npcId); + npc->defeatBytecode = defeatBytecode; + + return ApiStatus_DONE2; +} + +ApiStatus SetSelfVar(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* owner = script->ownerActorID; + s32 var1 = get_variable(script, *args++); + s32 var2 = get_variable(script, *args); + + owner->varTable[var1] = var2; + return ApiStatus_DONE2; +} + +ApiStatus GetSelfVar(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + + set_variable(script, *args, script->ownerActorID->varTable[get_variable(script, *args++)]); + return ApiStatus_DONE2; +} + +ApiStatus SetNpcVar(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* npc = script->ownerActorID; + NpcId npcId = get_variable(script, *args++); + s32 varIdx = get_variable(script, *args++); + s32 val = get_variable(script, *args); + + if (npcId == NpcId_SELF) { + npcId = npc->npcID; + } + + npc = get_enemy(npcId); + npc->varTable[varIdx] = val; + + return ApiStatus_DONE2; +} + +ApiStatus GetNpcVar(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* npc; + NpcId npcID; + s32 varIdx; + s32 var3; + + npc = script->ownerActorID; + npcID = get_variable(script, *args++); + varIdx = get_variable(script, *args++); + var3 = *args; + + if (npcID == NpcId_SELF) { + npcID = npc->npcID; + } + + npc = get_enemy(npcID); + set_variable(script, var3, npc->varTable[varIdx]); + + return ApiStatus_DONE2; +} + +ApiStatus SetSelfRotation(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Npc* self = get_npc_unsafe(script->ownerID); + s32 rotX = get_variable(script, *args++); + s32 rotY = get_variable(script, *args++); + s32 rotZ = get_variable(script, *args++); + + self->rotation.x = rotX; + self->rotation.y = rotY; + self->rotation.z = rotZ; + + return ApiStatus_DONE2; +} ApiStatus SetSelfEnemyFlags(ScriptInstance* script, s32 isInitialCall) { script->ownerActorID->flags = *script->ptrReadPos; @@ -113,11 +384,11 @@ ApiStatus SetSelfEnemyFlags(ScriptInstance* script, s32 isInitialCall) { } ApiStatus SetSelfEnemyFlagBits(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; Enemy* owner = script->ownerActorID; - s32 bits = thisPos[0]; + s32 bits = *args++; - if (get_variable(script, thisPos[1])) { + if (get_variable(script, *args)) { owner->flags |= bits; } else { owner->flags &= ~bits; @@ -125,22 +396,70 @@ ApiStatus SetSelfEnemyFlagBits(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_1f580_len_1940", func_80045580); +ApiStatus func_80045580(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* owner = script->ownerActorID; + Npc* npc = get_npc_unsafe(script->ownerID); + + owner->unk_07 = get_variable(script, *args); + owner->unk_10.x = npc->pos.x; + owner->unk_10.y = npc->pos.y; + owner->unk_10.z = npc->pos.z; + + return ApiStatus_DONE2; +} ApiStatus GetSelfNpcID(ScriptInstance* script, s32 isInitialCall) { set_variable(script, *script->ptrReadPos, script->ownerActorID->npcID); return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_1f580_len_1940", ClearDefeatedEnemies, ScriptInstance* script, s32 isInitialCall); +ApiStatus ClearDefeatedEnemies(ScriptInstance* script, s32 isInitialCall) { + EncounterStatus* currentEncounter = &gCurrentEncounter; + s32 i; + s32 j; -INCLUDE_ASM(s32, "code_1f580_len_1940", SetEnemyFlagBits, ScriptInstance* script, s32 isInitialCall); + for (i = 0; i < 60; i++) { + for (j = 0; j < 12; j++) { + currentEncounter->defeatFlags[i][j] = 0; + } + } + return ApiStatus_DONE2; +} + +ApiStatus SetEnemyFlagBits(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* npc = script->ownerActorID; + NpcId npcId = get_variable(script, *args++); + s32 bits = *args++; + s32 var2 = get_variable(script, *args); + + if (npcId == NpcId_SELF) { + npcId = npc->npcID; + } + + npc = get_enemy(npcId); + + if (var2 != NULL) { + npc->flags |= bits; + } else { + npc->flags &= ~bits; + } + + return ApiStatus_DONE2; +} ApiStatus func_8004572C(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_1f580_len_1940", GetSelfAnimationFromTable, ScriptInstance* script, s32 isInitialCall); +ApiStatus GetSelfAnimationFromTable(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Enemy* owner = script->ownerActorID; + + set_variable(script, *args, owner->animList[get_variable(script, *args++)]); + return ApiStatus_DONE2; +} ApiStatus func_80045798(ScriptInstance* script, s32 isInitialCall) { D_8010EF08 = get_variable(script, *script->ptrReadPos); @@ -151,7 +470,7 @@ ApiStatus func_800457C4(ScriptInstance* script, s32 isInitialCall) { Enemy* ownerActor = script->ownerActorID; ownerActor->unk_B5 = get_variable(script, *script->ptrReadPos); - return 2; + return ApiStatus_DONE2; } ApiStatus func_800457F8(ScriptInstance* script, s32 isInitialCall) { @@ -164,7 +483,22 @@ ApiStatus func_8004580C(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_1f580_len_1940", func_80045838); +ApiStatus func_80045838(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Npc* npc; + s32 var1 = get_variable(script, *args++); + s32 var2 = get_variable(script, *args++); + s32 var3 = get_variable(script, *args); + + npc = resolve_npc(script, var1); + if (npc != NULL) { + func_800494C0(npc, var2, var3); + } + + return ApiStatus_DONE2; + + do {} while (0); // necessary to match +} ApiStatus func_800458CC(ScriptInstance* script, s32 isInitialCall) { set_variable(script, *script->ptrReadPos, script->ownerActorID->npcSettings->unkFlags & 8); @@ -173,4 +507,12 @@ ApiStatus func_800458CC(ScriptInstance* script, s32 isInitialCall) { INCLUDE_ASM(s32, "code_1f580_len_1940", func_80045900); -INCLUDE_ASM(s32, "code_1f580_len_1940", func_80045A58); +ApiStatus SetTattleString(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + NpcId enemyId = get_variable(script, *args++); + u32 tattleString = get_variable(script, *args); + Enemy* npc = get_enemy(enemyId); + + npc->tattleString = tattleString; + return ApiStatus_DONE2; +} diff --git a/src/code_20ec0_len_5040.c b/src/code_20ec0_len_5040.c index f06eaaed0f..1ddc2eac5b 100644 --- a/src/code_20ec0_len_5040.c +++ b/src/code_20ec0_len_5040.c @@ -100,19 +100,92 @@ INCLUDE_ASM(s32, "code_20ec0_len_5040", func_8004824C); INCLUDE_ASM(s32, "code_20ec0_len_5040", spawn_drops); +#ifdef NON_MATCHING +s32 get_coin_drop_amount(Enemy* enemy) { + EncounterStatus* currentEncounter; + s32 amt; + + s32 diff; + s32 a; + s32 max; + s32 min; + + currentEncounter = &gCurrentEncounter; + + min = enemy->dropTables[89]; + max = enemy->dropTables[90]; + a = min; + + if (max < min) { + min = max; + max = a; + } + + diff = max - min; + + amt = min; + if ((min < 0) || (diff != 0)) { + amt = rand_int(diff) + min; + } + + if (amt < 0) { + amt = 0; + } + + if (is_ability_active(Ability_PAY_OFF)) { + amt += currentEncounter->damageTaken / 2; + } + + if (currentEncounter->merleeCoinBonus != 0) { + amt *= 3; + } + + if (is_ability_active(Ability_MONEY_MONEY)) { + amt *= 2; + } + + amt += currentEncounter->coinsEarned; + + if (enemy->flags & 0x840000) { + amt = 0; + } + + if (amt > 20) { + amt = 20; + } + + return amt; +} +#else INCLUDE_ASM(s32, "code_20ec0_len_5040", get_coin_drop_amount); +#endif INCLUDE_ASM(s32, "code_20ec0_len_5040", func_80048E34); INCLUDE_ASM(s32, "code_20ec0_len_5040", func_80048F0C); -INCLUDE_ASM(s32, "code_20ec0_len_5040", is_point_within_region); +s32 is_point_within_region(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 centerY, f32 sizeX, f32 sizeZ) { + f32 dist1; + f32 dist2; + + switch (shape) { + case 0: + dist1 = dist2D(pointX, pointY, centerX, centerY); + return (sizeX < dist1); + case 1: + dist1 = dist2D(pointX, 0, centerX, 0); + dist2 = dist2D(0, pointY, 0, centerY); + return ((sizeX < dist1) || (sizeZ < dist2)); + default: + return FALSE; + } +} INCLUDE_ASM(s32, "code_20ec0_len_5040", func_800490B4); INCLUDE_ASM(s32, "code_20ec0_len_5040", func_800493EC); -INCLUDE_ASM(s32, "code_20ec0_len_5040", func_800494C0); +INCLUDE_ASM(s32, "code_20ec0_len_5040", func_800494C0, Npc* npc, s32 arg1, s32 arg2); INCLUDE_ASM(s32, "code_20ec0_len_5040", func_80049550); diff --git a/src/code_3bf0_len_6f0.c b/src/code_3bf0_len_6f0.c index 3d7b58373e..fd97f0571a 100644 --- a/src/code_3bf0_len_6f0.c +++ b/src/code_3bf0_len_6f0.c @@ -5,9 +5,9 @@ void func_800287F0(void) { GameStatus* gameStatus; GameStatus* gameStatus2; - gameStatus = *gGameStatusPtr; + gameStatus = GAME_STATUS; gameStatus->stickX = 0; - gameStatus2 = *gGameStatusPtr; + gameStatus2 = GAME_STATUS; gameStatus->currentButtons = 0; gameStatus->pressedButtons = 0; gameStatus->heldButtons = 0; @@ -15,10 +15,10 @@ void func_800287F0(void) { // TODO: macro { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; gameStatus->prevButtons = 0; - gameStatus->unk_50 = 4; - gameStatus->unk_48 = 15; + gameStatus->unk_50[0] = 4; + gameStatus->unk_48[0] = 15; gameStatus->unk_60 = 0; gameStatus->unk_58 = 0; } diff --git a/src/code_42e0_len_1f60.c b/src/code_42e0_len_1f60.c index b0e810dfc3..225cf65921 100644 --- a/src/code_42e0_len_1f60.c +++ b/src/code_42e0_len_1f60.c @@ -62,7 +62,7 @@ INCLUDE_ASM(s32, "code_42e0_len_1f60", func_80029860); s32 _advance_rng(void) { s32* rngVal = &gRandSeed; - (*gGameStatusPtr)->nextRNG = *rngVal = (*rngVal * 0x5D588B65) + 1; + GAME_STATUS->nextRNG = *rngVal = (*rngVal * 0x5D588B65) + 1; return *rngVal; } @@ -106,7 +106,7 @@ f32 get_clamped_angle_diff(f32 a, f32 b) { INCLUDE_ASM(f32, "code_42e0_len_1f60", atan2, f32 startX, f32 startZ, f32 endX, f32 endZ); f32 get_player_normal_yaw(void) { - return atan2(0, 0, (*gGameStatusPtr)->playerTraceNormal.x, (*gGameStatusPtr)->playerTraceNormal.z); + return atan2(0, 0, GAME_STATUS->playerTraceNormal.x, GAME_STATUS->playerTraceNormal.z); } INCLUDE_ASM(s32, "code_42e0_len_1f60", get_player_normal_pitch); diff --git a/src/code_6240_len_c00.c b/src/code_6240_len_c00.c index 269386f05c..9ba42f8425 100644 --- a/src/code_6240_len_c00.c +++ b/src/code_6240_len_c00.c @@ -1,5 +1,7 @@ #include "common.h" +void fio_serialize_state(void); + INCLUDE_ASM(s32, "code_6240_len_c00", get_spirits_rescued); INCLUDE_ASM(s32, "code_6240_len_c00", fio_calc_header_checksum); @@ -10,7 +12,19 @@ INCLUDE_ASM(s32, "code_6240_len_c00", fio_has_valid_backup); INCLUDE_ASM(s32, "code_6240_len_c00", fio_flush_backups); +#ifdef NON_MATCHING +s32 fio_calc_file_checksum(s32* saveData) { + u32 sum = 0; + u32 i = 0; + + for (i = 0; i < 0x4E0; i++) { + sum += saveData[i]; + } + return sum; +} +#else INCLUDE_ASM(s32, "code_6240_len_c00", fio_calc_file_checksum); +#endif INCLUDE_ASM(s32, "code_6240_len_c00", fio_validate_file_checksum); @@ -24,9 +38,12 @@ INCLUDE_ASM(s32, "code_6240_len_c00", fio_erase_game); INCLUDE_ASM(s32, "code_6240_len_c00", fio_deserialize_state); -INCLUDE_ASM(s32, "code_6240_len_c00", func_8002B608); +void func_8002B608(void) { + GAME_STATUS->entryID = 10; + fio_serialize_state(); +} -INCLUDE_ASM(s32, "code_6240_len_c00", fio_serialize_state); +INCLUDE_ASM(void, "code_6240_len_c00", fio_serialize_state); void fio_init_flash(void) { osFlashInit(); diff --git a/src/code_7E3700.c b/src/code_7E3700.c index 2390838886..042ed09145 100644 --- a/src/code_7E3700.c +++ b/src/code_7E3700.c @@ -12,7 +12,14 @@ INCLUDE_ASM(s32, "code_7E3700", func_80283080); INCLUDE_ASM(s32, "code_7E3700", func_80283174); -INCLUDE_ASM(s32, "code_7E3700", CheckActionState); +ApiStatus CheckActionState(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Bytecode a0 = *args++; + s32 var = get_float_variable(script, *args); + + set_variable(script, a0, gPlayerActionState == var); + return ApiStatus_DONE2; +} INCLUDE_ASM(s32, "code_7E3700", func_80283240); diff --git a/src/code_7bb60_len_41b0.c b/src/code_7bb60_len_41b0.c index 3544adb4d7..35841f3fcf 100644 --- a/src/code_7bb60_len_41b0.c +++ b/src/code_7bb60_len_41b0.c @@ -1,21 +1,25 @@ #include "common.h" -INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E26B0); +void func_800E26B0(void) { + PlayerStatus* playerStatus = &gPlayerStatus; + + playerStatus->jumpApexHeight = playerStatus->position.y; +} INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E26C4); void set_action_state(s32 actionState); void move_player(s16 duration, f32 heading, f32 speed) { - PlayerStatus* player_status = &gPlayerStatus; + PlayerStatus* playerStatus = &gPlayerStatus; - player_status->flags = player_status->flags | 0x4000; - player_status->heading = heading; - player_status->moveFrames = duration; - player_status->currentSpeed = speed; + playerStatus->flags |= 0x4000; + playerStatus->heading = heading; + playerStatus->moveFrames = duration; + playerStatus->currentSpeed = speed; - if (!(player_status->animFlags & 0x00400000)) { - set_action_state(speed > player_status->walkSpeed ? ActionState_RUN : ActionState_WALK); + if (!(playerStatus->animFlags & 0x400000)) { + set_action_state(speed > playerStatus->walkSpeed ? ActionState_RUN : ActionState_WALK); } } @@ -37,9 +41,29 @@ INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E315C); INCLUDE_ASM(s32, "code_7bb60_len_41b0", phys_player_land); -INCLUDE_ASM(s32, "code_7bb60_len_41b0", integrate_gravity); +f32 integrate_gravity(void) { + PlayerStatus* playerStatus = &gPlayerStatus; -INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E34D8); + if (playerStatus->flags & 0x40000) { + playerStatus->gravityIntegrator[2] += playerStatus->gravityIntegrator[3] / 1.7f; + playerStatus->gravityIntegrator[1] += playerStatus->gravityIntegrator[2] / 1.7f; + playerStatus->gravityIntegrator[0] += playerStatus->gravityIntegrator[1] / 1.7f; + } else { + playerStatus->gravityIntegrator[2] += playerStatus->gravityIntegrator[3]; + playerStatus->gravityIntegrator[1] += playerStatus->gravityIntegrator[2]; + playerStatus->gravityIntegrator[0] += playerStatus->gravityIntegrator[1]; + } + return playerStatus->gravityIntegrator[0]; +} + +f32 func_800E34D8(void) { + f32 ret = integrate_gravity(); + + if (func_800E0208() != 0) { + ret = 0.0f; + } + return ret; +} INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E3514); @@ -67,7 +91,9 @@ INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E4F10); INCLUDE_ASM(s32, "code_7bb60_len_41b0", check_input_midair_jump); -INCLUDE_ASM(s32, "code_7bb60_len_41b0", get_current_partner_id); +PartnerId get_current_partner_id(void) { + return gPlayerData.currentPartner; +} INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E5098); @@ -81,7 +107,13 @@ INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E5348); INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E546C); -INCLUDE_ASM(s32, "code_7bb60_len_41b0", save_ground_pos); +void save_ground_pos(void) { + PlayerStatus* playerStatus = &gPlayerStatus; + + playerStatus->lastGoodPosition.x = playerStatus->position.x; + playerStatus->lastGoodPosition.y = playerStatus->position.y; + playerStatus->lastGoodPosition.z = playerStatus->position.z; +} INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E5520); @@ -98,21 +130,21 @@ INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E5A2C); INCLUDE_ASM(s32, "code_7bb60_len_41b0", func_800E5C78); void set_action_state(s32 actionState) { - PlayerStatus* player_status = &gPlayerStatus; - PlayerData* player_data = &gPlayerData; - UNK_TYPE* unknown_struct = &D_8010F250; + PlayerStatus* playerStatus = &gPlayerStatus; + PlayerData* playerData = &gPlayerData; + UNK_TYPE* unknownStruct = &D_8010F250; - if (player_status->flags & 0x200) { - player_status->flags &= ~0x200; + if (playerStatus->flags & 0x200) { + playerStatus->flags &= ~0x200; enable_player_input(); } - if (player_status->animFlags & 0x4000) { + if (playerStatus->animFlags & 0x4000) { if (actionState < ActionState_CONVERSATION) { if (actionState >= 0) { - player_status->prevActionState = player_status->actionState; - player_status->actionState = actionState; - player_status->flags |= 0x80000000; + playerStatus->prevActionState = playerStatus->actionState; + playerStatus->actionState = actionState; + playerStatus->flags |= 0x80000000; } } return; @@ -121,71 +153,102 @@ void set_action_state(s32 actionState) { if (actionState == ActionState_HIT_HAZARD || actionState == ActionState_HIT_LAVA) { u8 partner; - if (player_status->unk_BF == 3) { + if (playerStatus->unk_BF == 3) { actionState = ActionState_HIT_HAZARD; } // Whilst Lakilester, Bow, or Parakarry's ability is active, hazards have no effect. - partner = player_data->currentPartner; - if ((partner - 7) < 2u || (s8)partner == PartnerId_PARAKARRY) { - if (D_8010EBB0) { - player_status->animFlags |= 0x4; - player_status->flags |= 0x800; + partner = playerData->currentPartner; + if (((u8)(partner - 7) < 2) || (playerData->currentPartner == PartnerId_PARAKARRY)) { + if (D_8010EBB0[0]) { + playerStatus->animFlags |= 0x4; + playerStatus->flags |= 0x800; return; } } } if (actionState == ActionState_SLIDING) { - player_status->flags |= 0x10; - player_status->moveFrames = 0; - player_status->flags &= ~0x4000; + playerStatus->flags |= 0x10; + playerStatus->moveFrames = 0; + playerStatus->flags &= ~0x4000; } - player_status->prevActionState = player_status->actionState; + playerStatus->prevActionState = playerStatus->actionState; if (actionState == ActionState_USE_TWEESTER) { - player_status->prevActionState = ActionState_IDLE; + playerStatus->prevActionState = ActionState_IDLE; } if (actionState == ActionState_ENEMY_FIRST_STRIKE) { - player_status->animFlags |= 4; + playerStatus->animFlags |= 4; } - player_status->actionState = actionState; - player_status->flags |= 0x80000000; + playerStatus->actionState = actionState; + playerStatus->flags |= 0x80000000; - if (player_status->actionState == ActionState_SPIN) { + if (playerStatus->actionState == ActionState_SPIN) { return; } - player_status->flags &= 0xFFFDFFFF; - player_status->animFlags &= 0xFFFEFFFF; + playerStatus->flags &= ~0x20000; + playerStatus->animFlags &= ~0x10000; - if (unknown_struct[0xC]) { - stop_sound(unknown_struct[0xC]); + if (unknownStruct[0xC]) { + stop_sound(unknownStruct[0xC]); } - if (player_status->unk_D8) { - player_status->unk_D8[3][9] = 0xA; - player_status->unk_D8 = NULL; + if (playerStatus->unk_D8) { + playerStatus->unk_D8[3][9] = 0xA; + playerStatus->unk_D8 = NULL; } } -INCLUDE_ASM(s32, "code_7bb60_len_41b0", update_locomotion_state); +void update_locomotion_state(void) { + PlayerStatus* playerStatus = (&gPlayerStatus); + do { } while (0); // required to match -INCLUDE_ASM(s32, "code_7bb60_len_41b0", start_falling); + set_action_state((!is_ability_active(Ability_SLOW_GO) + && (SQ(playerStatus->stickAxis[0]) + SQ(playerStatus->stickAxis[1]) >= 0xBD2)) ? ActionState_RUN : ActionState_WALK); +} -INCLUDE_ASM(s32, "code_7bb60_len_41b0", start_bounce_a); +void start_falling(void) { + PlayerStatus* playerStatus = &gPlayerStatus; -INCLUDE_ASM(s32, "code_7bb60_len_41b0", start_bounce_b); + set_action_state(ActionState_FALLING); + playerStatus->gravityIntegrator[0] = 0.1143f; + playerStatus->gravityIntegrator[1] = -0.2871f; + playerStatus->gravityIntegrator[2] = -0.1823f; + playerStatus->gravityIntegrator[3] = 0.01152f; +} + +void start_bounce_a(void) { + PlayerStatus* playerStatus = &gPlayerStatus; + + set_action_state(ActionState_BOUNCE); + playerStatus->gravityIntegrator[0] = 10.0f; + playerStatus->gravityIntegrator[1] = -2.0f; + playerStatus->gravityIntegrator[2] = 0.8f; + playerStatus->gravityIntegrator[3] = -0.75f; +} + +void start_bounce_b(void) { + PlayerStatus* playerStatus = &gPlayerStatus; + + set_action_state(ActionState_BOUNCE); + playerStatus->gravityIntegrator[0] = 8.0f; + playerStatus->gravityIntegrator[1] = -1.0f; + playerStatus->gravityIntegrator[2] = 0; + playerStatus->gravityIntegrator[3] = 0; + playerStatus->flags |= 0x800000; +} s32 check_input_hammer(void) { - PlayerStatus* player_status = &gPlayerStatus; - PlayerData* player_data = &gPlayerData; + PlayerStatus* playerStatus = &gPlayerStatus; + PlayerData* playerData = &gPlayerData; - if (player_status->pressedButtons & Buttons_B) { - if (!(player_status->flags & 4)) { - if (D_8010EBB0 != 1 || player_data->currentPartner != PartnerId_WATT) { - if (player_data->hammerLevel != -1) { + if (playerStatus->pressedButtons & Button_B) { + if (!(playerStatus->flags & 4)) { + if (D_8010EBB0[0] != 1 || playerData->currentPartner != PartnerId_WATT) { + if (playerData->hammerLevel != -1) { set_action_state(ActionState_HAMMER); return TRUE; } diff --git a/src/code_80850_len_3060.c b/src/code_80850_len_3060.c index 083ab8bfae..fa0bc1af7f 100644 --- a/src/code_80850_len_3060.c +++ b/src/code_80850_len_3060.c @@ -280,7 +280,7 @@ void coin_counter_draw_content(UNK_TYPE arg0, s32 posX, s32 posY) { UiStatus* uiStatus = &gUIStatus; s32 iconIndex; - if ((gPlayerData.coins != uiStatus->displayCoins) && (((*gGameStatusPtr)->frameCounter % 3) == 0)) { + if ((gPlayerData.coins != uiStatus->displayCoins) && ((GAME_STATUS->frameCounter % 3) == 0)) { play_sound(0x211); } @@ -514,7 +514,7 @@ s32 is_status_menu_visible(void) { } void status_menu_start_blinking_hp(void) { - GameStatus* gameStatus = (*gGameStatusPtr); + GameStatus* gameStatus = GAME_STATUS; UiStatus* uiStatus = &gUIStatus; UiStatus* uiStatus2 = &gUIStatus; @@ -539,7 +539,7 @@ void status_menu_stop_blinking_hp(void) { } void status_menu_start_blinking_fp(void) { - GameStatus* gameStatus = (*gGameStatusPtr); + GameStatus* gameStatus = GAME_STATUS; UiStatus* uiStatus = &gUIStatus; UiStatus* uiStatus2 = &gUIStatus; @@ -563,7 +563,7 @@ void status_menu_stop_blinking_fp(void) { } void status_menu_start_blinking_coins(void) { - GameStatus* gameStatus = (*gGameStatusPtr); + GameStatus* gameStatus = GAME_STATUS; UiStatus* uiStatus = &gUIStatus; UiStatus* uiStatus2 = &gUIStatus; diff --git a/src/code_ED510.c b/src/code_ED510.c new file mode 100644 index 0000000000..b5e6188435 --- /dev/null +++ b/src/code_ED510.c @@ -0,0 +1,320 @@ +#include "common.h" + +INCLUDE_ASM(s32, "code_ED510", TranslateModel, ScriptInstance* script, s32 isInitialCall); + +INCLUDE_ASM(s32, "code_ED510", RotateModel, ScriptInstance* script, s32 isInitialCall); + +INCLUDE_ASM(s32, "code_ED510", ScaleModel, ScriptInstance* script, s32 isInitialCall); + +ApiStatus GetModelIndex(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + Bytecode modelID = get_variable(script, *thisPos++); + Bytecode index = *thisPos++; + + set_variable(script, index, get_model_list_index_from_tree_index(modelID)); + return ApiStatus_DONE2; +} + +ApiStatus func_802C8EE4(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + Bytecode modelID = get_variable(script, *thisPos++); + Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(modelID)); + + model->flags &= ~0x400; + return ApiStatus_DONE2; +} + +ApiStatus CloneModel(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + Bytecode srcModelID = get_variable(script, *thisPos++); + Bytecode newModelID = get_variable(script, *thisPos++); + + clone_model(srcModelID, newModelID); + return ApiStatus_DONE2; +} + +ApiStatus GetModelCenter(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + f32 centerX; + f32 centerY; + f32 centerZ; + f32 sizeX; + f32 sizeY; + f32 sizeZ; + + get_model_center_and_size(get_variable(script, *thisPos++) & 0xFFFF, ¢erX, ¢erY, ¢erZ, &sizeX, &sizeY, + &sizeZ); + script->varTable[0] = centerX; + script->varTable[1] = centerY; + script->varTable[2] = centerZ; + return ApiStatus_DONE2; +} + +ApiStatus SetTexPanner(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + s32 treeIndex = get_variable(script, *thisPos++); + s32 var2 = get_variable(script, *thisPos++); + Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex)); + + set_tex_panner(model, var2); + model->flags |= 0x800; + return ApiStatus_DONE2; +} + +ApiStatus SetModelFlag10(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + Bytecode treeIndex = get_variable(script, *thisPos++); + Bytecode var2 = get_variable(script, *thisPos++); + Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex)); + + if (var2 != 0) { + model->flags |= 0x10; + } else { + model->flags &= ~0x10; + } + return ApiStatus_DONE2; +} + +#ifdef NON_MATCHING +ApiStatus func_802C90FC(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + s32 treeIndex = get_variable(script, *thisPos++); + s32 var2 = get_variable(script, *thisPos++); + s32 var3 = get_variable(script, *thisPos++); + Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex)); + + func_8011BC7C(model, var2, var3); + if (var2 != -1) { + model->flags |= 0x10; + } + return ApiStatus_DONE2; +} +#else +INCLUDE_ASM(s32, "code_ED510", func_802C90FC); +#endif + +ApiStatus func_802C91A4(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + Bytecode treeIndex = get_variable(script, *thisPos++); + Bytecode var2 = get_variable(script, *thisPos++); + + get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex))->unk_A9 = var2; + return ApiStatus_DONE2; +} + +ApiStatus EnableTexPanning(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + s32 treeIndex = get_variable(script, *thisPos++); + s32 flag = get_variable(script, *thisPos++); + Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex)); + + if (flag) { + model->flags |= 0x800; + } else { + model->flags &= ~0x800; + } + return ApiStatus_DONE2; +} + +ApiStatus EnableModel(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + s32 listIndex = get_model_list_index_from_tree_index(get_variable(script, *thisPos++)); + Bytecode flag = get_variable(script, *thisPos++); + Model* model = get_model_from_list_index(listIndex); + + if (flag != 0) { + model->flags &= ~0x2; + } else { + model->flags |= 0x2; + } + return ApiStatus_DONE2; +} + +ApiStatus SetGroupEnabled(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + Bytecode var1 = get_variable(script, *thisPos++); + Bytecode var2 = get_variable(script, *thisPos++); + + func_8011B7C0(var1, 2, var2); + return ApiStatus_DONE2; +} + +INCLUDE_ASM(s32, "code_ED510", SetTexPanOffset, ScriptInstance* script, s32 isInitialCall); + +ApiStatus func_802C9428(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + s32 var1 = get_variable(script, *thisPos++); + s32 var2 = get_variable(script, *thisPos++); + s32 var3 = get_variable(script, *thisPos++); + + func_8011BCB4(var1, var2, var3); + return ApiStatus_DONE2; +} + +ApiStatus func_802C94A0(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + s32 var1 = get_variable(script, *thisPos++); + s32 var2 = get_variable(script, *thisPos++); + s32 var3 = get_variable(script, *thisPos++); + + func_8011BCD0(var1, var2, var3); + return ApiStatus_DONE2; +} + +#ifdef NON_MATCHING +ApiStatus SetModelFlags(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32 treeIndex = get_variable(script, *args++); + s32 listIndex = get_model_list_index_from_tree_index(treeIndex); + s32 a1 = *args++; + s32 var2; + Model* model; + + var2 = get_variable(script, *args); + model = get_model_from_list_index(listIndex); + + if (var2 != 0) { + model->flags |= a1; + } else { + model->flags &= ~a1; + } + + return ApiStatus_DONE2; +} +#else +INCLUDE_ASM(s32, "code_ED510", SetModelFlags, ScriptInstance* script, s32 isInitialCall); +#endif + +INCLUDE_ASM(s32, "code_ED510", func_802C95A0); + +ApiStatus func_802C971C(ScriptInstance* script, s32 isInitialCall) { + func_8011B37C((u16)get_variable(script, *script->ptrReadPos)); + return ApiStatus_DONE2; +} + +ApiStatus func_802C9748(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + u16 var1 = get_variable(script, *thisPos++); + s32 var2 = get_variable(script, *thisPos++); + + if (var2 != 0) { + func_8011B5D0(var1); + } else { + func_8011B660(var1); + } + return ApiStatus_DONE2; +} + +INCLUDE_ASM(s32, "code_ED510", TranslateGroup, ScriptInstance* script, s32 isInitialCall); + +INCLUDE_ASM(s32, "code_ED510", RotateGroup, ScriptInstance* script, s32 isInitialCall); + +INCLUDE_ASM(s32, "code_ED510", ScaleGroup, ScriptInstance* script, s32 isInitialCall); + +ApiStatus func_802C9B40(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + s32 var1 = get_variable(script, *thisPos++); + Bytecode var2 = *thisPos++; + + set_variable(script, var2, func_8011B090(var1)); + return ApiStatus_DONE2; +} + +INCLUDE_ASM(s32, "code_ED510", EnableGroup, ScriptInstance* script, s32 isInitialCall); + +ApiStatus func_802C9C70(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + s32 var1 = get_variable(script, *thisPos++); + u16 var2 = get_variable(script, *thisPos++); + s32 var3 = get_variable(script, *thisPos++); + + func_8011C164(var1, var2, var3); + return ApiStatus_DONE2; +} + +INCLUDE_ASM(s32, "code_ED510", modify_collider_family_flags); + +INCLUDE_ASM(s32, "code_ED510", ModifyColliderFlags, ScriptInstance* script, s32 isInitialCall); + +INCLUDE_ASM(s32, "code_ED510", ResetFromLava, ScriptInstance* script, s32 isInitialCall); + +INCLUDE_ASM(s32, "code_ED510", func_802C9FD4); + +ApiStatus GetColliderCenter(ScriptInstance* script, s32 initialCall) { + f32 x; + f32 y; + f32 z; + + get_collider_center(get_variable(script, *script->ptrReadPos), &x, &y, &z); + + script->varTable[0] = x; + script->varTable[1] = y; + script->varTable[2] = z; + + return ApiStatus_DONE2; +} + +ApiStatus ParentColliderToModel(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + s16 colliderID = get_variable(script, *thisPos++); + s32 treeIndex = get_variable(script, *thisPos++); + + parent_collider_to_model(colliderID, get_model_list_index_from_tree_index(treeIndex)); + update_collider_transform(colliderID); + return ApiStatus_DONE2; +} + +ApiStatus UpdateColliderTransform(ScriptInstance* script, s32 isInitialCall) { + update_collider_transform(get_variable(script, *script->ptrReadPos)); + return ApiStatus_DONE2; +} + +INCLUDE_ASM(s32, "code_ED510", set_zone_enabled); + +INCLUDE_ASM(s32, "code_ED510", SetZoneEnabled); + +INCLUDE_ASM(s32, "code_ED510", goto_map); + +ApiStatus GotoMap(ScriptInstance* script, s32 isInitialCall) { + goto_map(script, 0); + return ApiStatus_DONE1; +} + +ApiStatus GotoMapSpecial(ScriptInstance* script, s32 isInitialCall) { + goto_map(script, 1); + return ApiStatus_DONE1; +} + +ApiStatus GotoMapByID(ScriptInstance* script, s32 isInitialCall) { + goto_map(script, 2); + return ApiStatus_DONE1; +} + +ApiStatus GetEntryID(ScriptInstance* script, s32 isInitialCall) { + set_variable(script, *script->ptrReadPos, GAME_STATUS->entryID); + return ApiStatus_DONE2; +} + +ApiStatus GetMapID(ScriptInstance* script, s32 isInitialCall) { + set_variable(script, *script->ptrReadPos, GAME_STATUS->mapID); + return ApiStatus_DONE2; +} + +ApiStatus GetLoadType(ScriptInstance* script, s32 isInitialCall) { + set_variable(script, *script->ptrReadPos, GAME_STATUS->loadType != 0); + return ApiStatus_DONE2; +} + +ApiStatus SetRenderMode(ScriptInstance* script, s32 isInitialCall) { + Bytecode* thisPos = script->ptrReadPos; + s32 treeIndex = get_variable(script, *thisPos++); + s8 renderMode = get_variable(script, *thisPos++); + + get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex))->renderMode = renderMode; + + return ApiStatus_DONE2; +} + +INCLUDE_ASM(s32, "code_ED510", PlaySoundAtModel, ScriptInstance* script, s32 isInitialCall); + +INCLUDE_ASM(s32, "code_ED510", PlaySoundAtCollider, ScriptInstance* script, s32 isInitialCall); diff --git a/src/code_F5750.c b/src/code_F5750.c index 733b04560c..ed27cdf682 100644 --- a/src/code_F5750.c +++ b/src/code_F5750.c @@ -48,28 +48,39 @@ ApiStatus DisablePlayerInput(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_F5750", SetPlayerPos, ScriptInstance* script, s32 isInitialCall); -/* ApiStatus SetPlayerPos(ScriptInstance* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; Bytecode* args = script->ptrReadPos; f32 x = get_variable(script, *args++); f32 y = get_variable(script, *args++); f32 z = get_variable(script, *args++); - Npc* playerNpc = gPlayerNpc; - playerNpc->pos.x = x; - playerNpc->pos.z = z; - playerNpc->pos.y = y; + gPlayerNpcPtr->pos.x = x; + gPlayerNpcPtr->pos.y = y; + gPlayerNpcPtr->pos.z = z; + + playerStatus->position.x = gPlayerNpcPtr->pos.x; + playerStatus->position.y = gPlayerNpcPtr->pos.y; + playerStatus->position.z = gPlayerNpcPtr->pos.z; - playerStatus->position.x = x; - playerStatus->position.y = y; - playerStatus->position.z = z; return ApiStatus_DONE2; } -*/ -INCLUDE_ASM(s32, "code_F5750", SetPlayerCollisionSize, ScriptInstance* script, s32 isInitialCall); +ApiStatus SetPlayerCollisionSize(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32 height = get_variable(script, *args++); + s32 radius = get_variable(script, *args); + Npc* player = gPlayerNpcPtr; + PlayerStatus* playerStatus = &gPlayerStatus; + + player->collisionHeight = height; + player->collisionRadius = radius; + + playerStatus->colliderHeight = player->collisionHeight; + playerStatus->colliderDiameter = player->collisionRadius; + + return ApiStatus_DONE2; +} ApiStatus SetPlayerSpeed(ScriptInstance* script, s32 isInitialCall) { gPlayerNpcPtr->moveSpeed = get_float_variable(script, *script->ptrReadPos); @@ -81,7 +92,25 @@ ApiStatus SetPlayerJumpscale(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } +#ifdef NON_MATCHING +ApiStatus SetPlayerAnimation(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + PlayerAnim animation; + + animation = get_variable(script, *args); + + gPlayerNpcPtr->currentAnim = animation; + gPlayerAnimation = animation; + + if (animation == 0x80003) { + exec_ShakeCam1(0, 0, 2); + } + + return ApiStatus_DONE2; +} +#else INCLUDE_ASM(s32, "code_F5750", SetPlayerAnimation, ScriptInstance* script, s32 isInitialCall); +#endif ApiStatus SetPlayerActionState(ScriptInstance* script, s32 isInitialCall) { set_action_state(get_variable(script, *script->ptrReadPos)); @@ -122,7 +151,21 @@ ApiStatus GetPlayerTargetYaw(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_F5750", SetPlayerFlagBits, ScriptInstance* script, s32 isInitialCall); +ApiStatus SetPlayerFlagBits(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + PlayerStatus* playerStatus = &gPlayerStatus; + PlayerStatus* playerStatus2 = &gPlayerStatus; + Bytecode bits = *args++; + Bytecode a1 = *args; + + if (get_variable(script, a1)) { + playerStatus->flags |= bits; + } else { + playerStatus2->flags &= ~bits; + } + + return ApiStatus_DONE2; +} ApiStatus GetPlayerActionState(ScriptInstance* script, s32 isInitialCall) { Bytecode outVar = *script->ptrReadPos; @@ -158,11 +201,28 @@ ApiStatus FullyRestoreHPandFP(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_F5750", FullyRestoreSP); +ApiStatus FullyRestoreSP(ScriptInstance* script, s32 isInitialCall) { + PlayerData* playerData = &gPlayerData; -INCLUDE_ASM(s32, "code_F5750", EnablePartner); + playerData->specialBarsFilled = playerData->maxStarPower * 256; + return ApiStatus_DONE2; +} -INCLUDE_ASM(s32, "code_F5750", DisablePartner); +ApiStatus EnablePartner(ScriptInstance* script, s32 isInitialCall) { + s32 partnerIdx = get_variable(script, *script->ptrReadPos) - 1; + PartnerData* partner = &gPlayerData.partners[partnerIdx]; + + partner->enabled = TRUE; + return ApiStatus_DONE2; +} + +ApiStatus DisablePartner(ScriptInstance* script, s32 isInitialCall) { + s32 partnerIdx = get_variable(script, *script->ptrReadPos) - 1; + PartnerData* partner = &gPlayerData.partners[partnerIdx]; + + partner->enabled = FALSE; + return ApiStatus_DONE2; +} INCLUDE_ASM(s32, "code_F5750", UseEntryHeading); @@ -188,21 +248,67 @@ INCLUDE_ASM(s32, "code_F5750", func_802D286C); INCLUDE_ASM(s32, "code_F5750", func_802D2884); -INCLUDE_ASM(s32, "code_F5750", DisablePulseStone); +ApiStatus DisablePulseStone(ScriptInstance* script, s32 isInitialCall) { + PlayerStatus* playerStatus = &gPlayerStatus; + PlayerStatus* playerStatus2 = &gPlayerStatus; -INCLUDE_ASM(s32, "code_F5750", GetCurrentPartner, ScriptInstance* script, s32 isInitialCall); + if (get_variable(script, *script->ptrReadPos)) { + playerStatus->animFlags &= ~0x80; + } else { + playerStatus2->animFlags |= 0x80; + } + + return ApiStatus_DONE2; +} + +ApiStatus GetCurrentPartner(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Bytecode a0 = *args; + PlayerData* playerData = &gPlayerData; + s32 currentPartner = 0; + + if (D_8010EBB0[0] != 0) { + currentPartner = playerData->currentPartner; + } + + set_variable(script, a0, currentPartner); + return ApiStatus_DONE2; +} INCLUDE_ASM(s32, "code_F5750", func_802D2B50); INCLUDE_ASM(s32, "code_F5750", func_802D2B6C); -INCLUDE_ASM(s32, "code_F5750", Disable8bitMario, ScriptInstance* script, s32 isInitialCall); +ApiStatus Disable8bitMario(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + PlayerStatus* playerStatus = &gPlayerStatus; + PlayerStatus* playerStatus2 = &gPlayerStatus; + + if (get_variable(script, *args)) { + playerStatus->colliderHeight = 37; + playerStatus->colliderDiameter = 26; + playerStatus->animFlags &= ~0x4000; + } else { + playerStatus2->colliderHeight = 19; + playerStatus2->colliderDiameter = 26; + playerStatus2->animFlags |= 0x44004; + } + + return ApiStatus_DONE2; +} INCLUDE_ASM(s32, "code_F5750", func_802D2C14); INCLUDE_ASM(s32, "code_F5750", func_802D2C40); -INCLUDE_ASM(s32, "code_F5750", PlaySoundAtPlayer, ScriptInstance* script, s32 isInitialCall); +ApiStatus PlaySoundAtPlayer(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32 var = get_variable(script, *args++); + s32 var2 = get_variable(script, *args++); + + play_sound_at_player(var, var2); + return 2; +} INCLUDE_ASM(s32, "code_F5750", func_802D2D30); diff --git a/src/code_a5dd0_len_114e0.c b/src/code_a5dd0_len_114e0.c index 6b1c76b97b..7968b72710 100644 --- a/src/code_a5dd0_len_114e0.c +++ b/src/code_a5dd0_len_114e0.c @@ -116,7 +116,18 @@ INCLUDE_ASM(s32, "code_a5dd0_len_114e0", AssignAreaFlag, ScriptInstance* script, INCLUDE_ASM(s32, "code_a5dd0_len_114e0", AssignBlockFlag, ScriptInstance* script, s32 isInitialCall); -INCLUDE_ASM(s32, "code_a5dd0_len_114e0", AssignFlag, ScriptInstance* script, s32 isInitialCall); +ApiStatus AssignFlag(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + Trigger* trigger; + + if (isInitialCall == TRUE) { + trigger = get_entity_by_index(gLastCreatedEntityIndex)->trigger; + trigger->flags.bytes.genericFlagIndex = get_variable_index(script, *args); + return ApiStatus_DONE2; + } + + return ApiStatus_DONE1; +} INCLUDE_ASM(s32, "code_a5dd0_len_114e0", AssignPanelFlag, ScriptInstance* script, s32 isInitialCall); diff --git a/src/code_dba20_len_350.c b/src/code_dba20_len_350.c index 8c6abfcf79..2e159fdbac 100644 --- a/src/code_dba20_len_350.c +++ b/src/code_dba20_len_350.c @@ -1,48 +1,40 @@ #include "common.h" -#ifdef NON_MATCHING void clear_saved_variables(void) { SaveData* saveFile = &gCurrentSaveFile; s32 i; - for (i = ARRAY_COUNT(saveFile->globalFlags) - 1; i >= 0; i--) { + for (i = 0; i < ARRAY_COUNT(saveFile->globalFlags); i++) { saveFile->globalFlags[i] = 0; } - for (i = ARRAY_COUNT(saveFile->globalBytes) - 1; i >= 0; i--) { + for (i = 0; i < ARRAY_COUNT(saveFile->globalBytes); i++) { saveFile->globalBytes[i] = 0; } - for (i = ARRAY_COUNT(saveFile->areaFlags) - 1; i >= 0; i--) { + for (i = 0; i < ARRAY_COUNT(saveFile->areaFlags); i++) { saveFile->areaFlags[i] = 0; } - for (i = ARRAY_COUNT(saveFile->areaBytes) - 1; i >= 0; i--) { + for (i = 0; i < ARRAY_COUNT(saveFile->areaBytes); i++) { saveFile->areaBytes[i] = 0; } } -#else -INCLUDE_ASM(s32, "code_dba20_len_350", clear_saved_variables); -#endif -#ifdef NON_MATCHING void clear_area_flags(void) { SaveData* saveFile = &gCurrentSaveFile; s32 i; if (GAME_STATUS->changedArea) { - for (i = ARRAY_COUNT(saveFile->areaFlags) - 1; i >= 0; i--) { + for (i = 0; i < ARRAY_COUNT(saveFile->areaFlags); i++) { saveFile->areaFlags[i] = 0; } - for (i = ARRAY_COUNT(saveFile->areaBytes) - 1; i >= 0; i--) { + for (i = 0; i < ARRAY_COUNT(saveFile->areaBytes); i++) { saveFile->areaBytes[i] = 0; } } } -#else -INCLUDE_ASM(s32, "code_dba20_len_350", clear_area_flags); -#endif s32 clear_global_flag(s32 index) { s32 wordIdx; @@ -60,7 +52,7 @@ s32 clear_global_flag(s32 index) { saveFile = &gCurrentSaveFile; flag = saveFile->globalFlags[wordIdx] & (1 << bitIdx); - if (flag) { + if (flag != 0) { flag = 1; } @@ -84,7 +76,7 @@ s32 set_global_flag(s32 index) { saveFile = &gCurrentSaveFile; flag = saveFile->globalFlags[wordIdx] & (1 << bitIdx); - if (flag) { + if (flag != 0) { flag = 1; } diff --git a/src/code_dbd70_len_700.c b/src/code_dbd70_len_700.c index bdcd8704a0..9045c95c38 100644 --- a/src/code_dbd70_len_700.c +++ b/src/code_dbd70_len_700.c @@ -7,7 +7,7 @@ void default_trigger_function_handler(s32* arg0) { INCLUDE_ASM(s32, "code_dbd70_len_700", clear_trigger_data); void init_trigger_list(void) { - if ((*gGameStatusPtr)->isBattle == 0) { + if (!GAME_STATUS->isBattle) { *gCurrentTriggerListPtr = gTriggerList1; } else { *gCurrentTriggerListPtr = gTriggerList2; @@ -35,32 +35,28 @@ void delete_trigger(Trigger* toDelete) { } } -INCLUDE_ASM(s32, "code_dbd70_len_700", is_trigger_bound); +INCLUDE_ASM(s32, "code_dbd70_len_700", is_trigger_bound, Trigger* trigger, Bytecode* script); Trigger* get_trigger_by_id(s32 triggerID) { return (*gCurrentTriggerListPtr)[triggerID]; } -#ifdef NON_MATCHING s32 func_80145CE8(s32 arg0) { s32 i; - s32 ret; if (func_800E52F8() == 0) { return 0; } for (i = 0; i < ARRAY_COUNT(gCurrentTriggerListPtr); i++) { - if (((*gCurrentTriggerListPtr)[i] == NULL) || - ((*gCurrentTriggerListPtr)[i]->unk_30 == 0) || - ((*gCurrentTriggerListPtr)[i]->colliderID != arg0) || - ((*gCurrentTriggerListPtr)[i]->genericFlagIndex & 0x100) == 0) { - ret = 1; + Trigger* trigger = (*gCurrentTriggerListPtr)[i]; + + if ((trigger != NULL) && + (trigger->unk_30 != 0) && + (trigger->params2 == arg0) && + (trigger->flags.flags & 0x100)) { + return 1; } } - - return ret; + return 0; } -#else -INCLUDE_ASM(s32, "code_dbd70_len_700", func_80145CE8); -#endif diff --git a/src/code_dc470_len_14c0.c b/src/code_dc470_len_14c0.c index f5c658aa9e..d6feef829d 100644 --- a/src/code_dc470_len_14c0.c +++ b/src/code_dc470_len_14c0.c @@ -26,7 +26,7 @@ void load_map_bg(char* optAssetName) { } void func_80145DF8(void) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; D_801595A0 = 0; D_8014F12F = 0; @@ -35,7 +35,7 @@ void func_80145DF8(void) { } void read_background_size(BackgroundHeader* bg) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; gameStatus->backgroundMaxW = bg->width; gameStatus->backgroundMaxH = bg->height; @@ -47,7 +47,7 @@ void read_background_size(BackgroundHeader* bg) { } void set_background_size(s16 startX, s16 startY, s16 sizeX, s16 sizeY) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; gameStatus->enableBackground &= ~1; gameStatus->backgroundMaxW = startX; diff --git a/src/code_dd930_len_1c0.c b/src/code_dd930_len_1c0.c index 251ff74c05..ffbda92f3d 100644 --- a/src/code_dd930_len_1c0.c +++ b/src/code_dd930_len_1c0.c @@ -2,11 +2,11 @@ // TODO: most likely part of the MusicPlayer struct typedef struct { - s16 fadeFlags; - s16 fadeState; - s32 fadeOutTime; - s32 fadeInTime; - s32 unkC; + /* 0x0 */ s16 fadeFlags; + /* 0x2 */ s16 fadeState; + /* 0x4 */ s32 fadeOutTime; + /* 0x8 */ s32 fadeInTime; + /* 0xC */ s32 unkC; } struct_80147230; extern struct_80147230 D_8014F140; @@ -60,7 +60,7 @@ s32 play_ambient_sounds(s32 fadeInTime, s32 fadeOutTime) { struct_80147230* temp1 = &D_8015C7C0; struct_80147230* temp2 = &D_8015C7C0; - if (!(*gGameStatusPtr)->musicEnabled) { + if (!GAME_STATUS->musicEnabled) { func_800554A4(temp1->fadeInTime, fadeOutTime); temp1->fadeFlags &= ~1; return 1; diff --git a/src/code_e79b0_len_1920.c b/src/code_e79b0_len_1920.c index 2369ae7513..0d162bca85 100644 --- a/src/code_e79b0_len_1920.c +++ b/src/code_e79b0_len_1920.c @@ -69,7 +69,7 @@ void find_script_labels(ScriptInstance *script) { j = 0; curLine = script->ptrNextLine; - for(j; j < ARRAY_COUNT(script->labelIndices); j++) { + for(j = 0; j < ARRAY_COUNT(script->labelIndices); j++) { type = *curLine++; numArgs = *curLine++; label = *curLine; @@ -236,7 +236,7 @@ ScriptInstance* start_script_in_group(Bytecode* initialLine, s8 priority, s32 in s32 scriptListCount; s32 i; s32 curScriptIndex; - s32* tempCounter; + s32* tempCounter = &gStaticScriptCounter; for(i = 0; i < MAX_SCRIPTS; i++) { if ((*gCurrentScriptListPtr)[i] == NULL) { @@ -289,8 +289,6 @@ ScriptInstance* start_script_in_group(Bytecode* initialLine, s8 priority, s32 in } func_802C3390(newScript); - { - s32* tempCounter = &gStaticScriptCounter; if (*tempCounter == 0) { *tempCounter = 1; } @@ -299,7 +297,7 @@ ScriptInstance* start_script_in_group(Bytecode* initialLine, s8 priority, s32 in return newScript; } #else -INCLUDE_ASM(s32, "code_e79b0_len_1920", start_script_in_group); +INCLUDE_ASM(ScriptInstance*, "code_e79b0_len_1920", start_script_in_group, Bytecode* initialLine, s8 priority, s32 initialState, s8 groupFlags); #endif INCLUDE_ASM(s32, "code_e79b0_len_1920", start_child_script); @@ -627,7 +625,7 @@ void resume_group_script(ScriptInstance* script, s32 groupFlags) { } if ((script->groupFlags & groupFlags) != 0) { - script->state &= 0xFD; + script->state &= ~0x2; } } diff --git a/src/code_e92d0_len_5da0.c b/src/code_e92d0_len_5da0.c index 49e3b1789a..c7064f23fa 100644 --- a/src/code_e92d0_len_5da0.c +++ b/src/code_e92d0_len_5da0.c @@ -5,6 +5,8 @@ s32 si_skip_if(ScriptInstance* script); s32 si_skip_else(ScriptInstance* script); s32 si_goto_end_loop(ScriptInstance* script); s32 si_goto_end_case(ScriptInstance* script); +s32 si_goto_next_case(ScriptInstance* script); +s32 get_variable_index(ScriptInstance* script, s32 var); f32 fixed_var_to_float(s32 scriptVar) { if (scriptVar <= -220000000) { @@ -33,19 +35,47 @@ ApiStatus si_handle_goto(ScriptInstance* script) { } ApiStatus si_handle_loop(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; s32 loopDepth = ++script->loopDepth; ASSERT(loopDepth < 8); - script->loopStartTable[loopDepth] = thisPos; + script->loopStartTable[loopDepth] = args; script->loopCounterTable[loopDepth] = var; return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_end_loop); +ApiStatus si_handle_end_loop(ScriptInstance* script) { + s32 loopDepth = script->loopDepth; + s32 loopCounter; + + ASSERT(loopDepth >= 0); + + loopCounter = script->loopCounterTable[loopDepth]; + + if (loopCounter == 0) { + script->ptrNextLine = script->loopStartTable[loopDepth]; + return ApiStatus_DONE2; + } + + if (loopCounter >= -10000000) { + script->loopCounterTable[loopDepth] = --loopCounter; + } else { + s32 var = get_variable(script, loopCounter) - 1; + set_variable(script, loopCounter, var); + loopCounter = var; + } + + if (loopCounter != 0) { + script->ptrNextLine = script->loopStartTable[loopDepth]; + return ApiStatus_DONE2; + } else { + script->loopDepth--; + return ApiStatus_DONE2; + } +} ApiStatus si_handle_break_loop(ScriptInstance* script) { ASSERT(script->loopDepth >= 0); @@ -91,9 +121,9 @@ ApiStatus si_handle_wait_seconds(ScriptInstance* script) { } ApiStatus si_handle_if_equal(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - if (get_variable(script, *thisPos++) != get_variable(script, *thisPos++)) { + if (get_variable(script, *args++) != get_variable(script, *args++)) { script->ptrNextLine = si_skip_if(script); return ApiStatus_DONE2; } @@ -102,9 +132,9 @@ ApiStatus si_handle_if_equal(ScriptInstance* script) { ApiStatus si_handle_if_not_equal(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - if (get_variable(script, *thisPos++) == get_variable(script, *thisPos++)) { + if (get_variable(script, *args++) == get_variable(script, *args++)) { script->ptrNextLine = si_skip_if(script); return ApiStatus_DONE2; } @@ -112,9 +142,9 @@ ApiStatus si_handle_if_not_equal(ScriptInstance* script) { } ApiStatus si_handle_if_less(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - if (get_variable(script, *thisPos++) >= get_variable(script, *thisPos++)) { + if (get_variable(script, *args++) >= get_variable(script, *args++)) { script->ptrNextLine = si_skip_if(script); return ApiStatus_DONE2; } @@ -122,9 +152,9 @@ ApiStatus si_handle_if_less(ScriptInstance* script) { } ApiStatus si_handle_if_greater(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - if (get_variable(script, *thisPos++) <= get_variable(script, *thisPos++)) { + if (get_variable(script, *args++) <= get_variable(script, *args++)) { script->ptrNextLine = si_skip_if(script); return ApiStatus_DONE2; } @@ -132,9 +162,9 @@ ApiStatus si_handle_if_greater(ScriptInstance* script) { } ApiStatus si_handle_if_less_equal(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - if (get_variable(script, *thisPos++) > get_variable(script, *thisPos++)) { + if (get_variable(script, *args++) > get_variable(script, *args++)) { script->ptrNextLine = si_skip_if(script); return ApiStatus_DONE2; } @@ -142,9 +172,9 @@ ApiStatus si_handle_if_less_equal(ScriptInstance* script) { } ApiStatus si_handle_if_greater_equal(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - if (get_variable(script, *thisPos++) < get_variable(script, *thisPos++)) { + if (get_variable(script, *args++) < get_variable(script, *args++)) { script->ptrNextLine = si_skip_if(script); return ApiStatus_DONE2; } @@ -152,10 +182,10 @@ ApiStatus si_handle_if_greater_equal(ScriptInstance* script) { } ApiStatus si_handle_if_AND(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; - if ((get_variable(script, var) & *thisPos) == 0) { + if ((get_variable(script, var) & *args) == 0) { script->ptrNextLine = si_skip_if(script); return ApiStatus_DONE2; } @@ -163,10 +193,10 @@ ApiStatus si_handle_if_AND(ScriptInstance* script) { } ApiStatus si_handle_if_not_AND(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; - if ((get_variable(script, var) & *thisPos) != 0) { + if ((get_variable(script, var) & *args) != 0) { script->ptrNextLine = si_skip_if(script); return ApiStatus_DONE2; } @@ -195,30 +225,187 @@ ApiStatus si_handle_switch(ScriptInstance* script) { } ApiStatus si_handle_switch_const(ScriptInstance* script) { - Bytecode* thisPos = *script->ptrReadPos; + Bytecode* args = *script->ptrReadPos; s32 switchDepth = ++script->switchDepth; ASSERT(switchDepth < 8); - script->switchBlockValue[switchDepth] = thisPos; + script->switchBlockValue[switchDepth] = args; script->switchBlockState[switchDepth] = 1; return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_equal); +ApiStatus si_handle_case_equal(ScriptInstance* script) { + Bytecode* args = script->ptrReadPos; + s32 switchDepth = script->switchDepth; + s32 var; + s32 switchBlockValue; -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_not_equal); + ASSERT(switchDepth >= 0); -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_less); + var = get_variable(script, *args); + switchBlockValue = script->switchBlockValue[switchDepth]; -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_less_equal); + if (script->switchBlockState[switchDepth] <= 0) { + script->ptrNextLine = si_goto_end_case(script); + } else if (var != switchBlockValue) { + script->ptrNextLine = si_goto_next_case(script); + } else { + script->switchBlockState[switchDepth] = 0; + } -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_greater); + return ApiStatus_DONE2; -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_greater_equal); + do {} while (0); // Necessary to match +} -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_range); +ApiStatus si_handle_case_not_equal(ScriptInstance* script) { + Bytecode* args = script->ptrReadPos; + s32 switchDepth = script->switchDepth; + s32 var; + s32 switchBlockValue; + + ASSERT(switchDepth >= 0); + + var = get_variable(script, *args); + switchBlockValue = script->switchBlockValue[switchDepth]; + + if (script->switchBlockState[switchDepth] <= 0) { + script->ptrNextLine = si_goto_end_case(script); + } else if (var == switchBlockValue) { + script->ptrNextLine = si_goto_next_case(script); + } else { + script->switchBlockState[switchDepth] = 0; + } + + return ApiStatus_DONE2; + + do {} while (0); // Necessary to match +} + +ApiStatus si_handle_case_less(ScriptInstance* script) { + Bytecode* args = script->ptrReadPos; + s32 switchDepth = script->switchDepth; + s32 var; + s32 switchBlockValue; + + ASSERT(switchDepth >= 0); + + var = get_variable(script, *args); + switchBlockValue = script->switchBlockValue[switchDepth]; + + if (script->switchBlockState[switchDepth] <= 0) { + script->ptrNextLine = si_goto_end_case(script); + } else if (var <= switchBlockValue) { + script->ptrNextLine = si_goto_next_case(script); + } else { + script->switchBlockState[switchDepth] = 0; + } + + return ApiStatus_DONE2; + + do {} while (0); // Necessary to match +} + +ApiStatus si_handle_case_less_equal(ScriptInstance* script) { + Bytecode* args = script->ptrReadPos; + s32 switchDepth = script->switchDepth; + s32 var; + s32 switchBlockValue; + + ASSERT(switchDepth >= 0); + + var = get_variable(script, *args); + switchBlockValue = script->switchBlockValue[switchDepth]; + + if (script->switchBlockState[switchDepth] <= 0) { + script->ptrNextLine = si_goto_end_case(script); + } else if (var < switchBlockValue) { + script->ptrNextLine = si_goto_next_case(script); + } else { + script->switchBlockState[switchDepth] = 0; + } + + return ApiStatus_DONE2; + + do {} while (0); // Necessary to match +} + +ApiStatus si_handle_case_greater(ScriptInstance* script) { + Bytecode* args = script->ptrReadPos; + s32 switchDepth = script->switchDepth; + s32 var; + s32 switchBlockValue; + + ASSERT(switchDepth >= 0); + + var = get_variable(script, *args); + switchBlockValue = script->switchBlockValue[switchDepth]; + + if (script->switchBlockState[switchDepth] <= 0) { + script->ptrNextLine = si_goto_end_case(script); + } else if (var >= switchBlockValue) { + script->ptrNextLine = si_goto_next_case(script); + } else { + script->switchBlockState[switchDepth] = 0; + } + + return ApiStatus_DONE2; + + do {} while (0); // Necessary to match +} + +ApiStatus si_handle_case_greater_equal(ScriptInstance* script) { + Bytecode* args = script->ptrReadPos; + s32 switchDepth = script->switchDepth; + s32 var; + s32 switchBlockValue; + + ASSERT(switchDepth >= 0); + + var = get_variable(script, *args); + switchBlockValue = script->switchBlockValue[switchDepth]; + + if (script->switchBlockState[switchDepth] <= 0) { + script->ptrNextLine = si_goto_end_case(script); + } else if (var > switchBlockValue) { + script->ptrNextLine = si_goto_next_case(script); + } else { + script->switchBlockState[switchDepth] = 0; + } + + return ApiStatus_DONE2; + + do {} while (0); // Necessary to match +} + +ApiStatus si_handle_case_range(ScriptInstance* script) { + Bytecode* args = script->ptrReadPos; + s32 switchDepth = script->switchDepth; + s32 var; + s32 var2; + s32 switchBlockValue; + + ASSERT(switchDepth >= 0); + + var = get_variable(script, *args++); + var2 = get_variable(script, *args++); + + switchBlockValue = script->switchBlockValue[switchDepth]; + + if (script->switchBlockState[switchDepth] <= 0) { + script->ptrNextLine = si_goto_end_case(script); + } else if ((var <= switchBlockValue) && (switchBlockValue <= var2)) { + script->switchBlockState[switchDepth] = 0; + } else { + script->ptrNextLine = si_goto_next_case(script); + } + + return ApiStatus_DONE2; + + do {} while (0); // Necessary to match +} ApiStatus si_handle_case_default(ScriptInstance* script) { s32 switchDepth = script->switchDepth; @@ -235,13 +422,52 @@ ApiStatus si_handle_case_default(ScriptInstance* script) { do {} while (0); // Necessary to match } -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_AND); +ApiStatus si_handle_case_AND(ScriptInstance* script) { + Bytecode* args = script->ptrReadPos; + s32 switchDepth = script->switchDepth; + s32 var; + s32 switchBlockValue; + + ASSERT(switchDepth >= 0); + + var = *args; + switchBlockValue = script->switchBlockValue[switchDepth]; + + if (script->switchBlockState[switchDepth] <= 0) { + script->ptrNextLine = si_goto_end_case(script); + } else if ((var & switchBlockValue) == 0) { + script->ptrNextLine = si_goto_next_case(script); + } else { + script->switchBlockState[switchDepth] = 0; + } + + return ApiStatus_DONE2; + + do {} while (0); // Necessary to match +} + INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_equal_OR); INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_equal_AND); -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_end_case_group); +ApiStatus si_handle_end_case_group(ScriptInstance* script) { + ASSERT(script->switchDepth >= 0); + + if (script->switchBlockState[script->switchDepth] == 0) { + script->ptrNextLine = si_goto_end_case(script); + } else if (script->switchBlockState[script->switchDepth] != -1) { + script->switchBlockState[script->switchDepth] = 1; + script->ptrNextLine = si_goto_next_case(script); + } else { + script->switchBlockState[script->switchDepth] = 0; + script->ptrNextLine = si_goto_end_case(script); + } + + return ApiStatus_DONE2; + + do {} while (0); // Necessary to match +} ApiStatus si_handle_break_case(ScriptInstance* script) { ASSERT(script->switchDepth >= 0); @@ -261,10 +487,10 @@ ApiStatus si_handle_end_switch(ScriptInstance* script) { } ApiStatus si_handle_set_var(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - s32 curPtrReadPos = thisPos[0]; + Bytecode* args = script->ptrReadPos; + s32 curPtrReadPos = args[0]; - set_variable(script, curPtrReadPos, get_variable(script, thisPos[1])); + set_variable(script, curPtrReadPos, get_variable(script, args[1])); return ApiStatus_DONE2; } @@ -274,17 +500,17 @@ ApiStatus si_handle_set_const(ScriptInstance* script) { } ApiStatus si_handle_set_float(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; - set_float_variable(script, var, get_float_variable(script, *thisPos)); + set_float_variable(script, var, get_float_variable(script, *args)); return ApiStatus_DONE2; } ApiStatus si_handle_add(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; - s32 result = get_variable(script, *thisPos++); + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; + s32 result = get_variable(script, *args++); s32 addend = get_variable(script, var); result += addend; @@ -294,9 +520,9 @@ ApiStatus si_handle_add(ScriptInstance* script) { } ApiStatus si_handle_subtract(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; - s32 result = get_variable(script, *thisPos++); + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; + s32 result = get_variable(script, *args++); s32 minuend = get_variable(script, var); result = minuend - result; @@ -306,9 +532,9 @@ ApiStatus si_handle_subtract(ScriptInstance* script) { } ApiStatus si_handle_multiply(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; - s32 result = get_variable(script, *thisPos++); + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; + s32 result = get_variable(script, *args++); s32 multiplier = get_variable(script, var); result *= multiplier; @@ -318,9 +544,9 @@ ApiStatus si_handle_multiply(ScriptInstance* script) { } ApiStatus si_handle_divide(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; - s32 result = get_variable(script, *thisPos++); + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; + s32 result = get_variable(script, *args++); s32 dividend = get_variable(script, var); result = dividend / result; @@ -330,9 +556,9 @@ ApiStatus si_handle_divide(ScriptInstance* script) { } ApiStatus si_handle_mod(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; - s32 result = get_variable(script, *thisPos++) + 0.5; + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; + s32 result = get_variable(script, *args++) + 0.5; s32 num = get_variable(script, var) + 0.5; result = num % result; @@ -342,9 +568,9 @@ ApiStatus si_handle_mod(ScriptInstance* script) { } ApiStatus si_handle_addF(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; - f32 result = get_float_variable(script, *thisPos++); + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; + f32 result = get_float_variable(script, *args++); f32 addend = get_float_variable(script, var); result += addend; @@ -354,9 +580,9 @@ ApiStatus si_handle_addF(ScriptInstance* script) { } ApiStatus si_handle_subtractF(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; - f32 result = get_float_variable(script, *thisPos++); + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; + f32 result = get_float_variable(script, *args++); f32 minuend = get_float_variable(script, var); result = minuend - result; @@ -366,9 +592,9 @@ ApiStatus si_handle_subtractF(ScriptInstance* script) { } ApiStatus si_handle_multiplyF(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; - f32 result = get_float_variable(script, *thisPos++); + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; + f32 result = get_float_variable(script, *args++); f32 multiplier = get_float_variable(script, var); result *= multiplier; @@ -378,9 +604,9 @@ ApiStatus si_handle_multiplyF(ScriptInstance* script) { } ApiStatus si_handle_divideF(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var = *thisPos++; - f32 result = get_float_variable(script, *thisPos++); + Bytecode* args = script->ptrReadPos; + Bytecode var = *args++; + f32 result = get_float_variable(script, *args++); f32 dividend = get_float_variable(script, var); result = dividend / result; @@ -389,7 +615,6 @@ ApiStatus si_handle_divideF(ScriptInstance* script) { return ApiStatus_DONE2; } - ApiStatus si_handle_set_int_buffer_ptr(ScriptInstance* script) { script->buffer = get_variable(script, *script->ptrReadPos); return ApiStatus_DONE2; @@ -401,149 +626,149 @@ ApiStatus si_handle_set_float_buffer_ptr(ScriptInstance* script) { } ApiStatus si_handle_get_1_word(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; Bytecode var; - var = *thisPos++; + var = *args++; set_variable(script, var, *script->buffer++); return ApiStatus_DONE2; } ApiStatus si_handle_get_2_word(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; Bytecode var; Bytecode var2; - var = *thisPos++; + var = *args++; set_variable(script, var, *script->buffer++); - var2 = *thisPos++; + var2 = *args++; set_variable(script, var2, *script->buffer++); return ApiStatus_DONE2; } ApiStatus si_handle_get_3_word(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; Bytecode var; Bytecode var2; Bytecode var3; - var = *thisPos++; + var = *args++; set_variable(script, var, *script->buffer++); - var2 = *thisPos++; + var2 = *args++; set_variable(script, var2, *script->buffer++); - var3 = *thisPos++; + var3 = *args++; set_variable(script, var3, *script->buffer++); return ApiStatus_DONE2; } ApiStatus si_handle_get_4_word(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; Bytecode var; Bytecode var2; Bytecode var3; Bytecode var4; - var = *thisPos++; + var = *args++; set_variable(script, var, *script->buffer++); - var2 = *thisPos++; + var2 = *args++; set_variable(script, var2, *script->buffer++); - var3 = *thisPos++; + var3 = *args++; set_variable(script, var3, *script->buffer++); - var4 = *thisPos++; + var4 = *args++; set_variable(script, var4, *script->buffer++); return ApiStatus_DONE2; } ApiStatus si_handle_get_Nth_word(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; Bytecode var; - var = *thisPos++; - set_variable(script, var, script->buffer[get_variable(script, *thisPos)]); + var = *args++; + set_variable(script, var, script->buffer[get_variable(script, *args)]); return ApiStatus_DONE2; } ApiStatus si_handle_get_1_float(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; Bytecode var; - var = *thisPos++; + var = *args++; set_float_variable(script, var, get_float_variable(script, *script->buffer++)); return ApiStatus_DONE2; } ApiStatus si_handle_get_2_float(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; Bytecode var; Bytecode var2; - var = *thisPos++; + var = *args++; set_float_variable(script, var, get_float_variable(script, *script->buffer++)); - var2 = *thisPos++; + var2 = *args++; set_float_variable(script, var2, get_float_variable(script, *script->buffer++)); return ApiStatus_DONE2; } ApiStatus si_handle_get_3_float(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; Bytecode var; Bytecode var2; Bytecode var3; - var = *thisPos++; + var = *args++; set_float_variable(script, var, get_float_variable(script, *script->buffer++)); - var2 = *thisPos++; + var2 = *args++; set_float_variable(script, var2, get_float_variable(script, *script->buffer++)); - var3 = *thisPos++; + var3 = *args++; set_float_variable(script, var3, get_float_variable(script, *script->buffer++)); return ApiStatus_DONE2; } ApiStatus si_handle_get_4_float(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; Bytecode var; Bytecode var2; Bytecode var3; Bytecode var4; - var = *thisPos++; + var = *args++; set_float_variable(script, var, get_float_variable(script, *script->buffer++)); - var2 = *thisPos++; + var2 = *args++; set_float_variable(script, var2, get_float_variable(script, *script->buffer++)); - var3 = *thisPos++; + var3 = *args++; set_float_variable(script, var3, get_float_variable(script, *script->buffer++)); - var4 = *thisPos++; + var4 = *args++; set_float_variable(script, var4, get_float_variable(script, *script->buffer++)); return ApiStatus_DONE2; } ApiStatus si_handle_get_Nth_float(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; Bytecode var; - var = *thisPos++; - set_float_variable(script, var, script->buffer[get_variable(script, *thisPos)]); + var = *args++; + set_float_variable(script, var, script->buffer[get_variable(script, *args)]); return ApiStatus_DONE2; } @@ -559,9 +784,9 @@ ApiStatus si_handle_set_flag_array(ScriptInstance* script) { } ApiStatus si_handle_allocate_array(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - s32 size = get_variable(script, *thisPos++); - Bytecode var = *thisPos++; + Bytecode* args = script->ptrReadPos; + s32 size = get_variable(script, *args++); + Bytecode var = *args++; script->array = (s32)heap_malloc(size * 4); set_variable(script, var, (s32)script->array); @@ -610,16 +835,87 @@ ApiStatus si_handle_OR_const(ScriptInstance* script) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_call); +ApiStatus si_handle_call(ScriptInstance* script) { + Bytecode* args = script->ptrReadPos; + s32 isInitialCall; + ApiFunc func; + ScriptInstance* newScript; // todo fake match -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_exec1); + if (script->blocked) { + isInitialCall = FALSE; + func = script->callFunction; + newScript = script; // todo fake match + } else { + script->callFunction = (ApiFunc)get_variable(script, *args++); + newScript = script; // todo fake match + script->ptrReadPos = args; + script->currentArgc--; + script->blocked = TRUE; + isInitialCall = TRUE; + func = script->callFunction; + } -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_exec2); + return func(newScript, isInitialCall); // todo fake match +} + +ApiStatus si_handle_exec1(ScriptInstance* script) { + ScriptInstance* newScript; + s32 i; + + newScript = start_script_in_group((ScriptInstance*)get_variable(script, *script->ptrReadPos), script->priority, 0, + script->groupFlags); + + newScript->ownerActorID = script->ownerActorID; + newScript->ownerID = script->ownerID; + + i = 0; + while (i < ARRAY_COUNT(script->varTable)) { + newScript->varTable[i] = script->varTable[i++]; + } + + i = 0; + while (i < ARRAY_COUNT(script->varFlags)) { + newScript->varFlags[i] = script->varFlags[i++]; + } + + newScript->array = script->array; + newScript->flagArray = script->flagArray; + + return ApiStatus_DONE2; +} + +ApiStatus si_handle_exec2(ScriptInstance* script) { + Bytecode* args = script->ptrReadPos; + ScriptInstance* var = (ScriptInstance*)get_variable(script, *args++); + Bytecode arg2 = *args++; + ScriptInstance* newScript; + s32 i; + + newScript = start_script_in_group(var, script->priority, 0, script->groupFlags); + + newScript->ownerActorID = script->ownerActorID; + newScript->ownerID = script->ownerID; + + for (i = 0; i < ARRAY_COUNT(script->varTable); i++) { + newScript->varTable[i] = script->varTable[i]; + } + + for (i = 0; i < ARRAY_COUNT(script->varFlags); i++) { + newScript->varFlags[i] = script->varFlags[i]; + } + + newScript->array = script->array; + newScript->flagArray = script->flagArray; + + set_variable(script, arg2, newScript->uniqueID); + + return ApiStatus_DONE2; +} ApiStatus si_handle_exec_wait(ScriptInstance* script) { start_child_script(script, get_variable(script, *script->ptrReadPos), 0); script->currentOpcode = 0; - return 0xFF; + return ApiStatus_FINISH; } ApiStatus si_handle_jump(ScriptInstance* script) { @@ -628,9 +924,64 @@ ApiStatus si_handle_jump(ScriptInstance* script) { return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_e92d0_len_5da0", _bound_script_trigger_handler, Trigger* trigger); +s32 _bound_script_trigger_handler(Trigger* trigger) { + Bytecode* scriptStart; + ScriptInstance* script; -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_bind); + if (trigger->runningScript == NULL) { + scriptStart = trigger->scriptStart; + if (is_trigger_bound(trigger, scriptStart)) { + return 0; + } + + script = start_script(scriptStart, trigger->priority, 0x20); + trigger->runningScript = script; + trigger->runningScriptID = script->uniqueID; + script->varTable[0] = trigger->scriptVars[0]; + script->varTable[1] = trigger->scriptVars[1]; + script->varTable[2] = trigger->scriptVars[2]; + script->ownerID = trigger; + } + + if (!does_script_exist(trigger->runningScriptID)) { + trigger->runningScript = NULL; + return 0; + } + + return 1; +} + +ApiStatus si_handle_bind(ScriptInstance* script) { + Bytecode* args = script->ptrReadPos; + Trigger* trigger; + s32 var0 = get_variable(script, *args++); + Bytecode flags = *args++; + Bytecode index = *args++; + Bytecode a3 = *args++; + Bytecode a4 = *args++; + TriggerDefinition def; + + def.flags = flags | 0x1000000; + def.flagIndex = get_variable(script, index); + def.colliderIndex = get_variable_index(script, index); + def.inputArg3 = a3; + def.unk_14 = 0; + def.function = _bound_script_trigger_handler; + + trigger = create_trigger(&def); + trigger->scriptStart = var0; + trigger->runningScript = NULL; + trigger->priority = script->priority; + trigger->scriptVars[0] = get_variable(script, script->varTable[0]); + trigger->scriptVars[1] = get_variable(script, script->varTable[1]); + trigger->scriptVars[2] = get_variable(script, script->varTable[2]); + + if (a4 != 0) { + set_variable(script, a4, trigger); + } + + return ApiStatus_DONE2; +} ApiStatus DeleteTrigger(ScriptInstance* script, s32 isInitialCall) { delete_trigger(get_variable(script, *script->ptrReadPos)); @@ -693,15 +1044,30 @@ ApiStatus si_handle_resume(ScriptInstance* script) { } ApiStatus si_handle_does_script_exist(ScriptInstance* script) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode scriptID = get_variable(script, *thisPos++); - Bytecode var2 = *thisPos++; + Bytecode* args = script->ptrReadPos; + Bytecode scriptID = get_variable(script, *args++); + Bytecode var2 = *args++; set_variable(script, var2, does_script_exist(scriptID)); return ApiStatus_DONE2; } -INCLUDE_ASM(s32, "code_e92d0_len_5da0", func_802C6AD0); +void si_standard_trigger_executor(Trigger* trigger) { + if (trigger->runningScript == NULL) { + ScriptInstance* newScript = start_script(trigger->scriptStart, trigger->priority, 0x20); + trigger->runningScript = newScript; + trigger->runningScriptID = newScript->uniqueID; + newScript->varTable[0] = trigger->scriptVars[0]; + newScript->varTable[1] = trigger->scriptVars[1]; + newScript->varTable[2] = trigger->scriptVars[2]; + newScript->ownerID = trigger; + } + + if (!does_script_exist(trigger->runningScriptID)) { + trigger->runningScript = NULL; + trigger->flags.flags &= ~0x2; + } +} INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_bind_lock, ScriptInstance* script, s32 isInitialCall); @@ -808,9 +1174,91 @@ s32 get_variable(ScriptInstance* script, Bytecode var) { INCLUDE_ASM(s32, "code_e92d0_len_5da0", get_variable, ScriptInstance* script, Bytecode var); #endif -INCLUDE_ASM(s32, "code_e92d0_len_5da0", get_variable_index); +s32 get_variable_index(ScriptInstance* script, s32 var) { + if (-270000000 >= var) { + return var; + } + if (-250000000 >= var) { + return var; + } + if (-220000000 >= var) { + return var; + } + if (-200000000 >= var) { + return var + 210000000; + } + if (-180000000 >= var) { + return var + 190000000; + } + if (-160000000 >= var) { + return var + 170000000; + } + if (-140000000 >= var) { + return var + 150000000; + } + if (-120000000 >= var) { + return var + 130000000; + } + if (-100000000 >= var) { + return var + 110000000; + } + if (-80000000 >= var) { + return var + 90000000; + } + if (-60000000 >= var) { + return var + 70000000; + } + if (-40000000 >= var) { + return var + 50000000; + } + if (-20000000 >= var) { + return var + 30000000; + } + return var; +} -INCLUDE_ASM(s32, "code_e92d0_len_5da0", get_variable_index_alt); +s32 get_variable_index_alt(s32 var) { + if (-270000000 >= var) { + return var; + } + if (-250000000 >= var) { + return var; + } + if (-220000000 >= var) { + return var; + } + if (-200000000 >= var) { + return var + 210000000; + } + if (-180000000 >= var) { + return var + 190000000; + } + if (-160000000 >= var) { + return var + 170000000; + } + if (-140000000 >= var) { + return var + 150000000; + } + if (-120000000 >= var) { + return var + 130000000; + } + if (-100000000 >= var) { + return var + 110000000; + } + if (-80000000 >= var) { + return var + 90000000; + } + if (-60000000 >= var) { + return var + 70000000; + } + if (-40000000 >= var) { + return var + 50000000; + } + if (-20000000 >= var) { + return var + 30000000; + } + return var; +} INCLUDE_ASM(s32, "code_e92d0_len_5da0", set_variable, ScriptInstance* script, Bytecode var, s32 value); @@ -901,325 +1349,3 @@ INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_goto_end_case, ScriptInstance* script INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_goto_next_case, ScriptInstance* script); INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_goto_end_loop, ScriptInstance* script); - -// Ethan: I think this is the start of a new file -//INCLUDE_ASM(s32, "code_e92d0_len_5da0", TranslateModel, ScriptInstance* script, s32 isInitialCall); - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", RotateModel, ScriptInstance* script, s32 isInitialCall); - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", ScaleModel, ScriptInstance* script, s32 isInitialCall); - -ApiStatus GetModelIndex(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode modelID = get_variable(script, *thisPos++); - Bytecode index = *thisPos++; - - set_variable(script, index, get_model_list_index_from_tree_index(modelID)); - return ApiStatus_DONE2; -} - -ApiStatus func_802C8EE4(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode modelID = get_variable(script, *thisPos++); - Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(modelID)); - - model->flags &= ~0x400; - return ApiStatus_DONE2; -} - -ApiStatus CloneModel(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode srcModelID = get_variable(script, *thisPos++); - Bytecode newModelID = get_variable(script, *thisPos++); - - clone_model(srcModelID, newModelID); - return ApiStatus_DONE2; -} - -ApiStatus GetModelCenter(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - f32 centerX; - f32 centerY; - f32 centerZ; - f32 sizeX; - f32 sizeY; - f32 sizeZ; - - get_model_center_and_size(get_variable(script, *thisPos++) & 0xFFFF, ¢erX, ¢erY, ¢erZ, &sizeX, &sizeY, - &sizeZ); - script->varTable[0] = centerX; - script->varTable[1] = centerY; - script->varTable[2] = centerZ; - return ApiStatus_DONE2; -} - -ApiStatus SetTexPanner(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - s32 treeIndex = get_variable(script, *thisPos++); - s32 var2 = get_variable(script, *thisPos++); - Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex)); - - set_tex_panner(model, var2); - model->flags |= 0x800; - return ApiStatus_DONE2; -} - -ApiStatus SetModelFlag10(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode treeIndex = get_variable(script, *thisPos++); - Bytecode var2 = get_variable(script, *thisPos++); - Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex)); - - if (var2 != 0) { - model->flags |= 0x10; - } else { - model->flags &= ~0x10; - } - return ApiStatus_DONE2; -} - -#ifdef NON_MATCHING -ApiStatus func_802C90FC(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - s32 treeIndex = get_variable(script, *thisPos++); - s32 var2 = get_variable(script, *thisPos++); - s32 var3 = get_variable(script, *thisPos++); - Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex)); - - func_8011BC7C(model, var2, var3); - if (var2 != -1) { - model->flags |= 0x10; - } - return ApiStatus_DONE2; -} -#else -INCLUDE_ASM(s32, "code_e92d0_len_5da0", func_802C90FC); -#endif - -ApiStatus func_802C91A4(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode treeIndex = get_variable(script, *thisPos++); - Bytecode var2 = get_variable(script, *thisPos++); - - get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex))->unk_A9 = var2; - return ApiStatus_DONE2; -} - -ApiStatus EnableTexPanning(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - s32 treeIndex = get_variable(script, *thisPos++); - s32 flag = get_variable(script, *thisPos++); - Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex)); - - if (flag) { - model->flags |= 0x800; - } else { - model->flags &= ~0x800; - } - return ApiStatus_DONE2; -} - -ApiStatus EnableModel(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - s32 listIndex = get_model_list_index_from_tree_index(get_variable(script, *thisPos++)); - Bytecode flag = get_variable(script, *thisPos++); - Model* model = get_model_from_list_index(listIndex); - - if (flag != 0) { - model->flags &= ~0x2; - } else { - model->flags |= 0x2; - } - return ApiStatus_DONE2; -} - -ApiStatus SetGroupEnabled(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - Bytecode var1 = get_variable(script, *thisPos++); - Bytecode var2 = get_variable(script, *thisPos++); - - func_8011B7C0(var1, 2, var2); - return ApiStatus_DONE2; -} - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", SetTexPanOffset, ScriptInstance* script, s32 isInitialCall); - -ApiStatus func_802C9428(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - s32 var1 = get_variable(script, *thisPos++); - s32 var2 = get_variable(script, *thisPos++); - s32 var3 = get_variable(script, *thisPos++); - - func_8011BCB4(var1, var2, var3); - return ApiStatus_DONE2; -} - -ApiStatus func_802C94A0(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - s32 var1 = get_variable(script, *thisPos++); - s32 var2 = get_variable(script, *thisPos++); - s32 var3 = get_variable(script, *thisPos++); - - func_8011BCD0(var1, var2, var3); - return ApiStatus_DONE2; -} - -#ifdef NON_MATCHING -/*ApiStatus SetModelFlags(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - s32 listIndex; - Bytecode zvar; - Bytecode avar; - Bytecode flag; - Model* model; - - listIndex = get_model_list_index_from_tree_index(get_variable(script, *thisPos++)); - zvar = thisPos[1]; - avar = thisPos[0]; - flag = get_variable(script, zvar); - model = get_model_from_list_index(listIndex); - - if (flag != 0) { - model->flags |= avar; - } else { - model->flags &= ~avar; - } - return ApiStatus_DONE2; -}*/ -#else -INCLUDE_ASM(s32, "code_e92d0_len_5da0", SetModelFlags, ScriptInstance* script, s32 isInitialCall); -#endif - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", func_802C95A0); - -ApiStatus func_802C971C(ScriptInstance* script, s32 isInitialCall) { - func_8011B37C((u16)get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} - -ApiStatus func_802C9748(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - u16 var1 = get_variable(script, *thisPos++); - s32 var2 = get_variable(script, *thisPos++); - - if (var2 != 0) { - func_8011B5D0(var1); - } else { - func_8011B660(var1); - } - return ApiStatus_DONE2; -} - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", TranslateGroup, ScriptInstance* script, s32 isInitialCall); - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", RotateGroup, ScriptInstance* script, s32 isInitialCall); - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", ScaleGroup, ScriptInstance* script, s32 isInitialCall); - -ApiStatus func_802C9B40(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - s32 var1 = get_variable(script, *thisPos++); - Bytecode var2 = *thisPos++; - - set_variable(script, var2, func_8011B090(var1)); - return ApiStatus_DONE2; -} - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", EnableGroup, ScriptInstance* script, s32 isInitialCall); - -ApiStatus func_802C9C70(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - s32 var1 = get_variable(script, *thisPos++); - u16 var2 = get_variable(script, *thisPos++); - s32 var3 = get_variable(script, *thisPos++); - - func_8011C164(var1, var2, var3); - return ApiStatus_DONE2; -} - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", modify_collider_family_flags); - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", ModifyColliderFlags, ScriptInstance* script, s32 isInitialCall); - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", ResetFromLava, ScriptInstance* script, s32 isInitialCall); - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", func_802C9FD4); - -ApiStatus GetColliderCenter(ScriptInstance* script, s32 initialCall) { - f32 x; - f32 y; - f32 z; - - get_collider_center(get_variable(script, *script->ptrReadPos), &x, &y, &z); - - script->varTable[0] = x; - script->varTable[1] = y; - script->varTable[2] = z; - - return ApiStatus_DONE2; -} - -ApiStatus ParentColliderToModel(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - s16 colliderID = get_variable(script, *thisPos++); - s32 treeIndex = get_variable(script, *thisPos++); - - parent_collider_to_model(colliderID, get_model_list_index_from_tree_index(treeIndex)); - update_collider_transform(colliderID); - return ApiStatus_DONE2; -} - -ApiStatus UpdateColliderTransform(ScriptInstance* script, s32 isInitialCall) { - update_collider_transform(get_variable(script, *script->ptrReadPos)); - return ApiStatus_DONE2; -} - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", set_zone_enabled); - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", SetZoneEnabled); - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", goto_map); - -ApiStatus GotoMap(ScriptInstance* script, s32 isInitialCall) { - goto_map(script, 0); - return ApiStatus_DONE1; -} - -ApiStatus GotoMapSpecial(ScriptInstance* script, s32 isInitialCall) { - goto_map(script, 1); - return ApiStatus_DONE1; -} - -ApiStatus GotoMapByID(ScriptInstance* script, s32 isInitialCall) { - goto_map(script, 2); - return ApiStatus_DONE1; -} - -ApiStatus GetEntryID(ScriptInstance* script, s32 isInitialCall) { - set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->entryID); - return ApiStatus_DONE2; -} - -ApiStatus GetMapID(ScriptInstance* script, s32 isInitialCall) { - set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->mapID); - return ApiStatus_DONE2; -} - -ApiStatus GetLoadType(ScriptInstance* script, s32 isInitialCall) { - set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->loadType != 0); - return ApiStatus_DONE2; -} - -ApiStatus SetRenderMode(ScriptInstance* script, s32 isInitialCall) { - Bytecode* thisPos = script->ptrReadPos; - s32 treeIndex = get_variable(script, *thisPos++); - s8 renderMode = get_variable(script, *thisPos++); - - get_model_from_list_index(get_model_list_index_from_tree_index(treeIndex))->renderMode = renderMode; - - return ApiStatus_DONE2; -} - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", PlaySoundAtModel, ScriptInstance* script, s32 isInitialCall); - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", PlaySoundAtCollider, ScriptInstance* script, s32 isInitialCall); diff --git a/src/code_e940_len_290.c b/src/code_e940_len_290.c index bbf051b9ab..df02221e4a 100644 --- a/src/code_e940_len_290.c +++ b/src/code_e940_len_290.c @@ -1,11 +1,85 @@ #include "common.h" void begin_state_init(void) { - D_8009A650[0] |= 8; + D_8009A650[0] |= 0x8; GAME_STATUS->loadMenuState = 3; } -INCLUDE_ASM(s32, "code_e940_len_290", step_init_state); +void step_init_state(void) { + GameStatus** gameStatusPtr = gGameStatusPtr; + GameStatus* gameStatus = *gameStatusPtr; + s32 i; + + if (GAME_STATUS->loadMenuState != 0) { + GAME_STATUS->loadMenuState--; + return; + } + + D_8009A650[0] = 0; + (*gameStatusPtr)->areaID = 0; + gameStatus->isBattle = 0; + gameStatus->prevArea = -1; + gameStatus->mapID = 0; + gameStatus->entryID = 0; + (*gameStatusPtr)->unk_76 = 0; + (*gameStatusPtr)->disableScripts = 0; + (*gameStatusPtr)->unk_7D = 0; + (*gameStatusPtr)->unk_A8 = -1; + (*gameStatusPtr)->unk_AA = 0; + (*gameStatusPtr)->unk_A9 = -1; + (*gameStatusPtr)->demoState = 0; + + general_heap_create(); + func_8011D890(); + clear_dynamic_entity_list(); + clear_script_list(); + create_cameras_a(); + func_802DD8F8(0); + clear_virtual_models(); + func_8011E224(); + clear_model_data(); + func_80148040(); + func_80145DF8(); + func_801452E8(0, 0); + func_80141100(); + clear_trigger_data(); + clear_printers(); + clear_entity_data(0); + func_80138108(); + clear_player_status(); + clear_npcs(); + clear_player_data(); + func_80072B30(); + func_8003E338(); + func_80059C9C(); + clear_item_entity_data(); + clear_saved_variables(); + initialize_collision(); + func_8014AC08(); + func_801473F0(); + partner_initialize_data(); + func_80149618(); + func_8014A52C(); + initialize_curtains(); + + for (i = 0; i < 4; i++) { + (*gameStatusPtr)->unk_50[i] = 4; + (*gameStatusPtr)->unk_48[i] = 0xF; + } + + fio_has_valid_backup(); + + if (D_800D9620 == 0) { + GAME_STATUS->unk_AB = 1; + func_8005615C(); + } else { + GAME_STATUS->unk_AB = 0; + func_80056180(); + } + + D_8009A650[0] &= ~0x8; + set_game_mode(1); +} void func_80033788(void) { func_8002AB5C(0, 0, 0x13F, 0xEF, 0, 0, 0, 0xFF); diff --git a/src/code_ebd0_len_6a0.c b/src/code_ebd0_len_6a0.c index 1b8301d968..0d491e9182 100644 --- a/src/code_ebd0_len_6a0.c +++ b/src/code_ebd0_len_6a0.c @@ -1,13 +1,13 @@ #include "common.h" void intro_logos_set_fade_alpha(s16 new_alpha) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; gameStatus->bootAlpha = new_alpha; } void intro_logos_set_fade_color(s16 arg0) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; gameStatus->bootRed = arg0; gameStatus->bootGreen = arg0; @@ -15,7 +15,7 @@ void intro_logos_set_fade_color(s16 arg0) { } s16 intro_logos_fade_in(subtract_val) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; if (gameStatus->bootAlpha != 0) { gameStatus->bootAlpha -= subtract_val; @@ -29,7 +29,7 @@ s16 intro_logos_fade_in(subtract_val) { } s16 intro_logos_fade_out(add_val) { - GameStatus* gameStatus = *gGameStatusPtr; + GameStatus* gameStatus = GAME_STATUS; if (gameStatus->bootAlpha != 0xFF) { gameStatus->bootAlpha += add_val; diff --git a/src/code_fa4c0_len_3bf0.c b/src/code_fa4c0_len_3bf0.c index 14b6d105fb..a3f68de5e9 100644 --- a/src/code_fa4c0_len_3bf0.c +++ b/src/code_fa4c0_len_3bf0.c @@ -5,19 +5,19 @@ INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D5B10); INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D5C70); ApiStatus FadeOutMusic(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 itemID = get_variable(script, *ptrReadPos++); - s32* ptrNextPos = ptrReadPos++; + Bytecode* args = script->ptrReadPos; + s32 itemID = get_variable(script, *args++); + s32* ptrNextPos = args++; return (set_music_track(itemID, -1, 0, get_variable(script, *ptrNextPos++), 8) != 0) * 2; } ApiStatus SetMusicTrack(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 musicPlayer = get_variable(script, *ptrReadPos++); - s32 songID = get_variable(script, *ptrReadPos++); - s32 variation = get_variable(script, *ptrReadPos++); - s16 volume = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32 musicPlayer = get_variable(script, *args++); + s32 songID = get_variable(script, *args++); + s32 variation = get_variable(script, *args++); + s16 volume = get_variable(script, *args++); return (set_music_track(musicPlayer, songID, variation, 0x1F4, volume) != 0) * 2; } @@ -40,69 +40,75 @@ INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D6070); INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D6090); -INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", ClearAmbientSounds); +//INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", ClearAmbientSounds); +ApiStatus ClearAmbientSounds(ScriptInstance* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32 flags = get_variable(script, *args++); + + return (play_ambient_sounds(-1, flags) != 0) * 2; +} ApiStatus PlayAmbientSounds(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 soundID = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32 soundID = get_variable(script, *args++); return (play_ambient_sounds(soundID, 0xFA) != 0) * 2; } ApiStatus PlaySound(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 soundID = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32 soundID = get_variable(script, *args++); play_sound(soundID); return ApiStatus_DONE2; } ApiStatus func_802D617C(ScriptInstance* script, s32 initialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 soundID = get_variable(script, *ptrReadPos++); - s32 value2 = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32 soundID = get_variable(script, *args++); + s32 value2 = get_variable(script, *args++); _play_sound(soundID, value2 & 0xFF, 0, 0); return ApiStatus_DONE2; } ApiStatus PlaySoundAt(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 soundID = get_variable(script, *ptrReadPos++); - s32 value2 = get_variable(script, *ptrReadPos++); - s32 x = get_variable(script, *ptrReadPos++); - s32 y = get_variable(script, *ptrReadPos++); - s32 z = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32 soundID = get_variable(script, *args++); + s32 value2 = get_variable(script, *args++); + s32 x = get_variable(script, *args++); + s32 y = get_variable(script, *args++); + s32 z = get_variable(script, *args++); play_sound_at_position(soundID, value2, x, y, z); return ApiStatus_DONE2; } ApiStatus StopSound(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - stop_sound(get_variable(script, *ptrReadPos++)); + stop_sound(get_variable(script, *args++)); return ApiStatus_DONE2; } ApiStatus func_802D62E4(ScriptInstance* script, s32 initialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - func_80149A6C(get_variable(script, *ptrReadPos++), 1); + func_80149A6C(get_variable(script, *args++), 1); return ApiStatus_DONE2; } ApiStatus UseDoorSounds(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - gCurrentDoorSoundsSet = get_variable(script, *ptrReadPos++); + gCurrentDoorSoundsSet = get_variable(script, *args++); return ApiStatus_DONE2; } ApiStatus func_802D6340(ScriptInstance* script, s32 initialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - D_80151308 = get_variable(script, *ptrReadPos++); + D_80151308 = get_variable(script, *args++); return ApiStatus_DONE2; } @@ -113,8 +119,8 @@ INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D6420); INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D663C); ApiStatus RemoveKeyItemAt(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 index = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32 index = get_variable(script, *args++); s16* ptrKeyItems = (s16*) &gPlayerData.keyItems; ptrKeyItems[index] = 0; @@ -122,8 +128,8 @@ ApiStatus RemoveKeyItemAt(ScriptInstance* script, s32 isInitialCall) { } ApiStatus RemoveItemAt(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 index = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32 index = get_variable(script, *args++); s16* ptrInvItems = (s16*) &gPlayerData.invItems; ptrInvItems[index] = 0; @@ -132,8 +138,8 @@ ApiStatus RemoveItemAt(ScriptInstance* script, s32 isInitialCall) { } ApiStatus AddKeyItem(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 value = *ptrReadPos++; + Bytecode* args = script->ptrReadPos; + s32 value = *args++; PlayerData* playerData = &gPlayerData; s32 itemID = get_variable(script, value); s32 i; @@ -164,9 +170,9 @@ ApiStatus func_802D6954(ScriptInstance* script, s32 isInitialCall) { } ApiStatus HasKeyItem(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 itemID = get_variable(script, *ptrReadPos++); - s32 value = *ptrReadPos++; + Bytecode* args = script->ptrReadPos; + s32 itemID = get_variable(script, *args++); + s32 value = *args++; PlayerData* playerData = &gPlayerData; s32 i; @@ -180,9 +186,9 @@ ApiStatus HasKeyItem(ScriptInstance* script, s32 isInitialCall) { } ApiStatus FindKeyItem(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 itemID = get_variable(script, *ptrReadPos++); - s32 value = *ptrReadPos++; + Bytecode* args = script->ptrReadPos; + s32 itemID = get_variable(script, *args++); + s32 value = *args++; PlayerData* playerData = &gPlayerData; s32 i; s32 itemIndex; @@ -203,9 +209,9 @@ ApiStatus FindKeyItem(ScriptInstance* script, s32 isInitialCall) { } ApiStatus AddItem(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 itemID = get_variable(script, *ptrReadPos++); - Bytecode outItemIdx = *ptrReadPos++; + Bytecode* args = script->ptrReadPos; + s32 itemID = get_variable(script, *args++); + Bytecode outItemIdx = *args++; set_variable(script, outItemIdx, add_item(itemID)); return ApiStatus_DONE2; @@ -217,9 +223,9 @@ ApiStatus func_802D6AF0(ScriptInstance* script, s32 initialCall) { } ApiStatus FindItem(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 itemID = get_variable(script, *ptrReadPos++); - s32 value = *ptrReadPos++; + Bytecode* args = script->ptrReadPos; + s32 itemID = get_variable(script, *args++); + s32 value = *args++; PlayerData* playerData = &gPlayerData; s32 i; s32 itemIndex; @@ -240,9 +246,9 @@ ApiStatus FindItem(ScriptInstance* script, s32 isInitialCall) { } ApiStatus RemoveItem(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 itemID = get_variable(script, *ptrReadPos++); - s32 value = *ptrReadPos++; + Bytecode* args = script->ptrReadPos; + s32 itemID = get_variable(script, *args++); + s32 value = *args++; PlayerData* playerData = &gPlayerData; s32 i; s32 itemIndex; @@ -291,13 +297,13 @@ INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", DropItemEntityB, ScriptInstance* script, /* // Close to working ApiStatus DropItemEntityB(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 itemID = get_variable(script, *ptrReadPos++); - s32 x = get_variable(script, *ptrReadPos++); - s32 y = get_variable(script, *ptrReadPos++); - s32 z = get_variable(script, *ptrReadPos++); - s32 itemSpawnMode = get_variable(script, *ptrReadPos++); - s32 pickupFlag = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32 itemID = get_variable(script, *args++); + s32 x = get_variable(script, *args++); + s32 y = get_variable(script, *args++); + s32 z = get_variable(script, *args++); + s32 itemSpawnMode = get_variable(script, *args++); + s32 pickupFlag = get_variable(script, *args++); script->varTable[0] = make_item_entity_nodelay(itemID, x, y, z); set_item_entity_flags(script, 0x4000); @@ -306,17 +312,17 @@ ApiStatus DropItemEntityB(ScriptInstance* script, s32 isInitialCall) { */ ApiStatus RemoveItemEntity(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 itemEntityIndex = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32 itemEntityIndex = get_variable(script, *args++); remove_item_entity_by_index(itemEntityIndex); return ApiStatus_DONE2; } ApiStatus AddBadge(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32 badgeID = get_variable(script, *ptrReadPos++); - Bytecode outBadgeIdx = *ptrReadPos++; + Bytecode* args = script->ptrReadPos; + s32 badgeID = get_variable(script, *args++); + Bytecode outBadgeIdx = *args++; set_variable(script, outBadgeIdx, add_badge(badgeID)); return ApiStatus_DONE2; @@ -325,15 +331,15 @@ ApiStatus AddBadge(ScriptInstance* script, s32 isInitialCall) { INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", RemoveBadge, ScriptInstance* script, s32 isInitialCall); ApiStatus SetItemPos(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; ItemEntity* ptrItemEntity; s32 itemEntityIndex; s32 x, y, z; - itemEntityIndex = get_variable(script, *ptrReadPos++); - x = get_variable(script, *ptrReadPos++); - y = get_variable(script, *ptrReadPos++); - z = get_variable(script, *ptrReadPos++); + itemEntityIndex = get_variable(script, *args++); + x = get_variable(script, *args++); + y = get_variable(script, *args++); + z = get_variable(script, *args++); ptrItemEntity = (ItemEntity*) get_item_entity(itemEntityIndex); ptrItemEntity->position.x = x; @@ -361,21 +367,16 @@ ApiStatus AddStarPieces(ScriptInstance* script, s32 isInitialCall) { return ApiStatus_DONE2; } -#ifdef NON_MATCHING -/* ApiStatus GetItemPower(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - StaticItem* item = &gItemTable[get_variable(script, *ptrReadPos++)]; - Bytecode out1 = *ptrReadPos++; - Bytecode out2 = *ptrReadPos++; + Bytecode* args = script->ptrReadPos; + s32 itemIdx = get_variable(script, *args++); + Bytecode out1 = *args++; + Bytecode out2 = *args++; - set_variable(script, out1, item->potencyA); - set_variable(script, out2, item->potencyB); + set_variable(script, out1, (&gItemTable[itemIdx])->potencyA); + set_variable(script, out2, (&gItemTable[itemIdx])->potencyB); return ApiStatus_DONE2; -}*/ -#else -INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", GetItemPower, ScriptInstance* script, s32 isInitialCall); -#endif +} INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", ShowGotItem, ScriptInstance* script, s32 isInitialCall); @@ -392,23 +393,23 @@ INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", func_802D7690); INCLUDE_ASM(s32, "code_fa4c0_len_3bf0", ShowEmote, ScriptInstance* script, s32 isInitialCall); ApiStatus RemoveEffect(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; + Bytecode* args = script->ptrReadPos; - remove_effect(get_variable(script, *ptrReadPos++)); + remove_effect(get_variable(script, *args++)); return ApiStatus_DONE2; } ApiStatus func_802D7B10(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32* ptrValue = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32* ptrValue = get_variable(script, *args++); *ptrValue |= 0x10; return ApiStatus_DONE2; } ApiStatus func_802D7B44(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32* ptrValue = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32* ptrValue = get_variable(script, *args++); s32* ptrTemp = ptrValue[3]; ptrTemp[5] = 10; @@ -416,8 +417,8 @@ ApiStatus func_802D7B44(ScriptInstance* script, s32 isInitialCall) { } ApiStatus func_802D7B74(ScriptInstance* script, s32 isInitialCall) { - Bytecode* ptrReadPos = script->ptrReadPos; - s32* ptrValue = get_variable(script, *ptrReadPos++); + Bytecode* args = script->ptrReadPos; + s32* ptrValue = get_variable(script, *args++); s32* ptrTemp = ptrValue[3]; ptrTemp[12] = 5; diff --git a/tools/func_addrs.txt b/tools/func_addrs.txt index 51c58a04e4..b15786733a 100644 --- a/tools/func_addrs.txt +++ b/tools/func_addrs.txt @@ -1663,6 +1663,7 @@ si_handle_wait;0x802C4B5C si_handle_wait_seconds;0x802C4BB8 si_skip_else;0x802C8978 si_skip_if;0x802C88FC +si_standard_trigger_executor;0x802C6AD0 sign;0x800294B0 signF;0x80029A7C sin_cos_deg;0x8002A234 diff --git a/tools/m2ctx.py b/tools/m2ctx.py index 326d3586d2..f6c477f0eb 100755 --- a/tools/m2ctx.py +++ b/tools/m2ctx.py @@ -6,7 +6,7 @@ import subprocess from pathlib import Path script_dir = os.path.dirname(os.path.realpath(__file__)) -root_dir = script_dir + "/../" +root_dir = os.path.abspath(os.path.join(script_dir, "..")) src_dir = root_dir + "src/" @@ -23,10 +23,10 @@ def get_c_file(directory): if file.endswith(".c") and "data" not in file: return file + def import_c_file(in_file): in_file = os.path.relpath(in_file, root_dir) - cpp_command = ["cpp", "-P", "-Iinclude", "-undef", "-D__sgi", "-D_LANGUAGE_C", - "-DNON_MATCHING", "-D_Static_assert(x, y)=", "-D__attribute__(x)=", in_file] + cpp_command = ["gcc", "-E", "-P", "-Iinclude", "-D_LANGUAGE_C", "-ffreestanding", "-DF3DEX_GBI_2", in_file] try: return subprocess.check_output(cpp_command, cwd=root_dir, encoding="utf-8") except subprocess.CalledProcessError: @@ -37,6 +37,7 @@ def import_c_file(in_file): ) sys.exit(1) + def main(): if len(sys.argv) > 1: arg = sys.argv[1] @@ -46,12 +47,23 @@ def main(): "Output will be saved in oot/ctx.c") c_file_path = Path.cwd() / sys.argv[1] else: - sys.exit("Please specify a .c file path as an argument to this script") + this_dir = Path.cwd() + c_dir_path = get_c_dir(this_dir.name) + if c_dir_path is None: + sys.exit("Cannot find appropriate c file dir. In argumentless mode, run this script from the c file's corresponding asm dir.") + c_file = get_c_file(c_dir_path) + c_file_path = os.path.join(c_dir_path, c_file) - output = import_c_file(c_file_path) + processed = import_c_file(c_file_path) + processed_lines = processed.split("\n") + output = [] + + for line in processed_lines: + if "__attribute__" not in line: + output.append(line) with open(os.path.join(root_dir, "ctx.c"), "w", encoding="UTF-8") as f: - f.write(output) + f.write("\n".join(output)) if __name__ == "__main__": diff --git a/tools/n64splat b/tools/n64splat index 1e6f29d78e..d606c8ec15 160000 --- a/tools/n64splat +++ b/tools/n64splat @@ -1 +1 @@ -Subproject commit 1e6f29d78e80cd8e43b2b9e82895103baf83a04c +Subproject commit d606c8ec15daa3632a2ef7baf10948fe5c88209d diff --git a/tools/splat.yaml b/tools/splat.yaml index 629218a1e7..30072bbd45 100644 --- a/tools/splat.yaml +++ b/tools/splat.yaml @@ -1,7 +1,9 @@ name: "Paper Mario (North America)" basename: "papermario" -options: ["find-file-boundaries", "skip-asm"] -compiler: "GCC" +options: + find-file-boundaries: True + pycparser_flags: ["-Iinclude", "-D_LANGUAGE_C", "-ffreestanding", "-DF3DEX_GBI_2", "-DSPLAT"] + compiler: "GCC" segments: - name: header type: code @@ -229,6 +231,7 @@ segments: files: - [0xe79b0, "c", "code_e79b0_len_1920"] - [0xe92d0, "c", "code_e92d0_len_5da0"] + - [0xED510, "c", "code_ED510"] - [0xef070, "c", "code_ef070_len_3400"] - [0xf2470, "c", "code_f2470_len_27f0"] - [0xf4c60, "c", "code_f4c60_len_4300"] diff --git a/tools/windows_terminal.bat b/tools/windows_terminal.bat new file mode 100644 index 0000000000..9dd5cda1cc --- /dev/null +++ b/tools/windows_terminal.bat @@ -0,0 +1,3 @@ +REM first set your default distro using: wsl --set-default +ehco "first set your default distro using: wsl --set-default " +wt --title "diff.py" -d "../" ; split-pane -d "../" -V ; new-tab --title "mips_to_c.py" -d "../" ; focus-tab -t 0 diff --git a/undefined_syms.txt b/undefined_syms.txt index a194196492..c31f90bad5 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -41,6 +41,8 @@ D_8010CD20 = 0x8010CD20; D_8010EF08 = 0x8010EF08; D_8010F094 = 0x8010F094; +D_800D9620 = 0x800D9620; + gBattleStatus = 0x800DC070; gStaticScriptCounter = 0x802D9CA0; @@ -75,6 +77,7 @@ D_800A0900 = 0x800A0900; gCurrentEncounter = 0x800B0F10; gCameras = 0x800B1D80; gCurrentCameraID = 0x80077410; +SCRIPT_NpcDefeat = 0x80077E38; D_800DC500 = 0x800DC500; D_8010F6D0 = 0x8010F6D0; gBackgroundImage = 0x80200000; @@ -113,7 +116,9 @@ gCurrentTriggerListPtr = 0x80159390; D_801595A0 = 0x801595A0; D_80159AE2 = 0x80159AE2; D_80159AE4 = 0x80159AE4; +gCollisionStatus = 0x8015A55A0; D_8015C7C0 = 0x8015C7C0; +gLastCreatedEntityIndex = 0x801512EC; gWorldModelList = 0x80151770; gBattleModelList = 0x80151B70;