Added more logging when Apple2 Tyoe changes

This commit is contained in:
tomcw 2018-01-26 11:03:44 +00:00
parent 02a6df73c5
commit b324f43a15
7 changed files with 26 additions and 8 deletions

View File

@ -520,15 +520,15 @@ void LoadConfiguration(void)
char sText[ 100 ];
_snprintf( sText, sizeof(sText)-1, "Unsupported Apple2Type(%d). Changing to %d", dwLoadedComputerType, dwComputerType);
LogFileOutput("%s\n", sText);
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);
sg_PropertySheet.ConfigSaveApple2Type((eApple2Type)dwComputerType);
}
apple2Type = (eApple2Type) dwComputerType;

View File

@ -8,6 +8,7 @@ __interface IPropertySheet
DWORD GetVolumeMax(void); // TODO:TC: Move out of here
bool SaveStateSelectImage(HWND hWindow, bool bSave); // TODO:TC: Move out of here
void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld);
void ConfigSaveApple2Type(eApple2Type apple2Type);
UINT GetScrollLockToggle(void);
void SetScrollLockToggle(UINT uValue);

View File

@ -178,6 +178,7 @@ BOOL CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM
case A2TYPE_PRAVETS8M: nCurrentChoice = MENUITEM_CLONE; break;
case A2TYPE_PRAVETS8A: nCurrentChoice = MENUITEM_CLONE; break;
case A2TYPE_TK30002E: nCurrentChoice = MENUITEM_CLONE; break;
default: _ASSERT(0); break;
}
m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMPUTER, m_ComputerChoices, nCurrentChoice);

View File

@ -28,6 +28,10 @@ public:
{
m_PropertySheetHelper.ApplyNewConfig(ConfigNew, ConfigOld);
}
void ConfigSaveApple2Type(eApple2Type apple2Type)
{
m_PropertySheetHelper.ConfigSaveApple2Type(apple2Type);
}
virtual UINT GetScrollLockToggle(void){ return m_PageInput.GetScrollLockToggle(); }
virtual void SetScrollLockToggle(UINT uValue){ m_PageInput.SetScrollLockToggle(uValue); }

View File

@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "..\AppleWin.h" // g_nAppMode, g_uScrollLockToggle, sg_PropertySheet
#include "..\Disk.h"
#include "..\Frame.h"
#include "..\Log.h"
#include "..\Registry.h"
#include "..\SaveState.h"
#include "IPropertySheet.h"
@ -104,7 +105,13 @@ void CPropertySheetHelper::SaveComputerType(eApple2Type NewApple2Type)
if (NewApple2Type == A2TYPE_CLONE) // Clone picked from Config tab, but no specific one picked from Advanced tab
NewApple2Type = A2TYPE_PRAVETS82;
REGSAVE(TEXT(REGVALUE_APPLE2_TYPE), NewApple2Type);
ConfigSaveApple2Type(NewApple2Type);
}
void CPropertySheetHelper::ConfigSaveApple2Type(eApple2Type apple2Type)
{
REGSAVE(TEXT(REGVALUE_APPLE2_TYPE), apple2Type);
LogFileOutput("Config: Apple2 Type changed to %d\n", apple2Type);
}
void CPropertySheetHelper::SaveCpuType(eCpuType NewCpuType)

View File

@ -37,6 +37,7 @@ public:
bool IsConfigChanged(void) { return m_ConfigNew != m_ConfigOld; }
void SetDoBenchmark(void) { m_bDoBenchmark = true; }
void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld);
void ConfigSaveApple2Type(eApple2Type apple2Type);
private:
bool IsOkToSaveLoadState(HWND hWnd, const bool bConfigChanged);

View File

@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Harddisk.h"
#include "Joystick.h"
#include "Keyboard.h"
#include "Log.h"
#include "Memory.h"
#include "Mockingboard.h"
#include "MouseInterface.h"
@ -1279,7 +1280,7 @@ void MemInitializeROM(void)
case A2TYPE_TK30002E: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_TK3000_2E_ROM ), "ROM"); ROM_SIZE = Apple2eRomSize; break;
}
if(hResInfo == NULL)
if (hResInfo == NULL)
{
TCHAR sRomFileName[ MAX_PATH ];
switch (g_Apple2Type)
@ -1295,18 +1296,21 @@ void MemInitializeROM(void)
default:
{
_tcscpy(sRomFileName, TEXT("Unknown type!"));
REGSAVE(TEXT(REGVALUE_APPLE2_TYPE), A2TYPE_APPLE2EENHANCED);
sg_PropertySheet.ConfigSaveApple2Type(A2TYPE_APPLE2EENHANCED);
}
}
TCHAR sText[ MAX_PATH ];
wsprintf( sText, TEXT("Unable to open the required firmware ROM data file.\n\nFile: %s"), sRomFileName );
TCHAR sText[MAX_PATH];
_snprintf(sText, sizeof(sText)-1, TEXT("Unable to open the required firmware ROM data file.\n\nFile: %s"), sRomFileName);
LogFileOutput("%s\n", sText);
MessageBox(
GetDesktopWindow(),
sText,
g_pAppTitle,
MB_ICONSTOP | MB_SETFOREGROUND);
ExitProcess(1);
}