Skip to content

Instantly share code, notes, and snippets.

@sp1187 sp1187/kazecollision.asm Secret
Created Apr 5, 2018

Embed
What would you like to do?
//original code by Kaze
//subroutine of 80381794/80381900, finds the collision triangle below on y axis.
//is about 30% faster than old one, will significantly remove lag in high poly levels
.headersize 0x80378800 - 0x0F5580 //0x80283280
.org 0x8038157c
@@asfstart:
lw t0, 0x0004 (a0)
lw a0, 0x0000 (a0)
lh t1, 0x000a (t0)
lh t2, 0x000e (t0)
lh t3, 0x0010 (t0)
lh t4, 0x0014 (t0)
subu t6, t2, a3
subu t7, t3, t1
multu t6, t7
mflo t8
subu t6, t4, t2
subu t9, t1, a1
multu t9, t6
mflo t7
subu t9, t8, t7
bgez t9, @@asfpass1
nop
b @@asfend
nop
@@asfpass1:
lh t5, 0x0016 (t0)
lh t6, 0x001a (t0)
sw t6, 0x001c (sp)
subu t8, t4, a3
subu t7, t5, t3
multu t8, t7
mflo t9
lw t8, 0x001c (sp)
subu t6, t3, a1
subu t7, t8, t4
multu t6, t7
mflo t8
subu t6, t9, t8
bgez t6, @@asfpass2
nop
b @@asfend
nop
@@asfpass2:
lw t7, 0x001c (sp)
subu t8, t1, t5
subu t9, t7, a3
multu t9, t8
mflo t6
subu t9, t5, a1
subu t8, t2, t7
multu t9, t8
mflo t7
subu t9, t6, t7
bgez t9, @@asfpass3
nop
b @@asfend
nop
@@asfpass3:
lui t8, 0x8036
lh t8, 0x1180 (t8)
beq t8, r0, @@asfcheck2
nop
lb t6, 0x0004 (t0)
andi t7, t6, 0x0002
beq t7, r0, @@asfpass4
nop
b @@asfend
nop
b @@asfpass4
nop
@@asfcheck2:
lh t9, 0x0000 (t0)
li at, 0x0072
bne t9, at, @@asfpass4
nop
b @@asfend
nop
@@asfpass4:
lwc1 f4, 0x001c (t0)
swc1 f4, 0x0018 (sp)
lwc1 f6, 0x0020 (t0)
swc1 f6, 0x0014 (sp)
lwc1 f8, 0x0024 (t0)
swc1 f8, 0x0010 (sp)
lwc1 f10, 0x0028 (t0)
swc1 f10, 0x000c (sp)
lwc1 f16, 0x0014 (sp)
mtc1 r0, f18
nop
c.eq.s f16, f18
nop
bc1f @@asfpass5
nop
b @@asfend
nop
@@asfpass5:
mtc1 a1, f4
mtc1 a3, f18
lwc1 f8, 0x0018 (sp)
cvt.s.w f6, f4
lwc1 f16, 0x0010 (sp)
cvt.s.w f4, f18
mul.s f10, f6, f8
lwc1 f18, 0x000c (sp)
mul.s f6, f16, f4
add.s f8, f10, f6
lwc1 f10, 0x0014 (sp)
add.s f16, f8, f18
neg.s f4, f16
div.s f6, f4, f10
/*
add.s f6, f6, f6
add.s f6, f6, f6
*/
swc1 f6, 0x0008 (sp)
mtc1 a2, f4
lui at, 0xc29c
mtc1 at, f18
lwc1 f8, 0x0008 (sp)
cvt.s.w f10, f4
add.s f16, f8, f18
mtc1 r0, f8
sub.s f6, f10, f16
c.lt.s f6, f8
bc1f @@asfpass6
nop
b @@asfend
@@asfpass6:
lwc1 f18, 0x0008 (sp)
lw t8, 0x0048 (sp)
swc1 f18, 0x0000 (t8)
sw t0, 0x0004 (sp)
b @@asfskip
nop
@@asfend:
bne a0, r0, @@asfstart
nop
nop
nop
nop
nop
nop
nop
nop
nop
@@asfskip:
lw v0, 0x0004 (sp)
jr ra
addiu sp, sp, 0x0038
//80383a94
//rewrite loop in 80383614 and 80383828
.org 0x80383614
addiu sp, sp, -0x00a0
sw ra, 0x003c (sp)
sw a0, 0x00a0 (sp)
sw a1, 0x00a4 (sp)
sw s2, 0x0038 (sp)
sw s1, 0x0034 (sp)
sw s0, 0x0030 (sp)
sdc1 f24, 0x0028 (sp)
sdc1 f22, 0x0020 (sp)
sdc1 f20, 0x0018 (sp)
lui t6, 0x8036
lw t6, 0x1160 (t6)
addiu t7, t6, 0x021c
sw t7, 0x0088 (sp)
lw t8, 0x00a0 (sp)
lw t9, 0x0000 (t8)
lh s1, 0x0000 (t9)
lw t0, 0x00a0 (sp)
lw t1, 0x0000 (t0)
addiu t2, t1, 0x0002
sw t2, 0x0000 (t0)
lw t3, 0x00a0 (sp)
lw s0, 0x0000 (t3)
lui t4, 0x8036
lw t4, 0x1160 (t4)
lw t5, 0x0050 (t4)
bne r0, t5, @@jump
nop
lui t7, 0x8036
lw t7, 0x1160 (t7)
lw t6, 0x0088 (sp)
sw t6, 0x0050 (t7)
lui a0, 0x8036
lw a0, 0x1160 (a0)
li a1, 0x0006
jal 0x802a2930
li a2, 0x0012
@@jump:
lui a0, 0x8036
lw a0, 0x1160 (a0)
addiu a1, sp, 0x0048
jal 0x8029dda8
lw a2, 0x0088 (sp)
move s2, s1
beq s2, r0, @@end
addiu s1, s1, 0xffff
@@loop:
lh t8, 0x0000 (s0)
mtc1 t8, f4
lh t9, 0x0002 (s0)
cvt.s.w f20, f4
mtc1 t9, f6
lh t1, 0x0004 (s0)
cvt.s.w f22, f6
addiu s0, s0, 0x0006
mtc1 t1, f8
nop
cvt.s.w f24, f8
lwc1 f10, 0x0048 (sp)
lwc1 f18, 0x0058 (sp)
lwc1 f8, 0x0068 (sp)
mul.s f16, f20, f10
lw a0, 0x00a4 (sp)
mul.s f4, f22, f18
add.s f6, f16, f4
mul.s f10, f24, f8
lwc1 f16, 0x0078 (sp)
add.s f18, f6, f10
add.s f4, f16, f18
trunc.w.s f8, f4
mfc1 t3, f8
addiu t6, a0, 0x0002
sh t3, 0x0000 (a0)
sw t6, 0x00a4 (sp)
lwc1 f6, 0x004c (sp)
lwc1 f16, 0x005c (sp)
lwc1 f8, 0x006c (sp)
mul.s f10, f20, f6
mul.s f18, f22, f16
add.s f4, f10, f18
mul.s f6, f24, f8
lwc1 f10, 0x007c (sp)
add.s f16, f4, f6
add.s f18, f10, f16
trunc.w.s f8, f18
mfc1 t9, f8
addiu t0, t6, 0x0002
sh t9, 0x0000 (t6)
sw t0, 0x00a4 (sp)
lwc1 f4, 0x0050 (sp)
lwc1 f10, 0x0060 (sp)
lwc1 f8, 0x0070 (sp)
mul.s f6, f20, f4
mul.s f16, f22, f10
add.s f18, f6, f16
mul.s f4, f24, f8
lwc1 f6, 0x0080 (sp)
add.s f10, f18, f4
add.s f16, f6, f10
trunc.w.s f8, f16
mfc1 t5, f8
addiu t8, t0, 0x0002
sh t5, 0x0000 (t0)
sw t8, 0x00a4 (sp)
move s2, s1
bne r0, s2, @@loop
addiu s1, s1, 0xffff
@@end:
lw t9, 0x00a0 (sp)
sw s0, 0x0000 (t9)
lw ra, 0x003c (sp)
ldc1 f20, 0x0018 (sp)
ldc1 f22, 0x0020 (sp)
ldc1 f24, 0x0028 (sp)
lw s0, 0x0030 (sp)
lw s1, 0x0034 (sp)
lw s2, 0x0038 (sp)
jr ra
addiu sp, sp, 0x00a0
.org 0x80383828
addiu sp, sp, -0x0030
sw ra, 0x0014 (sp)
sw a0, 0x0030 (sp)
sw a1, 0x0034 (sp)
lw t6, 0x0030 (sp)
lw t7, 0x0000 (t6)
lh t8, 0x0000 (t7)
sw t8, 0x002c (sp)
lw t9, 0x0030 (sp)
lw t0, 0x0000 (t9)
addiu t1, t0, 0x0002
sw t1, 0x0000 (t9)
lw t2, 0x0030 (sp)
lw t3, 0x0000 (t2)
lh t4, 0x0000 (t3)
sw t4, 0x0024 (sp)
lw t5, 0x0030 (sp)
lw t6, 0x0000 (t5)
addiu t7, t6, 0x0002
sw t7, 0x0000 (t5)
jal 0x80382f84
lw a0, 0x002c (sp)
sh v0, 0x0022 (sp)
jal 0x80382fec
lw a0, 0x002c (sp)
sh v0, 0x0020 (sp)
lh t8, 0x0020 (sp)
ori t0, t8, 0x0001
sh t0, 0x0020 (sp)
lui a0, 0x1300
jal 0x80277f50
addiu a0, a0, 0x1c34
lui t1, 0x8036
lw t1, 0x1160 (t1)
lw t9, 0x020c (t1)
bne v0, t9, @@notbehavior
nop
li t2, 0x0005
b @@prepareloop
sh t2, 0x001e (sp)
@@notbehavior:
sh r0, 0x001e (sp)
@@prepareloop:
lw t3, 0x0024 (sp)
sw r0, 0x0028 (sp)
blez t3, @@end
nop
@@loop:
lw a0, 0x0034 (sp)
jal 0x80382b7c
lw a1, 0x0030 (sp)
sw v0, 0x0018 (sp)
beq v0, r0, @@skip1
nop
lui t6, 0x8036
lw t6, 0x1160 (t6)
sw t6, 0x002c (v0)
lw t5, 0x002c (sp)
sh t5, 0x0000 (v0)
lh t0, 0x0022 (sp)
beq t0, r0, @@skip2
nop
lw t1, 0x0030 (sp)
lw t9, 0x0000 (t1)
lh t2, 0x0006 (t9)
b @@combine
sh t2, 0x0002 (v0)
@@skip2:
sh r0, 0x0002 (v0)
@@combine:
lh t5, 0x0020 (sp)
lb t7, 0x0004 (v0)
or t8, t7, t5
sb t8, 0x0004 (v0)
lh t0, 0x001e (sp)
sb t0, 0x0005 (v0)
lw a0, 0x0018 (sp)
jal 0x80382a2c
li a1, 0x0001
@@skip1:
lh t9, 0x0022 (sp)
beq t9, r0, @@skip3
nop
lw t2, 0x0030 (sp)
lw t3, 0x0000 (t2)
addiu t4, t3, 0x0008
b @@loopcounter
sw t4, 0x0000 (t2)
@@skip3:
lw t7, 0x0030 (sp)
lw t5, 0x0000 (t7)
addiu t8, t5, 0x0006
sw t8, 0x0000 (t7)
@@loopcounter:
lw t6, 0x0028 (sp)
lw t1, 0x0024 (sp)
addiu t0, t6, 0x0001
slt at, t0, t1
bnez at, @@loop
sw t0, 0x0028 (sp)
@@end:
lw ra, 0x0014 (sp)
jr ra
addiu sp, sp, 0x0030
.org 0x80382b7c
addiu sp, sp, -0x0080
sw ra, 0x0034 (sp)
sw a0, 0x0080 (sp)
sw a1, 0x0084 (sp)
sw s7, 0x0030 (sp)
sw s6, 0x002c (sp)
sw s5, 0x0028 (sp)
sw s4, 0x0024 (sp)
sw s3, 0x0020 (sp)
sw s2, 0x001c (sp)
sw s1, 0x0018 (sp)
sw s0, 0x0014 (sp)
//shortenalot
lw t7, 0x0000 (a1)
lh t8, 0x0000 (t7)
sll t9, t8, 0x2
subu t9, t9, t8
sh t9, 0x003e (sp)
lh t2, 0x0002 (t7)
sll t3, t2, 0x2
subu t3, t3, t2
sh t3, 0x003c (sp)
lh t6, 0x0004 (t7)
sll t0, t6, 0x2
subu t0, t0, t6
sh t0, 0x003a (sp)
lh t9, 0x003e (sp)
sll t0, t9, 0x1
addu t1, a0, t0
lh s0, 0x0000 (t1)
lh s1, 0x0002 (t1)
lh s2, 0x0004 (t1)
lh t1, 0x003c (sp)
sll t3, t1, 0x1
addu t2, a0, t3
lh s3, 0x0000 (t2)
lh s4, 0x0002 (t2)
lh s5, 0x0004 (t2)
lh t2, 0x003a (sp)
sll t5, t2, 0x1
addu t4, a0, t5
lh s6, 0x0000 (t4)
lh s7, 0x0002 (t4)
lh t5, 0x0004 (t4)
//back to regular
/*
sra s0, s0, 0x2
sra s1, s1, 0x2
sra s2, s2, 0x2
sra s3, s3, 0x2
sra s4, s4, 0x2
sra s5, s5, 0x2
sra s6, s6, 0x2
sra s7, s7, 0x2
sra t5, t5, 0x2
*/
sw t5, 0x0058 (sp)
subu t4, s4, s1
subu t9, s5, s2
subu t7, t5, s5
multu t4, t7
mflo t8
subu t3, s5, s2
subu t0, s7, s4
multu t9, t0
mflo t1
subu t2, t8, t1
mtc1 t2, f4
cvt.s.w f6, f4
swc1 f6, 0x004c (sp)
subu t5, s6, s3
multu t3, t5
lw t7, 0x0058 (sp)
subu t4, s3, s0
subu t9, t7, s5
mflo t6
subu t1, s3, s0
subu t2, s7, s4
multu t4, t9
mflo t0
subu t8, t6, t0
mtc1 t8, f8
cvt.s.w f10, f8
swc1 f10, 0x0048 (sp)
multu t1, t2
mflo t3
subu t5, s4, s1
subu t7, s6, s3
multu t5, t7
mflo t4
subu t9, t3, t4
mtc1 t9, f16
cvt.s.w f18, f16
swc1 f18, 0x0044 (sp)
lwc1 f4, 0x004c (sp)
lwc1 f8, 0x0048 (sp)
lwc1 f18, 0x0044 (sp)
mul.s f6, f4, f4
mul.s f10, f8, f8
add.s f16, f6, f10
mul.s f4, f18, f18
jal 0x80323a50
add.s f12, f16, f4
swc1 f0, 0x0040 (sp)
sw s1, 0x0050 (sp)
lw t6, 0x0050 (sp)
slt at, s4, t6
beq at, r0, @@skip1
nop
sw s4, 0x0050 (sp)
@@skip1:
lw t0, 0x0050 (sp)
slt at, s7, t0
beq at, r0, @@skip2
nop
sw s7, 0x0050 (sp)
@@skip2:
sw s1, 0x0054 (sp)
lw t8, 0x0054 (sp)
slt at, t8, s4
beq at, r0, @@skip3
nop
sw s4, 0x0054 (sp)
@@skip3:
lw t1, 0x0054 (sp)
slt at, t1, s7
beq at, r0, @@skip4
nop
sw s7, 0x0054 (sp)
@@skip4:
lwc1 f8, 0x0040 (sp)
lui at, 0x8039
ldc1 f10, 0xbbd0 (at)
cvt.d.s f6, f8
c.lt.d f6, f10
nop
bc1t @@end
li v0, 0
lui at, 0x3ff0
mtc1 at, f19
mtc1 r0, f18
cvt.d.s f4, f8
div.d f8, f18, f4
cvt.s.d f6, f8
swc1 f6, 0x0040 (sp)
lwc1 f10, 0x004c (sp)
mul.s f18, f10, f6
swc1 f18, 0x004c (sp)
lwc1 f4, 0x0048 (sp)
mul.s f12, f4, f6
swc1 f12, 0x0048 (sp)
lwc1 f10, 0x0044 (sp)
mul.s f18, f10, f6
jal 0x803824f8
swc1 f18, 0x0044 (sp)
sw v0, 0x007c (sp)
sh s0, 0x000a (v0)
sh s3, 0x0010 (v0)
sh s6, 0x0016 (v0)
sh s1, 0x000c (v0)
sh s4, 0x0012 (v0)
sh s7, 0x0018 (v0)
sh s2, 0x000e (v0)
sh s5, 0x0014 (v0)
lw t8, 0x0058 (sp)
sh t8, 0x001a (v0)
lwc1 f4, 0x004c (sp)
swc1 f4, 0x001c (v0)
lwc1 f8, 0x0048 (sp)
swc1 f8, 0x0020 (v0)
lwc1 f6, 0x0044 (sp)
swc1 f6, 0x0024 (v0)
mtc1 s0, f10
mtc1 s1, f6
lwc1 f18, 0x004c (sp)
cvt.s.w f16, f10
lwc1 f8, 0x0048 (sp)
cvt.s.w f10, f6
mul.s f4, f16, f18
lwc1 f6, 0x0044 (sp)
mul.s f16, f8, f10
mtc1 s2, f8
cvt.s.w f10, f8
add.s f18, f4, f16
mul.s f4, f6, f10
add.s f16, f18, f4
neg.s f8, f16
swc1 f8, 0x0028 (v0)
lw t4, 0x0050 (sp)
addiu t9, t4, 0xfffb
sh t9, 0x0006 (v0)
lw t0, 0x0054 (sp)
addiu t8, t0, 0x0005
sh t8, 0x0008 (v0)
@@end:
lw ra, 0x0034 (sp)
lw s0, 0x0014 (sp)
lw s1, 0x0018 (sp)
lw s2, 0x001c (sp)
lw s3, 0x0020 (sp)
lw s4, 0x0024 (sp)
lw s5, 0x0028 (sp)
lw s6, 0x002c (sp)
lw s7, 0x0030 (sp)
jr ra
addiu sp, sp, 0x0080
.org 0x80382a2c
addiu sp, sp, -0x0038
sw ra, 0x0014 (sp)
sw a0, 0x0038 (sp)
sw a1, 0x003c (sp)
sw r0, 0x0018 (sp)
lw t6, 0x0038 (sp)
lh a0, 0x000a (t6)
lh a1, 0x0010 (t6)
jal 0x8038283c
lh a2, 0x0016 (t6)
sh v0, 0x002e (sp)
lw t7, 0x0038 (sp)
lh a0, 0x000e (t7)
lh a1, 0x0014 (t7)
jal 0x8038283c
lh a2, 0x001a (t7)
sh v0, 0x002c (sp)
lw t8, 0x0038 (sp)
lh a0, 0x000a (t8)
lh a1, 0x0010 (t8)
jal 0x8038289c
lh a2, 0x0016 (t8)
sh v0, 0x002a (sp)
lw t9, 0x0038 (sp)
lh a0, 0x000e (t9)
lh a1, 0x0014 (t9)
jal 0x8038289c
lh a2, 0x001a (t9)
sh v0, 0x0028 (sp)
jal 0x803828fc
lh a0, 0x002e (sp)
sh v0, 0x0026 (sp)
jal 0x80382990
lh a0, 0x002a (sp)
sh v0, 0x0022 (sp)
jal 0x803828fc
lh a0, 0x002c (sp)
sh v0, 0x0024 (sp)
jal 0x80382990
lh a0, 0x0028 (sp)
sh v0, 0x0020 (sp)
lh t0, 0x0024 (sp)
lh t1, 0x0020 (sp)
sh t0, 0x001e (sp)
slt at, t1, t0
bnez at, @@end
nop
@@biggerloop:
lh t2, 0x0026 (sp)
lh t3, 0x0022 (sp)
sh t2, 0x001c (sp)
slt at, t3, t2
bnez at, @@skip
nop
@@smallloop:
lw a0, 0x003c (sp)
lh a1, 0x001c (sp)
lh a2, 0x001e (sp)
jal 0x803825fc
lw a3, 0x0038 (sp)
lh t4, 0x001c (sp)
lh t8, 0x0022 (sp)
addiu t5, t4, 0x0001
sll t6, t5, 0x10
sra t7, t6, 0x10
slt at, t8, t7
beq at, r0, @@smallloop
sh t5, 0x001c (sp)
@@skip:
lh t9, 0x001e (sp)
lh t3, 0x0020 (sp)
addiu t0, t9, 0x0001
sll t1, t0, 0x10
sra t2, t1, 0x10
slt at, t3, t2
beq at, r0, @@biggerloop
sh t0, 0x001e (sp)
@@end:
lw ra, 0x0014 (sp)
jr ra
addiu sp, sp, 0x0038
.org 0x803828fc
sll a0, a0, 0x10
sra a0, a0, 0x10
addiu sp, sp, -0x0008
addiu a0, a0, 0x2000
sll a0, a0, 0x10
sra a0, a0, 0x10
bgez a0, @@skip1
nop
li a0, 0
@@skip1:
bgez a0, @@skip2
sra t8, a0, 0xa
addiu at, a0, 0x03ff
sra t8, at, 0xa
@@skip2:
sh t8, 0x0006 (sp)
bgez a0, @@skip3
andi t9, a0, 0x03ff
beq t9, r0, @@skip3
nop
addiu t9, t9, 0xfc00
@@skip3:
slti at, t9, 0x0032
beq at, r0, @@skip4
nop
lh t0, 0x0006 (sp)
addiu t1, t0, 0xffff
sh t1, 0x0006 (sp)
@@skip4:
lh t2, 0x0006 (sp)
bgez t2, @@skip5
nop
sh r0, 0x0006 (sp)
@@skip5:
lh v0, 0x0006 (sp)
jr ra
addiu sp, sp, 0x0008
.org 0x80382990
sll a0, a0, 0x10
sra a0, a0, 0x10
addiu sp, sp, -0x0008
addiu a0, a0, 0x2000
sll a0, a0, 0x10
sra a0, a0, 0x10
bgez a0, @@skip1
nop
li a0, 0
@@skip1:
bgez a0, @@skip2
sra t8, a0, 0xa
addiu at, a0, 0x03ff
sra t8, at, 0xa
@@skip2:
sh t8, 0x0006 (sp)
bgez a0, @@skip3
andi t9, a0, 0x03ff
beq t9, r0, @@skip3
nop
addiu t9, t9, 0xfc00
@@skip3:
slti at, t9, 0x03cf
bnez at, @@skip4
nop
lh t0, 0x0006 (sp)
addiu t1, t0, 0x0001
sh t1, 0x0006 (sp)
@@skip4:
lh t2, 0x0006 (sp)
slti at, t2, 0x0010
bnez at, @@skip5
nop
li t3, 0x000f
sh t3, 0x0006 (sp)
@@skip5:
lh v0, 0x0006 (sp)
jr ra
addiu sp, sp, 0x0008
.org 0x803825fc
addiu sp, sp, -0x0028
sw ra, 0x0014 (sp)
sw a0, 0x0028 (sp)
sw a1, 0x002c (sp)
sw a2, 0x0030 (sp)
sw a3, 0x0034 (sp)
jal 0x80382490
nop
sw v0, 0x0024 (sp)
lw t6, 0x0034 (sp)
lui at, 0x8039
ldc1 f8, 0xbbb0 (at)
lwc1 f4, 0x0020 (t6)
cvt.d.s f6, f4
c.lt.d f8, f6
nop
bc1f @@skip1
nop
sh r0, 0x0018 (sp)
li t7, 0x0001
b @@farjumping
sh t7, 0x001a (sp)
@@skip1:
lw t8, 0x0034 (sp)
lui at, 0x8039
ldc1 f18, 0xbbb8 (at)
lwc1 f10, 0x0020 (t8)
cvt.d.s f16, f10
c.lt.d f16, f18
nop
bc1f @@skip2
nop
li t9, 0x0001
sh t9, 0x0018 (sp)
li t0, -0x0001
b @@farjumping
sh t0, 0x001a (sp)
@@skip2:
li t1, 0x0002
sh t1, 0x0018 (sp)
sh r0, 0x001a (sp)
lw t2, 0x0034 (sp)
lui at, 0x8039
ldc1 f8, 0xbbc0 (at)
lwc1 f4, 0x001c (t2)
cvt.d.s f6, f4
c.lt.d f6, f8
nop
bc1t @@skip3
nop
lui at, 0x8039
ldc1 f10, 0xbbc8 (at)
c.lt.d f10, f6
nop
bc1f @@farjumping
nop
@@skip3:
lw t3, 0x0034 (sp)
lb t4, 0x0004 (t3)
ori t5, t4, 0x0008
sb t5, 0x0004 (t3)
@@farjumping:
lw t6, 0x0034 (sp)
lh t8, 0x001a (sp)
lh t7, 0x000c (t6)
multu t7, t8
mflo t9
sh t9, 0x001e (sp)
nop
lw t0, 0x0034 (sp)
lw t1, 0x0024 (sp)
sw t0, 0x0004 (t1)
lh t2, 0x002a (sp)
beq t2, r0, @@skip4
nop
lh t4, 0x0032 (sp)
lh t3, 0x002e (sp)
lh t8, 0x0018 (sp)
sll t5, t4, 0x2
sll t6, t3, 0x2
subu t5, t5, t4
subu t6, t6, t3
sll t6, t6, 0x3
sll t5, t5, 0x7
addu t7, t5, t6
lui t1, 0x8039
sll t9, t8, 0x3
addu t0, t7, t9
addiu t1, t1, 0xd698
addu t2, t0, t1
b @@skip5
sw t2, 0x0020 (sp)
@@skip4:
lh t4, 0x0032 (sp)
lh t5, 0x002e (sp)
lh t7, 0x0018 (sp)
sll t3, t4, 0x2
sll t6, t5, 0x2
subu t3, t3, t4
subu t6, t6, t5
sll t6, t6, 0x3
sll t3, t3, 0x7
addu t8, t3, t6
lui t1, 0x8039
sll t9, t7, 0x3
addu t0, t8, t9
addiu t1, t1, 0xbe98
addu t2, t0, t1
sw t2, 0x0020 (sp)
@@skip5:
lw t4, 0x0020 (sp)
lw t5, 0x0000 (t4)
beq t5, r0, @@end
nop
@@loop:
lw t3, 0x0020 (sp)
lh t9, 0x001a (sp)
lw t6, 0x0000 (t3)
lw t7, 0x0004 (t6)
lh t8, 0x000c (t7)
multu t8, t9
mflo t0
sh t0, 0x001c (sp)
nop
lh t1, 0x001e (sp)
lh t2, 0x001c (sp)
slt at, t2, t1
beq at, r0, @@noend
nop
b @@end
nop
@@noend:
lw t4, 0x0020 (sp)
lw t5, 0x0000 (t4)
sw t5, 0x0020 (sp)
lw t3, 0x0020 (sp)
lw t6, 0x0000 (t3)
bnez t6, @@loop
nop
@@end:
lw t7, 0x0020 (sp)
lw t9, 0x0024 (sp)
lw t8, 0x0000 (t7)
sw t8, 0x0000 (t9)
lw t0, 0x0024 (sp)
lw t1, 0x0020 (sp)
sw t0, 0x0000 (t1)
nop
lw ra, 0x0014 (sp)
jr ra
addiu sp, sp, 0x0028
.org 0x80382490
addiu sp, sp, -0x0008
lui t6, 0x8036
lw t6, 0x116c (t6)
lui t8, 0x8039
lw t8, 0xee98 (t8)
sll t7, t6, 0x3
addu t9, t7, t8
sw t9, 0x0004 (sp)
lui t0, 0x8036
lw t0, 0x116c (t0)
lui at, 0x8036
addiu t1, t0, 0x0001
sw t1, 0x116c (at)
lw t2, 0x0004 (sp)
sw r0, 0x0000 (t2)
lui t3, 0x8036
lw t3, 0x116c (t3)
lw v0, 0x0004 (sp)
jr ra
addiu sp, sp, 0x0008
.org 0x803824f8
addiu sp, sp, -0x0008
lui t6, 0x8036
lw t6, 0x1170 (t6)
lui t8, 0x8039
lw t8, 0xee9c (t8)
sll t7, t6, 0x2
subu t7, t7, t6
sll t7, t7, 0x4
addu t9, t7, t8
sw t9, 0x0004 (sp)
lui t0, 0x8036
lw t0, 0x1170 (t0)
lui at, 0x8036
addiu t1, t0, 0x0001
sw t1, 0x1170 (at)
lui t2, 0x8036
lui t3, 0x8039
lh t3, 0xeea0 (t3)
lw t2, 0x1170 (t2)
lw t4, 0x0004 (sp)
sh r0, 0x0000 (t4)
lw t5, 0x0004 (sp)
sh r0, 0x0002 (t5)
lw t6, 0x0004 (sp)
sb r0, 0x0004 (t6)
lw t7, 0x0004 (sp)
sb r0, 0x0005 (t7)
lw t8, 0x0004 (sp)
sw r0, 0x002c (t8)
lw v0, 0x0004 (sp)
jr ra
addiu sp, sp, 0x0008
.org 0x8038289c
sll a0, a0, 0x10
sll a1, a1, 0x10
sll a2, a2, 0x10
sra a2, a2, 0x10
sra a1, a1, 0x10
sra a0, a0, 0x10
slt at, a0, a1
beq at, r0, @@skip
nop
sll a0, a1, 0x10
sra t6, a0, 0x10
move a0, t6
@@skip:
slt at, a0, a2
beq at, r0, @@end
nop
sll a0, a2, 0x10
sra t7, a0, 0x10
move a0, t7
@@end:
jr ra
move v0, a0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.