diff --git a/source/NTSC.cpp b/source/NTSC.cpp index e9fc3171..2ac66dc9 100644 --- a/source/NTSC.cpp +++ b/source/NTSC.cpp @@ -1306,7 +1306,7 @@ void updateScreenDoubleHires80RGB (long cycles6502 ) // wsUpdateVideoDblHires int width = UpdateDHiRes160Cell(g_nVideoClockHorz-VIDEO_SCANNER_HORZ_START, g_nVideoClockVert, addr, g_pVideoAddress); g_pVideoAddress += width; } - else if (RGB_Is560Mode())// || (RGB_IsMixMode() && !((a | m) & 0x80))) + else if (RGB_Is560Mode()) { update7MonoPixels(a); update7MonoPixels(m); @@ -1463,7 +1463,9 @@ void updateScreenDoubleLores80 (long cycles6502) // wsUpdateVideoDblLores } //=========================================================================== -static void updateScreenSingleHires40Simplified (long cycles6502) + +// Handles both the "SingleHires40" & "DoubleHires40" cases, via UpdateHiResCell() +static void updateScreenHires40Simplified (long cycles6502) { if (g_nVideoMixed && g_nVideoClockVert >= VIDEO_SCANNER_Y_MIXED) { @@ -1482,24 +1484,8 @@ static void updateScreenSingleHires40Simplified (long cycles6502) else if (g_nVideoClockHorz >= VIDEO_SCANNER_HORZ_START) { uint16_t addr = getVideoScannerAddressHGR(); - - if (!RGB_Is560Mode()) - { - UpdateHiResCell(g_nVideoClockHorz-VIDEO_SCANNER_HORZ_START, g_nVideoClockVert, addr, g_pVideoAddress); - g_pVideoAddress += 14; - } - else // Color Burst is off - duplicate code from updateScreenSingleHires40() (GH#631) - { - uint8_t *pMain = MemGetMainPtr(addr); - uint8_t m = pMain[0]; - uint16_t bits = g_aPixelDoubleMaskHGR[m & 0x7F]; // Optimization: hgrbits second 128 entries are mirror of first 128 - if (m & 0x80) - bits = (bits << 1) | g_nLastColumnPixelNTSC; - updatePixels( bits ); - - if (g_nVideoClockHorz == (VIDEO_SCANNER_MAX_HORZ-1)) - g_nLastColumnPixelNTSC = 0; - } + UpdateHiResCell(g_nVideoClockHorz-VIDEO_SCANNER_HORZ_START, g_nVideoClockVert, addr, g_pVideoAddress); + g_pVideoAddress += 14; } } updateVideoScannerHorzEOLSimple(); @@ -2053,13 +2039,18 @@ void NTSC_SetVideoMode( uint32_t uVideoModeFlags, bool bDelay/*=false*/ ) } else { - g_pFuncUpdateGraphicsScreen = updateScreenDoubleHires40; + if (g_eVideoType == VT_COLOR_MONITOR_RGB) + g_pFuncUpdateGraphicsScreen = updateScreenHires40Simplified; // handles both Single/Double Hires40 (EG. FT's DIGIDREAM demo) +// else if (g_eVideoType == VT_COLOR_VIDEOCARD_RGB) +// // TODO + else + g_pFuncUpdateGraphicsScreen = updateScreenDoubleHires40; } } else { if (g_eVideoType == VT_COLOR_MONITOR_RGB) - g_pFuncUpdateGraphicsScreen = updateScreenSingleHires40Simplified; + g_pFuncUpdateGraphicsScreen = updateScreenHires40Simplified; else if (g_eVideoType == VT_COLOR_VIDEOCARD_RGB) g_pFuncUpdateGraphicsScreen = updateScreenSingleHires40RGB; else diff --git a/source/RGBMonitor.cpp b/source/RGBMonitor.cpp index ac631e3b..eddebbd8 100644 --- a/source/RGBMonitor.cpp +++ b/source/RGBMonitor.cpp @@ -587,7 +587,7 @@ static void CopySource(int w, int h, int sx, int sy, bgra_t *pVideoAddress, cons //=========================================================================== -#define HIRES_COLUMN_OFFSET (((byteval1 & 0xE0) << 2) | ((byteval3 & 0x03) << 5)) // (prevHighBit | last 2 pixels | next 2 pixesl) * HIRES_COLUMN_UNIT_SIZE +#define HIRES_COLUMN_OFFSET (((byteval1 & 0xE0) << 2) | ((byteval3 & 0x03) << 5)) // (prevHighBit | last 2 pixels | next 2 pixels) * HIRES_COLUMN_UNIT_SIZE void UpdateHiResCell (int x, int y, uint16_t addr, bgra_t *pVideoAddress) { @@ -596,6 +596,13 @@ void UpdateHiResCell (int x, int y, uint16_t addr, bgra_t *pVideoAddress) BYTE byteval2 = *(pMain); BYTE byteval3 = (x < 39) ? *(pMain+1) : 0; + if (g_uVideoMode & VF_DHIRES) // ie. VF_DHIRES=1, VF_HIRES=1, VF_80COL=0 - NTSC.cpp refers to this as "DoubleHires40" + { + byteval1 &= 0x7f; + byteval2 &= 0x7f; + byteval3 &= 0x7f; + } + if (IsVideoStyle(VS_COLOR_VERTICAL_BLEND)) { CopyMixedSource(x, y, SRCOFFS_HIRES+HIRES_COLUMN_OFFSET+((x & 1)*HIRES_COLUMN_SUBUNIT_SIZE), (int)byteval2, pVideoAddress);