From 83e21e99e4bda550376113becaebbea93c503f2d Mon Sep 17 00:00:00 2001 From: Ville Linde Date: Sun, 13 Jun 2021 20:26:42 +0300 Subject: [PATCH] voodoo: fix Hornet games POST crash --- src/devices/video/voodoo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp index de10bb9a471..dc028f656a3 100644 --- a/src/devices/video/voodoo.cpp +++ b/src/devices/video/voodoo.cpp @@ -3129,7 +3129,7 @@ int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t dat attoseconds_t refresh = vd->m_screen->frame_period().attoseconds(); attoseconds_t stdperiod, medperiod, vgaperiod; attoseconds_t stddiff, meddiff, vgadiff; - rectangle visarea; + rectangle visarea; if (vd->vd_type == TYPE_VOODOO_2) { @@ -3151,7 +3151,7 @@ int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t dat } /* create a new visarea */ - visarea.set(hbp, hbp + hvis - 1, vbp, vbp + vvis - 1); + visarea.set(hbp, hbp + std::max(hvis - 1, 0), vbp, vbp + std::max(vvis - 1, 0)); /* keep within bounds */ visarea.max_x = (std::min)(visarea.max_x, htotal - 1);