diff options
| author | John Wilbert M. Villamor <lameguy64@gmail.com> | 2019-06-23 07:42:16 +0800 |
|---|---|---|
| committer | John Wilbert M. Villamor <lameguy64@gmail.com> | 2019-06-23 07:42:16 +0800 |
| commit | 7be9178c0f9b0e698a305ecc5c0c41fcc596a4fc (patch) | |
| tree | e98c627e1da5c764563774b89b0c06d7ac5ad0a4 /libpsn00b/psxgpu/drawprim.s | |
| parent | ae9e545c3ed33d39ce21ae13ceb8337fa34901b8 (diff) | |
| download | psn00bsdk-7be9178c0f9b0e698a305ecc5c0c41fcc596a4fc.tar.gz | |
LibPSn00b officially v0.10b, added psxsio library, better DrawSync() and VSync(), better reference manual.
Diffstat (limited to 'libpsn00b/psxgpu/drawprim.s')
| -rw-r--r-- | libpsn00b/psxgpu/drawprim.s | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libpsn00b/psxgpu/drawprim.s b/libpsn00b/psxgpu/drawprim.s new file mode 100644 index 0000000..a216720 --- /dev/null +++ b/libpsn00b/psxgpu/drawprim.s @@ -0,0 +1,40 @@ +.set noreorder + +.include "hwregs_a.h" + +.text + +.global DrawPrim +.type DrawPrim, @function +DrawPrim: + + addiu $sp, -8 + sw $ra, 0($sp) + sw $s0, 4($sp) + + move $s0, $a0 # Wait for GPU to complete + jal DrawSync + move $a0, $0 + + lui $a3, IOBASE + lui $v0, 0x0400 # Set transfer direction to off + sw $v0, GP1($a3) + + move $a0, $s0 + lbu $a1, 3($a0) # Get length of primitive packet + addiu $a0, 4 + +.Ltransfer_loop: + lw $v0, 0($a0) + addiu $a0, 4 + sw $v0, GP0($a3) + bgtz $a1, .Ltransfer_loop + addiu $a1, -1 + + jal DrawSync + move $a0, $0 + + lw $ra, 0($sp) + lw $s0, 4($sp) + jr $ra + addiu $sp, 8
\ No newline at end of file |
