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

183 lines
9.0 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8003D448
/* 18848 8003D448 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 1884C 8003D44C AFB00030 */ sw $s0, 0x30($sp)
/* 18850 8003D450 0080802D */ daddu $s0, $a0, $zero
/* 18854 8003D454 3C038007 */ lui $v1, %hi(D_8007417C)
/* 18858 8003D458 8C63417C */ lw $v1, %lo(D_8007417C)($v1)
/* 1885C 8003D45C AFBF0038 */ sw $ra, 0x38($sp)
/* 18860 8003D460 AFB10034 */ sw $s1, 0x34($sp)
/* 18864 8003D464 84620086 */ lh $v0, 0x86($v1)
/* 18868 8003D468 24110005 */ addiu $s1, $zero, 5
/* 1886C 8003D46C 14510004 */ bne $v0, $s1, .L8003D480
/* 18870 8003D470 0000302D */ daddu $a2, $zero, $zero
/* 18874 8003D474 8462008C */ lh $v0, 0x8c($v1)
/* 18878 8003D478 38420002 */ xori $v0, $v0, 2
/* 1887C 8003D47C 2C460001 */ sltiu $a2, $v0, 1
.L8003D480:
/* 18880 8003D480 24020002 */ addiu $v0, $zero, 2
/* 18884 8003D484 14A20026 */ bne $a1, $v0, .L8003D520
/* 18888 8003D488 00000000 */ nop
/* 1888C 8003D48C C602003C */ lwc1 $f2, 0x3c($s0)
/* 18890 8003D490 44800000 */ mtc1 $zero, $f0
/* 18894 8003D494 C6040040 */ lwc1 $f4, 0x40($s0)
/* 18898 8003D498 46001080 */ add.s $f2, $f2, $f0
/* 1889C 8003D49C C6000038 */ lwc1 $f0, 0x38($s0)
/* 188A0 8003D4A0 14C00011 */ bnez $a2, .L8003D4E8
/* 188A4 8003D4A4 24040003 */ addiu $a0, $zero, 3
/* 188A8 8003D4A8 3C108007 */ lui $s0, %hi(D_80077BE0)
/* 188AC 8003D4AC 26107BE0 */ addiu $s0, $s0, %lo(D_80077BE0)
/* 188B0 8003D4B0 44050000 */ mfc1 $a1, $f0
/* 188B4 8003D4B4 44061000 */ mfc1 $a2, $f2
/* 188B8 8003D4B8 44072000 */ mfc1 $a3, $f4
/* 188BC 8003D4BC C6000000 */ lwc1 $f0, ($s0)
/* 188C0 8003D4C0 0000202D */ daddu $a0, $zero, $zero
/* 188C4 8003D4C4 0C01BEAC */ jal func_8006FAB0
/* 188C8 8003D4C8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 188CC 8003D4CC C6000000 */ lwc1 $f0, ($s0)
/* 188D0 8003D4D0 3C01420C */ lui $at, 0x420c
/* 188D4 8003D4D4 44816000 */ mtc1 $at, $f12
/* 188D8 8003D4D8 0C00A6B9 */ jal func_80029AE4
/* 188DC 8003D4DC 460C0300 */ add.s $f12, $f0, $f12
/* 188E0 8003D4E0 0800F5B9 */ j .L8003D6E4
/* 188E4 8003D4E4 E6000000 */ swc1 $f0, ($s0)
.L8003D4E8:
/* 188E8 8003D4E8 44050000 */ mfc1 $a1, $f0
/* 188EC 8003D4EC 44061000 */ mfc1 $a2, $f2
/* 188F0 8003D4F0 44072000 */ mfc1 $a3, $f4
/* 188F4 8003D4F4 3C014150 */ lui $at, 0x4150
/* 188F8 8003D4F8 44810000 */ mtc1 $at, $f0
/* 188FC 8003D4FC 3C014120 */ lui $at, 0x4120
/* 18900 8003D500 44811000 */ mtc1 $at, $f2
/* 18904 8003D504 3C013F80 */ lui $at, 0x3f80
/* 18908 8003D508 44812000 */ mtc1 $at, $f4
/* 1890C 8003D50C 2402001E */ addiu $v0, $zero, 0x1e
/* 18910 8003D510 AFB1001C */ sw $s1, 0x1c($sp)
/* 18914 8003D514 AFA20020 */ sw $v0, 0x20($sp)
/* 18918 8003D518 0800F5B6 */ j .L8003D6D8
/* 1891C 8003D51C E7A00010 */ swc1 $f0, 0x10($sp)
.L8003D520:
/* 18920 8003D520 10A00070 */ beqz $a1, .L8003D6E4
/* 18924 8003D524 00000000 */ nop
/* 18928 8003D528 3C048007 */ lui $a0, %hi(D_80077BE4)
/* 1892C 8003D52C 24847BE4 */ addiu $a0, $a0, %lo(D_80077BE4)
/* 18930 8003D530 94820000 */ lhu $v0, ($a0)
/* 18934 8003D534 24430001 */ addiu $v1, $v0, 1
/* 18938 8003D538 00021400 */ sll $v0, $v0, 0x10
/* 1893C 8003D53C 00021403 */ sra $v0, $v0, 0x10
/* 18940 8003D540 28420004 */ slti $v0, $v0, 4
/* 18944 8003D544 14400067 */ bnez $v0, .L8003D6E4
/* 18948 8003D548 A4830000 */ sh $v1, ($a0)
/* 1894C 8003D54C 14C00034 */ bnez $a2, .L8003D620
/* 18950 8003D550 A4800000 */ sh $zero, ($a0)
/* 18954 8003D554 C60C000C */ lwc1 $f12, 0xc($s0)
/* 18958 8003D558 0C00A6B9 */ jal func_80029AE4
/* 1895C 8003D55C 46006307 */ neg.s $f12, $f12
/* 18960 8003D560 3C0140C9 */ lui $at, 0x40c9
/* 18964 8003D564 34210FD0 */ ori $at, $at, 0xfd0
/* 18968 8003D568 44811000 */ mtc1 $at, $f2
/* 1896C 8003D56C 00000000 */ nop
/* 18970 8003D570 46020002 */ mul.s $f0, $f0, $f2
/* 18974 8003D574 00000000 */ nop
/* 18978 8003D578 27A50028 */ addiu $a1, $sp, 0x28
/* 1897C 8003D57C 3C0143B4 */ lui $at, 0x43b4
/* 18980 8003D580 44816000 */ mtc1 $at, $f12
/* 18984 8003D584 27A6002C */ addiu $a2, $sp, 0x2c
/* 18988 8003D588 0C00A81D */ jal func_8002A074
/* 1898C 8003D58C 460C0303 */ div.s $f12, $f0, $f12
/* 18990 8003D590 860200A6 */ lh $v0, 0xa6($s0)
/* 18994 8003D594 C7AA0028 */ lwc1 $f10, 0x28($sp)
/* 18998 8003D598 44821000 */ mtc1 $v0, $f2
/* 1899C 8003D59C 00000000 */ nop
/* 189A0 8003D5A0 468010A0 */ cvt.s.w $f2, $f2
/* 189A4 8003D5A4 460A1182 */ mul.s $f6, $f2, $f10
/* 189A8 8003D5A8 00000000 */ nop
/* 189AC 8003D5AC C7A8002C */ lwc1 $f8, 0x2c($sp)
/* 189B0 8003D5B0 46081082 */ mul.s $f2, $f2, $f8
/* 189B4 8003D5B4 00000000 */ nop
/* 189B8 8003D5B8 3C013E4C */ lui $at, 0x3e4c
/* 189BC 8003D5BC 3421CCCD */ ori $at, $at, 0xcccd
/* 189C0 8003D5C0 44810000 */ mtc1 $at, $f0
/* 189C4 8003D5C4 00000000 */ nop
/* 189C8 8003D5C8 46003182 */ mul.s $f6, $f6, $f0
/* 189CC 8003D5CC 00000000 */ nop
/* 189D0 8003D5D0 46001082 */ mul.s $f2, $f2, $f0
/* 189D4 8003D5D4 00000000 */ nop
/* 189D8 8003D5D8 C604003C */ lwc1 $f4, 0x3c($s0)
/* 189DC 8003D5DC 3C013FC0 */ lui $at, 0x3fc0
/* 189E0 8003D5E0 44810000 */ mtc1 $at, $f0
/* 189E4 8003D5E4 00000000 */ nop
/* 189E8 8003D5E8 46002100 */ add.s $f4, $f4, $f0
/* 189EC 8003D5EC C6000038 */ lwc1 $f0, 0x38($s0)
/* 189F0 8003D5F0 46060000 */ add.s $f0, $f0, $f6
/* 189F4 8003D5F4 44050000 */ mfc1 $a1, $f0
/* 189F8 8003D5F8 C6000040 */ lwc1 $f0, 0x40($s0)
/* 189FC 8003D5FC 46020000 */ add.s $f0, $f0, $f2
/* 18A00 8003D600 44062000 */ mfc1 $a2, $f4
/* 18A04 8003D604 44070000 */ mfc1 $a3, $f0
/* 18A08 8003D608 0000202D */ daddu $a0, $zero, $zero
/* 18A0C 8003D60C E7AA0010 */ swc1 $f10, 0x10($sp)
/* 18A10 8003D610 0C01BEC4 */ jal func_8006FB10
/* 18A14 8003D614 E7A80014 */ swc1 $f8, 0x14($sp)
/* 18A18 8003D618 0800F5B9 */ j .L8003D6E4
/* 18A1C 8003D61C 00000000 */ nop
.L8003D620:
/* 18A20 8003D620 0C00A6B9 */ jal func_80029AE4
/* 18A24 8003D624 C60C000C */ lwc1 $f12, 0xc($s0)
/* 18A28 8003D628 3C0140C9 */ lui $at, 0x40c9
/* 18A2C 8003D62C 34210FD0 */ ori $at, $at, 0xfd0
/* 18A30 8003D630 44811000 */ mtc1 $at, $f2
/* 18A34 8003D634 00000000 */ nop
/* 18A38 8003D638 46020002 */ mul.s $f0, $f0, $f2
/* 18A3C 8003D63C 00000000 */ nop
/* 18A40 8003D640 27A50028 */ addiu $a1, $sp, 0x28
/* 18A44 8003D644 3C0143B4 */ lui $at, 0x43b4
/* 18A48 8003D648 44816000 */ mtc1 $at, $f12
/* 18A4C 8003D64C 27A6002C */ addiu $a2, $sp, 0x2c
/* 18A50 8003D650 0C00A81D */ jal func_8002A074
/* 18A54 8003D654 460C0303 */ div.s $f12, $f0, $f12
/* 18A58 8003D658 C602003C */ lwc1 $f2, 0x3c($s0)
/* 18A5C 8003D65C 3C013FC0 */ lui $at, 0x3fc0
/* 18A60 8003D660 44810000 */ mtc1 $at, $f0
/* 18A64 8003D664 860200A6 */ lh $v0, 0xa6($s0)
/* 18A68 8003D668 46001080 */ add.s $f2, $f2, $f0
/* 18A6C 8003D66C C7A40028 */ lwc1 $f4, 0x28($sp)
/* 18A70 8003D670 44820000 */ mtc1 $v0, $f0
/* 18A74 8003D674 00000000 */ nop
/* 18A78 8003D678 46800020 */ cvt.s.w $f0, $f0
/* 18A7C 8003D67C 46040102 */ mul.s $f4, $f0, $f4
/* 18A80 8003D680 00000000 */ nop
/* 18A84 8003D684 44061000 */ mfc1 $a2, $f2
/* 18A88 8003D688 C7A2002C */ lwc1 $f2, 0x2c($sp)
/* 18A8C 8003D68C 46020002 */ mul.s $f0, $f0, $f2
/* 18A90 8003D690 00000000 */ nop
/* 18A94 8003D694 24040003 */ addiu $a0, $zero, 3
/* 18A98 8003D698 C6060038 */ lwc1 $f6, 0x38($s0)
/* 18A9C 8003D69C C6080040 */ lwc1 $f8, 0x40($s0)
/* 18AA0 8003D6A0 3C0140A0 */ lui $at, 0x40a0
/* 18AA4 8003D6A4 44811000 */ mtc1 $at, $f2
/* 18AA8 8003D6A8 46043180 */ add.s $f6, $f6, $f4
/* 18AAC 8003D6AC E7A20010 */ swc1 $f2, 0x10($sp)
/* 18AB0 8003D6B0 3C014120 */ lui $at, 0x4120
/* 18AB4 8003D6B4 44811000 */ mtc1 $at, $f2
/* 18AB8 8003D6B8 46004200 */ add.s $f8, $f8, $f0
/* 18ABC 8003D6BC 3C013F80 */ lui $at, 0x3f80
/* 18AC0 8003D6C0 44812000 */ mtc1 $at, $f4
/* 18AC4 8003D6C4 44053000 */ mfc1 $a1, $f6
/* 18AC8 8003D6C8 44074000 */ mfc1 $a3, $f8
/* 18ACC 8003D6CC 2402001E */ addiu $v0, $zero, 0x1e
/* 18AD0 8003D6D0 AFB1001C */ sw $s1, 0x1c($sp)
/* 18AD4 8003D6D4 AFA20020 */ sw $v0, 0x20($sp)
.L8003D6D8:
/* 18AD8 8003D6D8 E7A20014 */ swc1 $f2, 0x14($sp)
/* 18ADC 8003D6DC 0C01C8CC */ jal func_80072330
/* 18AE0 8003D6E0 E7A40018 */ swc1 $f4, 0x18($sp)
.L8003D6E4:
/* 18AE4 8003D6E4 8FBF0038 */ lw $ra, 0x38($sp)
/* 18AE8 8003D6E8 8FB10034 */ lw $s1, 0x34($sp)
/* 18AEC 8003D6EC 8FB00030 */ lw $s0, 0x30($sp)
/* 18AF0 8003D6F0 03E00008 */ jr $ra
/* 18AF4 8003D6F4 27BD0040 */ addiu $sp, $sp, 0x40