diff options
author | Angelo Salese <angelosa@users.noreply.github.com> | 2010-05-03 12:53:46 +0000 |
---|---|---|
committer | Angelo Salese <angelosa@users.noreply.github.com> | 2010-05-03 12:53:46 +0000 |
commit | 6948662d636bfa4e7ce96007115afa0ea941bd38 (patch) | |
tree | f7a74af284075edf080e54542b09fe1dedf9585e | |
parent | b5fac5bcba56a19c419a51038e3d97e326161a49 (diff) |
Naomi: work-around for an int32 overflow bug in the renderer, makes The House of the Dead 2 / The Typing of the Dead to not crash during attract mode [Angelo Salese]
-rw-r--r-- | src/mame/video/dc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mame/video/dc.c b/src/mame/video/dc.c index 2f351bab542..00489eb09ff 100644 --- a/src/mame/video/dc.c +++ b/src/mame/video/dc.c @@ -1810,6 +1810,9 @@ static void render_span(bitmap_t *bitmap, texinfo *ti, yy0 = round(y0); yy1 = round(y1); + if((yy0 < 0 && y0 > 0) || (yy1 < 0 && y1 > 0)) //temp handling of int32 overflow, needed by hotd2/totd + return; + dy = yy0+0.5-y0; if(0) @@ -1927,6 +1930,7 @@ static void render_tri_sorted(bitmap_t *bitmap, texinfo *ti, const vert *v0, con v1->x, v0->x + dx02dy*dy01, v1->u, v0->u + du02dy*dy01, v1->v, v0->v + dv02dy*dy01, v1->w, v0->w + dw02dy*dy01, dx12dy, dx02dy, du12dy, du02dy, dv12dy, dv02dy, dw12dy, dw02dy); } else { + render_span(bitmap, ti, v0->y, v1->y, v0->x, v0->x, v0->u, v0->u, v0->v, v0->v, v0->w, v0->w, dx02dy, dx01dy, du02dy, du01dy, dv02dy, dv01dy, dw02dy, dw01dy); |