papermario/ver/us/asm/nonmatchings/43F0/_heap_malloc_tail.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

57 lines
2.5 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel _heap_malloc_tail
/* 4564 80029164 24A5000F */ addiu $a1, $a1, 0xf
/* 4568 80029168 2402FFF0 */ addiu $v0, $zero, -0x10
/* 456C 8002916C 00A22824 */ and $a1, $a1, $v0
/* 4570 80029170 14A00003 */ bnez $a1, .L80029180
/* 4574 80029174 0000402D */ daddu $t0, $zero, $zero
/* 4578 80029178 03E00008 */ jr $ra
/* 457C 8002917C 0100102D */ daddu $v0, $t0, $zero
.L80029180:
/* 4580 80029180 0000302D */ daddu $a2, $zero, $zero
/* 4584 80029184 00C0382D */ daddu $a3, $a2, $zero
.L80029188:
/* 4588 80029188 94820008 */ lhu $v0, 8($a0)
/* 458C 8002918C 14400008 */ bnez $v0, .L800291B0
/* 4590 80029190 00000000 */ nop
/* 4594 80029194 8C830004 */ lw $v1, 4($a0)
/* 4598 80029198 0065102B */ sltu $v0, $v1, $a1
/* 459C 8002919C 14400004 */ bnez $v0, .L800291B0
/* 45A0 800291A0 00000000 */ nop
/* 45A4 800291A4 0080402D */ daddu $t0, $a0, $zero
/* 45A8 800291A8 0060302D */ daddu $a2, $v1, $zero
/* 45AC 800291AC 8C870000 */ lw $a3, ($a0)
.L800291B0:
/* 45B0 800291B0 8C840000 */ lw $a0, ($a0)
/* 45B4 800291B4 1480FFF4 */ bnez $a0, .L80029188
/* 45B8 800291B8 00000000 */ nop
/* 45BC 800291BC 10C00015 */ beqz $a2, .L80029214
/* 45C0 800291C0 24A30010 */ addiu $v1, $a1, 0x10
/* 45C4 800291C4 00C3102B */ sltu $v0, $a2, $v1
/* 45C8 800291C8 1440000C */ bnez $v0, .L800291FC
/* 45CC 800291CC 0100202D */ daddu $a0, $t0, $zero
/* 45D0 800291D0 00861021 */ addu $v0, $a0, $a2
/* 45D4 800291D4 00451023 */ subu $v0, $v0, $a1
/* 45D8 800291D8 AC820000 */ sw $v0, ($a0)
/* 45DC 800291DC 00C31023 */ subu $v0, $a2, $v1
/* 45E0 800291E0 AC820004 */ sw $v0, 4($a0)
/* 45E4 800291E4 A4800008 */ sh $zero, 8($a0)
/* 45E8 800291E8 8C840000 */ lw $a0, ($a0)
/* 45EC 800291EC 24020001 */ addiu $v0, $zero, 1
/* 45F0 800291F0 AC870000 */ sw $a3, ($a0)
/* 45F4 800291F4 0800A482 */ j .L80029208
/* 45F8 800291F8 AC850004 */ sw $a1, 4($a0)
.L800291FC:
/* 45FC 800291FC 24020001 */ addiu $v0, $zero, 1
/* 4600 80029200 AC870000 */ sw $a3, ($a0)
/* 4604 80029204 AC860004 */ sw $a2, 4($a0)
.L80029208:
/* 4608 80029208 A4820008 */ sh $v0, 8($a0)
/* 460C 8002920C 03E00008 */ jr $ra
/* 4610 80029210 24820010 */ addiu $v0, $a0, 0x10
.L80029214:
/* 4614 80029214 03E00008 */ jr $ra
/* 4618 80029218 0000102D */ daddu $v0, $zero, $zero