From 564b1928a4e169d6aae8ca7853562ed8bbf48ab8 Mon Sep 17 00:00:00 2001 From: smf- Date: Fri, 18 May 2012 00:43:34 +0000 Subject: [PATCH] Stop the elephant stage on Handle Champ from crashing, though other graphics issues remain. [smf] --- src/emu/video/psx.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/emu/video/psx.c b/src/emu/video/psx.c index 1e6212337a7..f27034d7b18 100644 --- a/src/emu/video/psx.c +++ b/src/emu/video/psx.c @@ -1334,6 +1334,11 @@ void psxgpu_device::FlatPolygon( int n_startpoint ) for( ;; ) { + if( n_y >= 1024 ) + { + return; + } + if( n_y == COORD_DY( vertex[ n_leftpoint ].n_coord ) ) { while( n_y == COORD_DY( vertex[ p_n_leftpointlist[ n_leftpoint ] ].n_coord ) ) @@ -1515,6 +1520,11 @@ void psxgpu_device::FlatTexturedPolygon( int n_startpoint ) for( ;; ) { + if( n_y >= 1024 ) + { + return; + } + if( n_y == COORD_DY( vertex[ n_leftpoint ].n_coord ) ) { while( n_y == COORD_DY( vertex[ p_n_leftpointlist[ n_leftpoint ] ].n_coord ) ) @@ -1698,6 +1708,11 @@ void psxgpu_device::GouraudPolygon( int n_startpoint ) for( ;; ) { + if( n_y >= 1024 ) + { + return; + } + if( n_y == COORD_DY( vertex[ n_leftpoint ].n_coord ) ) { while( n_y == COORD_DY( vertex[ p_n_leftpointlist[ n_leftpoint ] ].n_coord ) ) @@ -1924,6 +1939,11 @@ void psxgpu_device::GouraudTexturedPolygon( int n_startpoint ) for( ;; ) { + if( n_y >= 1024 ) + { + return; + } + if( n_y == COORD_DY( vertex[ n_leftpoint ].n_coord ) ) { while( n_y == COORD_DY( vertex[ p_n_leftpointlist[ n_leftpoint ] ].n_coord ) )