aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/psxgpu/addprim.s
diff options
context:
space:
mode:
authorJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-04-06 10:11:07 +0800
committerJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-04-06 10:11:07 +0800
commitf3e040230772f978540a71aea43dfde200992922 (patch)
treebd8ca31b72dd01e24980b073854e263589530f56 /libpsn00b/psxgpu/addprim.s
downloadpsn00bsdk-f3e040230772f978540a71aea43dfde200992922.tar.gz
First commit
Diffstat (limited to 'libpsn00b/psxgpu/addprim.s')
-rw-r--r--libpsn00b/psxgpu/addprim.s26
1 files changed, 26 insertions, 0 deletions
diff --git a/libpsn00b/psxgpu/addprim.s b/libpsn00b/psxgpu/addprim.s
new file mode 100644
index 0000000..1b66274
--- /dev/null
+++ b/libpsn00b/psxgpu/addprim.s
@@ -0,0 +1,26 @@
+.set noreorder
+.set noat
+
+.section .text
+
+
+.global AddPrim
+.type AddPrim, @function
+AddPrim:
+
+ lw $v0, 0($a0) # Load OT entry
+ lw $v1, 0($a1) # Set packet length value (in words)
+ lui $at, 0x00ff
+ or $at, 0xffff
+ and $v0, $at # Mask off the upper 8 bits of OT entry
+ or $v1, $v0 # OR values together
+ sw $v1, 0($a1) # Store new address to primitive tag
+ lw $v0, 0($a0) # Load OT entry
+ and $a1, $at # Mask off the upper 8 bits of primitive tag
+ lui $at, 0xff00
+ and $v0, $at # Mask off the first 24 bits of OT entry
+ or $v0, $a1 # OR values together
+
+ jr $ra
+ sw $v0, 0($a0) # Store result to OT
+