papermario/ver/us/asm/nonmatchings/d0a70_len_4fe0/func_8013C048.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

129 lines
6.2 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8013C048
/* D2748 8013C048 0080582D */ daddu $t3, $a0, $zero
/* D274C 8013C04C 3C098015 */ lui $t1, %hi(D_8014EE14)
/* D2750 8013C050 2529EE14 */ addiu $t1, $t1, %lo(D_8014EE14)
/* D2754 8013C054 0000402D */ daddu $t0, $zero, $zero
/* D2758 8013C058 91660004 */ lbu $a2, 4($t3)
/* D275C 8013C05C 44804000 */ mtc1 $zero, $f8
/* D2760 8013C060 95220000 */ lhu $v0, ($t1)
/* D2764 8013C064 3C038015 */ lui $v1, %hi(D_80156950)
/* D2768 8013C068 8C636950 */ lw $v1, %lo(D_80156950)($v1)
/* D276C 8013C06C 3C0A8015 */ lui $t2, %hi(D_8014EE10)
/* D2770 8013C070 254AEE10 */ addiu $t2, $t2, %lo(D_8014EE10)
/* D2774 8013C074 A5620008 */ sh $v0, 8($t3)
/* D2778 8013C078 95220000 */ lhu $v0, ($t1)
/* D277C 8013C07C 8D450000 */ lw $a1, ($t2)
/* D2780 8013C080 00021100 */ sll $v0, $v0, 4
/* D2784 8013C084 00623821 */ addu $a3, $v1, $v0
/* D2788 8013C088 84A4000E */ lh $a0, 0xe($a1)
/* D278C 8013C08C 94A20008 */ lhu $v0, 8($a1)
/* D2790 8013C090 91630003 */ lbu $v1, 3($t3)
/* D2794 8013C094 44843000 */ mtc1 $a0, $f6
/* D2798 8013C098 00000000 */ nop
/* D279C 8013C09C 468031A0 */ cvt.s.w $f6, $f6
/* D27A0 8013C0A0 44821000 */ mtc1 $v0, $f2
/* D27A4 8013C0A4 00000000 */ nop
/* D27A8 8013C0A8 468010A0 */ cvt.s.w $f2, $f2
/* D27AC 8013C0AC 44830000 */ mtc1 $v1, $f0
/* D27B0 8013C0B0 00000000 */ nop
/* D27B4 8013C0B4 46800020 */ cvt.s.w $f0, $f0
/* D27B8 8013C0B8 46001283 */ div.s $f10, $f2, $f0
/* D27BC 8013C0BC 94A2000A */ lhu $v0, 0xa($a1)
/* D27C0 8013C0C0 44860000 */ mtc1 $a2, $f0
/* D27C4 8013C0C4 00000000 */ nop
/* D27C8 8013C0C8 46800020 */ cvt.s.w $f0, $f0
/* D27CC 8013C0CC 44821000 */ mtc1 $v0, $f2
/* D27D0 8013C0D0 00000000 */ nop
/* D27D4 8013C0D4 468010A0 */ cvt.s.w $f2, $f2
/* D27D8 8013C0D8 00C8102A */ slt $v0, $a2, $t0
/* D27DC 8013C0DC 1440004B */ bnez $v0, .L8013C20C
/* D27E0 8013C0E0 46001083 */ div.s $f2, $f2, $f0
/* D27E4 8013C0E4 0140282D */ daddu $a1, $t2, $zero
/* D27E8 8013C0E8 0120602D */ daddu $t4, $t1, $zero
.L8013C0EC:
/* D27EC 8013C0EC 1506000B */ bne $t0, $a2, .L8013C11C
/* D27F0 8013C0F0 0000302D */ daddu $a2, $zero, $zero
/* D27F4 8013C0F4 8CA20000 */ lw $v0, ($a1)
/* D27F8 8013C0F8 9443000A */ lhu $v1, 0xa($v0)
/* D27FC 8013C0FC 8442000E */ lh $v0, 0xe($v0)
/* D2800 8013C100 44834000 */ mtc1 $v1, $f8
/* D2804 8013C104 00000000 */ nop
/* D2808 8013C108 46804220 */ cvt.s.w $f8, $f8
/* D280C 8013C10C 00431023 */ subu $v0, $v0, $v1
/* D2810 8013C110 44823000 */ mtc1 $v0, $f6
/* D2814 8013C114 00000000 */ nop
/* D2818 8013C118 468031A0 */ cvt.s.w $f6, $f6
.L8013C11C:
/* D281C 8013C11C 8CA20000 */ lw $v0, ($a1)
/* D2820 8013C120 44802000 */ mtc1 $zero, $f4
/* D2824 8013C124 8442000C */ lh $v0, 0xc($v0)
/* D2828 8013C128 91630003 */ lbu $v1, 3($t3)
/* D282C 8013C12C 44820000 */ mtc1 $v0, $f0
/* D2830 8013C130 00000000 */ nop
/* D2834 8013C134 46800020 */ cvt.s.w $f0, $f0
/* D2838 8013C138 0066102A */ slt $v0, $v1, $a2
/* D283C 8013C13C 5440002E */ bnel $v0, $zero, .L8013C1F8
/* D2840 8013C140 46023181 */ sub.s $f6, $f6, $f2
/* D2844 8013C144 4600330D */ trunc.w.s $f12, $f6
/* D2848 8013C148 440A6000 */ mfc1 $t2, $f12
/* D284C 8013C14C 4600430D */ trunc.w.s $f12, $f8
/* D2850 8013C150 44026000 */ mfc1 $v0, $f12
/* D2854 8013C154 00000000 */ nop
/* D2858 8013C158 24420100 */ addiu $v0, $v0, 0x100
/* D285C 8013C15C 00024940 */ sll $t1, $v0, 5
/* D2860 8013C160 24E4000A */ addiu $a0, $a3, 0xa
.L8013C164:
/* D2864 8013C164 14C3000B */ bne $a2, $v1, .L8013C194
/* D2868 8013C168 00000000 */ nop
/* D286C 8013C16C 8CA20000 */ lw $v0, ($a1)
/* D2870 8013C170 94430008 */ lhu $v1, 8($v0)
/* D2874 8013C174 8442000C */ lh $v0, 0xc($v0)
/* D2878 8013C178 44832000 */ mtc1 $v1, $f4
/* D287C 8013C17C 00000000 */ nop
/* D2880 8013C180 46802120 */ cvt.s.w $f4, $f4
/* D2884 8013C184 00431021 */ addu $v0, $v0, $v1
/* D2888 8013C188 44820000 */ mtc1 $v0, $f0
/* D288C 8013C18C 00000000 */ nop
/* D2890 8013C190 46800020 */ cvt.s.w $f0, $f0
.L8013C194:
/* D2894 8013C194 4600030D */ trunc.w.s $f12, $f0
/* D2898 8013C198 44026000 */ mfc1 $v0, $f12
/* D289C 8013C19C 00000000 */ nop
/* D28A0 8013C1A0 A4E20000 */ sh $v0, ($a3)
/* D28A4 8013C1A4 4600230D */ trunc.w.s $f12, $f4
/* D28A8 8013C1A8 44026000 */ mfc1 $v0, $f12
/* D28AC 8013C1AC 00000000 */ nop
/* D28B0 8013C1B0 24420100 */ addiu $v0, $v0, 0x100
/* D28B4 8013C1B4 00021140 */ sll $v0, $v0, 5
/* D28B8 8013C1B8 A48AFFF8 */ sh $t2, -8($a0)
/* D28BC 8013C1BC A480FFFA */ sh $zero, -6($a0)
/* D28C0 8013C1C0 A482FFFE */ sh $v0, -2($a0)
/* D28C4 8013C1C4 A4890000 */ sh $t1, ($a0)
/* D28C8 8013C1C8 24840010 */ addiu $a0, $a0, 0x10
/* D28CC 8013C1CC 24E70010 */ addiu $a3, $a3, 0x10
/* D28D0 8013C1D0 24C60001 */ addiu $a2, $a2, 1
/* D28D4 8013C1D4 95820000 */ lhu $v0, ($t4)
/* D28D8 8013C1D8 460A0000 */ add.s $f0, $f0, $f10
/* D28DC 8013C1DC 24420001 */ addiu $v0, $v0, 1
/* D28E0 8013C1E0 A5820000 */ sh $v0, ($t4)
/* D28E4 8013C1E4 91630003 */ lbu $v1, 3($t3)
/* D28E8 8013C1E8 0066102A */ slt $v0, $v1, $a2
/* D28EC 8013C1EC 1040FFDD */ beqz $v0, .L8013C164
/* D28F0 8013C1F0 460A2100 */ add.s $f4, $f4, $f10
/* D28F4 8013C1F4 46023181 */ sub.s $f6, $f6, $f2
.L8013C1F8:
/* D28F8 8013C1F8 25080001 */ addiu $t0, $t0, 1
/* D28FC 8013C1FC 91660004 */ lbu $a2, 4($t3)
/* D2900 8013C200 00C8102A */ slt $v0, $a2, $t0
/* D2904 8013C204 1040FFB9 */ beqz $v0, .L8013C0EC
/* D2908 8013C208 46024200 */ add.s $f8, $f8, $f2
.L8013C20C:
/* D290C 8013C20C 3C028015 */ lui $v0, %hi(D_8014EE14)
/* D2910 8013C210 9442EE14 */ lhu $v0, %lo(D_8014EE14)($v0)
/* D2914 8013C214 2442FFFF */ addiu $v0, $v0, -1
/* D2918 8013C218 03E00008 */ jr $ra
/* D291C 8013C21C A562000A */ sh $v0, 0xa($t3)