diff --git a/ApplewinExpress10.00.vcxproj b/ApplewinExpress10.00.vcxproj index f00ab559..62fdc484 100644 --- a/ApplewinExpress10.00.vcxproj +++ b/ApplewinExpress10.00.vcxproj @@ -267,6 +267,7 @@ + Create Create @@ -469,14 +470,6 @@ - - - - - - - - @@ -491,6 +484,7 @@ + @@ -518,16 +512,26 @@ + + + + + + + + + + diff --git a/ApplewinExpress10.00.vcxproj.filters b/ApplewinExpress10.00.vcxproj.filters index 023cd320..3052e88a 100644 --- a/ApplewinExpress10.00.vcxproj.filters +++ b/ApplewinExpress10.00.vcxproj.filters @@ -215,6 +215,9 @@ Source\Video + + Source\Emulator + @@ -501,6 +504,9 @@ Resources + + Resources + Resources @@ -582,6 +588,24 @@ Resources + + Resources + + + Resources + + + Resources + + + Resources + + + Resources + + + Resources + Resources @@ -597,9 +621,15 @@ Resources + + Resources + Resources + + Resources + Resources @@ -612,16 +642,12 @@ Resources - + + Resources + + Resources - - - - - - - diff --git a/ApplewinExpress9.00.vcproj b/ApplewinExpress9.00.vcproj index aa4af152..95f88eb8 100644 --- a/ApplewinExpress9.00.vcproj +++ b/ApplewinExpress9.00.vcproj @@ -1242,6 +1242,10 @@ RelativePath="RESOURCE\RUN.BMP" > + + @@ -1258,6 +1262,14 @@ RelativePath=".\resource\ThunderClockPlus.rom" > + + + + diff --git a/resource/Applewin.rc b/resource/Applewin.rc index b463a359..983ea401 100644 --- a/resource/Applewin.rc +++ b/resource/Applewin.rc @@ -53,6 +53,7 @@ END FULLSCR_BUTTON BITMAP "FULLSCR.BMP" RUN_BUTTON BITMAP "RUN.BMP" RUNP_BUTTON BITMAP "RUNP.BMP" +RUN3000E_BUTTON BITMAP "RUN3000E.BMP" DEBUG_BUTTON BITMAP "DEBUG.BMP" DRIVE1_BUTTON BITMAP "DRIVE1.BMP" DRIVE2_BUTTON BITMAP "DRIVE2.BMP" @@ -308,6 +309,7 @@ IDR_PRINTDRVR_FW FIRMWARE "Parallel.rom" IDR_MOCKINGBOARD_D_FW FIRMWARE "Mockingboard-D.rom" IDR_MOUSEINTERFACE_FW FIRMWARE "MouseInterface.rom" IDR_THUNDERCLOCKPLUS_FW FIRMWARE "ThunderClockPlus.rom" +IDR_TKCLOCK_FW FIRMWARE "TKClock.rom" ///////////////////////////////////////////////////////////////////////////// // @@ -321,6 +323,7 @@ IDR_APPLE2E_ENHANCED_ROM ROM "Apple2e_Enhanced.rom" IDR_PRAVETS_82_ROM ROM "Pravets82.rom" IDR_PRAVETS_8M_ROM ROM "Pravets8M.rom" IDR_PRAVETS_8C_ROM ROM "Pravets8C.rom" +IDR_TK3000_2E_ROM ROM "TK3000e.rom" IDR_FREEZES_F8_ROM ROM "FREEZES_NON-AUTOSTART_F8_ROM.rom" ///////////////////////////////////////////////////////////////////////////// diff --git a/resource/RUN3000E.bmp b/resource/RUN3000E.bmp new file mode 100644 index 00000000..1c828c27 Binary files /dev/null and b/resource/RUN3000E.bmp differ diff --git a/resource/TK3000e.rom b/resource/TK3000e.rom new file mode 100644 index 00000000..3e73abb9 Binary files /dev/null and b/resource/TK3000e.rom differ diff --git a/resource/TKClock.rom b/resource/TKClock.rom new file mode 100644 index 00000000..94a955bf Binary files /dev/null and b/resource/TKClock.rom differ diff --git a/resource/resource.h b/resource/resource.h index 651ce3ce..aa46914a 100644 --- a/resource/resource.h +++ b/resource/resource.h @@ -1,132 +1,134 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Applewin.rc -// -#define IDC_COMPUTER 101 -#define IDC_JOYSTICK0 102 -#define IDC_SOUNDTYPE 103 -#define IDC_SERIALPORT 104 -#define IDR_ACCELERATOR1 105 -#define IDC_VIDEOTYPE 106 -#define IDD_PROPPAGE_INPUT 107 -#define IDC_AUTHENTIC_SPEED 108 -#define IDD_PROPPAGE_CONFIG 109 -#define IDC_CUSTOM_SPEED 110 -#define IDC_SLIDER_CPU_SPEED 111 -#define IDD_PROPPAGE_SOUND 112 -#define IDC_DISKTYPE 113 -#define IDC_JOYSTICK1 115 -#define IDD_PROPPAGE_DISK 116 -#define IDC_BENCHMARK 117 -#define IDC_LOADSTATE 118 -#define IDR_HDDRVR_FW 119 -#define IDC_0_5_MHz 120 -#define IDB_APPLEWIN 121 -#define IDC_1_0_MHz 122 -#define IDC_2_0_MHz 123 -#define IDC_MAX_MHz 124 -#define IDR_MENU 125 -#define IDR_APPLE2_ROM 126 -#define IDR_APPLE2_PLUS_ROM 127 -#define IDR_APPLE2E_ROM 128 -#define IDR_APPLE2E_ENHANCED_ROM 129 -#define IDC_MB_ENABLE 130 -#define IDD_TFE_SETTINGS_DIALOG 131 -#define IDR_PRINTDRVR_FW 132 -#define IDD_PROPPAGE_ADVANCED 132 -#define IDR_DISK2_FW 133 -#define IDR_SSC_FW 134 -#define IDR_MOCKINGBOARD_D_FW 135 -#define IDR_MOUSEINTERFACE_FW 136 -#define IDR_THUNDERCLOCKPLUS_FW 137 -#define IDR_FREEZES_F8_ROM 138 -#define IDR_PRAVETS_82_ROM 139 -#define IDR_PRAVETS_8M_ROM 140 -#define IDR_PRAVETS_8C_ROM 142 -#define IDR_MENU_DISK_POPUP 143 -#define IDD_ABOUT 145 -#define IDC_CHECK_CONFIRM_REBOOT 146 -#define IDC_KEYB_BUFFER_ENABLE 1005 -#define IDC_SAVESTATE 1006 -#define IDC_SAVESTATE_ON_EXIT 1007 -#define IDC_SAVESTATE_FILENAME 1008 -#define IDC_SPKR_VOLUME 1009 -#define IDC_MB_VOLUME 1010 -#define IDC_SAVESTATE_BROWSE 1011 -#define IDC_MONOCOLOR 1012 -#define IDC_HDD1 1013 -#define IDC_HDD2 1014 -#define IDC_DISK1 1015 -#define IDC_DISK2 1016 -#define IDC_EDIT_DISK1 1017 -#define IDC_EDIT_DISK2 1018 -#define IDC_PASTE_FROM_CLIPBOARD 1018 -#define IDC_EDIT_HDD1 1019 -#define IDC_EDIT_HDD2 1020 -#define IDC_HDD_ENABLE 1021 -#define IDC_SPIN_XTRIM 1026 -#define IDC_SPIN_YTRIM 1027 -#define IDC_PHASOR_ENABLE 1029 -#define IDC_SAM_ENABLE 1030 -#define IDC_SOUNDCARD_DISABLE 1031 - -#define IDC_TFE_SETTINGS_ENABLE_T 1032 -#define IDC_TFE_SETTINGS_ENABLE 1033 -#define IDC_TFE_SETTINGS_INTERFACE_T 1034 -#define IDC_TFE_SETTINGS_INTERFACE 1035 -#define IDC_TFE_SETTINGS_INTERFACE_NAME 1036 -#define IDC_TFE_SETTINGS_INTERFACE_DESC 1037 -#define IDS_TFE_CAPTION 1038 -#define IDS_TFE_ETHERNET 1039 -#define IDS_TFE_INTERFACE 1040 -#define IDS_OK 1041 -#define IDS_CANCEL 1042 -#define IDC_ETHERNET 1043 -#define IDC_SCROLLLOCK_TOGGLE 1044 -#define IDC_MOUSE_IN_SLOT4 1045 -#define IDC_THE_FREEZES_F8_ROM_FW 1046 -#define IDC_MOUSE_CROSSHAIR 1047 -#define IDC_CLONETYPE 1048 -#define IDC_MOUSE_RESTRICT_TO_WINDOW 1049 -#define IDC_CIDERPRESS_BROWSE 1050 -#define IDC_CIDERPRESS_FILENAME 1051 -#define IDC_CPM_CONFIG 1052 -#define IDC_DUMPTOPRINTER 1053 -#define IDC_PRINTER_DUMP_FILENAME 1054 -#define IDC_PRINTER_DUMP_FILENAME_BROWSE 1055 -#define IDC_PRINTER_CONVERT_ENCODING 1056 -#define IDC_PRINTER_FILTER_UNPRINTABLE 1057 -#define IDC_PRINTER_APPEND 1058 -#define IDC_SPIN_PRINTER_IDLE 1059 - -#define IDC_CHECK_HALF_SCAN_LINES 1060 -#define IDC_GPL_TEXT 1061 -#define IDC_GPL_BORDER 1063 -#define IDC_APPLEWIN_VERSION 1064 -#define IDC_APPLEWIN_ICON 1065 -#define IDC_CURSORCONTROL 1066 -#define IDC_AUTOFIRE 1067 -#define IDC_CENTERINGCONTROL 1068 -#define IDC_COMBO_HDD1 1078 -#define IDC_COMBO_HDD2 1079 -#define IDC_COMBO_DISK1 1080 -#define IDC_COMBO_DISK2 1081 -#define IDM_EXIT 40001 -#define IDM_HELP 40002 -#define IDM_ABOUT 40003 -#define ID_DISKMENU_EJECT 40004 -#define ID_DISKMENU_WRITEPROTECTION_ON 40005 -#define ID_DISKMENU_WRITEPROTECTION_OFF 40006 -#define ID_DISKMENU_SENDTO_CIDERPRESS 40007 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 147 -#define _APS_NEXT_COMMAND_VALUE 40012 -#define _APS_NEXT_CONTROL_VALUE 1082 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Applewin.rc +// +#define IDC_COMPUTER 101 +#define IDC_JOYSTICK0 102 +#define IDC_SOUNDTYPE 103 +#define IDC_SERIALPORT 104 +#define IDR_ACCELERATOR1 105 +#define IDC_VIDEOTYPE 106 +#define IDD_PROPPAGE_INPUT 107 +#define IDC_AUTHENTIC_SPEED 108 +#define IDD_PROPPAGE_CONFIG 109 +#define IDC_CUSTOM_SPEED 110 +#define IDC_SLIDER_CPU_SPEED 111 +#define IDD_PROPPAGE_SOUND 112 +#define IDC_DISKTYPE 113 +#define IDC_JOYSTICK1 115 +#define IDD_PROPPAGE_DISK 116 +#define IDC_BENCHMARK 117 +#define IDC_LOADSTATE 118 +#define IDR_HDDRVR_FW 119 +#define IDC_0_5_MHz 120 +#define IDB_APPLEWIN 121 +#define IDC_1_0_MHz 122 +#define IDC_2_0_MHz 123 +#define IDC_MAX_MHz 124 +#define IDR_MENU 125 +#define IDR_APPLE2_ROM 126 +#define IDR_APPLE2_PLUS_ROM 127 +#define IDR_APPLE2E_ROM 128 +#define IDR_APPLE2E_ENHANCED_ROM 129 +#define IDC_MB_ENABLE 130 +#define IDD_TFE_SETTINGS_DIALOG 131 +#define IDR_PRINTDRVR_FW 132 +#define IDD_PROPPAGE_ADVANCED 132 +#define IDR_DISK2_FW 133 +#define IDR_SSC_FW 134 +#define IDR_MOCKINGBOARD_D_FW 135 +#define IDR_MOUSEINTERFACE_FW 136 +#define IDR_THUNDERCLOCKPLUS_FW 137 +#define IDR_FREEZES_F8_ROM 138 +#define IDR_PRAVETS_82_ROM 139 +#define IDR_PRAVETS_8M_ROM 140 +#define IDR_PRAVETS_8C_ROM 142 +#define IDR_MENU_DISK_POPUP 143 +#define IDD_ABOUT 145 +#define IDC_CHECK_CONFIRM_REBOOT 146 +#define IDR_TK3000_2E_ROM 147 +#define IDR_TKCLOCK_FW 148 +#define IDC_KEYB_BUFFER_ENABLE 1005 +#define IDC_SAVESTATE 1006 +#define IDC_SAVESTATE_ON_EXIT 1007 +#define IDC_SAVESTATE_FILENAME 1008 +#define IDC_SPKR_VOLUME 1009 +#define IDC_MB_VOLUME 1010 +#define IDC_SAVESTATE_BROWSE 1011 +#define IDC_MONOCOLOR 1012 +#define IDC_HDD1 1013 +#define IDC_HDD2 1014 +#define IDC_DISK1 1015 +#define IDC_DISK2 1016 +#define IDC_EDIT_DISK1 1017 +#define IDC_EDIT_DISK2 1018 +#define IDC_PASTE_FROM_CLIPBOARD 1018 +#define IDC_EDIT_HDD1 1019 +#define IDC_EDIT_HDD2 1020 +#define IDC_HDD_ENABLE 1021 +#define IDC_SPIN_XTRIM 1026 +#define IDC_SPIN_YTRIM 1027 +#define IDC_PHASOR_ENABLE 1029 +#define IDC_SAM_ENABLE 1030 +#define IDC_SOUNDCARD_DISABLE 1031 + +#define IDC_TFE_SETTINGS_ENABLE_T 1032 +#define IDC_TFE_SETTINGS_ENABLE 1033 +#define IDC_TFE_SETTINGS_INTERFACE_T 1034 +#define IDC_TFE_SETTINGS_INTERFACE 1035 +#define IDC_TFE_SETTINGS_INTERFACE_NAME 1036 +#define IDC_TFE_SETTINGS_INTERFACE_DESC 1037 +#define IDS_TFE_CAPTION 1038 +#define IDS_TFE_ETHERNET 1039 +#define IDS_TFE_INTERFACE 1040 +#define IDS_OK 1041 +#define IDS_CANCEL 1042 +#define IDC_ETHERNET 1043 +#define IDC_SCROLLLOCK_TOGGLE 1044 +#define IDC_MOUSE_IN_SLOT4 1045 +#define IDC_THE_FREEZES_F8_ROM_FW 1046 +#define IDC_MOUSE_CROSSHAIR 1047 +#define IDC_CLONETYPE 1048 +#define IDC_MOUSE_RESTRICT_TO_WINDOW 1049 +#define IDC_CIDERPRESS_BROWSE 1050 +#define IDC_CIDERPRESS_FILENAME 1051 +#define IDC_CPM_CONFIG 1052 +#define IDC_DUMPTOPRINTER 1053 +#define IDC_PRINTER_DUMP_FILENAME 1054 +#define IDC_PRINTER_DUMP_FILENAME_BROWSE 1055 +#define IDC_PRINTER_CONVERT_ENCODING 1056 +#define IDC_PRINTER_FILTER_UNPRINTABLE 1057 +#define IDC_PRINTER_APPEND 1058 +#define IDC_SPIN_PRINTER_IDLE 1059 + +#define IDC_CHECK_HALF_SCAN_LINES 1060 +#define IDC_GPL_TEXT 1061 +#define IDC_GPL_BORDER 1063 +#define IDC_APPLEWIN_VERSION 1064 +#define IDC_APPLEWIN_ICON 1065 +#define IDC_CURSORCONTROL 1066 +#define IDC_AUTOFIRE 1067 +#define IDC_CENTERINGCONTROL 1068 +#define IDC_COMBO_HDD1 1078 +#define IDC_COMBO_HDD2 1079 +#define IDC_COMBO_DISK1 1080 +#define IDC_COMBO_DISK2 1081 +#define IDM_EXIT 40001 +#define IDM_HELP 40002 +#define IDM_ABOUT 40003 +#define ID_DISKMENU_EJECT 40004 +#define ID_DISKMENU_WRITEPROTECTION_ON 40005 +#define ID_DISKMENU_WRITEPROTECTION_OFF 40006 +#define ID_DISKMENU_SENDTO_CIDERPRESS 40007 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 149 +#define _APS_NEXT_COMMAND_VALUE 40012 +#define _APS_NEXT_CONTROL_VALUE 1082 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/source/Applewin.cpp b/source/Applewin.cpp index b7423717..8bb4bac7 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -441,6 +441,7 @@ void SetCharsetType(void) case A2TYPE_APPLE2PLUS: g_nCharsetType = 0; break; case A2TYPE_APPLE2E: g_nCharsetType = 0; break; case A2TYPE_APPLE2EENHANCED:g_nCharsetType = 0; break; + case A2TYPE_TK30002E: g_nCharsetType = 0; break; case A2TYPE_PRAVETS82: g_nCharsetType = 1; break; case A2TYPE_PRAVETS8M: g_nCharsetType = 2; break; //This charset has a very small difference with the PRAVETS82 one, and probably has some misplaced characters. case A2TYPE_PRAVETS8A: g_nCharsetType = 3; break; diff --git a/source/CPU.cpp b/source/CPU.cpp index 52fe8794..b2d525be 100644 --- a/source/CPU.cpp +++ b/source/CPU.cpp @@ -171,7 +171,7 @@ void SetMainCpu(eCpuType cpu) static bool IsCpu65C02(eApple2Type apple2Type) { // NB. All Pravets clones are 6502 (GH#307) - return (apple2Type == A2TYPE_APPLE2EENHANCED) || (apple2Type & A2TYPE_APPLE2C); + return (apple2Type == A2TYPE_APPLE2EENHANCED) || (apple2Type == A2TYPE_TK30002E) || (apple2Type & A2TYPE_APPLE2C); } eCpuType ProbeMainCpuDefault(eApple2Type apple2Type) diff --git a/source/CPU.h b/source/CPU.h index 5086e9e1..8fb02e3a 100644 --- a/source/CPU.h +++ b/source/CPU.h @@ -36,7 +36,7 @@ void CpuWrite(USHORT addr, BYTE a, ULONG uExecutedCycles); DWORD CpuGetEmulationTime_ms(void); -enum eCpuType {CPU_6502=1, CPU_65C02, CPU_Z80}; // Don't change! Persisted to Registry +enum eCpuType {CPU_UNKNOWN=0, CPU_6502=1, CPU_65C02, CPU_Z80}; // Don't change! Persisted to Registry eCpuType GetMainCpu(void); void SetMainCpu(eCpuType cpu); diff --git a/source/Common.h b/source/Common.h index 32c76ef1..d0a27a9a 100644 --- a/source/Common.h +++ b/source/Common.h @@ -63,6 +63,7 @@ enum AppMode_e #define TITLE_PRAVETS_82 TEXT("Pravets 82 Emulator") #define TITLE_PRAVETS_8M TEXT("Pravets 8M Emulator") #define TITLE_PRAVETS_8A TEXT("Pravets 8A Emulator") +#define TITLE_TK3000_2E TEXT("TK3000 //e Emulator") #define TITLE_PAUSED TEXT("* PAUSED *") #define TITLE_STEPPING TEXT("Stepping") @@ -184,6 +185,7 @@ enum eApple2Type { 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_PRAVETS8A, // Apple //e clone + A2TYPE_TK30002E, // Apple //e enhanced clone A2TYPE_MAX }; diff --git a/source/Configuration/PageAdvanced.cpp b/source/Configuration/PageAdvanced.cpp index c50cf5c7..a46d12c6 100644 --- a/source/Configuration/PageAdvanced.cpp +++ b/source/Configuration/PageAdvanced.cpp @@ -33,12 +33,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA CPageAdvanced* CPageAdvanced::ms_this = 0; // reinit'd in ctor -enum CLONECHOICE {MENUITEM_CLONEMIN, MENUITEM_PRAVETS82=MENUITEM_CLONEMIN, MENUITEM_PRAVETS8M, MENUITEM_PRAVETS8A, MENUITEM_CLONEMAX}; +enum CLONECHOICE {MENUITEM_CLONEMIN, MENUITEM_PRAVETS82=MENUITEM_CLONEMIN, MENUITEM_PRAVETS8M, MENUITEM_PRAVETS8A, MENUITEM_TK30002E, MENUITEM_CLONEMAX}; const TCHAR CPageAdvanced::m_CloneChoices[] = TEXT("Pravets 82\0") // Bulgarian - TEXT("Pravets 8M\0") // Bulgarian - TEXT("Pravets 8A\0"); // Bulgarian - + TEXT("Pravets 8M\0") // Bulgarian + TEXT("Pravets 8A\0") // Bulgarian + TEXT("TK3000 //e"); // Brazilian BOOL CALLBACK CPageAdvanced::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { @@ -117,6 +117,7 @@ BOOL CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR const DWORD NewCloneMenuItem = (DWORD) SendDlgItemMessage(hWnd, IDC_CLONETYPE, CB_GETCURSEL, 0, 0); const eApple2Type NewCloneType = GetCloneType(NewCloneMenuItem); m_PropertySheetHelper.GetConfigNew().m_Apple2Type = NewCloneType; + m_PropertySheetHelper.GetConfigNew().m_CpuType = ProbeMainCpuDefault(NewCloneType); } break; } @@ -221,6 +222,7 @@ eApple2Type CPageAdvanced::GetCloneType(DWORD NewMenuItem) case MENUITEM_PRAVETS82: return A2TYPE_PRAVETS82; case MENUITEM_PRAVETS8M: return A2TYPE_PRAVETS8M; case MENUITEM_PRAVETS8A: return A2TYPE_PRAVETS8A; + case MENUITEM_TK30002E: return A2TYPE_TK30002E; default: return A2TYPE_PRAVETS82; } } diff --git a/source/Configuration/PageConfig.cpp b/source/Configuration/PageConfig.cpp index 44be7a0e..a6834fcb 100644 --- a/source/Configuration/PageConfig.cpp +++ b/source/Configuration/PageConfig.cpp @@ -131,7 +131,16 @@ BOOL CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM const DWORD NewComputerMenuItem = (DWORD) SendDlgItemMessage(hWnd, IDC_COMPUTER, CB_GETCURSEL, 0, 0); const eApple2Type NewApple2Type = GetApple2Type(NewComputerMenuItem); m_PropertySheetHelper.GetConfigNew().m_Apple2Type = NewApple2Type; - m_PropertySheetHelper.GetConfigNew().m_CpuType = ProbeMainCpuDefault(NewApple2Type); + if (NewApple2Type != A2TYPE_CLONE) + { + m_PropertySheetHelper.GetConfigNew().m_CpuType = ProbeMainCpuDefault(NewApple2Type); + } + else // A2TYPE_CLONE + { + // NB. A2TYPE_CLONE could be either 6502(Pravets) or 65C02(TK3000 //e) + // - Set correctly in PageAdvanced.cpp for IDC_CLONETYPE + m_PropertySheetHelper.GetConfigNew().m_CpuType = CPU_UNKNOWN; + } } break; @@ -170,6 +179,7 @@ BOOL CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM case A2TYPE_PRAVETS82: nCurrentChoice = MENUITEM_CLONE; break; case A2TYPE_PRAVETS8M: nCurrentChoice = MENUITEM_CLONE; break; case A2TYPE_PRAVETS8A: nCurrentChoice = MENUITEM_CLONE; break; + case A2TYPE_TK30002E: nCurrentChoice = MENUITEM_CLONE; break; } m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMPUTER, m_ComputerChoices, nCurrentChoice); diff --git a/source/Configuration/PropertySheetHelper.cpp b/source/Configuration/PropertySheetHelper.cpp index a6ec332a..faf51d75 100644 --- a/source/Configuration/PropertySheetHelper.cpp +++ b/source/Configuration/PropertySheetHelper.cpp @@ -324,6 +324,18 @@ void CPropertySheetHelper::PostMsgAfterClose(HWND hWnd, PAGETYPE page) UINT uAfterClose = 0; + if (m_ConfigNew.m_Apple2Type == A2TYPE_CLONE) + { + MessageBox(hWnd, "Error - Unable to change configuration\n\nReason: A specific clone wasn't selected from the Advanced tab", g_pAppTitle, MB_ICONSTOP | MB_SETFOREGROUND); + return; + } + + _ASSERT(m_ConfigNew.m_CpuType != CPU_UNKNOWN); // NB. Could only ever be CPU_UNKNOWN for a clone (and only if a mistake was made when adding a new clone) + if (m_ConfigNew.m_CpuType == CPU_UNKNOWN) + { + m_ConfigNew.m_CpuType = ProbeMainCpuDefault(m_ConfigNew.m_Apple2Type); + } + if (IsConfigChanged()) { if (!CheckChangesForRestart(hWnd)) diff --git a/source/Frame.cpp b/source/Frame.cpp index c43380a4..3020acaf 100644 --- a/source/Frame.cpp +++ b/source/Frame.cpp @@ -204,13 +204,14 @@ static void GetAppleWindowTitle() switch (g_Apple2Type) { default: - case A2TYPE_APPLE2: _tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2 ); break; - case A2TYPE_APPLE2PLUS: _tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2_PLUS ); break; - case A2TYPE_APPLE2E: _tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2E ); break; - case A2TYPE_APPLE2EENHANCED:_tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2E_ENHANCED); break; - case A2TYPE_PRAVETS82: _tcscpy(g_pAppleWindowTitle, TITLE_PRAVETS_82 ); break; - case A2TYPE_PRAVETS8M: _tcscpy(g_pAppleWindowTitle, TITLE_PRAVETS_8M ); break; - case A2TYPE_PRAVETS8A: _tcscpy(g_pAppleWindowTitle, TITLE_PRAVETS_8A ); break; + case A2TYPE_APPLE2: _tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2 ); break; + case A2TYPE_APPLE2PLUS: _tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2_PLUS ); break; + case A2TYPE_APPLE2E: _tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2E ); break; + case A2TYPE_APPLE2EENHANCED:_tcscpy(g_pAppleWindowTitle, TITLE_APPLE_2E_ENHANCED); break; + case A2TYPE_PRAVETS82: _tcscpy(g_pAppleWindowTitle, TITLE_PRAVETS_82 ); break; + case A2TYPE_PRAVETS8M: _tcscpy(g_pAppleWindowTitle, TITLE_PRAVETS_8M ); break; + case A2TYPE_PRAVETS8A: _tcscpy(g_pAppleWindowTitle, TITLE_PRAVETS_8A ); break; + case A2TYPE_TK30002E: _tcscpy(g_pAppleWindowTitle, TITLE_TK3000_2E ); break; } #if _DEBUG @@ -312,6 +313,9 @@ static void CreateGdiObjects(void) case A2TYPE_PRAVETS8A: buttonbitmap[BTN_RUN] = (HBITMAP)LOADBUTTONBITMAP(TEXT("RUNP_BUTTON")); break; + case A2TYPE_TK30002E: + buttonbitmap[BTN_RUN] = (HBITMAP)LOADBUTTONBITMAP(TEXT("RUN3000E_BUTTON")); + break; default: buttonbitmap[BTN_RUN] = (HBITMAP)LOADBUTTONBITMAP(TEXT("RUN_BUTTON")); break; diff --git a/source/Keyboard.cpp b/source/Keyboard.cpp index be0001ef..47f1687d 100644 --- a/source/Keyboard.cpp +++ b/source/Keyboard.cpp @@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "Pravets.h" #include "Tape.h" #include "YamlHelper.h" +#include "Video.h" // Needed by TK3000 //e, to refresh the frame at each |Mode| change static bool g_bKeybBufferEnable = false; @@ -48,6 +49,8 @@ bool g_bShiftKey = false; bool g_bCtrlKey = false; bool g_bAltKey = false; +static bool g_bTK3KModeKey = false; //TK3000 //e |Mode| key + static bool g_bCapsLock = true; //Caps lock key for Apple2 and Lat/Cyr lock for Pravets8 static bool g_bP8CapsLock = true; //Caps lock key of Pravets 8A/C static int lastvirtkey = 0; // Current PC keycode @@ -173,7 +176,7 @@ void KeybQueueKeypress (int key, BOOL bASCII) } g_bFreshReset = false; - if (key > 0x7F) + if ((key > 0x7F) && !g_bTK3KModeKey) // When in TK3000 mode, we have special keys which need remapping return; if (!IS_APPLE2) @@ -279,6 +282,32 @@ void KeybQueueKeypress (int key, BOOL bASCII) } } } + // Remap for the TK3000 //e, which had a special |Mode| key for displaying accented chars on screen + // Borrowed from Fábio Belavenuto's TK3000e emulator (Copyright (C) 2004) - http://code.google.com/p/tk3000e/ + if (g_bTK3KModeKey) // We already switch this on only if the the TK3000 is currently being emulated + { + if ((key >= 0xC0) && (key <= 0xDA)) key += 0x20; // Convert uppercase to lowercase + switch (key) + { + case 0xE0: key = '_'; break; // à + case 0xE1: key = '@'; break; // á + case 0xE2: key = '\\'; break; // â + case 0xE3: key = '['; break; // ã + case 0xE7: key = ']'; break; // ç + case 0xE9: key = '`'; break; // é + case 0xEA: key = '&'; break; // ê + case 0xED: key = '{'; break; // í + case 0xF3: key = '~'; break; // ó + case 0xF4: key = '}'; break; // ô + case 0xF5: key = '#'; break; // õ + case 0xFA: key = '|'; break; // ú + } + if (key > 0x7F) return; // Get out + if ((key >= 'a') && (key <= 'z') && (g_bCapsLock)) + keycode = key - ('a'-'A'); + else + keycode = key; + } } else { @@ -315,6 +344,16 @@ void KeybQueueKeypress (int key, BOOL bASCII) return; } + if (key == VK_SCROLL) + { // For the TK3000 //e we use Scroll Lock to switch between Apple ][ and accented chars modes + if (g_Apple2Type == A2TYPE_TK30002E) + { + g_bTK3KModeKey = (GetKeyState(VK_SCROLL) & 1) ? true : false; // Sync with the Scroll Lock status + FrameRefreshStatus(DRAW_LEDS); // TODO: Implement |Mode| LED in the UI; make it appear only when in TK3000 mode + VideoRedrawScreen(); // TODO: Still need to implement page mode switching and 'whatnot' + } + } + if (!((key >= VK_LEFT) && (key <= VK_DELETE) && asciicode[IS_APPLE2 ? 0 : 1][key - VK_LEFT])) return; diff --git a/source/Memory.cpp b/source/Memory.cpp index f69112ed..1ddba2f1 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -1176,6 +1176,7 @@ void MemInitializeROM(void) case A2TYPE_PRAVETS82: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_PRAVETS_82_ROM ), "ROM"); ROM_SIZE = Apple2RomSize ; break; case A2TYPE_PRAVETS8M: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_PRAVETS_8M_ROM ), "ROM"); ROM_SIZE = Apple2RomSize ; break; case A2TYPE_PRAVETS8A: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_PRAVETS_8C_ROM ), "ROM"); ROM_SIZE = Apple2eRomSize; break; + case A2TYPE_TK30002E: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_TK3000_2E_ROM ), "ROM"); ROM_SIZE = Apple2eRomSize; break; } if(hResInfo == NULL) @@ -1190,6 +1191,7 @@ void MemInitializeROM(void) case A2TYPE_PRAVETS82: _tcscpy(sRomFileName, TEXT("PRAVETS82.ROM" )); break; case A2TYPE_PRAVETS8M: _tcscpy(sRomFileName, TEXT("PRAVETS8M.ROM" )); break; case A2TYPE_PRAVETS8A: _tcscpy(sRomFileName, TEXT("PRAVETS8C.ROM" )); break; + case A2TYPE_TK30002E: _tcscpy(sRomFileName, TEXT("TK3000e.ROM" )); break; default: { _tcscpy(sRomFileName, TEXT("Unknown type!"));