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

136 lines
6.8 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8003D6F8
/* 18AF8 8003D6F8 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 18AFC 8003D6FC AFB00018 */ sw $s0, 0x18($sp)
/* 18B00 8003D700 24020002 */ addiu $v0, $zero, 2
/* 18B04 8003D704 AFBF0020 */ sw $ra, 0x20($sp)
/* 18B08 8003D708 AFB1001C */ sw $s1, 0x1c($sp)
/* 18B0C 8003D70C F7B80038 */ sdc1 $f24, 0x38($sp)
/* 18B10 8003D710 F7B60030 */ sdc1 $f22, 0x30($sp)
/* 18B14 8003D714 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 18B18 8003D718 14A20019 */ bne $a1, $v0, .L8003D780
/* 18B1C 8003D71C 0080802D */ daddu $s0, $a0, $zero
/* 18B20 8003D720 3C118007 */ lui $s1, %hi(D_80077BEE)
/* 18B24 8003D724 26317BEE */ addiu $s1, $s1, %lo(D_80077BEE)
/* 18B28 8003D728 86230000 */ lh $v1, ($s1)
/* 18B2C 8003D72C 24020005 */ addiu $v0, $zero, 5
/* 18B30 8003D730 14620013 */ bne $v1, $v0, .L8003D780
/* 18B34 8003D734 00000000 */ nop
/* 18B38 8003D738 C60C0038 */ lwc1 $f12, 0x38($s0)
/* 18B3C 8003D73C 8E060040 */ lw $a2, 0x40($s0)
/* 18B40 8003D740 C600003C */ lwc1 $f0, 0x3c($s0)
/* 18B44 8003D744 3C014160 */ lui $at, 0x4160
/* 18B48 8003D748 44817000 */ mtc1 $at, $f14
/* 18B4C 8003D74C 3C108007 */ lui $s0, %hi(D_80077BE8)
/* 18B50 8003D750 26107BE8 */ addiu $s0, $s0, %lo(D_80077BE8)
/* 18B54 8003D754 8E070000 */ lw $a3, ($s0)
/* 18B58 8003D758 0C01BEDC */ jal func_8006FB70
/* 18B5C 8003D75C 460E0380 */ add.s $f14, $f0, $f14
/* 18B60 8003D760 C6000000 */ lwc1 $f0, ($s0)
/* 18B64 8003D764 3C01420C */ lui $at, 0x420c
/* 18B68 8003D768 44816000 */ mtc1 $at, $f12
/* 18B6C 8003D76C 0C00A6B9 */ jal func_80029AE4
/* 18B70 8003D770 460C0300 */ add.s $f12, $f0, $f12
/* 18B74 8003D774 E6000000 */ swc1 $f0, ($s0)
/* 18B78 8003D778 0800F636 */ j .L8003D8D8
/* 18B7C 8003D77C A6200000 */ sh $zero, ($s1)
.L8003D780:
/* 18B80 8003D780 3C038007 */ lui $v1, %hi(D_80077BEE)
/* 18B84 8003D784 24637BEE */ addiu $v1, $v1, %lo(D_80077BEE)
/* 18B88 8003D788 94620000 */ lhu $v0, ($v1)
/* 18B8C 8003D78C 24420001 */ addiu $v0, $v0, 1
/* 18B90 8003D790 A4620000 */ sh $v0, ($v1)
/* 18B94 8003D794 00021400 */ sll $v0, $v0, 0x10
/* 18B98 8003D798 00021403 */ sra $v0, $v0, 0x10
/* 18B9C 8003D79C 28420006 */ slti $v0, $v0, 6
/* 18BA0 8003D7A0 14400002 */ bnez $v0, .L8003D7AC
/* 18BA4 8003D7A4 24020005 */ addiu $v0, $zero, 5
/* 18BA8 8003D7A8 A4620000 */ sh $v0, ($v1)
.L8003D7AC:
/* 18BAC 8003D7AC 3C048007 */ lui $a0, %hi(D_80077BEC)
/* 18BB0 8003D7B0 24847BEC */ addiu $a0, $a0, %lo(D_80077BEC)
/* 18BB4 8003D7B4 94820000 */ lhu $v0, ($a0)
/* 18BB8 8003D7B8 24430001 */ addiu $v1, $v0, 1
/* 18BBC 8003D7BC 00021400 */ sll $v0, $v0, 0x10
/* 18BC0 8003D7C0 18400045 */ blez $v0, .L8003D8D8
/* 18BC4 8003D7C4 A4830000 */ sh $v1, ($a0)
/* 18BC8 8003D7C8 C60C000C */ lwc1 $f12, 0xc($s0)
/* 18BCC 8003D7CC A4800000 */ sh $zero, ($a0)
/* 18BD0 8003D7D0 0C00A6B9 */ jal func_80029AE4
/* 18BD4 8003D7D4 46006307 */ neg.s $f12, $f12
/* 18BD8 8003D7D8 3C0140C9 */ lui $at, 0x40c9
/* 18BDC 8003D7DC 34210FD0 */ ori $at, $at, 0xfd0
/* 18BE0 8003D7E0 44811000 */ mtc1 $at, $f2
/* 18BE4 8003D7E4 00000000 */ nop
/* 18BE8 8003D7E8 46020502 */ mul.s $f20, $f0, $f2
/* 18BEC 8003D7EC 00000000 */ nop
/* 18BF0 8003D7F0 3C0143B4 */ lui $at, 0x43b4
/* 18BF4 8003D7F4 44810000 */ mtc1 $at, $f0
/* 18BF8 8003D7F8 00000000 */ nop
/* 18BFC 8003D7FC 4600A503 */ div.s $f20, $f20, $f0
/* 18C00 8003D800 0C00A84B */ jal func_8002A12C
/* 18C04 8003D804 4600A306 */ mov.s $f12, $f20
/* 18C08 8003D808 4600A306 */ mov.s $f12, $f20
/* 18C0C 8003D80C 0C00A864 */ jal func_8002A190
/* 18C10 8003D810 46000506 */ mov.s $f20, $f0
/* 18C14 8003D814 860200A6 */ lh $v0, 0xa6($s0)
/* 18C18 8003D818 44821000 */ mtc1 $v0, $f2
/* 18C1C 8003D81C 00000000 */ nop
/* 18C20 8003D820 468010A0 */ cvt.s.w $f2, $f2
/* 18C24 8003D824 46141502 */ mul.s $f20, $f2, $f20
/* 18C28 8003D828 00000000 */ nop
/* 18C2C 8003D82C 46001082 */ mul.s $f2, $f2, $f0
/* 18C30 8003D830 00000000 */ nop
/* 18C34 8003D834 3C01BECC */ lui $at, 0xbecc
/* 18C38 8003D838 3421CCCD */ ori $at, $at, 0xcccd
/* 18C3C 8003D83C 44810000 */ mtc1 $at, $f0
/* 18C40 8003D840 00000000 */ nop
/* 18C44 8003D844 4600A502 */ mul.s $f20, $f20, $f0
/* 18C48 8003D848 00000000 */ nop
/* 18C4C 8003D84C 46001082 */ mul.s $f2, $f2, $f0
/* 18C50 8003D850 00000000 */ nop
/* 18C54 8003D854 C6000038 */ lwc1 $f0, 0x38($s0)
/* 18C58 8003D858 46140600 */ add.s $f24, $f0, $f20
/* 18C5C 8003D85C C6000040 */ lwc1 $f0, 0x40($s0)
/* 18C60 8003D860 C604003C */ lwc1 $f4, 0x3c($s0)
/* 18C64 8003D864 46020580 */ add.s $f22, $f0, $f2
/* 18C68 8003D868 3C014178 */ lui $at, 0x4178
/* 18C6C 8003D86C 44810000 */ mtc1 $at, $f0
/* 18C70 8003D870 2404000A */ addiu $a0, $zero, 0xa
/* 18C74 8003D874 0C00A66F */ jal func_800299BC
/* 18C78 8003D878 46002500 */ add.s $f20, $f4, $f0
/* 18C7C 8003D87C 24040001 */ addiu $a0, $zero, 1
/* 18C80 8003D880 44821000 */ mtc1 $v0, $f2
/* 18C84 8003D884 00000000 */ nop
/* 18C88 8003D888 468010A0 */ cvt.s.w $f2, $f2
/* 18C8C 8003D88C C600000C */ lwc1 $f0, 0xc($s0)
/* 18C90 8003D890 3C108007 */ lui $s0, %hi(D_80077BF0)
/* 18C94 8003D894 26107BF0 */ addiu $s0, $s0, %lo(D_80077BF0)
/* 18C98 8003D898 4405C000 */ mfc1 $a1, $f24
/* 18C9C 8003D89C 4407B000 */ mfc1 $a3, $f22
/* 18CA0 8003D8A0 46000007 */ neg.s $f0, $f0
/* 18CA4 8003D8A4 46020000 */ add.s $f0, $f0, $f2
/* 18CA8 8003D8A8 3C0140A0 */ lui $at, 0x40a0
/* 18CAC 8003D8AC 44811000 */ mtc1 $at, $f2
/* 18CB0 8003D8B0 4406A000 */ mfc1 $a2, $f20
/* 18CB4 8003D8B4 46020001 */ sub.s $f0, $f0, $f2
/* 18CB8 8003D8B8 C6020000 */ lwc1 $f2, ($s0)
/* 18CBC 8003D8BC 468010A0 */ cvt.s.w $f2, $f2
/* 18CC0 8003D8C0 E7A20014 */ swc1 $f2, 0x14($sp)
/* 18CC4 8003D8C4 0C01BEF4 */ jal func_8006FBD0
/* 18CC8 8003D8C8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 18CCC 8003D8CC 8E020000 */ lw $v0, ($s0)
/* 18CD0 8003D8D0 2C420001 */ sltiu $v0, $v0, 1
/* 18CD4 8003D8D4 AE020000 */ sw $v0, ($s0)
.L8003D8D8:
/* 18CD8 8003D8D8 8FBF0020 */ lw $ra, 0x20($sp)
/* 18CDC 8003D8DC 8FB1001C */ lw $s1, 0x1c($sp)
/* 18CE0 8003D8E0 8FB00018 */ lw $s0, 0x18($sp)
/* 18CE4 8003D8E4 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 18CE8 8003D8E8 D7B60030 */ ldc1 $f22, 0x30($sp)
/* 18CEC 8003D8EC D7B40028 */ ldc1 $f20, 0x28($sp)
/* 18CF0 8003D8F0 03E00008 */ jr $ra
/* 18CF4 8003D8F4 27BD0040 */ addiu $sp, $sp, 0x40