summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/video/psx.c
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2013-01-22 00:01:49 +0000
committer smf- <smf-@users.noreply.github.com>2013-01-22 00:01:49 +0000
commit6ac8987ebd09b5f765893dd5c5a4df7a7aad9fef (patch)
tree515d9f47455df4eeb9e90fd4a5f96afd94559976 /src/emu/video/psx.c
parent9a829fa1207bf8cc41b04d1bdfd41b4f52e91d23 (diff)
clamp framebuffer reading to frame buffer coordinates. not sure this is accurate, but it stops it crashing when negative coordinates are used. [smf]
Diffstat (limited to 'src/emu/video/psx.c')
-rw-r--r--src/emu/video/psx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/emu/video/psx.c b/src/emu/video/psx.c
index 79cacd7be88..0d508e93deb 100644
--- a/src/emu/video/psx.c
+++ b/src/emu/video/psx.c
@@ -3663,7 +3663,7 @@ void psxgpu_device::gpu_read( UINT32 *p_ram, INT32 n_size )
for( n_pixel = 0; n_pixel < 2; n_pixel++ )
{
data.w.l = data.w.h;
- data.w.h = *( p_p_vram[ n_vramy + ( m_packet.n_entry[ 1 ] >> 16 ) ] + n_vramx + ( m_packet.n_entry[ 1 ] & 0xffff ) );
+ data.w.h = *( p_p_vram[ ( n_vramy + ( m_packet.n_entry[ 1 ] >> 16 ) ) & 0x3ff ] + ( ( n_vramx + ( m_packet.n_entry[ 1 ] & 0xffff ) ) & 0x3ff ) );
n_vramx++;
if( n_vramx >= ( m_packet.n_entry[ 2 ] & 0xffff ) )
{