mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-04-20 00:17:16 +00:00
Updates for DHGR MIX and detection (#633):
. Support DHGR MIX mode and AN2 off to invert bit7 (undocumented) . Improve the video-mode precondition to check for 80COL access occurring before $C05F
This commit is contained in:
+18
-3
@@ -738,6 +738,7 @@ void VideoInitializeOriginal(baseColors_t pBaseNtscColors)
|
||||
static UINT g_rgbFlags = 0;
|
||||
static UINT g_rgbMode = 0;
|
||||
static WORD g_rgbPrevAN3Addr = 0;
|
||||
static bool g_rgbSet80COL = false;
|
||||
|
||||
// Video7 RGB card:
|
||||
// . Clock in the !80COL state to define the 2 flags: F2, F1
|
||||
@@ -745,7 +746,13 @@ static WORD g_rgbPrevAN3Addr = 0;
|
||||
// . NB. There's a final 5th AN3 transition to set DHGR mode
|
||||
void RGB_SetVideoMode(WORD address)
|
||||
{
|
||||
if ((address&~1) != 0x5E) // 0x5E or 0x5F?
|
||||
if ((address&~1) == 0x0C) // 0x0C or 0x0D? (80COL)
|
||||
{
|
||||
g_rgbSet80COL = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((address&~1) != 0x5E) // 0x5E or 0x5F? (DHIRES)
|
||||
return;
|
||||
|
||||
// Precondition before toggling AN3:
|
||||
@@ -754,10 +761,12 @@ void RGB_SetVideoMode(WORD address)
|
||||
// . (*) "King's Quest 1" - see routine at 0x5FD7 (trigger by pressing TAB twice)
|
||||
// . Apple II desktop sets DHGR B&W mode with HIRES off! (GH#631)
|
||||
// Maybe there is no video-mode precondition?
|
||||
if (g_uVideoMode & VF_MIXED)
|
||||
// . After setting 80COL on/off then need a 0x5E->0x5F toggle. So if we see a 0x5F then reset (GH#633)
|
||||
if ((g_uVideoMode & VF_MIXED) || (g_rgbSet80COL && address == 0x5F))
|
||||
{
|
||||
g_rgbMode = 0;
|
||||
g_rgbPrevAN3Addr = 0;
|
||||
g_rgbSet80COL = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -769,6 +778,7 @@ void RGB_SetVideoMode(WORD address)
|
||||
}
|
||||
|
||||
g_rgbPrevAN3Addr = address;
|
||||
g_rgbSet80COL = false;
|
||||
}
|
||||
|
||||
bool RGB_Is140Mode(void) // Extended 80-Column Text/AppleColor Card's Mode 2
|
||||
@@ -806,6 +816,7 @@ void RGB_ResetState(void)
|
||||
#define SS_YAML_KEY_RGB_FLAGS "RGB mode flags"
|
||||
#define SS_YAML_KEY_RGB_MODE "RGB mode"
|
||||
#define SS_YAML_KEY_RGB_PREVIOUS_AN3 "Previous AN3"
|
||||
#define SS_YAML_KEY_RGB_80COL_CHANGED "80COL changed"
|
||||
|
||||
void RGB_SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
{
|
||||
@@ -814,9 +825,10 @@ void RGB_SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
|
||||
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_RGB_FLAGS, g_rgbFlags);
|
||||
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_RGB_MODE, g_rgbMode);
|
||||
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_RGB_PREVIOUS_AN3, g_rgbPrevAN3Addr);
|
||||
yamlSaveHelper.SaveBool(SS_YAML_KEY_RGB_80COL_CHANGED, g_rgbSet80COL);
|
||||
}
|
||||
|
||||
void RGB_LoadSnapshot(YamlLoadHelper& yamlLoadHelper)
|
||||
void RGB_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT cardVersion)
|
||||
{
|
||||
if (!yamlLoadHelper.GetSubMap(SS_YAML_KEY_RGB_CARD))
|
||||
throw std::string("Card: Expected key: ") + std::string(SS_YAML_KEY_RGB_CARD);
|
||||
@@ -825,5 +837,8 @@ void RGB_LoadSnapshot(YamlLoadHelper& yamlLoadHelper)
|
||||
g_rgbMode = yamlLoadHelper.LoadUint(SS_YAML_KEY_RGB_MODE);
|
||||
g_rgbPrevAN3Addr = yamlLoadHelper.LoadUint(SS_YAML_KEY_RGB_PREVIOUS_AN3);
|
||||
|
||||
if (cardVersion >= 3)
|
||||
g_rgbSet80COL = yamlLoadHelper.LoadBool(SS_YAML_KEY_RGB_80COL_CHANGED);
|
||||
|
||||
yamlLoadHelper.PopMap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user