Merge branch 'master' into misc-decomp

This commit is contained in:
Ethan Roseman 2020-12-28 11:45:34 +09:00
commit 8e96d92a59
26 changed files with 1954 additions and 57 deletions

View File

@ -0,0 +1,111 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218000_4309A0
/* 4309A0 80218000 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 4309A4 80218004 F7B60020 */ sdc1 $f22, 0x20($sp)
/* 4309A8 80218008 46006586 */ mov.s $f22, $f12
/* 4309AC 8021800C F7B40018 */ sdc1 $f20, 0x18($sp)
/* 4309B0 80218010 AFBF0010 */ sw $ra, 0x10($sp)
/* 4309B4 80218014 0C00A3FC */ jal length2D
/* 4309B8 80218018 46007506 */ mov.s $f20, $f14
/* 4309BC 8021801C 4600A18D */ trunc.w.s $f6, $f20
/* 4309C0 80218020 44023000 */ mfc1 $v0, $f6
/* 4309C4 80218024 00000000 */ nop
/* 4309C8 80218028 04420001 */ bltzl $v0, .L80218030
/* 4309CC 8021802C 00021023 */ negu $v0, $v0
.L80218030:
/* 4309D0 80218030 44821000 */ mtc1 $v0, $f2
/* 4309D4 80218034 00000000 */ nop
/* 4309D8 80218038 468010A0 */ cvt.s.w $f2, $f2
/* 4309DC 8021803C 46001103 */ div.s $f4, $f2, $f0
/* 4309E0 80218040 0000202D */ daddu $a0, $zero, $zero
/* 4309E4 80218044 2406005A */ addiu $a2, $zero, 0x5a
/* 4309E8 80218048 0080282D */ daddu $a1, $a0, $zero
/* 4309EC 8021804C 3C078022 */ lui $a3, %hi(D_8021A194)
/* 4309F0 80218050 24E7A194 */ addiu $a3, $a3, %lo(D_8021A194)
/* 4309F4 80218054 30C2FFFF */ andi $v0, $a2, 0xffff
.L80218058:
/* 4309F8 80218058 3083FFFF */ andi $v1, $a0, 0xffff
/* 4309FC 8021805C 00431023 */ subu $v0, $v0, $v1
/* 430A00 80218060 00021FC2 */ srl $v1, $v0, 0x1f
/* 430A04 80218064 00431021 */ addu $v0, $v0, $v1
/* 430A08 80218068 00021043 */ sra $v0, $v0, 1
/* 430A0C 8021806C 00821821 */ addu $v1, $a0, $v0
/* 430A10 80218070 3062FFFF */ andi $v0, $v1, 0xffff
/* 430A14 80218074 00021080 */ sll $v0, $v0, 2
/* 430A18 80218078 00471021 */ addu $v0, $v0, $a3
/* 430A1C 8021807C C4400000 */ lwc1 $f0, ($v0)
/* 430A20 80218080 4604003C */ c.lt.s $f0, $f4
/* 430A24 80218084 00000000 */ nop
/* 430A28 80218088 45020002 */ bc1fl .L80218094
/* 430A2C 8021808C 0060302D */ daddu $a2, $v1, $zero
/* 430A30 80218090 0060202D */ daddu $a0, $v1, $zero
.L80218094:
/* 430A34 80218094 24A50001 */ addiu $a1, $a1, 1
/* 430A38 80218098 30A2FFFF */ andi $v0, $a1, 0xffff
/* 430A3C 8021809C 2C420007 */ sltiu $v0, $v0, 7
/* 430A40 802180A0 1440FFED */ bnez $v0, .L80218058
/* 430A44 802180A4 30C2FFFF */ andi $v0, $a2, 0xffff
/* 430A48 802180A8 3082FFFF */ andi $v0, $a0, 0xffff
/* 430A4C 802180AC 00021080 */ sll $v0, $v0, 2
/* 430A50 802180B0 30C3FFFF */ andi $v1, $a2, 0xffff
/* 430A54 802180B4 3C018022 */ lui $at, %hi(D_8021A194)
/* 430A58 802180B8 00220821 */ addu $at, $at, $v0
/* 430A5C 802180BC C422A194 */ lwc1 $f2, %lo(D_8021A194)($at)
/* 430A60 802180C0 00031880 */ sll $v1, $v1, 2
/* 430A64 802180C4 46041081 */ sub.s $f2, $f2, $f4
/* 430A68 802180C8 3C018022 */ lui $at, %hi(D_8021A194)
/* 430A6C 802180CC 00230821 */ addu $at, $at, $v1
/* 430A70 802180D0 C420A194 */ lwc1 $f0, %lo(D_8021A194)($at)
/* 430A74 802180D4 46040001 */ sub.s $f0, $f0, $f4
/* 430A78 802180D8 46001085 */ abs.s $f2, $f2
/* 430A7C 802180DC 46000005 */ abs.s $f0, $f0
/* 430A80 802180E0 4600103C */ c.lt.s $f2, $f0
/* 430A84 802180E4 00000000 */ nop
/* 430A88 802180E8 45000002 */ bc1f .L802180F4
/* 430A8C 802180EC 00C0182D */ daddu $v1, $a2, $zero
/* 430A90 802180F0 0080182D */ daddu $v1, $a0, $zero
.L802180F4:
/* 430A94 802180F4 44800000 */ mtc1 $zero, $f0
/* 430A98 802180F8 00000000 */ nop
/* 430A9C 802180FC 4600B03C */ c.lt.s $f22, $f0
/* 430AA0 80218100 00000000 */ nop
/* 430AA4 80218104 4500000A */ bc1f .L80218130
/* 430AA8 80218108 00000000 */ nop
/* 430AAC 8021810C 4614003E */ c.le.s $f0, $f20
/* 430AB0 80218110 00000000 */ nop
/* 430AB4 80218114 45000004 */ bc1f .L80218128
/* 430AB8 80218118 240200B4 */ addiu $v0, $zero, 0xb4
/* 430ABC 8021811C 00431823 */ subu $v1, $v0, $v1
/* 430AC0 80218120 44800000 */ mtc1 $zero, $f0
/* 430AC4 80218124 00000000 */ nop
.L80218128:
/* 430AC8 80218128 4600B03C */ c.lt.s $f22, $f0
/* 430ACC 8021812C 00000000 */ nop
.L80218130:
/* 430AD0 80218130 45000005 */ bc1f .L80218148
/* 430AD4 80218134 00000000 */ nop
/* 430AD8 80218138 4600A03C */ c.lt.s $f20, $f0
/* 430ADC 8021813C 00000000 */ nop
/* 430AE0 80218140 45030001 */ bc1tl .L80218148
/* 430AE4 80218144 246300B4 */ addiu $v1, $v1, 0xb4
.L80218148:
/* 430AE8 80218148 44800000 */ mtc1 $zero, $f0
/* 430AEC 8021814C 00000000 */ nop
/* 430AF0 80218150 4616003E */ c.le.s $f0, $f22
/* 430AF4 80218154 00000000 */ nop
/* 430AF8 80218158 45000006 */ bc1f .L80218174
/* 430AFC 8021815C 00000000 */ nop
/* 430B00 80218160 4600A03C */ c.lt.s $f20, $f0
/* 430B04 80218164 00000000 */ nop
/* 430B08 80218168 45000002 */ bc1f .L80218174
/* 430B0C 8021816C 24020168 */ addiu $v0, $zero, 0x168
/* 430B10 80218170 00431823 */ subu $v1, $v0, $v1
.L80218174:
/* 430B14 80218174 8FBF0010 */ lw $ra, 0x10($sp)
/* 430B18 80218178 D7B60020 */ ldc1 $f22, 0x20($sp)
/* 430B1C 8021817C D7B40018 */ ldc1 $f20, 0x18($sp)
/* 430B20 80218180 3062FFFF */ andi $v0, $v1, 0xffff
/* 430B24 80218184 03E00008 */ jr $ra
/* 430B28 80218188 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -0,0 +1,67 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8021818C_430B2C
/* 430B2C 8021818C 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 430B30 80218190 AFB40020 */ sw $s4, 0x20($sp)
/* 430B34 80218194 0080A02D */ daddu $s4, $a0, $zero
/* 430B38 80218198 AFBF0024 */ sw $ra, 0x24($sp)
/* 430B3C 8021819C AFB3001C */ sw $s3, 0x1c($sp)
/* 430B40 802181A0 AFB20018 */ sw $s2, 0x18($sp)
/* 430B44 802181A4 AFB10014 */ sw $s1, 0x14($sp)
/* 430B48 802181A8 AFB00010 */ sw $s0, 0x10($sp)
/* 430B4C 802181AC 8E92000C */ lw $s2, 0xc($s4)
/* 430B50 802181B0 8E450000 */ lw $a1, ($s2)
/* 430B54 802181B4 0C0B1EAF */ jal get_variable
/* 430B58 802181B8 26520004 */ addiu $s2, $s2, 4
/* 430B5C 802181BC 8E450000 */ lw $a1, ($s2)
/* 430B60 802181C0 26520004 */ addiu $s2, $s2, 4
/* 430B64 802181C4 0280202D */ daddu $a0, $s4, $zero
/* 430B68 802181C8 0C0B1EAF */ jal get_variable
/* 430B6C 802181CC 0040802D */ daddu $s0, $v0, $zero
/* 430B70 802181D0 8E450000 */ lw $a1, ($s2)
/* 430B74 802181D4 26520004 */ addiu $s2, $s2, 4
/* 430B78 802181D8 0280202D */ daddu $a0, $s4, $zero
/* 430B7C 802181DC 0C0B1EAF */ jal get_variable
/* 430B80 802181E0 0040882D */ daddu $s1, $v0, $zero
/* 430B84 802181E4 0040982D */ daddu $s3, $v0, $zero
/* 430B88 802181E8 8E450000 */ lw $a1, ($s2)
/* 430B8C 802181EC 26520004 */ addiu $s2, $s2, 4
/* 430B90 802181F0 0280202D */ daddu $a0, $s4, $zero
/* 430B94 802181F4 0C0B1EAF */ jal get_variable
/* 430B98 802181F8 02709823 */ subu $s3, $s3, $s0
/* 430B9C 802181FC 0040802D */ daddu $s0, $v0, $zero
/* 430BA0 80218200 0280202D */ daddu $a0, $s4, $zero
/* 430BA4 80218204 8E450000 */ lw $a1, ($s2)
/* 430BA8 80218208 0C0B1EAF */ jal get_variable
/* 430BAC 8021820C 02118023 */ subu $s0, $s0, $s1
/* 430BB0 80218210 16600006 */ bnez $s3, .L8021822C
/* 430BB4 80218214 00000000 */ nop
/* 430BB8 80218218 16000004 */ bnez $s0, .L8021822C
/* 430BBC 8021821C 0280202D */ daddu $a0, $s4, $zero
/* 430BC0 80218220 8E450000 */ lw $a1, ($s2)
/* 430BC4 80218224 08086095 */ j .L80218254
/* 430BC8 80218228 0040302D */ daddu $a2, $v0, $zero
.L8021822C:
/* 430BCC 8021822C 44936000 */ mtc1 $s3, $f12
/* 430BD0 80218230 00000000 */ nop
/* 430BD4 80218234 46806320 */ cvt.s.w $f12, $f12
/* 430BD8 80218238 44907000 */ mtc1 $s0, $f14
/* 430BDC 8021823C 00000000 */ nop
/* 430BE0 80218240 0C086000 */ jal func_80218000_4309A0
/* 430BE4 80218244 468073A0 */ cvt.s.w $f14, $f14
/* 430BE8 80218248 0280202D */ daddu $a0, $s4, $zero
/* 430BEC 8021824C 8E450000 */ lw $a1, ($s2)
/* 430BF0 80218250 2446FFA6 */ addiu $a2, $v0, -0x5a
.L80218254:
/* 430BF4 80218254 0C0B2026 */ jal set_variable
/* 430BF8 80218258 00000000 */ nop
/* 430BFC 8021825C 24020002 */ addiu $v0, $zero, 2
/* 430C00 80218260 8FBF0024 */ lw $ra, 0x24($sp)
/* 430C04 80218264 8FB40020 */ lw $s4, 0x20($sp)
/* 430C08 80218268 8FB3001C */ lw $s3, 0x1c($sp)
/* 430C0C 8021826C 8FB20018 */ lw $s2, 0x18($sp)
/* 430C10 80218270 8FB10014 */ lw $s1, 0x14($sp)
/* 430C14 80218274 8FB00010 */ lw $s0, 0x10($sp)
/* 430C18 80218278 03E00008 */ jr $ra
/* 430C1C 8021827C 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -0,0 +1,111 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218280_430C20
/* 430C20 80218280 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 430C24 80218284 F7B60020 */ sdc1 $f22, 0x20($sp)
/* 430C28 80218288 46006586 */ mov.s $f22, $f12
/* 430C2C 8021828C F7B40018 */ sdc1 $f20, 0x18($sp)
/* 430C30 80218290 AFBF0010 */ sw $ra, 0x10($sp)
/* 430C34 80218294 0C00A3FC */ jal length2D
/* 430C38 80218298 46007506 */ mov.s $f20, $f14
/* 430C3C 8021829C 4600A18D */ trunc.w.s $f6, $f20
/* 430C40 802182A0 44023000 */ mfc1 $v0, $f6
/* 430C44 802182A4 00000000 */ nop
/* 430C48 802182A8 04420001 */ bltzl $v0, .L802182B0
/* 430C4C 802182AC 00021023 */ negu $v0, $v0
.L802182B0:
/* 430C50 802182B0 44821000 */ mtc1 $v0, $f2
/* 430C54 802182B4 00000000 */ nop
/* 430C58 802182B8 468010A0 */ cvt.s.w $f2, $f2
/* 430C5C 802182BC 46001103 */ div.s $f4, $f2, $f0
/* 430C60 802182C0 0000202D */ daddu $a0, $zero, $zero
/* 430C64 802182C4 2406005A */ addiu $a2, $zero, 0x5a
/* 430C68 802182C8 0080282D */ daddu $a1, $a0, $zero
/* 430C6C 802182CC 3C078022 */ lui $a3, %hi(D_8021BC70)
/* 430C70 802182D0 24E7BC70 */ addiu $a3, $a3, %lo(D_8021BC70)
/* 430C74 802182D4 30C2FFFF */ andi $v0, $a2, 0xffff
.L802182D8:
/* 430C78 802182D8 3083FFFF */ andi $v1, $a0, 0xffff
/* 430C7C 802182DC 00431023 */ subu $v0, $v0, $v1
/* 430C80 802182E0 00021FC2 */ srl $v1, $v0, 0x1f
/* 430C84 802182E4 00431021 */ addu $v0, $v0, $v1
/* 430C88 802182E8 00021043 */ sra $v0, $v0, 1
/* 430C8C 802182EC 00821821 */ addu $v1, $a0, $v0
/* 430C90 802182F0 3062FFFF */ andi $v0, $v1, 0xffff
/* 430C94 802182F4 00021080 */ sll $v0, $v0, 2
/* 430C98 802182F8 00471021 */ addu $v0, $v0, $a3
/* 430C9C 802182FC C4400000 */ lwc1 $f0, ($v0)
/* 430CA0 80218300 4604003C */ c.lt.s $f0, $f4
/* 430CA4 80218304 00000000 */ nop
/* 430CA8 80218308 45020002 */ bc1fl .L80218314
/* 430CAC 8021830C 0060302D */ daddu $a2, $v1, $zero
/* 430CB0 80218310 0060202D */ daddu $a0, $v1, $zero
.L80218314:
/* 430CB4 80218314 24A50001 */ addiu $a1, $a1, 1
/* 430CB8 80218318 30A2FFFF */ andi $v0, $a1, 0xffff
/* 430CBC 8021831C 2C420007 */ sltiu $v0, $v0, 7
/* 430CC0 80218320 1440FFED */ bnez $v0, .L802182D8
/* 430CC4 80218324 30C2FFFF */ andi $v0, $a2, 0xffff
/* 430CC8 80218328 3082FFFF */ andi $v0, $a0, 0xffff
/* 430CCC 8021832C 00021080 */ sll $v0, $v0, 2
/* 430CD0 80218330 30C3FFFF */ andi $v1, $a2, 0xffff
/* 430CD4 80218334 3C018022 */ lui $at, %hi(D_8021BC70)
/* 430CD8 80218338 00220821 */ addu $at, $at, $v0
/* 430CDC 8021833C C422BC70 */ lwc1 $f2, %lo(D_8021BC70)($at)
/* 430CE0 80218340 00031880 */ sll $v1, $v1, 2
/* 430CE4 80218344 46041081 */ sub.s $f2, $f2, $f4
/* 430CE8 80218348 3C018022 */ lui $at, %hi(D_8021BC70)
/* 430CEC 8021834C 00230821 */ addu $at, $at, $v1
/* 430CF0 80218350 C420BC70 */ lwc1 $f0, %lo(D_8021BC70)($at)
/* 430CF4 80218354 46040001 */ sub.s $f0, $f0, $f4
/* 430CF8 80218358 46001085 */ abs.s $f2, $f2
/* 430CFC 8021835C 46000005 */ abs.s $f0, $f0
/* 430D00 80218360 4600103C */ c.lt.s $f2, $f0
/* 430D04 80218364 00000000 */ nop
/* 430D08 80218368 45000002 */ bc1f .L80218374
/* 430D0C 8021836C 00C0182D */ daddu $v1, $a2, $zero
/* 430D10 80218370 0080182D */ daddu $v1, $a0, $zero
.L80218374:
/* 430D14 80218374 44800000 */ mtc1 $zero, $f0
/* 430D18 80218378 00000000 */ nop
/* 430D1C 8021837C 4600B03C */ c.lt.s $f22, $f0
/* 430D20 80218380 00000000 */ nop
/* 430D24 80218384 4500000A */ bc1f .L802183B0
/* 430D28 80218388 00000000 */ nop
/* 430D2C 8021838C 4614003E */ c.le.s $f0, $f20
/* 430D30 80218390 00000000 */ nop
/* 430D34 80218394 45000004 */ bc1f .L802183A8
/* 430D38 80218398 240200B4 */ addiu $v0, $zero, 0xb4
/* 430D3C 8021839C 00431823 */ subu $v1, $v0, $v1
/* 430D40 802183A0 44800000 */ mtc1 $zero, $f0
/* 430D44 802183A4 00000000 */ nop
.L802183A8:
/* 430D48 802183A8 4600B03C */ c.lt.s $f22, $f0
/* 430D4C 802183AC 00000000 */ nop
.L802183B0:
/* 430D50 802183B0 45000005 */ bc1f .L802183C8
/* 430D54 802183B4 00000000 */ nop
/* 430D58 802183B8 4600A03C */ c.lt.s $f20, $f0
/* 430D5C 802183BC 00000000 */ nop
/* 430D60 802183C0 45030001 */ bc1tl .L802183C8
/* 430D64 802183C4 246300B4 */ addiu $v1, $v1, 0xb4
.L802183C8:
/* 430D68 802183C8 44800000 */ mtc1 $zero, $f0
/* 430D6C 802183CC 00000000 */ nop
/* 430D70 802183D0 4616003E */ c.le.s $f0, $f22
/* 430D74 802183D4 00000000 */ nop
/* 430D78 802183D8 45000006 */ bc1f .L802183F4
/* 430D7C 802183DC 00000000 */ nop
/* 430D80 802183E0 4600A03C */ c.lt.s $f20, $f0
/* 430D84 802183E4 00000000 */ nop
/* 430D88 802183E8 45000002 */ bc1f .L802183F4
/* 430D8C 802183EC 24020168 */ addiu $v0, $zero, 0x168
/* 430D90 802183F0 00431823 */ subu $v1, $v0, $v1
.L802183F4:
/* 430D94 802183F4 8FBF0010 */ lw $ra, 0x10($sp)
/* 430D98 802183F8 D7B60020 */ ldc1 $f22, 0x20($sp)
/* 430D9C 802183FC D7B40018 */ ldc1 $f20, 0x18($sp)
/* 430DA0 80218400 3062FFFF */ andi $v0, $v1, 0xffff
/* 430DA4 80218404 03E00008 */ jr $ra
/* 430DA8 80218408 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -0,0 +1,67 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8021840C_430DAC
/* 430DAC 8021840C 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 430DB0 80218410 AFB40020 */ sw $s4, 0x20($sp)
/* 430DB4 80218414 0080A02D */ daddu $s4, $a0, $zero
/* 430DB8 80218418 AFBF0024 */ sw $ra, 0x24($sp)
/* 430DBC 8021841C AFB3001C */ sw $s3, 0x1c($sp)
/* 430DC0 80218420 AFB20018 */ sw $s2, 0x18($sp)
/* 430DC4 80218424 AFB10014 */ sw $s1, 0x14($sp)
/* 430DC8 80218428 AFB00010 */ sw $s0, 0x10($sp)
/* 430DCC 8021842C 8E92000C */ lw $s2, 0xc($s4)
/* 430DD0 80218430 8E450000 */ lw $a1, ($s2)
/* 430DD4 80218434 0C0B1EAF */ jal get_variable
/* 430DD8 80218438 26520004 */ addiu $s2, $s2, 4
/* 430DDC 8021843C 8E450000 */ lw $a1, ($s2)
/* 430DE0 80218440 26520004 */ addiu $s2, $s2, 4
/* 430DE4 80218444 0280202D */ daddu $a0, $s4, $zero
/* 430DE8 80218448 0C0B1EAF */ jal get_variable
/* 430DEC 8021844C 0040802D */ daddu $s0, $v0, $zero
/* 430DF0 80218450 8E450000 */ lw $a1, ($s2)
/* 430DF4 80218454 26520004 */ addiu $s2, $s2, 4
/* 430DF8 80218458 0280202D */ daddu $a0, $s4, $zero
/* 430DFC 8021845C 0C0B1EAF */ jal get_variable
/* 430E00 80218460 0040882D */ daddu $s1, $v0, $zero
/* 430E04 80218464 0040982D */ daddu $s3, $v0, $zero
/* 430E08 80218468 8E450000 */ lw $a1, ($s2)
/* 430E0C 8021846C 26520004 */ addiu $s2, $s2, 4
/* 430E10 80218470 0280202D */ daddu $a0, $s4, $zero
/* 430E14 80218474 0C0B1EAF */ jal get_variable
/* 430E18 80218478 02709823 */ subu $s3, $s3, $s0
/* 430E1C 8021847C 0040802D */ daddu $s0, $v0, $zero
/* 430E20 80218480 0280202D */ daddu $a0, $s4, $zero
/* 430E24 80218484 8E450000 */ lw $a1, ($s2)
/* 430E28 80218488 0C0B1EAF */ jal get_variable
/* 430E2C 8021848C 02118023 */ subu $s0, $s0, $s1
/* 430E30 80218490 16600006 */ bnez $s3, .L802184AC
/* 430E34 80218494 00000000 */ nop
/* 430E38 80218498 16000004 */ bnez $s0, .L802184AC
/* 430E3C 8021849C 0280202D */ daddu $a0, $s4, $zero
/* 430E40 802184A0 8E450000 */ lw $a1, ($s2)
/* 430E44 802184A4 08086135 */ j .L802184D4
/* 430E48 802184A8 0040302D */ daddu $a2, $v0, $zero
.L802184AC:
/* 430E4C 802184AC 44936000 */ mtc1 $s3, $f12
/* 430E50 802184B0 00000000 */ nop
/* 430E54 802184B4 46806320 */ cvt.s.w $f12, $f12
/* 430E58 802184B8 44907000 */ mtc1 $s0, $f14
/* 430E5C 802184BC 00000000 */ nop
/* 430E60 802184C0 0C0860A0 */ jal func_80218280_430C20
/* 430E64 802184C4 468073A0 */ cvt.s.w $f14, $f14
/* 430E68 802184C8 0280202D */ daddu $a0, $s4, $zero
/* 430E6C 802184CC 8E450000 */ lw $a1, ($s2)
/* 430E70 802184D0 2446FFA6 */ addiu $a2, $v0, -0x5a
.L802184D4:
/* 430E74 802184D4 0C0B2026 */ jal set_variable
/* 430E78 802184D8 00000000 */ nop
/* 430E7C 802184DC 24020002 */ addiu $v0, $zero, 2
/* 430E80 802184E0 8FBF0024 */ lw $ra, 0x24($sp)
/* 430E84 802184E4 8FB40020 */ lw $s4, 0x20($sp)
/* 430E88 802184E8 8FB3001C */ lw $s3, 0x1c($sp)
/* 430E8C 802184EC 8FB20018 */ lw $s2, 0x18($sp)
/* 430E90 802184F0 8FB10014 */ lw $s1, 0x14($sp)
/* 430E94 802184F4 8FB00010 */ lw $s0, 0x10($sp)
/* 430E98 802184F8 03E00008 */ jr $ra
/* 430E9C 802184FC 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -0,0 +1,26 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218500_430EA0
/* 430EA0 80218500 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 430EA4 80218504 AFB10014 */ sw $s1, 0x14($sp)
/* 430EA8 80218508 0080882D */ daddu $s1, $a0, $zero
/* 430EAC 8021850C AFBF0018 */ sw $ra, 0x18($sp)
/* 430EB0 80218510 AFB00010 */ sw $s0, 0x10($sp)
/* 430EB4 80218514 8E30000C */ lw $s0, 0xc($s1)
/* 430EB8 80218518 8E050000 */ lw $a1, ($s0)
/* 430EBC 8021851C 0C0B1EAF */ jal get_variable
/* 430EC0 80218520 26100004 */ addiu $s0, $s0, 4
/* 430EC4 80218524 0220202D */ daddu $a0, $s1, $zero
/* 430EC8 80218528 8E050000 */ lw $a1, ($s0)
/* 430ECC 8021852C 0C0B1EAF */ jal get_variable
/* 430ED0 80218530 0040802D */ daddu $s0, $v0, $zero
/* 430ED4 80218534 0200202D */ daddu $a0, $s0, $zero
/* 430ED8 80218538 0C00A3C2 */ jal start_rumble
/* 430EDC 8021853C 0040282D */ daddu $a1, $v0, $zero
/* 430EE0 80218540 8FBF0018 */ lw $ra, 0x18($sp)
/* 430EE4 80218544 8FB10014 */ lw $s1, 0x14($sp)
/* 430EE8 80218548 8FB00010 */ lw $s0, 0x10($sp)
/* 430EEC 8021854C 24020002 */ addiu $v0, $zero, 2
/* 430EF0 80218550 03E00008 */ jr $ra
/* 430EF4 80218554 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -0,0 +1,111 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218558_430EF8
/* 430EF8 80218558 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 430EFC 8021855C F7B60020 */ sdc1 $f22, 0x20($sp)
/* 430F00 80218560 46006586 */ mov.s $f22, $f12
/* 430F04 80218564 F7B40018 */ sdc1 $f20, 0x18($sp)
/* 430F08 80218568 AFBF0010 */ sw $ra, 0x10($sp)
/* 430F0C 8021856C 0C00A3FC */ jal length2D
/* 430F10 80218570 46007506 */ mov.s $f20, $f14
/* 430F14 80218574 4600A18D */ trunc.w.s $f6, $f20
/* 430F18 80218578 44023000 */ mfc1 $v0, $f6
/* 430F1C 8021857C 00000000 */ nop
/* 430F20 80218580 04420001 */ bltzl $v0, .L80218588
/* 430F24 80218584 00021023 */ negu $v0, $v0
.L80218588:
/* 430F28 80218588 44821000 */ mtc1 $v0, $f2
/* 430F2C 8021858C 00000000 */ nop
/* 430F30 80218590 468010A0 */ cvt.s.w $f2, $f2
/* 430F34 80218594 46001103 */ div.s $f4, $f2, $f0
/* 430F38 80218598 0000202D */ daddu $a0, $zero, $zero
/* 430F3C 8021859C 2406005A */ addiu $a2, $zero, 0x5a
/* 430F40 802185A0 0080282D */ daddu $a1, $a0, $zero
/* 430F44 802185A4 3C078022 */ lui $a3, %hi(D_8021EF6C)
/* 430F48 802185A8 24E7EF6C */ addiu $a3, $a3, %lo(D_8021EF6C)
/* 430F4C 802185AC 30C2FFFF */ andi $v0, $a2, 0xffff
.L802185B0:
/* 430F50 802185B0 3083FFFF */ andi $v1, $a0, 0xffff
/* 430F54 802185B4 00431023 */ subu $v0, $v0, $v1
/* 430F58 802185B8 00021FC2 */ srl $v1, $v0, 0x1f
/* 430F5C 802185BC 00431021 */ addu $v0, $v0, $v1
/* 430F60 802185C0 00021043 */ sra $v0, $v0, 1
/* 430F64 802185C4 00821821 */ addu $v1, $a0, $v0
/* 430F68 802185C8 3062FFFF */ andi $v0, $v1, 0xffff
/* 430F6C 802185CC 00021080 */ sll $v0, $v0, 2
/* 430F70 802185D0 00471021 */ addu $v0, $v0, $a3
/* 430F74 802185D4 C4400000 */ lwc1 $f0, ($v0)
/* 430F78 802185D8 4604003C */ c.lt.s $f0, $f4
/* 430F7C 802185DC 00000000 */ nop
/* 430F80 802185E0 45020002 */ bc1fl .L802185EC
/* 430F84 802185E4 0060302D */ daddu $a2, $v1, $zero
/* 430F88 802185E8 0060202D */ daddu $a0, $v1, $zero
.L802185EC:
/* 430F8C 802185EC 24A50001 */ addiu $a1, $a1, 1
/* 430F90 802185F0 30A2FFFF */ andi $v0, $a1, 0xffff
/* 430F94 802185F4 2C420007 */ sltiu $v0, $v0, 7
/* 430F98 802185F8 1440FFED */ bnez $v0, .L802185B0
/* 430F9C 802185FC 30C2FFFF */ andi $v0, $a2, 0xffff
/* 430FA0 80218600 3082FFFF */ andi $v0, $a0, 0xffff
/* 430FA4 80218604 00021080 */ sll $v0, $v0, 2
/* 430FA8 80218608 30C3FFFF */ andi $v1, $a2, 0xffff
/* 430FAC 8021860C 3C018022 */ lui $at, %hi(D_8021EF6C)
/* 430FB0 80218610 00220821 */ addu $at, $at, $v0
/* 430FB4 80218614 C422EF6C */ lwc1 $f2, %lo(D_8021EF6C)($at)
/* 430FB8 80218618 00031880 */ sll $v1, $v1, 2
/* 430FBC 8021861C 46041081 */ sub.s $f2, $f2, $f4
/* 430FC0 80218620 3C018022 */ lui $at, %hi(D_8021EF6C)
/* 430FC4 80218624 00230821 */ addu $at, $at, $v1
/* 430FC8 80218628 C420EF6C */ lwc1 $f0, %lo(D_8021EF6C)($at)
/* 430FCC 8021862C 46040001 */ sub.s $f0, $f0, $f4
/* 430FD0 80218630 46001085 */ abs.s $f2, $f2
/* 430FD4 80218634 46000005 */ abs.s $f0, $f0
/* 430FD8 80218638 4600103C */ c.lt.s $f2, $f0
/* 430FDC 8021863C 00000000 */ nop
/* 430FE0 80218640 45000002 */ bc1f .L8021864C
/* 430FE4 80218644 00C0182D */ daddu $v1, $a2, $zero
/* 430FE8 80218648 0080182D */ daddu $v1, $a0, $zero
.L8021864C:
/* 430FEC 8021864C 44800000 */ mtc1 $zero, $f0
/* 430FF0 80218650 00000000 */ nop
/* 430FF4 80218654 4600B03C */ c.lt.s $f22, $f0
/* 430FF8 80218658 00000000 */ nop
/* 430FFC 8021865C 4500000A */ bc1f .L80218688
/* 431000 80218660 00000000 */ nop
/* 431004 80218664 4614003E */ c.le.s $f0, $f20
/* 431008 80218668 00000000 */ nop
/* 43100C 8021866C 45000004 */ bc1f .L80218680
/* 431010 80218670 240200B4 */ addiu $v0, $zero, 0xb4
/* 431014 80218674 00431823 */ subu $v1, $v0, $v1
/* 431018 80218678 44800000 */ mtc1 $zero, $f0
/* 43101C 8021867C 00000000 */ nop
.L80218680:
/* 431020 80218680 4600B03C */ c.lt.s $f22, $f0
/* 431024 80218684 00000000 */ nop
.L80218688:
/* 431028 80218688 45000005 */ bc1f .L802186A0
/* 43102C 8021868C 00000000 */ nop
/* 431030 80218690 4600A03C */ c.lt.s $f20, $f0
/* 431034 80218694 00000000 */ nop
/* 431038 80218698 45030001 */ bc1tl .L802186A0
/* 43103C 8021869C 246300B4 */ addiu $v1, $v1, 0xb4
.L802186A0:
/* 431040 802186A0 44800000 */ mtc1 $zero, $f0
/* 431044 802186A4 00000000 */ nop
/* 431048 802186A8 4616003E */ c.le.s $f0, $f22
/* 43104C 802186AC 00000000 */ nop
/* 431050 802186B0 45000006 */ bc1f .L802186CC
/* 431054 802186B4 00000000 */ nop
/* 431058 802186B8 4600A03C */ c.lt.s $f20, $f0
/* 43105C 802186BC 00000000 */ nop
/* 431060 802186C0 45000002 */ bc1f .L802186CC
/* 431064 802186C4 24020168 */ addiu $v0, $zero, 0x168
/* 431068 802186C8 00431823 */ subu $v1, $v0, $v1
.L802186CC:
/* 43106C 802186CC 8FBF0010 */ lw $ra, 0x10($sp)
/* 431070 802186D0 D7B60020 */ ldc1 $f22, 0x20($sp)
/* 431074 802186D4 D7B40018 */ ldc1 $f20, 0x18($sp)
/* 431078 802186D8 3062FFFF */ andi $v0, $v1, 0xffff
/* 43107C 802186DC 03E00008 */ jr $ra
/* 431080 802186E0 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -0,0 +1,69 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802186E4_431084
/* 431084 802186E4 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 431088 802186E8 AFB40020 */ sw $s4, 0x20($sp)
/* 43108C 802186EC 0080A02D */ daddu $s4, $a0, $zero
/* 431090 802186F0 AFBF0024 */ sw $ra, 0x24($sp)
/* 431094 802186F4 AFB3001C */ sw $s3, 0x1c($sp)
/* 431098 802186F8 AFB20018 */ sw $s2, 0x18($sp)
/* 43109C 802186FC AFB10014 */ sw $s1, 0x14($sp)
/* 4310A0 80218700 AFB00010 */ sw $s0, 0x10($sp)
/* 4310A4 80218704 8E92000C */ lw $s2, 0xc($s4)
/* 4310A8 80218708 8E450000 */ lw $a1, ($s2)
/* 4310AC 8021870C 0C0B1EAF */ jal get_variable
/* 4310B0 80218710 26520004 */ addiu $s2, $s2, 4
/* 4310B4 80218714 8E450000 */ lw $a1, ($s2)
/* 4310B8 80218718 26520004 */ addiu $s2, $s2, 4
/* 4310BC 8021871C 0280202D */ daddu $a0, $s4, $zero
/* 4310C0 80218720 0C0B1EAF */ jal get_variable
/* 4310C4 80218724 0040802D */ daddu $s0, $v0, $zero
/* 4310C8 80218728 8E450000 */ lw $a1, ($s2)
/* 4310CC 8021872C 26520004 */ addiu $s2, $s2, 4
/* 4310D0 80218730 0280202D */ daddu $a0, $s4, $zero
/* 4310D4 80218734 0C0B1EAF */ jal get_variable
/* 4310D8 80218738 0040882D */ daddu $s1, $v0, $zero
/* 4310DC 8021873C 0040982D */ daddu $s3, $v0, $zero
/* 4310E0 80218740 8E450000 */ lw $a1, ($s2)
/* 4310E4 80218744 26520004 */ addiu $s2, $s2, 4
/* 4310E8 80218748 0280202D */ daddu $a0, $s4, $zero
/* 4310EC 8021874C 0C0B1EAF */ jal get_variable
/* 4310F0 80218750 02709823 */ subu $s3, $s3, $s0
/* 4310F4 80218754 0040802D */ daddu $s0, $v0, $zero
/* 4310F8 80218758 0280202D */ daddu $a0, $s4, $zero
/* 4310FC 8021875C 8E450000 */ lw $a1, ($s2)
/* 431100 80218760 0C0B1EAF */ jal get_variable
/* 431104 80218764 02118023 */ subu $s0, $s0, $s1
/* 431108 80218768 16600006 */ bnez $s3, .L80218784
/* 43110C 8021876C 00000000 */ nop
/* 431110 80218770 16000004 */ bnez $s0, .L80218784
/* 431114 80218774 0280202D */ daddu $a0, $s4, $zero
/* 431118 80218778 8E450000 */ lw $a1, ($s2)
/* 43111C 8021877C 080861EB */ j .L802187AC
/* 431120 80218780 0040302D */ daddu $a2, $v0, $zero
.L80218784:
/* 431124 80218784 44936000 */ mtc1 $s3, $f12
/* 431128 80218788 00000000 */ nop
/* 43112C 8021878C 46806320 */ cvt.s.w $f12, $f12
/* 431130 80218790 44907000 */ mtc1 $s0, $f14
/* 431134 80218794 00000000 */ nop
/* 431138 80218798 0C086156 */ jal func_80218558_430EF8
/* 43113C 8021879C 468073A0 */ cvt.s.w $f14, $f14
/* 431140 802187A0 0280202D */ daddu $a0, $s4, $zero
/* 431144 802187A4 8E450000 */ lw $a1, ($s2)
/* 431148 802187A8 2446FFA6 */ addiu $a2, $v0, -0x5a
.L802187AC:
/* 43114C 802187AC 0C0B2026 */ jal set_variable
/* 431150 802187B0 00000000 */ nop
/* 431154 802187B4 24020002 */ addiu $v0, $zero, 2
/* 431158 802187B8 8FBF0024 */ lw $ra, 0x24($sp)
/* 43115C 802187BC 8FB40020 */ lw $s4, 0x20($sp)
/* 431160 802187C0 8FB3001C */ lw $s3, 0x1c($sp)
/* 431164 802187C4 8FB20018 */ lw $s2, 0x18($sp)
/* 431168 802187C8 8FB10014 */ lw $s1, 0x14($sp)
/* 43116C 802187CC 8FB00010 */ lw $s0, 0x10($sp)
/* 431170 802187D0 03E00008 */ jr $ra
/* 431174 802187D4 27BD0028 */ addiu $sp, $sp, 0x28
/* 431178 802187D8 00000000 */ nop
/* 43117C 802187DC 00000000 */ nop

View File

@ -0,0 +1,164 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802187E0_431180
/* 431180 802187E0 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 431184 802187E4 AFB40020 */ sw $s4, 0x20($sp)
/* 431188 802187E8 0080A02D */ daddu $s4, $a0, $zero
/* 43118C 802187EC AFBF0024 */ sw $ra, 0x24($sp)
/* 431190 802187F0 AFB3001C */ sw $s3, 0x1c($sp)
/* 431194 802187F4 AFB20018 */ sw $s2, 0x18($sp)
/* 431198 802187F8 AFB10014 */ sw $s1, 0x14($sp)
/* 43119C 802187FC AFB00010 */ sw $s0, 0x10($sp)
/* 4311A0 80218800 F7BE0050 */ sdc1 $f30, 0x50($sp)
/* 4311A4 80218804 F7BC0048 */ sdc1 $f28, 0x48($sp)
/* 4311A8 80218808 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 4311AC 8021880C F7B80038 */ sdc1 $f24, 0x38($sp)
/* 4311B0 80218810 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 4311B4 80218814 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 4311B8 80218818 8E90000C */ lw $s0, 0xc($s4)
/* 4311BC 8021881C 8E050000 */ lw $a1, ($s0)
/* 4311C0 80218820 0C0B1EAF */ jal get_variable
/* 4311C4 80218824 26100004 */ addiu $s0, $s0, 4
/* 4311C8 80218828 44820000 */ mtc1 $v0, $f0
/* 4311CC 8021882C 00000000 */ nop
/* 4311D0 80218830 46800021 */ cvt.d.w $f0, $f0
/* 4311D4 80218834 8E110000 */ lw $s1, ($s0)
/* 4311D8 80218838 26100004 */ addiu $s0, $s0, 4
/* 4311DC 8021883C 3C014024 */ lui $at, 0x4024
/* 4311E0 80218840 44811800 */ mtc1 $at, $f3
/* 4311E4 80218844 44801000 */ mtc1 $zero, $f2
/* 4311E8 80218848 3C0140C9 */ lui $at, 0x40c9
/* 4311EC 8021884C 34210FD0 */ ori $at, $at, 0xfd0
/* 4311F0 80218850 4481A000 */ mtc1 $at, $f20
/* 4311F4 80218854 8E130000 */ lw $s3, ($s0)
/* 4311F8 80218858 46220003 */ div.d $f0, $f0, $f2
/* 4311FC 8021885C 462007A0 */ cvt.s.d $f30, $f0
/* 431200 80218860 4614F502 */ mul.s $f20, $f30, $f20
/* 431204 80218864 00000000 */ nop
/* 431208 80218868 26100004 */ addiu $s0, $s0, 4
/* 43120C 8021886C 8E120000 */ lw $s2, ($s0)
/* 431210 80218870 3C0143B4 */ lui $at, 0x43b4
/* 431214 80218874 44810000 */ mtc1 $at, $f0
/* 431218 80218878 8E100004 */ lw $s0, 4($s0)
/* 43121C 8021887C 4600A503 */ div.s $f20, $f20, $f0
/* 431220 80218880 0C00A85B */ jal sin_rad
/* 431224 80218884 4600A306 */ mov.s $f12, $f20
/* 431228 80218888 3C014100 */ lui $at, 0x4100
/* 43122C 8021888C 44816000 */ mtc1 $at, $f12
/* 431230 80218890 00000000 */ nop
/* 431234 80218894 460CA302 */ mul.s $f12, $f20, $f12
/* 431238 80218898 00000000 */ nop
/* 43123C 8021889C 3C014316 */ lui $at, 0x4316
/* 431240 802188A0 4481E000 */ mtc1 $at, $f28
/* 431244 802188A4 00000000 */ nop
/* 431248 802188A8 461C0582 */ mul.s $f22, $f0, $f28
/* 43124C 802188AC 00000000 */ nop
/* 431250 802188B0 4480D000 */ mtc1 $zero, $f26
/* 431254 802188B4 0C00A85B */ jal sin_rad
/* 431258 802188B8 461AB580 */ add.s $f22, $f22, $f26
/* 43125C 802188BC 3C014120 */ lui $at, 0x4120
/* 431260 802188C0 44811000 */ mtc1 $at, $f2
/* 431264 802188C4 00000000 */ nop
/* 431268 802188C8 46020602 */ mul.s $f24, $f0, $f2
/* 43126C 802188CC 00000000 */ nop
/* 431270 802188D0 4600A306 */ mov.s $f12, $f20
/* 431274 802188D4 0C00A874 */ jal cos_rad
/* 431278 802188D8 461AC600 */ add.s $f24, $f24, $f26
/* 43127C 802188DC 0280202D */ daddu $a0, $s4, $zero
/* 431280 802188E0 461C0502 */ mul.s $f20, $f0, $f28
/* 431284 802188E4 00000000 */ nop
/* 431288 802188E8 0220282D */ daddu $a1, $s1, $zero
/* 43128C 802188EC 4406B000 */ mfc1 $a2, $f22
/* 431290 802188F0 3C0141A0 */ lui $at, 0x41a0
/* 431294 802188F4 44810000 */ mtc1 $at, $f0
/* 431298 802188F8 3C01C248 */ lui $at, 0xc248
/* 43129C 802188FC 44811000 */ mtc1 $at, $f2
/* 4312A0 80218900 4600A503 */ div.s $f20, $f20, $f0
/* 4312A4 80218904 0C0B2190 */ jal set_float_variable
/* 4312A8 80218908 4602A500 */ add.s $f20, $f20, $f2
/* 4312AC 8021890C 0280202D */ daddu $a0, $s4, $zero
/* 4312B0 80218910 4406C000 */ mfc1 $a2, $f24
/* 4312B4 80218914 0C0B2190 */ jal set_float_variable
/* 4312B8 80218918 0260282D */ daddu $a1, $s3, $zero
/* 4312BC 8021891C 0280202D */ daddu $a0, $s4, $zero
/* 4312C0 80218920 4406A000 */ mfc1 $a2, $f20
/* 4312C4 80218924 0C0B2190 */ jal set_float_variable
/* 4312C8 80218928 0240282D */ daddu $a1, $s2, $zero
/* 4312CC 8021892C 3C0142B4 */ lui $at, 0x42b4
/* 4312D0 80218930 44810000 */ mtc1 $at, $f0
/* 4312D4 80218934 00000000 */ nop
/* 4312D8 80218938 461E003C */ c.lt.s $f0, $f30
/* 4312DC 8021893C 00000000 */ nop
/* 4312E0 80218940 4500000B */ bc1f .L80218970
/* 4312E4 80218944 0000302D */ daddu $a2, $zero, $zero
/* 4312E8 80218948 3C014387 */ lui $at, 0x4387
/* 4312EC 8021894C 44810000 */ mtc1 $at, $f0
/* 4312F0 80218950 00000000 */ nop
/* 4312F4 80218954 4600F03C */ c.lt.s $f30, $f0
/* 4312F8 80218958 00000000 */ nop
/* 4312FC 8021895C 45030001 */ bc1tl .L80218964
/* 431300 80218960 240600B4 */ addiu $a2, $zero, 0xb4
.L80218964:
/* 431304 80218964 3C0142B4 */ lui $at, 0x42b4
/* 431308 80218968 44810000 */ mtc1 $at, $f0
/* 43130C 8021896C 00000000 */ nop
.L80218970:
/* 431310 80218970 461E0001 */ sub.s $f0, $f0, $f30
/* 431314 80218974 46000005 */ abs.s $f0, $f0
/* 431318 80218978 4600010D */ trunc.w.s $f4, $f0
/* 43131C 8021897C 44022000 */ mfc1 $v0, $f4
/* 431320 80218980 00000000 */ nop
/* 431324 80218984 2842002D */ slti $v0, $v0, 0x2d
/* 431328 80218988 10400008 */ beqz $v0, .L802189AC
/* 43132C 8021898C 00000000 */ nop
/* 431330 80218990 3C014234 */ lui $at, 0x4234
/* 431334 80218994 44810000 */ mtc1 $at, $f0
/* 431338 80218998 00000000 */ nop
/* 43133C 8021899C 4600F001 */ sub.s $f0, $f30, $f0
/* 431340 802189A0 46000000 */ add.s $f0, $f0, $f0
/* 431344 802189A4 4600010D */ trunc.w.s $f4, $f0
/* 431348 802189A8 44062000 */ mfc1 $a2, $f4
.L802189AC:
/* 43134C 802189AC 3C014387 */ lui $at, 0x4387
/* 431350 802189B0 44810000 */ mtc1 $at, $f0
/* 431354 802189B4 00000000 */ nop
/* 431358 802189B8 461E0001 */ sub.s $f0, $f0, $f30
/* 43135C 802189BC 46000005 */ abs.s $f0, $f0
/* 431360 802189C0 4600010D */ trunc.w.s $f4, $f0
/* 431364 802189C4 44022000 */ mfc1 $v0, $f4
/* 431368 802189C8 00000000 */ nop
/* 43136C 802189CC 2842002D */ slti $v0, $v0, 0x2d
/* 431370 802189D0 1040000C */ beqz $v0, .L80218A04
/* 431374 802189D4 0280202D */ daddu $a0, $s4, $zero
/* 431378 802189D8 3C014361 */ lui $at, 0x4361
/* 43137C 802189DC 44810000 */ mtc1 $at, $f0
/* 431380 802189E0 00000000 */ nop
/* 431384 802189E4 4600F001 */ sub.s $f0, $f30, $f0
/* 431388 802189E8 46000000 */ add.s $f0, $f0, $f0
/* 43138C 802189EC 3C014334 */ lui $at, 0x4334
/* 431390 802189F0 44811000 */ mtc1 $at, $f2
/* 431394 802189F4 00000000 */ nop
/* 431398 802189F8 46020000 */ add.s $f0, $f0, $f2
/* 43139C 802189FC 4600010D */ trunc.w.s $f4, $f0
/* 4313A0 80218A00 44062000 */ mfc1 $a2, $f4
.L80218A04:
/* 4313A4 80218A04 0C0B2026 */ jal set_variable
/* 4313A8 80218A08 0200282D */ daddu $a1, $s0, $zero
/* 4313AC 80218A0C 8FBF0024 */ lw $ra, 0x24($sp)
/* 4313B0 80218A10 8FB40020 */ lw $s4, 0x20($sp)
/* 4313B4 80218A14 8FB3001C */ lw $s3, 0x1c($sp)
/* 4313B8 80218A18 8FB20018 */ lw $s2, 0x18($sp)
/* 4313BC 80218A1C 8FB10014 */ lw $s1, 0x14($sp)
/* 4313C0 80218A20 8FB00010 */ lw $s0, 0x10($sp)
/* 4313C4 80218A24 D7BE0050 */ ldc1 $f30, 0x50($sp)
/* 4313C8 80218A28 D7BC0048 */ ldc1 $f28, 0x48($sp)
/* 4313CC 80218A2C D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 4313D0 80218A30 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 4313D4 80218A34 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 4313D8 80218A38 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 4313DC 80218A3C 24020002 */ addiu $v0, $zero, 2
/* 4313E0 80218A40 03E00008 */ jr $ra
/* 4313E4 80218A44 27BD0058 */ addiu $sp, $sp, 0x58
/* 4313E8 80218A48 00000000 */ nop
/* 4313EC 80218A4C 00000000 */ nop

View File

@ -0,0 +1,164 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218A50_4313F0
/* 4313F0 80218A50 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 4313F4 80218A54 AFB40020 */ sw $s4, 0x20($sp)
/* 4313F8 80218A58 0080A02D */ daddu $s4, $a0, $zero
/* 4313FC 80218A5C AFBF0024 */ sw $ra, 0x24($sp)
/* 431400 80218A60 AFB3001C */ sw $s3, 0x1c($sp)
/* 431404 80218A64 AFB20018 */ sw $s2, 0x18($sp)
/* 431408 80218A68 AFB10014 */ sw $s1, 0x14($sp)
/* 43140C 80218A6C AFB00010 */ sw $s0, 0x10($sp)
/* 431410 80218A70 F7BE0050 */ sdc1 $f30, 0x50($sp)
/* 431414 80218A74 F7BC0048 */ sdc1 $f28, 0x48($sp)
/* 431418 80218A78 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 43141C 80218A7C F7B80038 */ sdc1 $f24, 0x38($sp)
/* 431420 80218A80 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 431424 80218A84 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 431428 80218A88 8E90000C */ lw $s0, 0xc($s4)
/* 43142C 80218A8C 8E050000 */ lw $a1, ($s0)
/* 431430 80218A90 0C0B1EAF */ jal get_variable
/* 431434 80218A94 26100004 */ addiu $s0, $s0, 4
/* 431438 80218A98 44820000 */ mtc1 $v0, $f0
/* 43143C 80218A9C 00000000 */ nop
/* 431440 80218AA0 46800021 */ cvt.d.w $f0, $f0
/* 431444 80218AA4 8E110000 */ lw $s1, ($s0)
/* 431448 80218AA8 26100004 */ addiu $s0, $s0, 4
/* 43144C 80218AAC 3C014024 */ lui $at, 0x4024
/* 431450 80218AB0 44811800 */ mtc1 $at, $f3
/* 431454 80218AB4 44801000 */ mtc1 $zero, $f2
/* 431458 80218AB8 3C0140C9 */ lui $at, 0x40c9
/* 43145C 80218ABC 34210FD0 */ ori $at, $at, 0xfd0
/* 431460 80218AC0 4481A000 */ mtc1 $at, $f20
/* 431464 80218AC4 8E130000 */ lw $s3, ($s0)
/* 431468 80218AC8 46220003 */ div.d $f0, $f0, $f2
/* 43146C 80218ACC 462007A0 */ cvt.s.d $f30, $f0
/* 431470 80218AD0 4614F502 */ mul.s $f20, $f30, $f20
/* 431474 80218AD4 00000000 */ nop
/* 431478 80218AD8 26100004 */ addiu $s0, $s0, 4
/* 43147C 80218ADC 8E120000 */ lw $s2, ($s0)
/* 431480 80218AE0 3C0143B4 */ lui $at, 0x43b4
/* 431484 80218AE4 44810000 */ mtc1 $at, $f0
/* 431488 80218AE8 8E100004 */ lw $s0, 4($s0)
/* 43148C 80218AEC 4600A503 */ div.s $f20, $f20, $f0
/* 431490 80218AF0 0C00A85B */ jal sin_rad
/* 431494 80218AF4 4600A306 */ mov.s $f12, $f20
/* 431498 80218AF8 3C014100 */ lui $at, 0x4100
/* 43149C 80218AFC 44816000 */ mtc1 $at, $f12
/* 4314A0 80218B00 00000000 */ nop
/* 4314A4 80218B04 460CA302 */ mul.s $f12, $f20, $f12
/* 4314A8 80218B08 00000000 */ nop
/* 4314AC 80218B0C 3C014316 */ lui $at, 0x4316
/* 4314B0 80218B10 4481E000 */ mtc1 $at, $f28
/* 4314B4 80218B14 00000000 */ nop
/* 4314B8 80218B18 461C0582 */ mul.s $f22, $f0, $f28
/* 4314BC 80218B1C 00000000 */ nop
/* 4314C0 80218B20 4480D000 */ mtc1 $zero, $f26
/* 4314C4 80218B24 0C00A85B */ jal sin_rad
/* 4314C8 80218B28 461AB580 */ add.s $f22, $f22, $f26
/* 4314CC 80218B2C 3C014120 */ lui $at, 0x4120
/* 4314D0 80218B30 44811000 */ mtc1 $at, $f2
/* 4314D4 80218B34 00000000 */ nop
/* 4314D8 80218B38 46020602 */ mul.s $f24, $f0, $f2
/* 4314DC 80218B3C 00000000 */ nop
/* 4314E0 80218B40 4600A306 */ mov.s $f12, $f20
/* 4314E4 80218B44 0C00A874 */ jal cos_rad
/* 4314E8 80218B48 461AC600 */ add.s $f24, $f24, $f26
/* 4314EC 80218B4C 0280202D */ daddu $a0, $s4, $zero
/* 4314F0 80218B50 461C0502 */ mul.s $f20, $f0, $f28
/* 4314F4 80218B54 00000000 */ nop
/* 4314F8 80218B58 0220282D */ daddu $a1, $s1, $zero
/* 4314FC 80218B5C 4406B000 */ mfc1 $a2, $f22
/* 431500 80218B60 3C0141A0 */ lui $at, 0x41a0
/* 431504 80218B64 44810000 */ mtc1 $at, $f0
/* 431508 80218B68 3C01C248 */ lui $at, 0xc248
/* 43150C 80218B6C 44811000 */ mtc1 $at, $f2
/* 431510 80218B70 4600A503 */ div.s $f20, $f20, $f0
/* 431514 80218B74 0C0B2190 */ jal set_float_variable
/* 431518 80218B78 4602A500 */ add.s $f20, $f20, $f2
/* 43151C 80218B7C 0280202D */ daddu $a0, $s4, $zero
/* 431520 80218B80 4406C000 */ mfc1 $a2, $f24
/* 431524 80218B84 0C0B2190 */ jal set_float_variable
/* 431528 80218B88 0260282D */ daddu $a1, $s3, $zero
/* 43152C 80218B8C 0280202D */ daddu $a0, $s4, $zero
/* 431530 80218B90 4406A000 */ mfc1 $a2, $f20
/* 431534 80218B94 0C0B2190 */ jal set_float_variable
/* 431538 80218B98 0240282D */ daddu $a1, $s2, $zero
/* 43153C 80218B9C 3C0142B4 */ lui $at, 0x42b4
/* 431540 80218BA0 44810000 */ mtc1 $at, $f0
/* 431544 80218BA4 00000000 */ nop
/* 431548 80218BA8 461E003C */ c.lt.s $f0, $f30
/* 43154C 80218BAC 00000000 */ nop
/* 431550 80218BB0 4500000B */ bc1f .L80218BE0
/* 431554 80218BB4 0000302D */ daddu $a2, $zero, $zero
/* 431558 80218BB8 3C014387 */ lui $at, 0x4387
/* 43155C 80218BBC 44810000 */ mtc1 $at, $f0
/* 431560 80218BC0 00000000 */ nop
/* 431564 80218BC4 4600F03C */ c.lt.s $f30, $f0
/* 431568 80218BC8 00000000 */ nop
/* 43156C 80218BCC 45030001 */ bc1tl .L80218BD4
/* 431570 80218BD0 240600B4 */ addiu $a2, $zero, 0xb4
.L80218BD4:
/* 431574 80218BD4 3C0142B4 */ lui $at, 0x42b4
/* 431578 80218BD8 44810000 */ mtc1 $at, $f0
/* 43157C 80218BDC 00000000 */ nop
.L80218BE0:
/* 431580 80218BE0 461E0001 */ sub.s $f0, $f0, $f30
/* 431584 80218BE4 46000005 */ abs.s $f0, $f0
/* 431588 80218BE8 4600010D */ trunc.w.s $f4, $f0
/* 43158C 80218BEC 44022000 */ mfc1 $v0, $f4
/* 431590 80218BF0 00000000 */ nop
/* 431594 80218BF4 2842002D */ slti $v0, $v0, 0x2d
/* 431598 80218BF8 10400008 */ beqz $v0, .L80218C1C
/* 43159C 80218BFC 00000000 */ nop
/* 4315A0 80218C00 3C014234 */ lui $at, 0x4234
/* 4315A4 80218C04 44810000 */ mtc1 $at, $f0
/* 4315A8 80218C08 00000000 */ nop
/* 4315AC 80218C0C 4600F001 */ sub.s $f0, $f30, $f0
/* 4315B0 80218C10 46000000 */ add.s $f0, $f0, $f0
/* 4315B4 80218C14 4600010D */ trunc.w.s $f4, $f0
/* 4315B8 80218C18 44062000 */ mfc1 $a2, $f4
.L80218C1C:
/* 4315BC 80218C1C 3C014387 */ lui $at, 0x4387
/* 4315C0 80218C20 44810000 */ mtc1 $at, $f0
/* 4315C4 80218C24 00000000 */ nop
/* 4315C8 80218C28 461E0001 */ sub.s $f0, $f0, $f30
/* 4315CC 80218C2C 46000005 */ abs.s $f0, $f0
/* 4315D0 80218C30 4600010D */ trunc.w.s $f4, $f0
/* 4315D4 80218C34 44022000 */ mfc1 $v0, $f4
/* 4315D8 80218C38 00000000 */ nop
/* 4315DC 80218C3C 2842002D */ slti $v0, $v0, 0x2d
/* 4315E0 80218C40 1040000C */ beqz $v0, .L80218C74
/* 4315E4 80218C44 0280202D */ daddu $a0, $s4, $zero
/* 4315E8 80218C48 3C014361 */ lui $at, 0x4361
/* 4315EC 80218C4C 44810000 */ mtc1 $at, $f0
/* 4315F0 80218C50 00000000 */ nop
/* 4315F4 80218C54 4600F001 */ sub.s $f0, $f30, $f0
/* 4315F8 80218C58 46000000 */ add.s $f0, $f0, $f0
/* 4315FC 80218C5C 3C014334 */ lui $at, 0x4334
/* 431600 80218C60 44811000 */ mtc1 $at, $f2
/* 431604 80218C64 00000000 */ nop
/* 431608 80218C68 46020000 */ add.s $f0, $f0, $f2
/* 43160C 80218C6C 4600010D */ trunc.w.s $f4, $f0
/* 431610 80218C70 44062000 */ mfc1 $a2, $f4
.L80218C74:
/* 431614 80218C74 0C0B2026 */ jal set_variable
/* 431618 80218C78 0200282D */ daddu $a1, $s0, $zero
/* 43161C 80218C7C 8FBF0024 */ lw $ra, 0x24($sp)
/* 431620 80218C80 8FB40020 */ lw $s4, 0x20($sp)
/* 431624 80218C84 8FB3001C */ lw $s3, 0x1c($sp)
/* 431628 80218C88 8FB20018 */ lw $s2, 0x18($sp)
/* 43162C 80218C8C 8FB10014 */ lw $s1, 0x14($sp)
/* 431630 80218C90 8FB00010 */ lw $s0, 0x10($sp)
/* 431634 80218C94 D7BE0050 */ ldc1 $f30, 0x50($sp)
/* 431638 80218C98 D7BC0048 */ ldc1 $f28, 0x48($sp)
/* 43163C 80218C9C D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 431640 80218CA0 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 431644 80218CA4 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 431648 80218CA8 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 43164C 80218CAC 24020002 */ addiu $v0, $zero, 2
/* 431650 80218CB0 03E00008 */ jr $ra
/* 431654 80218CB4 27BD0058 */ addiu $sp, $sp, 0x58
/* 431658 80218CB8 00000000 */ nop
/* 43165C 80218CBC 00000000 */ nop

View File

@ -0,0 +1,164 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218CC0_431660
/* 431660 80218CC0 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 431664 80218CC4 AFB40020 */ sw $s4, 0x20($sp)
/* 431668 80218CC8 0080A02D */ daddu $s4, $a0, $zero
/* 43166C 80218CCC AFBF0024 */ sw $ra, 0x24($sp)
/* 431670 80218CD0 AFB3001C */ sw $s3, 0x1c($sp)
/* 431674 80218CD4 AFB20018 */ sw $s2, 0x18($sp)
/* 431678 80218CD8 AFB10014 */ sw $s1, 0x14($sp)
/* 43167C 80218CDC AFB00010 */ sw $s0, 0x10($sp)
/* 431680 80218CE0 F7BE0050 */ sdc1 $f30, 0x50($sp)
/* 431684 80218CE4 F7BC0048 */ sdc1 $f28, 0x48($sp)
/* 431688 80218CE8 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 43168C 80218CEC F7B80038 */ sdc1 $f24, 0x38($sp)
/* 431690 80218CF0 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 431694 80218CF4 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 431698 80218CF8 8E90000C */ lw $s0, 0xc($s4)
/* 43169C 80218CFC 8E050000 */ lw $a1, ($s0)
/* 4316A0 80218D00 0C0B1EAF */ jal get_variable
/* 4316A4 80218D04 26100004 */ addiu $s0, $s0, 4
/* 4316A8 80218D08 44820000 */ mtc1 $v0, $f0
/* 4316AC 80218D0C 00000000 */ nop
/* 4316B0 80218D10 46800021 */ cvt.d.w $f0, $f0
/* 4316B4 80218D14 8E110000 */ lw $s1, ($s0)
/* 4316B8 80218D18 26100004 */ addiu $s0, $s0, 4
/* 4316BC 80218D1C 3C014024 */ lui $at, 0x4024
/* 4316C0 80218D20 44811800 */ mtc1 $at, $f3
/* 4316C4 80218D24 44801000 */ mtc1 $zero, $f2
/* 4316C8 80218D28 3C0140C9 */ lui $at, 0x40c9
/* 4316CC 80218D2C 34210FD0 */ ori $at, $at, 0xfd0
/* 4316D0 80218D30 4481A000 */ mtc1 $at, $f20
/* 4316D4 80218D34 8E130000 */ lw $s3, ($s0)
/* 4316D8 80218D38 46220003 */ div.d $f0, $f0, $f2
/* 4316DC 80218D3C 462007A0 */ cvt.s.d $f30, $f0
/* 4316E0 80218D40 4614F502 */ mul.s $f20, $f30, $f20
/* 4316E4 80218D44 00000000 */ nop
/* 4316E8 80218D48 26100004 */ addiu $s0, $s0, 4
/* 4316EC 80218D4C 8E120000 */ lw $s2, ($s0)
/* 4316F0 80218D50 3C0143B4 */ lui $at, 0x43b4
/* 4316F4 80218D54 44810000 */ mtc1 $at, $f0
/* 4316F8 80218D58 8E100004 */ lw $s0, 4($s0)
/* 4316FC 80218D5C 4600A503 */ div.s $f20, $f20, $f0
/* 431700 80218D60 0C00A85B */ jal sin_rad
/* 431704 80218D64 4600A306 */ mov.s $f12, $f20
/* 431708 80218D68 3C014100 */ lui $at, 0x4100
/* 43170C 80218D6C 44816000 */ mtc1 $at, $f12
/* 431710 80218D70 00000000 */ nop
/* 431714 80218D74 460CA302 */ mul.s $f12, $f20, $f12
/* 431718 80218D78 00000000 */ nop
/* 43171C 80218D7C 3C014316 */ lui $at, 0x4316
/* 431720 80218D80 4481E000 */ mtc1 $at, $f28
/* 431724 80218D84 00000000 */ nop
/* 431728 80218D88 461C0582 */ mul.s $f22, $f0, $f28
/* 43172C 80218D8C 00000000 */ nop
/* 431730 80218D90 4480D000 */ mtc1 $zero, $f26
/* 431734 80218D94 0C00A85B */ jal sin_rad
/* 431738 80218D98 461AB580 */ add.s $f22, $f22, $f26
/* 43173C 80218D9C 3C014120 */ lui $at, 0x4120
/* 431740 80218DA0 44811000 */ mtc1 $at, $f2
/* 431744 80218DA4 00000000 */ nop
/* 431748 80218DA8 46020602 */ mul.s $f24, $f0, $f2
/* 43174C 80218DAC 00000000 */ nop
/* 431750 80218DB0 4600A306 */ mov.s $f12, $f20
/* 431754 80218DB4 0C00A874 */ jal cos_rad
/* 431758 80218DB8 461AC600 */ add.s $f24, $f24, $f26
/* 43175C 80218DBC 0280202D */ daddu $a0, $s4, $zero
/* 431760 80218DC0 461C0502 */ mul.s $f20, $f0, $f28
/* 431764 80218DC4 00000000 */ nop
/* 431768 80218DC8 0220282D */ daddu $a1, $s1, $zero
/* 43176C 80218DCC 4406B000 */ mfc1 $a2, $f22
/* 431770 80218DD0 3C0141A0 */ lui $at, 0x41a0
/* 431774 80218DD4 44810000 */ mtc1 $at, $f0
/* 431778 80218DD8 3C01C248 */ lui $at, 0xc248
/* 43177C 80218DDC 44811000 */ mtc1 $at, $f2
/* 431780 80218DE0 4600A503 */ div.s $f20, $f20, $f0
/* 431784 80218DE4 0C0B2190 */ jal set_float_variable
/* 431788 80218DE8 4602A500 */ add.s $f20, $f20, $f2
/* 43178C 80218DEC 0280202D */ daddu $a0, $s4, $zero
/* 431790 80218DF0 4406C000 */ mfc1 $a2, $f24
/* 431794 80218DF4 0C0B2190 */ jal set_float_variable
/* 431798 80218DF8 0260282D */ daddu $a1, $s3, $zero
/* 43179C 80218DFC 0280202D */ daddu $a0, $s4, $zero
/* 4317A0 80218E00 4406A000 */ mfc1 $a2, $f20
/* 4317A4 80218E04 0C0B2190 */ jal set_float_variable
/* 4317A8 80218E08 0240282D */ daddu $a1, $s2, $zero
/* 4317AC 80218E0C 3C0142B4 */ lui $at, 0x42b4
/* 4317B0 80218E10 44810000 */ mtc1 $at, $f0
/* 4317B4 80218E14 00000000 */ nop
/* 4317B8 80218E18 461E003C */ c.lt.s $f0, $f30
/* 4317BC 80218E1C 00000000 */ nop
/* 4317C0 80218E20 4500000B */ bc1f .L80218E50
/* 4317C4 80218E24 0000302D */ daddu $a2, $zero, $zero
/* 4317C8 80218E28 3C014387 */ lui $at, 0x4387
/* 4317CC 80218E2C 44810000 */ mtc1 $at, $f0
/* 4317D0 80218E30 00000000 */ nop
/* 4317D4 80218E34 4600F03C */ c.lt.s $f30, $f0
/* 4317D8 80218E38 00000000 */ nop
/* 4317DC 80218E3C 45030001 */ bc1tl .L80218E44
/* 4317E0 80218E40 240600B4 */ addiu $a2, $zero, 0xb4
.L80218E44:
/* 4317E4 80218E44 3C0142B4 */ lui $at, 0x42b4
/* 4317E8 80218E48 44810000 */ mtc1 $at, $f0
/* 4317EC 80218E4C 00000000 */ nop
.L80218E50:
/* 4317F0 80218E50 461E0001 */ sub.s $f0, $f0, $f30
/* 4317F4 80218E54 46000005 */ abs.s $f0, $f0
/* 4317F8 80218E58 4600010D */ trunc.w.s $f4, $f0
/* 4317FC 80218E5C 44022000 */ mfc1 $v0, $f4
/* 431800 80218E60 00000000 */ nop
/* 431804 80218E64 2842002D */ slti $v0, $v0, 0x2d
/* 431808 80218E68 10400008 */ beqz $v0, .L80218E8C
/* 43180C 80218E6C 00000000 */ nop
/* 431810 80218E70 3C014234 */ lui $at, 0x4234
/* 431814 80218E74 44810000 */ mtc1 $at, $f0
/* 431818 80218E78 00000000 */ nop
/* 43181C 80218E7C 4600F001 */ sub.s $f0, $f30, $f0
/* 431820 80218E80 46000000 */ add.s $f0, $f0, $f0
/* 431824 80218E84 4600010D */ trunc.w.s $f4, $f0
/* 431828 80218E88 44062000 */ mfc1 $a2, $f4
.L80218E8C:
/* 43182C 80218E8C 3C014387 */ lui $at, 0x4387
/* 431830 80218E90 44810000 */ mtc1 $at, $f0
/* 431834 80218E94 00000000 */ nop
/* 431838 80218E98 461E0001 */ sub.s $f0, $f0, $f30
/* 43183C 80218E9C 46000005 */ abs.s $f0, $f0
/* 431840 80218EA0 4600010D */ trunc.w.s $f4, $f0
/* 431844 80218EA4 44022000 */ mfc1 $v0, $f4
/* 431848 80218EA8 00000000 */ nop
/* 43184C 80218EAC 2842002D */ slti $v0, $v0, 0x2d
/* 431850 80218EB0 1040000C */ beqz $v0, .L80218EE4
/* 431854 80218EB4 0280202D */ daddu $a0, $s4, $zero
/* 431858 80218EB8 3C014361 */ lui $at, 0x4361
/* 43185C 80218EBC 44810000 */ mtc1 $at, $f0
/* 431860 80218EC0 00000000 */ nop
/* 431864 80218EC4 4600F001 */ sub.s $f0, $f30, $f0
/* 431868 80218EC8 46000000 */ add.s $f0, $f0, $f0
/* 43186C 80218ECC 3C014334 */ lui $at, 0x4334
/* 431870 80218ED0 44811000 */ mtc1 $at, $f2
/* 431874 80218ED4 00000000 */ nop
/* 431878 80218ED8 46020000 */ add.s $f0, $f0, $f2
/* 43187C 80218EDC 4600010D */ trunc.w.s $f4, $f0
/* 431880 80218EE0 44062000 */ mfc1 $a2, $f4
.L80218EE4:
/* 431884 80218EE4 0C0B2026 */ jal set_variable
/* 431888 80218EE8 0200282D */ daddu $a1, $s0, $zero
/* 43188C 80218EEC 8FBF0024 */ lw $ra, 0x24($sp)
/* 431890 80218EF0 8FB40020 */ lw $s4, 0x20($sp)
/* 431894 80218EF4 8FB3001C */ lw $s3, 0x1c($sp)
/* 431898 80218EF8 8FB20018 */ lw $s2, 0x18($sp)
/* 43189C 80218EFC 8FB10014 */ lw $s1, 0x14($sp)
/* 4318A0 80218F00 8FB00010 */ lw $s0, 0x10($sp)
/* 4318A4 80218F04 D7BE0050 */ ldc1 $f30, 0x50($sp)
/* 4318A8 80218F08 D7BC0048 */ ldc1 $f28, 0x48($sp)
/* 4318AC 80218F0C D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 4318B0 80218F10 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 4318B4 80218F14 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 4318B8 80218F18 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 4318BC 80218F1C 24020002 */ addiu $v0, $zero, 2
/* 4318C0 80218F20 03E00008 */ jr $ra
/* 4318C4 80218F24 27BD0058 */ addiu $sp, $sp, 0x58
/* 4318C8 80218F28 00000000 */ nop
/* 4318CC 80218F2C 00000000 */ nop

View File

@ -0,0 +1,162 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218F30_4318D0
/* 4318D0 80218F30 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 4318D4 80218F34 AFB40020 */ sw $s4, 0x20($sp)
/* 4318D8 80218F38 0080A02D */ daddu $s4, $a0, $zero
/* 4318DC 80218F3C AFBF0024 */ sw $ra, 0x24($sp)
/* 4318E0 80218F40 AFB3001C */ sw $s3, 0x1c($sp)
/* 4318E4 80218F44 AFB20018 */ sw $s2, 0x18($sp)
/* 4318E8 80218F48 AFB10014 */ sw $s1, 0x14($sp)
/* 4318EC 80218F4C AFB00010 */ sw $s0, 0x10($sp)
/* 4318F0 80218F50 F7BE0050 */ sdc1 $f30, 0x50($sp)
/* 4318F4 80218F54 F7BC0048 */ sdc1 $f28, 0x48($sp)
/* 4318F8 80218F58 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 4318FC 80218F5C F7B80038 */ sdc1 $f24, 0x38($sp)
/* 431900 80218F60 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 431904 80218F64 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 431908 80218F68 8E90000C */ lw $s0, 0xc($s4)
/* 43190C 80218F6C 8E050000 */ lw $a1, ($s0)
/* 431910 80218F70 0C0B1EAF */ jal get_variable
/* 431914 80218F74 26100004 */ addiu $s0, $s0, 4
/* 431918 80218F78 44820000 */ mtc1 $v0, $f0
/* 43191C 80218F7C 00000000 */ nop
/* 431920 80218F80 46800021 */ cvt.d.w $f0, $f0
/* 431924 80218F84 8E110000 */ lw $s1, ($s0)
/* 431928 80218F88 26100004 */ addiu $s0, $s0, 4
/* 43192C 80218F8C 3C014024 */ lui $at, 0x4024
/* 431930 80218F90 44811800 */ mtc1 $at, $f3
/* 431934 80218F94 44801000 */ mtc1 $zero, $f2
/* 431938 80218F98 3C0140C9 */ lui $at, 0x40c9
/* 43193C 80218F9C 34210FD0 */ ori $at, $at, 0xfd0
/* 431940 80218FA0 4481A000 */ mtc1 $at, $f20
/* 431944 80218FA4 8E130000 */ lw $s3, ($s0)
/* 431948 80218FA8 46220003 */ div.d $f0, $f0, $f2
/* 43194C 80218FAC 462007A0 */ cvt.s.d $f30, $f0
/* 431950 80218FB0 4614F502 */ mul.s $f20, $f30, $f20
/* 431954 80218FB4 00000000 */ nop
/* 431958 80218FB8 26100004 */ addiu $s0, $s0, 4
/* 43195C 80218FBC 8E120000 */ lw $s2, ($s0)
/* 431960 80218FC0 3C0143B4 */ lui $at, 0x43b4
/* 431964 80218FC4 44810000 */ mtc1 $at, $f0
/* 431968 80218FC8 8E100004 */ lw $s0, 4($s0)
/* 43196C 80218FCC 4600A503 */ div.s $f20, $f20, $f0
/* 431970 80218FD0 0C00A85B */ jal sin_rad
/* 431974 80218FD4 4600A306 */ mov.s $f12, $f20
/* 431978 80218FD8 3C014100 */ lui $at, 0x4100
/* 43197C 80218FDC 44816000 */ mtc1 $at, $f12
/* 431980 80218FE0 00000000 */ nop
/* 431984 80218FE4 460CA302 */ mul.s $f12, $f20, $f12
/* 431988 80218FE8 00000000 */ nop
/* 43198C 80218FEC 3C014316 */ lui $at, 0x4316
/* 431990 80218FF0 4481E000 */ mtc1 $at, $f28
/* 431994 80218FF4 00000000 */ nop
/* 431998 80218FF8 461C0582 */ mul.s $f22, $f0, $f28
/* 43199C 80218FFC 00000000 */ nop
/* 4319A0 80219000 4480D000 */ mtc1 $zero, $f26
/* 4319A4 80219004 0C00A85B */ jal sin_rad
/* 4319A8 80219008 461AB580 */ add.s $f22, $f22, $f26
/* 4319AC 8021900C 3C014120 */ lui $at, 0x4120
/* 4319B0 80219010 44811000 */ mtc1 $at, $f2
/* 4319B4 80219014 00000000 */ nop
/* 4319B8 80219018 46020602 */ mul.s $f24, $f0, $f2
/* 4319BC 8021901C 00000000 */ nop
/* 4319C0 80219020 4600A306 */ mov.s $f12, $f20
/* 4319C4 80219024 0C00A874 */ jal cos_rad
/* 4319C8 80219028 461AC600 */ add.s $f24, $f24, $f26
/* 4319CC 8021902C 0280202D */ daddu $a0, $s4, $zero
/* 4319D0 80219030 461C0502 */ mul.s $f20, $f0, $f28
/* 4319D4 80219034 00000000 */ nop
/* 4319D8 80219038 0220282D */ daddu $a1, $s1, $zero
/* 4319DC 8021903C 4406B000 */ mfc1 $a2, $f22
/* 4319E0 80219040 3C0141A0 */ lui $at, 0x41a0
/* 4319E4 80219044 44810000 */ mtc1 $at, $f0
/* 4319E8 80219048 3C01C248 */ lui $at, 0xc248
/* 4319EC 8021904C 44811000 */ mtc1 $at, $f2
/* 4319F0 80219050 4600A503 */ div.s $f20, $f20, $f0
/* 4319F4 80219054 0C0B2190 */ jal set_float_variable
/* 4319F8 80219058 4602A500 */ add.s $f20, $f20, $f2
/* 4319FC 8021905C 0280202D */ daddu $a0, $s4, $zero
/* 431A00 80219060 4406C000 */ mfc1 $a2, $f24
/* 431A04 80219064 0C0B2190 */ jal set_float_variable
/* 431A08 80219068 0260282D */ daddu $a1, $s3, $zero
/* 431A0C 8021906C 0280202D */ daddu $a0, $s4, $zero
/* 431A10 80219070 4406A000 */ mfc1 $a2, $f20
/* 431A14 80219074 0C0B2190 */ jal set_float_variable
/* 431A18 80219078 0240282D */ daddu $a1, $s2, $zero
/* 431A1C 8021907C 3C0142B4 */ lui $at, 0x42b4
/* 431A20 80219080 44810000 */ mtc1 $at, $f0
/* 431A24 80219084 00000000 */ nop
/* 431A28 80219088 461E003C */ c.lt.s $f0, $f30
/* 431A2C 8021908C 00000000 */ nop
/* 431A30 80219090 4500000B */ bc1f .L802190C0
/* 431A34 80219094 0000302D */ daddu $a2, $zero, $zero
/* 431A38 80219098 3C014387 */ lui $at, 0x4387
/* 431A3C 8021909C 44810000 */ mtc1 $at, $f0
/* 431A40 802190A0 00000000 */ nop
/* 431A44 802190A4 4600F03C */ c.lt.s $f30, $f0
/* 431A48 802190A8 00000000 */ nop
/* 431A4C 802190AC 45030001 */ bc1tl .L802190B4
/* 431A50 802190B0 240600B4 */ addiu $a2, $zero, 0xb4
.L802190B4:
/* 431A54 802190B4 3C0142B4 */ lui $at, 0x42b4
/* 431A58 802190B8 44810000 */ mtc1 $at, $f0
/* 431A5C 802190BC 00000000 */ nop
.L802190C0:
/* 431A60 802190C0 461E0001 */ sub.s $f0, $f0, $f30
/* 431A64 802190C4 46000005 */ abs.s $f0, $f0
/* 431A68 802190C8 4600010D */ trunc.w.s $f4, $f0
/* 431A6C 802190CC 44022000 */ mfc1 $v0, $f4
/* 431A70 802190D0 00000000 */ nop
/* 431A74 802190D4 2842002D */ slti $v0, $v0, 0x2d
/* 431A78 802190D8 10400008 */ beqz $v0, .L802190FC
/* 431A7C 802190DC 00000000 */ nop
/* 431A80 802190E0 3C014234 */ lui $at, 0x4234
/* 431A84 802190E4 44810000 */ mtc1 $at, $f0
/* 431A88 802190E8 00000000 */ nop
/* 431A8C 802190EC 4600F001 */ sub.s $f0, $f30, $f0
/* 431A90 802190F0 46000000 */ add.s $f0, $f0, $f0
/* 431A94 802190F4 4600010D */ trunc.w.s $f4, $f0
/* 431A98 802190F8 44062000 */ mfc1 $a2, $f4
.L802190FC:
/* 431A9C 802190FC 3C014387 */ lui $at, 0x4387
/* 431AA0 80219100 44810000 */ mtc1 $at, $f0
/* 431AA4 80219104 00000000 */ nop
/* 431AA8 80219108 461E0001 */ sub.s $f0, $f0, $f30
/* 431AAC 8021910C 46000005 */ abs.s $f0, $f0
/* 431AB0 80219110 4600010D */ trunc.w.s $f4, $f0
/* 431AB4 80219114 44022000 */ mfc1 $v0, $f4
/* 431AB8 80219118 00000000 */ nop
/* 431ABC 8021911C 2842002D */ slti $v0, $v0, 0x2d
/* 431AC0 80219120 1040000C */ beqz $v0, .L80219154
/* 431AC4 80219124 0280202D */ daddu $a0, $s4, $zero
/* 431AC8 80219128 3C014361 */ lui $at, 0x4361
/* 431ACC 8021912C 44810000 */ mtc1 $at, $f0
/* 431AD0 80219130 00000000 */ nop
/* 431AD4 80219134 4600F001 */ sub.s $f0, $f30, $f0
/* 431AD8 80219138 46000000 */ add.s $f0, $f0, $f0
/* 431ADC 8021913C 3C014334 */ lui $at, 0x4334
/* 431AE0 80219140 44811000 */ mtc1 $at, $f2
/* 431AE4 80219144 00000000 */ nop
/* 431AE8 80219148 46020000 */ add.s $f0, $f0, $f2
/* 431AEC 8021914C 4600010D */ trunc.w.s $f4, $f0
/* 431AF0 80219150 44062000 */ mfc1 $a2, $f4
.L80219154:
/* 431AF4 80219154 0C0B2026 */ jal set_variable
/* 431AF8 80219158 0200282D */ daddu $a1, $s0, $zero
/* 431AFC 8021915C 8FBF0024 */ lw $ra, 0x24($sp)
/* 431B00 80219160 8FB40020 */ lw $s4, 0x20($sp)
/* 431B04 80219164 8FB3001C */ lw $s3, 0x1c($sp)
/* 431B08 80219168 8FB20018 */ lw $s2, 0x18($sp)
/* 431B0C 8021916C 8FB10014 */ lw $s1, 0x14($sp)
/* 431B10 80219170 8FB00010 */ lw $s0, 0x10($sp)
/* 431B14 80219174 D7BE0050 */ ldc1 $f30, 0x50($sp)
/* 431B18 80219178 D7BC0048 */ ldc1 $f28, 0x48($sp)
/* 431B1C 8021917C D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 431B20 80219180 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 431B24 80219184 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 431B28 80219188 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 431B2C 8021918C 24020002 */ addiu $v0, $zero, 2
/* 431B30 80219190 03E00008 */ jr $ra
/* 431B34 80219194 27BD0058 */ addiu $sp, $sp, 0x58

View File

@ -0,0 +1,22 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80219198_431B38
/* 431B38 80219198 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 431B3C 8021919C 240403D4 */ addiu $a0, $zero, 0x3d4
/* 431B40 802191A0 AFBF0010 */ sw $ra, 0x10($sp)
/* 431B44 802191A4 0C046EDD */ jal set_world_fog_dist
/* 431B48 802191A8 240503E8 */ addiu $a1, $zero, 0x3e8
/* 431B4C 802191AC 2404000F */ addiu $a0, $zero, 0xf
/* 431B50 802191B0 24050005 */ addiu $a1, $zero, 5
/* 431B54 802191B4 24060037 */ addiu $a2, $zero, 0x37
/* 431B58 802191B8 0C046EE2 */ jal set_world_fog_color
/* 431B5C 802191BC 240700FF */ addiu $a3, $zero, 0xff
/* 431B60 802191C0 0C046ED4 */ jal enable_world_fog
/* 431B64 802191C4 00000000 */ nop
/* 431B68 802191C8 8FBF0010 */ lw $ra, 0x10($sp)
/* 431B6C 802191CC 24020002 */ addiu $v0, $zero, 2
/* 431B70 802191D0 03E00008 */ jr $ra
/* 431B74 802191D4 27BD0018 */ addiu $sp, $sp, 0x18
/* 431B78 802191D8 00000000 */ nop
/* 431B7C 802191DC 00000000 */ nop

View File

@ -237,14 +237,14 @@ typedef struct Enemy {
/* 0xDC */ char unk_DC[20];
} Enemy; // size = 0xF0
/// Zero-terminated.
typedef struct {
/* 0x00 */ s32 npcCount;
/* 0x04 */ StaticNpc* npcs;
/* 0x08 */ FormationID formationID;
/* 0x08 */ BattleID battle;
} NpcGroupList[]; // size = 0x0C
#define NPC_GROUP(npcs, formationID) { sizeof(npcs) / sizeof(StaticNpc), &npcs, formationID }
#define NPC_GROUP_LIST_END() { 0, 0, 0 }
#define NPC_GROUP(npcs, battle) { sizeof(npcs) / sizeof(StaticNpc), &npcs, battle }
Enemy* get_enemy(NpcId npcId);
MapConfig* get_current_map_header(void);

View File

@ -10,8 +10,8 @@
#define UNK_FUN_PTR(name) void(*name)(void)
#define UNK_ARGS
typedef s32 FormationID;
#define FORMATION_ID(section, stage, index) (((section << 16) + (stage << 8) + index))
typedef s32 BattleID;
#define BATTLE_ID(area, stage, index) ((area << 16) + (stage << 8) + index)
typedef s32 NpcAnimID;
#define NPC_ANIM(sprite, palette, anim) (((_NPC_SPRITE_##sprite << 16) + (_NPC_PALETTE_##sprite##_##palette << 8) + _NPC_ANIM_##sprite##_##anim))

View File

@ -0,0 +1,7 @@
#ifndef _BATTLE_ACTOR_GOOMBA_
#define _BATTLE_ACTOR_GOOMBA_
// TODO: disasm
#define goomba 0x802196EC
#endif

View File

@ -0,0 +1,7 @@
#ifndef _BATTLE_ACTOR_PARAGOOMBA_
#define _BATTLE_ACTOR_PARAGOOMBA_
// TODO: disasm
#define paragoomba 0x8021CD00
#endif

View File

@ -0,0 +1,7 @@
#ifndef _BATTLE_ACTOR_SPIKED_GOOMBA_
#define _BATTLE_ACTOR_SPIKED_GOOMBA_
// TODO: disasm
#define spikedGoomba 0x8021B0AC
#endif

View File

@ -0,0 +1,25 @@
#include "common.h"
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_80218000_4309A0);
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_8021818C_430B2C);
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_80218280_430C20);
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_8021840C_430DAC);
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_80218500_430EA0);
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_80218558_430EF8);
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_802186E4_431084);
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_802187E0_431180);
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_80218A50_4313F0);
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_80218CC0_431660);
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_80218F30_4318D0);
INCLUDE_ASM(s32, "battle/area_kmr_part_1/4309A0", func_80219198_431B38);

View File

@ -0,0 +1,94 @@
#include "common.h"
#include "battle/battle.h"
#include "battle/actor/goomba.h"
#include "battle/actor/paragoomba.h"
#include "battle/actor/spiked_goomba.h"
Formation formation0 = {
{ goomba, .position = 1, .priority = 10 },
};
Formation formation1 = {
{ goomba, .position = 1, .priority = 10 },
{ goomba, .position = 2, .priority = 9 },
};
Formation formation2 = {
{ goomba, .position = 0, .priority = 10 },
{ goomba, .position = 1, .priority = 9 },
{ goomba, .position = 2, .priority = 8 },
};
Formation formation3 = {
{ goomba, .position = 1, .priority = 10 },
{ paragoomba, .position = 6, .priority = 9 },
};
Formation formation4 = {
{ goomba, .position = 0, .priority = 10 },
{ goomba, .position = 1, .priority = 9 },
{ goomba, .position = 2, .priority = 8 },
{ goomba, .position = 3, .priority = 7 },
};
Formation formation5 = {
{ goomba, .position = 1, .priority = 10 },
{ spikedGoomba, .position = 2, .priority = 9 },
};
Formation formation6 = {
{ goomba, .position = 0, .priority = 10 },
{ paragoomba, .position = 5, .priority = 9 },
{ goomba, .position = 2, .priority = 8 },
{ paragoomba, .position = 7, .priority = 7 },
};
Formation formation7 = {
{ paragoomba, .position = 5, .priority = 10 },
};
Formation formation8 = {
{ paragoomba, .position = 5, .priority = 10 },
{ paragoomba, .position = 6, .priority = 9 },
};
Formation formation9 = {
{ paragoomba, .position = 4, .priority = 10 },
{ paragoomba, .position = 5, .priority = 9 },
{ paragoomba, .position = 6, .priority = 8 },
};
Formation formation10 = {
{ spikedGoomba, .position = 1, .priority = 10 },
};
Formation formation11 = {
{ spikedGoomba, .position = 1, .priority = 10 },
{ goomba, .position = 2, .priority = 9 },
};
BattleList area_kmr_part_1_battles = {
BATTLE("クリボー", formation0, 0x8022066C),
BATTLE("クリボーx", formation1, 0x8022066C),
BATTLE("クリボーx", formation2, 0x8022066C),
BATTLE("クリボー、パタクリボー", formation3, 0x8022066C),
BATTLE("クリボーx", formation4, 0x8022066C),
BATTLE("クリボー,トゲクリボー", formation5, 0x8022066C),
BATTLE("クリボー,パタクリボー,クリボー,パタクリボー", formation6, 0x8022066C),
BATTLE("パタクリボー", formation7, 0x8022066C),
BATTLE("パタクリボーx", formation8, 0x8022066C),
BATTLE("パタクリボーx", formation9, 0x8022066C),
BATTLE("トゲクリボー", formation10, 0x8022066C),
BATTLE("トゲクリボー、クリボー", formation11, 0x8022066C),
{},
};
StageList area_kmr_part_1_stages = {
{ "kmr_02", 0x8021FDD0 },
{ "kmr_03", 0x8022021C },
{ "kmr_04", 0x8022066C },
{ "kmr_05", 0x80220A78 },
{ "kmr_06", 0x80220ECC },
{},
};

368
src/battle/battle.c Normal file
View File

@ -0,0 +1,368 @@
#include "common.h"
#include "ld_addrs.h"
#include "battle.h"
typedef struct BattleArea {
/* 0x00 */ char* name; ///< JP debug name.
/* 0x04 */ s32 dmaStart;
/* 0x08 */ s32 dmaEnd;
/* 0x0C */ void* dmaDest;
/* 0x10 */ BattleList* battles;
/* 0x14 */ StageList* stages;
/* 0x18 */ s32 unused_18;
/* 0x1C */ void* dmaTable;
} BattleArea; // size = 0x20
#define AREA(id) \
.dmaStart = &code_##id##_ROM_START, \
.dmaEnd = &code_##id##_ROM_END, \
.dmaDest = &code_##id##_VRAM
const s32 rodata_75240[] = {
/* 0x75240 */ 0x00010202, 0x03030303, 0x04040404, 0x04040404,
/* 0x75250 */ 0x05050505, 0x05050505, 0x05050505, 0x05050505,
/* 0x75260 */ 0x06060606, 0x06060606, 0x06060606, 0x06060606,
/* 0x75270 */ 0x06060606, 0x06060606, 0x06060606, 0x06060606,
/* 0x75280 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x75290 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x752A0 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x752B0 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x752C0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x752D0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x752E0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x752F0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75300 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75310 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75320 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75330 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75340 */ 0x00010202, 0x03030303, 0x04040404, 0x04040404,
/* 0x75350 */ 0x05050505, 0x05050505, 0x05050505, 0x05050505,
/* 0x75360 */ 0x06060606, 0x06060606, 0x06060606, 0x06060606,
/* 0x75370 */ 0x06060606, 0x06060606, 0x06060606, 0x06060606,
/* 0x75380 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x75390 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x753A0 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x753B0 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x753C0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x753D0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x753E0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x753F0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75400 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75410 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75420 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75430 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75440 */ 0x00010202, 0x03030303, 0x04040404, 0x04040404,
/* 0x75450 */ 0x05050505, 0x05050505, 0x05050505, 0x05050505,
/* 0x75460 */ 0x06060606, 0x06060606, 0x06060606, 0x06060606,
/* 0x75470 */ 0x06060606, 0x06060606, 0x06060606, 0x06060606,
/* 0x75480 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x75490 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x754A0 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x754B0 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x754C0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x754D0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x754E0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x754F0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75500 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75510 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75520 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75530 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75540 */ 0x00010202, 0x03030303, 0x04040404, 0x04040404,
/* 0x75550 */ 0x05050505, 0x05050505, 0x05050505, 0x05050505,
/* 0x75560 */ 0x06060606, 0x06060606, 0x06060606, 0x06060606,
/* 0x75570 */ 0x06060606, 0x06060606, 0x06060606, 0x06060606,
/* 0x75580 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x75590 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x755A0 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x755B0 */ 0x07070707, 0x07070707, 0x07070707, 0x07070707,
/* 0x755C0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x755D0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x755E0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x755F0 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75600 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75610 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75620 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
/* 0x75630 */ 0x08080808, 0x08080808, 0x08080808, 0x08080808,
};
BattleList area_kmr_part_1_battles;
StageList area_kmr_part_1_stages;
BattleArea gBattleAreas[0x30] = {
{
AREA(area_kmr_part_1),
.name = "エリア その1",
.battles = area_kmr_part_1_battles,
.stages = area_kmr_part_1_stages,
},
{
AREA(area_kmr_part_2),
.name = "エリア その2",
.battles = 0x80219840,
.stages = 0x8021987C,
},
{
AREA(area_kmr_part_3),
.name = "エリア その3",
.battles = 0x8021A2AC,
.stages = 0x8021A360,
},
{
AREA(area_mac),
.name = "エリア ",
.battles = 0x80232A5C,
.stages = 0x80232AD4,
},
{
AREA(area_hos),
.name = "エリア ",
.battles = 0x80225F24,
.stages = 0x80225F88,
},
{
AREA(area_nok),
.name = "エリア ",
.battles = 0x80219520,
.stages = 0x80219728,
},
{
AREA(area_trd_part_1),
.name = "エリア その1",
.battles = 0x80218CB0,
.stages = 0x80218EE0,
},
{
AREA(area_trd_part_2),
.name = "エリア その2",
.battles = 0x8021A5DC,
.stages = 0x8021A604,
},
{
AREA(area_trd_part_3),
.name = "エリア その3",
.battles = 0x8021823C,
.stages = 0x80218264,
},
{
AREA(area_iwa),
.name = "エリア ",
.battles = 0x802185B8,
.stages = 0x802186E4,
},
{
AREA(area_sbk),
.name = "エリア ",
.battles = 0x8021FE80,
.stages = 0x8021FFE8,
},
{
AREA(area_isk_part_1),
.name = "エリア その1",
.battles = 0x80224700,
.stages = 0x802248A4,
},
{
AREA(area_isk_part_2),
.name = "エリア その2",
.battles = 0x80220448,
.stages = 0x80220470,
},
{
AREA(area_mim),
.name = "エリア ",
.battles = 0x8021EA70,
.stages = 0x8021EBEC,
},
{
AREA(area_arn),
.name = "エリア ",
.battles = 0x80228110,
.stages = 0x80228278,
},
{
AREA(area_dgb),
.name = "エリア ",
.battles = 0x8021B38C,
.stages = 0x8021B418,
},
{
AREA(area_omo),
.name = "エリア ",
.battles = 0x80230730,
.stages = 0x80230AC8,
},
{
AREA(area_omo2),
.name = "エリア ",
.battles = 0x8022FBF4,
.stages = 0x8022FC1C,
},
{
AREA(area_omo3),
.name = "エリア ",
.battles = 0x8022EA2C,
.stages = 0x8022EB1C,
},
{
AREA(area_kgr),
.name = "エリア ",
.battles = 0x8021D5FC,
.stages = 0x8021D624,
},
{
AREA(area_jan),
.name = "エリア ",
.battles = 0x80228AF8,
.stages = 0x80228C60,
},
{
AREA(area_jan2),
.name = "エリア ",
.battles = 0x8021F6C8,
.stages = 0x8021F72C,
},
{
AREA(area_kzn),
.name = "エリア ",
.battles = 0x80229E74,
.stages = 0x8022A02C,
},
{
AREA(area_kzn2),
.name = "エリア ",
.battles = 0x8022AA08,
.stages = 0x8022AA44,
.dmaTable = 0x8022AA84,
},
{
AREA(area_flo),
.name = "エリア ",
.battles = 0x80234574,
.stages = 0x8023486C,
},
{
AREA(area_flo2),
.name = "エリア ",
.battles = 0x802356FC,
.stages = 0x80235788,
},
{
AREA(area_tik),
.name = "エリア ",
.battles = 0x802340B4,
.stages = 0x802342BC,
},
{
AREA(area_tik2),
.name = "エリア ",
.battles = 0x80227A90,
.stages = 0x80227AE0,
},
{
AREA(area_tik3),
.name = "エリア ",
.battles = 0x802232E8,
.stages = 0x8022334C,
},
{
AREA(area_sam),
.name = "エリア ",
.battles = 0x80231164,
.stages = 0x80231290,
},
{
AREA(area_sam2),
.name = "エリア ",
.battles = 0x802234F0,
.stages = 0x8022352C,
},
{
AREA(area_pra),
.name = "エリア ",
.battles = 0x8022F4D4,
.stages = 0x8022F614,
},
{
AREA(area_pra2),
.name = "エリア ",
.battles = 0x802215A0,
.stages = 0x802215C8,
},
{
AREA(area_pra3),
.name = "エリア ",
.battles = 0x80232888,
.stages = 0x8023298C,
},
{
AREA(area_kpa),
.name = "エリア ",
.battles = 0x80231A64,
.stages = 0x80231ED8,
},
{
AREA(area_kpa2),
.name = "エリア ",
.battles = 0x802346A8,
.stages = 0x80234720,
},
{
AREA(area_kpa3),
.name = "エリア ",
.battles = 0x8022839C,
.stages = 0x802283EC,
},
{
AREA(area_kpa4),
.name = "エリア ",
.battles = 0x80227910,
.stages = 0x80227988,
},
{
AREA(area_kkj),
.name = "エリア ",
.battles = 0x802185BC,
.stages = 0x802185E4,
},
{
AREA(area_dig),
.name = "エリア ",
.battles = 0x8022A7C4,
.stages = 0x8022A83C,
},
{},
{
AREA(area_omo2_1),
.name = "エリア _",
},
{
AREA(area_omo2_2),
.name = "エリア _",
},
{
AREA(area_omo2_3),
.name = "エリア _",
},
{
AREA(area_omo2_4),
.name = "エリア _",
},
{
AREA(area_omo2_5),
.name = "エリア _",
},
{
AREA(area_omo2_6),
.name = "エリア _",
},
{},
};
// possibly a jump table
// vram 0x8009A578
const s32 rodata_75978[] = {
0x80072F38, 0x80072F4C,
0x80072F64, 0x80072F90, 0x80072FA8, 0x00000000,
0x8007301C, 0x80073070, 0x80073094, 0x800730CC,
0x800730F8,
};

48
src/battle/battle.h Normal file
View File

@ -0,0 +1,48 @@
#ifndef _BATTLE_BATTLE_H_
#define _BATTLE_BATTLE_H_
#include "common.h"
typedef struct Stage {
/* 0x00 */ const char* texture;
/* 0x04 */ const char* shape;
/* 0x08 */ const char* hit;
/* 0x0C */ Bytecode* preBattle;
/* 0x10 */ Bytecode* postBattle;
/* 0x14 */ const char* bg;
/* 0x18 */ s32 unk_18;
/* 0x1C */ s32 unk_1C;
/* 0x20 */ s32 unk_20;
/* 0x24 */ s32 unk_24;
} Stage; // size = 0x28
/// Zero-terminated.
typedef struct StageListRow {
/* 0x00 */ const char* id; ///< Map ID.
/* 0x04 */ Stage* stage;
} StageList[]; // size = 0x08 * n
typedef struct FormationRow {
/* 0x00 */ StaticActorData* actor;
/* 0x04 */ s32 position; ///< Home position. May also be a `Vector3*`.
/* 0x08 */ s32 priority; ///< Actors with higher priority values take their turn first.
/* 0x0C */ s32 var0;
/* 0x10 */ s32 var1;
/* 0x14 */ s32 var2;
/* 0x18 */ s32 var3;
} Formation[]; // size = 0x1C * n
/// Zero-terminated.
typedef struct Battle {
/* 0x00 */ const char* name; ///< Debug SJIS name.
/* 0x04 */ s32 formationSize;
/* 0x08 */ Formation* formation;
/* 0x0C */ Stage* stage;
/* 0x10 */ s32 unk_10;
} BattleList[]; // size = 0x14 * n
#define BATTLE(name, formation, stage) { name, ARRAY_COUNT(formation), formation, stage }
// TODO: enum for home position (0..3 are floor, 4..7 are air, etc.)
#endif

View File

@ -187,8 +187,8 @@ StaticNpc M(goombaNpc) = {
};
NpcGroupList M(npcGroupList) = {
NPC_GROUP(M(goombaNpc), FORMATION_ID(1, 0, 3)),
NPC_GROUP_LIST_END(),
NPC_GROUP(M(goombaNpc), BATTLE_ID(1, 0, 3)),
{},
};
Script M(ReadEastSign) = SCRIPT({

View File

@ -657,5 +657,5 @@ Area gAreas[] = {
AREA(mgm, "ミニゲーム"), // minige-mu [Minigames]
AREA(gv, "ゲームオーバー"), // ge-mu o-ba- [Game Over]
AREA(tst, "テストマップ"), // tesuto mappu [Test map]
0, 0, 0, 0,
{},
};

45
tools/sjis.py Executable file
View File

@ -0,0 +1,45 @@
#! /usr/bin/python3
def decode(data):
length = 0
is_dbl_char = False
for byte in data:
if byte == 0 and not is_dbl_char:
break
# ignore null terminator when reading double-byte char
is_dbl_char = False
if byte & 0xF0 == 0x80:
is_dbl_char = True
if byte & 0xF0 == 0x90:
is_dbl_char = True
if byte & 0xF0 == 0xE0:
is_dbl_char = True
if byte & 0xF0 == 0xF0:
is_dbl_char = True
length += 1
return data[:length].decode('shift-jis')
if __name__ == "__main__":
import sys
if len(sys.argv) <= 1:
print("usage: ./sjis.py <bytes...>")
print("decodes zero-terminated SJIS from arbitrary hex bytes.")
print("e.g.")
print(" ./sjis.py 80072F64 80072F90 80072FA8 00000000")
print(" エリア その1")
exit(1)
s = "".join(sys.argv[1:])
data = bytearray()
for i in range(0, len(s), 2):
byte = eval(f"0x{s[i]}{s[i + 1]}")
data.append(byte)
print(data)
print(decode(data))

View File

@ -213,10 +213,11 @@ segments:
- [0x542E0, data, code_31650]
- [0x6B450, .data, world/world]
- [0x6EAC0, bin] # has scripts
- [0x70E30, bin, battle/battle]
- [0x70E30, .data, battle/battle]
- [0x71430, bin]
- [0x73DA0, .rodata, world/world]
- [0x74EA0, bin]
- [0x75240, .rodata, battle/battle] # ram 80099E40
- type: code
start: 0x759B0
vram: 0x800DC500
@ -925,280 +926,333 @@ segments:
files:
- [0x415D90, c]
- [0x4200C0, bin] # todo split this further
- name: battle/section_0/
- name: battle/area_kmr_part_1/
type: code
start: 0x4309A0
vram: 0x80218000
overlay: True
files:
- [0x4309A0, bin]
- name: battle/section_1/
- [0x4309A0, c]
- [0x431B80, .data, battle/area_kmr_part_1/battles]
- [0x431FB0, bin, battle/area_kmr_part_1/goomba]
- [0x4398A0, .rodata, battle/area_kmr_part_1/battles]
- [0x439984, bin]
- name: battle/area_kmr_part_2/
type: code
start: 0x439A90
vram: 0x80218000
overlay: True
files:
- [0x439A90, bin]
- name: battle/section_2/
- name: battle/area_kmr_part_3/
type: code
start: 0x447440
vram: 0x80218000
overlay: True
files:
- [0x447440, bin]
- name: battle/section_3/
- name: battle/area_mac/
type: code
start: 0x464490
vram: 0x80218000
overlay: True
files:
- [0x464490, bin]
- name: battle/section_4/
- name: battle/area_hos/
type: code
start: 0x47F0B0
vram: 0x80218000
overlay: True
files:
- [0x47F0B0, bin]
- name: battle/section_5/
- name: battle/area_nok/
type: code
start: 0x48D1A0
vram: 0x80218000
overlay: True
files:
- [0x48D1A0, bin]
- name: battle/section_6/
- name: battle/area_trd_part_1/
type: code
start: 0x4A10A0
vram: 0x80218000
overlay: True
files:
- [0x4A10A0, bin]
- name: battle/section_7/
- name: battle/area_trd_part_2/
type: code
start: 0x4B11F0
vram: 0x80218000
overlay: True
files:
- [0x4B11F0, bin]
- name: battle/section_8/
- name: battle/area_trd_part_3/
type: code
start: 0x4CF1B0
vram: 0x80218000
overlay: True
files:
- [0x4CF1B0, bin]
- name: battle/section_9/
- name: battle/area_iwa/
type: code
start: 0x4D01F0
vram: 0x80218000
overlay: True
files:
- [0x4D01F0, bin]
- name: battle/section_10/
- name: battle/area_sbk/
type: code
start: 0x4DA5E0
vram: 0x80218000
overlay: True
files:
- [0x4DA5E0, bin]
- name: battle/section_11/
- [0x4DA5E0, bin] # 1 func
- [0x4DA6B0, bin] # 2 funcs
- [0x4DA860, bin] # data
- [0x4E25E0, bin] # rodata
- name: battle/area_isk_part_1/
type: code
start: 0x4E2740
vram: 0x80218000
overlay: True
files:
- [0x4E2740, bin]
- name: battle/section_12/
- name: battle/area_isk_part_2/
type: code
start: 0x4EF4A0
vram: 0x80218000
overlay: True
files:
- [0x4EF4A0, bin]
- name: battle/section_13/
- name: battle/area_mim/
type: code
start: 0x4F7BE0
vram: 0x80218000
overlay: True
files:
- [0x4F7BE0, bin]
- name: battle/section_14/
- name: battle/area_arn/
type: code
start: 0x4FEA50
vram: 0x80218000
overlay: True
files:
- [0x4FEA50, bin]
- name: battle/section_15/
- name: battle/area_dgb/
type: code
start: 0x50F020
vram: 0x80218000
overlay: True
files:
- [0x50F020, bin]
- name: battle/section_16/
- name: battle/area_omo/
type: code
start: 0x5125D0
vram: 0x80218000
overlay: True
files:
- [0x5125D0, bin]
- name: battle/section_17/
- name: battle/area_omo2/
type: code
start: 0x52B6A0
vram: 0x80218000
overlay: True
files:
- [0x52B6A0, bin]
- name: battle/section_41/
- name: battle/area_omo2_1/
type: code
start: 0x543570
vram: 0x80231000
overlay: True
files:
- [0x543570, bin]
- name: battle/section_42/
- name: battle/area_omo2_2/
type: code
start: 0x5483E0
vram: 0x80231000
overlay: True
files:
- [0x5483E0, bin]
- name: battle/section_43/
- name: battle/area_omo2_3/
type: code
start: 0x54CC70
vram: 0x80231000
overlay: True
files:
- [0x54CC70, bin]
- name: battle/section_44/
- name: battle/area_omo2_4/
type: code
start: 0x552440
vram: 0x80231000
overlay: True
files:
- [0x552440, bin]
- name: battle/section_45/
- name: battle/area_omo2_5/
type: code
start: 0x552BB0
vram: 0x80231000
overlay: True
files:
- [0x552BB0, bin]
- name: battle/section_46/
- name: battle/area_omo2_6/
type: code
start: 0x556C90
vram: 0x80231000
overlay: True
files:
- [0x556C90, bin]
- name: battle/section_18/
- name: battle/area_omo3/
type: code
start: 0x5573E0
vram: 0x80218000
overlay: True
files:
- [0x5573E0, bin]
- name: battle/section_19/
- name: battle/area_kgr/
type: code
start: 0x56E2A0
vram: 0x80218000
overlay: True
files:
- [0x56E2A0, bin]
- name: battle/section_20/
- name: battle/area_jan/
type: code
start: 0x573920
vram: 0x80218000
overlay: True
files:
- [0x573920, bin]
- name: battle/section_21/
- name: battle/area_jan2/
type: code
start: 0x584940
vram: 0x80218000
overlay: True
files:
- [0x584940, bin]
- name: battle/section_22/
- name: battle/area_kzn/
type: code
start: 0x58C2F0
vram: 0x80218000
overlay: True
files:
- [0x58C2F0, bin]
- name: battle/section_23/
- name: battle/area_kzn2/
type: code
start: 0x59E6E0
vram: 0x80218000
overlay: True
files:
- [0x59E6E0, bin]
- name: battle/section_24/
- name: battle/area_flo/
type: code
start: 0x5B14B0
vram: 0x80218000
overlay: True
files:
- [0x5B14B0, bin]
- name: battle/section_25/
- name: battle/area_flo2/
type: code
start: 0x5CE690
vram: 0x80218000
overlay: True
files:
- [0x5CE690, bin]
- name: battle/section_26/
- name: battle/area_tik/
type: code
start: 0x5EC490
vram: 0x80218000
overlay: True
files:
- [0x5EC490, bin]
- name: battle/section_27/
- name: battle/area_tik2/
type: code
start: 0x608AB0
vram: 0x80218000
overlay: True
files:
- [0x608AB0, bin]
- name: battle/section_28/
- name: battle/area_tik3/
type: code
start: 0x6186F0
vram: 0x80218000
overlay: True
files:
- [0x6186F0, bin]
- name: battle/section_29/
- name: battle/area_sam/
type: code
start: 0x623BA0
vram: 0x80218000
overlay: True
files:
- [0x623BA0, bin]
- name: battle/section_30/
- name: battle/area_sam2/
type: code
start: 0x63D1E0
vram: 0x80218000
overlay: True
files:
- [0x63D1E0, bin]
- name: battle/section_31/
- name: battle/area_pra/
type: code
start: 0x648E10
vram: 0x80218000
overlay: True
files:
- [0x648E10, bin]
- name: battle/section_32/
- name: battle/area_pra2/
type: code
start: 0x660750
vram: 0x80218000
overlay: True
files:
- [0x660750, bin]
- name: battle/section_33/
- name: battle/area_pra3/
type: code
start: 0x669D80
vram: 0x80218000
overlay: True
files:
- [0x669D80, bin]
- name: battle/section_34/
- name: battle/area_kpa/
type: code
start: 0x684A30
vram: 0x80218000
overlay: True
files:
- [0x684A30, bin]
- name: battle/section_35/
- name: battle/area_kpa2/
type: code
start: 0x69F200
vram: 0x80218000
overlay: True
files:
- [0x69F200, bin]
- name: battle/section_36/
- name: battle/area_kpa3/
type: code
start: 0x6BBB90
vram: 0x80218000
overlay: True
files:
- [0x6BBB90, bin]
- name: battle/section_37/
- name: battle/area_kpa4/
type: code
start: 0x6CC070
vram: 0x80218000
overlay: True
files:
- [0x6CC070, bin]
- name: battle/section_38/
- name: battle/area_kkj/
type: code
start: 0x6DBDA0
vram: 0x80218000
overlay: True
files:
- [0x6DBDA0, bin]
- name: battle/section_39/
- name: battle/area_dig/
type: code
start: 0x6DDDC0
vram: 0x80218000
overlay: True
files:
- [0x6DDDC0, bin]
- [0x6F0B30, bin]

View File

@ -5302,3 +5302,7 @@ D_F5000007 = 0xF5000007;
D_F79DDD0F = 0xF79DDD0F;
D_FA000028 = 0xFA000028;
D_FD100008 = 0xFD100008;
D_FFFF41F0 = 0xFFFF41F0;
D_8021A194 = 0x8021A194;
D_8021BC70 = 0x8021BC70;
D_8021EF6C = 0x8021EF6C;