aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/psxgpu/drawsync.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/drawsync.s
downloadpsn00bsdk-f3e040230772f978540a71aea43dfde200992922.tar.gz
First commit
Diffstat (limited to 'libpsn00b/psxgpu/drawsync.s')
-rw-r--r--libpsn00b/psxgpu/drawsync.s26
1 files changed, 26 insertions, 0 deletions
diff --git a/libpsn00b/psxgpu/drawsync.s b/libpsn00b/psxgpu/drawsync.s
new file mode 100644
index 0000000..149519d
--- /dev/null
+++ b/libpsn00b/psxgpu/drawsync.s
@@ -0,0 +1,26 @@
+.set noreorder
+
+.include "hwregs_a.h"
+
+.section .text
+
+
+.global DrawSync
+.type DrawSync, @function
+DrawSync:
+ addiu $sp, -4
+ sw $ra, 0($sp)
+
+.gpu_wait: # Wait for GPU to be ready for commands and DMA
+ jal ReadGPUstat
+ nop
+ srl $v0, 0x1a
+ andi $v0, 0x5
+ li $v1, 5
+ bne $v0, $v1, .gpu_wait
+ nop
+
+ lw $ra, 0($sp)
+ addiu $sp, 4
+ jr $ra
+ nop