papermario/ver/jp/asm/nonmatchings/13530/func_80038F98.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

254 lines
12 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80038F98
/* 14398 80038F98 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 1439C 80038F9C AFB1001C */ sw $s1, 0x1c($sp)
/* 143A0 80038FA0 0080882D */ daddu $s1, $a0, $zero
/* 143A4 80038FA4 AFBF0020 */ sw $ra, 0x20($sp)
/* 143A8 80038FA8 AFB00018 */ sw $s0, 0x18($sp)
/* 143AC 80038FAC F7BE0050 */ sdc1 $f30, 0x50($sp)
/* 143B0 80038FB0 F7BC0048 */ sdc1 $f28, 0x48($sp)
/* 143B4 80038FB4 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 143B8 80038FB8 F7B80038 */ sdc1 $f24, 0x38($sp)
/* 143BC 80038FBC F7B60030 */ sdc1 $f22, 0x30($sp)
/* 143C0 80038FC0 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 143C4 80038FC4 8E230000 */ lw $v1, ($s1)
/* 143C8 80038FC8 3C108011 */ lui $s0, %hi(D_8010F188)
/* 143CC 80038FCC 2610F188 */ addiu $s0, $s0, %lo(D_8010F188)
/* 143D0 80038FD0 30620100 */ andi $v0, $v1, 0x100
/* 143D4 80038FD4 144000D1 */ bnez $v0, .L8003931C
/* 143D8 80038FD8 0000102D */ daddu $v0, $zero, $zero
/* 143DC 80038FDC 3C020400 */ lui $v0, 0x400
/* 143E0 80038FE0 00621024 */ and $v0, $v1, $v0
/* 143E4 80038FE4 10400003 */ beqz $v0, .L80038FF4
/* 143E8 80038FE8 00000000 */ nop
.L80038FEC:
/* 143EC 80038FEC 0800E4C7 */ j .L8003931C
/* 143F0 80038FF0 0000102D */ daddu $v0, $zero, $zero
.L80038FF4:
/* 143F4 80038FF4 3C02800A */ lui $v0, %hi(D_8009E9A4)
/* 143F8 80038FF8 8042E9A4 */ lb $v0, %lo(D_8009E9A4)($v0)
/* 143FC 80038FFC 504000C7 */ beql $v0, $zero, .L8003931C
/* 14400 80039000 0000102D */ daddu $v0, $zero, $zero
/* 14404 80039004 860200B0 */ lh $v0, 0xb0($s0)
/* 14408 80039008 C604002C */ lwc1 $f4, 0x2c($s0)
/* 1440C 8003900C 44820000 */ mtc1 $v0, $f0
/* 14410 80039010 00000000 */ nop
/* 14414 80039014 46800020 */ cvt.s.w $f0, $f0
/* 14418 80039018 46002000 */ add.s $f0, $f4, $f0
/* 1441C 8003901C C622003C */ lwc1 $f2, 0x3c($s1)
/* 14420 80039020 4602003C */ c.lt.s $f0, $f2
/* 14424 80039024 00000000 */ nop
/* 14428 80039028 450100BC */ bc1t .L8003931C
/* 1442C 8003902C 0000102D */ daddu $v0, $zero, $zero
/* 14430 80039030 862200A8 */ lh $v0, 0xa8($s1)
/* 14434 80039034 44820000 */ mtc1 $v0, $f0
/* 14438 80039038 00000000 */ nop
/* 1443C 8003903C 46800020 */ cvt.s.w $f0, $f0
/* 14440 80039040 46001000 */ add.s $f0, $f2, $f0
/* 14444 80039044 4604003C */ c.lt.s $f0, $f4
/* 14448 80039048 00000000 */ nop
/* 1444C 8003904C 450100B3 */ bc1t .L8003931C
/* 14450 80039050 0000102D */ daddu $v0, $zero, $zero
/* 14454 80039054 C63A0038 */ lwc1 $f26, 0x38($s1)
/* 14458 80039058 C61E0028 */ lwc1 $f30, 0x28($s0)
/* 1445C 8003905C C61C0030 */ lwc1 $f28, 0x30($s0)
/* 14460 80039060 962200A6 */ lhu $v0, 0xa6($s1)
/* 14464 80039064 461AF581 */ sub.s $f22, $f30, $f26
/* 14468 80039068 960300B2 */ lhu $v1, 0xb2($s0)
/* 1446C 8003906C 00021400 */ sll $v0, $v0, 0x10
/* 14470 80039070 4616B082 */ mul.s $f2, $f22, $f22
/* 14474 80039074 00000000 */ nop
/* 14478 80039078 00022403 */ sra $a0, $v0, 0x10
/* 1447C 8003907C 000217C2 */ srl $v0, $v0, 0x1f
/* 14480 80039080 C6360040 */ lwc1 $f22, 0x40($s1)
/* 14484 80039084 00822021 */ addu $a0, $a0, $v0
/* 14488 80039088 4616E501 */ sub.s $f20, $f28, $f22
/* 1448C 8003908C 00042043 */ sra $a0, $a0, 1
/* 14490 80039090 00031C00 */ sll $v1, $v1, 0x10
/* 14494 80039094 4614A002 */ mul.s $f0, $f20, $f20
/* 14498 80039098 00000000 */ nop
/* 1449C 8003909C 00031403 */ sra $v0, $v1, 0x10
/* 144A0 800390A0 00031FC2 */ srl $v1, $v1, 0x1f
/* 144A4 800390A4 00431021 */ addu $v0, $v0, $v1
/* 144A8 800390A8 00021043 */ sra $v0, $v0, 1
/* 144AC 800390AC 46001300 */ add.s $f12, $f2, $f0
/* 144B0 800390B0 4484B000 */ mtc1 $a0, $f22
/* 144B4 800390B4 00000000 */ nop
/* 144B8 800390B8 4680B5A0 */ cvt.s.w $f22, $f22
/* 144BC 800390BC 4482A000 */ mtc1 $v0, $f20
/* 144C0 800390C0 00000000 */ nop
/* 144C4 800390C4 4680A520 */ cvt.s.w $f20, $f20
/* 144C8 800390C8 46006004 */ sqrt.s $f0, $f12
/* 144CC 800390CC 46000032 */ c.eq.s $f0, $f0
/* 144D0 800390D0 00000000 */ nop
/* 144D4 800390D4 45010003 */ bc1t .L800390E4
/* 144D8 800390D8 4614B580 */ add.s $f22, $f22, $f20
/* 144DC 800390DC 0C0187B0 */ jal func_80061EC0
/* 144E0 800390E0 00000000 */ nop
.L800390E4:
/* 144E4 800390E4 4600B03C */ c.lt.s $f22, $f0
/* 144E8 800390E8 00000000 */ nop
/* 144EC 800390EC 4501FFBF */ bc1t .L80038FEC
/* 144F0 800390F0 E7B60010 */ swc1 $f22, 0x10($sp)
/* 144F4 800390F4 8E020004 */ lw $v0, 4($s0)
/* 144F8 800390F8 34428000 */ ori $v0, $v0, 0x8000
/* 144FC 800390FC AE020004 */ sw $v0, 4($s0)
/* 14500 80039100 C63A006C */ lwc1 $f26, 0x6c($s1)
/* 14504 80039104 461AF581 */ sub.s $f22, $f30, $f26
/* 14508 80039108 4616B082 */ mul.s $f2, $f22, $f22
/* 1450C 8003910C 00000000 */ nop
/* 14510 80039110 C6360074 */ lwc1 $f22, 0x74($s1)
/* 14514 80039114 4616E501 */ sub.s $f20, $f28, $f22
/* 14518 80039118 4614A002 */ mul.s $f0, $f20, $f20
/* 1451C 8003911C 00000000 */ nop
/* 14520 80039120 46001300 */ add.s $f12, $f2, $f0
/* 14524 80039124 46006004 */ sqrt.s $f0, $f12
/* 14528 80039128 46000032 */ c.eq.s $f0, $f0
/* 1452C 8003912C 00000000 */ nop
/* 14530 80039130 45010004 */ bc1t .L80039144
/* 14534 80039134 46000606 */ mov.s $f24, $f0
/* 14538 80039138 0C0187B0 */ jal func_80061EC0
/* 1453C 8003913C 00000000 */ nop
/* 14540 80039140 46000606 */ mov.s $f24, $f0
.L80039144:
/* 14544 80039144 4600F306 */ mov.s $f12, $f30
/* 14548 80039148 4406D000 */ mfc1 $a2, $f26
/* 1454C 8003914C 4407B000 */ mfc1 $a3, $f22
/* 14550 80039150 0C00A710 */ jal func_80029C40
/* 14554 80039154 4600E386 */ mov.s $f14, $f28
/* 14558 80039158 3C0140C9 */ lui $at, 0x40c9
/* 1455C 8003915C 34210FD0 */ ori $at, $at, 0xfd0
/* 14560 80039160 4481A000 */ mtc1 $at, $f20
/* 14564 80039164 46000686 */ mov.s $f26, $f0
/* 14568 80039168 4614D502 */ mul.s $f20, $f26, $f20
/* 1456C 8003916C 00000000 */ nop
/* 14570 80039170 3C0143B4 */ lui $at, 0x43b4
/* 14574 80039174 44810000 */ mtc1 $at, $f0
/* 14578 80039178 C7A80010 */ lwc1 $f8, 0x10($sp)
/* 1457C 8003917C C61C0080 */ lwc1 $f28, 0x80($s0)
/* 14580 80039180 46184601 */ sub.s $f24, $f8, $f24
/* 14584 80039184 4600A503 */ div.s $f20, $f20, $f0
/* 14588 80039188 0C00A84B */ jal func_8002A12C
/* 1458C 8003918C 4600A306 */ mov.s $f12, $f20
/* 14590 80039190 4600C582 */ mul.s $f22, $f24, $f0
/* 14594 80039194 00000000 */ nop
/* 14598 80039198 0C00A864 */ jal func_8002A190
/* 1459C 8003919C 4600A306 */ mov.s $f12, $f20
/* 145A0 800391A0 3C030040 */ lui $v1, 0x40
/* 145A4 800391A4 8E020004 */ lw $v0, 4($s0)
/* 145A8 800391A8 4600C087 */ neg.s $f2, $f24
/* 145AC 800391AC 46001502 */ mul.s $f20, $f2, $f0
/* 145B0 800391B0 00000000 */ nop
/* 145B4 800391B4 00431024 */ and $v0, $v0, $v1
/* 145B8 800391B8 1040002D */ beqz $v0, .L80039270
/* 145BC 800391BC 4600D306 */ mov.s $f12, $f26
/* 145C0 800391C0 0C00A6FA */ jal func_80029BE8
/* 145C4 800391C4 4600E386 */ mov.s $f14, $f28
/* 145C8 800391C8 3C014234 */ lui $at, 0x4234
/* 145CC 800391CC 44811000 */ mtc1 $at, $f2
/* 145D0 800391D0 46000005 */ abs.s $f0, $f0
/* 145D4 800391D4 4602003C */ c.lt.s $f0, $f2
/* 145D8 800391D8 00000000 */ nop
/* 145DC 800391DC 4500000E */ bc1f .L80039218
/* 145E0 800391E0 00000000 */ nop
/* 145E4 800391E4 C6020028 */ lwc1 $f2, 0x28($s0)
/* 145E8 800391E8 46161081 */ sub.s $f2, $f2, $f22
/* 145EC 800391EC C6000030 */ lwc1 $f0, 0x30($s0)
/* 145F0 800391F0 3C028011 */ lui $v0, %hi(D_8010CAF0)
/* 145F4 800391F4 8C42CAF0 */ lw $v0, %lo(D_8010CAF0)($v0)
/* 145F8 800391F8 46140001 */ sub.s $f0, $f0, $f20
/* 145FC 800391FC E6020028 */ swc1 $f2, 0x28($s0)
/* 14600 80039200 E6000030 */ swc1 $f0, 0x30($s0)
/* 14604 80039204 C4420038 */ lwc1 $f2, 0x38($v0)
/* 14608 80039208 46161081 */ sub.s $f2, $f2, $f22
/* 1460C 8003920C C4400040 */ lwc1 $f0, 0x40($v0)
/* 14610 80039210 0800E499 */ j .L80039264
/* 14614 80039214 46140001 */ sub.s $f0, $f0, $f20
.L80039218:
/* 14618 80039218 3C013F00 */ lui $at, 0x3f00
/* 1461C 8003921C 44812000 */ mtc1 $at, $f4
/* 14620 80039220 00000000 */ nop
/* 14624 80039224 4604B182 */ mul.s $f6, $f22, $f4
/* 14628 80039228 00000000 */ nop
/* 1462C 8003922C 4604A102 */ mul.s $f4, $f20, $f4
/* 14630 80039230 00000000 */ nop
/* 14634 80039234 C6020028 */ lwc1 $f2, 0x28($s0)
/* 14638 80039238 46061081 */ sub.s $f2, $f2, $f6
/* 1463C 8003923C C6000030 */ lwc1 $f0, 0x30($s0)
/* 14640 80039240 3C028011 */ lui $v0, %hi(D_8010CAF0)
/* 14644 80039244 8C42CAF0 */ lw $v0, %lo(D_8010CAF0)($v0)
/* 14648 80039248 46040001 */ sub.s $f0, $f0, $f4
/* 1464C 8003924C E6020028 */ swc1 $f2, 0x28($s0)
/* 14650 80039250 E6000030 */ swc1 $f0, 0x30($s0)
/* 14654 80039254 C4420038 */ lwc1 $f2, 0x38($v0)
/* 14658 80039258 46061081 */ sub.s $f2, $f2, $f6
/* 1465C 8003925C C4400040 */ lwc1 $f0, 0x40($v0)
/* 14660 80039260 46040001 */ sub.s $f0, $f0, $f4
.L80039264:
/* 14664 80039264 E4420038 */ swc1 $f2, 0x38($v0)
/* 14668 80039268 0800E4C0 */ j .L80039300
/* 1466C 8003926C E4400040 */ swc1 $f0, 0x40($v0)
.L80039270:
/* 14670 80039270 8E020000 */ lw $v0, ($s0)
/* 14674 80039274 30420006 */ andi $v0, $v0, 6
/* 14678 80039278 10400006 */ beqz $v0, .L80039294
/* 1467C 8003927C 00000000 */ nop
/* 14680 80039280 3C013ECC */ lui $at, 0x3ecc
/* 14684 80039284 3421CCCD */ ori $at, $at, 0xcccd
/* 14688 80039288 44812000 */ mtc1 $at, $f4
/* 1468C 8003928C 0800E4B6 */ j .L800392D8
/* 14690 80039290 00000000 */ nop
.L80039294:
/* 14694 80039294 0C00A6FA */ jal func_80029BE8
/* 14698 80039298 4600E386 */ mov.s $f14, $f28
/* 1469C 8003929C 3C014234 */ lui $at, 0x4234
/* 146A0 800392A0 44811000 */ mtc1 $at, $f2
/* 146A4 800392A4 46000005 */ abs.s $f0, $f0
/* 146A8 800392A8 4602003C */ c.lt.s $f0, $f2
/* 146AC 800392AC 00000000 */ nop
/* 146B0 800392B0 45000006 */ bc1f .L800392CC
/* 146B4 800392B4 00000000 */ nop
/* 146B8 800392B8 C6020028 */ lwc1 $f2, 0x28($s0)
/* 146BC 800392BC 46161081 */ sub.s $f2, $f2, $f22
/* 146C0 800392C0 C6000030 */ lwc1 $f0, 0x30($s0)
/* 146C4 800392C4 0800E4BE */ j .L800392F8
/* 146C8 800392C8 46140001 */ sub.s $f0, $f0, $f20
.L800392CC:
/* 146CC 800392CC 3C013F00 */ lui $at, 0x3f00
/* 146D0 800392D0 44812000 */ mtc1 $at, $f4
/* 146D4 800392D4 00000000 */ nop
.L800392D8:
/* 146D8 800392D8 4604B002 */ mul.s $f0, $f22, $f4
/* 146DC 800392DC 00000000 */ nop
/* 146E0 800392E0 4604A102 */ mul.s $f4, $f20, $f4
/* 146E4 800392E4 00000000 */ nop
/* 146E8 800392E8 C6020028 */ lwc1 $f2, 0x28($s0)
/* 146EC 800392EC 46001081 */ sub.s $f2, $f2, $f0
/* 146F0 800392F0 C6000030 */ lwc1 $f0, 0x30($s0)
/* 146F4 800392F4 46040001 */ sub.s $f0, $f0, $f4
.L800392F8:
/* 146F8 800392F8 E6020028 */ swc1 $f2, 0x28($s0)
/* 146FC 800392FC E6000030 */ swc1 $f0, 0x30($s0)
.L80039300:
/* 14700 80039300 C620006C */ lwc1 $f0, 0x6c($s1)
/* 14704 80039304 C6220070 */ lwc1 $f2, 0x70($s1)
/* 14708 80039308 C6240074 */ lwc1 $f4, 0x74($s1)
/* 1470C 8003930C 24020001 */ addiu $v0, $zero, 1
/* 14710 80039310 E6200038 */ swc1 $f0, 0x38($s1)
/* 14714 80039314 E622003C */ swc1 $f2, 0x3c($s1)
/* 14718 80039318 E6240040 */ swc1 $f4, 0x40($s1)
.L8003931C:
/* 1471C 8003931C 8FBF0020 */ lw $ra, 0x20($sp)
/* 14720 80039320 8FB1001C */ lw $s1, 0x1c($sp)
/* 14724 80039324 8FB00018 */ lw $s0, 0x18($sp)
/* 14728 80039328 D7BE0050 */ ldc1 $f30, 0x50($sp)
/* 1472C 8003932C D7BC0048 */ ldc1 $f28, 0x48($sp)
/* 14730 80039330 D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 14734 80039334 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 14738 80039338 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 1473C 8003933C D7B40028 */ ldc1 $f20, 0x28($sp)
/* 14740 80039340 03E00008 */ jr $ra
/* 14744 80039344 27BD0058 */ addiu $sp, $sp, 0x58