papermario/ver/jp/asm/nonmatchings/40980/func_80065580.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

92 lines
4.4 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80065580
/* 40980 80065580 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 40984 80065584 AFB00010 */ sw $s0, 0x10($sp)
/* 40988 80065588 00808021 */ addu $s0, $a0, $zero
/* 4098C 8006558C AFB50024 */ sw $s5, 0x24($sp)
/* 40990 80065590 00A0A821 */ addu $s5, $a1, $zero
/* 40994 80065594 AFB20018 */ sw $s2, 0x18($sp)
/* 40998 80065598 00C09021 */ addu $s2, $a2, $zero
/* 4099C 8006559C AFBF0028 */ sw $ra, 0x28($sp)
/* 409A0 800655A0 AFB40020 */ sw $s4, 0x20($sp)
/* 409A4 800655A4 AFB3001C */ sw $s3, 0x1c($sp)
/* 409A8 800655A8 0C01ACD0 */ jal func_8006B340
/* 409AC 800655AC AFB10014 */ sw $s1, 0x14($sp)
/* 409B0 800655B0 8E030008 */ lw $v1, 8($s0)
/* 409B4 800655B4 8E040010 */ lw $a0, 0x10($s0)
/* 409B8 800655B8 0064182A */ slt $v1, $v1, $a0
/* 409BC 800655BC 14600012 */ bnez $v1, .L80065608
/* 409C0 800655C0 00408821 */ addu $s1, $v0, $zero
/* 409C4 800655C4 24140001 */ addiu $s4, $zero, 1
/* 409C8 800655C8 24130008 */ addiu $s3, $zero, 8
.L800655CC:
/* 409CC 800655CC 12540005 */ beq $s2, $s4, .L800655E4
/* 409D0 800655D0 26040004 */ addiu $a0, $s0, 4
/* 409D4 800655D4 0C01ACEC */ jal func_8006B3B0
/* 409D8 800655D8 02202021 */ addu $a0, $s1, $zero
/* 409DC 800655DC 080195A4 */ j .L80065690
/* 409E0 800655E0 2402FFFF */ addiu $v0, $zero, -1
.L800655E4:
/* 409E4 800655E4 3C028009 */ lui $v0, %hi(D_80094640)
/* 409E8 800655E8 8C424640 */ lw $v0, %lo(D_80094640)($v0)
/* 409EC 800655EC 0C01AC13 */ jal func_8006B04C
/* 409F0 800655F0 A4530010 */ sh $s3, 0x10($v0)
/* 409F4 800655F4 8E020008 */ lw $v0, 8($s0)
/* 409F8 800655F8 8E030010 */ lw $v1, 0x10($s0)
/* 409FC 800655FC 0043102A */ slt $v0, $v0, $v1
/* 40A00 80065600 1040FFF2 */ beqz $v0, .L800655CC
/* 40A04 80065604 00000000 */ nop
.L80065608:
/* 40A08 80065608 8E02000C */ lw $v0, 0xc($s0)
/* 40A0C 8006560C 8E030010 */ lw $v1, 0x10($s0)
/* 40A10 80065610 00431021 */ addu $v0, $v0, $v1
/* 40A14 80065614 2442FFFF */ addiu $v0, $v0, -1
/* 40A18 80065618 0043001A */ div $zero, $v0, $v1
/* 40A1C 8006561C 14600002 */ bnez $v1, .L80065628
/* 40A20 80065620 00000000 */ nop
/* 40A24 80065624 0007000D */ break 7
.L80065628:
/* 40A28 80065628 2401FFFF */ addiu $at, $zero, -1
/* 40A2C 8006562C 14610004 */ bne $v1, $at, .L80065640
/* 40A30 80065630 3C018000 */ lui $at, 0x8000
/* 40A34 80065634 14410002 */ bne $v0, $at, .L80065640
/* 40A38 80065638 00000000 */ nop
/* 40A3C 8006563C 0006000D */ break 6
.L80065640:
/* 40A40 80065640 00001810 */ mfhi $v1
/* 40A44 80065644 8E020014 */ lw $v0, 0x14($s0)
/* 40A48 80065648 AE03000C */ sw $v1, 0xc($s0)
/* 40A4C 8006564C 00031880 */ sll $v1, $v1, 2
/* 40A50 80065650 00621821 */ addu $v1, $v1, $v0
/* 40A54 80065654 AC750000 */ sw $s5, ($v1)
/* 40A58 80065658 8E020008 */ lw $v0, 8($s0)
/* 40A5C 8006565C 8E030000 */ lw $v1, ($s0)
/* 40A60 80065660 24420001 */ addiu $v0, $v0, 1
/* 40A64 80065664 AE020008 */ sw $v0, 8($s0)
/* 40A68 80065668 8C620000 */ lw $v0, ($v1)
/* 40A6C 8006566C 10400005 */ beqz $v0, .L80065684
/* 40A70 80065670 00000000 */ nop
/* 40A74 80065674 0C01AC67 */ jal func_8006B19C
/* 40A78 80065678 02002021 */ addu $a0, $s0, $zero
/* 40A7C 8006567C 0C0197FC */ jal func_80065FF0
/* 40A80 80065680 00402021 */ addu $a0, $v0, $zero
.L80065684:
/* 40A84 80065684 0C01ACEC */ jal func_8006B3B0
/* 40A88 80065688 02202021 */ addu $a0, $s1, $zero
/* 40A8C 8006568C 00001021 */ addu $v0, $zero, $zero
.L80065690:
/* 40A90 80065690 8FBF0028 */ lw $ra, 0x28($sp)
/* 40A94 80065694 8FB50024 */ lw $s5, 0x24($sp)
/* 40A98 80065698 8FB40020 */ lw $s4, 0x20($sp)
/* 40A9C 8006569C 8FB3001C */ lw $s3, 0x1c($sp)
/* 40AA0 800656A0 8FB20018 */ lw $s2, 0x18($sp)
/* 40AA4 800656A4 8FB10014 */ lw $s1, 0x14($sp)
/* 40AA8 800656A8 8FB00010 */ lw $s0, 0x10($sp)
/* 40AAC 800656AC 03E00008 */ jr $ra
/* 40AB0 800656B0 27BD0030 */ addiu $sp, $sp, 0x30
/* 40AB4 800656B4 00000000 */ nop
/* 40AB8 800656B8 00000000 */ nop
/* 40ABC 800656BC 00000000 */ nop