papermario/ver/us/asm/nonmatchings/404220/func_E011A48C.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

180 lines
8.7 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_E011A48C
/* 4046AC E011A48C 3C03800A */ lui $v1, %hi(gMasterGfxPos)
/* 4046B0 E011A490 2463A66C */ addiu $v1, $v1, %lo(gMasterGfxPos)
/* 4046B4 E011A494 44872000 */ mtc1 $a3, $f4
/* 4046B8 E011A498 8C670000 */ lw $a3, ($v1)
/* 4046BC E011A49C 24E20008 */ addiu $v0, $a3, 8
/* 4046C0 E011A4A0 AC620000 */ sw $v0, ($v1)
/* 4046C4 E011A4A4 24820020 */ addiu $v0, $a0, 0x20
/* 4046C8 E011A4A8 00021480 */ sll $v0, $v0, 0x12
/* 4046CC E011A4AC 00021403 */ sra $v0, $v0, 0x10
/* 4046D0 E011A4B0 18400005 */ blez $v0, .LE011A4C8
/* 4046D4 E011A4B4 30420FFF */ andi $v0, $v0, 0xfff
/* 4046D8 E011A4B8 00021300 */ sll $v0, $v0, 0xc
/* 4046DC E011A4BC 3C03E400 */ lui $v1, 0xe400
/* 4046E0 E011A4C0 08046933 */ j .LE011A4CC
/* 4046E4 E011A4C4 00431825 */ or $v1, $v0, $v1
.LE011A4C8:
/* 4046E8 E011A4C8 3C03E400 */ lui $v1, 0xe400
.LE011A4CC:
/* 4046EC E011A4CC 24A20020 */ addiu $v0, $a1, 0x20
/* 4046F0 E011A4D0 00021480 */ sll $v0, $v0, 0x12
/* 4046F4 E011A4D4 00021403 */ sra $v0, $v0, 0x10
/* 4046F8 E011A4D8 18400004 */ blez $v0, .LE011A4EC
/* 4046FC E011A4DC ACE30000 */ sw $v1, ($a3)
/* 404700 E011A4E0 30420FFF */ andi $v0, $v0, 0xfff
/* 404704 E011A4E4 00621025 */ or $v0, $v1, $v0
/* 404708 E011A4E8 ACE20000 */ sw $v0, ($a3)
.LE011A4EC:
/* 40470C E011A4EC 30C20007 */ andi $v0, $a2, 7
/* 404710 E011A4F0 00021E00 */ sll $v1, $v0, 0x18
/* 404714 E011A4F4 00041480 */ sll $v0, $a0, 0x12
/* 404718 E011A4F8 00023403 */ sra $a2, $v0, 0x10
/* 40471C E011A4FC 18C00003 */ blez $a2, .LE011A50C
/* 404720 E011A500 30C20FFF */ andi $v0, $a2, 0xfff
/* 404724 E011A504 00021300 */ sll $v0, $v0, 0xc
/* 404728 E011A508 00621825 */ or $v1, $v1, $v0
.LE011A50C:
/* 40472C E011A50C 00051480 */ sll $v0, $a1, 0x12
/* 404730 E011A510 00021403 */ sra $v0, $v0, 0x10
/* 404734 E011A514 18400004 */ blez $v0, .LE011A528
/* 404738 E011A518 ACE30004 */ sw $v1, 4($a3)
/* 40473C E011A51C 30420FFF */ andi $v0, $v0, 0xfff
/* 404740 E011A520 00621025 */ or $v0, $v1, $v0
/* 404744 E011A524 ACE20004 */ sw $v0, 4($a3)
.LE011A528:
/* 404748 E011A528 3C03800A */ lui $v1, %hi(gMasterGfxPos)
/* 40474C E011A52C 2463A66C */ addiu $v1, $v1, %lo(gMasterGfxPos)
/* 404750 E011A530 8C620000 */ lw $v0, ($v1)
/* 404754 E011A534 0040202D */ daddu $a0, $v0, $zero
/* 404758 E011A538 24420008 */ addiu $v0, $v0, 8
/* 40475C E011A53C AC620000 */ sw $v0, ($v1)
/* 404760 E011A540 3C02E100 */ lui $v0, 0xe100
/* 404764 E011A544 AC820000 */ sw $v0, ($a0)
/* 404768 E011A548 04C10015 */ bgez $a2, .LE011A5A0
/* 40476C E011A54C 24840004 */ addiu $a0, $a0, 4
/* 404770 E011A550 4600218D */ trunc.w.s $f6, $f4
/* 404774 E011A554 44023000 */ mfc1 $v0, $f6
/* 404778 E011A558 00000000 */ nop
/* 40477C E011A55C 00021400 */ sll $v0, $v0, 0x10
/* 404780 E011A560 00021403 */ sra $v0, $v0, 0x10
/* 404784 E011A564 04410007 */ bgez $v0, .LE011A584
/* 404788 E011A568 00C20018 */ mult $a2, $v0
/* 40478C E011A56C 00004012 */ mflo $t0
/* 404790 E011A570 000811C3 */ sra $v0, $t0, 7
/* 404794 E011A574 04410008 */ bgez $v0, .LE011A598
/* 404798 E011A578 00021023 */ negu $v0, $v0
/* 40479C E011A57C 08046965 */ j .LE011A594
/* 4047A0 E011A580 0000102D */ daddu $v0, $zero, $zero
.LE011A584:
/* 4047A4 E011A584 00004012 */ mflo $t0
/* 4047A8 E011A588 000811C3 */ sra $v0, $t0, 7
/* 4047AC E011A58C 5C400001 */ bgtzl $v0, .LE011A594
/* 4047B0 E011A590 0000102D */ daddu $v0, $zero, $zero
.LE011A594:
/* 4047B4 E011A594 00021023 */ negu $v0, $v0
.LE011A598:
/* 4047B8 E011A598 08046969 */ j .LE011A5A4
/* 4047BC E011A59C 00023400 */ sll $a2, $v0, 0x10
.LE011A5A0:
/* 4047C0 E011A5A0 0000302D */ daddu $a2, $zero, $zero
.LE011A5A4:
/* 4047C4 E011A5A4 00051080 */ sll $v0, $a1, 2
/* 4047C8 E011A5A8 0441001E */ bgez $v0, .LE011A624
/* 4047CC E011A5AC 34C20400 */ ori $v0, $a2, 0x400
/* 4047D0 E011A5B0 46002007 */ neg.s $f0, $f4
/* 4047D4 E011A5B4 4600018D */ trunc.w.s $f6, $f0
/* 4047D8 E011A5B8 44023000 */ mfc1 $v0, $f6
/* 4047DC E011A5BC 00000000 */ nop
/* 4047E0 E011A5C0 00021400 */ sll $v0, $v0, 0x10
/* 4047E4 E011A5C4 00021C03 */ sra $v1, $v0, 0x10
/* 4047E8 E011A5C8 0461000C */ bgez $v1, .LE011A5FC
/* 4047EC E011A5CC 00051480 */ sll $v0, $a1, 0x12
/* 4047F0 E011A5D0 00021403 */ sra $v0, $v0, 0x10
/* 4047F4 E011A5D4 00430018 */ mult $v0, $v1
/* 4047F8 E011A5D8 00004012 */ mflo $t0
/* 4047FC E011A5DC 000819C3 */ sra $v1, $t0, 7
/* 404800 E011A5E0 04620001 */ bltzl $v1, .LE011A5E8
/* 404804 E011A5E4 0000182D */ daddu $v1, $zero, $zero
.LE011A5E8:
/* 404808 E011A5E8 24020400 */ addiu $v0, $zero, 0x400
/* 40480C E011A5EC 00431023 */ subu $v0, $v0, $v1
/* 404810 E011A5F0 3042FFFF */ andi $v0, $v0, 0xffff
/* 404814 E011A5F4 08046989 */ j .LE011A624
/* 404818 E011A5F8 00C21025 */ or $v0, $a2, $v0
.LE011A5FC:
/* 40481C E011A5FC 00021403 */ sra $v0, $v0, 0x10
/* 404820 E011A600 00430018 */ mult $v0, $v1
/* 404824 E011A604 00004012 */ mflo $t0
/* 404828 E011A608 000819C3 */ sra $v1, $t0, 7
/* 40482C E011A60C 5C600001 */ bgtzl $v1, .LE011A614
/* 404830 E011A610 0000182D */ daddu $v1, $zero, $zero
.LE011A614:
/* 404834 E011A614 24020400 */ addiu $v0, $zero, 0x400
/* 404838 E011A618 00431023 */ subu $v0, $v0, $v1
/* 40483C E011A61C 3042FFFF */ andi $v0, $v0, 0xffff
/* 404840 E011A620 00C21025 */ or $v0, $a2, $v0
.LE011A624:
/* 404844 E011A624 AC820000 */ sw $v0, ($a0)
/* 404848 E011A628 3C03800A */ lui $v1, %hi(gMasterGfxPos)
/* 40484C E011A62C 2463A66C */ addiu $v1, $v1, %lo(gMasterGfxPos)
/* 404850 E011A630 8C620000 */ lw $v0, ($v1)
/* 404854 E011A634 3C014F00 */ lui $at, 0x4f00
/* 404858 E011A638 44810000 */ mtc1 $at, $f0
/* 40485C E011A63C 0040202D */ daddu $a0, $v0, $zero
/* 404860 E011A640 24420008 */ addiu $v0, $v0, 8
/* 404864 E011A644 AC620000 */ sw $v0, ($v1)
/* 404868 E011A648 3C02F100 */ lui $v0, 0xf100
/* 40486C E011A64C AC820000 */ sw $v0, ($a0)
/* 404870 E011A650 4604003E */ c.le.s $f0, $f4
/* 404874 E011A654 00000000 */ nop
/* 404878 E011A658 45010005 */ bc1t .LE011A670
/* 40487C E011A65C 24840004 */ addiu $a0, $a0, 4
/* 404880 E011A660 4600218D */ trunc.w.s $f6, $f4
/* 404884 E011A664 44033000 */ mfc1 $v1, $f6
/* 404888 E011A668 080469A2 */ j .LE011A688
/* 40488C E011A66C 00000000 */ nop
.LE011A670:
/* 404890 E011A670 46002001 */ sub.s $f0, $f4, $f0
/* 404894 E011A674 3C028000 */ lui $v0, 0x8000
/* 404898 E011A678 4600018D */ trunc.w.s $f6, $f0
/* 40489C E011A67C 44033000 */ mfc1 $v1, $f6
/* 4048A0 E011A680 00000000 */ nop
/* 4048A4 E011A684 00621825 */ or $v1, $v1, $v0
.LE011A688:
/* 4048A8 E011A688 3C014F00 */ lui $at, 0x4f00
/* 4048AC E011A68C 44811000 */ mtc1 $at, $f2
/* 4048B0 E011A690 46002007 */ neg.s $f0, $f4
/* 4048B4 E011A694 4600103E */ c.le.s $f2, $f0
/* 4048B8 E011A698 00000000 */ nop
/* 4048BC E011A69C 45010005 */ bc1t .LE011A6B4
/* 4048C0 E011A6A0 00033400 */ sll $a2, $v1, 0x10
/* 4048C4 E011A6A4 4600018D */ trunc.w.s $f6, $f0
/* 4048C8 E011A6A8 44073000 */ mfc1 $a3, $f6
/* 4048CC E011A6AC 080469B3 */ j .LE011A6CC
/* 4048D0 E011A6B0 00000000 */ nop
.LE011A6B4:
/* 4048D4 E011A6B4 46020001 */ sub.s $f0, $f0, $f2
/* 4048D8 E011A6B8 3C028000 */ lui $v0, 0x8000
/* 4048DC E011A6BC 4600018D */ trunc.w.s $f6, $f0
/* 4048E0 E011A6C0 44073000 */ mfc1 $a3, $f6
/* 4048E4 E011A6C4 00000000 */ nop
/* 4048E8 E011A6C8 00E23825 */ or $a3, $a3, $v0
.LE011A6CC:
/* 4048EC E011A6CC 3C05800A */ lui $a1, %hi(gMasterGfxPos)
/* 4048F0 E011A6D0 24A5A66C */ addiu $a1, $a1, %lo(gMasterGfxPos)
/* 4048F4 E011A6D4 30E2FFFF */ andi $v0, $a3, 0xffff
/* 4048F8 E011A6D8 8CA30000 */ lw $v1, ($a1)
/* 4048FC E011A6DC 00C21025 */ or $v0, $a2, $v0
/* 404900 E011A6E0 AC820000 */ sw $v0, ($a0)
/* 404904 E011A6E4 3C02E700 */ lui $v0, 0xe700
/* 404908 E011A6E8 0060202D */ daddu $a0, $v1, $zero
/* 40490C E011A6EC 24630008 */ addiu $v1, $v1, 8
/* 404910 E011A6F0 ACA30000 */ sw $v1, ($a1)
/* 404914 E011A6F4 AC820000 */ sw $v0, ($a0)
/* 404918 E011A6F8 03E00008 */ jr $ra
/* 40491C E011A6FC AC800004 */ sw $zero, 4($a0)