1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 12:54:51 +00:00
oot/asm/code_800D71F0.s
Tharo 7334ffa373
Improve the state of handwritten assembly files (#865)
* Format all handwritten asm and document some

* Use c preprocessor for constants

* Fix

* Fix PI_STATUS_ERROR, some label improvements

* Avoid hi/lo for constants

* Some more comments

* Properly mark functions as functions and their sizes

* Fix merge

* Improvements

* Review suggestions, rework procedure start/end macros to be more like libreultra

* Move IPL3 symbol definitions into ipl3.s

* Fix undefined_syms, add include and language guards to asm.h and fix the comment in gbi.h

* Consistent hex capitalization, add some MIPS builtin defines to CC_CHECK to behave properly

* Add -no-pad-sections assembler option and clean up alignment in gu files and bzero

* Further suggestions and improvements

* Matrix conversion function clarifications

* Fix passing AVOID_UB to gcc

* Suggestions

* Suggestions, global interrupt mask improvements

* Further suggestions, interrupt mask comments

* Comments fixes, rdb.h

* Switch from # comments to // comments, remove unnecesary .set gp=64 directives

* Further review suggestions

* Missed one
2022-05-01 01:03:22 +02:00

58 lines
1.1 KiB
ArmAsm

#include "ultra64/asm.h"
.set noat
.set noreorder
.section .text
.balign 16
LEAF(func_800D71F0)
li $at, 0x8800
slt $at, $a0, $at
bnez $at, .L800D723C
li $a2, 188
srl $a1, $a0, 8
addi $a1, $a1, -0x88
multu $a2, $a1
andi $a3, $a0, 0xFF
addi $a3, $a3, -0x40
slti $at, $a3, 0x40
mflo $a2
bnezl $at, .L800D722C
mflo $a2
addi $a3, $a3, -1
mflo $a2
.L800D722C:
addi $a3, $a3, 0x30A
add $a3, $a3, $a2
jr $ra
sll $v0, $a3, 7
.L800D723C:
srl $a1, $a0, 8
addi $a1, $a1, -0x81
multu $a2, $a1
andi $a3, $a0, 0xFF
addi $a3, $a3, -0x40
slti $at, $a3, 0x40
mflo $a2
bnezl $at, .L800D7268
mflo $a2
addi $a3, $a3, -1
mflo $a2
.L800D7268:
add $a3, $a3, $a2
lui $a2, %hi(D_800D7288)
sll $a3, $a3, 1
addiu $a2, %lo(D_800D7288)
add $a3, $a3, $a2
lh $a2, ($a3)
jr $ra
sll $v0, $a2, 7
END(func_800D71F0)
DATA(D_800D7288)
.incbin "baserom.z64", 0xB4E428, 0xB4EE70 - 0xB4E428
ENDDATA(D_800D7288)