Some more si functions

This commit is contained in:
Ethan Roseman 2020-08-21 23:04:10 -04:00
parent d5a453b2c1
commit 87b421e8a0
13 changed files with 109 additions and 309 deletions

View File

@ -1,29 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel SetGroupEnabled
/* 0EDCB8 802C9308 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0EDCBC 802C930C AFB10014 */ sw $s1, 0x14($sp)
/* 0EDCC0 802C9310 0080882D */ daddu $s1, $a0, $zero
/* 0EDCC4 802C9314 AFBF0018 */ sw $ra, 0x18($sp)
/* 0EDCC8 802C9318 AFB00010 */ sw $s0, 0x10($sp)
/* 0EDCCC 802C931C 8E30000C */ lw $s0, 0xc($s1)
/* 0EDCD0 802C9320 8E050000 */ lw $a1, ($s0)
/* 0EDCD4 802C9324 0C0B1EAF */ jal get_variable
/* 0EDCD8 802C9328 26100004 */ addiu $s0, $s0, 4
/* 0EDCDC 802C932C 0220202D */ daddu $a0, $s1, $zero
/* 0EDCE0 802C9330 8E050000 */ lw $a1, ($s0)
/* 0EDCE4 802C9334 0C0B1EAF */ jal get_variable
/* 0EDCE8 802C9338 0040802D */ daddu $s0, $v0, $zero
/* 0EDCEC 802C933C 3204FFFF */ andi $a0, $s0, 0xffff
/* 0EDCF0 802C9340 24050002 */ addiu $a1, $zero, 2
/* 0EDCF4 802C9344 0C046DF0 */ jal func_8011B7C0
/* 0EDCF8 802C9348 0040302D */ daddu $a2, $v0, $zero
/* 0EDCFC 802C934C 8FBF0018 */ lw $ra, 0x18($sp)
/* 0EDD00 802C9350 8FB10014 */ lw $s1, 0x14($sp)
/* 0EDD04 802C9354 8FB00010 */ lw $s0, 0x10($sp)
/* 0EDD08 802C9358 24020002 */ addiu $v0, $zero, 2
/* 0EDD0C 802C935C 03E00008 */ jr $ra
/* 0EDD10 802C9360 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,31 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_if_equal
/* 0E95F0 802C4C40 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0E95F4 802C4C44 AFB10014 */ sw $s1, 0x14($sp)
/* 0E95F8 802C4C48 0080882D */ daddu $s1, $a0, $zero
/* 0E95FC 802C4C4C AFBF0018 */ sw $ra, 0x18($sp)
/* 0E9600 802C4C50 AFB00010 */ sw $s0, 0x10($sp)
/* 0E9604 802C4C54 8E30000C */ lw $s0, 0xc($s1)
/* 0E9608 802C4C58 8E050000 */ lw $a1, ($s0)
/* 0E960C 802C4C5C 0C0B1EAF */ jal get_variable
/* 0E9610 802C4C60 26100004 */ addiu $s0, $s0, 4
/* 0E9614 802C4C64 0220202D */ daddu $a0, $s1, $zero
/* 0E9618 802C4C68 8E050000 */ lw $a1, ($s0)
/* 0E961C 802C4C6C 0C0B1EAF */ jal get_variable
/* 0E9620 802C4C70 0040802D */ daddu $s0, $v0, $zero
/* 0E9624 802C4C74 12020005 */ beq $s0, $v0, .L802C4C8C
/* 0E9628 802C4C78 24020002 */ addiu $v0, $zero, 2
/* 0E962C 802C4C7C 0C0B223F */ jal si_skip_if
/* 0E9630 802C4C80 0220202D */ daddu $a0, $s1, $zero
/* 0E9634 802C4C84 AE220008 */ sw $v0, 8($s1)
/* 0E9638 802C4C88 24020002 */ addiu $v0, $zero, 2
.L802C4C8C:
/* 0E963C 802C4C8C 8FBF0018 */ lw $ra, 0x18($sp)
/* 0E9640 802C4C90 8FB10014 */ lw $s1, 0x14($sp)
/* 0E9644 802C4C94 8FB00010 */ lw $s0, 0x10($sp)
/* 0E9648 802C4C98 03E00008 */ jr $ra
/* 0E964C 802C4C9C 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,32 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_if_greater
/* 0E9714 802C4D64 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0E9718 802C4D68 AFB10014 */ sw $s1, 0x14($sp)
/* 0E971C 802C4D6C 0080882D */ daddu $s1, $a0, $zero
/* 0E9720 802C4D70 AFBF0018 */ sw $ra, 0x18($sp)
/* 0E9724 802C4D74 AFB00010 */ sw $s0, 0x10($sp)
/* 0E9728 802C4D78 8E30000C */ lw $s0, 0xc($s1)
/* 0E972C 802C4D7C 8E050000 */ lw $a1, ($s0)
/* 0E9730 802C4D80 0C0B1EAF */ jal get_variable
/* 0E9734 802C4D84 26100004 */ addiu $s0, $s0, 4
/* 0E9738 802C4D88 0220202D */ daddu $a0, $s1, $zero
/* 0E973C 802C4D8C 8E050000 */ lw $a1, ($s0)
/* 0E9740 802C4D90 0C0B1EAF */ jal get_variable
/* 0E9744 802C4D94 0040802D */ daddu $s0, $v0, $zero
/* 0E9748 802C4D98 0050102A */ slt $v0, $v0, $s0
/* 0E974C 802C4D9C 14400005 */ bnez $v0, .L802C4DB4
/* 0E9750 802C4DA0 24020002 */ addiu $v0, $zero, 2
/* 0E9754 802C4DA4 0C0B223F */ jal si_skip_if
/* 0E9758 802C4DA8 0220202D */ daddu $a0, $s1, $zero
/* 0E975C 802C4DAC AE220008 */ sw $v0, 8($s1)
/* 0E9760 802C4DB0 24020002 */ addiu $v0, $zero, 2
.L802C4DB4:
/* 0E9764 802C4DB4 8FBF0018 */ lw $ra, 0x18($sp)
/* 0E9768 802C4DB8 8FB10014 */ lw $s1, 0x14($sp)
/* 0E976C 802C4DBC 8FB00010 */ lw $s0, 0x10($sp)
/* 0E9770 802C4DC0 03E00008 */ jr $ra
/* 0E9774 802C4DC4 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,32 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_if_greater_equal
/* 0E97DC 802C4E2C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0E97E0 802C4E30 AFB10014 */ sw $s1, 0x14($sp)
/* 0E97E4 802C4E34 0080882D */ daddu $s1, $a0, $zero
/* 0E97E8 802C4E38 AFBF0018 */ sw $ra, 0x18($sp)
/* 0E97EC 802C4E3C AFB00010 */ sw $s0, 0x10($sp)
/* 0E97F0 802C4E40 8E30000C */ lw $s0, 0xc($s1)
/* 0E97F4 802C4E44 8E050000 */ lw $a1, ($s0)
/* 0E97F8 802C4E48 0C0B1EAF */ jal get_variable
/* 0E97FC 802C4E4C 26100004 */ addiu $s0, $s0, 4
/* 0E9800 802C4E50 0220202D */ daddu $a0, $s1, $zero
/* 0E9804 802C4E54 8E050000 */ lw $a1, ($s0)
/* 0E9808 802C4E58 0C0B1EAF */ jal get_variable
/* 0E980C 802C4E5C 0040802D */ daddu $s0, $v0, $zero
/* 0E9810 802C4E60 0202802A */ slt $s0, $s0, $v0
/* 0E9814 802C4E64 12000005 */ beqz $s0, .L802C4E7C
/* 0E9818 802C4E68 24020002 */ addiu $v0, $zero, 2
/* 0E981C 802C4E6C 0C0B223F */ jal si_skip_if
/* 0E9820 802C4E70 0220202D */ daddu $a0, $s1, $zero
/* 0E9824 802C4E74 AE220008 */ sw $v0, 8($s1)
/* 0E9828 802C4E78 24020002 */ addiu $v0, $zero, 2
.L802C4E7C:
/* 0E982C 802C4E7C 8FBF0018 */ lw $ra, 0x18($sp)
/* 0E9830 802C4E80 8FB10014 */ lw $s1, 0x14($sp)
/* 0E9834 802C4E84 8FB00010 */ lw $s0, 0x10($sp)
/* 0E9838 802C4E88 03E00008 */ jr $ra
/* 0E983C 802C4E8C 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,32 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_if_less
/* 0E96B0 802C4D00 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0E96B4 802C4D04 AFB10014 */ sw $s1, 0x14($sp)
/* 0E96B8 802C4D08 0080882D */ daddu $s1, $a0, $zero
/* 0E96BC 802C4D0C AFBF0018 */ sw $ra, 0x18($sp)
/* 0E96C0 802C4D10 AFB00010 */ sw $s0, 0x10($sp)
/* 0E96C4 802C4D14 8E30000C */ lw $s0, 0xc($s1)
/* 0E96C8 802C4D18 8E050000 */ lw $a1, ($s0)
/* 0E96CC 802C4D1C 0C0B1EAF */ jal get_variable
/* 0E96D0 802C4D20 26100004 */ addiu $s0, $s0, 4
/* 0E96D4 802C4D24 0220202D */ daddu $a0, $s1, $zero
/* 0E96D8 802C4D28 8E050000 */ lw $a1, ($s0)
/* 0E96DC 802C4D2C 0C0B1EAF */ jal get_variable
/* 0E96E0 802C4D30 0040802D */ daddu $s0, $v0, $zero
/* 0E96E4 802C4D34 0202802A */ slt $s0, $s0, $v0
/* 0E96E8 802C4D38 16000005 */ bnez $s0, .L802C4D50
/* 0E96EC 802C4D3C 24020002 */ addiu $v0, $zero, 2
/* 0E96F0 802C4D40 0C0B223F */ jal si_skip_if
/* 0E96F4 802C4D44 0220202D */ daddu $a0, $s1, $zero
/* 0E96F8 802C4D48 AE220008 */ sw $v0, 8($s1)
/* 0E96FC 802C4D4C 24020002 */ addiu $v0, $zero, 2
.L802C4D50:
/* 0E9700 802C4D50 8FBF0018 */ lw $ra, 0x18($sp)
/* 0E9704 802C4D54 8FB10014 */ lw $s1, 0x14($sp)
/* 0E9708 802C4D58 8FB00010 */ lw $s0, 0x10($sp)
/* 0E970C 802C4D5C 03E00008 */ jr $ra
/* 0E9710 802C4D60 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,32 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_if_less_equal
/* 0E9778 802C4DC8 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0E977C 802C4DCC AFB10014 */ sw $s1, 0x14($sp)
/* 0E9780 802C4DD0 0080882D */ daddu $s1, $a0, $zero
/* 0E9784 802C4DD4 AFBF0018 */ sw $ra, 0x18($sp)
/* 0E9788 802C4DD8 AFB00010 */ sw $s0, 0x10($sp)
/* 0E978C 802C4DDC 8E30000C */ lw $s0, 0xc($s1)
/* 0E9790 802C4DE0 8E050000 */ lw $a1, ($s0)
/* 0E9794 802C4DE4 0C0B1EAF */ jal get_variable
/* 0E9798 802C4DE8 26100004 */ addiu $s0, $s0, 4
/* 0E979C 802C4DEC 0220202D */ daddu $a0, $s1, $zero
/* 0E97A0 802C4DF0 8E050000 */ lw $a1, ($s0)
/* 0E97A4 802C4DF4 0C0B1EAF */ jal get_variable
/* 0E97A8 802C4DF8 0040802D */ daddu $s0, $v0, $zero
/* 0E97AC 802C4DFC 0050102A */ slt $v0, $v0, $s0
/* 0E97B0 802C4E00 10400005 */ beqz $v0, .L802C4E18
/* 0E97B4 802C4E04 24020002 */ addiu $v0, $zero, 2
/* 0E97B8 802C4E08 0C0B223F */ jal si_skip_if
/* 0E97BC 802C4E0C 0220202D */ daddu $a0, $s1, $zero
/* 0E97C0 802C4E10 AE220008 */ sw $v0, 8($s1)
/* 0E97C4 802C4E14 24020002 */ addiu $v0, $zero, 2
.L802C4E18:
/* 0E97C8 802C4E18 8FBF0018 */ lw $ra, 0x18($sp)
/* 0E97CC 802C4E1C 8FB10014 */ lw $s1, 0x14($sp)
/* 0E97D0 802C4E20 8FB00010 */ lw $s0, 0x10($sp)
/* 0E97D4 802C4E24 03E00008 */ jr $ra
/* 0E97D8 802C4E28 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,31 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_if_not_equal
/* 0E9650 802C4CA0 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0E9654 802C4CA4 AFB10014 */ sw $s1, 0x14($sp)
/* 0E9658 802C4CA8 0080882D */ daddu $s1, $a0, $zero
/* 0E965C 802C4CAC AFBF0018 */ sw $ra, 0x18($sp)
/* 0E9660 802C4CB0 AFB00010 */ sw $s0, 0x10($sp)
/* 0E9664 802C4CB4 8E30000C */ lw $s0, 0xc($s1)
/* 0E9668 802C4CB8 8E050000 */ lw $a1, ($s0)
/* 0E966C 802C4CBC 0C0B1EAF */ jal get_variable
/* 0E9670 802C4CC0 26100004 */ addiu $s0, $s0, 4
/* 0E9674 802C4CC4 0220202D */ daddu $a0, $s1, $zero
/* 0E9678 802C4CC8 8E050000 */ lw $a1, ($s0)
/* 0E967C 802C4CCC 0C0B1EAF */ jal get_variable
/* 0E9680 802C4CD0 0040802D */ daddu $s0, $v0, $zero
/* 0E9684 802C4CD4 16020005 */ bne $s0, $v0, .L802C4CEC
/* 0E9688 802C4CD8 24020002 */ addiu $v0, $zero, 2
/* 0E968C 802C4CDC 0C0B223F */ jal si_skip_if
/* 0E9690 802C4CE0 0220202D */ daddu $a0, $s1, $zero
/* 0E9694 802C4CE4 AE220008 */ sw $v0, 8($s1)
/* 0E9698 802C4CE8 24020002 */ addiu $v0, $zero, 2
.L802C4CEC:
/* 0E969C 802C4CEC 8FBF0018 */ lw $ra, 0x18($sp)
/* 0E96A0 802C4CF0 8FB10014 */ lw $s1, 0x14($sp)
/* 0E96A4 802C4CF4 8FB00010 */ lw $s0, 0x10($sp)
/* 0E96A8 802C4CF8 03E00008 */ jr $ra
/* 0E96AC 802C4CFC 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,33 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_wait
/* 0E950C 802C4B5C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0E9510 802C4B60 AFB00010 */ sw $s0, 0x10($sp)
/* 0E9514 802C4B64 0080802D */ daddu $s0, $a0, $zero
/* 0E9518 802C4B68 AFBF0014 */ sw $ra, 0x14($sp)
/* 0E951C 802C4B6C 82020005 */ lb $v0, 5($s0)
/* 0E9520 802C4B70 14400006 */ bnez $v0, .L802C4B8C
/* 0E9524 802C4B74 8E05000C */ lw $a1, 0xc($s0)
/* 0E9528 802C4B78 0C0B1EAF */ jal get_variable
/* 0E952C 802C4B7C 8CA50000 */ lw $a1, ($a1)
/* 0E9530 802C4B80 AE020070 */ sw $v0, 0x70($s0)
/* 0E9534 802C4B84 24020001 */ addiu $v0, $zero, 1
/* 0E9538 802C4B88 A2020005 */ sb $v0, 5($s0)
.L802C4B8C:
/* 0E953C 802C4B8C 8E020070 */ lw $v0, 0x70($s0)
/* 0E9540 802C4B90 10400004 */ beqz $v0, .L802C4BA4
/* 0E9544 802C4B94 2442FFFF */ addiu $v0, $v0, -1
/* 0E9548 802C4B98 AE020070 */ sw $v0, 0x70($s0)
/* 0E954C 802C4B9C 080B12EA */ j .L802C4BA8
/* 0E9550 802C4BA0 2C420001 */ sltiu $v0, $v0, 1
.L802C4BA4:
/* 0E9554 802C4BA4 24020002 */ addiu $v0, $zero, 2
.L802C4BA8:
/* 0E9558 802C4BA8 8FBF0014 */ lw $ra, 0x14($sp)
/* 0E955C 802C4BAC 8FB00010 */ lw $s0, 0x10($sp)
/* 0E9560 802C4BB0 03E00008 */ jr $ra
/* 0E9564 802C4BB4 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,44 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_wait_seconds
/* 0E9568 802C4BB8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0E956C 802C4BBC AFB00010 */ sw $s0, 0x10($sp)
/* 0E9570 802C4BC0 0080802D */ daddu $s0, $a0, $zero
/* 0E9574 802C4BC4 AFBF0014 */ sw $ra, 0x14($sp)
/* 0E9578 802C4BC8 82020005 */ lb $v0, 5($s0)
/* 0E957C 802C4BCC 14400011 */ bnez $v0, .L802C4C14
/* 0E9580 802C4BD0 8E05000C */ lw $a1, 0xc($s0)
/* 0E9584 802C4BD4 0C0B210B */ jal get_float_variable
/* 0E9588 802C4BD8 8CA50000 */ lw $a1, ($a1)
/* 0E958C 802C4BDC 3C0141F0 */ lui $at, 0x41f0
/* 0E9590 802C4BE0 44811000 */ mtc1 $at, $f2
/* 0E9594 802C4BE4 00000000 */ nop
/* 0E9598 802C4BE8 46020002 */ mul.s $f0, $f0, $f2
/* 0E959C 802C4BEC 00000000 */ nop
/* 0E95A0 802C4BF0 3C013FE0 */ lui $at, 0x3fe0
/* 0E95A4 802C4BF4 44811800 */ mtc1 $at, $f3
/* 0E95A8 802C4BF8 44801000 */ mtc1 $zero, $f2
/* 0E95AC 802C4BFC 46000021 */ cvt.d.s $f0, $f0
/* 0E95B0 802C4C00 46220000 */ add.d $f0, $f0, $f2
/* 0E95B4 802C4C04 24020001 */ addiu $v0, $zero, 1
/* 0E95B8 802C4C08 A2020005 */ sb $v0, 5($s0)
/* 0E95BC 802C4C0C 4620010D */ trunc.w.d $f4, $f0
/* 0E95C0 802C4C10 E6040070 */ swc1 $f4, 0x70($s0)
.L802C4C14:
/* 0E95C4 802C4C14 8E020070 */ lw $v0, 0x70($s0)
/* 0E95C8 802C4C18 10400004 */ beqz $v0, .L802C4C2C
/* 0E95CC 802C4C1C 2442FFFF */ addiu $v0, $v0, -1
/* 0E95D0 802C4C20 AE020070 */ sw $v0, 0x70($s0)
/* 0E95D4 802C4C24 080B130C */ j .L802C4C30
/* 0E95D8 802C4C28 2C420001 */ sltiu $v0, $v0, 1
.L802C4C2C:
/* 0E95DC 802C4C2C 24020002 */ addiu $v0, $zero, 2
.L802C4C30:
/* 0E95E0 802C4C30 8FBF0014 */ lw $ra, 0x14($sp)
/* 0E95E4 802C4C34 8FB00010 */ lw $s0, 0x10($sp)
/* 0E95E8 802C4C38 03E00008 */ jr $ra
/* 0E95EC 802C4C3C 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -230,7 +230,7 @@ typedef struct ScriptInstance {
/* 0x002 */ u8 currentOpcode;
/* 0x003 */ u8 priority;
/* 0x004 */ u8 groupFlags;
/* 0x005 */ u8 blocked; /* 1 = blocking */
/* 0x005 */ s8 blocked; /* 1 = blocking */
/* 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;

View File

@ -23,6 +23,7 @@ s32 func_80055464(s32, s32);
s32 func_800554A4(s32, s32);
s32 func_800554E8(s32, s32);
s32 func_800555E4(s32);
void func_8011B7C0(u16, s32, s32);
void func_80137D88(s32, f32);
void func_80137DA4(s32, f32);
void func_80137E10(s32, u8, u8, u8);

View File

@ -178,7 +178,7 @@ INCLUDE_ASM("code_a5dd0_len_114e0", func_8011B660);
void INCLUDE_ASM("code_a5dd0_len_114e0", clone_model, u16 srcModelID, u16 newModelID);
INCLUDE_ASM("code_a5dd0_len_114e0", func_8011B7C0);
void INCLUDE_ASM("code_a5dd0_len_114e0", func_8011B7C0, u16 arg0, s32 arg1, s32 arg2);
INCLUDE_ASM("code_a5dd0_len_114e0", func_8011B950);

View File

@ -47,21 +47,102 @@ ApiStatus si_handle_break_loop(ScriptInstance* script) {
return ApiStatus_DONE2;
}
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_wait);
ApiStatus si_handle_wait(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 todo = 1; // val can be anything
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_wait_seconds);
if (!script->blocked) {
script->functionTemp[0] = get_variable(script, *ptrReadPos);
script->blocked = 1;
}
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_equal);
if (script->functionTemp[0]) {
if (todo) {
script->functionTemp[0] -= 1;
}
return !script->functionTemp[0];
}
return ApiStatus_DONE2;
}
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_not_equal);
ApiStatus si_handle_wait_seconds(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 todo = 1; // val can be anything
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_less);
if (!script->blocked) {
script->functionTemp[0] = get_float_variable(script, *ptrReadPos) * 30.0f + 0.5;
script->blocked = 1;
}
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_greater);
if (script->functionTemp[0]) {
if (todo) {
script->functionTemp[0] -= 1;
}
return !script->functionTemp[0];
}
return ApiStatus_DONE2;
}
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_less_equal);
ApiStatus si_handle_if_equal(ScriptInstance* script) {
Bytecode *thisPos = script->ptrReadPos;
if (get_variable(script, *thisPos++) != get_variable(script, *thisPos++)) {
script->ptrNextLine = si_skip_if(script);
return ApiStatus_DONE2;
}
return ApiStatus_DONE2;
}
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_if_greater_equal);
ApiStatus si_handle_if_not_equal(ScriptInstance* script) {
Bytecode *thisPos = script->ptrReadPos;
if (get_variable(script, *thisPos++) == get_variable(script, *thisPos++)) {
script->ptrNextLine = si_skip_if(script);
return ApiStatus_DONE2;
}
return ApiStatus_DONE2;
}
ApiStatus si_handle_if_less(ScriptInstance* script) {
Bytecode *thisPos = script->ptrReadPos;
if (get_variable(script, *thisPos++) >= get_variable(script, *thisPos++)) {
script->ptrNextLine = si_skip_if(script);
return ApiStatus_DONE2;
}
return ApiStatus_DONE2;
}
ApiStatus si_handle_if_greater(ScriptInstance* script) {
Bytecode *thisPos = script->ptrReadPos;
if (get_variable(script, *thisPos++) <= get_variable(script, *thisPos++)) {
script->ptrNextLine = si_skip_if(script);
return ApiStatus_DONE2;
}
return ApiStatus_DONE2;
}
ApiStatus si_handle_if_less_equal(ScriptInstance* script) {
Bytecode *thisPos = script->ptrReadPos;
if (get_variable(script, *thisPos++) > get_variable(script, *thisPos++)) {
script->ptrNextLine = si_skip_if(script);
return ApiStatus_DONE2;
}
return ApiStatus_DONE2;
}
ApiStatus si_handle_if_greater_equal(ScriptInstance* script) {
Bytecode *thisPos = script->ptrReadPos;
if (get_variable(script, *thisPos++) < get_variable(script, *thisPos++)) {
script->ptrNextLine = si_skip_if(script);
return ApiStatus_DONE2;
}
return ApiStatus_DONE2;
}
ApiStatus si_handle_if_AND(ScriptInstance* script) {
Bytecode* thisPos = script->ptrReadPos;
@ -181,6 +262,13 @@ ApiStatus si_handle_set_float(ScriptInstance* script) {
}
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_add);
/*ApiStatus si_handle_add(ScriptInstance* script) {
Bytecode* thisPos = script->ptrReadPos;
Bytecode var1 = *thisPos++;
set_variable(script, var1, get_variable(script, *thisPos++) + get_variable(script, var1));
return ApiStatus_DONE2;
}*/
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_subtract);
@ -561,8 +649,8 @@ INCLUDE_API_ASM("code_e92d0_len_5da0", GetModelIndex);
ApiStatus CloneModel(ScriptInstance* script, s32 isInitialCall) {
Bytecode* thisPos = script->ptrReadPos;
s32 srcModelID = get_variable(script, *thisPos++);
s32 newModelID = get_variable(script, *thisPos++);
Bytecode srcModelID = get_variable(script, *thisPos++);
Bytecode newModelID = get_variable(script, *thisPos++);
clone_model(srcModelID, newModelID);
return ApiStatus_DONE2;
@ -578,7 +666,14 @@ INCLUDE_API_ASM("code_e92d0_len_5da0", EnableTexPanning);
INCLUDE_API_ASM("code_e92d0_len_5da0", EnableModel);
INCLUDE_API_ASM("code_e92d0_len_5da0", SetGroupEnabled);
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_API_ASM("code_e92d0_len_5da0", SetTexPanOffset);