4 * This is a deprecated module that is not yet completely extricated from the
7 * Copyright (c) 2005 Nathan Keynes.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
20 #define MODULE sh4_module
27 #include "dreamcast.h"
28 #include "sh4/sh4core.h"
29 #include "sh4/sh4mmio.h"
31 #include "pvr2/pvr2.h"
32 #include "xlat/xltcache.h"
34 /************** Obsolete methods ***************/
36 /* FIXME: Handle all the many special cases when the range doesn't fall cleanly
37 * into the same memory block
39 void mem_copy_from_sh4( sh4ptr_t dest, sh4addr_t srcaddr, size_t count ) {
40 if( srcaddr >= 0x04000000 && srcaddr < 0x05000000 ) {
41 pvr2_vram64_read( dest, srcaddr, count );
43 sh4ptr_t src = mem_get_region(srcaddr);
45 WARN( "Attempted block read from unknown address %08X", srcaddr );
47 memcpy( dest, src, count );
52 void mem_copy_to_sh4( sh4addr_t destaddr, sh4ptr_t src, size_t count ) {
53 if( destaddr >= 0x10000000 && destaddr < 0x14000000 ) {
54 pvr2_dma_write( destaddr, src, count );
56 } else if( (destaddr & 0x1F800000) == 0x05000000 ) {
57 pvr2_render_buffer_invalidate( destaddr, TRUE );
58 } else if( (destaddr & 0x1F800000) == 0x04000000 ) {
59 pvr2_vram64_write( destaddr, src, count );
62 sh4ptr_t dest = mem_get_region(destaddr);
64 WARN( "Attempted block write to unknown address %08X", destaddr );
66 xlat_invalidate_block( destaddr, count );
67 memcpy( dest, src, count );
.