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

88 lines
4.2 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_800657F0
/* 40BF0 800657F0 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 40BF4 800657F4 AFB00010 */ sw $s0, 0x10($sp)
/* 40BF8 800657F8 00808021 */ addu $s0, $a0, $zero
/* 40BFC 800657FC AFB50024 */ sw $s5, 0x24($sp)
/* 40C00 80065800 00A0A821 */ addu $s5, $a1, $zero
/* 40C04 80065804 AFB20018 */ sw $s2, 0x18($sp)
/* 40C08 80065808 00C09021 */ addu $s2, $a2, $zero
/* 40C0C 8006580C AFBF0028 */ sw $ra, 0x28($sp)
/* 40C10 80065810 AFB40020 */ sw $s4, 0x20($sp)
/* 40C14 80065814 AFB3001C */ sw $s3, 0x1c($sp)
/* 40C18 80065818 0C01ACD0 */ jal func_8006B340
/* 40C1C 8006581C AFB10014 */ sw $s1, 0x14($sp)
/* 40C20 80065820 8E030008 */ lw $v1, 8($s0)
/* 40C24 80065824 8E040010 */ lw $a0, 0x10($s0)
/* 40C28 80065828 0064182A */ slt $v1, $v1, $a0
/* 40C2C 8006582C 14600012 */ bnez $v1, .L80065878
/* 40C30 80065830 00408821 */ addu $s1, $v0, $zero
/* 40C34 80065834 24140001 */ addiu $s4, $zero, 1
/* 40C38 80065838 24130008 */ addiu $s3, $zero, 8
.L8006583C:
/* 40C3C 8006583C 12540005 */ beq $s2, $s4, .L80065854
/* 40C40 80065840 26040004 */ addiu $a0, $s0, 4
/* 40C44 80065844 0C01ACEC */ jal func_8006B3B0
/* 40C48 80065848 02202021 */ addu $a0, $s1, $zero
/* 40C4C 8006584C 0801963F */ j .L800658FC
/* 40C50 80065850 2402FFFF */ addiu $v0, $zero, -1
.L80065854:
/* 40C54 80065854 3C028009 */ lui $v0, %hi(D_80094640)
/* 40C58 80065858 8C424640 */ lw $v0, %lo(D_80094640)($v0)
/* 40C5C 8006585C 0C01AC13 */ jal func_8006B04C
/* 40C60 80065860 A4530010 */ sh $s3, 0x10($v0)
/* 40C64 80065864 8E020008 */ lw $v0, 8($s0)
/* 40C68 80065868 8E030010 */ lw $v1, 0x10($s0)
/* 40C6C 8006586C 0043102A */ slt $v0, $v0, $v1
/* 40C70 80065870 1040FFF2 */ beqz $v0, .L8006583C
/* 40C74 80065874 00000000 */ nop
.L80065878:
/* 40C78 80065878 8E03000C */ lw $v1, 0xc($s0)
/* 40C7C 8006587C 8E040008 */ lw $a0, 8($s0)
/* 40C80 80065880 8E020010 */ lw $v0, 0x10($s0)
/* 40C84 80065884 00641821 */ addu $v1, $v1, $a0
/* 40C88 80065888 0062001A */ div $zero, $v1, $v0
/* 40C8C 8006588C 14400002 */ bnez $v0, .L80065898
/* 40C90 80065890 00000000 */ nop
/* 40C94 80065894 0007000D */ break 7
.L80065898:
/* 40C98 80065898 2401FFFF */ addiu $at, $zero, -1
/* 40C9C 8006589C 14410004 */ bne $v0, $at, .L800658B0
/* 40CA0 800658A0 3C018000 */ lui $at, 0x8000
/* 40CA4 800658A4 14610002 */ bne $v1, $at, .L800658B0
/* 40CA8 800658A8 00000000 */ nop
/* 40CAC 800658AC 0006000D */ break 6
.L800658B0:
/* 40CB0 800658B0 00001010 */ mfhi $v0
/* 40CB4 800658B4 8E030014 */ lw $v1, 0x14($s0)
/* 40CB8 800658B8 00021080 */ sll $v0, $v0, 2
/* 40CBC 800658BC 00431021 */ addu $v0, $v0, $v1
/* 40CC0 800658C0 AC550000 */ sw $s5, ($v0)
/* 40CC4 800658C4 8E020008 */ lw $v0, 8($s0)
/* 40CC8 800658C8 8E030000 */ lw $v1, ($s0)
/* 40CCC 800658CC 24420001 */ addiu $v0, $v0, 1
/* 40CD0 800658D0 AE020008 */ sw $v0, 8($s0)
/* 40CD4 800658D4 8C620000 */ lw $v0, ($v1)
/* 40CD8 800658D8 10400005 */ beqz $v0, .L800658F0
/* 40CDC 800658DC 00000000 */ nop
/* 40CE0 800658E0 0C01AC67 */ jal func_8006B19C
/* 40CE4 800658E4 02002021 */ addu $a0, $s0, $zero
/* 40CE8 800658E8 0C0197FC */ jal func_80065FF0
/* 40CEC 800658EC 00402021 */ addu $a0, $v0, $zero
.L800658F0:
/* 40CF0 800658F0 0C01ACEC */ jal func_8006B3B0
/* 40CF4 800658F4 02202021 */ addu $a0, $s1, $zero
/* 40CF8 800658F8 00001021 */ addu $v0, $zero, $zero
.L800658FC:
/* 40CFC 800658FC 8FBF0028 */ lw $ra, 0x28($sp)
/* 40D00 80065900 8FB50024 */ lw $s5, 0x24($sp)
/* 40D04 80065904 8FB40020 */ lw $s4, 0x20($sp)
/* 40D08 80065908 8FB3001C */ lw $s3, 0x1c($sp)
/* 40D0C 8006590C 8FB20018 */ lw $s2, 0x18($sp)
/* 40D10 80065910 8FB10014 */ lw $s1, 0x14($sp)
/* 40D14 80065914 8FB00010 */ lw $s0, 0x10($sp)
/* 40D18 80065918 03E00008 */ jr $ra
/* 40D1C 8006591C 27BD0030 */ addiu $sp, $sp, 0x30