papermario/ver/jp/asm/nonmatchings/13140/func_80037DB4.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

230 lines
12 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80037DB4
/* 131B4 80037DB4 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 131B8 80037DB8 3C058007 */ lui $a1, %hi(D_8007417C)
/* 131BC 80037DBC 8CA5417C */ lw $a1, %lo(D_8007417C)($a1)
/* 131C0 80037DC0 3C048007 */ lui $a0, %hi(D_80077AB0)
/* 131C4 80037DC4 24847AB0 */ addiu $a0, $a0, %lo(D_80077AB0)
/* 131C8 80037DC8 AFBF002C */ sw $ra, 0x2c($sp)
/* 131CC 80037DCC AFB20028 */ sw $s2, 0x28($sp)
/* 131D0 80037DD0 AFB10024 */ sw $s1, 0x24($sp)
/* 131D4 80037DD4 AFB00020 */ sw $s0, 0x20($sp)
/* 131D8 80037DD8 80A30072 */ lb $v1, 0x72($a1)
/* 131DC 80037DDC 3C128011 */ lui $s2, %hi(D_8010F450)
/* 131E0 80037DE0 2652F450 */ addiu $s2, $s2, %lo(D_8010F450)
/* 131E4 80037DE4 00031040 */ sll $v0, $v1, 1
/* 131E8 80037DE8 00431021 */ addu $v0, $v0, $v1
/* 131EC 80037DEC 00021080 */ sll $v0, $v0, 2
/* 131F0 80037DF0 00448821 */ addu $s1, $v0, $a0
/* 131F4 80037DF4 24020004 */ addiu $v0, $zero, 4
/* 131F8 80037DF8 80A40071 */ lb $a0, 0x71($a1)
/* 131FC 80037DFC 96230000 */ lhu $v1, ($s1)
/* 13200 80037E00 50820001 */ beql $a0, $v0, .L80037E08
/* 13204 80037E04 24030003 */ addiu $v1, $zero, 3
.L80037E08:
/* 13208 80037E08 24020005 */ addiu $v0, $zero, 5
/* 1320C 80037E0C 50820001 */ beql $a0, $v0, .L80037E14
/* 13210 80037E10 24030004 */ addiu $v1, $zero, 4
.L80037E14:
/* 13214 80037E14 00031400 */ sll $v0, $v1, 0x10
/* 13218 80037E18 00021C03 */ sra $v1, $v0, 0x10
/* 1321C 80037E1C 2C620005 */ sltiu $v0, $v1, 5
/* 13220 80037E20 104000AC */ beqz $v0, .L800380D4
/* 13224 80037E24 00031080 */ sll $v0, $v1, 2
/* 13228 80037E28 3C01800A */ lui $at, %hi(D_80098440)
/* 1322C 80037E2C 00220821 */ addu $at, $at, $v0
/* 13230 80037E30 8C228440 */ lw $v0, %lo(D_80098440)($at)
/* 13234 80037E34 00400008 */ jr $v0
/* 13238 80037E38 00000000 */ nop
/* 1323C 80037E3C 0C00CD18 */ jal func_80033460
/* 13240 80037E40 240400FF */ addiu $a0, $zero, 0xff
/* 13244 80037E44 0C00CD1C */ jal func_80033470
/* 13248 80037E48 240400E0 */ addiu $a0, $zero, 0xe0
/* 1324C 80037E4C 3C108007 */ lui $s0, %hi(D_8007417C)
/* 13250 80037E50 2610417C */ addiu $s0, $s0, %lo(D_8007417C)
/* 13254 80037E54 8E030000 */ lw $v1, ($s0)
/* 13258 80037E58 24020003 */ addiu $v0, $zero, 3
/* 1325C 80037E5C A06200AC */ sb $v0, 0xac($v1)
/* 13260 80037E60 3C03800A */ lui $v1, %hi(D_8009A630)
/* 13264 80037E64 2463A630 */ addiu $v1, $v1, %lo(D_8009A630)
/* 13268 80037E68 8C620000 */ lw $v0, ($v1)
/* 1326C 80037E6C 34420008 */ ori $v0, $v0, 8
/* 13270 80037E70 0C00CD41 */ jal func_80033504
/* 13274 80037E74 AC620000 */ sw $v0, ($v1)
/* 13278 80037E78 8E030000 */ lw $v1, ($s0)
/* 1327C 80037E7C 24020005 */ addiu $v0, $zero, 5
/* 13280 80037E80 0800E035 */ j .L800380D4
/* 13284 80037E84 A0620071 */ sb $v0, 0x71($v1)
/* 13288 80037E88 3C108007 */ lui $s0, %hi(D_8007417C)
/* 1328C 80037E8C 2610417C */ addiu $s0, $s0, %lo(D_8007417C)
/* 13290 80037E90 8E040000 */ lw $a0, ($s0)
/* 13294 80037E94 808200AC */ lb $v0, 0xac($a0)
/* 13298 80037E98 908300AC */ lbu $v1, 0xac($a0)
/* 1329C 80037E9C 10400006 */ beqz $v0, .L80037EB8
/* 132A0 80037EA0 2462FFFF */ addiu $v0, $v1, -1
/* 132A4 80037EA4 A08200AC */ sb $v0, 0xac($a0)
/* 132A8 80037EA8 8E020000 */ lw $v0, ($s0)
/* 132AC 80037EAC 804200AC */ lb $v0, 0xac($v0)
/* 132B0 80037EB0 14400094 */ bnez $v0, .L80038104
/* 132B4 80037EB4 00000000 */ nop
.L80037EB8:
/* 132B8 80037EB8 8E020000 */ lw $v0, ($s0)
/* 132BC 80037EBC A0400072 */ sb $zero, 0x72($v0)
/* 132C0 80037EC0 8E020000 */ lw $v0, ($s0)
/* 132C4 80037EC4 A0400071 */ sb $zero, 0x71($v0)
/* 132C8 80037EC8 8E020000 */ lw $v0, ($s0)
/* 132CC 80037ECC 0C0157AD */ jal func_80055EB4
/* 132D0 80037ED0 A040007E */ sb $zero, 0x7e($v0)
/* 132D4 80037ED4 8E020000 */ lw $v0, ($s0)
/* 132D8 80037ED8 A0400070 */ sb $zero, 0x70($v0)
/* 132DC 80037EDC 8E020000 */ lw $v0, ($s0)
/* 132E0 80037EE0 A0400076 */ sb $zero, 0x76($v0)
/* 132E4 80037EE4 8E020000 */ lw $v0, ($s0)
/* 132E8 80037EE8 A0400078 */ sb $zero, 0x78($v0)
/* 132EC 80037EEC 8E020000 */ lw $v0, ($s0)
/* 132F0 80037EF0 3C04800A */ lui $a0, %hi(D_8009A630)
/* 132F4 80037EF4 2484A630 */ addiu $a0, $a0, %lo(D_8009A630)
/* 132F8 80037EF8 A040007D */ sb $zero, 0x7d($v0)
/* 132FC 80037EFC 8C820000 */ lw $v0, ($a0)
/* 13300 80037F00 2403FFF7 */ addiu $v1, $zero, -9
/* 13304 80037F04 00431024 */ and $v0, $v0, $v1
/* 13308 80037F08 0C00AAF0 */ jal func_8002ABC0
/* 1330C 80037F0C AC820000 */ sw $v0, ($a0)
/* 13310 80037F10 0C048AA8 */ jal func_80122AA0
/* 13314 80037F14 00000000 */ nop
/* 13318 80037F18 0C04A0B2 */ jal func_801282C8
/* 1331C 80037F1C 00000000 */ nop
/* 13320 80037F20 0C0B0C77 */ jal func_802C31DC
/* 13324 80037F24 00000000 */ nop
/* 13328 80037F28 0C00B6E1 */ jal func_8002DB84
/* 1332C 80037F2C 00000000 */ nop
/* 13330 80037F30 0C044512 */ jal func_80111448
/* 13334 80037F34 0000202D */ daddu $a0, $zero, $zero
/* 13338 80037F38 0C049770 */ jal func_80125DC0
/* 1333C 80037F3C 00000000 */ nop
/* 13340 80037F40 0C048D0D */ jal func_80123434
/* 13344 80037F44 00000000 */ nop
/* 13348 80037F48 0C046BD5 */ jal func_8011AF54
/* 1334C 80037F4C 00000000 */ nop
/* 13350 80037F50 0C05343C */ jal func_8014D0F0
/* 13354 80037F54 00000000 */ nop
/* 13358 80037F58 0C052BAA */ jal func_8014AEA8
/* 1335C 80037F5C 00000000 */ nop
/* 13360 80037F60 0C05186C */ jal func_801461B0
/* 13364 80037F64 00000000 */ nop
/* 13368 80037F68 0C0529CC */ jal func_8014A730
/* 1336C 80037F6C 00000000 */ nop
/* 13370 80037F70 0C04A221 */ jal func_80128884
/* 13374 80037F74 00000000 */ nop
/* 13378 80037F78 0C0457B2 */ jal func_80115EC8
/* 1337C 80037F7C 0000202D */ daddu $a0, $zero, $zero
/* 13380 80037F80 0C04F46E */ jal func_8013D1B8
/* 13384 80037F84 00000000 */ nop
/* 13388 80037F88 0C037F0C */ jal func_800DFC30
/* 1338C 80037F8C 00000000 */ nop
/* 13390 80037F90 0C00E05F */ jal func_8003817C
/* 13394 80037F94 00000000 */ nop
/* 13398 80037F98 0C039CD0 */ jal func_800E7340
/* 1339C 80037F9C 00000000 */ nop
/* 133A0 80037FA0 0C01CAC4 */ jal func_80072B10
/* 133A4 80037FA4 00000000 */ nop
/* 133A8 80037FA8 0C00F7FE */ jal func_8003DFF8
/* 133AC 80037FAC 00000000 */ nop
/* 133B0 80037FB0 0C016653 */ jal func_8005994C
/* 133B4 80037FB4 00000000 */ nop
/* 133B8 80037FB8 0C04D85C */ jal func_80136170
/* 133BC 80037FBC 00000000 */ nop
/* 133C0 80037FC0 0C0528F4 */ jal func_8014A3D0
/* 133C4 80037FC4 00000000 */ nop
/* 133C8 80037FC8 0C016B11 */ jal func_8005AC44
/* 133CC 80037FCC 00000000 */ nop
/* 133D0 80037FD0 0C00CC60 */ jal func_80033180
/* 133D4 80037FD4 24040002 */ addiu $a0, $zero, 2
/* 133D8 80037FD8 0800E041 */ j .L80038104
/* 133DC 80037FDC 00000000 */ nop
/* 133E0 80037FE0 27A50018 */ addiu $a1, $sp, 0x18
/* 133E4 80037FE4 8E240008 */ lw $a0, 8($s1)
/* 133E8 80037FE8 0C016A2C */ jal func_8005A8B0
/* 133EC 80037FEC 27A6001A */ addiu $a2, $sp, 0x1a
/* 133F0 80037FF0 0000202D */ daddu $a0, $zero, $zero
/* 133F4 80037FF4 2405001D */ addiu $a1, $zero, 0x1d
/* 133F8 80037FF8 3C108007 */ lui $s0, %hi(D_8007417C)
/* 133FC 80037FFC 2610417C */ addiu $s0, $s0, %lo(D_8007417C)
/* 13400 80038000 8E020000 */ lw $v0, ($s0)
/* 13404 80038004 97A30018 */ lhu $v1, 0x18($sp)
/* 13408 80038008 97A7001A */ lhu $a3, 0x1a($sp)
/* 1340C 8003800C 24060014 */ addiu $a2, $zero, 0x14
/* 13410 80038010 A4430086 */ sh $v1, 0x86($v0)
/* 13414 80038014 A447008C */ sh $a3, 0x8c($v0)
/* 13418 80038018 96230002 */ lhu $v1, 2($s1)
/* 1341C 8003801C 2407FEFA */ addiu $a3, $zero, -0x106
/* 13420 80038020 A040007E */ sb $zero, 0x7e($v0)
/* 13424 80038024 0800E01E */ j .L80038078
/* 13428 80038028 A443008E */ sh $v1, 0x8e($v0)
/* 1342C 8003802C 27A50018 */ addiu $a1, $sp, 0x18
/* 13430 80038030 8E240008 */ lw $a0, 8($s1)
/* 13434 80038034 0C016A2C */ jal func_8005A8B0
/* 13438 80038038 27A6001A */ addiu $a2, $sp, 0x1a
/* 1343C 8003803C 0000202D */ daddu $a0, $zero, $zero
/* 13440 80038040 2405001D */ addiu $a1, $zero, 0x1d
/* 13444 80038044 24060014 */ addiu $a2, $zero, 0x14
/* 13448 80038048 3C108007 */ lui $s0, %hi(D_8007417C)
/* 1344C 8003804C 2610417C */ addiu $s0, $s0, %lo(D_8007417C)
/* 13450 80038050 8E030000 */ lw $v1, ($s0)
/* 13454 80038054 97A20018 */ lhu $v0, 0x18($sp)
/* 13458 80038058 97A8001A */ lhu $t0, 0x1a($sp)
/* 1345C 8003805C 2407FEFA */ addiu $a3, $zero, -0x106
/* 13460 80038060 A4620086 */ sh $v0, 0x86($v1)
/* 13464 80038064 A468008C */ sh $t0, 0x8c($v1)
/* 13468 80038068 96280002 */ lhu $t0, 2($s1)
/* 1346C 8003806C 24020001 */ addiu $v0, $zero, 1
/* 13470 80038070 A062007E */ sb $v0, 0x7e($v1)
/* 13474 80038074 A468008E */ sh $t0, 0x8e($v1)
.L80038078:
/* 13478 80038078 92230005 */ lbu $v1, 5($s1)
/* 1347C 8003807C 240200B1 */ addiu $v0, $zero, 0xb1
/* 13480 80038080 AFA20010 */ sw $v0, 0x10($sp)
/* 13484 80038084 0C00B7E9 */ jal func_8002DFA4
/* 13488 80038088 A2430012 */ sb $v1, 0x12($s2)
/* 1348C 8003808C 0000202D */ daddu $a0, $zero, $zero
/* 13490 80038090 3C05F5DE */ lui $a1, 0xf5de
/* 13494 80038094 82260006 */ lb $a2, 6($s1)
/* 13498 80038098 0C0B2026 */ jal func_802C8098
/* 1349C 8003809C 34A50180 */ ori $a1, $a1, 0x180
/* 134A0 800380A0 8E020000 */ lw $v0, ($s0)
/* 134A4 800380A4 80420072 */ lb $v0, 0x72($v0)
/* 134A8 800380A8 14400002 */ bnez $v0, .L800380B4
/* 134AC 800380AC 24040002 */ addiu $a0, $zero, 2
/* 134B0 800380B0 24040003 */ addiu $a0, $zero, 3
.L800380B4:
/* 134B4 800380B4 0C04F4D4 */ jal func_8013D350
/* 134B8 800380B8 00000000 */ nop
/* 134BC 800380BC 0C00CC60 */ jal func_80033180
/* 134C0 800380C0 24040003 */ addiu $a0, $zero, 3
/* 134C4 800380C4 0800E035 */ j .L800380D4
/* 134C8 800380C8 00000000 */ nop
/* 134CC 800380CC 0C01CB7D */ jal func_80072DF4
/* 134D0 800380D0 96240002 */ lhu $a0, 2($s1)
.L800380D4:
/* 134D4 800380D4 3C048007 */ lui $a0, %hi(D_8007417C)
/* 134D8 800380D8 2484417C */ addiu $a0, $a0, %lo(D_8007417C)
/* 134DC 800380DC 8C830000 */ lw $v1, ($a0)
/* 134E0 800380E0 90620072 */ lbu $v0, 0x72($v1)
/* 134E4 800380E4 24420001 */ addiu $v0, $v0, 1
/* 134E8 800380E8 A0620072 */ sb $v0, 0x72($v1)
/* 134EC 800380EC 8C840000 */ lw $a0, ($a0)
/* 134F0 800380F0 80820072 */ lb $v0, 0x72($a0)
/* 134F4 800380F4 28420013 */ slti $v0, $v0, 0x13
/* 134F8 800380F8 14400002 */ bnez $v0, .L80038104
/* 134FC 800380FC 24020012 */ addiu $v0, $zero, 0x12
/* 13500 80038100 A0820072 */ sb $v0, 0x72($a0)
.L80038104:
/* 13504 80038104 8FBF002C */ lw $ra, 0x2c($sp)
/* 13508 80038108 8FB20028 */ lw $s2, 0x28($sp)
/* 1350C 8003810C 8FB10024 */ lw $s1, 0x24($sp)
/* 13510 80038110 8FB00020 */ lw $s0, 0x20($sp)
/* 13514 80038114 03E00008 */ jr $ra
/* 13518 80038118 27BD0030 */ addiu $sp, $sp, 0x30