Merge pull request #9 from ethteck/si

Work on script interpreter
This commit is contained in:
Ethan Roseman 2020-08-14 22:51:38 -04:00 committed by GitHub
commit 162f02c846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 288 additions and 780 deletions

View File

@ -71,7 +71,7 @@ LD_SCRIPT = $(TARGET).ld
all: $(BUILD_DIR) $(TARGET).z64 verify
clean:
rm -rf build $(TARGET).z64
rm -rf $(BUILD_DIR) $(TARGET).z64
submodules:
git submodule update --init --recursive

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel DeleteTrigger
/* 0EB1D4 802C6824 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB1D8 802C6828 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB1DC 802C682C 8C82000C */ lw $v0, 0xc($a0)
/* 0EB1E0 802C6830 0C0B1EAF */ jal get_variable
/* 0EB1E4 802C6834 8C450000 */ lw $a1, ($v0)
/* 0EB1E8 802C6838 0C0516FD */ jal delete_trigger
/* 0EB1EC 802C683C 0040202D */ daddu $a0, $v0, $zero
/* 0EB1F0 802C6840 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB1F4 802C6844 24020002 */ addiu $v0, $zero, 2
/* 0EB1F8 802C6848 03E00008 */ jr $ra
/* 0EB1FC 802C684C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,18 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel GetEntryID
/* 0EEE10 802CA460 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EEE14 802CA464 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EEE18 802CA468 8C82000C */ lw $v0, 0xc($a0)
/* 0EEE1C 802CA46C 3C038007 */ lui $v1, 0x8007
/* 0EEE20 802CA470 8C63419C */ lw $v1, 0x419c($v1)
/* 0EEE24 802CA474 8C450000 */ lw $a1, ($v0)
/* 0EEE28 802CA478 0C0B2026 */ jal set_variable
/* 0EEE2C 802CA47C 8466008E */ lh $a2, 0x8e($v1)
/* 0EEE30 802CA480 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EEE34 802CA484 24020002 */ addiu $v0, $zero, 2
/* 0EEE38 802CA488 03E00008 */ jr $ra
/* 0EEE3C 802CA48C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel GetLoadType
/* 0EEE70 802CA4C0 3C028007 */ lui $v0, 0x8007
/* 0EEE74 802CA4C4 8C42419C */ lw $v0, 0x419c($v0)
/* 0EEE78 802CA4C8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EEE7C 802CA4CC AFBF0010 */ sw $ra, 0x10($sp)
/* 0EEE80 802CA4D0 8C83000C */ lw $v1, 0xc($a0)
/* 0EEE84 802CA4D4 90460167 */ lbu $a2, 0x167($v0)
/* 0EEE88 802CA4D8 8C650000 */ lw $a1, ($v1)
/* 0EEE8C 802CA4DC 0C0B2026 */ jal set_variable
/* 0EEE90 802CA4E0 0006302B */ sltu $a2, $zero, $a2
/* 0EEE94 802CA4E4 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EEE98 802CA4E8 24020002 */ addiu $v0, $zero, 2
/* 0EEE9C 802CA4EC 03E00008 */ jr $ra
/* 0EEEA0 802CA4F0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802C6E14
/* 0EB7C4 802C6E14 03E00008 */ jr $ra
/* 0EB7C8 802C6E18 24020002 */ addiu $v0, $zero, 2

View File

@ -1,11 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802C739C
/* 0EBD4C 802C739C 8C82000C */ lw $v0, 0xc($a0)
/* 0EBD50 802C73A0 8C420000 */ lw $v0, ($v0)
/* 0EBD54 802C73A4 AC820160 */ sw $v0, 0x160($a0)
/* 0EBD58 802C73A8 03E00008 */ jr $ra
/* 0EBD5C 802C73AC 24020002 */ addiu $v0, $zero, 2

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802C73B0
/* 0EBD60 802C73B0 03E00008 */ jr $ra
/* 0EBD64 802C73B4 24020002 */ addiu $v0, $zero, 2

View File

@ -1,27 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802C73B8
/* 0EBD68 802C73B8 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0EBD6C 802C73BC AFB10014 */ sw $s1, 0x14($sp)
/* 0EBD70 802C73C0 0080882D */ daddu $s1, $a0, $zero
/* 0EBD74 802C73C4 AFB00010 */ sw $s0, 0x10($sp)
/* 0EBD78 802C73C8 0000802D */ daddu $s0, $zero, $zero
/* 0EBD7C 802C73CC AFBF0018 */ sw $ra, 0x18($sp)
.L802C73D0:
/* 0EBD80 802C73D0 0C0B11E4 */ jal get_script_by_index
/* 0EBD84 802C73D4 0200202D */ daddu $a0, $s0, $zero
/* 0EBD88 802C73D8 12220004 */ beq $s1, $v0, .L802C73EC
/* 0EBD8C 802C73DC 26100001 */ addiu $s0, $s0, 1
/* 0EBD90 802C73E0 2A020080 */ slti $v0, $s0, 0x80
/* 0EBD94 802C73E4 1440FFFA */ bnez $v0, .L802C73D0
/* 0EBD98 802C73E8 00000000 */ nop
.L802C73EC:
/* 0EBD9C 802C73EC 8FBF0018 */ lw $ra, 0x18($sp)
/* 0EBDA0 802C73F0 8FB10014 */ lw $s1, 0x14($sp)
/* 0EBDA4 802C73F4 8FB00010 */ lw $s0, 0x10($sp)
/* 0EBDA8 802C73F8 24020001 */ addiu $v0, $zero, 1
/* 0EBDAC 802C73FC 03E00008 */ jr $ra
/* 0EBDB0 802C7400 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,26 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_break_case
/* 0EA084 802C56D4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EA088 802C56D8 AFB00010 */ sw $s0, 0x10($sp)
/* 0EA08C 802C56DC 0080802D */ daddu $s0, $a0, $zero
/* 0EA090 802C56E0 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EA094 802C56E4 82020007 */ lb $v0, 7($s0)
/* 0EA098 802C56E8 04410003 */ bgez $v0, .L802C56F8
/* 0EA09C 802C56EC 00000000 */ nop
.L802C56F0:
/* 0EA0A0 802C56F0 080B15BC */ j .L802C56F0
/* 0EA0A4 802C56F4 00000000 */ nop
.L802C56F8:
/* 0EA0A8 802C56F8 0C0B2279 */ jal si_goto_end_case
/* 0EA0AC 802C56FC 0200202D */ daddu $a0, $s0, $zero
/* 0EA0B0 802C5700 AE020008 */ sw $v0, 8($s0)
/* 0EA0B4 802C5704 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EA0B8 802C5708 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA0BC 802C570C 24020002 */ addiu $v0, $zero, 2
/* 0EA0C0 802C5710 03E00008 */ jr $ra
/* 0EA0C4 802C5714 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,29 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_break_loop
/* 0E94BC 802C4B0C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0E94C0 802C4B10 AFB00010 */ sw $s0, 0x10($sp)
/* 0E94C4 802C4B14 0080802D */ daddu $s0, $a0, $zero
/* 0E94C8 802C4B18 AFBF0014 */ sw $ra, 0x14($sp)
/* 0E94CC 802C4B1C 82020006 */ lb $v0, 6($s0)
/* 0E94D0 802C4B20 04410003 */ bgez $v0, .L802C4B30
/* 0E94D4 802C4B24 00000000 */ nop
.L802C4B28:
/* 0E94D8 802C4B28 080B12CA */ j .L802C4B28
/* 0E94DC 802C4B2C 00000000 */ nop
.L802C4B30:
/* 0E94E0 802C4B30 0C0B22B9 */ jal si_goto_end_loop
/* 0E94E4 802C4B34 0200202D */ daddu $a0, $s0, $zero
/* 0E94E8 802C4B38 92030006 */ lbu $v1, 6($s0)
/* 0E94EC 802C4B3C AE020008 */ sw $v0, 8($s0)
/* 0E94F0 802C4B40 2463FFFF */ addiu $v1, $v1, -1
/* 0E94F4 802C4B44 A2030006 */ sb $v1, 6($s0)
/* 0E94F8 802C4B48 8FBF0014 */ lw $ra, 0x14($sp)
/* 0E94FC 802C4B4C 8FB00010 */ lw $s0, 0x10($sp)
/* 0E9500 802C4B50 24020002 */ addiu $v0, $zero, 2
/* 0E9504 802C4B54 03E00008 */ jr $ra
/* 0E9508 802C4B58 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_else
/* 0E98F0 802C4F40 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0E98F4 802C4F44 AFB00010 */ sw $s0, 0x10($sp)
/* 0E98F8 802C4F48 AFBF0014 */ sw $ra, 0x14($sp)
/* 0E98FC 802C4F4C 0C0B225E */ jal si_skip_else
/* 0E9900 802C4F50 0080802D */ daddu $s0, $a0, $zero
/* 0E9904 802C4F54 AE020008 */ sw $v0, 8($s0)
/* 0E9908 802C4F58 8FBF0014 */ lw $ra, 0x14($sp)
/* 0E990C 802C4F5C 8FB00010 */ lw $s0, 0x10($sp)
/* 0E9910 802C4F60 24020002 */ addiu $v0, $zero, 2
/* 0E9914 802C4F64 03E00008 */ jr $ra
/* 0E9918 802C4F68 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,14 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_end_child_thread
/* 0EB7A4 802C6DF4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB7A8 802C6DF8 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB7AC 802C6DFC 0C0B0FCF */ jal kill_script
/* 0EB7B0 802C6E00 00000000 */ nop
/* 0EB7B4 802C6E04 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB7B8 802C6E08 0000102D */ daddu $v0, $zero, $zero
/* 0EB7BC 802C6E0C 03E00008 */ jr $ra
/* 0EB7C0 802C6E10 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_end_if
/* 0E991C 802C4F6C 03E00008 */ jr $ra
/* 0E9920 802C4F70 24020002 */ addiu $v0, $zero, 2

View File

@ -1,14 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_end_thread
/* 0EB6FC 802C6D4C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB700 802C6D50 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB704 802C6D54 0C0B0FCF */ jal kill_script
/* 0EB708 802C6D58 00000000 */ nop
/* 0EB70C 802C6D5C 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB710 802C6D60 240200FF */ addiu $v0, $zero, 0xff
/* 0EB714 802C6D64 03E00008 */ jr $ra
/* 0EB718 802C6D68 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,23 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_exec_wait
/* 0EAFAC 802C65FC 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EAFB0 802C6600 AFB00010 */ sw $s0, 0x10($sp)
/* 0EAFB4 802C6604 0080802D */ daddu $s0, $a0, $zero
/* 0EAFB8 802C6608 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EAFBC 802C660C 8E02000C */ lw $v0, 0xc($s0)
/* 0EAFC0 802C6610 0C0B1EAF */ jal get_variable
/* 0EAFC4 802C6614 8C450000 */ lw $a1, ($v0)
/* 0EAFC8 802C6618 0200202D */ daddu $a0, $s0, $zero
/* 0EAFCC 802C661C 0040282D */ daddu $a1, $v0, $zero
/* 0EAFD0 802C6620 0C0B0DF2 */ jal start_child_script
/* 0EAFD4 802C6624 0000302D */ daddu $a2, $zero, $zero
/* 0EAFD8 802C6628 A2000002 */ sb $zero, 2($s0)
/* 0EAFDC 802C662C 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EAFE0 802C6630 8FB00010 */ lw $s0, 0x10($sp)
/* 0EAFE4 802C6634 240200FF */ addiu $v0, $zero, 0xff
/* 0EAFE8 802C6638 03E00008 */ jr $ra
/* 0EAFEC 802C663C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_get_1_word
/* 0EA640 802C5C90 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EA644 802C5C94 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EA648 802C5C98 8C83000C */ lw $v1, 0xc($a0)
/* 0EA64C 802C5C9C 8C820138 */ lw $v0, 0x138($a0)
/* 0EA650 802C5CA0 8C650000 */ lw $a1, ($v1)
/* 0EA654 802C5CA4 8C460000 */ lw $a2, ($v0)
/* 0EA658 802C5CA8 24420004 */ addiu $v0, $v0, 4
/* 0EA65C 802C5CAC 0C0B2026 */ jal set_variable
/* 0EA660 802C5CB0 AC820138 */ sw $v0, 0x138($a0)
/* 0EA664 802C5CB4 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EA668 802C5CB8 24020002 */ addiu $v0, $zero, 2
/* 0EA66C 802C5CBC 03E00008 */ jr $ra
/* 0EA670 802C5CC0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,28 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_get_Nth_word
/* 0EA80C 802C5E5C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0EA810 802C5E60 AFB00010 */ sw $s0, 0x10($sp)
/* 0EA814 802C5E64 0080802D */ daddu $s0, $a0, $zero
/* 0EA818 802C5E68 AFBF0018 */ sw $ra, 0x18($sp)
/* 0EA81C 802C5E6C AFB10014 */ sw $s1, 0x14($sp)
/* 0EA820 802C5E70 8E02000C */ lw $v0, 0xc($s0)
/* 0EA824 802C5E74 8C450004 */ lw $a1, 4($v0)
/* 0EA828 802C5E78 0C0B1EAF */ jal get_variable
/* 0EA82C 802C5E7C 8C510000 */ lw $s1, ($v0)
/* 0EA830 802C5E80 0200202D */ daddu $a0, $s0, $zero
/* 0EA834 802C5E84 8C830138 */ lw $v1, 0x138($a0)
/* 0EA838 802C5E88 00021080 */ sll $v0, $v0, 2
/* 0EA83C 802C5E8C 00431021 */ addu $v0, $v0, $v1
/* 0EA840 802C5E90 8C460000 */ lw $a2, ($v0)
/* 0EA844 802C5E94 0C0B2026 */ jal set_variable
/* 0EA848 802C5E98 0220282D */ daddu $a1, $s1, $zero
/* 0EA84C 802C5E9C 8FBF0018 */ lw $ra, 0x18($sp)
/* 0EA850 802C5EA0 8FB10014 */ lw $s1, 0x14($sp)
/* 0EA854 802C5EA4 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA858 802C5EA8 24020002 */ addiu $v0, $zero, 2
/* 0EA85C 802C5EAC 03E00008 */ jr $ra
/* 0EA860 802C5EB0 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,22 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_goto
/* 0E9370 802C49C0 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0E9374 802C49C4 AFB00010 */ sw $s0, 0x10($sp)
/* 0E9378 802C49C8 0080802D */ daddu $s0, $a0, $zero
/* 0E937C 802C49CC AFBF0014 */ sw $ra, 0x14($sp)
/* 0E9380 802C49D0 8E02000C */ lw $v0, 0xc($s0)
/* 0E9384 802C49D4 0C0B1EAF */ jal get_variable
/* 0E9388 802C49D8 8C450000 */ lw $a1, ($v0)
/* 0E938C 802C49DC 0200202D */ daddu $a0, $s0, $zero
/* 0E9390 802C49E0 0C0B2224 */ jal si_goto_label
/* 0E9394 802C49E4 0040282D */ daddu $a1, $v0, $zero
/* 0E9398 802C49E8 AE020008 */ sw $v0, 8($s0)
/* 0E939C 802C49EC 8FBF0014 */ lw $ra, 0x14($sp)
/* 0E93A0 802C49F0 8FB00010 */ lw $s0, 0x10($sp)
/* 0E93A4 802C49F4 24020002 */ addiu $v0, $zero, 2
/* 0E93A8 802C49F8 03E00008 */ jr $ra
/* 0E93AC 802C49FC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,29 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_if_AND
/* 0E9840 802C4E90 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0E9844 802C4E94 AFB10014 */ sw $s1, 0x14($sp)
/* 0E9848 802C4E98 0080882D */ daddu $s1, $a0, $zero
/* 0E984C 802C4E9C AFBF0018 */ sw $ra, 0x18($sp)
/* 0E9850 802C4EA0 AFB00010 */ sw $s0, 0x10($sp)
/* 0E9854 802C4EA4 8E30000C */ lw $s0, 0xc($s1)
/* 0E9858 802C4EA8 8E050000 */ lw $a1, ($s0)
/* 0E985C 802C4EAC 0C0B1EAF */ jal get_variable
/* 0E9860 802C4EB0 26100004 */ addiu $s0, $s0, 4
/* 0E9864 802C4EB4 8E030000 */ lw $v1, ($s0)
/* 0E9868 802C4EB8 00431024 */ and $v0, $v0, $v1
/* 0E986C 802C4EBC 14400005 */ bnez $v0, .L802C4ED4
/* 0E9870 802C4EC0 24020002 */ addiu $v0, $zero, 2
/* 0E9874 802C4EC4 0C0B223F */ jal si_skip_if
/* 0E9878 802C4EC8 0220202D */ daddu $a0, $s1, $zero
/* 0E987C 802C4ECC AE220008 */ sw $v0, 8($s1)
/* 0E9880 802C4ED0 24020002 */ addiu $v0, $zero, 2
.L802C4ED4:
/* 0E9884 802C4ED4 8FBF0018 */ lw $ra, 0x18($sp)
/* 0E9888 802C4ED8 8FB10014 */ lw $s1, 0x14($sp)
/* 0E988C 802C4EDC 8FB00010 */ lw $s0, 0x10($sp)
/* 0E9890 802C4EE0 03E00008 */ jr $ra
/* 0E9894 802C4EE4 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,21 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_jump
/* 0EAFF0 802C6640 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EAFF4 802C6644 AFB00010 */ sw $s0, 0x10($sp)
/* 0EAFF8 802C6648 0080802D */ daddu $s0, $a0, $zero
/* 0EAFFC 802C664C AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB000 802C6650 8E02000C */ lw $v0, 0xc($s0)
/* 0EB004 802C6654 0C0B1EAF */ jal get_variable
/* 0EB008 802C6658 8C450000 */ lw $a1, ($v0)
/* 0EB00C 802C665C 0200202D */ daddu $a0, $s0, $zero
/* 0EB010 802C6660 0C0B0F41 */ jal restart_script
/* 0EB014 802C6664 AC82015C */ sw $v0, 0x15c($a0)
/* 0EB018 802C6668 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB01C 802C666C 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB020 802C6670 24020002 */ addiu $v0, $zero, 2
/* 0EB024 802C6674 03E00008 */ jr $ra
/* 0EB028 802C6678 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_kill
/* 0EB220 802C6870 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB224 802C6874 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB228 802C6878 8C82000C */ lw $v0, 0xc($a0)
/* 0EB22C 802C687C 0C0B1EAF */ jal get_variable
/* 0EB230 802C6880 8C450000 */ lw $a1, ($v0)
/* 0EB234 802C6884 0C0B102B */ jal kill_script_by_ID
/* 0EB238 802C6888 0040202D */ daddu $a0, $v0, $zero
/* 0EB23C 802C688C 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB240 802C6890 24020002 */ addiu $v0, $zero, 2
/* 0EB244 802C6894 03E00008 */ jr $ra
/* 0EB248 802C6898 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_label
/* 0E9368 802C49B8 03E00008 */ jr $ra
/* 0E936C 802C49BC 24020002 */ addiu $v0, $zero, 2

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_resume
/* 0EB3FC 802C6A4C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB400 802C6A50 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB404 802C6A54 8C82000C */ lw $v0, 0xc($a0)
/* 0EB408 802C6A58 0C0B1EAF */ jal get_variable
/* 0EB40C 802C6A5C 8C450000 */ lw $a1, ($v0)
/* 0EB410 802C6A60 0C0B1123 */ jal resume_all_script
/* 0EB414 802C6A64 0040202D */ daddu $a0, $v0, $zero
/* 0EB418 802C6A68 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB41C 802C6A6C 24020002 */ addiu $v0, $zero, 2
/* 0EB420 802C6A70 03E00008 */ jr $ra
/* 0EB424 802C6A74 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_resume_all
/* 0EB32C 802C697C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB330 802C6980 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB334 802C6984 8C82000C */ lw $v0, 0xc($a0)
/* 0EB338 802C6988 0C0B1EAF */ jal get_variable
/* 0EB33C 802C698C 8C450000 */ lw $a1, ($v0)
/* 0EB340 802C6990 0C0B1192 */ jal resume_all_group
/* 0EB344 802C6994 0040202D */ daddu $a0, $v0, $zero
/* 0EB348 802C6998 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB34C 802C699C 24020002 */ addiu $v0, $zero, 2
/* 0EB350 802C69A0 03E00008 */ jr $ra
/* 0EB354 802C69A4 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,21 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_resume_others
/* 0EB394 802C69E4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB398 802C69E8 AFB00010 */ sw $s0, 0x10($sp)
/* 0EB39C 802C69EC 0080802D */ daddu $s0, $a0, $zero
/* 0EB3A0 802C69F0 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB3A4 802C69F4 8E02000C */ lw $v0, 0xc($s0)
/* 0EB3A8 802C69F8 0C0B1EAF */ jal get_variable
/* 0EB3AC 802C69FC 8C450000 */ lw $a1, ($v0)
/* 0EB3B0 802C6A00 0200202D */ daddu $a0, $s0, $zero
/* 0EB3B4 802C6A04 0C0B11C7 */ jal resume_group_others
/* 0EB3B8 802C6A08 0040282D */ daddu $a1, $v0, $zero
/* 0EB3BC 802C6A0C 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB3C0 802C6A10 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB3C4 802C6A14 24020002 */ addiu $v0, $zero, 2
/* 0EB3C8 802C6A18 03E00008 */ jr $ra
/* 0EB3CC 802C6A1C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,14 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_return
/* 0E9348 802C4998 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0E934C 802C499C AFBF0010 */ sw $ra, 0x10($sp)
/* 0E9350 802C49A0 0C0B0FCF */ jal kill_script
/* 0E9354 802C49A4 00000000 */ nop
/* 0E9358 802C49A8 8FBF0010 */ lw $ra, 0x10($sp)
/* 0E935C 802C49AC 240200FF */ addiu $v0, $zero, 0xff
/* 0E9360 802C49B0 03E00008 */ jr $ra
/* 0E9364 802C49B4 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_array
/* 0EAB5C 802C61AC 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EAB60 802C61B0 AFB00010 */ sw $s0, 0x10($sp)
/* 0EAB64 802C61B4 0080802D */ daddu $s0, $a0, $zero
/* 0EAB68 802C61B8 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EAB6C 802C61BC 8E02000C */ lw $v0, 0xc($s0)
/* 0EAB70 802C61C0 0C0B1EAF */ jal get_variable
/* 0EAB74 802C61C4 8C450000 */ lw $a1, ($v0)
/* 0EAB78 802C61C8 AE02013C */ sw $v0, 0x13c($s0)
/* 0EAB7C 802C61CC 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EAB80 802C61D0 8FB00010 */ lw $s0, 0x10($sp)
/* 0EAB84 802C61D4 24020002 */ addiu $v0, $zero, 2
/* 0EAB88 802C61D8 03E00008 */ jr $ra
/* 0EAB8C 802C61DC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,16 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_const
/* 0EA140 802C5790 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EA144 802C5794 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EA148 802C5798 8C82000C */ lw $v0, 0xc($a0)
/* 0EA14C 802C579C 8C450000 */ lw $a1, ($v0)
/* 0EA150 802C57A0 0C0B2026 */ jal set_variable
/* 0EA154 802C57A4 8C460004 */ lw $a2, 4($v0)
/* 0EA158 802C57A8 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EA15C 802C57AC 24020002 */ addiu $v0, $zero, 2
/* 0EA160 802C57B0 03E00008 */ jr $ra
/* 0EA164 802C57B4 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_flag_array
/* 0EAB90 802C61E0 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EAB94 802C61E4 AFB00010 */ sw $s0, 0x10($sp)
/* 0EAB98 802C61E8 0080802D */ daddu $s0, $a0, $zero
/* 0EAB9C 802C61EC AFBF0014 */ sw $ra, 0x14($sp)
/* 0EABA0 802C61F0 8E02000C */ lw $v0, 0xc($s0)
/* 0EABA4 802C61F4 0C0B1EAF */ jal get_variable
/* 0EABA8 802C61F8 8C450000 */ lw $a1, ($v0)
/* 0EABAC 802C61FC AE020140 */ sw $v0, 0x140($s0)
/* 0EABB0 802C6200 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EABB4 802C6204 8FB00010 */ lw $s0, 0x10($sp)
/* 0EABB8 802C6208 24020002 */ addiu $v0, $zero, 2
/* 0EABBC 802C620C 03E00008 */ jr $ra
/* 0EABC0 802C6210 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,25 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_float
/* 0EA168 802C57B8 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0EA16C 802C57BC AFB00010 */ sw $s0, 0x10($sp)
/* 0EA170 802C57C0 0080802D */ daddu $s0, $a0, $zero
/* 0EA174 802C57C4 AFBF0018 */ sw $ra, 0x18($sp)
/* 0EA178 802C57C8 AFB10014 */ sw $s1, 0x14($sp)
/* 0EA17C 802C57CC 8E02000C */ lw $v0, 0xc($s0)
/* 0EA180 802C57D0 8C450004 */ lw $a1, 4($v0)
/* 0EA184 802C57D4 0C0B210B */ jal get_float_variable
/* 0EA188 802C57D8 8C510000 */ lw $s1, ($v0)
/* 0EA18C 802C57DC 0200202D */ daddu $a0, $s0, $zero
/* 0EA190 802C57E0 44060000 */ mfc1 $a2, $f0
/* 0EA194 802C57E4 0C0B2190 */ jal set_float_variable
/* 0EA198 802C57E8 0220282D */ daddu $a1, $s1, $zero
/* 0EA19C 802C57EC 8FBF0018 */ lw $ra, 0x18($sp)
/* 0EA1A0 802C57F0 8FB10014 */ lw $s1, 0x14($sp)
/* 0EA1A4 802C57F4 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA1A8 802C57F8 24020002 */ addiu $v0, $zero, 2
/* 0EA1AC 802C57FC 03E00008 */ jr $ra
/* 0EA1B0 802C5800 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_float_buffer_ptr
/* 0EA60C 802C5C5C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EA610 802C5C60 AFB00010 */ sw $s0, 0x10($sp)
/* 0EA614 802C5C64 0080802D */ daddu $s0, $a0, $zero
/* 0EA618 802C5C68 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EA61C 802C5C6C 8E02000C */ lw $v0, 0xc($s0)
/* 0EA620 802C5C70 0C0B1EAF */ jal get_variable
/* 0EA624 802C5C74 8C450000 */ lw $a1, ($v0)
/* 0EA628 802C5C78 AE020138 */ sw $v0, 0x138($s0)
/* 0EA62C 802C5C7C 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EA630 802C5C80 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA634 802C5C84 24020002 */ addiu $v0, $zero, 2
/* 0EA638 802C5C88 03E00008 */ jr $ra
/* 0EA63C 802C5C8C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,21 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_group
/* 0EB2C4 802C6914 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB2C8 802C6918 AFB00010 */ sw $s0, 0x10($sp)
/* 0EB2CC 802C691C 0080802D */ daddu $s0, $a0, $zero
/* 0EB2D0 802C6920 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB2D4 802C6924 8E02000C */ lw $v0, 0xc($s0)
/* 0EB2D8 802C6928 0C0B1EAF */ jal get_variable
/* 0EB2DC 802C692C 8C450000 */ lw $a1, ($v0)
/* 0EB2E0 802C6930 0200202D */ daddu $a0, $s0, $zero
/* 0EB2E4 802C6934 0C0B1086 */ jal set_script_group
/* 0EB2E8 802C6938 0040282D */ daddu $a1, $v0, $zero
/* 0EB2EC 802C693C 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB2F0 802C6940 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB2F4 802C6944 24020002 */ addiu $v0, $zero, 2
/* 0EB2F8 802C6948 03E00008 */ jr $ra
/* 0EB2FC 802C694C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_int_buffer_ptr
/* 0EA5D8 802C5C28 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EA5DC 802C5C2C AFB00010 */ sw $s0, 0x10($sp)
/* 0EA5E0 802C5C30 0080802D */ daddu $s0, $a0, $zero
/* 0EA5E4 802C5C34 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EA5E8 802C5C38 8E02000C */ lw $v0, 0xc($s0)
/* 0EA5EC 802C5C3C 0C0B1EAF */ jal get_variable
/* 0EA5F0 802C5C40 8C450000 */ lw $a1, ($v0)
/* 0EA5F4 802C5C44 AE020138 */ sw $v0, 0x138($s0)
/* 0EA5F8 802C5C48 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EA5FC 802C5C4C 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA600 802C5C50 24020002 */ addiu $v0, $zero, 2
/* 0EA604 802C5C54 03E00008 */ jr $ra
/* 0EA608 802C5C58 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,21 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_priority
/* 0EB24C 802C689C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB250 802C68A0 AFB00010 */ sw $s0, 0x10($sp)
/* 0EB254 802C68A4 0080802D */ daddu $s0, $a0, $zero
/* 0EB258 802C68A8 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB25C 802C68AC 8E02000C */ lw $v0, 0xc($s0)
/* 0EB260 802C68B0 0C0B1EAF */ jal get_variable
/* 0EB264 802C68B4 8C450000 */ lw $a1, ($v0)
/* 0EB268 802C68B8 0200202D */ daddu $a0, $s0, $zero
/* 0EB26C 802C68BC 0C0B1076 */ jal set_script_priority
/* 0EB270 802C68C0 0040282D */ daddu $a1, $v0, $zero
/* 0EB274 802C68C4 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB278 802C68C8 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB27C 802C68CC 24020002 */ addiu $v0, $zero, 2
/* 0EB280 802C68D0 03E00008 */ jr $ra
/* 0EB284 802C68D4 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,21 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_timescale
/* 0EB288 802C68D8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB28C 802C68DC AFB00010 */ sw $s0, 0x10($sp)
/* 0EB290 802C68E0 0080802D */ daddu $s0, $a0, $zero
/* 0EB294 802C68E4 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB298 802C68E8 8E02000C */ lw $v0, 0xc($s0)
/* 0EB29C 802C68EC 0C0B210B */ jal get_float_variable
/* 0EB2A0 802C68F0 8C450000 */ lw $a1, ($v0)
/* 0EB2A4 802C68F4 44050000 */ mfc1 $a1, $f0
/* 0EB2A8 802C68F8 0C0B1078 */ jal set_script_timescale
/* 0EB2AC 802C68FC 0200202D */ daddu $a0, $s0, $zero
/* 0EB2B0 802C6900 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB2B4 802C6904 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB2B8 802C6908 24020002 */ addiu $v0, $zero, 2
/* 0EB2BC 802C690C 03E00008 */ jr $ra
/* 0EB2C0 802C6910 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,25 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_set_var
/* 0EA0F4 802C5744 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0EA0F8 802C5748 AFB00010 */ sw $s0, 0x10($sp)
/* 0EA0FC 802C574C 0080802D */ daddu $s0, $a0, $zero
/* 0EA100 802C5750 AFBF0018 */ sw $ra, 0x18($sp)
/* 0EA104 802C5754 AFB10014 */ sw $s1, 0x14($sp)
/* 0EA108 802C5758 8E02000C */ lw $v0, 0xc($s0)
/* 0EA10C 802C575C 8C450004 */ lw $a1, 4($v0)
/* 0EA110 802C5760 0C0B1EAF */ jal get_variable
/* 0EA114 802C5764 8C510000 */ lw $s1, ($v0)
/* 0EA118 802C5768 0200202D */ daddu $a0, $s0, $zero
/* 0EA11C 802C576C 0220282D */ daddu $a1, $s1, $zero
/* 0EA120 802C5770 0C0B2026 */ jal set_variable
/* 0EA124 802C5774 0040302D */ daddu $a2, $v0, $zero
/* 0EA128 802C5778 8FBF0018 */ lw $ra, 0x18($sp)
/* 0EA12C 802C577C 8FB10014 */ lw $s1, 0x14($sp)
/* 0EA130 802C5780 8FB00010 */ lw $s0, 0x10($sp)
/* 0EA134 802C5784 24020002 */ addiu $v0, $zero, 2
/* 0EA138 802C5788 03E00008 */ jr $ra
/* 0EA13C 802C578C 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_suspend
/* 0EB3D0 802C6A20 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB3D4 802C6A24 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB3D8 802C6A28 8C82000C */ lw $v0, 0xc($a0)
/* 0EB3DC 802C6A2C 0C0B1EAF */ jal get_variable
/* 0EB3E0 802C6A30 8C450000 */ lw $a1, ($v0)
/* 0EB3E4 802C6A34 0C0B1108 */ jal suspend_all_script
/* 0EB3E8 802C6A38 0040202D */ daddu $a0, $v0, $zero
/* 0EB3EC 802C6A3C 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB3F0 802C6A40 24020002 */ addiu $v0, $zero, 2
/* 0EB3F4 802C6A44 03E00008 */ jr $ra
/* 0EB3F8 802C6A48 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_suspend_all
/* 0EB300 802C6950 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB304 802C6954 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB308 802C6958 8C82000C */ lw $v0, 0xc($a0)
/* 0EB30C 802C695C 0C0B1EAF */ jal get_variable
/* 0EB310 802C6960 8C450000 */ lw $a1, ($v0)
/* 0EB314 802C6964 0C0B117A */ jal suspend_all_group
/* 0EB318 802C6968 0040202D */ daddu $a0, $v0, $zero
/* 0EB31C 802C696C 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB320 802C6970 24020002 */ addiu $v0, $zero, 2
/* 0EB324 802C6974 03E00008 */ jr $ra
/* 0EB328 802C6978 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,21 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_suspend_others
/* 0EB358 802C69A8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB35C 802C69AC AFB00010 */ sw $s0, 0x10($sp)
/* 0EB360 802C69B0 0080802D */ daddu $s0, $a0, $zero
/* 0EB364 802C69B4 AFBF0014 */ sw $ra, 0x14($sp)
/* 0EB368 802C69B8 8E02000C */ lw $v0, 0xc($s0)
/* 0EB36C 802C69BC 0C0B1EAF */ jal get_variable
/* 0EB370 802C69C0 8C450000 */ lw $a1, ($v0)
/* 0EB374 802C69C4 0200202D */ daddu $a0, $s0, $zero
/* 0EB378 802C69C8 0C0B11AA */ jal suspend_group_others
/* 0EB37C 802C69CC 0040282D */ daddu $a1, $v0, $zero
/* 0EB380 802C69D0 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EB384 802C69D4 8FB00010 */ lw $s0, 0x10($sp)
/* 0EB388 802C69D8 24020002 */ addiu $v0, $zero, 2
/* 0EB38C 802C69DC 03E00008 */ jr $ra
/* 0EB390 802C69E0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,14 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_unbind
/* 0EB200 802C6850 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0EB204 802C6854 AFBF0010 */ sw $ra, 0x10($sp)
/* 0EB208 802C6858 0C0516FD */ jal delete_trigger
/* 0EB20C 802C685C 8C84014C */ lw $a0, 0x14c($a0)
/* 0EB210 802C6860 8FBF0010 */ lw $ra, 0x10($sp)
/* 0EB214 802C6864 24020002 */ addiu $v0, $zero, 2
/* 0EB218 802C6868 03E00008 */ jr $ra
/* 0EB21C 802C686C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -179,8 +179,8 @@ typedef struct script_context {
/* 0x003 */ u8 priority;
/* 0x004 */ u8 groupFlags;
/* 0x005 */ u8 blocked; /* 1 = blocking */
/* 0x006 */ u8 loopDepth; /* how many nested loops we are in, >= 8 hangs forever */
/* 0x007 */ u8 switchDepth; /* how many nested switches we are in, max = 8 */
/* 0x006 */ s8 loopDepth; /* how many nested loops we are in, >= 8 hangs forever */
/* 0x007 */ s8 switchDepth; /* how many nested switches we are in, max = 8 */
/* 0x008 */ bytecode* ptrNextLine;
/* 0x00C */ bytecode* ptrReadPos;
/* 0x010 */ u8 labelIndices[16];
@ -197,7 +197,7 @@ typedef struct script_context {
/* 0x0F0 */ s32 loopCounterTable[8];
/* 0x110 */ u8 switchBlockState[8];
/* 0x118 */ s32 switchBlockValue[8];
/* 0x138 */ UNK_PTR buffer;
/* 0x138 */ s32* buffer;
/* 0x13C */ UNK_PTR array;
/* 0x140 */ UNK_PTR flagArray;
/* 0x144 */ s32 uniqueID;

View File

@ -10,6 +10,8 @@ void clone_model(u16 srcModelID, u16 newModelID);
void update_collider_transform(s16 colliderID);
s32 get_variable(script_context* script, s32 pos);
f32 get_float_variable(script_context* script, s32 pos);
f32 set_float_variable(script_context* script, s32 dest, f32 value);
void set_script_timescale(script_context* script, f32 timescale);
f32 sin_deg(f32 x);
f32 cos_deg(f32 x);
s32 func_80055448(s32);

View File

@ -46,3 +46,22 @@ trigger* get_trigger_by_id(s32 triggerID) {
}
INCLUDE_ASM(code_dbd70_len_700, func_80145CE8);
/*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;
}
}
return ret;
}*/

View File

@ -68,7 +68,7 @@ INCLUDE_ASM(code_e79b0_len_1920, does_script_exist_by_ref);
INCLUDE_ASM(code_e79b0_len_1920, set_script_priority);
INCLUDE_ASM(code_e79b0_len_1920, set_script_timescale);
void INCLUDE_ASM(code_e79b0_len_1920, set_script_timescale, script_context* script, f32 timescale);
INCLUDE_ASM(code_e79b0_len_1920, set_global_timespace);

View File

@ -1,20 +1,44 @@
#include "common.h"
INCLUDE_ASM(code_e92d0_len_5da0, fixed_var_to_float);
/*f32 fixed_var_to_float(s32 scriptVar) {
if (scriptVar <= -220000000) {
return (scriptVar + 230000000) * (1 / 1024.f);
}
return scriptVar;
}*/
INCLUDE_ASM(code_e92d0_len_5da0, float_to_fixed_var);
/*s32 float_to_fixed_var(f32 arg0) {
return (s32)(arg0 * (f32)1024.0f) + -230000000;
}*/
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_return);
s32 si_handle_return(script_context* script) {
kill_script(script);
return 255;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_label);
s32 si_handle_label(script_context* script) {
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_goto);
s32 si_handle_goto(script_context* script) {
script->ptrNextLine = si_goto_label(script, get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_Loop);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_loop);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_break_loop);
s32 si_handle_break_loop(script_context* script) {
if (script->loopDepth < 0) {
while (1) {}; // todo INF_LOOP
}
script->ptrNextLine = si_goto_end_loop(script);
script->loopDepth -= 1;
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_wait);
@ -32,17 +56,58 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_less_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_greater_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_AND);
s32 si_handle_if_AND(script_context* script) {
s32 var1;
s32 *ptrReadPos = script->ptrReadPos;
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_not_AND);
var1 = ptrReadPos[0];
ptrReadPos++;
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_else);
if ((get_variable(script, var1) & *ptrReadPos) == 0) {
script->ptrNextLine = si_skip_if(script);
return 2;
}
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_if);
//INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_not_AND);
s32 si_handle_if_not_AND(script_context* script) {
s32 var1;
s32 *ptrReadPos = script->ptrReadPos;
var1 = ptrReadPos[0];
ptrReadPos++;
if ((get_variable(script, var1) & *ptrReadPos) != 0) {
script->ptrNextLine = si_skip_if(script);
return 2;
}
return 2;
}
s32 si_handle_else(script_context* script) {
script->ptrNextLine = si_skip_else(script);
return 2;
}
s32 si_handle_end_if(script_context* script) {
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_switch);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_switch_const);
/*s32 si_handle_switch_const(script_context* script) {
s32 ptrReadPos = *script->ptrReadPos;
s8 switchDepth = script->switchDepth + 1;
if (switchDepth >= 8) {
inf_loop: goto inf_loop; //todo
}
script->switchBlockValue[script->switchDepth + 1] = ptrReadPos;
script->switchBlockState[script->switchDepth + 1] = 1;
return 2;
}*/
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_equal);
@ -68,15 +133,47 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_equal_AND);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_case_group);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_break_case);
s32 si_handle_break_case(script_context* script) {
if (script->switchDepth < 0) {
while (1) {}; //todo INF_LOOP
}
script->ptrNextLine = si_goto_end_case(script);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_switch);
s32 si_handle_end_switch(script_context* script) {
s32 switchDepth = script->switchDepth;
if (switchDepth < 0) {
inf_loop: goto inf_loop; // todo macro? how to do without label
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_var);
script->switchBlockState[script->switchDepth] = 0;
script->switchDepth -= 1;
return 2;
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_const);
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_float);
s32 si_handle_set_var(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
s32 curPtrReadPos = ptrReadPos[0];
set_variable(script, curPtrReadPos, get_variable(script, ptrReadPos[1]));
return 2;
}
s32 si_handle_set_const(script_context* script) {
set_variable(script, *script->ptrReadPos, script->ptrReadPos[1]);
return 2;
}
s32 si_handle_set_float(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
s32 curPtrReadPos = ptrReadPos[0];
set_float_variable(script, curPtrReadPos, get_float_variable(script, ptrReadPos[1]));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_add);
@ -96,11 +193,23 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_multiplyF);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_divideF);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_int_buffer_ptr);
s32 si_handle_set_int_buffer_ptr(script_context* script) {
script->buffer = get_variable(script, *script->ptrReadPos);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_float_buffer_ptr);
s32 si_handle_set_float_buffer_ptr(script_context* script) {
script->buffer = get_variable(script, *script->ptrReadPos);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_1_word);
s32 si_handle_get_1_word(script_context* script) {
s32 ptrReadPos = *script->ptrReadPos;
s32 buffer = *script->buffer++;
set_variable(script, ptrReadPos, buffer);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_2_word);
@ -108,7 +217,13 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_3_word);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_4_word);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_Nth_word);
s32 si_handle_get_Nth_word(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
s32 curPtrReadPos = ptrReadPos[0];
set_variable(script, curPtrReadPos, script->buffer[get_variable(script, ptrReadPos[1])]);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_1_float);
@ -120,19 +235,47 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_4_float);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_Nth_float);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_array);
s32 si_handle_set_array(script_context* script) {
script->array = get_variable(script, *script->ptrReadPos);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_flag_array);
s32 si_handle_set_flag_array(script_context* script) {
script->flagArray = get_variable(script, *script->ptrReadPos);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_allocate_array);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_AND);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_AND_const);
//INCLUDE_ASM(code_e92d0_len_5da0, si_handle_AND_const);
s32 si_handle_AND_const(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
// todo ???
s32 temp_s0 = ptrReadPos[0];
s32 temp_s2 = ptrReadPos[0];
temp_s0 = ptrReadPos[1];
// end todo
set_variable(script, temp_s2, temp_s0 & get_variable(script, temp_s2));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_OR);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_OR_const);
//INCLUDE_ASM(code_e92d0_len_5da0, si_handle_OR_const);
s32 si_handle_OR_const(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
// todo ???
s32 temp_s0 = ptrReadPos[0];
s32 temp_s2 = ptrReadPos[0];
temp_s0 = ptrReadPos[1];
// end todo
set_variable(script, temp_s2, temp_s0 | get_variable(script, temp_s2));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_call);
@ -140,37 +283,81 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_exec1);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_exec2);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_exec_wait);
s32 si_handle_exec_wait(script_context* script) {
start_child_script(script, get_variable(script, *script->ptrReadPos), 0);
script->currentOpcode = 0;
return 0xFF;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_jump);
s32 si_handle_jump(script_context* script) {
script->ptrFirstLine = get_variable(script, *script->ptrReadPos);
restart_script(script);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, _bound_script_trigger_handler);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_bind);
INCLUDE_ASM(code_e92d0_len_5da0, DeleteTrigger);
s32 DeleteTrigger(script_context* script) {
delete_trigger(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_unbind);
s32 si_handle_unbind(script_context* script) {
delete_trigger(script->ownerID);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_kill);
s32 si_handle_kill(script_context* script) {
kill_script_by_ID(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_priority);
s32 si_handle_set_priority(script_context* script) {
set_script_priority(script, get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_timescale);
s32 si_handle_set_timescale(script_context* script) {
set_script_timescale(script, get_float_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_set_group);
s32 si_handle_set_group(script_context* script) {
set_script_group(script, get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_suspend_all);
s32 si_handle_suspend_all(script_context* script) {
suspend_all_group(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_resume_all);
s32 si_handle_resume_all(script_context* script) {
resume_all_group(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_suspend_others);
s32 si_handle_suspend_others(script_context* script) {
suspend_group_others(script, get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_resume_others);
s32 si_handle_resume_others(script_context* script) {
resume_group_others(script, get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_suspend);
s32 si_handle_suspend(script_context* script) {
suspend_all_script(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_resume);
s32 si_handle_resume(script_context* script) {
resume_all_script(get_variable(script, *script->ptrReadPos));
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_does_script_exist);
@ -178,21 +365,43 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_bind_lock);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_thread);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_thread);
s32 si_handle_end_thread(script_context* script) {
kill_script(script);
return 255;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_child_thread);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_child_thread);
s32 si_handle_end_child_thread(script_context* script) {
kill_script(script);
return 0;
}
INCLUDE_ASM(code_e92d0_len_5da0, func_802C6E14);
s32 func_802C6E14(script_context* script) {
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_print_debug_var);
INCLUDE_ASM(code_e92d0_len_5da0, func_802C739C);
s32 func_802C739C(script_context* script) {
script->ptrSavedPosition = *script->ptrReadPos;
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, func_802C73B0);
s32 func_802C73B0(script_context* script) {
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, func_802C73B8);
s32 func_802C73B8(script_context* script) {
s32 i;
for (i = 0; i < 0x80; i++) { // TODO figure out what this represents
if (script == get_script_by_index(i)) {
break;
}
}
return 1;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_execute_next_command);
@ -208,7 +417,7 @@ INCLUDE_ASM(code_e92d0_len_5da0, set_variable);
f32 INCLUDE_ASM(code_e92d0_len_5da0, get_float_variable, script_context* script, s32 pos);
INCLUDE_ASM(code_e92d0_len_5da0, set_float_variable);
f32 INCLUDE_ASM(code_e92d0_len_5da0, set_float_variable, script_context* script, s32 dest, f32 value);
INCLUDE_ASM(code_e92d0_len_5da0, si_goto_label);
@ -299,16 +508,20 @@ s32 GotoMapByID(script_context* script) {
return 1;
}
INCLUDE_ASM(code_e92d0_len_5da0, GetEntryID);
s32 GetMapID(script_context* script) {
game_status* gameStatus = *gGameStatusPtr;
set_variable(script, *script->ptrReadPos, gameStatus->mapID);
s32 GetEntryID(script_context* script) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->entryID);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, GetLoadType);
s32 GetMapID(script_context* script, s32 initialCall) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->mapID);
return 2;
}
s32 GetLoadType(script_context* script, s32 initialCall) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->loadType != 0);
return 2;
}
INCLUDE_ASM(code_e92d0_len_5da0, SetRenderMode);