Merge branch 'master' into Testing

This commit is contained in:
JoshDuMan 2020-09-21 01:51:52 -04:00 committed by GitHub
commit 0a3874a0d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 883 additions and 945 deletions

View File

@ -5,7 +5,6 @@
"files.insertFinalNewline": true, "files.insertFinalNewline": true,
"editor.rulers": [120], "editor.rulers": [120],
"clang-tidy.compilerArgs": [ "clang-tidy.compilerArgs": [
"-fno-builtin",
"-std=gnu89", "-std=gnu89",
"-Iinclude", "-Iinclude",
"-Iinclude/PR", "-Iinclude/PR",

View File

@ -45,10 +45,10 @@ OBJCOPY = $(CROSS)objcopy
TARGET = papermario TARGET = papermario
CPPFLAGS = -fno-builtin -Iinclude -D _LANGUAGE_C -ffreestanding -DF3DEX_GBI_2 CPPFLAGS = -Iinclude -D _LANGUAGE_C -ffreestanding -DF3DEX_GBI_2
ASFLAGS = -EB -Iinclude -march=vr4300 -mtune=vr4300 ASFLAGS = -EB -Iinclude -march=vr4300 -mtune=vr4300
OLDASFLAGS = -EB -Iinclude OLDASFLAGS = -EB -Iinclude
CFLAGS = -fno-builtin -O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 CFLAGS = -O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32
LDFLAGS = -T undefined_syms.txt -T $(LD_SCRIPT) -Map $(BUILD_DIR)/papermario.map --no-check-sections LDFLAGS = -T undefined_syms.txt -T $(LD_SCRIPT) -Map $(BUILD_DIR)/papermario.map --no-check-sections
######################## Targets ############################# ######################## Targets #############################

View File

@ -76,8 +76,6 @@ Decide on a function to match. These can be found in the subdirectories of `asm/
Take the relevant `.s` file and pass it to [mips_to_c](https://github.com/matt-kempster/mips_to_c) ([web version](https://simonsoftware.se/other/mips_to_c.py)). Take the relevant `.s` file and pass it to [mips_to_c](https://github.com/matt-kempster/mips_to_c) ([web version](https://simonsoftware.se/other/mips_to_c.py)).
If mips_to_c gives you an error about branch-likely instructions, edit the `.s` file and rename any branch-likely instructions to their unlikely equivalent (i.e. remove the `l` suffix). Add a `nop` after the branches and move the instruction that was originally in the delay slot (directly after the branch instruction) to the start of the target label. Don't commit the edited assembly.
Open up the relevant `.c` file and replace the function's `INCLUDE_ASM` macro with the output from mips_to_c. Run the following command to attempt to compile, replacing `function_name` with the name of the function you're working with: Open up the relevant `.c` file and replace the function's `INCLUDE_ASM` macro with the output from mips_to_c. Run the following command to attempt to compile, replacing `function_name` with the name of the function you're working with:
```sh ```sh

View File

@ -1,60 +1,7 @@
.set noat # allow manual use of $at .set noat # allow manual use of $at
.set noreorder # don't insert nops after branches .set noreorder # don't insert nops after branches
glabel func_8005DECC
glabel get_npc_pos
/* 039210 8005DE10 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 039214 8005DE14 AFB00010 */ sw $s0, 0x10($sp)
/* 039218 8005DE18 00A0802D */ daddu $s0, $a1, $zero
/* 03921C 8005DE1C AFB10014 */ sw $s1, 0x14($sp)
/* 039220 8005DE20 00C0882D */ daddu $s1, $a2, $zero
/* 039224 8005DE24 AFB20018 */ sw $s2, 0x18($sp)
/* 039228 8005DE28 00E0902D */ daddu $s2, $a3, $zero
/* 03922C 8005DE2C 3C038011 */ lui $v1, 0x8011
/* 039230 8005DE30 2463EFC8 */ addiu $v1, $v1, -0x1038
/* 039234 8005DE34 AFB3001C */ sw $s3, 0x1c($sp)
/* 039238 8005DE38 8FB30038 */ lw $s3, 0x38($sp)
/* 03923C 8005DE3C 2402FFFF */ addiu $v0, $zero, -1
/* 039240 8005DE40 AFBF0020 */ sw $ra, 0x20($sp)
/* 039244 8005DE44 AE000000 */ sw $zero, ($s0)
/* 039248 8005DE48 AE200000 */ sw $zero, ($s1)
/* 03924C 8005DE4C AE400000 */ sw $zero, ($s2)
/* 039250 8005DE50 1482000A */ bne $a0, $v0, .L8005DE7C
/* 039254 8005DE54 AE600000 */ sw $zero, ($s3)
/* 039258 8005DE58 C4600028 */ lwc1 $f0, 0x28($v1)
/* 03925C 8005DE5C E6000000 */ swc1 $f0, ($s0)
/* 039260 8005DE60 C460002C */ lwc1 $f0, 0x2c($v1)
/* 039264 8005DE64 E6200000 */ swc1 $f0, ($s1)
/* 039268 8005DE68 C4600030 */ lwc1 $f0, 0x30($v1)
/* 03926C 8005DE6C E6400000 */ swc1 $f0, ($s2)
/* 039270 8005DE70 8C620000 */ lw $v0, ($v1)
/* 039274 8005DE74 080177A9 */ j .L8005DEA4
/* 039278 8005DE78 30420006 */ andi $v0, $v0, 6
.L8005DE7C:
/* 03927C 8005DE7C 0C00EABB */ jal get_npc_unsafe
/* 039280 8005DE80 00000000 */ nop
/* 039284 8005DE84 C4400038 */ lwc1 $f0, 0x38($v0)
/* 039288 8005DE88 E6000000 */ swc1 $f0, ($s0)
/* 03928C 8005DE8C C440003C */ lwc1 $f0, 0x3c($v0)
/* 039290 8005DE90 E6200000 */ swc1 $f0, ($s1)
/* 039294 8005DE94 C4400040 */ lwc1 $f0, 0x40($v0)
/* 039298 8005DE98 E6400000 */ swc1 $f0, ($s2)
/* 03929C 8005DE9C 8C420000 */ lw $v0, ($v0)
/* 0392A0 8005DEA0 30420800 */ andi $v0, $v0, 0x800
.L8005DEA4:
/* 0392A4 8005DEA4 10400002 */ beqz $v0, .L8005DEB0
/* 0392A8 8005DEA8 24020001 */ addiu $v0, $zero, 1
/* 0392AC 8005DEAC AE620000 */ sw $v0, ($s3)
.L8005DEB0:
/* 0392B0 8005DEB0 8FBF0020 */ lw $ra, 0x20($sp)
/* 0392B4 8005DEB4 8FB3001C */ lw $s3, 0x1c($sp)
/* 0392B8 8005DEB8 8FB20018 */ lw $s2, 0x18($sp)
/* 0392BC 8005DEBC 8FB10014 */ lw $s1, 0x14($sp)
/* 0392C0 8005DEC0 8FB00010 */ lw $s0, 0x10($sp)
/* 0392C4 8005DEC4 03E00008 */ jr $ra
/* 0392C8 8005DEC8 27BD0028 */ addiu $sp, $sp, 0x28
/* 0392CC 8005DECC 27BDFFD0 */ addiu $sp, $sp, -0x30 /* 0392CC 8005DECC 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 0392D0 8005DED0 AFB10014 */ sw $s1, 0x14($sp) /* 0392D0 8005DED0 AFB10014 */ sw $s1, 0x14($sp)
/* 0392D4 8005DED4 0080882D */ daddu $s1, $a0, $zero /* 0392D4 8005DED4 0080882D */ daddu $s1, $a0, $zero
@ -741,5 +688,3 @@ glabel get_npc_pos
/* 039CA8 8005E8A8 00000000 */ nop /* 039CA8 8005E8A8 00000000 */ nop
/* 039CAC 8005E8AC 00000000 */ nop /* 039CAC 8005E8AC 00000000 */ nop

View File

@ -1,19 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel _advance_rng
/* 004D00 80029900 3C035D58 */ lui $v1, 0x5d58
/* 004D04 80029904 3C048007 */ lui $a0, 0x8007
/* 004D08 80029908 24844410 */ addiu $a0, $a0, 0x4410
/* 004D0C 8002990C 8C820000 */ lw $v0, ($a0)
/* 004D10 80029910 34638B65 */ ori $v1, $v1, 0x8b65
/* 004D14 80029914 00430018 */ mult $v0, $v1
/* 004D18 80029918 3C038007 */ lui $v1, 0x8007
/* 004D1C 8002991C 8C63419C */ lw $v1, 0x419c($v1)
/* 004D20 80029920 00002812 */ mflo $a1
/* 004D24 80029924 24A20001 */ addiu $v0, $a1, 1
/* 004D28 80029928 AC820000 */ sw $v0, ($a0)
/* 004D2C 8002992C 03E00008 */ jr $ra
/* 004D30 80029930 AC620138 */ sw $v0, 0x138($v1)

View File

@ -1,13 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel copy_matrix
/* 004B20 80029720 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 004B24 80029724 AFBF0010 */ sw $ra, 0x10($sp)
/* 004B28 80029728 0C019194 */ jal bcopy
/* 004B2C 8002972C 24060040 */ addiu $a2, $zero, 0x40
/* 004B30 80029730 8FBF0010 */ lw $ra, 0x10($sp)
/* 004B34 80029734 03E00008 */ jr $ra
/* 004B38 80029738 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 dist2D
/* 0052D4 80029ED4 44861000 */ mtc1 $a2, $f2
/* 0052D8 80029ED8 00000000 */ nop
/* 0052DC 80029EDC 460C1301 */ sub.s $f12, $f2, $f12
/* 0052E0 80029EE0 460C6302 */ mul.s $f12, $f12, $f12
/* 0052E4 80029EE4 00000000 */ nop
/* 0052E8 80029EE8 44871000 */ mtc1 $a3, $f2
/* 0052EC 80029EEC 00000000 */ nop
/* 0052F0 80029EF0 460E1381 */ sub.s $f14, $f2, $f14
/* 0052F4 80029EF4 460E7382 */ mul.s $f14, $f14, $f14
/* 0052F8 80029EF8 00000000 */ nop
/* 0052FC 80029EFC 460E6300 */ add.s $f12, $f12, $f14
/* 005300 80029F00 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 005304 80029F04 46006004 */ sqrt.s $f0, $f12
/* 005308 80029F08 46000032 */ c.eq.s $f0, $f0
/* 00530C 80029F0C 00000000 */ nop
/* 005310 80029F10 45010003 */ bc1t .L80029F20
/* 005314 80029F14 AFBF0010 */ sw $ra, 0x10($sp)
/* 005318 80029F18 0C0187BC */ jal sqrtf
/* 00531C 80029F1C 00000000 */ nop
.L80029F20:
/* 005320 80029F20 8FBF0010 */ lw $ra, 0x10($sp)
/* 005324 80029F24 03E00008 */ jr $ra
/* 005328 80029F28 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,35 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel dist3D
/* 00532C 80029F2C 44872000 */ mtc1 $a3, $f4
/* 005330 80029F30 00000000 */ nop
/* 005334 80029F34 460C2301 */ sub.s $f12, $f4, $f12
/* 005338 80029F38 460C6302 */ mul.s $f12, $f12, $f12
/* 00533C 80029F3C 00000000 */ nop
/* 005340 80029F40 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 005344 80029F44 C7A20028 */ lwc1 $f2, 0x28($sp)
/* 005348 80029F48 460E1081 */ sub.s $f2, $f2, $f14
/* 00534C 80029F4C 46021082 */ mul.s $f2, $f2, $f2
/* 005350 80029F50 00000000 */ nop
/* 005354 80029F54 C7A0002C */ lwc1 $f0, 0x2c($sp)
/* 005358 80029F58 44862000 */ mtc1 $a2, $f4
/* 00535C 80029F5C 00000000 */ nop
/* 005360 80029F60 46040001 */ sub.s $f0, $f0, $f4
/* 005364 80029F64 46000002 */ mul.s $f0, $f0, $f0
/* 005368 80029F68 00000000 */ nop
/* 00536C 80029F6C 46026300 */ add.s $f12, $f12, $f2
/* 005370 80029F70 46006300 */ add.s $f12, $f12, $f0
/* 005374 80029F74 46006004 */ sqrt.s $f0, $f12
/* 005378 80029F78 46000032 */ c.eq.s $f0, $f0
/* 00537C 80029F7C 00000000 */ nop
/* 005380 80029F80 45010003 */ bc1t .L80029F90
/* 005384 80029F84 AFBF0010 */ sw $ra, 0x10($sp)
/* 005388 80029F88 0C0187BC */ jal sqrtf
/* 00538C 80029F8C 00000000 */ nop
.L80029F90:
/* 005390 80029F90 8FBF0010 */ lw $ra, 0x10($sp)
/* 005394 80029F94 03E00008 */ jr $ra
/* 005398 80029F98 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,31 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_clamped_angle_diff
/* 005028 80029C28 460C7001 */ sub.s $f0, $f14, $f12
/* 00502C 80029C2C 3C014334 */ lui $at, 0x4334
/* 005030 80029C30 44811000 */ mtc1 $at, $f2
/* 005034 80029C34 46000005 */ abs.s $f0, $f0
/* 005038 80029C38 4600103E */ c.le.s $f2, $f0
/* 00503C 80029C3C 00000000 */ nop
/* 005040 80029C40 4500000D */ bc1f .L80029C78
/* 005044 80029C44 00000000 */ nop
/* 005048 80029C48 460C703C */ c.lt.s $f14, $f12
/* 00504C 80029C4C 00000000 */ nop
/* 005050 80029C50 45000005 */ bc1f .L80029C68
/* 005054 80029C54 00000000 */ nop
/* 005058 80029C58 3C0143B4 */ lui $at, 0x43b4
/* 00505C 80029C5C 44810000 */ mtc1 $at, $f0
/* 005060 80029C60 0800A71E */ j .L80029C78
/* 005064 80029C64 46007380 */ add.s $f14, $f14, $f0
.L80029C68:
/* 005068 80029C68 3C0143B4 */ lui $at, 0x43b4
/* 00506C 80029C6C 44810000 */ mtc1 $at, $f0
/* 005070 80029C70 00000000 */ nop
/* 005074 80029C74 46007381 */ sub.s $f14, $f14, $f0
.L80029C78:
/* 005078 80029C78 03E00008 */ jr $ra
/* 00507C 80029C7C 460C7001 */ sub.s $f0, $f14, $f12

View File

@ -1,18 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_player_normal_yaw
/* 005220 80029E20 44806000 */ mtc1 $zero, $f12
/* 005224 80029E24 3C028007 */ lui $v0, 0x8007
/* 005228 80029E28 8C42419C */ lw $v0, 0x419c($v0)
/* 00522C 80029E2C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 005230 80029E30 AFBF0010 */ sw $ra, 0x10($sp)
/* 005234 80029E34 8C460128 */ lw $a2, 0x128($v0)
/* 005238 80029E38 8C470130 */ lw $a3, 0x130($v0)
/* 00523C 80029E3C 0C00A720 */ jal atan2
/* 005240 80029E40 46006386 */ mov.s $f14, $f12
/* 005244 80029E44 8FBF0010 */ lw $ra, 0x10($sp)
/* 005248 80029E48 03E00008 */ jr $ra
/* 00524C 80029E4C 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 length2D
/* 0043F0 80028FF0 460C6302 */ mul.s $f12, $f12, $f12
/* 0043F4 80028FF4 00000000 */ nop
/* 0043F8 80028FF8 460E7382 */ mul.s $f14, $f14, $f14
/* 0043FC 80028FFC 00000000 */ nop
/* 004400 80029000 460E6300 */ add.s $f12, $f12, $f14
/* 004404 80029004 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 004408 80029008 46006004 */ sqrt.s $f0, $f12
/* 00440C 8002900C 46000032 */ c.eq.s $f0, $f0
/* 004410 80029010 00000000 */ nop
/* 004414 80029014 45010003 */ bc1t .L80029024
/* 004418 80029018 AFBF0010 */ sw $ra, 0x10($sp)
/* 00441C 8002901C 0C0187BC */ jal sqrtf
/* 004420 80029020 00000000 */ nop
.L80029024:
/* 004424 80029024 8FBF0010 */ lw $ra, 0x10($sp)
/* 004428 80029028 03E00008 */ jr $ra
/* 00442C 8002902C 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 mem_clear
/* 004A00 80029600 18A00005 */ blez $a1, .L80029618
/* 004A04 80029604 00000000 */ nop
.L80029608:
/* 004A08 80029608 A0800000 */ sb $zero, ($a0)
/* 004A0C 8002960C 24A5FFFF */ addiu $a1, $a1, -1
/* 004A10 80029610 1CA0FFFD */ bgtz $a1, .L80029608
/* 004A14 80029614 24840001 */ addiu $a0, $a0, 1
.L80029618:
/* 004A18 80029618 03E00008 */ jr $ra
/* 004A1C 8002961C 00000000 */ nop

View File

@ -1,16 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel poll_rumble
/* 0042E0 80028EE0 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0042E4 80028EE4 AFBF0010 */ sw $ra, 0x10($sp)
/* 0042E8 80028EE8 0C017FBC */ jal nuContRmbCheck
/* 0042EC 80028EEC 0000202D */ daddu $a0, $zero, $zero
/* 0042F0 80028EF0 0000202D */ daddu $a0, $zero, $zero
/* 0042F4 80028EF4 0C017FE4 */ jal nuContRmbModeSet
/* 0042F8 80028EF8 24050002 */ addiu $a1, $zero, 2
/* 0042FC 80028EFC 8FBF0010 */ lw $ra, 0x10($sp)
/* 004300 80028F00 03E00008 */ jr $ra
/* 004304 80028F04 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,12 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel sign
/* 0048B0 800294B0 04800002 */ bltz $a0, .L800294BC
/* 0048B4 800294B4 2402FFFF */ addiu $v0, $zero, -1
/* 0048B8 800294B8 0004102A */ slt $v0, $zero, $a0
.L800294BC:
/* 0048BC 800294BC 03E00008 */ jr $ra
/* 0048C0 800294C0 00000000 */ nop

View File

@ -1,27 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel signF
/* 004E7C 80029A7C 44801000 */ mtc1 $zero, $f2
/* 004E80 80029A80 00000000 */ nop
/* 004E84 80029A84 460C103C */ c.lt.s $f2, $f12
/* 004E88 80029A88 00000000 */ nop
/* 004E8C 80029A8C 45010009 */ bc1t .L80029AB4
/* 004E90 80029A90 00000000 */ nop
/* 004E94 80029A94 3C01BF80 */ lui $at, 0xbf80
/* 004E98 80029A98 44810000 */ mtc1 $at, $f0
/* 004E9C 80029A9C 4602603C */ c.lt.s $f12, $f2
/* 004EA0 80029AA0 00000000 */ nop
/* 004EA4 80029AA4 45010005 */ bc1t .L80029ABC
/* 004EA8 80029AA8 00000000 */ nop
/* 004EAC 80029AAC 03E00008 */ jr $ra
/* 004EB0 80029AB0 46001006 */ mov.s $f0, $f2
.L80029AB4:
/* 004EB4 80029AB4 3C013F80 */ lui $at, 0x3f80
/* 004EB8 80029AB8 44810000 */ mtc1 $at, $f0
.L80029ABC:
/* 004EBC 80029ABC 03E00008 */ jr $ra
/* 004EC0 80029AC0 00000000 */ nop

View File

@ -1,13 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_entity_by_index
/* 0A6CE8 801105E8 30840FFF */ andi $a0, $a0, 0xfff
/* 0A6CEC 801105EC 3C028015 */ lui $v0, 0x8015
/* 0A6CF0 801105F0 8C421470 */ lw $v0, 0x1470($v0)
/* 0A6CF4 801105F4 00042080 */ sll $a0, $a0, 2
/* 0A6CF8 801105F8 00822021 */ addu $a0, $a0, $v0
/* 0A6CFC 801105FC 03E00008 */ jr $ra
/* 0A6D00 80110600 8C820000 */ lw $v0, ($a0)

View File

@ -1,18 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_entity_list
/* 0A6D20 80110620 3C028007 */ lui $v0, 0x8007
/* 0A6D24 80110624 8C42419C */ lw $v0, 0x419c($v0)
/* 0A6D28 80110628 80420070 */ lb $v0, 0x70($v0)
/* 0A6D2C 8011062C 3C038015 */ lui $v1, 0x8015
/* 0A6D30 80110630 246313F8 */ addiu $v1, $v1, 0x13f8
/* 0A6D34 80110634 14400003 */ bnez $v0, .L80110644
/* 0A6D38 80110638 00000000 */ nop
/* 0A6D3C 8011063C 3C038015 */ lui $v1, 0x8015
/* 0A6D40 80110640 24631380 */ addiu $v1, $v1, 0x1380
.L80110644:
/* 0A6D44 80110644 03E00008 */ jr $ra
/* 0A6D48 80110648 0060102D */ daddu $v0, $v1, $zero

View File

@ -1,12 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_model_from_list_index
/* 0B1430 8011AD30 3C028015 */ lui $v0, 0x8015
/* 0B1434 8011AD34 8C4212CC */ lw $v0, 0x12cc($v0)
/* 0B1438 8011AD38 00042080 */ sll $a0, $a0, 2
/* 0B143C 8011AD3C 00822021 */ addu $a0, $a0, $v0
/* 0B1440 8011AD40 03E00008 */ jr $ra
/* 0B1444 8011AD44 8C820000 */ lw $v0, ($a0)

View File

@ -1,13 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_shadow_by_index
/* 0A6D04 80110604 30840FFF */ andi $a0, $a0, 0xfff
/* 0A6D08 80110608 3C028015 */ lui $v0, 0x8015
/* 0A6D0C 8011060C 8C421658 */ lw $v0, 0x1658($v0)
/* 0A6D10 80110610 00042080 */ sll $a0, $a0, 2
/* 0A6D14 80110614 00822021 */ addu $a0, $a0, $v0
/* 0A6D18 80110618 03E00008 */ jr $ra
/* 0A6D1C 8011061C 8C820000 */ lw $v0, ($a0)

View File

@ -1,18 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_shadow_list
/* 0A6D4C 8011064C 3C028007 */ lui $v0, 0x8007
/* 0A6D50 80110650 8C42419C */ lw $v0, 0x419c($v0)
/* 0A6D54 80110654 80420070 */ lb $v0, 0x70($v0)
/* 0A6D58 80110658 3C038015 */ lui $v1, 0x8015
/* 0A6D5C 8011065C 24631568 */ addiu $v1, $v1, 0x1568
/* 0A6D60 80110660 14400003 */ bnez $v0, .L80110670
/* 0A6D64 80110664 00000000 */ nop
/* 0A6D68 80110668 3C038015 */ lui $v1, 0x8015
/* 0A6D6C 8011066C 24631478 */ addiu $v1, $v1, 0x1478
.L80110670:
/* 0A6D70 80110670 03E00008 */ jr $ra
/* 0A6D74 80110674 0060102D */ daddu $v0, $v1, $zero

View File

@ -1,13 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel is_player_action_state
/* 0A72B0 80110BB0 00041600 */ sll $v0, $a0, 0x18
/* 0A72B4 80110BB4 3C038011 */ lui $v1, 0x8011
/* 0A72B8 80110BB8 8063F07C */ lb $v1, -0xf84($v1)
/* 0A72BC 80110BBC 00021603 */ sra $v0, $v0, 0x18
/* 0A72C0 80110BC0 00431026 */ xor $v0, $v0, $v1
/* 0A72C4 80110BC4 03E00008 */ jr $ra
/* 0A72C8 80110BC8 2C420001 */ sltiu $v0, $v0, 1

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel set_tex_panner
/* 0B2314 8011BC14 03E00008 */ jr $ra
/* 0B2318 8011BC18 A08500A4 */ sb $a1, 0xa4($a0)

View File

@ -2,7 +2,7 @@
.set noreorder # don't insert nops after branches .set noreorder # don't insert nops after branches
glabel set_fog_color glabel set_world_fog_color
/* 0B2288 8011BB88 3C028015 */ lui $v0, 0x8015 /* 0B2288 8011BB88 3C028015 */ lui $v0, 0x8015
/* 0B228C 8011BB8C 8C423264 */ lw $v0, 0x3264($v0) /* 0B228C 8011BB8C 8C423264 */ lw $v0, 0x3264($v0)
/* 0B2290 8011BB90 AC440004 */ sw $a0, 4($v0) /* 0B2290 8011BB90 AC440004 */ sw $a0, 4($v0)

View File

@ -1,16 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_area_byte
/* 0DBD50 80145650 3C02800E */ lui $v0, 0x800e
/* 0DBD54 80145654 00441021 */ addu $v0, $v0, $a0
/* 0DBD58 80145658 8042BF90 */ lb $v0, -0x4070($v0)
/* 0DBD5C 8014565C 03E00008 */ jr $ra
/* 0DBD60 80145660 00000000 */ nop
/* 0DBD64 80145664 00000000 */ nop
/* 0DBD68 80145668 00000000 */ nop
/* 0DBD6C 8014566C 00000000 */ nop

View File

@ -1,26 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_area_flag
/* 0DBCF0 801455F0 0080102D */ daddu $v0, $a0, $zero
/* 0DBCF4 801455F4 04410002 */ bgez $v0, .L80145600
/* 0DBCF8 801455F8 0040182D */ daddu $v1, $v0, $zero
/* 0DBCFC 801455FC 2443001F */ addiu $v1, $v0, 0x1f
.L80145600:
/* 0DBD00 80145600 00031943 */ sra $v1, $v1, 5
/* 0DBD04 80145604 00032140 */ sll $a0, $v1, 5
/* 0DBD08 80145608 00442023 */ subu $a0, $v0, $a0
/* 0DBD0C 8014560C 00031880 */ sll $v1, $v1, 2
/* 0DBD10 80145610 24020001 */ addiu $v0, $zero, 1
/* 0DBD14 80145614 3C01800E */ lui $at, 0x800e
/* 0DBD18 80145618 00230821 */ addu $at, $at, $v1
/* 0DBD1C 8014561C 8C23BF70 */ lw $v1, -0x4090($at)
/* 0DBD20 80145620 00821004 */ sllv $v0, $v0, $a0
/* 0DBD24 80145624 00621024 */ and $v0, $v1, $v0
/* 0DBD28 80145628 54400001 */ bnel $v0, $zero, .L80145630
/* 0DBD2C 8014562C 24020001 */ addiu $v0, $zero, 1
.L80145630:
/* 0DBD30 80145630 03E00008 */ jr $ra
/* 0DBD34 80145634 00000000 */ nop

View File

@ -1,11 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel get_global_byte
/* 0DBC38 80145538 3C02800E */ lui $v0, 0x800e
/* 0DBC3C 8014553C 00441021 */ addu $v0, $v0, $a0
/* 0DBC40 80145540 8042BD70 */ lb $v0, -0x4290($v0)
/* 0DBC44 80145544 03E00008 */ jr $ra
/* 0DBC48 80145548 00000000 */ nop

View File

@ -1,12 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel set_area_byte
/* 0DBD38 80145638 3C02800E */ lui $v0, 0x800e
/* 0DBD3C 8014563C 2442ACC0 */ addiu $v0, $v0, -0x5340
/* 0DBD40 80145640 00822021 */ addu $a0, $a0, $v0
/* 0DBD44 80145644 808212D0 */ lb $v0, 0x12d0($a0)
/* 0DBD48 80145648 03E00008 */ jr $ra
/* 0DBD4C 8014564C A08512D0 */ sb $a1, 0x12d0($a0)

View File

@ -1,12 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel set_global_byte
/* 0DBC20 80145520 3C02800E */ lui $v0, 0x800e
/* 0DBC24 80145524 2442ACC0 */ addiu $v0, $v0, -0x5340
/* 0DBC28 80145528 00822021 */ addu $a0, $a0, $v0
/* 0DBC2C 8014552C 808210B0 */ lb $v0, 0x10b0($a0)
/* 0DBC30 80145530 03E00008 */ jr $ra
/* 0DBC34 80145534 A08510B0 */ sb $a1, 0x10b0($a0)

View File

@ -1,41 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel EnableModel
/* 0EDC38 802C9288 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0EDC3C 802C928C AFB10014 */ sw $s1, 0x14($sp)
/* 0EDC40 802C9290 0080882D */ daddu $s1, $a0, $zero
/* 0EDC44 802C9294 AFBF0018 */ sw $ra, 0x18($sp)
/* 0EDC48 802C9298 AFB00010 */ sw $s0, 0x10($sp)
/* 0EDC4C 802C929C 8E30000C */ lw $s0, 0xc($s1)
/* 0EDC50 802C92A0 8E050000 */ lw $a1, ($s0)
/* 0EDC54 802C92A4 0C0B1EAF */ jal get_variable
/* 0EDC58 802C92A8 26100004 */ addiu $s0, $s0, 4
/* 0EDC5C 802C92AC 0C046C04 */ jal get_model_list_index_from_tree_index
/* 0EDC60 802C92B0 0040202D */ daddu $a0, $v0, $zero
/* 0EDC64 802C92B4 0220202D */ daddu $a0, $s1, $zero
/* 0EDC68 802C92B8 8E050000 */ lw $a1, ($s0)
/* 0EDC6C 802C92BC 0C0B1EAF */ jal get_variable
/* 0EDC70 802C92C0 0040802D */ daddu $s0, $v0, $zero
/* 0EDC74 802C92C4 0200202D */ daddu $a0, $s0, $zero
/* 0EDC78 802C92C8 0C046B4C */ jal get_model_from_list_index
/* 0EDC7C 802C92CC 0040802D */ daddu $s0, $v0, $zero
/* 0EDC80 802C92D0 12000004 */ beqz $s0, .L802C92E4
/* 0EDC84 802C92D4 0040182D */ daddu $v1, $v0, $zero
/* 0EDC88 802C92D8 94620000 */ lhu $v0, ($v1)
/* 0EDC8C 802C92DC 080B24BB */ j .L802C92EC
/* 0EDC90 802C92E0 3042FFFD */ andi $v0, $v0, 0xfffd
.L802C92E4:
/* 0EDC94 802C92E4 94620000 */ lhu $v0, ($v1)
/* 0EDC98 802C92E8 34420002 */ ori $v0, $v0, 2
.L802C92EC:
/* 0EDC9C 802C92EC A4620000 */ sh $v0, ($v1)
/* 0EDCA0 802C92F0 8FBF0018 */ lw $ra, 0x18($sp)
/* 0EDCA4 802C92F4 8FB10014 */ lw $s1, 0x14($sp)
/* 0EDCA8 802C92F8 8FB00010 */ lw $s0, 0x10($sp)
/* 0EDCAC 802C92FC 24020002 */ addiu $v0, $zero, 2
/* 0EDCB0 802C9300 03E00008 */ jr $ra
/* 0EDCB4 802C9304 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,38 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel GetModelCenter
/* 0ED930 802C8F80 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 0ED934 802C8F84 AFB00038 */ sw $s0, 0x38($sp)
/* 0ED938 802C8F88 0080802D */ daddu $s0, $a0, $zero
/* 0ED93C 802C8F8C AFBF003C */ sw $ra, 0x3c($sp)
/* 0ED940 802C8F90 8E02000C */ lw $v0, 0xc($s0)
/* 0ED944 802C8F94 0C0B1EAF */ jal get_variable
/* 0ED948 802C8F98 8C450000 */ lw $a1, ($v0)
/* 0ED94C 802C8F9C 3044FFFF */ andi $a0, $v0, 0xffff
/* 0ED950 802C8FA0 27A50020 */ addiu $a1, $sp, 0x20
/* 0ED954 802C8FA4 27A2002C */ addiu $v0, $sp, 0x2c
/* 0ED958 802C8FA8 AFA20010 */ sw $v0, 0x10($sp)
/* 0ED95C 802C8FAC 27A20030 */ addiu $v0, $sp, 0x30
/* 0ED960 802C8FB0 AFA20014 */ sw $v0, 0x14($sp)
/* 0ED964 802C8FB4 27A20034 */ addiu $v0, $sp, 0x34
/* 0ED968 802C8FB8 27A60024 */ addiu $a2, $sp, 0x24
/* 0ED96C 802C8FBC 27A70028 */ addiu $a3, $sp, 0x28
/* 0ED970 802C8FC0 0C046C3B */ jal get_model_center_and_size
/* 0ED974 802C8FC4 AFA20018 */ sw $v0, 0x18($sp)
/* 0ED978 802C8FC8 C7A00020 */ lwc1 $f0, 0x20($sp)
/* 0ED97C 802C8FCC 4600010D */ trunc.w.s $f4, $f0
/* 0ED980 802C8FD0 E6040084 */ swc1 $f4, 0x84($s0)
/* 0ED984 802C8FD4 C7A00024 */ lwc1 $f0, 0x24($sp)
/* 0ED988 802C8FD8 C7A20028 */ lwc1 $f2, 0x28($sp)
/* 0ED98C 802C8FDC 4600010D */ trunc.w.s $f4, $f0
/* 0ED990 802C8FE0 E6040088 */ swc1 $f4, 0x88($s0)
/* 0ED994 802C8FE4 4600110D */ trunc.w.s $f4, $f2
/* 0ED998 802C8FE8 E604008C */ swc1 $f4, 0x8c($s0)
/* 0ED99C 802C8FEC 8FBF003C */ lw $ra, 0x3c($sp)
/* 0ED9A0 802C8FF0 8FB00038 */ lw $s0, 0x38($sp)
/* 0ED9A4 802C8FF4 24020002 */ addiu $v0, $zero, 2
/* 0ED9A8 802C8FF8 03E00008 */ jr $ra
/* 0ED9AC 802C8FFC 27BD0040 */ addiu $sp, $sp, 0x40

View File

@ -1,46 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel GetModelIndex
/* 0ED83C 802C8E8C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0ED840 802C8E90 AFB10014 */ sw $s1, 0x14($sp)
/* 0ED844 802C8E94 0080882D */ daddu $s1, $a0, $zero
/* 0ED848 802C8E98 AFBF0018 */ sw $ra, 0x18($sp)
/* 0ED84C 802C8E9C AFB00010 */ sw $s0, 0x10($sp)
/* 0ED850 802C8EA0 8E30000C */ lw $s0, 0xc($s1)
/* 0ED854 802C8EA4 8E050000 */ lw $a1, ($s0)
/* 0ED858 802C8EA8 0C0B1EAF */ jal get_variable
/* 0ED85C 802C8EAC 26100004 */ addiu $s0, $s0, 4
/* 0ED860 802C8EB0 8E100000 */ lw $s0, ($s0)
/* 0ED864 802C8EB4 0C046C04 */ jal get_model_list_index_from_tree_index
/* 0ED868 802C8EB8 0040202D */ daddu $a0, $v0, $zero
/* 0ED86C 802C8EBC 0220202D */ daddu $a0, $s1, $zero
/* 0ED870 802C8EC0 0040302D */ daddu $a2, $v0, $zero
/* 0ED874 802C8EC4 0C0B2026 */ jal set_variable
/* 0ED878 802C8EC8 0200282D */ daddu $a1, $s0, $zero
/* 0ED87C 802C8ECC 8FBF0018 */ lw $ra, 0x18($sp)
/* 0ED880 802C8ED0 8FB10014 */ lw $s1, 0x14($sp)
/* 0ED884 802C8ED4 8FB00010 */ lw $s0, 0x10($sp)
/* 0ED888 802C8ED8 24020002 */ addiu $v0, $zero, 2
/* 0ED88C 802C8EDC 03E00008 */ jr $ra
/* 0ED890 802C8EE0 27BD0020 */ addiu $sp, $sp, 0x20
/* 0ED894 802C8EE4 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0ED898 802C8EE8 AFBF0010 */ sw $ra, 0x10($sp)
/* 0ED89C 802C8EEC 8C82000C */ lw $v0, 0xc($a0)
/* 0ED8A0 802C8EF0 0C0B1EAF */ jal get_variable
/* 0ED8A4 802C8EF4 8C450000 */ lw $a1, ($v0)
/* 0ED8A8 802C8EF8 0C046C04 */ jal get_model_list_index_from_tree_index
/* 0ED8AC 802C8EFC 0040202D */ daddu $a0, $v0, $zero
/* 0ED8B0 802C8F00 0C046B4C */ jal get_model_from_list_index
/* 0ED8B4 802C8F04 0040202D */ daddu $a0, $v0, $zero
/* 0ED8B8 802C8F08 0040202D */ daddu $a0, $v0, $zero
/* 0ED8BC 802C8F0C 94830000 */ lhu $v1, ($a0)
/* 0ED8C0 802C8F10 3063FBFF */ andi $v1, $v1, 0xfbff
/* 0ED8C4 802C8F14 A4830000 */ sh $v1, ($a0)
/* 0ED8C8 802C8F18 8FBF0010 */ lw $ra, 0x10($sp)
/* 0ED8CC 802C8F1C 24020002 */ addiu $v0, $zero, 2
/* 0ED8D0 802C8F20 03E00008 */ jr $ra
/* 0ED8D4 802C8F24 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,31 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel SetRenderMode
/* 0EEEA4 802CA4F4 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 0EEEA8 802CA4F8 AFB10014 */ sw $s1, 0x14($sp)
/* 0EEEAC 802CA4FC 0080882D */ daddu $s1, $a0, $zero
/* 0EEEB0 802CA500 AFBF0018 */ sw $ra, 0x18($sp)
/* 0EEEB4 802CA504 AFB00010 */ sw $s0, 0x10($sp)
/* 0EEEB8 802CA508 8E30000C */ lw $s0, 0xc($s1)
/* 0EEEBC 802CA50C 8E050000 */ lw $a1, ($s0)
/* 0EEEC0 802CA510 0C0B1EAF */ jal get_variable
/* 0EEEC4 802CA514 26100004 */ addiu $s0, $s0, 4
/* 0EEEC8 802CA518 0220202D */ daddu $a0, $s1, $zero
/* 0EEECC 802CA51C 8E050000 */ lw $a1, ($s0)
/* 0EEED0 802CA520 0C0B1EAF */ jal get_variable
/* 0EEED4 802CA524 0040802D */ daddu $s0, $v0, $zero
/* 0EEED8 802CA528 0200202D */ daddu $a0, $s0, $zero
/* 0EEEDC 802CA52C 0C046C04 */ jal get_model_list_index_from_tree_index
/* 0EEEE0 802CA530 0040802D */ daddu $s0, $v0, $zero
/* 0EEEE4 802CA534 0C046B4C */ jal get_model_from_list_index
/* 0EEEE8 802CA538 0040202D */ daddu $a0, $v0, $zero
/* 0EEEEC 802CA53C A05000A6 */ sb $s0, 0xa6($v0)
/* 0EEEF0 802CA540 8FBF0018 */ lw $ra, 0x18($sp)
/* 0EEEF4 802CA544 8FB10014 */ lw $s1, 0x14($sp)
/* 0EEEF8 802CA548 8FB00010 */ lw $s0, 0x10($sp)
/* 0EEEFC 802CA54C 24020002 */ addiu $v0, $zero, 2
/* 0EEF00 802CA550 03E00008 */ jr $ra
/* 0EEF04 802CA554 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -32,475 +32,506 @@ glabel si_execute_next_command
/* 0EBE18 802C7468 00041080 */ sll $v0, $a0, 2 /* 0EBE18 802C7468 00041080 */ sll $v0, $a0, 2
/* 0EBE1C 802C746C 00621821 */ addu $v1, $v1, $v0 /* 0EBE1C 802C746C 00621821 */ addu $v1, $v1, $v0
/* 0EBE20 802C7470 A2040001 */ sb $a0, 1($s0) /* 0EBE20 802C7470 A2040001 */ sb $a0, 1($s0)
/* 0EBE24 802C7474 080B1E95 */ j si_handle_end /* 0EBE24 802C7474 080B1E95 */ j .L802C7A54
/* 0EBE28 802C7478 AE030008 */ sw $v1, 8($s0) /* 0EBE28 802C7478 AE030008 */ sw $v1, 8($s0)
/* 0EBE2C 802C747C 0C0B1266 */ jal si_handle_return /* 0EBE2C 802C747C 0C0B1266 */ jal si_handle_return
/* 0EBE30 802C7480 0200202D */ daddu $a0, $s0, $zero /* 0EBE30 802C7480 0200202D */ daddu $a0, $s0, $zero
/* 0EBE34 802C7484 080B1E95 */ j si_handle_end /* 0EBE34 802C7484 080B1E95 */ j .L802C7A54
/* 0EBE38 802C7488 0040282D */ daddu $a1, $v0, $zero /* 0EBE38 802C7488 0040282D */ daddu $a1, $v0, $zero
/* 0EBE3C 802C748C 0C0B126E */ jal si_handle_label /* 0EBE3C 802C748C 0C0B126E */ jal si_handle_label
/* 0EBE40 802C7490 0200202D */ daddu $a0, $s0, $zero /* 0EBE40 802C7490 0200202D */ daddu $a0, $s0, $zero
/* 0EBE44 802C7494 080B1E95 */ j si_handle_end /* 0EBE44 802C7494 080B1E95 */ j .L802C7A54
/* 0EBE48 802C7498 0040282D */ daddu $a1, $v0, $zero /* 0EBE48 802C7498 0040282D */ daddu $a1, $v0, $zero
/* 0EBE4C 802C749C 0C0B1270 */ jal si_handle_goto /* 0EBE4C 802C749C 0C0B1270 */ jal si_handle_goto
/* 0EBE50 802C74A0 0200202D */ daddu $a0, $s0, $zero /* 0EBE50 802C74A0 0200202D */ daddu $a0, $s0, $zero
/* 0EBE54 802C74A4 080B1E95 */ j si_handle_end /* 0EBE54 802C74A4 080B1E95 */ j .L802C7A54
/* 0EBE58 802C74A8 0040282D */ daddu $a1, $v0, $zero /* 0EBE58 802C74A8 0040282D */ daddu $a1, $v0, $zero
/* 0EBE5C 802C74AC 0C0B1280 */ jal si_handle_Loop /* 0EBE5C 802C74AC 0C0B1280 */ jal si_handle_Loop
/* 0EBE60 802C74B0 0200202D */ daddu $a0, $s0, $zero /* 0EBE60 802C74B0 0200202D */ daddu $a0, $s0, $zero
/* 0EBE64 802C74B4 080B1E95 */ j si_handle_end /* 0EBE64 802C74B4 080B1E95 */ j .L802C7A54
/* 0EBE68 802C74B8 0040282D */ daddu $a1, $v0, $zero /* 0EBE68 802C74B8 0040282D */ daddu $a1, $v0, $zero
/* 0EBE6C 802C74BC 0C0B1292 */ jal si_handle_end_loop /* 0EBE6C 802C74BC 0C0B1292 */ jal si_handle_end_loop
/* 0EBE70 802C74C0 0200202D */ daddu $a0, $s0, $zero /* 0EBE70 802C74C0 0200202D */ daddu $a0, $s0, $zero
/* 0EBE74 802C74C4 080B1E95 */ j si_handle_end /* 0EBE74 802C74C4 080B1E95 */ j .L802C7A54
/* 0EBE78 802C74C8 0040282D */ daddu $a1, $v0, $zero /* 0EBE78 802C74C8 0040282D */ daddu $a1, $v0, $zero
/* 0EBE7C 802C74CC 0C0B12C3 */ jal si_handle_break_loop /* 0EBE7C 802C74CC 0C0B12C3 */ jal si_handle_break_loop
/* 0EBE80 802C74D0 0200202D */ daddu $a0, $s0, $zero /* 0EBE80 802C74D0 0200202D */ daddu $a0, $s0, $zero
/* 0EBE84 802C74D4 080B1E95 */ j si_handle_end /* 0EBE84 802C74D4 080B1E95 */ j .L802C7A54
/* 0EBE88 802C74D8 0040282D */ daddu $a1, $v0, $zero /* 0EBE88 802C74D8 0040282D */ daddu $a1, $v0, $zero
/* 0EBE8C 802C74DC 0C0B12D7 */ jal si_handle_wait /* 0EBE8C 802C74DC 0C0B12D7 */ jal si_handle_wait
/* 0EBE90 802C74E0 0200202D */ daddu $a0, $s0, $zero /* 0EBE90 802C74E0 0200202D */ daddu $a0, $s0, $zero
/* 0EBE94 802C74E4 080B1E95 */ j si_handle_end /* 0EBE94 802C74E4 080B1E95 */ j .L802C7A54
/* 0EBE98 802C74E8 0040282D */ daddu $a1, $v0, $zero /* 0EBE98 802C74E8 0040282D */ daddu $a1, $v0, $zero
/* 0EBE9C 802C74EC 0C0B12EE */ jal si_handle_wait_seconds /* 0EBE9C 802C74EC 0C0B12EE */ jal si_handle_wait_seconds
/* 0EBEA0 802C74F0 0200202D */ daddu $a0, $s0, $zero /* 0EBEA0 802C74F0 0200202D */ daddu $a0, $s0, $zero
/* 0EBEA4 802C74F4 080B1E95 */ j si_handle_end /* 0EBEA4 802C74F4 080B1E95 */ j .L802C7A54
/* 0EBEA8 802C74F8 0040282D */ daddu $a1, $v0, $zero /* 0EBEA8 802C74F8 0040282D */ daddu $a1, $v0, $zero
/* 0EBEAC 802C74FC 0C0B1310 */ jal si_handle_if_equal /* 0EBEAC 802C74FC 0C0B1310 */ jal si_handle_if_equal
/* 0EBEB0 802C7500 0200202D */ daddu $a0, $s0, $zero /* 0EBEB0 802C7500 0200202D */ daddu $a0, $s0, $zero
/* 0EBEB4 802C7504 080B1E95 */ j si_handle_end /* 0EBEB4 802C7504 080B1E95 */ j .L802C7A54
/* 0EBEB8 802C7508 0040282D */ daddu $a1, $v0, $zero /* 0EBEB8 802C7508 0040282D */ daddu $a1, $v0, $zero
/* 0EBEBC 802C750C 0C0B1328 */ jal si_handle_if_not_equal /* 0EBEBC 802C750C 0C0B1328 */ jal si_handle_if_not_equal
/* 0EBEC0 802C7510 0200202D */ daddu $a0, $s0, $zero /* 0EBEC0 802C7510 0200202D */ daddu $a0, $s0, $zero
/* 0EBEC4 802C7514 080B1E95 */ j si_handle_end /* 0EBEC4 802C7514 080B1E95 */ j .L802C7A54
/* 0EBEC8 802C7518 0040282D */ daddu $a1, $v0, $zero /* 0EBEC8 802C7518 0040282D */ daddu $a1, $v0, $zero
/* 0EBECC 802C751C 0C0B1340 */ jal si_handle_if_less /* 0EBECC 802C751C 0C0B1340 */ jal si_handle_if_less
/* 0EBED0 802C7520 0200202D */ daddu $a0, $s0, $zero /* 0EBED0 802C7520 0200202D */ daddu $a0, $s0, $zero
/* 0EBED4 802C7524 080B1E95 */ j si_handle_end /* 0EBED4 802C7524 080B1E95 */ j .L802C7A54
/* 0EBED8 802C7528 0040282D */ daddu $a1, $v0, $zero /* 0EBED8 802C7528 0040282D */ daddu $a1, $v0, $zero
/* 0EBEDC 802C752C 0C0B1359 */ jal si_handle_if_greater /* 0EBEDC 802C752C 0C0B1359 */ jal si_handle_if_greater
/* 0EBEE0 802C7530 0200202D */ daddu $a0, $s0, $zero /* 0EBEE0 802C7530 0200202D */ daddu $a0, $s0, $zero
/* 0EBEE4 802C7534 080B1E95 */ j si_handle_end /* 0EBEE4 802C7534 080B1E95 */ j .L802C7A54
/* 0EBEE8 802C7538 0040282D */ daddu $a1, $v0, $zero /* 0EBEE8 802C7538 0040282D */ daddu $a1, $v0, $zero
/* 0EBEEC 802C753C 0C0B1372 */ jal si_handle_if_less_equal /* 0EBEEC 802C753C 0C0B1372 */ jal si_handle_if_less_equal
/* 0EBEF0 802C7540 0200202D */ daddu $a0, $s0, $zero /* 0EBEF0 802C7540 0200202D */ daddu $a0, $s0, $zero
/* 0EBEF4 802C7544 080B1E95 */ j si_handle_end /* 0EBEF4 802C7544 080B1E95 */ j .L802C7A54
/* 0EBEF8 802C7548 0040282D */ daddu $a1, $v0, $zero /* 0EBEF8 802C7548 0040282D */ daddu $a1, $v0, $zero
/* 0EBEFC 802C754C 0C0B138B */ jal si_handle_if_greater_equal /* 0EBEFC 802C754C 0C0B138B */ jal si_handle_if_greater_equal
/* 0EBF00 802C7550 0200202D */ daddu $a0, $s0, $zero /* 0EBF00 802C7550 0200202D */ daddu $a0, $s0, $zero
/* 0EBF04 802C7554 080B1E95 */ j si_handle_end /* 0EBF04 802C7554 080B1E95 */ j .L802C7A54
/* 0EBF08 802C7558 0040282D */ daddu $a1, $v0, $zero /* 0EBF08 802C7558 0040282D */ daddu $a1, $v0, $zero
/* 0EBF0C 802C755C 0C0B13A4 */ jal si_handle_if_AND /* 0EBF0C 802C755C 0C0B13A4 */ jal si_handle_if_AND
/* 0EBF10 802C7560 0200202D */ daddu $a0, $s0, $zero /* 0EBF10 802C7560 0200202D */ daddu $a0, $s0, $zero
/* 0EBF14 802C7564 080B1E95 */ j si_handle_end /* 0EBF14 802C7564 080B1E95 */ j .L802C7A54
/* 0EBF18 802C7568 0040282D */ daddu $a1, $v0, $zero /* 0EBF18 802C7568 0040282D */ daddu $a1, $v0, $zero
/* 0EBF1C 802C756C 0C0B13BA */ jal si_handle_if_not_AND /* 0EBF1C 802C756C 0C0B13BA */ jal si_handle_if_not_AND
/* 0EBF20 802C7570 0200202D */ daddu $a0, $s0, $zero /* 0EBF20 802C7570 0200202D */ daddu $a0, $s0, $zero
/* 0EBF24 802C7574 080B1E95 */ j si_handle_end /* 0EBF24 802C7574 080B1E95 */ j .L802C7A54
/* 0EBF28 802C7578 0040282D */ daddu $a1, $v0, $zero /* 0EBF28 802C7578 0040282D */ daddu $a1, $v0, $zero
/* 0EBF2C 802C757C 0C0B13D0 */ jal si_handle_else /* 0EBF2C 802C757C 0C0B13D0 */ jal si_handle_else
/* 0EBF30 802C7580 0200202D */ daddu $a0, $s0, $zero /* 0EBF30 802C7580 0200202D */ daddu $a0, $s0, $zero
/* 0EBF34 802C7584 080B1E95 */ j si_handle_end /* 0EBF34 802C7584 080B1E95 */ j .L802C7A54
/* 0EBF38 802C7588 0040282D */ daddu $a1, $v0, $zero /* 0EBF38 802C7588 0040282D */ daddu $a1, $v0, $zero
/* 0EBF3C 802C758C 0C0B13DB */ jal si_handle_end_if /* 0EBF3C 802C758C 0C0B13DB */ jal si_handle_end_if
/* 0EBF40 802C7590 0200202D */ daddu $a0, $s0, $zero /* 0EBF40 802C7590 0200202D */ daddu $a0, $s0, $zero
/* 0EBF44 802C7594 080B1E95 */ j si_handle_end /* 0EBF44 802C7594 080B1E95 */ j .L802C7A54
/* 0EBF48 802C7598 0040282D */ daddu $a1, $v0, $zero /* 0EBF48 802C7598 0040282D */ daddu $a1, $v0, $zero
/* 0EBF4C 802C759C 0C0B13DD */ jal si_handle_switch /* 0EBF4C 802C759C 0C0B13DD */ jal si_handle_switch
/* 0EBF50 802C75A0 0200202D */ daddu $a0, $s0, $zero /* 0EBF50 802C75A0 0200202D */ daddu $a0, $s0, $zero
/* 0EBF54 802C75A4 080B1E95 */ j si_handle_end /* 0EBF54 802C75A4 080B1E95 */ j .L802C7A54
/* 0EBF58 802C75A8 0040282D */ daddu $a1, $v0, $zero /* 0EBF58 802C75A8 0040282D */ daddu $a1, $v0, $zero
/* 0EBF5C 802C75AC 0C0B13F9 */ jal si_handle_switch_const /* 0EBF5C 802C75AC 0C0B13F9 */ jal si_handle_switch_const
/* 0EBF60 802C75B0 0200202D */ daddu $a0, $s0, $zero /* 0EBF60 802C75B0 0200202D */ daddu $a0, $s0, $zero
/* 0EBF64 802C75B4 080B1E95 */ j si_handle_end /* 0EBF64 802C75B4 080B1E95 */ j .L802C7A54
/* 0EBF68 802C75B8 0040282D */ daddu $a1, $v0, $zero /* 0EBF68 802C75B8 0040282D */ daddu $a1, $v0, $zero
/* 0EBF6C 802C75BC 0C0B140C */ jal si_handle_case_equal /* 0EBF6C 802C75BC 0C0B140C */ jal si_handle_case_equal
/* 0EBF70 802C75C0 0200202D */ daddu $a0, $s0, $zero /* 0EBF70 802C75C0 0200202D */ daddu $a0, $s0, $zero
/* 0EBF74 802C75C4 080B1E95 */ j si_handle_end /* 0EBF74 802C75C4 080B1E95 */ j .L802C7A54
/* 0EBF78 802C75C8 0040282D */ daddu $a1, $v0, $zero /* 0EBF78 802C75C8 0040282D */ daddu $a1, $v0, $zero
/* 0EBF7C 802C75CC 0C0B142F */ jal si_handle_case_not_equal /* 0EBF7C 802C75CC 0C0B142F */ jal si_handle_case_not_equal
/* 0EBF80 802C75D0 0200202D */ daddu $a0, $s0, $zero /* 0EBF80 802C75D0 0200202D */ daddu $a0, $s0, $zero
/* 0EBF84 802C75D4 080B1E95 */ j si_handle_end /* 0EBF84 802C75D4 080B1E95 */ j .L802C7A54
/* 0EBF88 802C75D8 0040282D */ daddu $a1, $v0, $zero /* 0EBF88 802C75D8 0040282D */ daddu $a1, $v0, $zero
/* 0EBF8C 802C75DC 0C0B1452 */ jal si_handle_case_less /* 0EBF8C 802C75DC 0C0B1452 */ jal si_handle_case_less
/* 0EBF90 802C75E0 0200202D */ daddu $a0, $s0, $zero /* 0EBF90 802C75E0 0200202D */ daddu $a0, $s0, $zero
/* 0EBF94 802C75E4 080B1E95 */ j si_handle_end /* 0EBF94 802C75E4 080B1E95 */ j .L802C7A54
/* 0EBF98 802C75E8 0040282D */ daddu $a1, $v0, $zero /* 0EBF98 802C75E8 0040282D */ daddu $a1, $v0, $zero
/* 0EBF9C 802C75EC 0C0B1476 */ jal si_handle_case_less_equal /* 0EBF9C 802C75EC 0C0B1476 */ jal si_handle_case_less_equal
/* 0EBFA0 802C75F0 0200202D */ daddu $a0, $s0, $zero /* 0EBFA0 802C75F0 0200202D */ daddu $a0, $s0, $zero
/* 0EBFA4 802C75F4 080B1E95 */ j si_handle_end /* 0EBFA4 802C75F4 080B1E95 */ j .L802C7A54
/* 0EBFA8 802C75F8 0040282D */ daddu $a1, $v0, $zero /* 0EBFA8 802C75F8 0040282D */ daddu $a1, $v0, $zero
/* 0EBFAC 802C75FC 0C0B149A */ jal si_handle_case_greater /* 0EBFAC 802C75FC 0C0B149A */ jal si_handle_case_greater
/* 0EBFB0 802C7600 0200202D */ daddu $a0, $s0, $zero /* 0EBFB0 802C7600 0200202D */ daddu $a0, $s0, $zero
/* 0EBFB4 802C7604 080B1E95 */ j si_handle_end /* 0EBFB4 802C7604 080B1E95 */ j .L802C7A54
/* 0EBFB8 802C7608 0040282D */ daddu $a1, $v0, $zero /* 0EBFB8 802C7608 0040282D */ daddu $a1, $v0, $zero
/* 0EBFBC 802C760C 0C0B14BE */ jal si_handle_case_greater_equal /* 0EBFBC 802C760C 0C0B14BE */ jal si_handle_case_greater_equal
/* 0EBFC0 802C7610 0200202D */ daddu $a0, $s0, $zero /* 0EBFC0 802C7610 0200202D */ daddu $a0, $s0, $zero
/* 0EBFC4 802C7614 080B1E95 */ j si_handle_end /* 0EBFC4 802C7614 080B1E95 */ j .L802C7A54
/* 0EBFC8 802C7618 0040282D */ daddu $a1, $v0, $zero /* 0EBFC8 802C7618 0040282D */ daddu $a1, $v0, $zero
/* 0EBFCC 802C761C 0C0B1511 */ jal si_handle_case_default /* 0EBFCC 802C761C 0C0B1511 */ jal si_handle_case_default
/* 0EBFD0 802C7620 0200202D */ daddu $a0, $s0, $zero /* 0EBFD0 802C7620 0200202D */ daddu $a0, $s0, $zero
/* 0EBFD4 802C7624 080B1E95 */ j si_handle_end /* 0EBFD4 802C7624 080B1E95 */ j .L802C7A54
/* 0EBFD8 802C7628 0040282D */ daddu $a1, $v0, $zero /* 0EBFD8 802C7628 0040282D */ daddu $a1, $v0, $zero
/* 0EBFDC 802C762C 0C0B15B5 */ jal si_handle_break_case /* 0EBFDC 802C762C 0C0B15B5 */ jal si_handle_break_case
/* 0EBFE0 802C7630 0200202D */ daddu $a0, $s0, $zero /* 0EBFE0 802C7630 0200202D */ daddu $a0, $s0, $zero
/* 0EBFE4 802C7634 080B1E95 */ j si_handle_end /* 0EBFE4 802C7634 080B1E95 */ j .L802C7A54
/* 0EBFE8 802C7638 0040282D */ daddu $a1, $v0, $zero /* 0EBFE8 802C7638 0040282D */ daddu $a1, $v0, $zero
/* 0EBFEC 802C763C 0C0B1546 */ jal si_handle_case_equal_OR /* 0EBFEC 802C763C 0C0B1546 */ jal si_handle_case_equal_OR
/* 0EBFF0 802C7640 0200202D */ daddu $a0, $s0, $zero /* 0EBFF0 802C7640 0200202D */ daddu $a0, $s0, $zero
/* 0EBFF4 802C7644 080B1E95 */ j si_handle_end /* 0EBFF4 802C7644 080B1E95 */ j .L802C7A54
/* 0EBFF8 802C7648 0040282D */ daddu $a1, $v0, $zero /* 0EBFF8 802C7648 0040282D */ daddu $a1, $v0, $zero
/* 0EBFFC 802C764C 0C0B1597 */ jal si_handle_end_case_group /* 0EBFFC 802C764C 0C0B1597 */ jal si_handle_end_case_group
/* 0EC000 802C7650 0200202D */ daddu $a0, $s0, $zero /* 0EC000 802C7650 0200202D */ daddu $a0, $s0, $zero
/* 0EC004 802C7654 080B1E95 */ j si_handle_end /* 0EC004 802C7654 080B1E95 */ j .L802C7A54
/* 0EC008 802C7658 0040282D */ daddu $a1, $v0, $zero /* 0EC008 802C7658 0040282D */ daddu $a1, $v0, $zero
/* 0EC00C 802C765C 0C0B156E */ jal si_handle_case_equal_AND /* 0EC00C 802C765C 0C0B156E */ jal si_handle_case_equal_AND
/* 0EC010 802C7660 0200202D */ daddu $a0, $s0, $zero /* 0EC010 802C7660 0200202D */ daddu $a0, $s0, $zero
/* 0EC014 802C7664 080B1E95 */ j si_handle_end /* 0EC014 802C7664 080B1E95 */ j .L802C7A54
/* 0EC018 802C7668 0040282D */ daddu $a1, $v0, $zero /* 0EC018 802C7668 0040282D */ daddu $a1, $v0, $zero
/* 0EC01C 802C766C 0C0B1527 */ jal si_handle_case_AND /* 0EC01C 802C766C 0C0B1527 */ jal si_handle_case_AND
/* 0EC020 802C7670 0200202D */ daddu $a0, $s0, $zero /* 0EC020 802C7670 0200202D */ daddu $a0, $s0, $zero
/* 0EC024 802C7674 080B1E95 */ j si_handle_end /* 0EC024 802C7674 080B1E95 */ j .L802C7A54
/* 0EC028 802C7678 0040282D */ daddu $a1, $v0, $zero /* 0EC028 802C7678 0040282D */ daddu $a1, $v0, $zero
/* 0EC02C 802C767C 0C0B14E2 */ jal si_handle_case_range /* 0EC02C 802C767C 0C0B14E2 */ jal si_handle_case_range
/* 0EC030 802C7680 0200202D */ daddu $a0, $s0, $zero /* 0EC030 802C7680 0200202D */ daddu $a0, $s0, $zero
/* 0EC034 802C7684 080B1E95 */ j si_handle_end /* 0EC034 802C7684 080B1E95 */ j .L802C7A54
/* 0EC038 802C7688 0040282D */ daddu $a1, $v0, $zero /* 0EC038 802C7688 0040282D */ daddu $a1, $v0, $zero
/* 0EC03C 802C768C 0C0B15C6 */ jal si_handle_end_switch /* 0EC03C 802C768C 0C0B15C6 */ jal si_handle_end_switch
/* 0EC040 802C7690 0200202D */ daddu $a0, $s0, $zero /* 0EC040 802C7690 0200202D */ daddu $a0, $s0, $zero
/* 0EC044 802C7694 080B1E95 */ j si_handle_end /* 0EC044 802C7694 080B1E95 */ j .L802C7A54
/* 0EC048 802C7698 0040282D */ daddu $a1, $v0, $zero /* 0EC048 802C7698 0040282D */ daddu $a1, $v0, $zero
/* 0EC04C 802C769C 0C0B15D1 */ jal si_handle_set_var /* 0EC04C 802C769C 0C0B15D1 */ jal si_handle_set_var
/* 0EC050 802C76A0 0200202D */ daddu $a0, $s0, $zero /* 0EC050 802C76A0 0200202D */ daddu $a0, $s0, $zero
/* 0EC054 802C76A4 080B1E95 */ j si_handle_end /* 0EC054 802C76A4 080B1E95 */ j .L802C7A54
/* 0EC058 802C76A8 0040282D */ daddu $a1, $v0, $zero /* 0EC058 802C76A8 0040282D */ daddu $a1, $v0, $zero
/* 0EC05C 802C76AC 0C0B15E4 */ jal si_handle_set_const /* 0EC05C 802C76AC 0C0B15E4 */ jal si_handle_set_const
/* 0EC060 802C76B0 0200202D */ daddu $a0, $s0, $zero /* 0EC060 802C76B0 0200202D */ daddu $a0, $s0, $zero
/* 0EC064 802C76B4 080B1E95 */ j si_handle_end /* 0EC064 802C76B4 080B1E95 */ j .L802C7A54
/* 0EC068 802C76B8 0040282D */ daddu $a1, $v0, $zero /* 0EC068 802C76B8 0040282D */ daddu $a1, $v0, $zero
/* 0EC06C 802C76BC 0C0B15EE */ jal si_handle_set_float /* 0EC06C 802C76BC 0C0B15EE */ jal si_handle_set_float
/* 0EC070 802C76C0 0200202D */ daddu $a0, $s0, $zero /* 0EC070 802C76C0 0200202D */ daddu $a0, $s0, $zero
/* 0EC074 802C76C4 080B1E95 */ j si_handle_end /* 0EC074 802C76C4 080B1E95 */ j .L802C7A54
/* 0EC078 802C76C8 0040282D */ daddu $a1, $v0, $zero /* 0EC078 802C76C8 0040282D */ daddu $a1, $v0, $zero
/* 0EC07C 802C76CC 0C0B1601 */ jal si_handle_add /* 0EC07C 802C76CC 0C0B1601 */ jal si_handle_add
/* 0EC080 802C76D0 0200202D */ daddu $a0, $s0, $zero /* 0EC080 802C76D0 0200202D */ daddu $a0, $s0, $zero
/* 0EC084 802C76D4 080B1E95 */ j si_handle_end /* 0EC084 802C76D4 080B1E95 */ j .L802C7A54
/* 0EC088 802C76D8 0040282D */ daddu $a1, $v0, $zero /* 0EC088 802C76D8 0040282D */ daddu $a1, $v0, $zero
/* 0EC08C 802C76DC 0C0B161A */ jal si_handle_subtract /* 0EC08C 802C76DC 0C0B161A */ jal si_handle_subtract
/* 0EC090 802C76E0 0200202D */ daddu $a0, $s0, $zero /* 0EC090 802C76E0 0200202D */ daddu $a0, $s0, $zero
/* 0EC094 802C76E4 080B1E95 */ j si_handle_end /* 0EC094 802C76E4 080B1E95 */ j .L802C7A54
/* 0EC098 802C76E8 0040282D */ daddu $a1, $v0, $zero /* 0EC098 802C76E8 0040282D */ daddu $a1, $v0, $zero
/* 0EC09C 802C76EC 0C0B1633 */ jal si_handle_multiply /* 0EC09C 802C76EC 0C0B1633 */ jal si_handle_multiply
/* 0EC0A0 802C76F0 0200202D */ daddu $a0, $s0, $zero /* 0EC0A0 802C76F0 0200202D */ daddu $a0, $s0, $zero
/* 0EC0A4 802C76F4 080B1E95 */ j si_handle_end /* 0EC0A4 802C76F4 080B1E95 */ j .L802C7A54
/* 0EC0A8 802C76F8 0040282D */ daddu $a1, $v0, $zero /* 0EC0A8 802C76F8 0040282D */ daddu $a1, $v0, $zero
/* 0EC0AC 802C76FC 0C0B164D */ jal si_handle_divide /* 0EC0AC 802C76FC 0C0B164D */ jal si_handle_divide
/* 0EC0B0 802C7700 0200202D */ daddu $a0, $s0, $zero /* 0EC0B0 802C7700 0200202D */ daddu $a0, $s0, $zero
/* 0EC0B4 802C7704 080B1E95 */ j si_handle_end /* 0EC0B4 802C7704 080B1E95 */ j .L802C7A54
/* 0EC0B8 802C7708 0040282D */ daddu $a1, $v0, $zero /* 0EC0B8 802C7708 0040282D */ daddu $a1, $v0, $zero
/* 0EC0BC 802C770C 0C0B166F */ jal si_handle_mod /* 0EC0BC 802C770C 0C0B166F */ jal si_handle_mod
/* 0EC0C0 802C7710 0200202D */ daddu $a0, $s0, $zero /* 0EC0C0 802C7710 0200202D */ daddu $a0, $s0, $zero
/* 0EC0C4 802C7714 080B1E95 */ j si_handle_end /* 0EC0C4 802C7714 080B1E95 */ j .L802C7A54
/* 0EC0C8 802C7718 0040282D */ daddu $a1, $v0, $zero /* 0EC0C8 802C7718 0040282D */ daddu $a1, $v0, $zero
/* 0EC0CC 802C771C 0C0B16A1 */ jal si_handle_addF /* 0EC0CC 802C771C 0C0B16A1 */ jal si_handle_addF
/* 0EC0D0 802C7720 0200202D */ daddu $a0, $s0, $zero /* 0EC0D0 802C7720 0200202D */ daddu $a0, $s0, $zero
/* 0EC0D4 802C7724 080B1E95 */ j si_handle_end /* 0EC0D4 802C7724 080B1E95 */ j .L802C7A54
/* 0EC0D8 802C7728 0040282D */ daddu $a1, $v0, $zero /* 0EC0D8 802C7728 0040282D */ daddu $a1, $v0, $zero
/* 0EC0DC 802C772C 0C0B16BB */ jal si_handle_subtractF /* 0EC0DC 802C772C 0C0B16BB */ jal si_handle_subtractF
/* 0EC0E0 802C7730 0200202D */ daddu $a0, $s0, $zero /* 0EC0E0 802C7730 0200202D */ daddu $a0, $s0, $zero
/* 0EC0E4 802C7734 080B1E95 */ j si_handle_end /* 0EC0E4 802C7734 080B1E95 */ j .L802C7A54
/* 0EC0E8 802C7738 0040282D */ daddu $a1, $v0, $zero /* 0EC0E8 802C7738 0040282D */ daddu $a1, $v0, $zero
/* 0EC0EC 802C773C 0C0B16D5 */ jal si_handle_multiplyF /* 0EC0EC 802C773C 0C0B16D5 */ jal si_handle_multiplyF
/* 0EC0F0 802C7740 0200202D */ daddu $a0, $s0, $zero /* 0EC0F0 802C7740 0200202D */ daddu $a0, $s0, $zero
/* 0EC0F4 802C7744 080B1E95 */ j si_handle_end /* 0EC0F4 802C7744 080B1E95 */ j .L802C7A54
/* 0EC0F8 802C7748 0040282D */ daddu $a1, $v0, $zero /* 0EC0F8 802C7748 0040282D */ daddu $a1, $v0, $zero
/* 0EC0FC 802C774C 0C0B16F0 */ jal si_handle_divideF /* 0EC0FC 802C774C 0C0B16F0 */ jal si_handle_divideF
/* 0EC100 802C7750 0200202D */ daddu $a0, $s0, $zero /* 0EC100 802C7750 0200202D */ daddu $a0, $s0, $zero
/* 0EC104 802C7754 080B1E95 */ j si_handle_end /* 0EC104 802C7754 080B1E95 */ j .L802C7A54
/* 0EC108 802C7758 0040282D */ daddu $a1, $v0, $zero /* 0EC108 802C7758 0040282D */ daddu $a1, $v0, $zero
/* 0EC10C 802C775C 0C0B170A */ jal si_handle_set_int_buffer_ptr /* 0EC10C 802C775C 0C0B170A */ jal si_handle_set_int_buffer_ptr
/* 0EC110 802C7760 0200202D */ daddu $a0, $s0, $zero /* 0EC110 802C7760 0200202D */ daddu $a0, $s0, $zero
/* 0EC114 802C7764 080B1E95 */ j si_handle_end /* 0EC114 802C7764 080B1E95 */ j .L802C7A54
/* 0EC118 802C7768 0040282D */ daddu $a1, $v0, $zero /* 0EC118 802C7768 0040282D */ daddu $a1, $v0, $zero
/* 0EC11C 802C776C 0C0B1724 */ jal si_handle_get_1_word /* 0EC11C 802C776C 0C0B1724 */ jal si_handle_get_1_word
/* 0EC120 802C7770 0200202D */ daddu $a0, $s0, $zero /* 0EC120 802C7770 0200202D */ daddu $a0, $s0, $zero
/* 0EC124 802C7774 080B1E95 */ j si_handle_end /* 0EC124 802C7774 080B1E95 */ j .L802C7A54
/* 0EC128 802C7778 0040282D */ daddu $a1, $v0, $zero /* 0EC128 802C7778 0040282D */ daddu $a1, $v0, $zero
/* 0EC12C 802C777C 0C0B1731 */ jal si_handle_get_2_word /* 0EC12C 802C777C 0C0B1731 */ jal si_handle_get_2_word
/* 0EC130 802C7780 0200202D */ daddu $a0, $s0, $zero /* 0EC130 802C7780 0200202D */ daddu $a0, $s0, $zero
/* 0EC134 802C7784 080B1E95 */ j si_handle_end /* 0EC134 802C7784 080B1E95 */ j .L802C7A54
/* 0EC138 802C7788 0040282D */ daddu $a1, $v0, $zero /* 0EC138 802C7788 0040282D */ daddu $a1, $v0, $zero
/* 0EC13C 802C778C 0C0B174B */ jal si_handle_get_3_word /* 0EC13C 802C778C 0C0B174B */ jal si_handle_get_3_word
/* 0EC140 802C7790 0200202D */ daddu $a0, $s0, $zero /* 0EC140 802C7790 0200202D */ daddu $a0, $s0, $zero
/* 0EC144 802C7794 080B1E95 */ j si_handle_end /* 0EC144 802C7794 080B1E95 */ j .L802C7A54
/* 0EC148 802C7798 0040282D */ daddu $a1, $v0, $zero /* 0EC148 802C7798 0040282D */ daddu $a1, $v0, $zero
/* 0EC14C 802C779C 0C0B176D */ jal si_handle_get_4_word /* 0EC14C 802C779C 0C0B176D */ jal si_handle_get_4_word
/* 0EC150 802C77A0 0200202D */ daddu $a0, $s0, $zero /* 0EC150 802C77A0 0200202D */ daddu $a0, $s0, $zero
/* 0EC154 802C77A4 080B1E95 */ j si_handle_end /* 0EC154 802C77A4 080B1E95 */ j .L802C7A54
/* 0EC158 802C77A8 0040282D */ daddu $a1, $v0, $zero /* 0EC158 802C77A8 0040282D */ daddu $a1, $v0, $zero
/* 0EC15C 802C77AC 0C0B1797 */ jal si_handle_get_Nth_word /* 0EC15C 802C77AC 0C0B1797 */ jal si_handle_get_Nth_word
/* 0EC160 802C77B0 0200202D */ daddu $a0, $s0, $zero /* 0EC160 802C77B0 0200202D */ daddu $a0, $s0, $zero
/* 0EC164 802C77B4 080B1E95 */ j si_handle_end /* 0EC164 802C77B4 080B1E95 */ j .L802C7A54
/* 0EC168 802C77B8 0040282D */ daddu $a1, $v0, $zero /* 0EC168 802C77B8 0040282D */ daddu $a1, $v0, $zero
/* 0EC16C 802C77BC 0C0B1717 */ jal si_handle_set_float_buffer_ptr /* 0EC16C 802C77BC 0C0B1717 */ jal si_handle_set_float_buffer_ptr
/* 0EC170 802C77C0 0200202D */ daddu $a0, $s0, $zero /* 0EC170 802C77C0 0200202D */ daddu $a0, $s0, $zero
/* 0EC174 802C77C4 080B1E95 */ j si_handle_end /* 0EC174 802C77C4 080B1E95 */ j .L802C7A54
/* 0EC178 802C77C8 0040282D */ daddu $a1, $v0, $zero /* 0EC178 802C77C8 0040282D */ daddu $a1, $v0, $zero
/* 0EC17C 802C77CC 0C0B17AD */ jal si_handle_get_1_float /* 0EC17C 802C77CC 0C0B17AD */ jal si_handle_get_1_float
/* 0EC180 802C77D0 0200202D */ daddu $a0, $s0, $zero /* 0EC180 802C77D0 0200202D */ daddu $a0, $s0, $zero
/* 0EC184 802C77D4 080B1E95 */ j si_handle_end /* 0EC184 802C77D4 080B1E95 */ j .L802C7A54
/* 0EC188 802C77D8 0040282D */ daddu $a1, $v0, $zero /* 0EC188 802C77D8 0040282D */ daddu $a1, $v0, $zero
/* 0EC18C 802C77DC 0C0B17C3 */ jal si_handle_get_2_float /* 0EC18C 802C77DC 0C0B17C3 */ jal si_handle_get_2_float
/* 0EC190 802C77E0 0200202D */ daddu $a0, $s0, $zero /* 0EC190 802C77E0 0200202D */ daddu $a0, $s0, $zero
/* 0EC194 802C77E4 080B1E95 */ j si_handle_end /* 0EC194 802C77E4 080B1E95 */ j .L802C7A54
/* 0EC198 802C77E8 0040282D */ daddu $a1, $v0, $zero /* 0EC198 802C77E8 0040282D */ daddu $a1, $v0, $zero
/* 0EC19C 802C77EC 0C0B17E7 */ jal si_handle_get_3_float /* 0EC19C 802C77EC 0C0B17E7 */ jal si_handle_get_3_float
/* 0EC1A0 802C77F0 0200202D */ daddu $a0, $s0, $zero /* 0EC1A0 802C77F0 0200202D */ daddu $a0, $s0, $zero
/* 0EC1A4 802C77F4 080B1E95 */ j si_handle_end /* 0EC1A4 802C77F4 080B1E95 */ j .L802C7A54
/* 0EC1A8 802C77F8 0040282D */ daddu $a1, $v0, $zero /* 0EC1A8 802C77F8 0040282D */ daddu $a1, $v0, $zero
/* 0EC1AC 802C77FC 0C0B1817 */ jal si_handle_get_4_float /* 0EC1AC 802C77FC 0C0B1817 */ jal si_handle_get_4_float
/* 0EC1B0 802C7800 0200202D */ daddu $a0, $s0, $zero /* 0EC1B0 802C7800 0200202D */ daddu $a0, $s0, $zero
/* 0EC1B4 802C7804 080B1E95 */ j si_handle_end /* 0EC1B4 802C7804 080B1E95 */ j .L802C7A54
/* 0EC1B8 802C7808 0040282D */ daddu $a1, $v0, $zero /* 0EC1B8 802C7808 0040282D */ daddu $a1, $v0, $zero
/* 0EC1BC 802C780C 0C0B1853 */ jal si_handle_get_Nth_float /* 0EC1BC 802C780C 0C0B1853 */ jal si_handle_get_Nth_float
/* 0EC1C0 802C7810 0200202D */ daddu $a0, $s0, $zero /* 0EC1C0 802C7810 0200202D */ daddu $a0, $s0, $zero
/* 0EC1C4 802C7814 080B1E95 */ j si_handle_end /* 0EC1C4 802C7814 080B1E95 */ j .L802C7A54
/* 0EC1C8 802C7818 0040282D */ daddu $a1, $v0, $zero /* 0EC1C8 802C7818 0040282D */ daddu $a1, $v0, $zero
/* 0EC1CC 802C781C 0C0B186B */ jal si_handle_set_array /* 0EC1CC 802C781C 0C0B186B */ jal si_handle_set_array
/* 0EC1D0 802C7820 0200202D */ daddu $a0, $s0, $zero /* 0EC1D0 802C7820 0200202D */ daddu $a0, $s0, $zero
/* 0EC1D4 802C7824 080B1E95 */ j si_handle_end /* 0EC1D4 802C7824 080B1E95 */ j .L802C7A54
/* 0EC1D8 802C7828 0040282D */ daddu $a1, $v0, $zero /* 0EC1D8 802C7828 0040282D */ daddu $a1, $v0, $zero
/* 0EC1DC 802C782C 0C0B1878 */ jal si_handle_set_flag_array /* 0EC1DC 802C782C 0C0B1878 */ jal si_handle_set_flag_array
/* 0EC1E0 802C7830 0200202D */ daddu $a0, $s0, $zero /* 0EC1E0 802C7830 0200202D */ daddu $a0, $s0, $zero
/* 0EC1E4 802C7834 080B1E95 */ j si_handle_end /* 0EC1E4 802C7834 080B1E95 */ j .L802C7A54
/* 0EC1E8 802C7838 0040282D */ daddu $a1, $v0, $zero /* 0EC1E8 802C7838 0040282D */ daddu $a1, $v0, $zero
/* 0EC1EC 802C783C 0C0B1885 */ jal si_handle_allocate_array /* 0EC1EC 802C783C 0C0B1885 */ jal si_handle_allocate_array
/* 0EC1F0 802C7840 0200202D */ daddu $a0, $s0, $zero /* 0EC1F0 802C7840 0200202D */ daddu $a0, $s0, $zero
/* 0EC1F4 802C7844 080B1E95 */ j si_handle_end /* 0EC1F4 802C7844 080B1E95 */ j .L802C7A54
/* 0EC1F8 802C7848 0040282D */ daddu $a1, $v0, $zero /* 0EC1F8 802C7848 0040282D */ daddu $a1, $v0, $zero
/* 0EC1FC 802C784C 0C0B1A1C */ jal si_handle_kill /* 0EC1FC 802C784C 0C0B1A1C */ jal si_handle_kill
/* 0EC200 802C7850 0200202D */ daddu $a0, $s0, $zero /* 0EC200 802C7850 0200202D */ daddu $a0, $s0, $zero
/* 0EC204 802C7854 080B1E95 */ j si_handle_end /* 0EC204 802C7854 080B1E95 */ j .L802C7A54
/* 0EC208 802C7858 0040282D */ daddu $a1, $v0, $zero /* 0EC208 802C7858 0040282D */ daddu $a1, $v0, $zero
/* 0EC20C 802C785C 0C0B189C */ jal si_handle_AND /* 0EC20C 802C785C 0C0B189C */ jal si_handle_AND
/* 0EC210 802C7860 0200202D */ daddu $a0, $s0, $zero /* 0EC210 802C7860 0200202D */ daddu $a0, $s0, $zero
/* 0EC214 802C7864 080B1E95 */ j si_handle_end /* 0EC214 802C7864 080B1E95 */ j .L802C7A54
/* 0EC218 802C7868 0040282D */ daddu $a1, $v0, $zero /* 0EC218 802C7868 0040282D */ daddu $a1, $v0, $zero
/* 0EC21C 802C786C 0C0B18B5 */ jal si_handle_AND_const /* 0EC21C 802C786C 0C0B18B5 */ jal si_handle_AND_const
/* 0EC220 802C7870 0200202D */ daddu $a0, $s0, $zero /* 0EC220 802C7870 0200202D */ daddu $a0, $s0, $zero
/* 0EC224 802C7874 080B1E95 */ j si_handle_end /* 0EC224 802C7874 080B1E95 */ j .L802C7A54
/* 0EC228 802C7878 0040282D */ daddu $a1, $v0, $zero /* 0EC228 802C7878 0040282D */ daddu $a1, $v0, $zero
/* 0EC22C 802C787C 0C0B18CB */ jal si_handle_OR /* 0EC22C 802C787C 0C0B18CB */ jal si_handle_OR
/* 0EC230 802C7880 0200202D */ daddu $a0, $s0, $zero /* 0EC230 802C7880 0200202D */ daddu $a0, $s0, $zero
/* 0EC234 802C7884 080B1E95 */ j si_handle_end /* 0EC234 802C7884 080B1E95 */ j .L802C7A54
/* 0EC238 802C7888 0040282D */ daddu $a1, $v0, $zero /* 0EC238 802C7888 0040282D */ daddu $a1, $v0, $zero
/* 0EC23C 802C788C 0C0B18E4 */ jal si_handle_OR_const /* 0EC23C 802C788C 0C0B18E4 */ jal si_handle_OR_const
/* 0EC240 802C7890 0200202D */ daddu $a0, $s0, $zero /* 0EC240 802C7890 0200202D */ daddu $a0, $s0, $zero
/* 0EC244 802C7894 080B1E95 */ j si_handle_end /* 0EC244 802C7894 080B1E95 */ j .L802C7A54
/* 0EC248 802C7898 0040282D */ daddu $a1, $v0, $zero /* 0EC248 802C7898 0040282D */ daddu $a1, $v0, $zero
/* 0EC24C 802C789C 0C0B18FA */ jal si_handle_call /* 0EC24C 802C789C 0C0B18FA */ jal si_handle_call
/* 0EC250 802C78A0 0200202D */ daddu $a0, $s0, $zero /* 0EC250 802C78A0 0200202D */ daddu $a0, $s0, $zero
/* 0EC254 802C78A4 080B1E95 */ j si_handle_end /* 0EC254 802C78A4 080B1E95 */ j .L802C7A54
/* 0EC258 802C78A8 0040282D */ daddu $a1, $v0, $zero /* 0EC258 802C78A8 0040282D */ daddu $a1, $v0, $zero
/* 0EC25C 802C78AC 0C0B191B */ jal si_handle_exec1 /* 0EC25C 802C78AC 0C0B191B */ jal si_handle_exec1
/* 0EC260 802C78B0 0200202D */ daddu $a0, $s0, $zero /* 0EC260 802C78B0 0200202D */ daddu $a0, $s0, $zero
/* 0EC264 802C78B4 080B1E95 */ j si_handle_end /* 0EC264 802C78B4 080B1E95 */ j .L802C7A54
/* 0EC268 802C78B8 0040282D */ daddu $a1, $v0, $zero /* 0EC268 802C78B8 0040282D */ daddu $a1, $v0, $zero
/* 0EC26C 802C78BC 0C0B1949 */ jal si_handle_exec2 /* 0EC26C 802C78BC 0C0B1949 */ jal si_handle_exec2
/* 0EC270 802C78C0 0200202D */ daddu $a0, $s0, $zero /* 0EC270 802C78C0 0200202D */ daddu $a0, $s0, $zero
/* 0EC274 802C78C4 080B1E95 */ j si_handle_end /* 0EC274 802C78C4 080B1E95 */ j .L802C7A54
/* 0EC278 802C78C8 0040282D */ daddu $a1, $v0, $zero /* 0EC278 802C78C8 0040282D */ daddu $a1, $v0, $zero
/* 0EC27C 802C78CC 0C0B197F */ jal si_handle_exec_wait /* 0EC27C 802C78CC 0C0B197F */ jal si_handle_exec_wait
/* 0EC280 802C78D0 0200202D */ daddu $a0, $s0, $zero /* 0EC280 802C78D0 0200202D */ daddu $a0, $s0, $zero
/* 0EC284 802C78D4 080B1E95 */ j si_handle_end /* 0EC284 802C78D4 080B1E95 */ j .L802C7A54
/* 0EC288 802C78D8 0040282D */ daddu $a1, $v0, $zero /* 0EC288 802C78D8 0040282D */ daddu $a1, $v0, $zero
/* 0EC28C 802C78DC 0C0B19C5 */ jal si_handle_bind /* 0EC28C 802C78DC 0C0B19C5 */ jal si_handle_bind
/* 0EC290 802C78E0 0200202D */ daddu $a0, $s0, $zero /* 0EC290 802C78E0 0200202D */ daddu $a0, $s0, $zero
/* 0EC294 802C78E4 080B1E95 */ j si_handle_end /* 0EC294 802C78E4 080B1E95 */ j .L802C7A54
/* 0EC298 802C78E8 0040282D */ daddu $a1, $v0, $zero /* 0EC298 802C78E8 0040282D */ daddu $a1, $v0, $zero
/* 0EC29C 802C78EC 0C0B1A14 */ jal si_handle_unbind /* 0EC29C 802C78EC 0C0B1A14 */ jal si_handle_unbind
/* 0EC2A0 802C78F0 0200202D */ daddu $a0, $s0, $zero /* 0EC2A0 802C78F0 0200202D */ daddu $a0, $s0, $zero
/* 0EC2A4 802C78F4 080B1E95 */ j si_handle_end /* 0EC2A4 802C78F4 080B1E95 */ j .L802C7A54
/* 0EC2A8 802C78F8 0040282D */ daddu $a1, $v0, $zero /* 0EC2A8 802C78F8 0040282D */ daddu $a1, $v0, $zero
/* 0EC2AC 802C78FC 0C0B1A27 */ jal si_handle_set_priority /* 0EC2AC 802C78FC 0C0B1A27 */ jal si_handle_set_priority
/* 0EC2B0 802C7900 0200202D */ daddu $a0, $s0, $zero /* 0EC2B0 802C7900 0200202D */ daddu $a0, $s0, $zero
/* 0EC2B4 802C7904 080B1E95 */ j si_handle_end /* 0EC2B4 802C7904 080B1E95 */ j .L802C7A54
/* 0EC2B8 802C7908 0040282D */ daddu $a1, $v0, $zero /* 0EC2B8 802C7908 0040282D */ daddu $a1, $v0, $zero
/* 0EC2BC 802C790C 0C0B1A36 */ jal si_handle_set_timescale /* 0EC2BC 802C790C 0C0B1A36 */ jal si_handle_set_timescale
/* 0EC2C0 802C7910 0200202D */ daddu $a0, $s0, $zero /* 0EC2C0 802C7910 0200202D */ daddu $a0, $s0, $zero
/* 0EC2C4 802C7914 080B1E95 */ j si_handle_end /* 0EC2C4 802C7914 080B1E95 */ j .L802C7A54
/* 0EC2C8 802C7918 0040282D */ daddu $a1, $v0, $zero /* 0EC2C8 802C7918 0040282D */ daddu $a1, $v0, $zero
/* 0EC2CC 802C791C 0C0B1A45 */ jal si_handle_set_group /* 0EC2CC 802C791C 0C0B1A45 */ jal si_handle_set_group
/* 0EC2D0 802C7920 0200202D */ daddu $a0, $s0, $zero /* 0EC2D0 802C7920 0200202D */ daddu $a0, $s0, $zero
/* 0EC2D4 802C7924 080B1E95 */ j si_handle_end /* 0EC2D4 802C7924 080B1E95 */ j .L802C7A54
/* 0EC2D8 802C7928 0040282D */ daddu $a1, $v0, $zero /* 0EC2D8 802C7928 0040282D */ daddu $a1, $v0, $zero
/* 0EC2DC 802C792C 0C0B1990 */ jal si_handle_jump /* 0EC2DC 802C792C 0C0B1990 */ jal si_handle_jump
/* 0EC2E0 802C7930 0200202D */ daddu $a0, $s0, $zero /* 0EC2E0 802C7930 0200202D */ daddu $a0, $s0, $zero
/* 0EC2E4 802C7934 080B1E95 */ j si_handle_end /* 0EC2E4 802C7934 080B1E95 */ j .L802C7A54
/* 0EC2E8 802C7938 0040282D */ daddu $a1, $v0, $zero /* 0EC2E8 802C7938 0040282D */ daddu $a1, $v0, $zero
/* 0EC2EC 802C793C 0C0B1AD5 */ jal si_handle_bind_lock /* 0EC2EC 802C793C 0C0B1AD5 */ jal si_handle_bind_lock
/* 0EC2F0 802C7940 0200202D */ daddu $a0, $s0, $zero /* 0EC2F0 802C7940 0200202D */ daddu $a0, $s0, $zero
/* 0EC2F4 802C7944 080B1E95 */ j si_handle_end /* 0EC2F4 802C7944 080B1E95 */ j .L802C7A54
/* 0EC2F8 802C7948 0040282D */ daddu $a1, $v0, $zero /* 0EC2F8 802C7948 0040282D */ daddu $a1, $v0, $zero
/* 0EC2FC 802C794C 0C0B1A54 */ jal si_handle_suspend_all /* 0EC2FC 802C794C 0C0B1A54 */ jal si_handle_suspend_all
/* 0EC300 802C7950 0200202D */ daddu $a0, $s0, $zero /* 0EC300 802C7950 0200202D */ daddu $a0, $s0, $zero
/* 0EC304 802C7954 080B1E95 */ j si_handle_end /* 0EC304 802C7954 080B1E95 */ j .L802C7A54
/* 0EC308 802C7958 0040282D */ daddu $a1, $v0, $zero /* 0EC308 802C7958 0040282D */ daddu $a1, $v0, $zero
/* 0EC30C 802C795C 0C0B1A5F */ jal si_handle_resume_all /* 0EC30C 802C795C 0C0B1A5F */ jal si_handle_resume_all
/* 0EC310 802C7960 0200202D */ daddu $a0, $s0, $zero /* 0EC310 802C7960 0200202D */ daddu $a0, $s0, $zero
/* 0EC314 802C7964 080B1E95 */ j si_handle_end /* 0EC314 802C7964 080B1E95 */ j .L802C7A54
/* 0EC318 802C7968 0040282D */ daddu $a1, $v0, $zero /* 0EC318 802C7968 0040282D */ daddu $a1, $v0, $zero
/* 0EC31C 802C796C 0C0B1A6A */ jal si_handle_suspend_others /* 0EC31C 802C796C 0C0B1A6A */ jal si_handle_suspend_others
/* 0EC320 802C7970 0200202D */ daddu $a0, $s0, $zero /* 0EC320 802C7970 0200202D */ daddu $a0, $s0, $zero
/* 0EC324 802C7974 080B1E95 */ j si_handle_end /* 0EC324 802C7974 080B1E95 */ j .L802C7A54
/* 0EC328 802C7978 0040282D */ daddu $a1, $v0, $zero /* 0EC328 802C7978 0040282D */ daddu $a1, $v0, $zero
/* 0EC32C 802C797C 0C0B1A79 */ jal si_handle_resume_others /* 0EC32C 802C797C 0C0B1A79 */ jal si_handle_resume_others
/* 0EC330 802C7980 0200202D */ daddu $a0, $s0, $zero /* 0EC330 802C7980 0200202D */ daddu $a0, $s0, $zero
/* 0EC334 802C7984 080B1E95 */ j si_handle_end /* 0EC334 802C7984 080B1E95 */ j .L802C7A54
/* 0EC338 802C7988 0040282D */ daddu $a1, $v0, $zero /* 0EC338 802C7988 0040282D */ daddu $a1, $v0, $zero
/* 0EC33C 802C798C 0C0B1A88 */ jal si_handle_suspend /* 0EC33C 802C798C 0C0B1A88 */ jal si_handle_suspend
/* 0EC340 802C7990 0200202D */ daddu $a0, $s0, $zero /* 0EC340 802C7990 0200202D */ daddu $a0, $s0, $zero
/* 0EC344 802C7994 080B1E95 */ j si_handle_end /* 0EC344 802C7994 080B1E95 */ j .L802C7A54
/* 0EC348 802C7998 0040282D */ daddu $a1, $v0, $zero /* 0EC348 802C7998 0040282D */ daddu $a1, $v0, $zero
/* 0EC34C 802C799C 0C0B1A93 */ jal si_handle_resume /* 0EC34C 802C799C 0C0B1A93 */ jal si_handle_resume
/* 0EC350 802C79A0 0200202D */ daddu $a0, $s0, $zero /* 0EC350 802C79A0 0200202D */ daddu $a0, $s0, $zero
/* 0EC354 802C79A4 080B1E95 */ j si_handle_end /* 0EC354 802C79A4 080B1E95 */ j .L802C7A54
/* 0EC358 802C79A8 0040282D */ daddu $a1, $v0, $zero /* 0EC358 802C79A8 0040282D */ daddu $a1, $v0, $zero
/* 0EC35C 802C79AC 0C0B1A9E */ jal si_handle_does_script_exist /* 0EC35C 802C79AC 0C0B1A9E */ jal si_handle_does_script_exist
/* 0EC360 802C79B0 0200202D */ daddu $a0, $s0, $zero /* 0EC360 802C79B0 0200202D */ daddu $a0, $s0, $zero
/* 0EC364 802C79B4 080B1E95 */ j si_handle_end /* 0EC364 802C79B4 080B1E95 */ j .L802C7A54
/* 0EC368 802C79B8 0040282D */ daddu $a1, $v0, $zero /* 0EC368 802C79B8 0040282D */ daddu $a1, $v0, $zero
/* 0EC36C 802C79BC 0C0B1B1E */ jal si_handle_thread /* 0EC36C 802C79BC 0C0B1B1E */ jal si_handle_thread
/* 0EC370 802C79C0 0200202D */ daddu $a0, $s0, $zero /* 0EC370 802C79C0 0200202D */ daddu $a0, $s0, $zero
/* 0EC374 802C79C4 080B1E95 */ j si_handle_end /* 0EC374 802C79C4 080B1E95 */ j .L802C7A54
/* 0EC378 802C79C8 0040282D */ daddu $a1, $v0, $zero /* 0EC378 802C79C8 0040282D */ daddu $a1, $v0, $zero
/* 0EC37C 802C79CC 0C0B1B53 */ jal si_handle_end_thread /* 0EC37C 802C79CC 0C0B1B53 */ jal si_handle_end_thread
/* 0EC380 802C79D0 0200202D */ daddu $a0, $s0, $zero /* 0EC380 802C79D0 0200202D */ daddu $a0, $s0, $zero
/* 0EC384 802C79D4 080B1E95 */ j si_handle_end /* 0EC384 802C79D4 080B1E95 */ j .L802C7A54
/* 0EC388 802C79D8 0040282D */ daddu $a1, $v0, $zero /* 0EC388 802C79D8 0040282D */ daddu $a1, $v0, $zero
/* 0EC38C 802C79DC 0C0B1B5B */ jal si_handle_child_thread /* 0EC38C 802C79DC 0C0B1B5B */ jal si_handle_child_thread
/* 0EC390 802C79E0 0200202D */ daddu $a0, $s0, $zero /* 0EC390 802C79E0 0200202D */ daddu $a0, $s0, $zero
/* 0EC394 802C79E4 080B1E95 */ j si_handle_end /* 0EC394 802C79E4 080B1E95 */ j .L802C7A54
/* 0EC398 802C79E8 0040282D */ daddu $a1, $v0, $zero /* 0EC398 802C79E8 0040282D */ daddu $a1, $v0, $zero
/* 0EC39C 802C79EC 0C0B1B7D */ jal si_handle_end_child_thread /* 0EC39C 802C79EC 0C0B1B7D */ jal si_handle_end_child_thread
/* 0EC3A0 802C79F0 0200202D */ daddu $a0, $s0, $zero /* 0EC3A0 802C79F0 0200202D */ daddu $a0, $s0, $zero
/* 0EC3A4 802C79F4 080B1E95 */ j si_handle_end /* 0EC3A4 802C79F4 080B1E95 */ j .L802C7A54
/* 0EC3A8 802C79F8 0040282D */ daddu $a1, $v0, $zero /* 0EC3A8 802C79F8 0040282D */ daddu $a1, $v0, $zero
/* 0EC3AC 802C79FC 0C0B1B85 */ jal func_802C6E14 /* 0EC3AC 802C79FC 0C0B1B85 */ jal func_802C6E14
/* 0EC3B0 802C7A00 0200202D */ daddu $a0, $s0, $zero /* 0EC3B0 802C7A00 0200202D */ daddu $a0, $s0, $zero
/* 0EC3B4 802C7A04 080B1E95 */ j si_handle_end /* 0EC3B4 802C7A04 080B1E95 */ j .L802C7A54
/* 0EC3B8 802C7A08 0040282D */ daddu $a1, $v0, $zero /* 0EC3B8 802C7A08 0040282D */ daddu $a1, $v0, $zero
/* 0EC3BC 802C7A0C 0C0B1B87 */ jal si_handle_print_debug_var /* 0EC3BC 802C7A0C 0C0B1B87 */ jal si_handle_print_debug_var
/* 0EC3C0 802C7A10 0200202D */ daddu $a0, $s0, $zero /* 0EC3C0 802C7A10 0200202D */ daddu $a0, $s0, $zero
/* 0EC3C4 802C7A14 080B1E95 */ j si_handle_end /* 0EC3C4 802C7A14 080B1E95 */ j .L802C7A54
/* 0EC3C8 802C7A18 0040282D */ daddu $a1, $v0, $zero /* 0EC3C8 802C7A18 0040282D */ daddu $a1, $v0, $zero
/* 0EC3CC 802C7A1C 0C0B1CE7 */ jal func_802C739C /* 0EC3CC 802C7A1C 0C0B1CE7 */ jal func_802C739C
/* 0EC3D0 802C7A20 0200202D */ daddu $a0, $s0, $zero /* 0EC3D0 802C7A20 0200202D */ daddu $a0, $s0, $zero
/* 0EC3D4 802C7A24 080B1E95 */ j si_handle_end /* 0EC3D4 802C7A24 080B1E95 */ j .L802C7A54
/* 0EC3D8 802C7A28 0040282D */ daddu $a1, $v0, $zero /* 0EC3D8 802C7A28 0040282D */ daddu $a1, $v0, $zero
/* 0EC3DC 802C7A2C 0C0B1CEC */ jal func_802C73B0 /* 0EC3DC 802C7A2C 0C0B1CEC */ jal func_802C73B0
/* 0EC3E0 802C7A30 0200202D */ daddu $a0, $s0, $zero /* 0EC3E0 802C7A30 0200202D */ daddu $a0, $s0, $zero
/* 0EC3E4 802C7A34 080B1E95 */ j si_handle_end /* 0EC3E4 802C7A34 080B1E95 */ j .L802C7A54
/* 0EC3E8 802C7A38 0040282D */ daddu $a1, $v0, $zero /* 0EC3E8 802C7A38 0040282D */ daddu $a1, $v0, $zero
/* 0EC3EC 802C7A3C 0C0B1CEE */ jal func_802C73B8 /* 0EC3EC 802C7A3C 0C0B1CEE */ jal func_802C73B8
/* 0EC3F0 802C7A40 0200202D */ daddu $a0, $s0, $zero /* 0EC3F0 802C7A40 0200202D */ daddu $a0, $s0, $zero
/* 0EC3F4 802C7A44 080B1E95 */ j si_handle_end /* 0EC3F4 802C7A44 080B1E95 */ j .L802C7A54
/* 0EC3F8 802C7A48 0040282D */ daddu $a1, $v0, $zero /* 0EC3F8 802C7A48 0040282D */ daddu $a1, $v0, $zero
.L802C7A4C: .L802C7A4C:
/* 0EC3FC 802C7A4C 080B1E93 */ j .L802C7A4C /* 0EC3FC 802C7A4C 080B1E93 */ j .L802C7A4C
/* 0EC400 802C7A50 00000000 */ nop /* 0EC400 802C7A50 00000000 */ nop
.L802C7A54:
/* 0EC404 802C7A54 24020003 */ addiu $v0, $zero, 3
/* 0EC408 802C7A58 10A2FE6E */ beq $a1, $v0, .L802C7414
/* 0EC40C 802C7A5C 240200FF */ addiu $v0, $zero, 0xff
/* 0EC410 802C7A60 10A20012 */ beq $a1, $v0, .L802C7AAC
/* 0EC414 802C7A64 2402FFFF */ addiu $v0, $zero, -1
/* 0EC418 802C7A68 04A00010 */ bltz $a1, .L802C7AAC
/* 0EC41C 802C7A6C 24020001 */ addiu $v0, $zero, 1
/* 0EC420 802C7A70 50A0000E */ beql $a1, $zero, .L802C7AAC
/* 0EC424 802C7A74 0000102D */ daddu $v0, $zero, $zero
/* 0EC428 802C7A78 14A20003 */ bne $a1, $v0, .L802C7A88
/* 0EC42C 802C7A7C 24020002 */ addiu $v0, $zero, 2
/* 0EC430 802C7A80 080B1EAA */ j .L802C7AA8
/* 0EC434 802C7A84 A2000002 */ sb $zero, 2($s0)
.L802C7A88:
/* 0EC438 802C7A88 14A2FE62 */ bne $a1, $v0, .L802C7414
/* 0EC43C 802C7A8C 00000000 */ nop
/* 0EC440 802C7A90 A2000002 */ sb $zero, 2($s0)
/* 0EC444 802C7A94 3C028007 */ lui $v0, 0x8007
/* 0EC448 802C7A98 8C42419C */ lw $v0, 0x419c($v0)
/* 0EC44C 802C7A9C 80420078 */ lb $v0, 0x78($v0)
/* 0EC450 802C7AA0 1445FE5C */ bne $v0, $a1, .L802C7414
/* 0EC454 802C7AA4 00000000 */ nop
.L802C7AA8:
/* 0EC458 802C7AA8 0000102D */ daddu $v0, $zero, $zero
.L802C7AAC:
/* 0EC45C 802C7AAC 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EC460 802C7AB0 8FB00010 */ lw $s0, 0x10($sp)
/* 0EC464 802C7AB4 03E00008 */ jr $ra
/* 0EC468 802C7AB8 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,34 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_case_default
/* 0E9DF4 802C5444 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 0E9DF8 802C5448 AFB00010 */ sw $s0, 0x10($sp)
/* 0E9DFC 802C544C 0080802D */ daddu $s0, $a0, $zero
/* 0E9E00 802C5450 AFBF0014 */ sw $ra, 0x14($sp)
/* 0E9E04 802C5454 82020007 */ lb $v0, 7($s0)
/* 0E9E08 802C5458 04410003 */ bgez $v0, .L802C5468
/* 0E9E0C 802C545C 02021821 */ addu $v1, $s0, $v0
.L802C5460:
/* 0E9E10 802C5460 080B1518 */ j .L802C5460
/* 0E9E14 802C5464 00000000 */ nop
.L802C5468:
/* 0E9E18 802C5468 80620110 */ lb $v0, 0x110($v1)
/* 0E9E1C 802C546C 18400003 */ blez $v0, .L802C547C
/* 0E9E20 802C5470 00000000 */ nop
/* 0E9E24 802C5474 080B1522 */ j .L802C5488
/* 0E9E28 802C5478 A0600110 */ sb $zero, 0x110($v1)
.L802C547C:
/* 0E9E2C 802C547C 0C0B2279 */ jal si_goto_end_case
/* 0E9E30 802C5480 0200202D */ daddu $a0, $s0, $zero
/* 0E9E34 802C5484 AE020008 */ sw $v0, 8($s0)
.L802C5488:
/* 0E9E38 802C5488 24020002 */ addiu $v0, $zero, 2
/* 0E9E3C 802C548C 8FBF0014 */ lw $ra, 0x14($sp)
/* 0E9E40 802C5490 8FB00010 */ lw $s0, 0x10($sp)
/* 0E9E44 802C5494 03E00008 */ jr $ra
/* 0E9E48 802C5498 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,36 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel si_handle_end
/* 0EC404 802C7A54 24020003 */ addiu $v0, $zero, 3
/* 0EC408 802C7A58 10A2FE6E */ beq $a1, $v0, .L802C7414
/* 0EC40C 802C7A5C 240200FF */ addiu $v0, $zero, 0xff
/* 0EC410 802C7A60 10A20012 */ beq $a1, $v0, .L802C7AAC
/* 0EC414 802C7A64 2402FFFF */ addiu $v0, $zero, -1
/* 0EC418 802C7A68 04A00010 */ bltz $a1, .L802C7AAC
/* 0EC41C 802C7A6C 24020001 */ addiu $v0, $zero, 1
/* 0EC420 802C7A70 50A0000E */ beql $a1, $zero, .L802C7AAC
/* 0EC424 802C7A74 0000102D */ daddu $v0, $zero, $zero
/* 0EC428 802C7A78 14A20003 */ bne $a1, $v0, .L802C7A88
/* 0EC42C 802C7A7C 24020002 */ addiu $v0, $zero, 2
/* 0EC430 802C7A80 080B1EAA */ j .L802C7AA8
/* 0EC434 802C7A84 A2000002 */ sb $zero, 2($s0)
.L802C7A88:
/* 0EC438 802C7A88 14A2FE62 */ bne $a1, $v0, .L802C7414
/* 0EC43C 802C7A8C 00000000 */ nop
/* 0EC440 802C7A90 A2000002 */ sb $zero, 2($s0)
/* 0EC444 802C7A94 3C028007 */ lui $v0, 0x8007
/* 0EC448 802C7A98 8C42419C */ lw $v0, 0x419c($v0)
/* 0EC44C 802C7A9C 80420078 */ lb $v0, 0x78($v0)
/* 0EC450 802C7AA0 1445FE5C */ bne $v0, $a1, .L802C7414
/* 0EC454 802C7AA4 00000000 */ nop
.L802C7AA8:
/* 0EC458 802C7AA8 0000102D */ daddu $v0, $zero, $zero
.L802C7AAC:
/* 0EC45C 802C7AAC 8FBF0014 */ lw $ra, 0x14($sp)
/* 0EC460 802C7AB0 8FB00010 */ lw $s0, 0x10($sp)
/* 0EC464 802C7AB4 03E00008 */ jr $ra
/* 0EC468 802C7AB8 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -5,10 +5,13 @@ from os import remove
from sys import argv from sys import argv
import re import re
from glob import glob from glob import glob
from pathlib import Path
DIR = path.dirname(__file__) DIR = path.dirname(__file__)
C_FILES = glob(path.join(DIR, "src/*.c")) NONMATCHINGS_DIR = Path(path.join(DIR, "asm", "nonmatchings"))
ASM_FILES = glob(path.join(DIR, "asm/nonmatchings/**/*.s"))
C_FILES = Path(path.join(DIR, "src")).rglob("*.c")
ASM_FILES = NONMATCHINGS_DIR.rglob("*.s")
def strip_c_comments(text): def strip_c_comments(text):
def replacer(match): def replacer(match):
@ -67,7 +70,7 @@ if __name__ == "__main__":
exit(1) exit(1)
elif "--delete-matched" in argv or input("Delete them [y/N]? ").upper() == "Y": elif "--delete-matched" in argv or input("Delete them [y/N]? ").upper() == "Y":
for func in matched_but_undeleted_asm: for func in matched_but_undeleted_asm:
file = glob(path.join(DIR, f"asm/nonmatchings/*/{func}.s"))[0] f = next(NONMATCHINGS_DIR.rglob(func + ".s"))
remove(file) remove(f)
elif len(asm) != len(non_matched): elif len(asm) != len(non_matched):
print(f"warning: number of INCLUDE_ASM macros ({len(asm)}) != number of asm files ({len(non_matched)})") print(f"warning: number of INCLUDE_ASM macros ({len(asm)}) != number of asm files ({len(non_matched)})")

326
diff.py
View File

@ -1,48 +1,71 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import sys import sys
import re
import os
import ast
import argparse
import subprocess
import collections
import difflib
import string
import itertools
import threading
import queue
import time
def fail(msg): def fail(msg):
print(msg, file=sys.stderr) print(msg, file=sys.stderr)
sys.exit(1) sys.exit(1)
MISSING_PREREQUISITES = (
"Missing prerequisite python module {}. "
"Run `python3 -m pip install --user colorama ansiwrap attrs watchdog python-Levenshtein cxxfilt` to install prerequisites (cxxfilt only needed with --source)."
)
try:
import attr
from colorama import Fore, Style, Back
import ansiwrap
import watchdog
except ModuleNotFoundError as e:
fail(MISSING_PREREQUISITES.format(e.name))
# Prefer to use diff_settings.py from the current working directory # Prefer to use diff_settings.py from the current working directory
sys.path.insert(0, ".") sys.path.insert(0, ".")
try: try:
import diff_settings import diff_settings
except ModuleNotFoundError: except ModuleNotFoundError:
fail("Unable to find diff_settings.py in the same directory.") fail("Unable to find diff_settings.py in the same directory.")
sys.path.pop(0)
# ==== CONFIG ==== # ==== COMMAND-LINE ====
try:
import argcomplete # type: ignore
except ModuleNotFoundError:
argcomplete = None
import argparse
parser = argparse.ArgumentParser(description="Diff MIPS assembly.") parser = argparse.ArgumentParser(description="Diff MIPS assembly.")
parser.add_argument("start", help="Function name or address to start diffing from.")
start_argument = parser.add_argument("start", help="Function name or address to start diffing from.")
if argcomplete:
def complete_symbol(**kwargs):
prefix = kwargs["prefix"]
if prefix == "":
# skip reading the map file, which would
# result in a lot of useless completions
return []
parsed_args = kwargs["parsed_args"]
config = {}
diff_settings.apply(config, parsed_args)
mapfile = config.get("mapfile")
if not mapfile:
return []
completes = []
with open(mapfile) as f:
data = f.read()
# assume symbols are prefixed by a space character
search = f" {prefix}"
pos = data.find(search)
while pos != -1:
# skip the space character in the search string
pos += 1
# assume symbols are suffixed by either a space
# character or a (unix-style) line return
spacePos = data.find(" ", pos)
lineReturnPos = data.find("\n", pos)
if lineReturnPos == -1:
endPos = spacePos
elif spacePos == -1:
endPos = lineReturnPos
else:
endPos = min(spacePos, lineReturnPos)
if endPos == -1:
match = data[pos:]
pos = -1
else:
match = data[pos:endPos]
pos = data.find(search, endPos)
completes.append(match)
return completes
start_argument.completer = complete_symbol
parser.add_argument("end", nargs="?", help="Address to end diff at.") parser.add_argument("end", nargs="?", help="Address to end diff at.")
parser.add_argument( parser.add_argument(
"-o", "-o",
@ -52,6 +75,7 @@ parser.add_argument(
) )
parser.add_argument( parser.add_argument(
"-e", "-e",
"--elf",
dest="diff_elf_symbol", dest="diff_elf_symbol",
help="Diff a given function in two ELFs, one being stripped and the other one non-stripped. Requires objdump from binutils 2.33+.", help="Diff a given function in two ELFs, one being stripped and the other one non-stripped. Requires objdump from binutils 2.33+.",
) )
@ -132,6 +156,14 @@ parser.add_argument(
help="Automatically update when source/object files change. " help="Automatically update when source/object files change. "
"Recommended in combination with -m.", "Recommended in combination with -m.",
) )
parser.add_argument(
"-3",
"--threeway",
dest="threeway",
action="store_true",
help="Show a three-way diff between target asm, current asm, and asm "
"prior to -w rebuild. Requires -w.",
)
parser.add_argument( parser.add_argument(
"--width", "--width",
dest="column_width", dest="column_width",
@ -146,7 +178,6 @@ parser.add_argument(
choices=["levenshtein", "difflib"], choices=["levenshtein", "difflib"],
help="Diff algorithm to use.", help="Diff algorithm to use.",
) )
parser.add_argument( parser.add_argument(
"--max-size", "--max-size",
"--max-lines", "--max-lines",
@ -158,12 +189,44 @@ parser.add_argument(
# Project-specific flags, e.g. different versions/make arguments. # Project-specific flags, e.g. different versions/make arguments.
if hasattr(diff_settings, "add_custom_arguments"): if hasattr(diff_settings, "add_custom_arguments"):
diff_settings.add_custom_arguments(parser) diff_settings.add_custom_arguments(parser) # type: ignore
if argcomplete:
argcomplete.autocomplete(parser)
# ==== IMPORTS ====
import re
import os
import ast
import subprocess
import difflib
import string
import itertools
import threading
import queue
import time
from typing import Any, Dict, List, NamedTuple, Optional, Set, Tuple, Union
MISSING_PREREQUISITES = (
"Missing prerequisite python module {}. "
"Run `python3 -m pip install --user colorama ansiwrap watchdog python-Levenshtein cxxfilt` to install prerequisites (cxxfilt only needed with --source)."
)
try:
from colorama import Fore, Style, Back # type: ignore
import ansiwrap # type: ignore
import watchdog # type: ignore
except ModuleNotFoundError as e:
fail(MISSING_PREREQUISITES.format(e.name))
# ==== CONFIG ====
args = parser.parse_args() args = parser.parse_args()
# Set imgs, map file and make flags in a project-specific manner. # Set imgs, map file and make flags in a project-specific manner.
config = {} config: Dict[str, Any] = {}
diff_settings.apply(config, args) diff_settings.apply(config, args)
arch = config.get("arch", "mips") arch = config.get("arch", "mips")
@ -199,13 +262,13 @@ FS_WATCH_EXTENSIONS = [".c", ".h"]
if args.algorithm == "levenshtein": if args.algorithm == "levenshtein":
try: try:
import Levenshtein import Levenshtein # type: ignore
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
fail(MISSING_PREREQUISITES.format(e.name)) fail(MISSING_PREREQUISITES.format(e.name))
if args.source: if args.source:
try: try:
import cxxfilt import cxxfilt # type: ignore
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
fail(MISSING_PREREQUISITES.format(e.name)) fail(MISSING_PREREQUISITES.format(e.name))
@ -538,22 +601,21 @@ def process_mips_reloc(row, prev):
return before + repl + after return before + repl + after
def cleanup_whitespace(line): def pad_mnemonic(line):
return "".join(f"{o:<8s}" for o in line.strip().split("\t")) if "\t" not in line:
return line
mn, args = line.split("\t", 1)
return f"{mn:<7s} {args}"
Line = collections.namedtuple( class Line(NamedTuple):
"Line", mnemonic: str
[ diff_row: str
"mnemonic", original: str
"diff_row", line_num: str
"original", branch_target: Optional[str]
"line_num", source_lines: List[str]
"branch_target", comment: Optional[str]
"source_lines",
"comment",
],
)
def process(lines): def process(lines):
@ -565,6 +627,7 @@ def process(lines):
lines.pop() lines.pop()
output = [] output = []
stop_after_delay_slot = False
for row in lines: for row in lines:
if args.diff_obj and (">:" in row or not row): if args.diff_obj and (">:" in row or not row):
continue continue
@ -634,18 +697,15 @@ def process(lines):
source_lines = [] source_lines = []
if args.stop_jrra and mnemonic == "jr" and row_parts[1].strip() == "ra": if args.stop_jrra and mnemonic == "jr" and row_parts[1].strip() == "ra":
stop_after_delay_slot = True
elif stop_after_delay_slot:
break break
# Cleanup whitespace, after relocation fixups have happened
output = [
line._replace(original=cleanup_whitespace(line.original)) for line in output
]
return output return output
def format_single_line_diff(line1, line2, column_width): def format_single_line_diff(line1, line2, column_width):
return f"{ansi_ljust(line1,column_width)}{ansi_ljust(line2,column_width)}" return f"{ansi_ljust(line1,column_width)}{line2}"
class SymbolColorer: class SymbolColorer:
@ -743,11 +803,27 @@ def diff_sequences(seq1, seq2):
return Levenshtein.opcodes(seq1, seq2) return Levenshtein.opcodes(seq1, seq2)
def do_diff(basedump, mydump): class OutputLine:
output = [] base: Optional[str]
fmt2: str
key2: str
# TODO: status line? def __init__(self, base: Optional[str], fmt2: str, key2: str) -> None:
# output.append(sha1sum(mydump)) self.base = base
self.fmt2 = fmt2
self.key2 = key2
def __eq__(self, other: object) -> bool:
if not isinstance(other, OutputLine):
return NotImplemented
return self.key2 == other.key2
def __hash__(self) -> int:
return hash(self.key2)
def do_diff(basedump: str, mydump: str) -> List[OutputLine]:
output: List[OutputLine] = []
lines1 = process(basedump.split("\n")) lines1 = process(basedump.split("\n"))
lines2 = process(mydump.split("\n")) lines2 = process(mydump.split("\n"))
@ -758,8 +834,8 @@ def do_diff(basedump, mydump):
sc4 = SymbolColorer(4) sc4 = SymbolColorer(4)
sc5 = SymbolColorer(0) sc5 = SymbolColorer(0)
sc6 = SymbolColorer(0) sc6 = SymbolColorer(0)
bts1 = set() bts1: Set[str] = set()
bts2 = set() bts2: Set[str] = set()
if args.show_branches: if args.show_branches:
for (lines, btset, sc) in [ for (lines, btset, sc) in [
@ -856,39 +932,35 @@ def do_diff(basedump, mydump):
out2 = line2.original out2 = line2.original
elif line1: elif line1:
line_prefix = "<" line_prefix = "<"
line_color1 = line_color2 = sym_color = Fore.RED line_color1 = sym_color = Fore.RED
out1 = line1.original out1 = line1.original
out2 = "" out2 = ""
elif line2: elif line2:
line_prefix = ">" line_prefix = ">"
line_color1 = line_color2 = sym_color = Fore.GREEN line_color2 = sym_color = Fore.GREEN
out1 = "" out1 = ""
out2 = line2.original out2 = line2.original
in_arrow1 = " "
in_arrow2 = " "
out_arrow1 = ""
out_arrow2 = ""
if args.show_branches and line1:
if line1.line_num in bts1:
in_arrow1 = sc5.color_symbol(line1.line_num, "~>") + line_color1
if line1.branch_target is not None:
out_arrow1 = " " + sc5.color_symbol(line1.branch_target + ":", "~>")
if args.show_branches and line2:
if line2.line_num in bts2:
in_arrow2 = sc6.color_symbol(line2.line_num, "~>") + line_color2
if line2.branch_target is not None:
out_arrow2 = " " + sc6.color_symbol(line2.branch_target + ":", "~>")
if args.source and line2 and line2.comment: if args.source and line2 and line2.comment:
out2 += f" {line2.comment}" out2 += f" {line2.comment}"
line_num1 = line1.line_num if line1 else "" def format_part(out: str, line: Optional[Line], line_color: str, btset: Set[str], sc: SymbolColorer) -> Optional[str]:
line_num2 = line2.line_num if line2 else "" if line is None:
return None
in_arrow = " "
out_arrow = ""
if args.show_branches:
if line.line_num in btset:
in_arrow = sc.color_symbol(line.line_num, "~>") + line_color
if line.branch_target is not None:
out_arrow = " " + sc.color_symbol(line.branch_target + ":", "~>")
out = pad_mnemonic(out)
return f"{line_color}{line.line_num} {in_arrow} {out}{Style.RESET_ALL}{out_arrow}"
part1 = format_part(out1, line1, line_color1, bts1, sc5)
part2 = format_part(out2, line2, line_color2, bts2, sc6)
key2 = line2.original if line2 else ""
out1 = f"{line_color1}{line_num1} {in_arrow1} {out1}{Style.RESET_ALL}{out_arrow1}"
out2 = f"{line_color2}{line_num2} {in_arrow2} {out2}{Style.RESET_ALL}{out_arrow2}"
mid = f"{sym_color}{line_prefix}" mid = f"{sym_color}{line_prefix}"
if line2: if line2:
@ -907,22 +979,82 @@ def do_diff(basedump, mydump):
) )
except: except:
pass pass
output.append( output.append(OutputLine(None, f" {color}{source_line}{Style.RESET_ALL}", source_line))
format_single_line_diff(
"",
f" {color}{source_line}{Style.RESET_ALL}",
args.column_width,
)
)
output.append(format_single_line_diff(out1, mid + out2, args.column_width)) fmt2 = mid + " " + (part2 or "")
output.append(OutputLine(part1, fmt2, key2))
return output[args.skip_lines :] return output
def chunk_diff(diff: List[OutputLine]) -> List[Union[List[OutputLine], OutputLine]]:
cur_right: List[OutputLine] = []
chunks: List[Union[List[OutputLine], OutputLine]] = []
for output_line in diff:
if output_line.base is not None:
chunks.append(cur_right)
chunks.append(output_line)
cur_right = []
else:
cur_right.append(output_line)
chunks.append(cur_right)
return chunks
def format_diff(old_diff: List[OutputLine], new_diff: List[OutputLine]) -> Tuple[str, List[str]]:
old_chunks = chunk_diff(old_diff)
new_chunks = chunk_diff(new_diff)
output: List[Tuple[str, OutputLine, OutputLine]] = []
assert len(old_chunks) == len(new_chunks), "same target"
empty = OutputLine("", "", "")
for old_chunk, new_chunk in zip(old_chunks, new_chunks):
if isinstance(old_chunk, list):
assert isinstance(new_chunk, list)
if not old_chunk and not new_chunk:
# Most of the time lines sync up without insertions/deletions,
# and there's no interdiffing to be done.
continue
differ = difflib.SequenceMatcher(a=old_chunk, b=new_chunk, autojunk=False)
for (tag, i1, i2, j1, j2) in differ.get_opcodes():
if tag in ["equal", "replace"]:
for i, j in zip(range(i1, i2), range(j1, j2)):
output.append(("", old_chunk[i], new_chunk[j]))
elif tag == "insert":
for j in range(j1, j2):
output.append(("", empty, new_chunk[j]))
else:
for i in range(i1, i2):
output.append(("", old_chunk[i], empty))
else:
assert isinstance(new_chunk, OutputLine)
# old_chunk.base and new_chunk.base have the same text since
# both diffs are based on the same target, but they might
# differ in color. Use the new version.
output.append((new_chunk.base or "", old_chunk, new_chunk))
# TODO: status line, with e.g. approximate permuter score?
width = args.column_width
if args.threeway:
header_line = "TARGET".ljust(width) + " CURRENT".ljust(width) + " PREVIOUS"
diff_lines = [
ansi_ljust(base, width)
+ ansi_ljust(new.fmt2, width)
+ (old.fmt2 or "-" if old != new else "")
for (base, old, new) in output
]
else:
header_line = ""
diff_lines = [
ansi_ljust(base, width) + new.fmt2
for (base, old, new) in output
if base or new.key2
]
return header_line, diff_lines
def debounced_fs_watch(targets, outq, debounce_delay): def debounced_fs_watch(targets, outq, debounce_delay):
import watchdog.events import watchdog.events # type: ignore
import watchdog.observers import watchdog.observers # type: ignore
class WatchEventHandler(watchdog.events.FileSystemEventHandler): class WatchEventHandler(watchdog.events.FileSystemEventHandler):
def __init__(self, queue, file_targets): def __init__(self, queue, file_targets):
@ -993,12 +1125,18 @@ class Display:
self.basedump = basedump self.basedump = basedump
self.mydump = mydump self.mydump = mydump
self.emsg = None self.emsg = None
self.last_diff_output = None
def run_less(self): def run_less(self):
if self.emsg is not None: if self.emsg is not None:
output = self.emsg output = self.emsg
else: else:
output = "\n".join(do_diff(self.basedump, self.mydump)) diff_output = do_diff(self.basedump, self.mydump)
last_diff_output = self.last_diff_output or diff_output
self.last_diff_output = diff_output
header, diff_lines = format_diff(last_diff_output, diff_output)
header_lines = [header] if header else []
output = "\n".join(header_lines + diff_lines[args.skip_lines :])
# Pipe the output through 'tail' and only then to less, to ensure the # Pipe the output through 'tail' and only then to less, to ensure the
# write call doesn't block. ('tail' has to buffer all its input before # write call doesn't block. ('tail' has to buffer all its input before

View File

@ -1,13 +1,13 @@
#!/bin/bash #!/bin/bash
COMPILER_OPTS="-fno-builtin -std=gnu89 -Iinclude -Isrc -D_LANGUAGE_C" COMPILER_OPTS="-std=gnu89 -Iinclude -Isrc -D_LANGUAGE_C"
shopt -s globstar shopt -s globstar
FILES="src/**/*.c include/*.h" FILES="src/**/*.c include/*.h"
if (( $# > 0 )); then if (( $# > 0 )); then
# only process .c and .h files # only process .c and .h files
FILES=$(echo "$@" | sed 's/ /\n/g' | grep '.[ch]$') FILES=$(echo "$@" | sed 's/ /\n/g' | grep '\.[ch]$')
fi fi
if [[ -z $FILES ]]; then if [[ -z $FILES ]]; then

View File

@ -247,7 +247,7 @@ typedef struct ScriptInstance {
/* 0x0C4 */ s32 varFlags[3]; /* 0x0C4 */ s32 varFlags[3];
/* 0x0D0 */ s32 loopStartTable[8]; /* 0x0D0 */ s32 loopStartTable[8];
/* 0x0F0 */ s32 loopCounterTable[8]; /* 0x0F0 */ s32 loopCounterTable[8];
/* 0x110 */ u8 switchBlockState[8]; /* 0x110 */ s8 switchBlockState[8];
/* 0x118 */ s32 switchBlockValue[8]; /* 0x118 */ s32 switchBlockValue[8];
/* 0x138 */ s32* buffer; /* 0x138 */ s32* buffer;
/* 0x13C */ s32* array; /* 0x13C */ s32* array;
@ -879,7 +879,7 @@ typedef struct GameStatus {
/* 0x0BA */ s16 bootGreen; /* 0x0BA */ s16 bootGreen;
/* 0x0BC */ s16 bootRed; /* 0x0BC */ s16 bootRed;
/* 0x0BE */ char unk_BE[106]; /* 0x0BE */ char unk_BE[106];
/* 0x128 */ f32 playerTraceNormal[3]; /* 0x128 */ Vec3f playerTraceNormal;
/* 0x134 */ u16 frameCounter; /* 0x134 */ u16 frameCounter;
/* 0x136 */ char unk_136[2]; /* 0x136 */ char unk_136[2];
/* 0x138 */ s32 nextRNG; /* 0x138 */ s32 nextRNG;
@ -1429,4 +1429,33 @@ typedef struct EncounterStatus {
/* 0x98 */ s32 unk_98; /* 0x98 */ s32 unk_98;
} EncounterStatus; // size = 0x9C } EncounterStatus; // size = 0x9C
typedef struct SaveData {
/* 0x0000 */ char magicString[16]; /* "Mario Story 006" string */
/* 0x0010 */ s8 pad[32]; /* always zero */
/* 0x0030 */ s32 crc1;
/* 0x0034 */ s32 crc2;
/* 0x0038 */ s32 saveSlot;
/* 0x003C */ s32 saveCount;
/* 0x0040 */ struct PlayerData player;
/* 0x0380 */ char unk_380[0xE0];
/* 0x0460 */ s32 starPoints;
/* 0x0464 */ char unk_464[4];
/* 0x0468 */ s16 areaID;
/* 0x046A */ s16 mapID;
/* 0x046C */ s16 entryID;
/* 0x046E */ char unk_46E[2];
/* 0x0470 */ s32 enemyDefeatFlags[720];
/* 0x0FB0 */ s8 globalFlags[256];
/* 0x10B0 */ s8 globalBytes[512];
/* 0x12B0 */ s32 areaFlags[8];
/* 0x12D0 */ s8 areaBytes[16];
/* 0x12E0 */ char unk_12E0[6];
/* 0x12E6 */ s16 savePos[3];
/* 0x12EC */ s32 unk_12EC;
/* 0x12F0 */ s8 unk_12F0[12]; /* player name starts at 4th char */
/* 0x12FC */ s32 unk_12FC;
/* 0x1300 */ s32 unk_1300;
/* 0x1304 */ char unk_1304[0x7C];
} SaveData; // size = 0x1380
#endif #endif

View File

@ -10,7 +10,16 @@ void osCleanupThread(void);
s32 heap_malloc(s32 size); s32 heap_malloc(s32 size);
HeapNode* _heap_create(void* addr, s32 size); HeapNode* _heap_create(void* addr, s32 size);
s8 get_global_byte(s32 index);
s32 get_global_flag(s32 index);
s8 get_area_byte(s32 index);
s32 get_area_flag(s32 index);
void clone_model(u16 srcModelID, u16 newModelID); void clone_model(u16 srcModelID, u16 newModelID);
Model* get_model_from_list_index(s32 listIndex);
void get_model_center_and_size(s32 modelID, f32* centerX, f32* centerY, f32* centerZ, f32* sizeX, f32* sizeY,
f32* sizeZ);
void update_collider_transform(s16 colliderID); void update_collider_transform(s16 colliderID);
void get_collider_center(s32 colliderID, f32* x, f32* y, f32* z); void get_collider_center(s32 colliderID, f32* x, f32* y, f32* z);
@ -31,6 +40,7 @@ s32 func_80055464(s32, s32);
s32 func_800554A4(s32, s32); s32 func_800554A4(s32, s32);
s32 func_800554E8(s32, s32); s32 func_800554E8(s32, s32);
s32 func_800555E4(s32); s32 func_800555E4(s32);
s32 osGetId();
void func_8011B7C0(u16, s32, s32); void func_8011B7C0(u16, s32, s32);
void func_80137D88(s32, f32); void func_80137D88(s32, f32);
void func_80137DA4(s32, f32); void func_80137DA4(s32, f32);

View File

@ -8,5 +8,10 @@
#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) #define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0]))
#define ASSERT(condition) if (!(condition)) { while (1) {} } #define ASSERT(condition) if (!(condition)) { while (1) {} }
#define PANIC() ASSERT(0)
#define GAME_STATUS (*gGameStatusPtr)
#define SQ(x) (x*x)
#endif #endif

View File

@ -12,6 +12,7 @@ extern ActionState gPlayerActionState;
extern PlayerAnim gPlayerAnimation; extern PlayerAnim gPlayerAnimation;
extern PlayerStatus gPlayerStatus; extern PlayerStatus gPlayerStatus;
extern GameStatus* gGameStatusPtr[1]; extern GameStatus* gGameStatusPtr[1];
extern s32 gRandSeed;
extern StaticItem gItemTable[364]; extern StaticItem gItemTable[364];
extern s16 gMainGameState; /* 0 = battle, 1 = pause, 2 = world */ extern s16 gMainGameState; /* 0 = battle, 1 = pause, 2 = world */
extern UNK_FUN_PTR(gCurrentUpdateFunction); extern UNK_FUN_PTR(gCurrentUpdateFunction);
@ -94,4 +95,9 @@ extern s8 D_8010EBB0;
//nusys //nusys
extern OSPiHandle* carthandle; extern OSPiHandle* carthandle;
extern SaveData gCurrentSaveFile;
extern u32* gMapFlags;
extern u32* gMapVars;
#endif #endif

View File

@ -1,3 +1,31 @@
#include "common.h" #include "common.h"
INCLUDE_ASM("code_39210_len_aa0", get_npc_pos); void get_npc_pos(s32 arg0, f32* outX, f32* outY, f32* outZ, s32* arg4) {
PlayerStatus* playerStatus = &gPlayerStatus;
Npc* npc;
s32 phi_v0;
*outX = 0.0f;
*outY = 0.0f;
*outZ = 0.0f;
*arg4 = 0;
if (arg0 == -1) {
*outX = playerStatus->position.x;
*outY = playerStatus->position.y;
*outZ = playerStatus->position.z;
phi_v0 = playerStatus->flags & 6;
} else {
npc = get_npc_unsafe(arg0);
*outX = npc->pos.x;
*outY = npc->pos.y;
*outZ = npc->pos.z;
phi_v0 = npc->flags & 0x800;
}
if (phi_v0 != 0) {
*arg4 = 1;
}
}
INCLUDE_ASM("code_39210_len_aa0", func_8005DECC);

View File

@ -1,6 +1,10 @@
#include "common.h" #include "common.h"
INCLUDE_ASM("code_42e0_len_1f60", poll_rumble); void poll_rumble(void) {
// TODO: replace with defines
nuContRmbCheck(0);
nuContRmbModeSet(0, 2);
}
INCLUDE_ASM("code_42e0_len_1f60", start_rumble); INCLUDE_ASM("code_42e0_len_1f60", start_rumble);
@ -8,7 +12,9 @@ INCLUDE_ASM("code_42e0_len_1f60", func_80028F8C);
INCLUDE_ASM("code_42e0_len_1f60", func_80028FE0); INCLUDE_ASM("code_42e0_len_1f60", func_80028FE0);
INCLUDE_API_ASM("code_42e0_len_1f60", length2D); f32 length2D(f32 x, f32 y) {
return sqrtf(SQ(x) + SQ(y));
}
HeapNode* INCLUDE_ASM("code_42e0_len_1f60", _heap_create, void* addr, s32 size); HeapNode* INCLUDE_ASM("code_42e0_len_1f60", _heap_create, void* addr, s32 size);
@ -22,21 +28,42 @@ INCLUDE_ASM("code_42e0_len_1f60", _heap_realloc);
INCLUDE_API_ASM("code_42e0_len_1f60", cosine); INCLUDE_API_ASM("code_42e0_len_1f60", cosine);
INCLUDE_API_ASM("code_42e0_len_1f60", sign); s32 sign(s32 val) {
s32 sign = -1;
if (val >= 0) {
sign = val > 0;
}
return sign;
}
INCLUDE_ASM("code_42e0_len_1f60", int_to_string); INCLUDE_ASM("code_42e0_len_1f60", int_to_string);
INCLUDE_ASM("code_42e0_len_1f60", mem_clear); void mem_clear(s8* data, s32 numBytes) {
while (numBytes > 0) {
*data = 0;
data++;
numBytes--;
}
}
INCLUDE_ASM("code_42e0_len_1f60", transform_point); INCLUDE_ASM("code_42e0_len_1f60", transform_point);
INCLUDE_ASM("code_42e0_len_1f60", copy_matrix); void copy_matrix(Matrix4f* src, Matrix4f* dest) {
bcopy(src, dest, sizeof(Matrix4f));
}
INCLUDE_ASM("code_42e0_len_1f60", dma_copy); INCLUDE_ASM("code_42e0_len_1f60", dma_copy);
INCLUDE_ASM("code_42e0_len_1f60", func_80029860); INCLUDE_ASM("code_42e0_len_1f60", func_80029860);
INCLUDE_ASM("code_42e0_len_1f60", _advance_rng); s32 _advance_rng(void) {
s32* rngVal = &gRandSeed;
(*gGameStatusPtr)->nextRNG = *rngVal = (*rngVal * 0x5D588B65) + 1;
return *rngVal;
}
INCLUDE_ASM("code_42e0_len_1f60", func_80029934); INCLUDE_ASM("code_42e0_len_1f60", func_80029934);
@ -44,23 +71,58 @@ INCLUDE_ASM("code_42e0_len_1f60", func_80029994);
s32 INCLUDE_ASM("code_42e0_len_1f60", rand_int, s32 arg0); s32 INCLUDE_ASM("code_42e0_len_1f60", rand_int, s32 arg0);
INCLUDE_API_ASM("code_42e0_len_1f60", signF); f32 signF(f32 val) {
f32 sign;
if (!(val > 0.0f)) {
sign = -1.0f;
if (!(val < 0.0f)) {
sign = 0.0f;
}
} else {
sign = 1.0f;
}
return sign;
}
INCLUDE_API_ASM("code_42e0_len_1f60", round); INCLUDE_API_ASM("code_42e0_len_1f60", round);
f32 INCLUDE_ASM("code_42e0_len_1f60", clamp_angle, f32 theta); f32 INCLUDE_ASM("code_42e0_len_1f60", clamp_angle, f32 theta);
INCLUDE_ASM("code_42e0_len_1f60", get_clamped_angle_diff); f32 get_clamped_angle_diff(f32 a, f32 b) {
if (fabsf(b - a) >= 180.0f) {
if (b < a) {
b += 360.0f;
} else {
b -= 360.0f;
}
}
return b - a;
}
f32 INCLUDE_ASM("code_42e0_len_1f60", atan2, f32 startX, f32 startZ, f32 endX, f32 endZ); f32 INCLUDE_ASM("code_42e0_len_1f60", atan2, f32 startX, f32 startZ, f32 endX, f32 endZ);
INCLUDE_ASM("code_42e0_len_1f60", get_player_normal_yaw); f32 get_player_normal_yaw(void) {
return atan2(0, 0, (*gGameStatusPtr)->playerTraceNormal.x, (*gGameStatusPtr)->playerTraceNormal.z);
}
INCLUDE_ASM("code_42e0_len_1f60", get_player_normal_pitch); INCLUDE_ASM("code_42e0_len_1f60", get_player_normal_pitch);
f32 INCLUDE_ASM("code_42e0_len_1f60", dist2D, f32 ax, f32 ay, f32 bx, f32 by); f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by) {
f32 xDiff = bx - ax;
f32 yDiff = by - ay;
f32 INCLUDE_ASM("code_42e0_len_1f60", dist3D, f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz); return sqrtf(SQ(xDiff) + SQ(yDiff));
}
f32 dist3D(f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz) {
f32 xDiff = bx - ax;
f32 yDiff = by - ay;
f32 zDiff = bz - az;
return sqrtf(SQ(xDiff) + SQ(yDiff) + SQ(zDiff));
}
void INCLUDE_ASM("code_42e0_len_1f60", add_vec2D_polar, f32* x, f32* y, f32 r, f32 theta); void INCLUDE_ASM("code_42e0_len_1f60", add_vec2D_polar, f32* x, f32* y, f32 r, f32 theta);

View File

@ -33,7 +33,7 @@ s32 func_8002ACDC(void) {
} }
s32 heap_malloc(s32 size) { s32 heap_malloc(s32 size) {
if ((*gGameStatusPtr)->isBattle == 0) { if (GAME_STATUS->isBattle == 0) {
return general_heap_malloc(size); return general_heap_malloc(size);
} else { } else {
return _heap_malloc(&D_803DA800, size); return _heap_malloc(&D_803DA800, size);
@ -41,7 +41,7 @@ s32 heap_malloc(s32 size) {
} }
s32 heap_free(s32 size) { s32 heap_free(s32 size) {
if ((*gGameStatusPtr)->isBattle != 0) { if (GAME_STATUS->isBattle != 0) {
return _heap_free(&D_803DA800, size); return _heap_free(&D_803DA800, size);
} else { } else {
return general_heap_free(size); return general_heap_free(size);
@ -56,7 +56,7 @@ s32 collision_heap_create(void) {
} }
s32 collision_heap_malloc(s32 size) { s32 collision_heap_malloc(s32 size) {
if (!(*gGameStatusPtr)->isBattle) { if (!GAME_STATUS->isBattle) {
return _heap_malloc(&D_80268000, size); return _heap_malloc(&D_80268000, size);
} else { } else {
return _heap_malloc(&D_803DA800, size); return _heap_malloc(&D_803DA800, size);
@ -64,7 +64,7 @@ s32 collision_heap_malloc(s32 size) {
} }
s32 collision_heap_free(void* data) { s32 collision_heap_free(void* data) {
if ((*gGameStatusPtr)->isBattle) { if (GAME_STATUS->isBattle) {
return _heap_free(&D_803DA800, data); return _heap_free(&D_803DA800, data);
} else { } else {
return _heap_free(&D_80268000, data); return _heap_free(&D_80268000, data);

View File

@ -22,13 +22,36 @@ INCLUDE_ASM("code_a5dd0_len_114e0", func_80110374);
INCLUDE_ASM("code_a5dd0_len_114e0", func_801104A4); INCLUDE_ASM("code_a5dd0_len_114e0", func_801104A4);
INCLUDE_ASM("code_a5dd0_len_114e0", get_entity_by_index); Entity* get_entity_by_index(s32 index) {
return (*gCurrentEntityListPtr)[index & 0xFFF];
}
INCLUDE_ASM("code_a5dd0_len_114e0", get_shadow_by_index); Shadow* get_shadow_by_index(s32 index) {
return (*gCurrentShadowListPtr)[index & 0xFFF];
}
INCLUDE_ASM("code_a5dd0_len_114e0", get_entity_list); Entity** get_entity_list(void) {
Entity** ret;
if (!GAME_STATUS->isBattle) {
ret = gWorldEntityList;
} else {
ret = gBattleEntityList;
}
return ret;
}
Shadow** get_shadow_list(void) {
Shadow** ret;
if (!GAME_STATUS->isBattle) {
ret = gWorldShadowList;
} else {
ret = gBattleShadowList;
}
return ret;
}
INCLUDE_ASM("code_a5dd0_len_114e0", get_shadow_list);
INCLUDE_ASM("code_a5dd0_len_114e0", func_80110678); INCLUDE_ASM("code_a5dd0_len_114e0", func_80110678);
@ -44,7 +67,9 @@ INCLUDE_ASM("code_a5dd0_len_114e0", func_801108B8);
INCLUDE_ASM("code_a5dd0_len_114e0", test_player_entity_aabb); INCLUDE_ASM("code_a5dd0_len_114e0", test_player_entity_aabb);
INCLUDE_ASM("code_a5dd0_len_114e0", is_player_action_state); s32 is_player_action_state(ActionState actionState) {
return actionState == gPlayerActionState;
}
INCLUDE_ASM("code_a5dd0_len_114e0", func_80110BCC); INCLUDE_ASM("code_a5dd0_len_114e0", func_80110BCC);
@ -154,7 +179,9 @@ INCLUDE_ASM("code_a5dd0_len_114e0", func_80117E74);
INCLUDE_ASM("code_a5dd0_len_114e0", func_801180E8); INCLUDE_ASM("code_a5dd0_len_114e0", func_801180E8);
INCLUDE_ASM("code_a5dd0_len_114e0", get_model_from_list_index); Model* get_model_from_list_index(s32 listIndex) {
return (*gCurrentModelListPtr)[listIndex];
}
INCLUDE_ASM("code_a5dd0_len_114e0", load_data_for_models); INCLUDE_ASM("code_a5dd0_len_114e0", load_data_for_models);
@ -164,7 +191,8 @@ INCLUDE_ASM("code_a5dd0_len_114e0", get_model_list_index_from_tree_index);
INCLUDE_ASM("code_a5dd0_len_114e0", func_8011B090); INCLUDE_ASM("code_a5dd0_len_114e0", func_8011B090);
INCLUDE_ASM("code_a5dd0_len_114e0", get_model_center_and_size); void INCLUDE_ASM("code_a5dd0_len_114e0", get_model_center_and_size, s32 modelID, f32* centerX, f32* centerY,
f32* centerZ, f32* sizeX, f32* sizeY, f32* sizeZ);
INCLUDE_ASM("code_a5dd0_len_114e0", func_8011B1C0); INCLUDE_ASM("code_a5dd0_len_114e0", func_8011B1C0);
@ -184,13 +212,15 @@ INCLUDE_ASM("code_a5dd0_len_114e0", func_8011B950);
INCLUDE_ASM("code_a5dd0_len_114e0", func_8011BAE8); INCLUDE_ASM("code_a5dd0_len_114e0", func_8011BAE8);
INCLUDE_ASM("code_a5dd0_len_114e0", set_fog_color); INCLUDE_ASM("code_a5dd0_len_114e0", set_world_fog_color);
INCLUDE_ASM("code_a5dd0_len_114e0", func_8011BBA4); INCLUDE_ASM("code_a5dd0_len_114e0", func_8011BBA4);
INCLUDE_ASM("code_a5dd0_len_114e0", get_fog_color); INCLUDE_ASM("code_a5dd0_len_114e0", get_fog_color);
INCLUDE_ASM("code_a5dd0_len_114e0", set_tex_panner); void set_tex_panner(Model* model, s8 texPannerID) {
model->texPannerID = texPannerID;
}
INCLUDE_ASM("code_a5dd0_len_114e0", set_main_pan_u); INCLUDE_ASM("code_a5dd0_len_114e0", set_main_pan_u);

View File

@ -6,20 +6,115 @@ INCLUDE_ASM("code_dba20_len_350", clear_area_flags);
INCLUDE_ASM("code_dba20_len_350", clear_global_flag); INCLUDE_ASM("code_dba20_len_350", clear_global_flag);
#ifdef NON_MATCHING
s32 set_global_flag(s32 index) {
//SaveData* saveFile = &gCurrentSaveFile;
s32 flag;
if (index <= -120000000) {
index += 130000000;
}
flag = gCurrentSaveFile->globalFlags[index / 32] & (1 << (index % 32));
if (flag) {
flag = 1;
}
gCurrentSaveFile->globalFlags[index / 32] |= (1 << (index % 32));
return flag;
}
#else
INCLUDE_ASM("code_dba20_len_350", set_global_flag); INCLUDE_ASM("code_dba20_len_350", set_global_flag);
#endif
INCLUDE_ASM("code_dba20_len_350", get_global_flag); #ifdef NON_MATCHING
s32 get_global_flag(s32 index) {
s32 bitIdx;
s32 wordIdx;
s32 bit;
s32 phi_return;
INCLUDE_ASM("code_dba20_len_350", set_global_byte); if (index <= -120000000) {
index += 130000000;
}
wordIdx = index / 32;
bitIdx = index % 32;
bit = gCurrentSaveFile->globalFlags[wordIdx] & (1 << bitIdx);
INCLUDE_ASM("code_dba20_len_350", get_global_byte); if (bit != 0) {
bit = 1;
}
return bit;
//return (bit != 0) ? 1 : bit; // ??? surely this is `bit != 0`
}
#else
s32 INCLUDE_ASM("code_dba20_len_350", get_global_flag, s32 index);
#endif
s8 set_global_byte(s32 index, s8 value) {
SaveData* saveFile = &gCurrentSaveFile;
s32 ret = saveFile->globalBytes[index];
saveFile->globalBytes[index] = value;
return ret;
}
s8 get_global_byte(s32 index) {
return gCurrentSaveFile.globalBytes[index];
}
INCLUDE_ASM("code_dba20_len_350", clear_area_flag); INCLUDE_ASM("code_dba20_len_350", clear_area_flag);
#ifdef NON_MATCHING
s32 set_area_flag(s32 index) {
SaveData* saveFile = &gCurrentSaveFile;
s32 flag;
s32 flagIdx;
s32 flagShift;
flagIdx = index / 32;
flagShift = index % 32;
flag = saveFile->areaFlags[flagIdx] & (1 << flagShift);
if (flag != 0) {
flag = 1;
}
saveFile->areaFlags[flagIdx] |= (1 << flagShift);
return flag;
}
#else
INCLUDE_ASM("code_dba20_len_350", set_area_flag); INCLUDE_ASM("code_dba20_len_350", set_area_flag);
#endif
INCLUDE_ASM("code_dba20_len_350", get_area_flag); s32 get_area_flag(s32 index) {
s32 flag;
s32 flagIdx;
s32 flagShift;
INCLUDE_ASM("code_dba20_len_350", set_area_byte); flagIdx = index / 32;
flagShift = index % 32;
INCLUDE_ASM("code_dba20_len_350", get_area_byte); flag = gCurrentSaveFile.areaFlags[flagIdx] & (1 << flagShift);
if (flag != 0) {
flag = 1;
}
return flag;
}
s8 set_area_byte(s32 index, s8 value) {
SaveData* saveFile = &gCurrentSaveFile;
s32 ret = saveFile->areaBytes[index];
saveFile->areaBytes[index] = value;
return ret;
}
s8 get_area_byte(s32 index) {
return gCurrentSaveFile.areaBytes[index];
}

View File

@ -213,7 +213,20 @@ INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_greater_equal);
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_range); INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_range);
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_default); ApiStatus si_handle_case_default(ScriptInstance* script) {
s32 switchDepth = script->switchDepth;
ASSERT(switchDepth >= 0);
if (script->switchBlockState[switchDepth] > 0) {
script->switchBlockState[switchDepth] = 0;
} else {
script->ptrNextLine = si_goto_end_case(script);
}
return ApiStatus_DONE2;
do {} while (0); // Necessary to match
}
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_AND); INCLUDE_ASM("code_e92d0_len_5da0", si_handle_case_AND);
@ -705,9 +718,61 @@ s32 func_802C73B8(ScriptInstance* script) {
INCLUDE_ASM("code_e92d0_len_5da0", si_execute_next_command); INCLUDE_ASM("code_e92d0_len_5da0", si_execute_next_command);
INCLUDE_ASM("code_e92d0_len_5da0", si_handle_end); // TODO: consider renaming to si_get_variable
#ifdef NON_MATCHING
s32 get_variable(ScriptInstance* script, Bytecode var) {
s32 abs_value;
s32 word_index;
s32 bit_index;
if (var <= -270000000) {
return var;
} else if (var <= -250000000) {
return var;
} else if (var <= -220000000) {
return (s32) fixed_var_to_float(var);
} else if (var <= -200000000) {
var += 210000000;
word_index = var / 32;
bit_index = var % 32;
return (script->flagArray[word_index] & (1 << bit_index)) != 0;
} else if (var <= -180000000) {
var += 190000000;
var = script->array[var];
return (var > -270000000 && var < -220000000) ? (s32) fixed_var_to_float(var) : var;
} else if (var <= -160000000) {
return get_global_byte(var + 170000000);
} else if (var <= -140000000) {
return get_area_byte(var + 150000000);
} else if (var <= -120000000) {
return get_global_flag(var + 130000000);
} else if (var <= -100000000) {
return get_area_flag(var + 110000000);
} else if (var <= -80000000) {
s32 avar = var + 90000000;
word_index = avar / 32;
bit_index = avar % 32;
return (gMapFlags[word_index] & (1 << bit_index)) != 0;
} else if (var <= -60000000) {
var += 70000000;
word_index = var / 32;
bit_index = var % 32;
return (script->varFlags[word_index] & (1 << bit_index)) != 0;
} else if (var <= -40000000) {
var += 50000000;
var = gMapVars[var];
return (var > -270000000 && var < -220000000) ? (s32) fixed_var_to_float(var) : var;
} else if (var <= -20000000) {
var += 30000000;
var = script->varTable[var];
return (var > -270000000 && var < -220000000) ? (s32) fixed_var_to_float(var) : var;
} else {
return var;
}
}
#else
s32 INCLUDE_ASM("code_e92d0_len_5da0", get_variable, ScriptInstance* script, Bytecode var); s32 INCLUDE_ASM("code_e92d0_len_5da0", get_variable, ScriptInstance* script, Bytecode var);
#endif
INCLUDE_ASM("code_e92d0_len_5da0", get_variable_index); INCLUDE_ASM("code_e92d0_len_5da0", get_variable_index);
@ -722,8 +787,80 @@ f32 INCLUDE_ASM("code_e92d0_len_5da0", set_float_variable, ScriptInstance* scrip
INCLUDE_ASM("code_e92d0_len_5da0", si_goto_label); INCLUDE_ASM("code_e92d0_len_5da0", si_goto_label);
INCLUDE_ASM("code_e92d0_len_5da0", si_skip_if); INCLUDE_ASM("code_e92d0_len_5da0", si_skip_if);
// Matching but needs rodata support
/*Bytecode* si_skip_if(ScriptInstance* script) {
s32 nestedIfDepth = 0;
Bytecode* pos = script->ptrNextLine;
Bytecode opcode;
s32 nargs;
do {
opcode = *pos++;
nargs = *pos++;
pos += nargs;
switch(opcode) {
case 1:
PANIC();
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 19:
nestedIfDepth--;
if (nestedIfDepth < 0) {
return pos;
}
break;
case 17:
nestedIfDepth++;
break;
case 18:
if (nestedIfDepth == 0) {
return pos;
}
break;
}
} while(1);
}*/
INCLUDE_ASM("code_e92d0_len_5da0", si_skip_else); INCLUDE_ASM("code_e92d0_len_5da0", si_skip_else);
// Matching but needs rodata support
/*Bytecode* si_skip_else(ScriptInstance* script) {
s32 nestedIfDepth = 0;
Bytecode* pos = script->ptrNextLine;
Bytecode opcode;
s32 nargs;
do {
opcode = *pos++;
nargs = *pos++;
pos += nargs;
switch(opcode) {
case 1:
PANIC();
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 19:
nestedIfDepth--;
if (nestedIfDepth < 0) {
return pos;
}
break;
case 17:
nestedIfDepth++;
break;
}
} while(1);
}*/
INCLUDE_ASM("code_e92d0_len_5da0", si_goto_end_case); INCLUDE_ASM("code_e92d0_len_5da0", si_goto_end_case);
@ -731,13 +868,30 @@ INCLUDE_ASM("code_e92d0_len_5da0", si_goto_next_case);
INCLUDE_ASM("code_e92d0_len_5da0", si_goto_end_loop); INCLUDE_ASM("code_e92d0_len_5da0", si_goto_end_loop);
// Ethan: I think this is the start of a new file
INCLUDE_API_ASM("code_e92d0_len_5da0", TranslateModel); INCLUDE_API_ASM("code_e92d0_len_5da0", TranslateModel);
INCLUDE_API_ASM("code_e92d0_len_5da0", RotateModel); INCLUDE_API_ASM("code_e92d0_len_5da0", RotateModel);
INCLUDE_API_ASM("code_e92d0_len_5da0", ScaleModel); INCLUDE_API_ASM("code_e92d0_len_5da0", ScaleModel);
INCLUDE_API_ASM("code_e92d0_len_5da0", GetModelIndex); 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) { ApiStatus CloneModel(ScriptInstance* script, s32 isInitialCall) {
Bytecode* thisPos = script->ptrReadPos; Bytecode* thisPos = script->ptrReadPos;
@ -748,7 +902,22 @@ ApiStatus CloneModel(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
INCLUDE_API_ASM("code_e92d0_len_5da0", GetModelCenter); 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, &centerX, &centerY, &centerZ, &sizeX, &sizeY,
&sizeZ);
script->varTable[0] = centerX;
script->varTable[1] = centerY;
script->varTable[2] = centerZ;
return ApiStatus_DONE2;
}
INCLUDE_API_ASM("code_e92d0_len_5da0", SetTexPanner); INCLUDE_API_ASM("code_e92d0_len_5da0", SetTexPanner);
@ -756,7 +925,20 @@ INCLUDE_API_ASM("code_e92d0_len_5da0", SetModelFlag10);
INCLUDE_API_ASM("code_e92d0_len_5da0", EnableTexPanning); INCLUDE_API_ASM("code_e92d0_len_5da0", EnableTexPanning);
INCLUDE_API_ASM("code_e92d0_len_5da0", EnableModel); ApiStatus EnableModel(ScriptInstance* script, s32 isInitialCall) {
Bytecode* thisPos = script->ptrReadPos;
Bytecode treeIndex = get_variable(script, *thisPos++);
s32 listIndex = get_model_list_index_from_tree_index(treeIndex);
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) { ApiStatus SetGroupEnabled(ScriptInstance* script, s32 isInitialCall) {
Bytecode* thisPos = script->ptrReadPos; Bytecode* thisPos = script->ptrReadPos;
@ -842,7 +1024,15 @@ ApiStatus GetLoadType(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
INCLUDE_API_ASM("code_e92d0_len_5da0", SetRenderMode); 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_API_ASM("code_e92d0_len_5da0", PlaySoundAtModel); INCLUDE_API_ASM("code_e92d0_len_5da0", PlaySoundAtModel);

View File

@ -2,7 +2,7 @@
void func_80033540(void) { void func_80033540(void) {
D_8009A650[0] |= 8; D_8009A650[0] |= 8;
(*gGameStatusPtr)->loadMenuState = 3; GAME_STATUS->loadMenuState = 3;
} }
INCLUDE_ASM("code_e940_len_290", func_80033568); INCLUDE_ASM("code_e940_len_290", func_80033568);

View File

@ -43,8 +43,8 @@ s16 func_80033830(add_val) {
} }
void func_80033874(void) { void func_80033874(void) {
func_80137D88(0, (*gGameStatusPtr)->bootAlpha); func_80137D88(0, GAME_STATUS->bootAlpha);
func_80137E10(0, (*gGameStatusPtr)->bootBlue, (*gGameStatusPtr)->bootGreen, (*gGameStatusPtr)->bootRed); func_80137E10(0, GAME_STATUS->bootBlue, GAME_STATUS->bootGreen, GAME_STATUS->bootRed);
} }
void start_battle_countdown(void) { void start_battle_countdown(void) {

View File

@ -12,22 +12,22 @@ ApiStatus EnableSpriteShading(ScriptInstance* script, s32 isInitialCall) {
} }
s32 getDemoState(ScriptInstance* script) { s32 getDemoState(ScriptInstance* script) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->demoState); set_variable(script, *script->ptrReadPos, GAME_STATUS->demoState);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus DemoPressButton(ScriptInstance* script, s32 isInitialCall) { ApiStatus DemoPressButton(ScriptInstance* script, s32 isInitialCall) {
(*gGameStatusPtr)->demoButtonInput |= get_variable(script, *script->ptrReadPos); GAME_STATUS->demoButtonInput |= get_variable(script, *script->ptrReadPos);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus DemoReleaseButton(ScriptInstance* script, s32 isInitialCall) { ApiStatus DemoReleaseButton(ScriptInstance* script, s32 isInitialCall) {
(*gGameStatusPtr)->demoButtonInput &= ~get_variable(script, *script->ptrReadPos); GAME_STATUS->demoButtonInput &= ~get_variable(script, *script->ptrReadPos);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
ApiStatus DemoSetButtons(ScriptInstance* script, s32 isInitialCall) { ApiStatus DemoSetButtons(ScriptInstance* script, s32 isInitialCall) {
(*gGameStatusPtr)->demoButtonInput = get_variable(script, *script->ptrReadPos); GAME_STATUS->demoButtonInput = get_variable(script, *script->ptrReadPos);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -39,8 +39,8 @@ ApiStatus DemoJoystickRadial(ScriptInstance* script, s32 isInitialCall) {
a = get_float_variable(script, *thisPos++); a = get_float_variable(script, *thisPos++);
b = get_float_variable(script, *thisPos++); b = get_float_variable(script, *thisPos++);
(*gGameStatusPtr)->demoStickX = a * sin_deg(b); GAME_STATUS->demoStickX = a * sin_deg(b);
(*gGameStatusPtr)->demoStickY = a * cos_deg(b); GAME_STATUS->demoStickY = a * cos_deg(b);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -53,8 +53,8 @@ ApiStatus DemoJoystickXY(ScriptInstance* script, s32 isInitialCall) {
x = get_float_variable(script, *thisPos++); x = get_float_variable(script, *thisPos++);
y = get_float_variable(script, *thisPos++); y = get_float_variable(script, *thisPos++);
(*gGameStatusPtr)->demoStickX = x; GAME_STATUS->demoStickX = x;
(*gGameStatusPtr)->demoStickY = y; GAME_STATUS->demoStickY = y;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -1,4 +1,5 @@
gGameStatusPtr = 0x8007419C; gGameStatusPtr = 0x8007419C;
gRandSeed = 0x80074410;
gUIStatus = 0x8010EF58; gUIStatus = 0x8010EF58;
gPlayerData = 0x8010F290; gPlayerData = 0x8010F290;
gPlayerActionState = 0x8010F07C; gPlayerActionState = 0x8010F07C;
@ -120,7 +121,7 @@ gBattleModelSpecialDls = 0x80152010;
gCurrentModelSpecialDlsPtr = 0x801512E8; gCurrentModelSpecialDlsPtr = 0x801512E8;
gWorldEntityList = 0x80151380; gWorldEntityList = 0x80151380;
gWorldBattleEntityList = 0x801513F8; gBattleEntityList = 0x801513F8;
gCurrentEntityListPtr = 0x80151470; gCurrentEntityListPtr = 0x80151470;
gWorldShadowList = 0x80151478; gWorldShadowList = 0x80151478;
@ -138,6 +139,11 @@ gScriptIdList = 0x802D1898;
gScriptIndexList = 0x802DAA98; gScriptIndexList = 0x802DAA98;
gScriptListCount = 0x802DAC98; gScriptListCount = 0x802DAC98;
gCurrentSaveFile = 0x800DACC0;
gMapFlags = 0x802DA480;
gMapVars = 0x802DA484;
func_802A91F8 = 0x802A91F8; func_802A91F8 = 0x802A91F8;
func_802A9208 = 0x802A9208; func_802A9208 = 0x802A9208;
func_802A9228 = 0x802A9228; func_802A9228 = 0x802A9228;