diff --git a/source/Applewin.cpp b/source/Applewin.cpp index 0e041d66..8b948b10 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -500,13 +500,36 @@ void LoadConfiguration(void) if (REGLOAD(TEXT(REGVALUE_APPLE2_TYPE), &dwComputerType)) { - if ((dwComputerType >= A2TYPE_MAX) || (dwComputerType >= A2TYPE_UNDEFINED && dwComputerType < A2TYPE_CLONE)) + const DWORD dwLoadedComputerType = dwComputerType; + + if ( (dwComputerType >= A2TYPE_MAX) || + (dwComputerType >= A2TYPE_UNDEFINED && dwComputerType < A2TYPE_CLONE) || + (dwComputerType >= A2TYPE_CLONE_A2_MAX && dwComputerType < A2TYPE_CLONE_A2E) ) dwComputerType = A2TYPE_APPLE2EENHANCED; // Remap the bad Pravets models (before AppleWin v1.26) if (dwComputerType == A2TYPE_BAD_PRAVETS82) dwComputerType = A2TYPE_PRAVETS82; if (dwComputerType == A2TYPE_BAD_PRAVETS8M) dwComputerType = A2TYPE_PRAVETS8M; + // Remap the bad Pravets models (at AppleWin v1.26) - GH#415 + if (dwComputerType == A2TYPE_CLONE) dwComputerType = A2TYPE_PRAVETS82; + + if (dwLoadedComputerType != dwComputerType) + { + char sText[ 100 ]; + _snprintf( sText, sizeof(sText)-1, "Unsupported Apple2Type(%d). Changing to %d", dwLoadedComputerType, dwComputerType); + + MessageBox( + GetDesktopWindow(), // NB. g_hFrameWindow is not yet valid + sText, + "Load Configuration", + MB_ICONSTOP | MB_SETFOREGROUND); + + LogFileOutput("%s\n", sText); + + REGSAVE(TEXT(REGVALUE_APPLE2_TYPE), dwComputerType); + } + apple2Type = (eApple2Type) dwComputerType; } else // Support older AppleWin registry entries diff --git a/source/Common.h b/source/Common.h index 73c48ee6..fbad00b2 100644 --- a/source/Common.h +++ b/source/Common.h @@ -175,16 +175,21 @@ enum eApple2Type { A2TYPE_UNDEFINED, A2TYPE_APPLE2C=APPLE2C_MASK, A2TYPE_APPLE2D=APPLE2D_MASK, - // - // Clones start here: + + // ][ clones start here: A2TYPE_CLONE=APPLECLONE_MASK, - A2TYPE_PRAVETS=APPLECLONE_MASK, - A2TYPE_PRAVETS82=A2TYPE_PRAVETS, // Apple ][ clone A2TYPE_PRAVETS8M, // Apple ][ clone - A2TYPE_BAD_PRAVETS82=A2TYPE_PRAVETS|APPLE2E_MASK, // Wrongly tagged as Apple //e clone (< AppleWin 1.26) - A2TYPE_BAD_PRAVETS8M, // Wrongly tagged as Apple //e clone (< AppleWin 1.26) + A2TYPE_PRAVETS82, // Apple ][ clone + // (Gap for more Apple ][ clones) + A2TYPE_CLONE_A2_MAX, + + // //e clones start here: + A2TYPE_CLONE_A2E=A2TYPE_CLONE|APPLE2E_MASK, + A2TYPE_BAD_PRAVETS82=A2TYPE_CLONE|APPLE2E_MASK, // Wrongly tagged as Apple //e clone (< AppleWin 1.26) + A2TYPE_BAD_PRAVETS8M, // Wrongly tagged as Apple //e clone (< AppleWin 1.26) A2TYPE_PRAVETS8A, // Apple //e clone A2TYPE_TK30002E, // Apple //e enhanced clone + // (Gap for more Apple //e clones) A2TYPE_MAX }; diff --git a/source/Configuration/PageAdvanced.cpp b/source/Configuration/PageAdvanced.cpp index f125e352..e8dfe250 100644 --- a/source/Configuration/PageAdvanced.cpp +++ b/source/Configuration/PageAdvanced.cpp @@ -237,6 +237,15 @@ int CPageAdvanced::GetCloneMenuItem(void) int nMenuItem = MENUITEM_CLONEMIN; switch (type) { + case A2TYPE_CLONE: // Set as generic clone type from Config page + { + // Need to set a real clone type & CPU in case the user never touches the clone menu + nMenuItem = MENUITEM_CLONEMIN; + const eApple2Type NewCloneType = GetCloneType(MENUITEM_CLONEMIN); + m_PropertySheetHelper.GetConfigNew().m_Apple2Type = GetCloneType(NewCloneType); + m_PropertySheetHelper.GetConfigNew().m_CpuType = ProbeMainCpuDefault(NewCloneType); + } + break; case A2TYPE_PRAVETS82: nMenuItem = MENUITEM_PRAVETS82; break; case A2TYPE_PRAVETS8M: nMenuItem = MENUITEM_PRAVETS8M; break; case A2TYPE_PRAVETS8A: nMenuItem = MENUITEM_PRAVETS8A; break;