papermario/ver/us/asm/nonmatchings/os/44b40_len_a90/osGetId.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

127 lines
6.3 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel osGetId
/* 45008 80069C08 27BDFF98 */ addiu $sp, $sp, -0x68
/* 4500C 80069C0C AFB00058 */ sw $s0, 0x58($sp)
/* 45010 80069C10 00808021 */ addu $s0, $a0, $zero
/* 45014 80069C14 AFBF0060 */ sw $ra, 0x60($sp)
/* 45018 80069C18 AFB1005C */ sw $s1, 0x5c($sp)
/* 4501C 80069C1C 92020065 */ lbu $v0, 0x65($s0)
/* 45020 80069C20 10400006 */ beqz $v0, .L80069C3C
/* 45024 80069C24 00000000 */ nop
/* 45028 80069C28 0C01A5B4 */ jal osPfsSelectBank
/* 4502C 80069C2C 00002821 */ addu $a1, $zero, $zero
/* 45030 80069C30 00401821 */ addu $v1, $v0, $zero
/* 45034 80069C34 14600062 */ bnez $v1, .L80069DC0
/* 45038 80069C38 00000000 */ nop
.L80069C3C:
/* 4503C 80069C3C 8E040004 */ lw $a0, 4($s0)
/* 45040 80069C40 8E050008 */ lw $a1, 8($s0)
/* 45044 80069C44 24060001 */ addiu $a2, $zero, 1
/* 45048 80069C48 0C01A874 */ jal osContRamRead
/* 4504C 80069C4C 27A70010 */ addiu $a3, $sp, 0x10
/* 45050 80069C50 00401821 */ addu $v1, $v0, $zero
/* 45054 80069C54 1460005A */ bnez $v1, .L80069DC0
/* 45058 80069C58 27A50010 */ addiu $a1, $sp, 0x10
/* 4505C 80069C5C 27A7002C */ addiu $a3, $sp, 0x2c
/* 45060 80069C60 A7A00052 */ sh $zero, 0x52($sp)
/* 45064 80069C64 A7A00050 */ sh $zero, 0x50($sp)
.L80069C68:
/* 45068 80069C68 94A20000 */ lhu $v0, ($a1)
/* 4506C 80069C6C 97A30050 */ lhu $v1, 0x50($sp)
/* 45070 80069C70 97A40052 */ lhu $a0, 0x52($sp)
/* 45074 80069C74 24A50002 */ addiu $a1, $a1, 2
/* 45078 80069C78 00623021 */ addu $a2, $v1, $v0
/* 4507C 80069C7C 00021027 */ nor $v0, $zero, $v0
/* 45080 80069C80 00822021 */ addu $a0, $a0, $v0
/* 45084 80069C84 00A7102B */ sltu $v0, $a1, $a3
/* 45088 80069C88 A7A60050 */ sh $a2, 0x50($sp)
/* 4508C 80069C8C 1440FFF6 */ bnez $v0, .L80069C68
/* 45090 80069C90 A7A40052 */ sh $a0, 0x52($sp)
/* 45094 80069C94 97A3002C */ lhu $v1, 0x2c($sp)
/* 45098 80069C98 30C2FFFF */ andi $v0, $a2, 0xffff
/* 4509C 80069C9C 14620005 */ bne $v1, $v0, .L80069CB4
/* 450A0 80069CA0 27B10010 */ addiu $s1, $sp, 0x10
/* 450A4 80069CA4 97A3002E */ lhu $v1, 0x2e($sp)
/* 450A8 80069CA8 3082FFFF */ andi $v0, $a0, 0xffff
/* 450AC 80069CAC 10620013 */ beq $v1, $v0, .L80069CFC
/* 450B0 80069CB0 00000000 */ nop
.L80069CB4:
/* 450B4 80069CB4 02002021 */ addu $a0, $s0, $zero
/* 450B8 80069CB8 0C01A6A9 */ jal osCheckPackId
/* 450BC 80069CBC 02202821 */ addu $a1, $s1, $zero
/* 450C0 80069CC0 00401821 */ addu $v1, $v0, $zero
/* 450C4 80069CC4 2402000A */ addiu $v0, $zero, 0xa
/* 450C8 80069CC8 1462000A */ bne $v1, $v0, .L80069CF4
/* 450CC 80069CCC 02002021 */ addu $a0, $s0, $zero
/* 450D0 80069CD0 02202821 */ addu $a1, $s1, $zero
/* 450D4 80069CD4 27B10030 */ addiu $s1, $sp, 0x30
/* 450D8 80069CD8 0C01A5EE */ jal osRepairPackId
/* 450DC 80069CDC 02203021 */ addu $a2, $s1, $zero
/* 450E0 80069CE0 00401821 */ addu $v1, $v0, $zero
/* 450E4 80069CE4 10600005 */ beqz $v1, .L80069CFC
/* 450E8 80069CE8 00000000 */ nop
/* 450EC 80069CEC 0801A770 */ j .L80069DC0
/* 450F0 80069CF0 00000000 */ nop
.L80069CF4:
/* 450F4 80069CF4 14600032 */ bnez $v1, .L80069DC0
/* 450F8 80069CF8 00601021 */ addu $v0, $v1, $zero
.L80069CFC:
/* 450FC 80069CFC 96220018 */ lhu $v0, 0x18($s1)
/* 45100 80069D00 30420001 */ andi $v0, $v0, 1
/* 45104 80069D04 1440000F */ bnez $v0, .L80069D44
/* 45108 80069D08 02202021 */ addu $a0, $s1, $zero
/* 4510C 80069D0C 02002021 */ addu $a0, $s0, $zero
/* 45110 80069D10 02202821 */ addu $a1, $s1, $zero
/* 45114 80069D14 27B10030 */ addiu $s1, $sp, 0x30
/* 45118 80069D18 0C01A5EE */ jal osRepairPackId
/* 4511C 80069D1C 02203021 */ addu $a2, $s1, $zero
/* 45120 80069D20 00401821 */ addu $v1, $v0, $zero
/* 45124 80069D24 14600026 */ bnez $v1, .L80069DC0
/* 45128 80069D28 00000000 */ nop
/* 4512C 80069D2C 97A20048 */ lhu $v0, 0x48($sp)
/* 45130 80069D30 30420001 */ andi $v0, $v0, 1
/* 45134 80069D34 14400003 */ bnez $v0, .L80069D44
/* 45138 80069D38 02202021 */ addu $a0, $s1, $zero
/* 4513C 80069D3C 0801A770 */ j .L80069DC0
/* 45140 80069D40 2402000B */ addiu $v0, $zero, 0xb
.L80069D44:
/* 45144 80069D44 2605000C */ addiu $a1, $s0, 0xc
/* 45148 80069D48 0C019194 */ jal bcopy
/* 4514C 80069D4C 24060020 */ addiu $a2, $zero, 0x20
/* 45150 80069D50 8E040004 */ lw $a0, 4($s0)
/* 45154 80069D54 8E050008 */ lw $a1, 8($s0)
/* 45158 80069D58 9222001B */ lbu $v0, 0x1b($s1)
/* 4515C 80069D5C 24060007 */ addiu $a2, $zero, 7
/* 45160 80069D60 AE02004C */ sw $v0, 0x4c($s0)
/* 45164 80069D64 9223001A */ lbu $v1, 0x1a($s1)
/* 45168 80069D68 2607002C */ addiu $a3, $s0, 0x2c
/* 4516C 80069D6C 24020010 */ addiu $v0, $zero, 0x10
/* 45170 80069D70 AE020050 */ sw $v0, 0x50($s0)
/* 45174 80069D74 24020008 */ addiu $v0, $zero, 8
/* 45178 80069D78 AE020054 */ sw $v0, 0x54($s0)
/* 4517C 80069D7C A2030064 */ sb $v1, 0x64($s0)
/* 45180 80069D80 92020064 */ lbu $v0, 0x64($s0)
/* 45184 80069D84 00031840 */ sll $v1, $v1, 1
/* 45188 80069D88 24630003 */ addiu $v1, $v1, 3
/* 4518C 80069D8C AE030060 */ sw $v1, 0x60($s0)
/* 45190 80069D90 92030064 */ lbu $v1, 0x64($s0)
/* 45194 80069D94 24420001 */ addiu $v0, $v0, 1
/* 45198 80069D98 000210C0 */ sll $v0, $v0, 3
/* 4519C 80069D9C 000318C0 */ sll $v1, $v1, 3
/* 451A0 80069DA0 AE020058 */ sw $v0, 0x58($s0)
/* 451A4 80069DA4 00431021 */ addu $v0, $v0, $v1
/* 451A8 80069DA8 0C01A874 */ jal osContRamRead
/* 451AC 80069DAC AE02005C */ sw $v0, 0x5c($s0)
/* 451B0 80069DB0 00401821 */ addu $v1, $v0, $zero
/* 451B4 80069DB4 0003102B */ sltu $v0, $zero, $v1
/* 451B8 80069DB8 00021023 */ negu $v0, $v0
/* 451BC 80069DBC 00621024 */ and $v0, $v1, $v0
.L80069DC0:
/* 451C0 80069DC0 8FBF0060 */ lw $ra, 0x60($sp)
/* 451C4 80069DC4 8FB1005C */ lw $s1, 0x5c($sp)
/* 451C8 80069DC8 8FB00058 */ lw $s0, 0x58($sp)
/* 451CC 80069DCC 03E00008 */ jr $ra
/* 451D0 80069DD0 27BD0068 */ addiu $sp, $sp, 0x68