From e2635c9e94dbc7f9307eb048b77f40dd3a009693 Mon Sep 17 00:00:00 2001 From: angelosa Date: Thu, 1 Mar 2018 01:39:03 +0100 Subject: [PATCH] model2.cpp: workaround hardlocks in fvipers and schamp (nw) --- src/mame/video/model2.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mame/video/model2.cpp b/src/mame/video/model2.cpp index c49553d2d0f..919d014a809 100644 --- a/src/mame/video/model2.cpp +++ b/src/mame/video/model2.cpp @@ -91,6 +91,7 @@ #include "video/segaic24.h" #include "includes/model2.h" +#include #define pz p[0] #define pu p[1] @@ -213,7 +214,10 @@ static int32_t clip_polygon(poly_vertex *v, int32_t num_vertices, plane *cp, pol nextin = (nextdot >= cp->distance) ? 1 : 0; /* Add a clipped vertex if one end of the current edge is inside the plane and the other is outside */ - if ( curin != nextin ) + // TODO: displaying Honey in Fighting Vipers and Bean in Sonic the Fighters somehow causes a NaN dot product here, + // causing MAME to hardlock in the renderer routine. They are also causing lots of invalid polygon renders + // which might be related. + if ( curin != nextin && std::isnan(curdot) == false && std::isnan(nextdot) == false ) { scale = (cp->distance - curdot) / (nextdot - curdot); @@ -1946,7 +1950,7 @@ static uint32_t * geo_object_data( geo_state *geo, uint32_t opcode, uint32_t *in // Virtual On & Gunblade NY if(obc == 0) obc = 0xfffff; - + switch( geo->mode & 3 ) { /* Normals present, No Specular */