diff --git a/AppleWin/docs/FREEZE'S NON-AUTOSTART F8 ROM [SPECS].rtf b/AppleWin/docs/FREEZE'S NON-AUTOSTART F8 ROM [SPECS].rtf old mode 100755 new mode 100644 diff --git a/AppleWin/help/cfg-advanced-freeze-rom.html b/AppleWin/help/cfg-advanced-freeze-rom.html old mode 100755 new mode 100644 diff --git a/AppleWin/help/cfg-advanced-pravets.html b/AppleWin/help/cfg-advanced-pravets.html old mode 100755 new mode 100644 diff --git a/AppleWin/help/cfg-advanced.html b/AppleWin/help/cfg-advanced.html index 40533482..01abb88f 100644 --- a/AppleWin/help/cfg-advanced.html +++ b/AppleWin/help/cfg-advanced.html @@ -1,68 +1,50 @@ - - -Advanced Settings - -

Advanced Settings

-
Advanced settings -

Save State File Name:
-This is the file name to use for save-state files. The default -directory is the same as where your AppleWin.exe program is stored.

-

Save State on Exit:
-Checking this box will automatically save the current state of the -emulator upon exit.  The state will be saved to the file -specified above (SaveState.aws by default).

-

Save State:
-Press this button to save the current state of the emulator to the file -specified.  You can also save the system state during -emulation by pressing the F11 key.

-

Load State:
-Press this button to load the specified state file into -the emulator.  You can also load the system state during -emulation by pressing the F12 key.

-

Clone:
-If you have specified Computer as 'Clone' on the main Configuration -page, then this drop-down menu can be used to specify the clone type.
-NB. Pravets 82 and 8A are Bulgarian Apple II clones.
-

-

Printer settings (Printer is -emulated at slot 1)

-

Printer dump filename:
-
Data sent to the printer is stored in a text file. Use -this setting to select its location.
-

-

Dump to printer:
-
Use -with caution! Enables dumping to a real printer. If -disabled, the -printout is stored only in printer.txt file in the AppleWin folder. -This probably works properly (not tested) when using a printer -compatible with the printer selected in the Apple II applications. In -modern printers trying to print images will result in printing tens of -pages with nonsense.
-

-

Encoding conversion for clones:
-
Characters are encoded from the character set used in -the real hardware to ASCII. For Pravets 8 this converts MIK to ASCII. -Enabling this could cause problems when printing images.

-

Filter unprintable characters:
-
Some characters represent commands for the printer and -shall not be printed. When saving them to the printer dump file they -may appear as some strange symbols. I may want to disable filtering -when dumping to printer.

Append to printfile:
-
When disabled previous print file is replaced (unless it has a -different name) by the newly created print file. Otherwise newly -printed data is added to the existing print file. I should better -disable appending -when dumping to printer.

Terminate printing after idle:
-
Whan printing is started a printer file is created and it is -closed either after the selected by this widget time expires, or when -the emulator is reset. This setting is emulation speed dependend. -

-

The Freeze's non-autostart F8 rom:
-If you have specified Computer as 'Apple ][' or 'Apple ][+' on the main -Configuration page, then you will be able to enable this setting. -The Freeze F8 rom is a hacker's rom that replaces the normal 2K rom at -$F800. Here's the -original release note -

- \ No newline at end of file + + + + + + Advanced Settings + + + + + + + +

Advanced Settings

+ +
Advanced settings +

Save State File Name:
+ +This is the file name to use for save-state files. The default +directory is the same as where your AppleWin.exe program is stored.

+ +

Save State on Exit:
+ +Checking this box will automatically save the current state of the +emulator upon exit.  The state will be saved to the file +specified above (SaveState.aws by default).

+ +

Save State:
+ +Press this button to save the current state of the emulator to the file +specified.  You can also save the system state during +emulation by pressing the F11 key.

+ +

Load State:
+ +Press this button to load the specified state file into +the emulator.  You can also load the system state during +emulation by pressing the F12 key.

+ +

Clone:
+ +If you have specified Computer as 'Clone' on the main Configuration page, then this drop-down menu can be used to specify the clone type.
+NB. Pravets 82 and 8A are Bulgarian Apple II clones.
+ +

The Freeze's non-autostart F8 rom:
+If you have specified Computer as 'Apple ][' or 'Apple ][+' on the main Configuration page, then you will be able to enable this setting. +The Freeze F8 rom is a hacker's rom that replaces the normal 2K rom at $F800. Here's the original release note + + + diff --git a/AppleWin/help/img/advanced.png b/AppleWin/help/img/advanced.png index 788e34e9..fd2069f2 100644 Binary files a/AppleWin/help/img/advanced.png and b/AppleWin/help/img/advanced.png differ diff --git a/AppleWin/resource/Applewin.rc b/AppleWin/resource/Applewin.rc index a1906490..8dd092eb 100644 --- a/AppleWin/resource/Applewin.rc +++ b/AppleWin/resource/Applewin.rc @@ -60,22 +60,18 @@ DRIVE1_BUTTON BITMAP "DRIVE1.BMP" DRIVE2_BUTTON BITMAP "DRIVE2.BMP" SETUP_BUTTON BITMAP "SETUP.BMP" CHARSET40 BITMAP "CHARSET4.BMP" +CHARSET8C BITMAP "CHARSET8C.BMP" +CHARSET82 BITMAP "CHARSET82.BMP" DISKOFF_BITMAP BITMAP "DISKOFF.BMP" DISKREAD_BITMAP BITMAP "DISKREAD.BMP" DISKWRITE_BITMAP BITMAP "DISKWRIT.BMP" DISKPROT_BITMAP BITMAP "DISKPROT.BMP" CAPSOFF_BITMAP BITMAP "CAPSOFF.BMP" CAPSON_BITMAP BITMAP "CAPSON.BMP" -//Pravets8 appendices LATOFF_BITMAP BITMAP "LATOFF.BMP" LATON_BITMAP BITMAP "LATON.BMP" CAPSOFF_P8_BITMAP BITMAP "CAPSOFF_P8.BMP" CAPSON_P8_BITMAP BITMAP "CAPSON_P8.BMP" -CHARSET82 BITMAP "CHARSET82.BMP" -//CHARSET8M BITMAP "CHARSET8M.BMP" //Still the exact charset of Pravets 8M is unknown -CHARSET8M BITMAP "CHARSET8C.BMP" -CHARSET8C BITMAP "CHARSET8C.BMP" -/////////////////////////////////////////////////////////////////////////// HELP_BUTTON BITMAP "HELP.BMP" DRIVESWAP_BUTTON BITMAP "DRIVESWAP.BMP" IDB_APPLEWIN BITMAP "Applewin.bmp" @@ -202,32 +198,19 @@ STYLE DS_SETFONT | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_CAPTION | WS_SYSMENU CAPTION "Advanced" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - - LTEXT "Save State file name:",IDC_STATIC,5,2,74,8 - GROUPBOX "Save State Control",IDC_STATIC,5,27,200,63 - CONTROL "Save State on exit",IDC_SAVESTATE_ON_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,38,74,10 - PUSHBUTTON "Save State",IDC_SAVESTATE,16,50,85,15 - PUSHBUTTON "Load State",IDC_LOADSTATE,16,67,85,15 - EDITTEXT IDC_SAVESTATE_FILENAME,5,23,143,12,ES_AUTOHSCROLL | ES_READONLY - LTEXT "(F11 during emulation)",IDC_STATIC,110,53,90,8 - LTEXT "(F12 during emulation)",IDC_STATIC,110,70,90,8 - PUSHBUTTON "Browse...",IDC_SAVESTATE_BROWSE,154,12,50,14 - LTEXT "Printer dump filename:",IDC_STATIC,5,98,74,8 - PUSHBUTTON "Browse...",IDC_DUMP_FILENAME_BROWSE,154,107,50,14 - EDITTEXT IDC_DUMP_FILENAME,5,108,143,12,ES_AUTOHSCROLL - CONTROL "Dump to printer (use with caution)",IDC_DUMPTOPRINTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,123,180,10 - CONTROL "Encoding conversion for clones",IDC_PRINTER_CONVERT_ENCODING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,133,180,10 - CONTROL "Filter unprintable characters",IDC_PRINTER_FILTER_UNPRINTABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,143,180,10 - CONTROL "Append to print file",IDC_PRINTER_APPEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,153,180,10 - - LTEXT "Teminate printing after idle (in seconds):",IDC_STATIC,3,167,160,8 - CTEXT "10",IDC_STATIC,155,160,24,20,SS_CENTERIMAGE - CONTROL "Spin1",IDC_SPIN_PRINTER_IDLE,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNLEFT | UDS_AUTOBUDDY,161,164,10,14 - - LTEXT "&Clone:",IDC_STATIC,5,185,40,8 - COMBOBOX IDC_CLONETYPE,45,185,100,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "&Clone:",IDC_STATIC,5,165,40,8 + COMBOBOX IDC_CLONETYPE,45,163,100,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "The Freeze's non-autostart F8 rom (Apple ][ or ][+ only)",IDC_THE_FREEZES_F8_ROM_FW, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,206,182,10 + LTEXT "Save State file name:",IDC_STATIC,5,12,74,8 + GROUPBOX "Save State Control",IDC_STATIC,5,57,200,73 + CONTROL "Save State on exit",IDC_SAVESTATE_ON_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,68,74,10 + PUSHBUTTON "Save State",IDC_SAVESTATE,16,85,85,15 + PUSHBUTTON "Load State",IDC_LOADSTATE,16,107,85,15 + EDITTEXT IDC_SAVESTATE_FILENAME,5,23,143,12,ES_AUTOHSCROLL | ES_READONLY + LTEXT "(F11 during emulation)",IDC_STATIC,110,88,74,8 + LTEXT "(F12 during emulation)",IDC_STATIC,110,110,90,8 + PUSHBUTTON "Browse...",IDC_SAVESTATE_BROWSE,154,22,50,14 END @@ -268,7 +251,7 @@ BEGIN VALUE "FileDescription", "Apple //e Emulator for Windows" VALUE "FileVersion", "1, 15, 0, 4" VALUE "InternalName", "APPLEWIN" - VALUE "LegalCopyright", " 1994-2008 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis" + VALUE "LegalCopyright", "© 1994-2008 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis" VALUE "OriginalFilename", "APPLEWIN.EXE" VALUE "ProductName", "Apple //e Emulator" VALUE "ProductVersion", "1, 15, 0, 4" @@ -311,14 +294,13 @@ IDR_THUNDERCLOCKPLUS_FW FIRMWARE "ThunderClockPlus.rom" // ROM // -IDR_APPLE2_ROM ROM "Apple2.rom" -IDR_APPLE2_PLUS_ROM ROM "Apple2_Plus.rom" -IDR_APPLE2E_ROM ROM "Apple2e.rom" -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_FREEZES_F8_ROM ROM "FREEZES_NON-AUTOSTART_F8_ROM.rom" +IDR_APPLE2_ROM ROM "Apple2.rom" +IDR_APPLE2_PLUS_ROM ROM "Apple2_Plus.rom" +IDR_APPLE2E_ROM ROM "Apple2e.rom" +IDR_APPLE2E_ENHANCED_ROM ROM "Apple2e_Enhanced.rom" +IDR_PRAVETS_82_ROM ROM "Pravets82.rom" +IDR_PRAVETS_8C_ROM ROM "Pravets8C.rom" +IDR_FREEZES_F8_ROM ROM "FREEZES_NON-AUTOSTART_F8_ROM.rom" ///////////////////////////////////////////////////////////////////////////// // diff --git a/AppleWin/resource/CHARSET82.bmp b/AppleWin/resource/CHARSET82.bmp index 0396611b..36847980 100644 Binary files a/AppleWin/resource/CHARSET82.bmp and b/AppleWin/resource/CHARSET82.bmp differ diff --git a/AppleWin/resource/CHARSET8M.bmp b/AppleWin/resource/CHARSET8M.bmp deleted file mode 100644 index 53efbb33..00000000 Binary files a/AppleWin/resource/CHARSET8M.bmp and /dev/null differ diff --git a/AppleWin/resource/PRAVETS8M.ROM b/AppleWin/resource/PRAVETS8M.ROM deleted file mode 100644 index e8e057c9..00000000 Binary files a/AppleWin/resource/PRAVETS8M.ROM and /dev/null differ diff --git a/AppleWin/resource/ThunderClockPlus.rom b/AppleWin/resource/ThunderClockPlus.rom old mode 100755 new mode 100644 diff --git a/AppleWin/resource/resource.h b/AppleWin/resource/resource.h index 02767d11..9cae4537 100644 --- a/AppleWin/resource/resource.h +++ b/AppleWin/resource/resource.h @@ -42,8 +42,7 @@ #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_PRAVETS_8C_ROM 140 #define IDC_KEYB_BUFFER_ENABLE 1005 #define IDC_SAVESTATE 1006 #define IDC_SAVESTATE_ON_EXIT 1007 @@ -87,21 +86,13 @@ #define IDC_CIDERPRESS_BROWSE 1049 #define IDC_CIDERPRESS_FILENAME 1050 #define IDC_Z80_IN_SLOT5 1051 -#define IDC_DUMPTOPRINTER 1052 -#define IDC_DUMP_FILENAME 1053 -#define IDC_DUMP_FILENAME_BROWSE 1054 -#define IDC_PRINTER_CONVERT_ENCODING 1055 -#define IDC_PRINTER_FILTER_UNPRINTABLE 1056 -#define IDC_PRINTER_APPEND 1057 -#define IDC_SPIN_PRINTER_IDLE 1058 - #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 +#define ID_DISKMENU_SENDTO_CIDERPRESS 40007 // Next default values for new objects // diff --git a/AppleWin/source/Applewin.cpp b/AppleWin/source/Applewin.cpp index f494b45a..1d62b4fd 100644 --- a/AppleWin/source/Applewin.cpp +++ b/AppleWin/source/Applewin.cpp @@ -76,12 +76,12 @@ CSuperSerialCard sg_SSC; CMouseInterface sg_Mouse; #ifdef SUPPORT_CPM -UINT g_Slot4 = CT_Empty; +UINT g_Slot4 = CT_Empty; #else UINT g_Slot4 = CT_Mockingboard; // CT_Mockingboard or CT_MouseInterface #endif - -eCPU g_ActiveCPU = CPU_6502; + +eCPU g_ActiveCPU = CPU_6502; HANDLE g_hCustomRomF8 = INVALID_HANDLE_VALUE; // Cmd-line specified custom ROM at $F800..$FFFF static bool g_bCustomRomF8Failed = false; // Set if custom ROM file failed @@ -387,8 +387,7 @@ void LoadConfiguration () switch (g_uCloneType) { case 0: g_Apple2Type = A2TYPE_PRAVETS82; break; - case 1: g_Apple2Type = A2TYPE_PRAVETS8M; break; - case 2: g_Apple2Type = A2TYPE_PRAVETS8A; break; + case 1: g_Apple2Type = A2TYPE_PRAVETS8A; break; default: g_Apple2Type = A2TYPE_APPLE2EEHANCED; break; } } @@ -418,7 +417,6 @@ void LoadConfiguration () case A2TYPE_APPLE2EEHANCED: g_nCharsetType = 0; break; case A2TYPE_PRAVETS82: g_nCharsetType = 1; break; case A2TYPE_PRAVETS8A: g_nCharsetType = 2; break; - case A2TYPE_PRAVETS8M: g_nCharsetType = 3; break; //This charset has a very small difference with the PRAVETS82 one an probably has some misplaced characters. Still the Pravets82 charset is used, because settiong charset to 3 results in some problems. } @@ -457,18 +455,6 @@ void LoadConfiguration () if(LOAD(TEXT(REGVALUE_SAVE_STATE_ON_EXIT), &dwTmp)) g_bSaveStateOnExit = dwTmp ? true : false; - if(LOAD(TEXT(REGVALUE_DUMP_TO_PRINTER), &dwTmp)) - g_bDumpToPrinter = dwTmp ? true : false; - - if(LOAD(TEXT(REGVALUE_CONVERT_ENCODING), &dwTmp)) - g_bConvertEncoding = dwTmp ? true : false; - - if(LOAD(TEXT(REGVALUE_FILTER_UNPRINTABLE), &dwTmp)) - g_bFilterUnprintable = dwTmp ? true : false; - - if(LOAD(TEXT(REGVALUE_PRINTER_APPEND), &dwTmp)) - g_bPrinterAppend = dwTmp ? true : false; - if(LOAD(TEXT(REGVALUE_HDD_ENABLED), &dwTmp)) HD_SetEnabled(dwTmp ? true : false); @@ -494,52 +480,46 @@ void LoadConfiguration () g_uMouseRestrictToWindow = dwTmp; #ifdef SUPPORT_CPM - if(LOAD(TEXT(REGVALUE_Z80_IN_SLOT5), &dwTmp)) - g_uZ80InSlot5 = dwTmp; - - if (g_uZ80InSlot5) - MB_SetSoundcardType(SC_NONE); - - g_Slot4 = g_uMouseInSlot4 ? CT_MouseInterface - : g_uZ80InSlot5 ? CT_Empty - : CT_Mockingboard; - #else + if(LOAD(TEXT(REGVALUE_Z80_IN_SLOT5), &dwTmp)) + g_uZ80InSlot5 = dwTmp; + + if (g_uZ80InSlot5) + MB_SetSoundcardType(SC_NONE); + + g_Slot4 = g_uMouseInSlot4 ? CT_MouseInterface + : g_uZ80InSlot5 ? CT_Empty + : CT_Mockingboard; +#else g_Slot4 = g_uMouseInSlot4 ? CT_MouseInterface : CT_Mockingboard; #endif + // - char szFilename[MAX_PATH] = {0}; - RegLoadString(TEXT(REG_CONFIG),TEXT(REGVALUE_SAVESTATE_FILENAME),1,szFilename,sizeof(szFilename)); - Snapshot_SetFilename(szFilename); // If not in Registry than default will be used - - char prFilename[MAX_PATH] = {0}; - RegLoadString(TEXT(REG_CONFIG),TEXT(REGVALUE_PRINTER_FILENAME),1,prFilename,sizeof(prFilename)); - Printer_SetFilename(prFilename); // If not in Registry than default will be used + char szFilename[MAX_PATH] = {0}; - // Current/Starting Dir is the "root" of where the user keeps his disk images - RegLoadString(TEXT(REG_PREFS),REGVALUE_PREF_START_DIR,1,g_sCurrentDir,MAX_PATH); - SetCurrentImageDir(); - - DWORD g_iPrinterIdleL= (10); - /*if(LOAD(TEXT(REGVALUE_PDL_YTRIM), &dwTmp)) - JoySetTrim((short)dwTmp, false); - */ - LOAD(TEXT(REGVALUE_PRINTER_IDLE_LIMIT), &g_iPrinterIdleL); - Printer_SetIdleLimit (g_iPrinterIdleL); + RegLoadString(TEXT(REG_CONFIG),TEXT(REGVALUE_SAVESTATE_FILENAME),1,szFilename,sizeof(szFilename)); + Snapshot_SetFilename(szFilename); // If not in Registry than default will be used - char szUthernetInt[MAX_PATH] = {0}; - RegLoadString(TEXT(REG_CONFIG),TEXT("Uthernet Interface"),1,szUthernetInt,MAX_PATH); - update_tfe_interface(szUthernetInt,NULL); + // Current/Starting Dir is the "root" of where the user keeps his disk images + RegLoadString(TEXT(REG_PREFS),TEXT(REGVALUE_PREF_START_DIR),1,g_sCurrentDir,MAX_PATH); + SetCurrentImageDir(); + Disk_LoadLastDiskImage(0); + Disk_LoadLastDiskImage(1); + + char szUthernetInt[MAX_PATH] = {0}; + RegLoadString(TEXT(REG_CONFIG),TEXT("Uthernet Interface"),1,szUthernetInt,MAX_PATH); + update_tfe_interface(szUthernetInt,NULL); +} + +//=========================================================================== + +void SetCurrentImageDir() +{ + SetCurrentDirectory(g_sCurrentDir); } //=========================================================================== - void SetCurrentImageDir() - { - SetCurrentDirectory(g_sCurrentDir); - } - - //=========================================================================== void RegisterExtensions () { TCHAR szCommandTmp[MAX_PATH]; @@ -587,31 +567,32 @@ void RegisterExtensions () } //=========================================================================== - void AppleWin_RegisterHotKeys() - { - BOOL bStatus = true; - - bStatus &= RegisterHotKey( - g_hFrameWindow , // HWND hWnd - VK_SNAPSHOT_560 , // int id (user/custom id) - 0 , // UINT fsModifiers - VK_SNAPSHOT // UINT vk = PrintScreen - ); - - bStatus &= RegisterHotKey( - g_hFrameWindow , // HWND hWnd - VK_SNAPSHOT_280, // int id (user/custom id) - MOD_SHIFT , // UINT fsModifiers - VK_SNAPSHOT // UINT vk = PrintScreen - ); +void AppleWin_RegisterHotKeys() +{ + BOOL bStatus = true; + + bStatus &= RegisterHotKey( + g_hFrameWindow , // HWND hWnd + VK_SNAPSHOT_560 , // int id (user/custom id) + 0 , // UINT fsModifiers + VK_SNAPSHOT // UINT vk = PrintScreen + ); + + bStatus &= RegisterHotKey( + g_hFrameWindow , // HWND hWnd + VK_SNAPSHOT_280, // int id (user/custom id) + MOD_SHIFT , // UINT fsModifiers + VK_SNAPSHOT // UINT vk = PrintScreen + ); + + if (! bStatus) + { + MessageBox( g_hFrameWindow, "Unable to capture PrintScreen key", "Warning", MB_OK ); + } +} + +//=========================================================================== - if (! bStatus) - { - MessageBox( g_hFrameWindow, "Unable to capture PrintScreen key", "Warning", MB_OK ); - } - } - - //=========================================================================== LPSTR GetCurrArg(LPSTR lpCmdLine) { if(*lpCmdLine == '\"') @@ -724,10 +705,11 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) if ((g_hCustomRomF8 == INVALID_HANDLE_VALUE) || (GetFileSize(g_hCustomRomF8, NULL) != 0x800)) g_bCustomRomF8Failed = true; } - else if(strcmp(lpCmdLine, "-printscreen") == 0) // turn on dispay of the last filename print screen was saved to - { - g_bDisplayPrintScreenFileName = true; - } + else if(strcmp(lpCmdLine, "-printscreen") == 0) // turn on dispay of the last filename print screen was saved to + { + g_bDisplayPrintScreenFileName = true; + } + lpCmdLine = lpNextArg; } @@ -772,7 +754,7 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) unsigned long fix = pFixedFileInfo->dwFileVersionLS >> 16; unsigned long fix_minor = pFixedFileInfo->dwFileVersionLS & 0xffff; -sprintf(VERSIONSTRING, "%d.%d.%d.%d", major, minor, fix, fix_minor); // potential buffer overflow + sprintf(VERSIONSTRING, "%d.%d.%d.%d", major, minor, fix, fix_minor); // potential buffer overflow } } @@ -826,7 +808,7 @@ sprintf(VERSIONSTRING, "%d.%d.%d.%d", major, minor, fix, fix_minor); // potentia VideoInitialize(); FrameCreateWindow(); // PrintScrn support - AppleWin_RegisterHotKeys(); // needs valid g_hFrameWindow + AppleWin_RegisterHotKeys(); // needs valid g_hFrameWindow // Need to test if it's safe to call ResetMachineState(). In the meantime, just call DiskReset(): DiskReset(); // Switch from a booting A][+ to a non-autostart A][, so need to turn off floppy motor diff --git a/AppleWin/source/Common.h b/AppleWin/source/Common.h index e1b36968..2ec3da1a 100644 --- a/AppleWin/source/Common.h +++ b/AppleWin/source/Common.h @@ -35,7 +35,6 @@ enum AppMode_e , MODE_STEPPING }; - #define SPEED_MIN 0 #define SPEED_NORMAL 10 #define SPEED_MAX 40 @@ -61,7 +60,6 @@ enum AppMode_e #define TITLE_APPLE_2E TEXT("Apple //e Emulator") #define TITLE_APPLE_2E_ENHANCED TEXT("Enhanced Apple //e Emulator") #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_PAUSED TEXT(" Paused ") @@ -71,7 +69,7 @@ enum AppMode_e #define SAVE(a,b) RegSaveValue(TEXT("Configuration"),a,1,b) // Configuration -#define REG_CONFIG "Configuration" +#define REG_CONFIG "Configuration" #define REGVALUE_APPLE2_TYPE "Apple2 Type" #define REGVALUE_SPKR_VOLUME "Speaker Volume" #define REGVALUE_MB_VOLUME "Mockingboard Volume" @@ -91,25 +89,20 @@ enum AppMode_e #define REGVALUE_CLONETYPE "Clone Type" #define REGVALUE_CIDERPRESSLOC "CiderPress Location" #define REGVALUE_Z80_IN_SLOT5 "Z80 in slot 5" -#define REGVALUE_DUMP_TO_PRINTER "Dump to printer" -#define REGVALUE_CONVERT_ENCODING "Convert printer encoding for clones" -#define REGVALUE_FILTER_UNPRINTABLE "Filter unprintable characters" -#define REGVALUE_PRINTER_FILENAME "Printer Filename" -#define REGVALUE_PRINTER_APPEND "Append to printer file" -#define REGVALUE_PRINTER_IDLE_LIMIT "Printer idle limit" // Preferences -#define REG_PREFS "Preferences" +#define REG_PREFS "Preferences" #define REGVALUE_PREF_START_DIR "Starting Directory" -#define REGVALUE_PREF_LAST_DISK_1 "Last Disk Image 1" -#define REGVALUE_PREF_LAST_DISK_2 "Last Disk Image 2" +#define REGVALUE_PREF_LAST_DISK_1 "Last Disk Image 1" +#define REGVALUE_PREF_LAST_DISK_2 "Last Disk Image 2" #define WM_USER_BENCHMARK WM_USER+1 #define WM_USER_RESTART WM_USER+2 #define WM_USER_SAVESTATE WM_USER+3 #define WM_USER_LOADSTATE WM_USER+4 -#define VK_SNAPSHOT_560 WM_USER+5 -#define VK_SNAPSHOT_280 WM_USER+6 +#define VK_SNAPSHOT_560 WM_USER+5 +#define VK_SNAPSHOT_280 WM_USER+6 + enum eSOUNDCARDTYPE {SC_UNINIT=0, SC_NONE, SC_MOCKINGBOARD, SC_PHASOR}; // Apple soundcard type @@ -141,7 +134,6 @@ enum eApple2Type { // Clones start here: A2TYPE_CLONE=APPLECLONE_MASK, A2TYPE_PRAVETS82=APPLECLONE_MASK|APPLE2E_MASK, - A2TYPE_PRAVETS8M, A2TYPE_PRAVETS8A, A2TYPE_MAX }; diff --git a/AppleWin/source/Frame.cpp b/AppleWin/source/Frame.cpp index ebcc1149..25c3ea74 100644 --- a/AppleWin/source/Frame.cpp +++ b/AppleWin/source/Frame.cpp @@ -56,7 +56,7 @@ static HBITMAP capsbitmap[2]; //Pravets8 only static HBITMAP capsbitmapP8[2]; static HBITMAP latbitmap[2]; -//static HBITMAP charsetbitmap [4]; //The idea was to add a charset indicator on the front panel, but it was given up. All charsetbitmap occurences must be REMOVED! +static HBITMAP charsetbitmap [3]; //=========================== static HBITMAP diskbitmap[ NUM_DISK_STATUS ]; @@ -78,7 +78,7 @@ static RECT framerect = {0,0,0,0}; HWND g_hFrameWindow = (HWND)0; BOOL fullscreen = 0; static BOOL helpquit = 0; -static BOOL g_bPaintingWindow = 0; +static BOOL g_bPaintingWindow = 0; static HFONT smallfont = (HFONT)0; static HWND tooltipwindow = (HWND)0; static BOOL g_bUsingCursor = 0; // 1=AppleWin is using (hiding) the mouse-cursor @@ -176,7 +176,6 @@ switch (g_Apple2Type) case A2TYPE_APPLE2E: buttonbitmap[BTN_RUN ] =(HBITMAP)LOADBUTTONBITMAP(TEXT("RUN_BUTTON")); break; case A2TYPE_APPLE2EEHANCED: buttonbitmap[BTN_RUN ] =(HBITMAP)LOADBUTTONBITMAP(TEXT("RUN_BUTTON")); break; case A2TYPE_PRAVETS82: buttonbitmap[BTN_RUN ] = (HBITMAP)LOADBUTTONBITMAP(TEXT("RUNP_BUTTON")); break; - case A2TYPE_PRAVETS8M: buttonbitmap[BTN_RUN ] = (HBITMAP)LOADBUTTONBITMAP(TEXT("RUNP_BUTTON")); break; case A2TYPE_PRAVETS8A: buttonbitmap[BTN_RUN ] = (HBITMAP)LOADBUTTONBITMAP(TEXT("RUNP_BUTTON")); break; } @@ -194,11 +193,9 @@ switch (g_Apple2Type) capsbitmapP8[1] = (HBITMAP)LOADBUTTONBITMAP(TEXT("CAPSON_P8_BITMAP")); latbitmap[0] = (HBITMAP)LOADBUTTONBITMAP(TEXT("LATOFF_BITMAP")); latbitmap[1] = (HBITMAP)LOADBUTTONBITMAP(TEXT("LATON_BITMAP")); - /*charsetbitmap[0] = (HBITMAP)LOADBUTTONBITMAP(TEXT("CHARSET_APPLE_BITMAP")); + charsetbitmap[0] = (HBITMAP)LOADBUTTONBITMAP(TEXT("CHARSET_APPLE_BITMAP")); charsetbitmap[1] = (HBITMAP)LOADBUTTONBITMAP(TEXT("CHARSET_82_BITMAP")); charsetbitmap[2] = (HBITMAP)LOADBUTTONBITMAP(TEXT("CHARSET_8A_BITMAP")); - charsetbitmap[3] = (HBITMAP)LOADBUTTONBITMAP(TEXT("CHARSET_8M_BITMAP")); - */ //=========================== diskbitmap[ DISK_STATUS_OFF ] = (HBITMAP)LOADBUTTONBITMAP(TEXT("DISKOFF_BITMAP")); diskbitmap[ DISK_STATUS_READ ] = (HBITMAP)LOADBUTTONBITMAP(TEXT("DISKREAD_BITMAP")); @@ -489,7 +486,6 @@ static void DrawStatusArea (HDC passdc, int drawflags) case A2TYPE_APPLE2E: DrawBitmapRect(dc,x+7,y+19,&rect,capsbitmap[bCaps != 0]); break; case A2TYPE_APPLE2EEHANCED: DrawBitmapRect(dc,x+7,y+19,&rect,capsbitmap[bCaps != 0]); break; case A2TYPE_PRAVETS82: DrawBitmapRect(dc,x+15,y+19,&rect,latbitmap[bCaps != 0]); break; - case A2TYPE_PRAVETS8M: DrawBitmapRect(dc,x+15,y+19,&rect,latbitmap[bCaps != 0]); break; case A2TYPE_PRAVETS8A: DrawBitmapRect(dc,x+2,y+19,&rect,latbitmap[bCaps != 0]); break; } if (g_Apple2Type == A2TYPE_PRAVETS8A) //Toggles Pravets 8A/C Caps lock LED @@ -517,7 +513,6 @@ static void DrawStatusArea (HDC passdc, int drawflags) case A2TYPE_APPLE2E: _tcscpy(title, TITLE_APPLE_2E); break; case A2TYPE_APPLE2EEHANCED: _tcscpy(title, TITLE_APPLE_2E_ENHANCED); break; case A2TYPE_PRAVETS82: _tcscpy(title, TITLE_PRAVETS_82); break; - case A2TYPE_PRAVETS8M: _tcscpy(title, TITLE_PRAVETS_8M); break; case A2TYPE_PRAVETS8A: _tcscpy(title, TITLE_PRAVETS_8A); break; } @@ -596,12 +591,12 @@ LRESULT CALLBACK FrameWndProc ( if ((g_nAppMode == MODE_RUNNING) || (g_nAppMode == MODE_LOGO) || ((g_nAppMode == MODE_STEPPING) && (wparam != TEXT('\x1B')))) { - if( !g_bDebuggerEatKey ) - { - KeybQueueKeypress((int)wparam,ASCII); - } else { - g_bDebuggerEatKey = false; - } + if( !g_bDebuggerEatKey ) + { + KeybQueueKeypress((int)wparam,ASCII); + } else { + g_bDebuggerEatKey = false; + } } else if ((g_nAppMode == MODE_DEBUG) || (g_nAppMode == MODE_STEPPING)) @@ -641,9 +636,9 @@ LRESULT CALLBACK FrameWndProc ( ProcessButtonClick(BTN_RUN); } else - { + { DiskNotifyInvalidImage(filename,error); - } + } GlobalUnlock((HGLOBAL)lparam); break; } @@ -699,35 +694,36 @@ LRESULT CALLBACK FrameWndProc ( break; } - // @see: http://answers.google.com/answers/threadview?id=133059 - // Win32 doesn't pass the PrintScreen key via WM_CHAR - // else if (wparam == VK_SNAPSHOT) - // Solution: 2 choices: - // 1) register hotkey, or - // 2) Use low level Keyboard hooks - // We use the 1st one since it is compatible with Win95 - case WM_HOTKEY: - // wparam = user id - // lparam = modifiers: shift, ctrl, alt, win - if (wparam == VK_SNAPSHOT_560) - { - #if _DEBUG - // MessageBox( NULL, "Double 580x384 size!", "PrintScreen", MB_OK ); - #endif - Video_TakeScreenShot( SCREENSHOT_560x384 ); - } - else - if (wparam == VK_SNAPSHOT_280) - { - if( lparam & MOD_SHIFT) - { - #if _DEBUG - // MessageBox( NULL, "Normal 280x192 size!", "PrintScreen", MB_OK ); - #endif - } - Video_TakeScreenShot( SCREENSHOT_280x192 ); - } - break; + // @see: http://answers.google.com/answers/threadview?id=133059 + // Win32 doesn't pass the PrintScreen key via WM_CHAR + // else if (wparam == VK_SNAPSHOT) + // Solution: 2 choices: + // 1) register hotkey, or + // 2) Use low level Keyboard hooks + // We use the 1st one since it is compatible with Win95 + case WM_HOTKEY: + // wparam = user id + // lparam = modifiers: shift, ctrl, alt, win + if (wparam == VK_SNAPSHOT_560) + { +#if _DEBUG +// MessageBox( NULL, "Double 580x384 size!", "PrintScreen", MB_OK ); +#endif + Video_TakeScreenShot( SCREENSHOT_560x384 ); + } + else + if (wparam == VK_SNAPSHOT_280) + { + if( lparam & MOD_SHIFT) + { +#if _DEBUG +// MessageBox( NULL, "Normal 280x192 size!", "PrintScreen", MB_OK ); +#endif + } + Video_TakeScreenShot( SCREENSHOT_280x192 ); + } + break; + case WM_KEYDOWN: KeybUpdateCtrlShiftStatus(); if ((wparam >= VK_F1) && (wparam <= VK_F8) && (buttondown == -1)) @@ -743,10 +739,10 @@ LRESULT CALLBACK FrameWndProc ( } else if (wparam == VK_F9) { - if (GetKeyState(VK_CONTROL) < 0) //CTRL+F9 + if (GetKeyState(VK_CONTROL) < 0) { - g_nCharsetType++; // Cycle through available charsets (Ctrl + F9). - if (g_nCharsetType >= 3) + g_nCharsetType++; // Cycle through available charsets (Ctrl + F9) + if (g_nCharsetType >= 3) g_nCharsetType = 0; } else // Cycle through available video modes @@ -1421,9 +1417,9 @@ void ResetMachineState () { MB_Reset(); SpkrReset(); sg_Mouse.Reset(); - #ifdef SUPPORT_CPM - g_ActiveCPU = CPU_6502; - #endif +#ifdef SUPPORT_CPM + g_ActiveCPU = CPU_6502; +#endif SoundCore_SetFade(FADE_NONE); } @@ -1541,7 +1537,6 @@ void FrameCreateWindow () case A2TYPE_APPLE2E: g_pAppTitle = TITLE_APPLE_2E; break; case A2TYPE_APPLE2EEHANCED: g_pAppTitle = TITLE_APPLE_2E_ENHANCED; break; case A2TYPE_PRAVETS82: g_pAppTitle = TITLE_PRAVETS_82; break; - case A2TYPE_PRAVETS8M: g_pAppTitle = TITLE_PRAVETS_8M; break; case A2TYPE_PRAVETS8A: g_pAppTitle = TITLE_PRAVETS_8A; break; } diff --git a/AppleWin/source/Keyboard.cpp b/AppleWin/source/Keyboard.cpp index 8297d950..878dc7eb 100644 --- a/AppleWin/source/Keyboard.cpp +++ b/AppleWin/source/Keyboard.cpp @@ -175,6 +175,7 @@ void KeybQueueKeypress (int key, BOOL bASCII) bFreshReset = false; return; // Swallow spurious CTRL-C caused by CTRL-BREAK } + bFreshReset = false; if (key > 0x7F) return; @@ -185,53 +186,40 @@ void KeybQueueKeypress (int key, BOOL bASCII) if (g_bCapsLock && (key >= 'a') && (key <='z')) { P8Shift = true; - keycode = key - 32; + keycode = key - 32; } else { - keycode = key; + keycode = key; } //The latter line should be applied for Pravtes 8A/C only, but not for Pravets 82/M !!! if ((g_bCapsLock == false) && (key >= 'A') && (key <='Z')) { - P8Shift = true; - if (g_Apple2Type == A2TYPE_PRAVETS8A) - keycode = key + 32; + P8Shift = true; + if (g_Apple2Type == A2TYPE_PRAVETS8A) + keycode = key + 32; } - + //Remap some keys for Pravets82/M if (g_Apple2Type == A2TYPE_PRAVETS82) { - if (key == 64) keycode = 96; - if (key == '^') keycode = '~'; - - if (g_bCapsLock == false) //cyrillic letters + if (key == 64) + keycode = 96; + if (key == '^') + keycode = '~'; + + if (g_bCapsLock == false) //i.e. cyrillic letters { if (key == '`') keycode = '^'; if (key == 92) keycode = '@'; // \ to @ if (key == 124) keycode = 92; } - else //(g_bCapsLock == true) //latin letters + else //(g_bCapsLock == true) //i.e. latin letters { - if (key == 91) keycode = 123; - if (key == 93) keycode = 125; - if (key == 124) keycode = 92; - } - } - if (g_Apple2Type == A2TYPE_PRAVETS8M) //Pravets 8M charset is still uncertain - { - if (g_bCapsLock == false) //cyrillic letters - { - if (key == '[') keycode = '{'; - if (key == ']') keycode = '}'; - if (key == '`') keycode = '~'; //96= key `~ - if (key == 92) keycode = 96; - } - else //latin letters - { - if (key == '`') - keycode = '^'; //96= key `~ + if (key == 91) keycode = 123; + if (key == 93) keycode = 125; + if (key == 124) keycode = 92; } } //Remap some keys for Pravets8A/C, which has a different charset for Pravtes82/M, whose keys MUST NOT be remapped. @@ -239,48 +227,48 @@ void KeybQueueKeypress (int key, BOOL bASCII) { if (g_bCapsLock == false) //i.e. cyrillic letters { - if (key == '[') keycode = '{'; - if (key == ']') keycode = '}'; - if (key == '`') keycode = '~'; - if (key == 92) keycode = 96; - if (GetCapsLockAllowed ()== true) - { - if ((key == 92) || (key == 124)) keycode = 96; //Ý to Þ - //This shall be rewriten, so that enabling CAPS_LOCK (i.e. F10) will not invert these keys values) - //The same for latin letters. - if ((key == '{') || (key == '}') || (key == '~') || (key == 124) || (key == '^') || (key == 95)) - P8Shift = true; + if (key == '[') keycode = '{'; + if (key == ']') keycode = '}'; + if (key == '`') keycode = '~'; + if (key == 92) keycode = 96; + if (GetCapsLockAllowed ()== true) + { + if ((key == 92) || (key == 124)) keycode = 96; //Ý to Þ + //This shall be rewriten, so that enabling CAPS_LOCK (i.e. F10) will not invert these keys values) + //The same for latin letters. + if ((key == '{') || (key == '}') || (key == '~') || (key == 124) || (key == '^') || (key == 95)) + P8Shift = true; + } } - } - else //i.e. latin letters + else //i.e. latin letters { if (GetCapsLockAllowed() == false) { - if (key == '{') keycode = '['; - if (key == '}') keycode = ']'; - if (key == 124) - keycode = 92; - /*if (key == 92) - keycode = 124;*/ + if (key == '{') keycode = '['; + if (key == '}') keycode = ']'; + if (key == 124) + keycode = 92; + /*if (key == 92) + keycode = 124;*/ //Characters ` and ~ cannot be generated in 7bit character mode, so they are replaced with } else { - if (key == '{') keycode = 91; - if (key == '}') keycode = 93; - if (key == 124) keycode = 92; - if ((key == '[') || (key == ']') || (key == 92) || (key == '^') || (key == 95)) - P8Shift= true; - if (key == 96) //This line shall generate sth. else i.e. ` In fact. this character is not generateable by the pravets keyboard. + if (key == '{') keycode = 91; + if (key == '}') keycode = 93; + if (key == 124) keycode = 92; + if ((key == '[') || (key == ']') || (key == 92) || (key == '^') || (key == 95)) + P8Shift= true; + if (key == 96) //This line shall generate sth. else i.e. ` In fact. this character is not generateable by the pravets keyboard. { keycode = '^'; P8Shift= true; } - if (key == 126) keycode = '^'; - } - } + if (key == 126) keycode = '^'; + } + } + } } -} else { if (g_Apple2Type == A2TYPE_PRAVETS8A) @@ -288,10 +276,10 @@ void KeybQueueKeypress (int key, BOOL bASCII) } else { - if (key >= '`') - keycode = key - 32; - else - keycode = key; + if (key >= '`') + keycode = key - 32; + else + keycode = key; } } lastvirtkey = LOBYTE(VkKeyScan(key)); @@ -513,9 +501,9 @@ void KeybToggleCapsLock () void KeybToggleP8ACapsLock () { _ASSERT(g_Apple2Type == A2TYPE_PRAVETS8A); - P8CAPS_ON = !P8CAPS_ON; - FrameRefreshStatus(DRAW_LEDS); - // g_bP8CapsLock= g_bP8CapsLock?false:true; //The same as the upper, but slower + P8CAPS_ON = !P8CAPS_ON; + FrameRefreshStatus(DRAW_LEDS); + // g_bP8CapsLock= g_bP8CapsLock?false:true; //The same as the upper, but slower } //=========================================================================== diff --git a/AppleWin/source/Memory.cpp b/AppleWin/source/Memory.cpp index 0bcd6f07..9adefdb2 100644 --- a/AppleWin/source/Memory.cpp +++ b/AppleWin/source/Memory.cpp @@ -963,7 +963,6 @@ void MemInitialize() case A2TYPE_APPLE2E: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_APPLE2E_ROM), "ROM"); ROM_SIZE = Apple2eRomSize; break; case A2TYPE_APPLE2EEHANCED: hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_APPLE2E_ENHANCED_ROM), "ROM"); ROM_SIZE = Apple2eRomSize; break; 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; } @@ -976,8 +975,7 @@ void MemInitialize() case A2TYPE_APPLE2PLUS: _tcscpy(sRomFileName, TEXT("APPLE2_PLUS.ROM")); break; case A2TYPE_APPLE2E: _tcscpy(sRomFileName, TEXT("APPLE2E.ROM")); break; case A2TYPE_APPLE2EEHANCED: _tcscpy(sRomFileName, TEXT("APPLE2E_ENHANCED.ROM")); break; - case A2TYPE_PRAVETS82: _tcscpy(sRomFileName, TEXT("PRAVETS82.ROM")); break; - case A2TYPE_PRAVETS8M: _tcscpy(sRomFileName, TEXT("PRAVETS8M.ROM")); break; + case A2TYPE_PRAVETS82: _tcscpy(sRomFileName, TEXT("PRAVETS82.ROM")); break; //Rom to be changed. Currently an Apple 2E Rom is used, because of the lack of a genuine Pravets82 one. case A2TYPE_PRAVETS8A: _tcscpy(sRomFileName, TEXT("PRAVETS8C.ROM")); break; } diff --git a/AppleWin/source/ParallelPrinter.cpp b/AppleWin/source/ParallelPrinter.cpp index 65e10401..41515950 100644 --- a/AppleWin/source/ParallelPrinter.cpp +++ b/AppleWin/source/ParallelPrinter.cpp @@ -29,30 +29,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "StdAfx.h" #pragma hdrstop #include "..\resource\resource.h" -#include -//#include - static DWORD inactivity = 0; static FILE* file = NULL; DWORD const PRINTDRVR_SIZE = APPLE_SLOT_SIZE; -TCHAR filepath[MAX_PATH * 2]; -#define DEFAULT_PRINT_FILENAME "Printer.txt" -static char g_szPrintFilename[MAX_PATH] = {0}; -bool g_bDumpToPrinter = false; -bool g_bConvertEncoding = true; -bool g_bFilterUnprintable = true; -bool g_bPrinterAppend = false; -int g_iPrinterIdleLimit = 10; //=========================================================================== static BYTE __stdcall PrintStatus(WORD, WORD, BYTE, BYTE, ULONG); static BYTE __stdcall PrintTransmit(WORD, WORD, BYTE, BYTE value, ULONG); - - - VOID PrintLoadRom(LPBYTE pCxRomPeripheral, const UINT uSlot) { HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_PRINTDRVR_FW), "FIRMWARE"); @@ -84,14 +70,10 @@ static BOOL CheckPrint() inactivity = 0; if (file == NULL) { - //TCHAR filepath[MAX_PATH * 2]; - //_tcsncpy(filepath, g_sProgramDir, MAX_PATH); - //_tcsncat(filepath, _T("Printer.txt"), MAX_PATH); - //file = fopen(filepath, "wb"); - if (g_bPrinterAppend ) - file = fopen(Printer_GetFilename(), "ab"); - else - file = fopen(Printer_GetFilename(), "wb"); + TCHAR filepath[MAX_PATH * 2]; + _tcsncpy(filepath, g_sProgramDir, MAX_PATH); + _tcsncat(filepath, _T("Printer.txt"), MAX_PATH); + file = fopen(filepath, "wb"); } return (file != NULL); } @@ -103,15 +85,8 @@ static void ClosePrint() { fclose(file); file = NULL; - string ExtendedFileName = "copy \""; - ExtendedFileName.append (Printer_GetFilename()); - ExtendedFileName.append ("\" prn"); - //if (g_bDumpToPrinter) ShellExecute(NULL, "print", Printer_GetFilename(), NULL, NULL, 0); //Print through Notepad - if (g_bDumpToPrinter) - system (ExtendedFileName.c_str ()); //Print through console. This is supposed to be the better way, because it shall print images (with older printers only). - } - inactivity = 0; + inactivity = 0; } //=========================================================================== @@ -127,10 +102,9 @@ void PrintUpdate(DWORD totalcycles) { return; } -// if ((inactivity += totalcycles) > (Printer_GetIdleLimit () * 1000 * 1000)) //This line seems to give a very big deviation - if ((inactivity += totalcycles) > (Printer_GetIdleLimit () * 710000)) + if ((inactivity += totalcycles) > (10 * 1000 * 1000)) // around 10 seconds { - // inactive, so close the file (next print will overwrite or append to it, according to the settings made) + // inactive, so close the file (next print will overwrite it) ClosePrint(); } } @@ -151,99 +125,13 @@ static BYTE __stdcall PrintStatus(WORD, WORD, BYTE, BYTE, ULONG) //=========================================================================== static BYTE __stdcall PrintTransmit(WORD, WORD, BYTE, BYTE value, ULONG) { - char Lat8A[]= "abwgdevzijklmnoprstufhc~{}yx`q|]"; - char Lat82[]= "abwgdevzijklmnoprstufhc^[]yx@q{}~`"; - char Kir82[]= "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÜÞß[]^@"; - char Kir8ACapital[]= "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÜÞßÝ"; - char Kir8ALowerCase[]= "àáâãäåæçèéêëìíîïðñòóôõö÷øùúüþÿý"; - bool Pres = false; if (!CheckPrint()) { return 0; } - - char c = NULL; - if ((g_Apple2Type == A2TYPE_PRAVETS8A) && g_bConvertEncoding) //This is print conversion for Pravets 8A/C. Print conversion for Pravets82/M is still to be done. - { - if ((value > 90) && (value < 128)) //This range shall be set more precisely - { - c = value; - int loop = 0; - while (loop < 31) - { - if (c== Lat8A[loop]) - c= 0 + Kir8ALowerCase [loop] ; - loop++; - } //End loop - }//End if (value < 128) - else if ((value >64) && (value <91)) - { - c = value + 32; - } - else - { - c = value & 0x7F; - int loop = 0; - while (loop < 31) - { - if (c== Lat8A[loop]) c= 0 + Kir8ACapital [loop]; - loop++; - } - } - } //End if (g_Apple2Type == A2TYPE_PRAVETS8A) - else if (((g_Apple2Type == A2TYPE_PRAVETS82) || (g_Apple2Type == A2TYPE_PRAVETS8M)) && g_bConvertEncoding) - { - c = value & 0x7F; - int loop = 0; - while (loop < 34) - { - if (c == Lat82[loop]) - c= Kir82 [loop]; - loop++; - } //end while - } - else //Apple II - { - c = value & 0x7F; - } - if ((g_bFilterUnprintable == false) || (c>31) || (c==13) || (c==10) || (c<0)) //c<0 is needed for cyrillic characters - fwrite(&c, 1, 1, file); //break; - - - /*else - { - char c = value & 0x7F; + char c = value & 0x7F; fwrite(&c, 1, 1, file); - }*/ - return 0; + return 0; } //=========================================================================== - -char* Printer_GetFilename() -{ - return g_szPrintFilename; -} - -void Printer_SetFilename(char* prtFilename) -{ - if(*prtFilename) - strcpy(g_szPrintFilename, (const char *) prtFilename); - else //No registry entry is available - { - _tcsncpy(g_szPrintFilename, g_sProgramDir, MAX_PATH); - _tcsncat(g_szPrintFilename, _T(DEFAULT_PRINT_FILENAME), MAX_PATH); - RegSaveString(TEXT("Configuration"),REGVALUE_PRINTER_FILENAME,1,g_szPrintFilename); - } -} - -unsigned int Printer_GetIdleLimit() -{ - return g_iPrinterIdleLimit; -} - -//unsigned int -void Printer_SetIdleLimit(unsigned int Duration) -{ - g_iPrinterIdleLimit = Duration; -} diff --git a/AppleWin/source/ParallelPrinter.h b/AppleWin/source/ParallelPrinter.h index f1c2715d..b4c57fd8 100644 --- a/AppleWin/source/ParallelPrinter.h +++ b/AppleWin/source/ParallelPrinter.h @@ -1,18 +1,6 @@ #pragma once -void PrintDestroy(); -void PrintLoadRom(LPBYTE pCxRomPeripheral, UINT uSlot); -void PrintReset(); -void PrintUpdate(DWORD); -void Printer_SetFilename(char* pszFilename); -char* Printer_GetFilename(); -void Printer_SetIdleLimit(unsigned int Duration); -unsigned int Printer_GetIdleLimit(); -extern bool g_bDumpToPrinter; -extern bool g_bConvertEncoding; -extern bool g_bFilterUnprintable; -extern bool g_bPrinterAppend; -extern int g_iPrinterIdleLimit; -extern bool g_bFilterUnprintable; -extern bool g_bPrinterAppend; - +void PrintDestroy(); +void PrintLoadRom(LPBYTE pCxRomPeripheral, UINT uSlot); +void PrintReset(); +void PrintUpdate(DWORD); diff --git a/AppleWin/source/Peripheral_Clock_Generic.cpp b/AppleWin/source/Peripheral_Clock_Generic.cpp old mode 100755 new mode 100644 diff --git a/AppleWin/source/Peripheral_Clock_Generic.h b/AppleWin/source/Peripheral_Clock_Generic.h old mode 100755 new mode 100644 diff --git a/AppleWin/source/Peripheral_Clock_ThunderClockPlus.cpp b/AppleWin/source/Peripheral_Clock_ThunderClockPlus.cpp old mode 100755 new mode 100644 diff --git a/AppleWin/source/PropertySheetPage.cpp b/AppleWin/source/PropertySheetPage.cpp index 0a487728..bc0bfd52 100644 --- a/AppleWin/source/PropertySheetPage.cpp +++ b/AppleWin/source/PropertySheetPage.cpp @@ -113,6 +113,7 @@ UINT g_uMouseShowCrosshair = 0; UINT g_uMouseRestrictToWindow = 0; UINT g_uZ80InSlot5 = 0; + // UINT g_uTheFreezesF8Rom = 0; @@ -124,14 +125,12 @@ static UINT g_bEnableFreezeDlgButton = UNDEFINED; enum { CLONETYPE_PRAVETS82=0, - CLONETYPE_PRAVETS8M, CLONETYPE_PRAVETS8A, CLONETYPE_NUM }; DWORD g_uCloneType = CLONETYPE_PRAVETS82 ; static TCHAR g_CloneChoices[] = TEXT("Pravets 82\0") // Bulgarian - TEXT("Pravets 8M\0") // Bulgarian TEXT("Pravets 8A\0"); // Bulgarian @@ -248,8 +247,7 @@ static eApple2Type GetApple2Type(DWORD NewCompType, DWORD NewCloneType) switch (NewCloneType) { case 0: return A2TYPE_PRAVETS82; break; - case 1: return A2TYPE_PRAVETS8M; break; - case 2: return A2TYPE_PRAVETS8A; break; + case 1: return A2TYPE_PRAVETS8A; break; } default: return A2TYPE_APPLE2EEHANCED; } @@ -305,7 +303,7 @@ static void ConfigDlg_OK(HWND window, UINT afterclose) if (NewApple2Type > A2TYPE_CLONE) NewCloneType = NewApple2Type - A2TYPE_CLONE; - if ((NewApple2Type == A2TYPE_PRAVETS82) || (NewApple2Type == A2TYPE_PRAVETS8A) || (NewApple2Type == A2TYPE_PRAVETS8M)) + if ((NewApple2Type == A2TYPE_PRAVETS82) || (NewApple2Type == A2TYPE_PRAVETS8A)) SAVE(TEXT(REGVALUE_APPLE2_TYPE),A2TYPE_CLONE ); else SAVE(TEXT(REGVALUE_APPLE2_TYPE),NewApple2Type ); @@ -416,7 +414,7 @@ static BOOL CALLBACK ConfigDlgProc (HWND window, CheckRadioButton(window, IDC_AUTHENTIC_SPEED, IDC_CUSTOM_SPEED, IDC_CUSTOM_SPEED); // FirstButton, LastButton, CheckButton break; - case WM_INITDIALOG: //Init general settings dialog + case WM_INITDIALOG: { g_nLastPage = PG_CONFIG; @@ -428,11 +426,10 @@ static BOOL CALLBACK ConfigDlgProc (HWND window, case A2TYPE_APPLE2E: iApple2String = 2; break; case A2TYPE_APPLE2EEHANCED: iApple2String = 3; break; case A2TYPE_PRAVETS82: iApple2String = 4; break; - case A2TYPE_PRAVETS8M: iApple2String = 5; break; - case A2TYPE_PRAVETS8A: iApple2String = 6; break; + case A2TYPE_PRAVETS8A: iApple2String = 5; break; } - if (iApple2String > 3) + if ((iApple2String == 4) || (iApple2String == 5)) FillComboBox(window,IDC_COMPUTER,computerchoices,4); else FillComboBox(window,IDC_COMPUTER,computerchoices,iApple2String); @@ -645,32 +642,32 @@ static BOOL CALLBACK InputDlgProc (HWND window, } break; - case IDC_Z80_IN_SLOT5: - { - UINT uNewState = IsDlgButtonChecked(window, IDC_Z80_IN_SLOT5) ? 1 : 0; - LPCSTR pMsg = uNewState ? - TEXT("The emulator needs to restart as the slot configuration has changed.\n") - TEXT("Microsoft CP/M SoftCard will be placed in slot 5.\n\n") - TEXT("Would you like to restart the emulator now?") - : - TEXT("The emulator needs to restart as the slot configuration has changed.\n") - TEXT("Microsoft CP/M SoftCard will be removed from slot 5\n\n") - TEXT("Would you like to restart the emulator now?"); - if (MessageBox(window, - pMsg, - TEXT("Configuration"), - MB_ICONQUESTION | MB_YESNO | MB_SETFOREGROUND) == IDYES) - { - g_uZ80InSlot5 = uNewState; - afterclose = WM_USER_RESTART; - PropSheet_PressButton(GetParent(window), PSBTN_OK); - } - else - { - CheckDlgButton(window, IDC_Z80_IN_SLOT5, g_uZ80InSlot5 ? BST_CHECKED : BST_UNCHECKED); - } - } - break; + case IDC_Z80_IN_SLOT5: + { + UINT uNewState = IsDlgButtonChecked(window, IDC_Z80_IN_SLOT5) ? 1 : 0; + LPCSTR pMsg = uNewState ? + TEXT("The emulator needs to restart as the slot configuration has changed.\n") + TEXT("Microsoft CP/M SoftCard will be placed in slot 5.\n\n") + TEXT("Would you like to restart the emulator now?") + : + TEXT("The emulator needs to restart as the slot configuration has changed.\n") + TEXT("Microsoft CP/M SoftCard will be removed from slot 5\n\n") + TEXT("Would you like to restart the emulator now?"); + if (MessageBox(window, + pMsg, + TEXT("Configuration"), + MB_ICONQUESTION | MB_YESNO | MB_SETFOREGROUND) == IDYES) + { + g_uZ80InSlot5 = uNewState; + afterclose = WM_USER_RESTART; + PropSheet_PressButton(GetParent(window), PSBTN_OK); + } + else + { + CheckDlgButton(window, IDC_Z80_IN_SLOT5, g_uZ80InSlot5 ? BST_CHECKED : BST_UNCHECKED); + } + } + break; case IDC_PASTE_FROM_CLIPBOARD: ClipboardInitiatePaste(); @@ -678,7 +675,7 @@ static BOOL CALLBACK InputDlgProc (HWND window, } break; - case WM_INITDIALOG: //Init input settings dialog + case WM_INITDIALOG: { g_nLastPage = PG_INPUT; @@ -697,7 +694,7 @@ static BOOL CALLBACK InputDlgProc (HWND window, CheckDlgButton(window, IDC_MOUSE_RESTRICT_TO_WINDOW, g_uMouseRestrictToWindow ? BST_CHECKED : BST_UNCHECKED); EnableWindow(GetDlgItem(window, IDC_MOUSE_CROSSHAIR), g_uMouseInSlot4 ? TRUE : FALSE); EnableWindow(GetDlgItem(window, IDC_MOUSE_RESTRICT_TO_WINDOW), g_uMouseInSlot4 ? TRUE : FALSE); - CheckDlgButton(window, IDC_Z80_IN_SLOT5, g_uZ80InSlot5 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(window, IDC_Z80_IN_SLOT5, g_uZ80InSlot5 ? BST_CHECKED : BST_UNCHECKED); afterclose = 0; break; @@ -831,12 +828,12 @@ static BOOL CALLBACK SoundDlgProc (HWND window, { EnableWindow(GetDlgItem(window, IDC_PHASOR_ENABLE), FALSE); } - + if (g_uZ80InSlot5) - { - EnableWindow(GetDlgItem(window, IDC_MB_ENABLE), FALSE); - } - + { + EnableWindow(GetDlgItem(window, IDC_MB_ENABLE), FALSE); + } + afterclose = 0; break; } @@ -962,8 +959,7 @@ static BOOL CALLBACK DiskDlgProc (HWND window, case IDC_CIDERPRESS_BROWSE: { - //string CiderPressLoc = BrowseToCiderPress(window, TEXT("Select path to CiderPress")); - string CiderPressLoc = BrowseToFile (window, TEXT("Select path to CiderPress"), REGVALUE_CIDERPRESSLOC, TEXT("Applications (*.exe)\0*.exe\0") TEXT("All Files\0*.*\0") ); + string CiderPressLoc = BrowseToCiderPress(window, TEXT("Select path to CiderPress")); RegSaveString(TEXT("Configuration"),REGVALUE_CIDERPRESSLOC,1,CiderPressLoc.c_str()); SendDlgItemMessage(window, IDC_CIDERPRESS_FILENAME, WM_SETTEXT, 0, (LPARAM) CiderPressLoc.c_str()); } @@ -971,7 +967,7 @@ static BOOL CALLBACK DiskDlgProc (HWND window, } break; - case WM_INITDIALOG: //Init disk settings dialog + case WM_INITDIALOG: { g_nLastPage = PG_DISK; @@ -988,7 +984,7 @@ static BOOL CALLBACK DiskDlgProc (HWND window, TCHAR PathToCiderPress[MAX_PATH] = ""; RegLoadString(TEXT("Configuration"), REGVALUE_CIDERPRESSLOC, 1, PathToCiderPress,MAX_PATH); SendDlgItemMessage(window,IDC_CIDERPRESS_FILENAME ,WM_SETTEXT,0,(LPARAM)PathToCiderPress); - + // CheckDlgButton(window, IDC_HDD_ENABLE, HD_CardIsEnabled() ? BST_CHECKED : BST_UNCHECKED); @@ -1006,20 +1002,20 @@ static BOOL CALLBACK DiskDlgProc (HWND window, //=========================================================================== static bool g_bSSNewFilename = false; -static char g_szNewFilename[MAX_PATH]; static char g_szSSNewDirectory[MAX_PATH]; +static char g_szSSNewDirectory[MAX_PATH]; static char g_szSSNewFilename[MAX_PATH]; static void SaveStateUpdate() { - if (g_bSSNewFilename) - { - Snapshot_SetFilename(g_szSSNewFilename); + if (g_bSSNewFilename) + { + Snapshot_SetFilename(g_szSSNewFilename); - RegSaveString(TEXT(REG_CONFIG),REGVALUE_SAVESTATE_FILENAME,1,Snapshot_GetFilename()); + RegSaveString(TEXT(REG_CONFIG),REGVALUE_SAVESTATE_FILENAME,1,Snapshot_GetFilename()); - if(g_szSSNewDirectory[0]) - RegSaveString(TEXT("Preferences"),REGVALUE_PREF_START_DIR,1,g_szSSNewDirectory); RegSaveString(TEXT("Preferences"),REGVALUE_PREF_START_DIR,1,g_szSSNewDirectory); - } + if(g_szSSNewDirectory[0]) + RegSaveString(TEXT(REG_PREFS),REGVALUE_PREF_START_DIR,1,g_szSSNewDirectory); + } } static int SaveStateSelectImage(HWND hWindow, TCHAR* pszTitle, bool bSave) @@ -1064,22 +1060,22 @@ static int SaveStateSelectImage(HWND hWindow, TCHAR* pszTitle, bool bSave) if(nRes) { strcpy(g_szSSNewFilename, &szFilename[ofn.nFileOffset]); - - if (bSave) // Only for saving (allow loading of any file for backwards compatibility) - { - // Append .aws if it's not there - const char szAWS_EXT[] = ".aws"; - const UINT uStrLenFile = strlen(g_szSSNewFilename); - const UINT uStrLenExt = strlen(szAWS_EXT); - if ((uStrLenFile <= uStrLenExt) || (strcmp(&g_szSSNewFilename[uStrLenFile-uStrLenExt], szAWS_EXT) != 0)) - strcpy(&g_szSSNewFilename[uStrLenFile], szAWS_EXT); - } + + if (bSave) // Only for saving (allow loading of any file for backwards compatibility) + { + // Append .aws if it's not there + const char szAWS_EXT[] = ".aws"; + const UINT uStrLenFile = strlen(g_szSSNewFilename); + const UINT uStrLenExt = strlen(szAWS_EXT); + if ((uStrLenFile <= uStrLenExt) || (strcmp(&g_szSSNewFilename[uStrLenFile-uStrLenExt], szAWS_EXT) != 0)) + strcpy(&g_szSSNewFilename[uStrLenFile], szAWS_EXT); + } szFilename[ofn.nFileOffset] = 0; if (_tcsicmp(szDirectory, szFilename)) strcpy(g_szSSNewDirectory, szFilename); } - + g_bSSNewFilename = nRes ? true : false; return nRes; } @@ -1110,30 +1106,17 @@ static void AdvancedDlg_OK(HWND window, UINT afterclose) szFilename[nLineLength] = 0x00; SaveStateUpdate(); - RegSaveString(TEXT("Configuration"),REGVALUE_PRINTER_FILENAME,1,Printer_GetFilename()); -// PrinterStateUpdate(); g_bSaveStateOnExit = IsDlgButtonChecked(window, IDC_SAVESTATE_ON_EXIT) ? true : false; + SAVE(TEXT(REGVALUE_SAVE_STATE_ON_EXIT), g_bSaveStateOnExit ? 1 : 0); - g_bDumpToPrinter = IsDlgButtonChecked(window, IDC_DUMPTOPRINTER ) ? true : false; - SAVE(TEXT(REGVALUE_DUMP_TO_PRINTER), g_bDumpToPrinter ? 1 : 0); - g_bConvertEncoding = IsDlgButtonChecked(window, IDC_PRINTER_CONVERT_ENCODING ) ? true : false; - SAVE(TEXT(REGVALUE_CONVERT_ENCODING), g_bConvertEncoding ? 1 : 0); - g_bFilterUnprintable = IsDlgButtonChecked(window, IDC_PRINTER_FILTER_UNPRINTABLE ) ? true : false; - SAVE(TEXT(REGVALUE_FILTER_UNPRINTABLE), g_bFilterUnprintable ? 1 : 0); - - g_bPrinterAppend = IsDlgButtonChecked(window, IDC_PRINTER_APPEND) ? true : false; - SAVE(TEXT(REGVALUE_PRINTER_APPEND), g_bPrinterAppend ? 1 : 0); // DWORD NewCloneType = (DWORD)SendDlgItemMessage(window, IDC_CLONETYPE, CB_GETCURSEL, 0, 0); SAVE(TEXT(REGVALUE_CLONETYPE), NewCloneType); SAVE(TEXT(REGVALUE_THE_FREEZES_F8_ROM),g_uTheFreezesF8Rom); // NB. Can also be disabled on Config page (when Apple2Type changes) - - Printer_SetIdleLimit((short)SendDlgItemMessage(window, IDC_SPIN_PRINTER_IDLE , UDM_GETPOS, 0, 0)); - SAVE(TEXT(REGVALUE_PRINTER_IDLE_LIMIT),Printer_GetIdleLimit()); eApple2Type NewApple2Clone = GetApple2Type(4, NewCloneType); @@ -1161,14 +1144,14 @@ static void AdvancedDlg_OK(HWND window, UINT afterclose) if (NewApple2Clone != (g_uCloneType + APPLECLONE_MASK|APPLE2E_MASK)) { MessageBox(window, - TEXT( - "You have changed the emulated clone type " - "but in order for the changes to take effect\n" - "you shall set the emulated computer type " - "to Clone from the Configuration tab.\n\n"), - TEXT("Clone type changed"), - MB_ICONQUESTION | MB_OK | MB_SETFOREGROUND) ; - g_uCloneType = NewApple2Clone - APPLECLONE_MASK -APPLE2E_MASK; + TEXT( + "You have changed the emulated clone type " + "but in order for the changes to take effect\n" + "you shall set the emulated computer type " + "to Clone from the Configuration tab.\n\n"), + TEXT("Clone type changed"), + MB_ICONQUESTION | MB_OK | MB_SETFOREGROUND) ; + g_uCloneType = NewApple2Clone - (APPLECLONE_MASK|APPLE2E_MASK); } } @@ -1232,15 +1215,6 @@ static BOOL CALLBACK AdvancedDlgProc (HWND window, if(SaveStateSelectImage(window, TEXT("Select Save State file"), true)) SendDlgItemMessage(window, IDC_SAVESTATE_FILENAME, WM_SETTEXT, 0, (LPARAM) g_szSSNewFilename); break; - case IDC_DUMP_FILENAME_BROWSE: - { - char PrinterDumpLoc[MAX_PATH] = {0}; - strcpy(PrinterDumpLoc, BrowseToFile (window, TEXT("Select printer dump file"), REGVALUE_PRINTER_FILENAME, TEXT("Text files (*.txt)\0*.txt\0") TEXT("All Files\0*.*\0")).c_str()); - RegSaveString(TEXT("Configuration"),REGVALUE_PRINTER_FILENAME,1,PrinterDumpLoc); - SendDlgItemMessage(window, IDC_DUMP_FILENAME, WM_SETTEXT, 0, (LPARAM) PrinterDumpLoc); - Printer_SetFilename (PrinterDumpLoc); - } - break; case IDC_SAVESTATE_ON_EXIT: break; case IDC_SAVESTATE: @@ -1275,19 +1249,13 @@ static BOOL CALLBACK AdvancedDlgProc (HWND window, } break; - case WM_INITDIALOG: //Init advanced settings dialog + case WM_INITDIALOG: { g_nLastPage = PG_ADVANCED; - + SendDlgItemMessage(window,IDC_SAVESTATE_FILENAME,WM_SETTEXT,0,(LPARAM)Snapshot_GetFilename()); + CheckDlgButton(window, IDC_SAVESTATE_ON_EXIT, g_bSaveStateOnExit ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(window, IDC_DUMPTOPRINTER, g_bDumpToPrinter ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(window, IDC_PRINTER_CONVERT_ENCODING, g_bConvertEncoding ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(window, IDC_PRINTER_FILTER_UNPRINTABLE, g_bFilterUnprintable ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(window, IDC_PRINTER_APPEND, g_bPrinterAppend ? BST_CHECKED : BST_UNCHECKED); - SendDlgItemMessage(window, IDC_SPIN_PRINTER_IDLE, UDM_SETRANGE, 0, MAKELONG(999,0)); - SendDlgItemMessage(window, IDC_SPIN_PRINTER_IDLE, UDM_SETPOS, 0, MAKELONG(Printer_GetIdleLimit (),0)); - SendDlgItemMessage(window,IDC_DUMP_FILENAME,WM_SETTEXT,0,(LPARAM)Printer_GetFilename()); FillComboBox(window, IDC_CLONETYPE, g_CloneChoices, g_uCloneType); InitFreezeDlgButton(window); @@ -1617,53 +1585,41 @@ bool PSP_SaveStateSelectImage(HWND hWindow, bool bSave) } } +//=========================================================================== - -string BrowseToFile (HWND hWindow, TCHAR* pszTitle, TCHAR* REGVALUE,TCHAR* FILEMASKS) +static string BrowseToCiderPress (HWND hWindow, TCHAR* pszTitle) { - - static char PathToFile[MAX_PATH] = {0}; //This is a really awkward way to prevent mixing CiderPress and SaveStated values (RAPCS), but it seem the quickest. Here is its Line 1. - strcpy(PathToFile, Snapshot_GetFilename()); //RAPCS, line 2. TCHAR szDirectory[MAX_PATH] = TEXT(""); - TCHAR szFilename[MAX_PATH]; - strcpy(szFilename, ""); - RegLoadString(TEXT("Configuration"), REGVALUE, 1, szFilename ,MAX_PATH); - string PathName = szFilename; + TCHAR szCPFilename[MAX_PATH] = TEXT(""); + RegLoadString(TEXT("Configuration"), REGVALUE_CIDERPRESSLOC, 1, szCPFilename ,MAX_PATH); + string PathName = szCPFilename; OPENFILENAME ofn; ZeroMemory(&ofn,sizeof(OPENFILENAME)); - + ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hWindow; ofn.hInstance = g_hInstance; - ofn.lpstrFilter = FILEMASKS; - /*ofn.lpstrFilter = TEXT("Applications (*.exe)\0*.exe\0") - TEXT("Text files (*.txt)\0*.txt\0") - TEXT("All Files\0*.*\0");*/ - ofn.lpstrFile = szFilename; + ofn.lpstrFilter = TEXT("Applications (*.exe)\0*.exe\0") + TEXT("All Files\0*.*\0"); + ofn.lpstrFile = szCPFilename; ofn.nMaxFile = MAX_PATH; ofn.lpstrInitialDir = szDirectory; ofn.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY; ofn.lpstrTitle = pszTitle; - + int nRes = GetOpenFileName(&ofn); if(nRes) //Okay is pressed { - strcpy(g_szNewFilename, &szFilename[ofn.nFileOffset]); - - szFilename[ofn.nFileOffset] = 0; - if (_tcsicmp(szDirectory, szFilename)) - strcpy(g_szSSNewDirectory, szFilename); - - PathName = szFilename; - PathName.append (g_szNewFilename); + SetCurrentImageDir(); // Reset, since GetOpenFileName() will've changed curr dir + PathName = szCPFilename; } else //Cancel is pressed. { - RegLoadString(TEXT("Configuration"), REGVALUE, 1, szFilename,MAX_PATH); - PathName = szFilename; + RegLoadString(TEXT("Configuration"), REGVALUE_CIDERPRESSLOC, 1, szCPFilename, MAX_PATH); + PathName = szCPFilename; } - strcpy(g_szNewFilename, PathToFile); //RAPCS, line 3 (last). + return PathName; } diff --git a/AppleWin/source/PropertySheetPage.h b/AppleWin/source/PropertySheetPage.h index 5ea29bf5..27838f99 100644 --- a/AppleWin/source/PropertySheetPage.h +++ b/AppleWin/source/PropertySheetPage.h @@ -7,7 +7,6 @@ void ui_tfe_settings_dialog(HWND hwnd); void * get_tfe_interface(void); void get_tfe_enabled(int *tfe_enabled); string BrowseToCiderPress (HWND hWindow, TCHAR* pszTitle); -string BrowseToFile (HWND hWindow, TCHAR* pszTitle, TCHAR* REGVALUE, TCHAR* FILEMASKS); extern UINT g_uScrollLockToggle; extern UINT g_uMouseInSlot4; diff --git a/AppleWin/source/Video.cpp b/AppleWin/source/Video.cpp index ca8d7a57..c62ad006 100644 --- a/AppleWin/source/Video.cpp +++ b/AppleWin/source/Video.cpp @@ -1047,13 +1047,12 @@ HBRUSH CreateCustomBrush(COLORREF nColor) //=========================================================================== void DrawMonoTextSource (HDC hDstDC) { - static HBITMAP hCharBitmap[4]; + static HBITMAP hCharBitmap[3]; HDC hSrcDC = CreateCompatibleDC(hDstDC); hCharBitmap[0] = LoadBitmap(g_hInstance,TEXT("CHARSET40")); hCharBitmap[1] = LoadBitmap(g_hInstance,TEXT("CHARSET82")); - hCharBitmap[2] = LoadBitmap(g_hInstance,TEXT("CHARSET8C")); //Pravets 8M probably has the same charset as Pravets 8C - hCharBitmap[3] = LoadBitmap(g_hInstance,TEXT("CHARSET8C")); + hCharBitmap[2] = LoadBitmap(g_hInstance,TEXT("CHARSET8C")); HBRUSH hBrush; switch (videotype) @@ -1082,12 +1081,11 @@ void DrawMonoTextSource (HDC hDstDC) void DrawTextSource (HDC dc) { HDC memdc = CreateCompatibleDC(dc); - static HBITMAP hCharBitmap[4]; + static HBITMAP hCharBitmap[3]; //The charset is set below hCharBitmap[0] = LoadBitmap(g_hInstance,TEXT("CHARSET40")); hCharBitmap[1] = LoadBitmap(g_hInstance,TEXT("CHARSET82")); - hCharBitmap[2] = LoadBitmap(g_hInstance,TEXT("CHARSET8C")); //Pravets 8M probably has the same charset as Pravets 8C - hCharBitmap[3] = LoadBitmap(g_hInstance,TEXT("CHARSET8C")); + hCharBitmap[2] = LoadBitmap(g_hInstance,TEXT("CHARSET8C")); SelectObject(memdc,hCharBitmap[g_nCharsetType]); BitBlt( diff --git a/AppleWin/source/Z80/README.txt b/AppleWin/source/Z80/README.txt old mode 100755 new mode 100644 diff --git a/AppleWin/source/Z80/z80.cpp b/AppleWin/source/Z80/z80.cpp old mode 100755 new mode 100644 diff --git a/AppleWin/source/Z80/z80.h b/AppleWin/source/Z80/z80.h old mode 100755 new mode 100644 diff --git a/AppleWin/source/Z80/z80codes.h b/AppleWin/source/Z80/z80codes.h old mode 100755 new mode 100644 diff --git a/AppleWin/source/Z80/z80daa.h b/AppleWin/source/Z80/z80daa.h old mode 100755 new mode 100644 diff --git a/AppleWin/source/Z80/z80emu.cpp b/AppleWin/source/Z80/z80emu.cpp old mode 100755 new mode 100644 diff --git a/AppleWin/source/Z80/z80emu.h b/AppleWin/source/Z80/z80emu.h old mode 100755 new mode 100644 diff --git a/AppleWin/source/Z80/z80io.h b/AppleWin/source/Z80/z80io.h old mode 100755 new mode 100644