diff --git a/source/CmdLine.cpp b/source/CmdLine.cpp index a9d2ba35..073ef21d 100644 --- a/source/CmdLine.cpp +++ b/source/CmdLine.cpp @@ -491,6 +491,10 @@ bool ProcessCmdLine(LPSTR lpCmdLine) { RGB_SetInvertBit7(true); } + else if (strcmp(lpCmdLine, "-mac-lc-card-dlgr") == 0) // GH#1258 + { + RGB_SetMacLCCardDLGR(true); + } else if (strcmp(lpCmdLine, "-screenshot-and-exit") == 0) // GH#616: For testing - Use in combination with -load-state { g_cmdLine.szScreenshotFilename = GetCurrArg(lpNextArg); diff --git a/source/RGBMonitor.cpp b/source/RGBMonitor.cpp index dc53bf7c..8ce85f7e 100644 --- a/source/RGBMonitor.cpp +++ b/source/RGBMonitor.cpp @@ -1049,7 +1049,8 @@ void UpdateDLoResCell (int x, int y, uint16_t addr, bgra_t *pVideoAddress) const BYTE auxval_h = auxval >> 4; const BYTE auxval_l = auxval & 0xF; - auxval = (ROL_NIB(auxval_h)<<4) | ROL_NIB(auxval_l); + if (!RGB_IsMacLCCardDLGR()) // "Apple IIe Card for Macintosh LC" has a bug in its DLGR implementation (GH#1258) + auxval = (ROL_NIB(auxval_h)<<4) | ROL_NIB(auxval_l); if ((y & 4) == 0) { @@ -1213,6 +1214,7 @@ static UINT g_rgbFlags = 0; static UINT g_rgbMode = 0; static WORD g_rgbPrevAN3Addr = 0; static bool g_rgbInvertBit7 = false; +static bool g_rgbMacLCCardDLGR = false; // TODO: Persist to save-state // Video7 RGB card: // . Clock in the !80COL state to define the 2 flags: F2, F1 @@ -1273,6 +1275,11 @@ bool RGB_IsMixModeInvertBit7(void) return RGB_IsMixMode() && g_rgbInvertBit7; } +bool RGB_IsMacLCCardDLGR(void) +{ + return g_rgbMacLCCardDLGR; +} + void RGB_ResetState(void) { g_rgbFlags = 0; @@ -1285,6 +1292,11 @@ void RGB_SetInvertBit7(bool state) g_rgbInvertBit7 = state; } +void RGB_SetMacLCCardDLGR(bool state) +{ + g_rgbMacLCCardDLGR = state; +} + //=========================================================================== #define SS_YAML_KEY_RGB_CARD "AppleColor RGB Adaptor" diff --git a/source/RGBMonitor.h b/source/RGBMonitor.h index 4b93bf14..0145c85b 100644 --- a/source/RGBMonitor.h +++ b/source/RGBMonitor.h @@ -36,8 +36,10 @@ bool RGB_Is160Mode(void); bool RGB_IsMixMode(void); bool RGB_Is560Mode(void); bool RGB_IsMixModeInvertBit7(void); +bool RGB_IsMacLCCardDLGR(void); void RGB_ResetState(void); void RGB_SetInvertBit7(bool state); +void RGB_SetMacLCCardDLGR(bool state); void RGB_SaveSnapshot(class YamlSaveHelper& yamlSaveHelper); void RGB_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT cardVersion);