papermario/ver/jp/asm/nonmatchings/42B0/func_80029394.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

63 lines
3.0 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80029394
/* 4794 80029394 3C06B60B */ lui $a2, 0xb60b
/* 4798 80029398 34C660B7 */ ori $a2, $a2, 0x60b7
/* 479C 8002939C 00042400 */ sll $a0, $a0, 0x10
/* 47A0 800293A0 00042C03 */ sra $a1, $a0, 0x10
/* 47A4 800293A4 00A60018 */ mult $a1, $a2
/* 47A8 800293A8 000427C3 */ sra $a0, $a0, 0x1f
/* 47AC 800293AC 00003810 */ mfhi $a3
/* 47B0 800293B0 00E51021 */ addu $v0, $a3, $a1
/* 47B4 800293B4 00021203 */ sra $v0, $v0, 8
/* 47B8 800293B8 00441023 */ subu $v0, $v0, $a0
/* 47BC 800293BC 00021840 */ sll $v1, $v0, 1
/* 47C0 800293C0 00621821 */ addu $v1, $v1, $v0
/* 47C4 800293C4 00031100 */ sll $v0, $v1, 4
/* 47C8 800293C8 00431023 */ subu $v0, $v0, $v1
/* 47CC 800293CC 000210C0 */ sll $v0, $v0, 3
/* 47D0 800293D0 00A22823 */ subu $a1, $a1, $v0
/* 47D4 800293D4 00051400 */ sll $v0, $a1, 0x10
/* 47D8 800293D8 04410002 */ bgez $v0, .L800293E4
/* 47DC 800293DC 00A0182D */ daddu $v1, $a1, $zero
/* 47E0 800293E0 24A30168 */ addiu $v1, $a1, 0x168
.L800293E4:
/* 47E4 800293E4 00031C00 */ sll $v1, $v1, 0x10
/* 47E8 800293E8 00032C03 */ sra $a1, $v1, 0x10
/* 47EC 800293EC 00A60018 */ mult $a1, $a2
/* 47F0 800293F0 00031FC3 */ sra $v1, $v1, 0x1f
/* 47F4 800293F4 00003810 */ mfhi $a3
/* 47F8 800293F8 00E51021 */ addu $v0, $a3, $a1
/* 47FC 800293FC 000211C3 */ sra $v0, $v0, 7
/* 4800 80029400 00431023 */ subu $v0, $v0, $v1
/* 4804 80029404 00021840 */ sll $v1, $v0, 1
/* 4808 80029408 00621821 */ addu $v1, $v1, $v0
/* 480C 8002940C 00031100 */ sll $v0, $v1, 4
/* 4810 80029410 00431023 */ subu $v0, $v0, $v1
/* 4814 80029414 00021080 */ sll $v0, $v0, 2
/* 4818 80029418 00A21823 */ subu $v1, $a1, $v0
/* 481C 8002941C 00031400 */ sll $v0, $v1, 0x10
/* 4820 80029420 00021403 */ sra $v0, $v0, 0x10
/* 4824 80029424 2842005B */ slti $v0, $v0, 0x5b
/* 4828 80029428 14400003 */ bnez $v0, .L80029438
/* 482C 8002942C 0060202D */ daddu $a0, $v1, $zero
/* 4830 80029430 240200B4 */ addiu $v0, $zero, 0xb4
/* 4834 80029434 00432023 */ subu $a0, $v0, $v1
.L80029438:
/* 4838 80029438 28A200B4 */ slti $v0, $a1, 0xb4
/* 483C 8002943C 10400006 */ beqz $v0, .L80029458
/* 4840 80029440 00041400 */ sll $v0, $a0, 0x10
/* 4844 80029444 00021383 */ sra $v0, $v0, 0xe
/* 4848 80029448 3C018007 */ lui $at, %hi(D_80074254)
/* 484C 8002944C 00220821 */ addu $at, $at, $v0
/* 4850 80029450 03E00008 */ jr $ra
/* 4854 80029454 C4204254 */ lwc1 $f0, %lo(D_80074254)($at)
.L80029458:
/* 4858 80029458 00021383 */ sra $v0, $v0, 0xe
/* 485C 8002945C 3C018007 */ lui $at, %hi(D_80074254)
/* 4860 80029460 00220821 */ addu $at, $at, $v0
/* 4864 80029464 C4204254 */ lwc1 $f0, %lo(D_80074254)($at)
/* 4868 80029468 03E00008 */ jr $ra
/* 486C 8002946C 46000007 */ neg.s $f0, $f0