Okay, then Unit 03 seems to be the FIFO for incoming data - which should be 32 x 32bit in size.
Theoretically the FIFO output could be passed straight to the RLE decompression hardware - not quite sure why it's stored in Unit 04 before passing it to RLE decompression hardware. But well, maybe there was some reason for doing that.
And, of course, there should be array(s) for decompressed data (separate ones for Cr, Cb, and at least one for Y). Did you altready spot those, too?
Yes, all MDEC data can be sent/received also without DMA, see here
http://nocash.emubase.de/psx-spx.htm#mdecioports for details. For Non-DMA transfers, I have this asm code:
Code: Select all
;use r28=1F800000h for below stuff
;------------------
nondma_mdec_init:
mov r1,80000000h ;#mdec reset and disable dma
mov [r28+1824h],r1 ;/
ret
;------------------
nondma_mdec_xmit: ;in: r3=src(cmd+data), r4=src.len, r5=dst, r6=dst.len
mov r1,[r3] ;src ;#
add r3,4 ;src ; send command (mdec.in)
mov [r28+1820h],r1 ;/
@@xmit_lop:
@@xmit_in_wait: ;#
@@try_rx_lop: ; ;#
mov r1,[r28+1824h] ; ;
mov r2,1 shl 31 ;dta.out.empty ;
and r2,r1 ;1=empty ; ;
jnz r2,@@skip_rx ; ;
mov r1,[r28+1820h] ; ; recv data (if any) (mdec.out)
add r6,4 ;dst.len ; ;
mov [r5],r1 ;dst ; ;
add r5,4 ;dst ; ;
jmp @@try_rx_lop ; ;
@@skip_rx: ; ;/
mov r1,[r28+1824h] ;
mov r2,1 shl 30 ;dta.in.full ; wait if mdec.in is full
and r2,r1 ;1=full ; (and alongsides: recv data, if any)
jnz r2,@@xmit_in_wait ;/
mov r1,[r3] ;src ;#
add r3,4 ;src ; send data (mdec.in)
mov [r28+1820h],r1 ;
sub r4,4 ;len ;/
jnz r4,@@xmit_lop
ret
;------------------
EDIT: The forum editor treats backslashes as "delete following linebreak"?
I've replaced them by "#" to avoid that effect.