From 6ac8987ebd09b5f765893dd5c5a4df7a7aad9fef Mon Sep 17 00:00:00 2001 From: smf- Date: Tue, 22 Jan 2013 00:01:49 +0000 Subject: [PATCH] clamp framebuffer reading to frame buffer coordinates. not sure this is accurate, but it stops it crashing when negative coordinates are used. [smf] --- src/emu/video/psx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ) ) {