papermario/ver/jp/asm/nonmatchings/33100/func_8005891C.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

100 lines
4.5 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8005891C
/* 33D1C 8005891C 8FA20010 */ lw $v0, 0x10($sp)
/* 33D20 80058920 1440000B */ bnez $v0, .L80058950
/* 33D24 80058924 8FA50014 */ lw $a1, 0x14($sp)
/* 33D28 80058928 462E603E */ c.le.d $f12, $f14
/* 33D2C 8005892C 00000000 */ nop
/* 33D30 80058930 45020005 */ bc1fl .L80058948
/* 33D34 80058934 A4A00000 */ sh $zero, ($a1)
/* 33D38 80058938 3402FFFF */ ori $v0, $zero, 0xffff
/* 33D3C 8005893C A4A20000 */ sh $v0, ($a1)
/* 33D40 80058940 03E00008 */ jr $ra
/* 33D44 80058944 24027FFF */ addiu $v0, $zero, 0x7fff
.L80058948:
/* 33D48 80058948 03E00008 */ jr $ra
/* 33D4C 8005894C 0000102D */ daddu $v0, $zero, $zero
.L80058950:
/* 33D50 80058950 3C013FF0 */ lui $at, 0x3ff0
/* 33D54 80058954 44812800 */ mtc1 $at, $f5
/* 33D58 80058958 44802000 */ mtc1 $zero, $f4
/* 33D5C 8005895C 44820000 */ mtc1 $v0, $f0
/* 33D60 80058960 00000000 */ nop
/* 33D64 80058964 46800021 */ cvt.d.w $f0, $f0
/* 33D68 80058968 4624703C */ c.lt.d $f14, $f4
/* 33D6C 8005896C 00000000 */ nop
/* 33D70 80058970 45000002 */ bc1f .L8005897C
/* 33D74 80058974 46202083 */ div.d $f2, $f4, $f0
/* 33D78 80058978 46202386 */ mov.d $f14, $f4
.L8005897C:
/* 33D7C 8005897C 44800000 */ mtc1 $zero, $f0
/* 33D80 80058980 44800800 */ mtc1 $zero, $f1
/* 33D84 80058984 00000000 */ nop
/* 33D88 80058988 4620603E */ c.le.d $f12, $f0
/* 33D8C 8005898C 00000000 */ nop
/* 33D90 80058990 45030001 */ bc1tl .L80058998
/* 33D94 80058994 46202306 */ mov.d $f12, $f4
.L80058998:
/* 33D98 80058998 462C7001 */ sub.d $f0, $f14, $f12
/* 33D9C 8005899C 46220002 */ mul.d $f0, $f0, $f2
/* 33DA0 800589A0 00000000 */ nop
/* 33DA4 800589A4 3C014020 */ lui $at, 0x4020
/* 33DA8 800589A8 44811800 */ mtc1 $at, $f3
/* 33DAC 800589AC 44801000 */ mtc1 $zero, $f2
/* 33DB0 800589B0 00000000 */ nop
/* 33DB4 800589B4 46220002 */ mul.d $f0, $f0, $f2
/* 33DB8 800589B8 00000000 */ nop
/* 33DBC 800589BC 4620018D */ trunc.w.d $f6, $f0
/* 33DC0 800589C0 44033000 */ mfc1 $v1, $f6
/* 33DC4 800589C4 00000000 */ nop
/* 33DC8 800589C8 00031400 */ sll $v0, $v1, 0x10
/* 33DCC 800589CC 00021403 */ sra $v0, $v0, 0x10
/* 33DD0 800589D0 44821000 */ mtc1 $v0, $f2
/* 33DD4 800589D4 00000000 */ nop
/* 33DD8 800589D8 468010A1 */ cvt.d.w $f2, $f2
/* 33DDC 800589DC 46220001 */ sub.d $f0, $f0, $f2
/* 33DE0 800589E0 46240000 */ add.d $f0, $f0, $f4
/* 33DE4 800589E4 4620018D */ trunc.w.d $f6, $f0
/* 33DE8 800589E8 44043000 */ mfc1 $a0, $f6
/* 33DEC 800589EC 00000000 */ nop
/* 33DF0 800589F0 00041400 */ sll $v0, $a0, 0x10
/* 33DF4 800589F4 00021403 */ sra $v0, $v0, 0x10
/* 33DF8 800589F8 44821000 */ mtc1 $v0, $f2
/* 33DFC 800589FC 00000000 */ nop
/* 33E00 80058A00 468010A1 */ cvt.d.w $f2, $f2
/* 33E04 80058A04 46220001 */ sub.d $f0, $f0, $f2
/* 33E08 80058A08 3C01800A */ lui $at, %hi(D_80098918)
/* 33E0C 80058A0C D4228918 */ ldc1 $f2, %lo(D_80098918)($at)
/* 33E10 80058A10 46220002 */ mul.d $f0, $f0, $f2
/* 33E14 80058A14 00000000 */ nop
/* 33E18 80058A18 2463FFFF */ addiu $v1, $v1, -1
/* 33E1C 80058A1C 3C0141E0 */ lui $at, 0x41e0
/* 33E20 80058A20 44811800 */ mtc1 $at, $f3
/* 33E24 80058A24 44801000 */ mtc1 $zero, $f2
/* 33E28 80058A28 00000000 */ nop
/* 33E2C 80058A2C 4620103E */ c.le.d $f2, $f0
/* 33E30 80058A30 00000000 */ nop
/* 33E34 80058A34 45010005 */ bc1t .L80058A4C
/* 33E38 80058A38 00641821 */ addu $v1, $v1, $a0
/* 33E3C 80058A3C 4620018D */ trunc.w.d $f6, $f0
/* 33E40 80058A40 44043000 */ mfc1 $a0, $f6
/* 33E44 80058A44 0801629A */ j .L80058A68
/* 33E48 80058A48 A4A40000 */ sh $a0, ($a1)
.L80058A4C:
/* 33E4C 80058A4C 46220001 */ sub.d $f0, $f0, $f2
/* 33E50 80058A50 3C028000 */ lui $v0, 0x8000
/* 33E54 80058A54 4620018D */ trunc.w.d $f6, $f0
/* 33E58 80058A58 44043000 */ mfc1 $a0, $f6
/* 33E5C 80058A5C 00000000 */ nop
/* 33E60 80058A60 00822025 */ or $a0, $a0, $v0
/* 33E64 80058A64 A4A40000 */ sh $a0, ($a1)
.L80058A68:
/* 33E68 80058A68 00031400 */ sll $v0, $v1, 0x10
/* 33E6C 80058A6C 03E00008 */ jr $ra
/* 33E70 80058A70 00021403 */ sra $v0, $v0, 0x10
/* 33E74 80058A74 00000000 */ nop
/* 33E78 80058A78 00000000 */ nop
/* 33E7C 80058A7C 00000000 */ nop