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_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_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_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_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 index 054f5b046f..e257c45e60 100644 --- a/asm/nonmatchings/code_e940_len_290/step_init_state.s +++ b/asm/nonmatchings/code_e940_len_290/step_init_state.s @@ -114,8 +114,8 @@ glabel step_init_state /* 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) +/* EB20 80033720 3C02800E */ lui $v0, %hi(D_800D9620) +/* EB24 80033724 8C429620 */ lw $v0, %lo(D_800D9620)($v0) /* EB28 80033728 14400007 */ bnez $v0, .L80033748 /* EB2C 8003372C 24020001 */ addiu $v0, $zero, 1 /* EB30 80033730 3C038007 */ lui $v1, %hi(gGameStatusPtr) diff --git a/include/functions.h b/include/functions.h index 7673260963..a3b2c4798d 100644 --- a/include/functions.h +++ b/include/functions.h @@ -52,6 +52,7 @@ s32 osGetId(); s32 func_800EF394(f32); s32 does_script_exist(s32 id); +ScriptInstance* start_script_in_group(ScriptInstance* script, s32 priority, s32 flags, s32 groups); void func_8011B7C0(u16, s32, s32); void func_80137D88(s32, f32); diff --git a/papermario.ld b/papermario.ld index 1252064ba6..0f31c5ea24 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_ED510.c b/src/code_ED510.c new file mode 100644 index 0000000000..cca11a6c39 --- /dev/null +++ b/src/code_ED510.c @@ -0,0 +1,322 @@ +#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* 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_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_e79b0_len_1920.c b/src/code_e79b0_len_1920.c index 9cea5cb91f..e6ae758dbe 100644 --- a/src/code_e79b0_len_1920.c +++ b/src/code_e79b0_len_1920.c @@ -12,7 +12,7 @@ INCLUDE_ASM(s32, "code_e79b0_len_1920", func_802C3390); INCLUDE_ASM(s32, "code_e79b0_len_1920", start_script); -INCLUDE_ASM(s32, "code_e79b0_len_1920", start_script_in_group); +INCLUDE_ASM(ScriptInstance*, "code_e79b0_len_1920", start_script_in_group, ScriptInstance* script, s32 priority, s32 flags, s32 groups); INCLUDE_ASM(s32, "code_e79b0_len_1920", start_child_script); diff --git a/src/code_e92d0_len_5da0.c b/src/code_e92d0_len_5da0.c index a82787d431..804a5b636b 100644 --- a/src/code_e92d0_len_5da0.c +++ b/src/code_e92d0_len_5da0.c @@ -46,7 +46,35 @@ ApiStatus si_handle_loop(ScriptInstance* script) { 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); @@ -207,19 +235,176 @@ ApiStatus si_handle_switch_const(ScriptInstance* script) { 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; @@ -236,31 +421,30 @@ ApiStatus si_handle_case_default(ScriptInstance* script) { do {} while (0); // Necessary to match } -#ifdef NON_MATCHING ApiStatus si_handle_case_AND(ScriptInstance* script) { Bytecode* args = script->ptrReadPos; - s32 a0; + s32 switchDepth = script->switchDepth; + s32 var; s32 switchBlockValue; - ASSERT(script->switchDepth >= 0); + ASSERT(switchDepth >= 0); - switchBlockValue = script->switchBlockValue[script->switchDepth]; - a0 = *args; + var = *args; + switchBlockValue = script->switchBlockValue[switchDepth]; - if (script->switchBlockState[script->switchDepth] <= 0) { + if (script->switchBlockState[switchDepth] <= 0) { script->ptrNextLine = si_goto_end_case(script); - } else if ((a0 & switchBlockValue) != 0) { - script->switchBlockState[script->switchDepth] = 0; - } else { + } 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 } -#else -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_AND); -#endif + INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_case_equal_OR); @@ -280,6 +464,7 @@ ApiStatus si_handle_end_case_group(ScriptInstance* script) { } return ApiStatus_DONE2; + do {} while (0); // Necessary to match } @@ -661,7 +846,7 @@ ApiStatus si_handle_call(ScriptInstance* script) { func = script->callFunction; newScript = script; // todo fake match } else { - script->callFunction = get_variable(script, *args++); + script->callFunction = (ApiFunc)get_variable(script, *args++); newScript = script; // todo fake match script->ptrReadPos = args; script->flags.bytes.currentArgc--; @@ -673,9 +858,60 @@ ApiStatus si_handle_call(ScriptInstance* script) { return func(newScript, isInitialCall); // todo fake match } -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_exec1); +ApiStatus si_handle_exec1(ScriptInstance *script) { + ScriptInstance* newScript; + s32 i; -INCLUDE_ASM(s32, "code_e92d0_len_5da0", si_handle_exec2); + newScript = start_script_in_group((ScriptInstance*)get_variable(script, *script->ptrReadPos), script->flags.bytes.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->flags.bytes.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; + + 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); @@ -978,325 +1214,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, 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_e92d0_len_5da0", PlaySoundAtModel, ScriptInstance* script, s32 isInitialCall); - -INCLUDE_ASM(s32, "code_e92d0_len_5da0", PlaySoundAtCollider, ScriptInstance* script, s32 isInitialCall); diff --git a/tools/splat.yaml b/tools/splat.yaml index c8960c5562..ee59b13837 100644 --- a/tools/splat.yaml +++ b/tools/splat.yaml @@ -1,6 +1,6 @@ name: "Paper Mario (North America)" basename: "papermario" -options: ["find-file-boundaries", "skip-asm"] +options: ["find-file-boundaries"] compiler: "GCC" segments: - name: header @@ -229,6 +229,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"]