papermario/ver/jp/asm/nonmatchings/40AC0/func_800656C0.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

89 lines
4.1 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_800656C0
/* 40AC0 800656C0 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 40AC4 800656C4 AFB00010 */ sw $s0, 0x10($sp)
/* 40AC8 800656C8 00808021 */ addu $s0, $a0, $zero
/* 40ACC 800656CC AFB40020 */ sw $s4, 0x20($sp)
/* 40AD0 800656D0 00A0A021 */ addu $s4, $a1, $zero
/* 40AD4 800656D4 AFB10014 */ sw $s1, 0x14($sp)
/* 40AD8 800656D8 00C08821 */ addu $s1, $a2, $zero
/* 40ADC 800656DC AFBF0024 */ sw $ra, 0x24($sp)
/* 40AE0 800656E0 AFB3001C */ sw $s3, 0x1c($sp)
/* 40AE4 800656E4 0C01ACD0 */ jal func_8006B340
/* 40AE8 800656E8 AFB20018 */ sw $s2, 0x18($sp)
/* 40AEC 800656EC 8E030008 */ lw $v1, 8($s0)
/* 40AF0 800656F0 1460000F */ bnez $v1, .L80065730
/* 40AF4 800656F4 00409021 */ addu $s2, $v0, $zero
/* 40AF8 800656F8 24130008 */ addiu $s3, $zero, 8
.L800656FC:
/* 40AFC 800656FC 16200005 */ bnez $s1, .L80065714
/* 40B00 80065700 02002021 */ addu $a0, $s0, $zero
/* 40B04 80065704 0C01ACEC */ jal func_8006B3B0
/* 40B08 80065708 02402021 */ addu $a0, $s2, $zero
/* 40B0C 8006570C 080195F1 */ j .L800657C4
/* 40B10 80065710 2402FFFF */ addiu $v0, $zero, -1
.L80065714:
/* 40B14 80065714 3C028009 */ lui $v0, %hi(D_80094640)
/* 40B18 80065718 8C424640 */ lw $v0, %lo(D_80094640)($v0)
/* 40B1C 8006571C 0C01AC13 */ jal func_8006B04C
/* 40B20 80065720 A4530010 */ sh $s3, 0x10($v0)
/* 40B24 80065724 8E020008 */ lw $v0, 8($s0)
/* 40B28 80065728 1040FFF4 */ beqz $v0, .L800656FC
/* 40B2C 8006572C 00000000 */ nop
.L80065730:
/* 40B30 80065730 12800007 */ beqz $s4, .L80065750
/* 40B34 80065734 00000000 */ nop
/* 40B38 80065738 8E02000C */ lw $v0, 0xc($s0)
/* 40B3C 8006573C 8E030014 */ lw $v1, 0x14($s0)
/* 40B40 80065740 00021080 */ sll $v0, $v0, 2
/* 40B44 80065744 00431021 */ addu $v0, $v0, $v1
/* 40B48 80065748 8C420000 */ lw $v0, ($v0)
/* 40B4C 8006574C AE820000 */ sw $v0, ($s4)
.L80065750:
/* 40B50 80065750 8E02000C */ lw $v0, 0xc($s0)
/* 40B54 80065754 8E030010 */ lw $v1, 0x10($s0)
/* 40B58 80065758 24420001 */ addiu $v0, $v0, 1
/* 40B5C 8006575C 0043001A */ div $zero, $v0, $v1
/* 40B60 80065760 14600002 */ bnez $v1, .L8006576C
/* 40B64 80065764 00000000 */ nop
/* 40B68 80065768 0007000D */ break 7
.L8006576C:
/* 40B6C 8006576C 2401FFFF */ addiu $at, $zero, -1
/* 40B70 80065770 14610004 */ bne $v1, $at, .L80065784
/* 40B74 80065774 3C018000 */ lui $at, 0x8000
/* 40B78 80065778 14410002 */ bne $v0, $at, .L80065784
/* 40B7C 8006577C 00000000 */ nop
/* 40B80 80065780 0006000D */ break 6
.L80065784:
/* 40B84 80065784 00002010 */ mfhi $a0
/* 40B88 80065788 8E020008 */ lw $v0, 8($s0)
/* 40B8C 8006578C 8E030004 */ lw $v1, 4($s0)
/* 40B90 80065790 2442FFFF */ addiu $v0, $v0, -1
/* 40B94 80065794 AE020008 */ sw $v0, 8($s0)
/* 40B98 80065798 AE04000C */ sw $a0, 0xc($s0)
/* 40B9C 8006579C 8C620000 */ lw $v0, ($v1)
/* 40BA0 800657A0 10400005 */ beqz $v0, .L800657B8
/* 40BA4 800657A4 00000000 */ nop
/* 40BA8 800657A8 0C01AC67 */ jal func_8006B19C
/* 40BAC 800657AC 26040004 */ addiu $a0, $s0, 4
/* 40BB0 800657B0 0C0197FC */ jal func_80065FF0
/* 40BB4 800657B4 00402021 */ addu $a0, $v0, $zero
.L800657B8:
/* 40BB8 800657B8 0C01ACEC */ jal func_8006B3B0
/* 40BBC 800657BC 02402021 */ addu $a0, $s2, $zero
/* 40BC0 800657C0 00001021 */ addu $v0, $zero, $zero
.L800657C4:
/* 40BC4 800657C4 8FBF0024 */ lw $ra, 0x24($sp)
/* 40BC8 800657C8 8FB40020 */ lw $s4, 0x20($sp)
/* 40BCC 800657CC 8FB3001C */ lw $s3, 0x1c($sp)
/* 40BD0 800657D0 8FB20018 */ lw $s2, 0x18($sp)
/* 40BD4 800657D4 8FB10014 */ lw $s1, 0x14($sp)
/* 40BD8 800657D8 8FB00010 */ lw $s0, 0x10($sp)
/* 40BDC 800657DC 03E00008 */ jr $ra
/* 40BE0 800657E0 27BD0028 */ addiu $sp, $sp, 0x28
/* 40BE4 800657E4 00000000 */ nop
/* 40BE8 800657E8 00000000 */ nop
/* 40BEC 800657EC 00000000 */ nop