papermario/ver/jp/asm/nonmatchings/48000/func_8006D1B8.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

104 lines
5.1 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8006D1B8
/* 485B8 8006D1B8 00052C03 */ sra $a1, $a1, 0x10
/* 485BC 8006D1BC 27BDFFC0 */ addiu $sp, $sp, -0x40
/* 485C0 8006D1C0 AFB40028 */ sw $s4, 0x28($sp)
/* 485C4 8006D1C4 0080A021 */ addu $s4, $a0, $zero
/* 485C8 8006D1C8 AFB1001C */ sw $s1, 0x1c($sp)
/* 485CC 8006D1CC 00C08821 */ addu $s1, $a2, $zero
/* 485D0 8006D1D0 AFB20020 */ sw $s2, 0x20($sp)
/* 485D4 8006D1D4 00009021 */ addu $s2, $zero, $zero
/* 485D8 8006D1D8 AFB00018 */ sw $s0, 0x18($sp)
/* 485DC 8006D1DC 00008021 */ addu $s0, $zero, $zero
/* 485E0 8006D1E0 30A300FF */ andi $v1, $a1, 0xff
/* 485E4 8006D1E4 00031882 */ srl $v1, $v1, 2
/* 485E8 8006D1E8 30A5FFFF */ andi $a1, $a1, 0xffff
/* 485EC 8006D1EC 00053202 */ srl $a2, $a1, 8
/* 485F0 8006D1F0 30C20007 */ andi $v0, $a2, 7
/* 485F4 8006D1F4 AFBF0038 */ sw $ra, 0x38($sp)
/* 485F8 8006D1F8 AFB70034 */ sw $s7, 0x34($sp)
/* 485FC 8006D1FC AFB60030 */ sw $s6, 0x30($sp)
/* 48600 8006D200 AFB5002C */ sw $s5, 0x2c($sp)
/* 48604 8006D204 AFB30024 */ sw $s3, 0x24($sp)
/* 48608 8006D208 92840064 */ lbu $a0, 0x64($s4)
/* 4860C 8006D20C 00021140 */ sll $v0, $v0, 5
/* 48610 8006D210 10800037 */ beqz $a0, .L8006D2F0
/* 48614 8006D214 0062B821 */ addu $s7, $v1, $v0
/* 48618 8006D218 00A0A821 */ addu $s5, $a1, $zero
/* 4861C 8006D21C 00C0B021 */ addu $s6, $a2, $zero
/* 48620 8006D220 324700FF */ andi $a3, $s2, 0xff
.L8006D224:
/* 48624 8006D224 14E00002 */ bnez $a3, .L8006D230
/* 48628 8006D228 24130001 */ addiu $s3, $zero, 1
/* 4862C 8006D22C 8E930060 */ lw $s3, 0x60($s4)
.L8006D230:
/* 48630 8006D230 10F60007 */ beq $a3, $s6, .L8006D250
/* 48634 8006D234 02371021 */ addu $v0, $s1, $s7
/* 48638 8006D238 90420101 */ lbu $v0, 0x101($v0)
/* 4863C 8006D23C 30E30007 */ andi $v1, $a3, 7
/* 48640 8006D240 00621007 */ srav $v0, $v0, $v1
/* 48644 8006D244 30420001 */ andi $v0, $v0, 1
/* 48648 8006D248 10400023 */ beqz $v0, .L8006D2D8
/* 4864C 8006D24C 00000000 */ nop
.L8006D250:
/* 48650 8006D250 92220100 */ lbu $v0, 0x100($s1)
/* 48654 8006D254 10E2000C */ beq $a3, $v0, .L8006D288
/* 48658 8006D258 02802021 */ addu $a0, $s4, $zero
/* 4865C 8006D25C 02202821 */ addu $a1, $s1, $zero
/* 48660 8006D260 0C01A79B */ jal func_80069E6C
/* 48664 8006D264 00003021 */ addu $a2, $zero, $zero
/* 48668 8006D268 00402021 */ addu $a0, $v0, $zero
/* 4866C 8006D26C 0004182B */ sltu $v1, $zero, $a0
/* 48670 8006D270 38820003 */ xori $v0, $a0, 3
/* 48674 8006D274 0002102B */ sltu $v0, $zero, $v0
/* 48678 8006D278 00621824 */ and $v1, $v1, $v0
/* 4867C 8006D27C 1460001D */ bnez $v1, .L8006D2F4
/* 48680 8006D280 00801021 */ addu $v0, $a0, $zero
/* 48684 8006D284 A2320100 */ sb $s2, 0x100($s1)
.L8006D288:
/* 48688 8006D288 02602821 */ addu $a1, $s3, $zero
/* 4868C 8006D28C 2A020002 */ slti $v0, $s0, 2
/* 48690 8006D290 28A30080 */ slti $v1, $a1, 0x80
/* 48694 8006D294 00431024 */ and $v0, $v0, $v1
/* 48698 8006D298 1040000C */ beqz $v0, .L8006D2CC
/* 4869C 8006D29C 00051040 */ sll $v0, $a1, 1
/* 486A0 8006D2A0 00512021 */ addu $a0, $v0, $s1
.L8006D2A4:
/* 486A4 8006D2A4 94820000 */ lhu $v0, ($a0)
/* 486A8 8006D2A8 24A50001 */ addiu $a1, $a1, 1
/* 486AC 8006D2AC 28A30080 */ slti $v1, $a1, 0x80
/* 486B0 8006D2B0 00551026 */ xor $v0, $v0, $s5
/* 486B4 8006D2B4 2C420001 */ sltiu $v0, $v0, 1
/* 486B8 8006D2B8 02028021 */ addu $s0, $s0, $v0
/* 486BC 8006D2BC 2A020002 */ slti $v0, $s0, 2
/* 486C0 8006D2C0 00431024 */ and $v0, $v0, $v1
/* 486C4 8006D2C4 1440FFF7 */ bnez $v0, .L8006D2A4
/* 486C8 8006D2C8 24840002 */ addiu $a0, $a0, 2
.L8006D2CC:
/* 486CC 8006D2CC 2A020002 */ slti $v0, $s0, 2
/* 486D0 8006D2D0 10400008 */ beqz $v0, .L8006D2F4
/* 486D4 8006D2D4 24020002 */ addiu $v0, $zero, 2
.L8006D2D8:
/* 486D8 8006D2D8 92830064 */ lbu $v1, 0x64($s4)
/* 486DC 8006D2DC 26520001 */ addiu $s2, $s2, 1
/* 486E0 8006D2E0 324200FF */ andi $v0, $s2, 0xff
/* 486E4 8006D2E4 0043102B */ sltu $v0, $v0, $v1
/* 486E8 8006D2E8 1440FFCE */ bnez $v0, .L8006D224
/* 486EC 8006D2EC 324700FF */ andi $a3, $s2, 0xff
.L8006D2F0:
/* 486F0 8006D2F0 02001021 */ addu $v0, $s0, $zero
.L8006D2F4:
/* 486F4 8006D2F4 8FBF0038 */ lw $ra, 0x38($sp)
/* 486F8 8006D2F8 8FB70034 */ lw $s7, 0x34($sp)
/* 486FC 8006D2FC 8FB60030 */ lw $s6, 0x30($sp)
/* 48700 8006D300 8FB5002C */ lw $s5, 0x2c($sp)
/* 48704 8006D304 8FB40028 */ lw $s4, 0x28($sp)
/* 48708 8006D308 8FB30024 */ lw $s3, 0x24($sp)
/* 4870C 8006D30C 8FB20020 */ lw $s2, 0x20($sp)
/* 48710 8006D310 8FB1001C */ lw $s1, 0x1c($sp)
/* 48714 8006D314 8FB00018 */ lw $s0, 0x18($sp)
/* 48718 8006D318 03E00008 */ jr $ra
/* 4871C 8006D31C 27BD0040 */ addiu $sp, $sp, 0x40