Search
lxdream.org :: lxdream/src/pvr2/pvr2mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/pvr2mem.c
changeset 325:5717ae5d4746
prev315:2d8ba198d62c
next327:00d55a462af3
author nkeynes
date Thu Jan 25 10:16:32 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Move PVR2 dma handling (0x10000000-0x13FFFFFF) into pvr2mem.c, minor
register cleanups in asic.c
file annotate diff log raw
1.1 --- a/src/pvr2/pvr2mem.c Tue Jan 23 11:19:32 2007 +0000
1.2 +++ b/src/pvr2/pvr2mem.c Thu Jan 25 10:16:32 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: pvr2mem.c,v 1.5 2007-01-23 11:19:32 nkeynes Exp $
1.6 + * $Id: pvr2mem.c,v 1.6 2007-01-25 10:16:32 nkeynes Exp $
1.7 *
1.8 * PVR2 (Video) VRAM handling routines (mainly for the 64-bit region)
1.9 *
1.10 @@ -16,11 +16,47 @@
1.11 * GNU General Public License for more details.
1.12 */
1.13 #include "pvr2.h"
1.14 +#include "asic.h"
1.15 #include <stdio.h>
1.16 #include <errno.h>
1.17
1.18 extern char *video_base;
1.19
1.20 +void pvr2_dma_write( sh4addr_t destaddr, char *src, uint32_t count )
1.21 +{
1.22 + int region;
1.23 +
1.24 + switch( destaddr & 0x13800000 ) {
1.25 + case 0x10000000:
1.26 + case 0x12000000:
1.27 + pvr2_ta_write( src, count );
1.28 + break;
1.29 + case 0x11000000:
1.30 + case 0x11800000:
1.31 + region = MMIO_READ( ASIC, PVRDMARGN1 );
1.32 + if( region == 0 ) {
1.33 + pvr2_vram64_write( destaddr, src, count );
1.34 + } else {
1.35 + char *dest = mem_get_region(destaddr);
1.36 + memcpy( dest, src, count );
1.37 + }
1.38 + break;
1.39 + case 0x10800000:
1.40 + case 0x12800000:
1.41 + pvr2_yuv_write( src, count );
1.42 + break;
1.43 + case 0x13000000:
1.44 + case 0x13800000:
1.45 + region = MMIO_READ( ASIC, PVRDMARGN2 );
1.46 + if( region == 0 ) {
1.47 + pvr2_vram64_write( destaddr, src, count );
1.48 + } else {
1.49 + char *dest = mem_get_region(destaddr);
1.50 + memcpy( dest, src, count );
1.51 + }
1.52 + }
1.53 +}
1.54 +
1.55 void pvr2_vram64_write( sh4addr_t destaddr, char *src, uint32_t length )
1.56 {
1.57 int bank_flag = (destaddr & 0x04) >> 2;
.