Search
lxdream.org :: lxdream :: r834:7682ceeb9309
lxdream 0.9.1
released Jun 29
Download Now
changeset834:7682ceeb9309
parent833:1ea87e0221f8
child835:2381ddfd3fdd
authornkeynes
dateWed Aug 27 10:31:08 2008 +0000 (11 years ago)
Fix DMA/SQ writes to the VRAM32 region
src/pvr2/pvr2mem.c
1.1 --- a/src/pvr2/pvr2mem.c Wed Aug 27 09:42:16 2008 +0000
1.2 +++ b/src/pvr2/pvr2mem.c Wed Aug 27 10:31:08 2008 +0000
1.3 @@ -39,7 +39,11 @@
1.4 if( region == 0 ) {
1.5 pvr2_vram64_write( destaddr, src, count );
1.6 } else {
1.7 - unsigned char *dest = mem_get_region(destaddr);
1.8 + destaddr &= PVR2_RAM_MASK;
1.9 + unsigned char *dest = video_base + destaddr;
1.10 + if( PVR2_RAM_SIZE - destaddr < count ) {
1.11 + count = PVR2_RAM_SIZE - destaddr;
1.12 + }
1.13 memcpy( dest, src, count );
1.14 }
1.15 break;
1.16 @@ -53,7 +57,11 @@
1.17 if( region == 0 ) {
1.18 pvr2_vram64_write( destaddr, src, count );
1.19 } else {
1.20 - unsigned char *dest = mem_get_region(destaddr);
1.21 + destaddr &= PVR2_RAM_MASK;
1.22 + unsigned char *dest = video_base + destaddr;
1.23 + if( PVR2_RAM_SIZE - destaddr < count ) {
1.24 + count = PVR2_RAM_SIZE - destaddr;
1.25 + }
1.26 memcpy( dest, src, count );
1.27 }
1.28 }
.