From dd88e3a7fee102dbae9db9d2c2ec9127df9c12e7 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Sat, 1 Jun 2019 22:38:16 +0200 Subject: [PATCH] change scanlines hotkey delta to 2 fix scanline underflow --- src/emucore/EventHandler.cxx | 4 ++-- src/emucore/TIASurface.cxx | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index d4eb8b981..4fc07f446 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -439,11 +439,11 @@ void EventHandler::handleEvent(Event::Type event, bool pressed, bool repeat) return; case Event::ScanlinesDecrease: - if (pressed) myOSystem.frameBuffer().tiaSurface().setScanlineIntensity(-5); + if (pressed) myOSystem.frameBuffer().tiaSurface().setScanlineIntensity(-2); return; case Event::ScanlinesIncrease: - if (pressed) myOSystem.frameBuffer().tiaSurface().setScanlineIntensity(+5); + if (pressed) myOSystem.frameBuffer().tiaSurface().setScanlineIntensity(+2); return; case Event::PreviousAttribute: diff --git a/src/emucore/TIASurface.cxx b/src/emucore/TIASurface.cxx index 4b684c2ae..bbf295d15 100644 --- a/src/emucore/TIASurface.cxx +++ b/src/emucore/TIASurface.cxx @@ -202,6 +202,7 @@ uInt32 TIASurface::enableScanlines(int relative, int absolute) FBSurface::Attributes& attr = mySLineSurface->attributes(); if(relative == 0) attr.blendalpha = absolute; else attr.blendalpha += relative; + attr.blendalpha = std::max(0, Int32(attr.blendalpha)); attr.blendalpha = std::min(100u, attr.blendalpha); mySLineSurface->applyAttributes();