From 95b6fde639e1a54c555eb8f69db19b1e998f4291 Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Fri, 2 Jan 2015 18:00:31 -0800 Subject: [PATCH] Cleanup & Optimize: g_nTextFlashCounter --- source/NTSC.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/source/NTSC.cpp b/source/NTSC.cpp index 6c8a05c1..0b1f77b7 100644 --- a/source/NTSC.cpp +++ b/source/NTSC.cpp @@ -144,7 +144,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA static void (*g_pFunc_ntscColorPixel)(int) = 0; //ntscColorSinglePixel; - static unsigned g_nTextFlashCounter = 0; + static uint8_t g_nTextFlashCounter = 0; static uint16_t g_nTextFlashMask = 0; static unsigned g_aPixelMaskGR [ 16]; @@ -463,11 +463,8 @@ inline void updateVideoHorzEOL() if (++g_nVideoClockVert == VIDEO_SCANNER_MAX_VERT) { g_nVideoClockVert = 0; - if (++g_nTextFlashCounter == 16) - { - g_nTextFlashCounter = 0; + if ((++g_nTextFlashCounter & 0xF) == 0) g_nTextFlashMask ^= -1; // 16-bits - } } if (g_nVideoClockVert < VIDEO_SCANNER_Y_DISPLAY) @@ -1496,11 +1493,9 @@ void NTSC_VideoUpdateCycles( long cycles6502 ) if (++g_nVideoClockVert == VIDEO_SCANNER_MAX_VERT) { g_nVideoClockVert = 0; - if (++g_nTextFlashCounter == 16) - { - g_nTextFlashCounter = 0; + if ((++g_nTextFlashCounter & 0xF) == 0) g_nTextFlashMask ^= -1; // 16-bits - } + bRedraw = true; }