papermario/ver/us/asm/nonmatchings/npc/func_8003DFA0.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

83 lines
4.0 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8003DFA0
/* 193A0 8003DFA0 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 193A4 8003DFA4 AFB1001C */ sw $s1, 0x1c($sp)
/* 193A8 8003DFA8 0080882D */ daddu $s1, $a0, $zero
/* 193AC 8003DFAC 3C048007 */ lui $a0, %hi(D_80077C30)
/* 193B0 8003DFB0 24847C30 */ addiu $a0, $a0, %lo(D_80077C30)
/* 193B4 8003DFB4 AFBF0020 */ sw $ra, 0x20($sp)
/* 193B8 8003DFB8 AFB00018 */ sw $s0, 0x18($sp)
/* 193BC 8003DFBC F7B40028 */ sdc1 $f20, 0x28($sp)
/* 193C0 8003DFC0 94820000 */ lhu $v0, ($a0)
/* 193C4 8003DFC4 24430001 */ addiu $v1, $v0, 1
/* 193C8 8003DFC8 00021400 */ sll $v0, $v0, 0x10
/* 193CC 8003DFCC 00021403 */ sra $v0, $v0, 0x10
/* 193D0 8003DFD0 28420004 */ slti $v0, $v0, 4
/* 193D4 8003DFD4 14400039 */ bnez $v0, .L8003E0BC
/* 193D8 8003DFD8 A4830000 */ sh $v1, ($a0)
/* 193DC 8003DFDC C62C000C */ lwc1 $f12, 0xc($s1)
/* 193E0 8003DFE0 A4800000 */ sh $zero, ($a0)
/* 193E4 8003DFE4 0C00A6C9 */ jal clamp_angle
/* 193E8 8003DFE8 46006307 */ neg.s $f12, $f12
/* 193EC 8003DFEC 3C0140C9 */ lui $at, 0x40c9
/* 193F0 8003DFF0 34210FD0 */ ori $at, $at, 0xfd0
/* 193F4 8003DFF4 44811000 */ mtc1 $at, $f2
/* 193F8 8003DFF8 00000000 */ nop
/* 193FC 8003DFFC 46020502 */ mul.s $f20, $f0, $f2
/* 19400 8003E000 00000000 */ nop
/* 19404 8003E004 3C0143B4 */ lui $at, 0x43b4
/* 19408 8003E008 44810000 */ mtc1 $at, $f0
/* 1940C 8003E00C 00000000 */ nop
/* 19410 8003E010 4600A503 */ div.s $f20, $f20, $f0
/* 19414 8003E014 0C00A85B */ jal sin_rad
/* 19418 8003E018 4600A306 */ mov.s $f12, $f20
/* 1941C 8003E01C 4600A306 */ mov.s $f12, $f20
/* 19420 8003E020 0C00A874 */ jal cos_rad
/* 19424 8003E024 46000506 */ mov.s $f20, $f0
/* 19428 8003E028 862200A6 */ lh $v0, 0xa6($s1)
/* 1942C 8003E02C 44821000 */ mtc1 $v0, $f2
/* 19430 8003E030 00000000 */ nop
/* 19434 8003E034 468010A0 */ cvt.s.w $f2, $f2
/* 19438 8003E038 46141502 */ mul.s $f20, $f2, $f20
/* 1943C 8003E03C 00000000 */ nop
/* 19440 8003E040 46001082 */ mul.s $f2, $f2, $f0
/* 19444 8003E044 00000000 */ nop
/* 19448 8003E048 3C013E4C */ lui $at, 0x3e4c
/* 1944C 8003E04C 3421CCCD */ ori $at, $at, 0xcccd
/* 19450 8003E050 44810000 */ mtc1 $at, $f0
/* 19454 8003E054 00000000 */ nop
/* 19458 8003E058 4600A502 */ mul.s $f20, $f20, $f0
/* 1945C 8003E05C 00000000 */ nop
/* 19460 8003E060 46001082 */ mul.s $f2, $f2, $f0
/* 19464 8003E064 00000000 */ nop
/* 19468 8003E068 3C013FC0 */ lui $at, 0x3fc0
/* 1946C 8003E06C 44817000 */ mtc1 $at, $f14
/* 19470 8003E070 C620003C */ lwc1 $f0, 0x3c($s1)
/* 19474 8003E074 460E0380 */ add.s $f14, $f0, $f14
/* 19478 8003E078 C6200040 */ lwc1 $f0, 0x40($s1)
/* 1947C 8003E07C 3C108007 */ lui $s0, %hi(D_80077C34)
/* 19480 8003E080 26107C34 */ addiu $s0, $s0, %lo(D_80077C34)
/* 19484 8003E084 46020000 */ add.s $f0, $f0, $f2
/* 19488 8003E088 C624000C */ lwc1 $f4, 0xc($s1)
/* 1948C 8003E08C C62C0038 */ lwc1 $f12, 0x38($s1)
/* 19490 8003E090 46002107 */ neg.s $f4, $f4
/* 19494 8003E094 44072000 */ mfc1 $a3, $f4
/* 19498 8003E098 46146300 */ add.s $f12, $f12, $f20
/* 1949C 8003E09C 44060000 */ mfc1 $a2, $f0
/* 194A0 8003E0A0 C6000000 */ lwc1 $f0, ($s0)
/* 194A4 8003E0A4 46800020 */ cvt.s.w $f0, $f0
/* 194A8 8003E0A8 0C01BF44 */ jal func_8006FD10
/* 194AC 8003E0AC E7A00010 */ swc1 $f0, 0x10($sp)
/* 194B0 8003E0B0 8E020000 */ lw $v0, ($s0)
/* 194B4 8003E0B4 2C420001 */ sltiu $v0, $v0, 1
/* 194B8 8003E0B8 AE020000 */ sw $v0, ($s0)
.L8003E0BC:
/* 194BC 8003E0BC 8FBF0020 */ lw $ra, 0x20($sp)
/* 194C0 8003E0C0 8FB1001C */ lw $s1, 0x1c($sp)
/* 194C4 8003E0C4 8FB00018 */ lw $s0, 0x18($sp)
/* 194C8 8003E0C8 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 194CC 8003E0CC 03E00008 */ jr $ra
/* 194D0 8003E0D0 27BD0030 */ addiu $sp, $sp, 0x30