papermario/ver/jp/asm/nonmatchings/99A0/func_8002E5A0.s
Ethan Roseman 3315d6010f
Splat refactor (#257)
* all non-world rodata migrated

* data disasm

* kinda working

* updated yaml

* bloop

* linker header

* configure 2.0

* bin

* mass rename to remove code_

* pause rename

* battle partner stuff

* whew

* more renames

* more renames

* more renaming

* it builds!

* updates

* remove main prefix

* one more thing

* crc, yay0

* .data, .rodata, .bss

* img

* dead_atan2

* it buildsgit add -A

* split battle/partner/6FAD10

* rm &s on sleepy_sheep syms

* sha1sum ninja rule description

* OK but commented out PaperMarioMapFS and PaperMarioNpcSprites

* uncomment

* fix mapfs

* match func_8003CFB4

* .

* clean up and name npc_iter_no_op

* npc.c

* enable cc warnings

* name npc_find_near

* use singular options.asset_path

* smores

* cc_dsl only when needed

* kinda fix configure for splat refactor2

* ok!

* new msg format

* remove old msg format docs

* slight bug fixes, splat adjustment

* git subrepo pull (merge) --force tools/splat

subrepo:
  subdir:   "tools/splat"
  merged:   "cfc140bb76"
upstream:
  origin:   "https://github.com/ethteck/splat.git"
  branch:   "master"
  commit:   "cfc140bb76"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* git subrepo pull (merge) --force tools/splat

subrepo:
  subdir:   "tools/splat"
  merged:   "85349befcd"
upstream:
  origin:   "https://github.com/ethteck/splat.git"
  branch:   "master"
  commit:   "85349befcd"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* Update symbol addrs

* git subrepo pull tools/splat

subrepo:
  subdir:   "tools/splat"
  merged:   "a44631e194"
upstream:
  origin:   "https://github.com/ethteck/splat.git"
  branch:   "master"
  commit:   "a44631e194"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

Co-authored-by: Alex Bates <hi@imalex.xyz>
2021-04-13 16:47:52 +09:00

261 lines
13 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8002E5A0
/* 99A0 8002E5A0 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 99A4 8002E5A4 AFB00010 */ sw $s0, 0x10($sp)
/* 99A8 8002E5A8 0080802D */ daddu $s0, $a0, $zero
/* 99AC 8002E5AC AFBF0014 */ sw $ra, 0x14($sp)
/* 99B0 8002E5B0 F7BE0040 */ sdc1 $f30, 0x40($sp)
/* 99B4 8002E5B4 F7BC0038 */ sdc1 $f28, 0x38($sp)
/* 99B8 8002E5B8 F7BA0030 */ sdc1 $f26, 0x30($sp)
/* 99BC 8002E5BC F7B80028 */ sdc1 $f24, 0x28($sp)
/* 99C0 8002E5C0 F7B60020 */ sdc1 $f22, 0x20($sp)
/* 99C4 8002E5C4 F7B40018 */ sdc1 $f20, 0x18($sp)
/* 99C8 8002E5C8 8602001C */ lh $v0, 0x1c($s0)
/* 99CC 8002E5CC C6000060 */ lwc1 $f0, 0x60($s0)
/* 99D0 8002E5D0 4482B000 */ mtc1 $v0, $f22
/* 99D4 8002E5D4 00000000 */ nop
/* 99D8 8002E5D8 4680B5A0 */ cvt.s.w $f22, $f22
/* 99DC 8002E5DC 4600B03C */ c.lt.s $f22, $f0
/* 99E0 8002E5E0 00000000 */ nop
/* 99E4 8002E5E4 45030001 */ bc1tl .L8002E5EC
/* 99E8 8002E5E8 4600B006 */ mov.s $f0, $f22
.L8002E5EC:
/* 99EC 8002E5EC 4600B107 */ neg.s $f4, $f22
/* 99F0 8002E5F0 4604003C */ c.lt.s $f0, $f4
/* 99F4 8002E5F4 00000000 */ nop
/* 99F8 8002E5F8 45030001 */ bc1tl .L8002E600
/* 99FC 8002E5FC 46002006 */ mov.s $f0, $f4
.L8002E600:
/* 9A00 8002E600 C6080068 */ lwc1 $f8, 0x68($s0)
/* 9A04 8002E604 8602001E */ lh $v0, 0x1e($s0)
/* 9A08 8002E608 4482C000 */ mtc1 $v0, $f24
/* 9A0C 8002E60C 00000000 */ nop
/* 9A10 8002E610 4680C620 */ cvt.s.w $f24, $f24
/* 9A14 8002E614 4608C03C */ c.lt.s $f24, $f8
/* 9A18 8002E618 00000000 */ nop
/* 9A1C 8002E61C 45000002 */ bc1f .L8002E628
/* 9A20 8002E620 E6000054 */ swc1 $f0, 0x54($s0)
/* 9A24 8002E624 4600C206 */ mov.s $f8, $f24
.L8002E628:
/* 9A28 8002E628 4600C007 */ neg.s $f0, $f24
/* 9A2C 8002E62C 4600403C */ c.lt.s $f8, $f0
/* 9A30 8002E630 00000000 */ nop
/* 9A34 8002E634 45030001 */ bc1tl .L8002E63C
/* 9A38 8002E638 46000206 */ mov.s $f8, $f0
.L8002E63C:
/* 9A3C 8002E63C 86020020 */ lh $v0, 0x20($s0)
/* 9A40 8002E640 3C01800A */ lui $at, %hi(D_8009A5CC)
/* 9A44 8002E644 C424A5CC */ lwc1 $f4, %lo(D_8009A5CC)($at)
/* 9A48 8002E648 AE000070 */ sw $zero, 0x70($s0)
/* 9A4C 8002E64C 44821000 */ mtc1 $v0, $f2
/* 9A50 8002E650 00000000 */ nop
/* 9A54 8002E654 468010A0 */ cvt.s.w $f2, $f2
/* 9A58 8002E658 46041082 */ mul.s $f2, $f2, $f4
/* 9A5C 8002E65C 00000000 */ nop
/* 9A60 8002E660 86020022 */ lh $v0, 0x22($s0)
/* 9A64 8002E664 C6060070 */ lwc1 $f6, 0x70($s0)
/* 9A68 8002E668 44820000 */ mtc1 $v0, $f0
/* 9A6C 8002E66C 00000000 */ nop
/* 9A70 8002E670 46800020 */ cvt.s.w $f0, $f0
/* 9A74 8002E674 86020006 */ lh $v0, 6($s0)
/* 9A78 8002E678 46040002 */ mul.s $f0, $f0, $f4
/* 9A7C 8002E67C 00000000 */ nop
/* 9A80 8002E680 E608005C */ swc1 $f8, 0x5c($s0)
/* 9A84 8002E684 AE000074 */ sw $zero, 0x74($s0)
/* 9A88 8002E688 E6060084 */ swc1 $f6, 0x84($s0)
/* 9A8C 8002E68C E6020078 */ swc1 $f2, 0x78($s0)
/* 9A90 8002E690 10400047 */ beqz $v0, .L8002E7B0
/* 9A94 8002E694 E600007C */ swc1 $f0, 0x7c($s0)
/* 9A98 8002E698 4480F000 */ mtc1 $zero, $f30
/* 9A9C 8002E69C C6020074 */ lwc1 $f2, 0x74($s0)
/* 9AA0 8002E6A0 3C0140C9 */ lui $at, 0x40c9
/* 9AA4 8002E6A4 34210FD0 */ ori $at, $at, 0xfd0
/* 9AA8 8002E6A8 4481B000 */ mtc1 $at, $f22
/* 9AAC 8002E6AC C6080054 */ lwc1 $f8, 0x54($s0)
/* 9AB0 8002E6B0 C6000058 */ lwc1 $f0, 0x58($s0)
/* 9AB4 8002E6B4 C604007C */ lwc1 $f4, 0x7c($s0)
/* 9AB8 8002E6B8 C606005C */ lwc1 $f6, 0x5c($s0)
/* 9ABC 8002E6BC 3C0143B4 */ lui $at, 0x43b4
/* 9AC0 8002E6C0 4481A000 */ mtc1 $at, $f20
/* 9AC4 8002E6C4 46161082 */ mul.s $f2, $f2, $f22
/* 9AC8 8002E6C8 00000000 */ nop
/* 9ACC 8002E6CC A6000006 */ sh $zero, 6($s0)
/* 9AD0 8002E6D0 E61E0098 */ swc1 $f30, 0x98($s0)
/* 9AD4 8002E6D4 E61E009C */ swc1 $f30, 0x9c($s0)
/* 9AD8 8002E6D8 46040000 */ add.s $f0, $f0, $f4
/* 9ADC 8002E6DC E6080048 */ swc1 $f8, 0x48($s0)
/* 9AE0 8002E6E0 E6060050 */ swc1 $f6, 0x50($s0)
/* 9AE4 8002E6E4 E600004C */ swc1 $f0, 0x4c($s0)
/* 9AE8 8002E6E8 46141683 */ div.s $f26, $f2, $f20
/* 9AEC 8002E6EC 0C00A84B */ jal func_8002A12C
/* 9AF0 8002E6F0 4600D306 */ mov.s $f12, $f26
/* 9AF4 8002E6F4 46000706 */ mov.s $f28, $f0
/* 9AF8 8002E6F8 0C00A864 */ jal func_8002A190
/* 9AFC 8002E6FC 4600D306 */ mov.s $f12, $f26
/* 9B00 8002E700 46000286 */ mov.s $f10, $f0
/* 9B04 8002E704 461E5202 */ mul.s $f8, $f10, $f30
/* 9B08 8002E708 00000000 */ nop
/* 9B0C 8002E70C 4600F087 */ neg.s $f2, $f30
/* 9B10 8002E710 4602E082 */ mul.s $f2, $f28, $f2
/* 9B14 8002E714 00000000 */ nop
/* 9B18 8002E718 C6180078 */ lwc1 $f24, 0x78($s0)
/* 9B1C 8002E71C 461CC102 */ mul.s $f4, $f24, $f28
/* 9B20 8002E720 00000000 */ nop
/* 9B24 8002E724 460AC182 */ mul.s $f6, $f24, $f10
/* 9B28 8002E728 00000000 */ nop
/* 9B2C 8002E72C C6000070 */ lwc1 $f0, 0x70($s0)
/* 9B30 8002E730 46160002 */ mul.s $f0, $f0, $f22
/* 9B34 8002E734 00000000 */ nop
/* 9B38 8002E738 4600F286 */ mov.s $f10, $f30
/* 9B3C 8002E73C 46005586 */ mov.s $f22, $f10
/* 9B40 8002E740 46044780 */ add.s $f30, $f8, $f4
/* 9B44 8002E744 46140683 */ div.s $f26, $f0, $f20
/* 9B48 8002E748 4600D306 */ mov.s $f12, $f26
/* 9B4C 8002E74C 0C00A84B */ jal func_8002A12C
/* 9B50 8002E750 46061600 */ add.s $f24, $f2, $f6
/* 9B54 8002E754 46000706 */ mov.s $f28, $f0
/* 9B58 8002E758 0C00A864 */ jal func_8002A190
/* 9B5C 8002E75C 4600D306 */ mov.s $f12, $f26
/* 9B60 8002E760 46000286 */ mov.s $f10, $f0
/* 9B64 8002E764 46165182 */ mul.s $f6, $f10, $f22
/* 9B68 8002E768 00000000 */ nop
/* 9B6C 8002E76C 4616E102 */ mul.s $f4, $f28, $f22
/* 9B70 8002E770 00000000 */ nop
/* 9B74 8002E774 461CC082 */ mul.s $f2, $f24, $f28
/* 9B78 8002E778 00000000 */ nop
/* 9B7C 8002E77C 460AC002 */ mul.s $f0, $f24, $f10
/* 9B80 8002E780 00000000 */ nop
/* 9B84 8002E784 46023281 */ sub.s $f10, $f6, $f2
/* 9B88 8002E788 46002180 */ add.s $f6, $f4, $f0
/* 9B8C 8002E78C C600004C */ lwc1 $f0, 0x4c($s0)
/* 9B90 8002E790 461E0000 */ add.s $f0, $f0, $f30
/* 9B94 8002E794 C6040048 */ lwc1 $f4, 0x48($s0)
/* 9B98 8002E798 460A2100 */ add.s $f4, $f4, $f10
/* 9B9C 8002E79C C6020050 */ lwc1 $f2, 0x50($s0)
/* 9BA0 8002E7A0 46061080 */ add.s $f2, $f2, $f6
/* 9BA4 8002E7A4 E6000040 */ swc1 $f0, 0x40($s0)
/* 9BA8 8002E7A8 E604003C */ swc1 $f4, 0x3c($s0)
/* 9BAC 8002E7AC E6020044 */ swc1 $f2, 0x44($s0)
.L8002E7B0:
/* 9BB0 8002E7B0 4480F000 */ mtc1 $zero, $f30
/* 9BB4 8002E7B4 C6020074 */ lwc1 $f2, 0x74($s0)
/* 9BB8 8002E7B8 3C0140C9 */ lui $at, 0x40c9
/* 9BBC 8002E7BC 34210FD0 */ ori $at, $at, 0xfd0
/* 9BC0 8002E7C0 4481B000 */ mtc1 $at, $f22
/* 9BC4 8002E7C4 C6080054 */ lwc1 $f8, 0x54($s0)
/* 9BC8 8002E7C8 46161082 */ mul.s $f2, $f2, $f22
/* 9BCC 8002E7CC 00000000 */ nop
/* 9BD0 8002E7D0 C6000058 */ lwc1 $f0, 0x58($s0)
/* 9BD4 8002E7D4 C604007C */ lwc1 $f4, 0x7c($s0)
/* 9BD8 8002E7D8 C606005C */ lwc1 $f6, 0x5c($s0)
/* 9BDC 8002E7DC 3C0143B4 */ lui $at, 0x43b4
/* 9BE0 8002E7E0 4481A000 */ mtc1 $at, $f20
/* 9BE4 8002E7E4 46040000 */ add.s $f0, $f0, $f4
/* 9BE8 8002E7E8 E6080048 */ swc1 $f8, 0x48($s0)
/* 9BEC 8002E7EC E6060050 */ swc1 $f6, 0x50($s0)
/* 9BF0 8002E7F0 E600004C */ swc1 $f0, 0x4c($s0)
/* 9BF4 8002E7F4 46141683 */ div.s $f26, $f2, $f20
/* 9BF8 8002E7F8 0C00A84B */ jal func_8002A12C
/* 9BFC 8002E7FC 4600D306 */ mov.s $f12, $f26
/* 9C00 8002E800 46000706 */ mov.s $f28, $f0
/* 9C04 8002E804 0C00A864 */ jal func_8002A190
/* 9C08 8002E808 4600D306 */ mov.s $f12, $f26
/* 9C0C 8002E80C 46000286 */ mov.s $f10, $f0
/* 9C10 8002E810 461E5202 */ mul.s $f8, $f10, $f30
/* 9C14 8002E814 00000000 */ nop
/* 9C18 8002E818 4600F087 */ neg.s $f2, $f30
/* 9C1C 8002E81C 4602E082 */ mul.s $f2, $f28, $f2
/* 9C20 8002E820 00000000 */ nop
/* 9C24 8002E824 C6180078 */ lwc1 $f24, 0x78($s0)
/* 9C28 8002E828 461CC102 */ mul.s $f4, $f24, $f28
/* 9C2C 8002E82C 00000000 */ nop
/* 9C30 8002E830 460AC182 */ mul.s $f6, $f24, $f10
/* 9C34 8002E834 00000000 */ nop
/* 9C38 8002E838 C6000070 */ lwc1 $f0, 0x70($s0)
/* 9C3C 8002E83C 46160002 */ mul.s $f0, $f0, $f22
/* 9C40 8002E840 00000000 */ nop
/* 9C44 8002E844 4600F286 */ mov.s $f10, $f30
/* 9C48 8002E848 46005586 */ mov.s $f22, $f10
/* 9C4C 8002E84C 46044780 */ add.s $f30, $f8, $f4
/* 9C50 8002E850 46140683 */ div.s $f26, $f0, $f20
/* 9C54 8002E854 4600D306 */ mov.s $f12, $f26
/* 9C58 8002E858 0C00A84B */ jal func_8002A12C
/* 9C5C 8002E85C 46061600 */ add.s $f24, $f2, $f6
/* 9C60 8002E860 46000706 */ mov.s $f28, $f0
/* 9C64 8002E864 0C00A864 */ jal func_8002A190
/* 9C68 8002E868 4600D306 */ mov.s $f12, $f26
/* 9C6C 8002E86C 46000286 */ mov.s $f10, $f0
/* 9C70 8002E870 46165102 */ mul.s $f4, $f10, $f22
/* 9C74 8002E874 00000000 */ nop
/* 9C78 8002E878 4616E182 */ mul.s $f6, $f28, $f22
/* 9C7C 8002E87C 00000000 */ nop
/* 9C80 8002E880 461CC002 */ mul.s $f0, $f24, $f28
/* 9C84 8002E884 00000000 */ nop
/* 9C88 8002E888 460AC082 */ mul.s $f2, $f24, $f10
/* 9C8C 8002E88C 00000000 */ nop
/* 9C90 8002E890 46002281 */ sub.s $f10, $f4, $f0
/* 9C94 8002E894 46023180 */ add.s $f6, $f6, $f2
/* 9C98 8002E898 C602004C */ lwc1 $f2, 0x4c($s0)
/* 9C9C 8002E89C 461E1080 */ add.s $f2, $f2, $f30
/* 9CA0 8002E8A0 C6000048 */ lwc1 $f0, 0x48($s0)
/* 9CA4 8002E8A4 8E060048 */ lw $a2, 0x48($s0)
/* 9CA8 8002E8A8 460A0000 */ add.s $f0, $f0, $f10
/* 9CAC 8002E8AC C60E0050 */ lwc1 $f14, 0x50($s0)
/* 9CB0 8002E8B0 8E070050 */ lw $a3, 0x50($s0)
/* 9CB4 8002E8B4 46067380 */ add.s $f14, $f14, $f6
/* 9CB8 8002E8B8 E6020040 */ swc1 $f2, 0x40($s0)
/* 9CBC 8002E8BC E600003C */ swc1 $f0, 0x3c($s0)
/* 9CC0 8002E8C0 46000306 */ mov.s $f12, $f0
/* 9CC4 8002E8C4 0C00A710 */ jal func_80029C40
/* 9CC8 8002E8C8 E60E0044 */ swc1 $f14, 0x44($s0)
/* 9CCC 8002E8CC 4600B506 */ mov.s $f20, $f22
/* 9CD0 8002E8D0 C6040048 */ lwc1 $f4, 0x48($s0)
/* 9CD4 8002E8D4 C602003C */ lwc1 $f2, 0x3c($s0)
/* 9CD8 8002E8D8 4600A306 */ mov.s $f12, $f20
/* 9CDC 8002E8DC 46022581 */ sub.s $f22, $f4, $f2
/* 9CE0 8002E8E0 C6040050 */ lwc1 $f4, 0x50($s0)
/* 9CE4 8002E8E4 C6020044 */ lwc1 $f2, 0x44($s0)
/* 9CE8 8002E8E8 4600A386 */ mov.s $f14, $f20
/* 9CEC 8002E8EC 46022601 */ sub.s $f24, $f4, $f2
/* 9CF0 8002E8F0 C604004C */ lwc1 $f4, 0x4c($s0)
/* 9CF4 8002E8F4 C6020040 */ lwc1 $f2, 0x40($s0)
/* 9CF8 8002E8F8 4406B000 */ mfc1 $a2, $f22
/* 9CFC 8002E8FC 4407C000 */ mfc1 $a3, $f24
/* 9D00 8002E900 46022781 */ sub.s $f30, $f4, $f2
/* 9D04 8002E904 0C00A710 */ jal func_80029C40
/* 9D08 8002E908 E600006C */ swc1 $f0, 0x6c($s0)
/* 9D0C 8002E90C 4616B102 */ mul.s $f4, $f22, $f22
/* 9D10 8002E910 00000000 */ nop
/* 9D14 8002E914 4618C082 */ mul.s $f2, $f24, $f24
/* 9D18 8002E918 00000000 */ nop
/* 9D1C 8002E91C 46022300 */ add.s $f12, $f4, $f2
/* 9D20 8002E920 46000007 */ neg.s $f0, $f0
/* 9D24 8002E924 E6000090 */ swc1 $f0, 0x90($s0)
/* 9D28 8002E928 46006004 */ sqrt.s $f0, $f12
/* 9D2C 8002E92C 46000032 */ c.eq.s $f0, $f0
/* 9D30 8002E930 00000000 */ nop
/* 9D34 8002E934 45030004 */ bc1tl .L8002E948
/* 9D38 8002E938 4600A306 */ mov.s $f12, $f20
/* 9D3C 8002E93C 0C0187B0 */ jal func_80061EC0
/* 9D40 8002E940 00000000 */ nop
/* 9D44 8002E944 4600A306 */ mov.s $f12, $f20
.L8002E948:
/* 9D48 8002E948 46000007 */ neg.s $f0, $f0
/* 9D4C 8002E94C 4406F000 */ mfc1 $a2, $f30
/* 9D50 8002E950 44070000 */ mfc1 $a3, $f0
/* 9D54 8002E954 0C00A710 */ jal func_80029C40
/* 9D58 8002E958 46006386 */ mov.s $f14, $f12
/* 9D5C 8002E95C E6000094 */ swc1 $f0, 0x94($s0)
/* 9D60 8002E960 8FBF0014 */ lw $ra, 0x14($sp)
/* 9D64 8002E964 8FB00010 */ lw $s0, 0x10($sp)
/* 9D68 8002E968 D7BE0040 */ ldc1 $f30, 0x40($sp)
/* 9D6C 8002E96C D7BC0038 */ ldc1 $f28, 0x38($sp)
/* 9D70 8002E970 D7BA0030 */ ldc1 $f26, 0x30($sp)
/* 9D74 8002E974 D7B80028 */ ldc1 $f24, 0x28($sp)
/* 9D78 8002E978 D7B60020 */ ldc1 $f22, 0x20($sp)
/* 9D7C 8002E97C D7B40018 */ ldc1 $f20, 0x18($sp)
/* 9D80 8002E980 03E00008 */ jr $ra
/* 9D84 8002E984 27BD0048 */ addiu $sp, $sp, 0x48