diff options
Diffstat (limited to 'libpsn00b/psxcd/_cd_control.s')
| -rw-r--r-- | libpsn00b/psxcd/_cd_control.s | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libpsn00b/psxcd/_cd_control.s b/libpsn00b/psxcd/_cd_control.s index 7f69266..c4153ff 100644 --- a/libpsn00b/psxcd/_cd_control.s +++ b/libpsn00b/psxcd/_cd_control.s @@ -15,6 +15,24 @@ _cd_control: # a1 - pointer to parameters # a2 - length of parameters + addiu $sp, -16 + sw $ra, 0($sp) + sw $a0, 4($sp) + sw $a1, 8($sp) + sw $a2, 12($sp) + +# move $a3, $a2 # Debug +# move $a2, $a1 +# move $a1, $a0 +# la $a0, _cd_control_msg +# jal printf +# addiu $sp, -16 +# addiu $sp, 16 + + lw $a0, 4($sp) + lw $a1, 8($sp) + lw $a2, 12($sp) + li $v0, 1 # Set acknowledge wait flag la $v1, _cd_ack_wait sb $v0, 0($v1) @@ -80,6 +98,15 @@ _cd_control: li $v0, 0x40 sb $v0, CD_REG3($v1) +#.Lflush_response: # Flush response FIFO +# lbu $v0, CD_REG1($v1) +# nop +# lbu $v0, CD_REG0($v1) +# nop +# andi $v0, 0x20 +# beqz $v0, .Lflush_response +# nop + .Lcmd_wait: # Wait for CD to become ready for commands lbu $v0, CD_REG0($v1) nop @@ -104,6 +131,14 @@ _cd_control: sb $0 , CD_REG0($v1) # Feed command value sb $a0, CD_REG1($v1) + lw $ra, 0($sp) + addiu $sp, 16 jr $ra nop + + +#.section .data + +#_cd_control_msg: +# .asciiz "CdControl(%d, %x, %d)\n"
\ No newline at end of file |
