From 1e5d3f827a97b13be768e292431b093730d6472b Mon Sep 17 00:00:00 2001 From: tomch Date: Thu, 23 Jul 2009 21:43:08 +0000 Subject: [PATCH] Fix Bug #14879 : Double-Lo-Res Graphics colours not correct --- AppleWin/source/Video.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/AppleWin/source/Video.cpp b/AppleWin/source/Video.cpp index e952dc7a..6e48549c 100644 --- a/AppleWin/source/Video.cpp +++ b/AppleWin/source/Video.cpp @@ -1510,16 +1510,23 @@ bool UpdateLoResCell (int x, int y, int xpixel, int ypixel, int offset) } //=========================================================================== + +#define ROL_NIB(x) ( (((x)<<1)&0xF) | (((x)>>3)&1) ) + bool UpdateDLoResCell (int x, int y, int xpixel, int ypixel, int offset) { - BYTE auxval = *(g_pTextBank1 +offset); - BYTE mainval = *(g_pTextBank0+offset); + BYTE auxval = *(g_pTextBank1 + offset); + BYTE mainval = *(g_pTextBank0 + offset); if ( (auxval != *(vidlastmem+offset)) || (mainval != *(vidlastmem+offset+0x400)) || g_VideoForceFullRedraw ) { + const BYTE auxval_h = auxval >> 4; + const BYTE auxval_l = auxval & 0xF; + auxval = (ROL_NIB(auxval_h)<<4) | ROL_NIB(auxval_l); // Fix Bug #14879 + CopySource( xpixel,ypixel , 7,8,SRCOFFS_LORES+((x & 1) << 1),((auxval & 0xF) << 4)); CopySource( xpixel,ypixel+8, 7,8,SRCOFFS_LORES+((x & 1) << 1),(auxval & 0xF0)); //