Search
lxdream.org :: lxdream/src/sh4/sh4mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4mem.c
changeset 282:01e53698ff38
prev234:8759d0067e9d
next316:5ae06185a3cd
author nkeynes
date Sun Jan 14 11:43:00 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change First cut of YUV converter
file annotate diff log raw
1.1 --- a/src/sh4/sh4mem.c Tue Dec 12 09:18:47 2006 +0000
1.2 +++ b/src/sh4/sh4mem.c Sun Jan 14 11:43:00 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: sh4mem.c,v 1.16 2006-12-12 09:18:47 nkeynes Exp $
1.6 + * $Id: sh4mem.c,v 1.17 2007-01-14 11:43:00 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 @@ -65,7 +65,11 @@
1.11 {
1.12 struct mmio_region *io = P4_io[(addr&0x1FFFFFFF)>>19];
1.13 if( !io ) {
1.14 - ERROR( "Attempted read from unknown P4 region: %08X", addr );
1.15 + if( (addr & 0xFF000000) != 0xF4000000 ) {
1.16 + /* OC address cache isn't implemented, but don't complain about it.
1.17 + * Complain about anything else though */
1.18 + ERROR( "Attempted read from unknown P4 region: %08X", addr );
1.19 + }
1.20 return 0;
1.21 } else {
1.22 int32_t val = io->io_read( addr&0xFFF );
1.23 @@ -367,8 +371,11 @@
1.24 }
1.25
1.26 void mem_copy_to_sh4( uint32_t destaddr, char *src, size_t count ) {
1.27 - if( destaddr >= 0x10000000 && destaddr < 0x11000000 ) {
1.28 + if( destaddr >= 0x10000000 && destaddr < 0x10800000 ) {
1.29 pvr2_ta_write( src, count );
1.30 + } else if( destaddr >= 0x10800000 && destaddr < 0x11000000 ) {
1.31 + /* YUV data */
1.32 + pvr2_yuv_write( src, count );
1.33 } else if( destaddr >= 0x04000000 && destaddr < 0x05000000 ||
1.34 destaddr >= 0x11000000 && destaddr < 0x12000000 ) {
1.35 pvr2_vram64_write( destaddr, src, count );
.