Search
lxdream.org :: lxdream/src/sh4/sh4mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4mem.c
changeset 325:5717ae5d4746
prev316:5ae06185a3cd
next355:18bd008f700a
author nkeynes
date Thu Jan 25 10:16:32 2007 +0000 (13 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/sh4/sh4mem.c Tue Jan 23 11:20:26 2007 +0000
1.2 +++ b/src/sh4/sh4mem.c Thu Jan 25 10:16:32 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: sh4mem.c,v 1.18 2007-01-23 11:20:26 nkeynes Exp $
1.6 + * $Id: sh4mem.c,v 1.19 2007-01-25 10:16:32 nkeynes Exp $
1.7 * sh4mem.c is responsible for the SH4's access to memory (including memory
1.8 * mapped I/O), using the page maps created in mem.c
1.9 *
1.10 @@ -371,22 +371,21 @@
1.11 }
1.12
1.13 void mem_copy_to_sh4( uint32_t destaddr, char *src, size_t count ) {
1.14 - if( destaddr >= 0x10000000 && destaddr < 0x10800000 ) {
1.15 - pvr2_ta_write( src, count );
1.16 - } else if( destaddr >= 0x10800000 && destaddr < 0x11000000 ) {
1.17 - /* YUV data */
1.18 - pvr2_yuv_write( src, count );
1.19 - } else if( destaddr >= 0x04000000 && destaddr < 0x05000000 ||
1.20 - destaddr >= 0x11000000 && destaddr < 0x12000000 ) {
1.21 + int region;
1.22 +
1.23 + if( destaddr >= 0x10000000 && destaddr < 0x14000000 ) {
1.24 + pvr2_dma_write( destaddr, src, count );
1.25 + return;
1.26 + } else if( (destaddr & 0x1F800000) == 0x05000000 ) {
1.27 + pvr2_render_buffer_invalidate( destaddr );
1.28 + } else if( (destaddr & 0x1F800000) == 0x04000000 ) {
1.29 pvr2_vram64_write( destaddr, src, count );
1.30 - } else {
1.31 - if( (destaddr & 0x1F800000) == 0x05000000 )
1.32 - pvr2_render_buffer_invalidate( destaddr );
1.33 - char *dest = mem_get_region(destaddr);
1.34 - if( dest == NULL )
1.35 - ERROR( "Attempted block write to unknown address %08X", destaddr );
1.36 - else {
1.37 - memcpy( dest, src, count );
1.38 - }
1.39 + return;
1.40 + }
1.41 + char *dest = mem_get_region(destaddr);
1.42 + if( dest == NULL )
1.43 + ERROR( "Attempted block write to unknown address %08X", destaddr );
1.44 + else {
1.45 + memcpy( dest, src, count );
1.46 }
1.47 }
.