Merge from cm630: r326 through r416

This commit is contained in:
tomch 2009-01-05 22:59:26 +00:00
parent 7cc10fb894
commit 67a8b86392
32 changed files with 613 additions and 352 deletions

View File

0
AppleWin/help/cfg-advanced-freeze-rom.html Normal file → Executable file
View File

0
AppleWin/help/cfg-advanced-pravets.html Normal file → Executable file
View File

View File

@ -1,50 +1,68 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Advanced Settings</title>
</head>
<body style="background-color: rgb(255, 255, 255); font-family: verdana;" alink="#008000" link="#008000" vlink="#008000">
<h2 style="color: rgb(0, 128, 0);">Advanced Settings</h2>
<hr size="4"><img style="width: 344px; height: 460px; float: right;" src="img/advanced.png" alt="Advanced settings" hspace="5" vspace="5">
<p><strong>Save State File Name:</strong><br>
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.</p>
<p><strong>Save State on Exit:</strong><br>
Checking this box will automatically save the current state of the
emulator upon exit. &nbsp;The state will be saved to the file
specified above (SaveState.aws by default).</p>
<p><strong>Save State:</strong><br>
Press this button to save the current state of the emulator to the file
specified. &nbsp;You can also save the system state during
emulation by pressing the F11 key.</p>
<p><strong>Load State:</strong><br>
Press this button to load the specified state file into
the emulator. &nbsp;You can also load the system state during
emulation by pressing the F12 key.</p>
<p><strong>Clone:</strong><br>
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.<br>
NB. Pravets 82 and 8A are Bulgarian Apple II clones.<br>
<p><strong>The Freeze's non-autostart F8 rom:</strong><br>
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. <a href="cfg-advanced-freeze-rom.html">Here's the original release note</a>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>Advanced Settings</title></head>
<body style="background-color: rgb(255, 255, 255); font-family: verdana;" alink="#008000" link="#008000" vlink="#008000">
<h2 style="color: rgb(0, 128, 0);">Advanced Settings</h2>
<hr size="4"><img style="width: 344px; height: 460px; float: right;" src="img/advanced.png" alt="Advanced settings" hspace="5" vspace="5">
<p><strong>Save State File Name:</strong><br>
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.</p>
<p><strong>Save State on Exit:</strong><br>
Checking this box will automatically save the current state of the
emulator upon exit. &nbsp;The state will be saved to the file
specified above (SaveState.aws by default).</p>
<p><strong>Save State:</strong><br>
Press this button to save the current state of the emulator to the file
specified. &nbsp;You can also save the system state during
emulation by pressing the F11 key.</p>
<p><strong>Load State:</strong><br>
Press this button to load the specified state file into
the emulator. &nbsp;You can also load the system state during
emulation by pressing the F12 key.</p>
<p><strong>Clone:</strong><br>
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.<br>
NB. Pravets 82 and 8A are Bulgarian Apple II clones.<br>
</p>
<p><strong>Printer settings </strong>(Printer is
emulated at slot 1)</p>
<p style="margin-left: 40px;"><strong>Printer dump filename:<br>
</strong>Data sent to the printer is stored in a text file. Use
this setting to select its location.<br>
</p>
<p style="margin-left: 40px;"><strong>Dump to printer:<br>
</strong><span style="font-weight: bold; font-style: italic;">Use
with caution!</span> 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.<br>
</p>
<p style="margin-left: 40px;"><strong>Encoding conversion for clones:<br>
</strong>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&nbsp;printing images.</p>
<p style="margin-left: 40px;"><strong>Filter unprintable characters:<br>
</strong>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.</p><p style="margin-left: 40px;"><strong>Append to printfile:<br>
</strong>When disabled previous print file is replaced (unless it has a
different&nbsp;name) by the newly created print file. Otherwise newly
printed data is added to the existing print file.&nbsp;I should better
disable appending
when dumping to printer.</p><p style="margin-left: 40px;"><strong>Terminate printing after idle:<br>
</strong>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.
</p>
<p><strong>The Freeze's non-autostart F8 rom:</strong><br>
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. <a href="cfg-advanced-freeze-rom.html">Here's the
original release note</a>
</p>
</body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -60,18 +60,22 @@ 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"
@ -198,19 +202,32 @@ 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 "&Clone:",IDC_STATIC,5,165,40,8
COMBOBOX IDC_CLONETYPE,45,163,100,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
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
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
@ -251,7 +268,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"
@ -294,13 +311,14 @@ 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_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_8M_ROM ROM "Pravets8M.rom"
IDR_PRAVETS_8C_ROM ROM "Pravets8C.rom"
IDR_FREEZES_F8_ROM ROM "FREEZES_NON-AUTOSTART_F8_ROM.rom"
/////////////////////////////////////////////////////////////////////////////
//

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

0
AppleWin/resource/ThunderClockPlus.rom Normal file → Executable file
View File

View File

@ -42,7 +42,8 @@
#define IDR_THUNDERCLOCKPLUS_FW 137
#define IDR_FREEZES_F8_ROM 138
#define IDR_PRAVETS_82_ROM 139
#define IDR_PRAVETS_8C_ROM 140
#define IDR_PRAVETS_8M_ROM 140
#define IDR_PRAVETS_8C_ROM 142
#define IDC_KEYB_BUFFER_ENABLE 1005
#define IDC_SAVESTATE 1006
#define IDC_SAVESTATE_ON_EXIT 1007
@ -86,13 +87,21 @@
#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
//

View File

@ -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,7 +387,8 @@ void LoadConfiguration ()
switch (g_uCloneType)
{
case 0: g_Apple2Type = A2TYPE_PRAVETS82; break;
case 1: g_Apple2Type = A2TYPE_PRAVETS8A; break;
case 1: g_Apple2Type = A2TYPE_PRAVETS8M; break;
case 2: g_Apple2Type = A2TYPE_PRAVETS8A; break;
default: g_Apple2Type = A2TYPE_APPLE2EEHANCED; break;
}
}
@ -417,6 +418,7 @@ 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.
}
@ -455,6 +457,18 @@ 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);
@ -480,46 +494,52 @@ 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};
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
RegLoadString(TEXT(REG_CONFIG),TEXT(REGVALUE_SAVESTATE_FILENAME),1,szFilename,sizeof(szFilename));
Snapshot_SetFilename(szFilename); // If not in Registry than default will be used
// 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);
// 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();
char szUthernetInt[MAX_PATH] = {0};
RegLoadString(TEXT(REG_CONFIG),TEXT("Uthernet Interface"),1,szUthernetInt,MAX_PATH);
update_tfe_interface(szUthernetInt,NULL);
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];
@ -567,32 +587,31 @@ 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
);
if (! bStatus)
{
MessageBox( g_hFrameWindow, "Unable to capture PrintScreen key", "Warning", MB_OK );
}
}
//===========================================================================
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 );
}
}
//===========================================================================
LPSTR GetCurrArg(LPSTR lpCmdLine)
{
if(*lpCmdLine == '\"')
@ -705,11 +724,10 @@ 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;
}
@ -754,7 +772,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
}
}
@ -808,7 +826,7 @@ int APIENTRY WinMain (HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
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

View File

@ -35,6 +35,7 @@ enum AppMode_e
, MODE_STEPPING
};
#define SPEED_MIN 0
#define SPEED_NORMAL 10
#define SPEED_MAX 40
@ -60,6 +61,7 @@ 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 ")
@ -69,7 +71,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"
@ -89,20 +91,25 @@ 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
@ -134,6 +141,7 @@ enum eApple2Type {
// Clones start here:
A2TYPE_CLONE=APPLECLONE_MASK,
A2TYPE_PRAVETS82=APPLECLONE_MASK|APPLE2E_MASK,
A2TYPE_PRAVETS8M,
A2TYPE_PRAVETS8A,
A2TYPE_MAX
};

View File

@ -56,7 +56,7 @@ static HBITMAP capsbitmap[2];
//Pravets8 only
static HBITMAP capsbitmapP8[2];
static HBITMAP latbitmap[2];
static HBITMAP charsetbitmap [3];
//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 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,6 +176,7 @@ 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;
}
@ -193,9 +194,11 @@ 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"));
@ -486,6 +489,7 @@ 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
@ -513,6 +517,7 @@ 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;
}
@ -591,12 +596,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))
@ -636,9 +641,9 @@ LRESULT CALLBACK FrameWndProc (
ProcessButtonClick(BTN_RUN);
}
else
{
{
DiskNotifyInvalidImage(filename,error);
}
}
GlobalUnlock((HGLOBAL)lparam);
break;
}
@ -694,36 +699,35 @@ 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))
@ -739,10 +743,10 @@ LRESULT CALLBACK FrameWndProc (
}
else if (wparam == VK_F9)
{
if (GetKeyState(VK_CONTROL) < 0)
if (GetKeyState(VK_CONTROL) < 0) //CTRL+F9
{
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
@ -1417,9 +1421,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);
}
@ -1537,6 +1541,7 @@ 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;
}

View File

@ -175,7 +175,6 @@ void KeybQueueKeypress (int key, BOOL bASCII)
bFreshReset = false;
return; // Swallow spurious CTRL-C caused by CTRL-BREAK
}
bFreshReset = false;
if (key > 0x7F)
return;
@ -186,40 +185,53 @@ 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) //i.e. cyrillic letters
if (key == 64) keycode = 96;
if (key == '^') keycode = '~';
if (g_bCapsLock == false) //cyrillic letters
{
if (key == '`') keycode = '^';
if (key == 92) keycode = '@'; // \ to @
if (key == 124) keycode = 92;
}
else //(g_bCapsLock == true) //i.e. latin letters
else //(g_bCapsLock == true) //latin letters
{
if (key == 91) keycode = 123;
if (key == 93) keycode = 125;
if (key == 124) keycode = 92;
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 `~
}
}
//Remap some keys for Pravets8A/C, which has a different charset for Pravtes82/M, whose keys MUST NOT be remapped.
@ -227,48 +239,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)
@ -276,10 +288,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));
@ -501,9 +513,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
}
//===========================================================================

View File

@ -963,6 +963,7 @@ 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;
}
@ -975,7 +976,8 @@ 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; //Rom to be changed. Currently an Apple 2E Rom is used, because of the lack of a genuine Pravets82 one.
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;
}

View File

@ -29,16 +29,30 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#pragma hdrstop
#include "..\resource\resource.h"
#include <stdlib.h>
//#include <process.h>
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");
@ -70,10 +84,14 @@ 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");
//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");
}
return (file != NULL);
}
@ -85,8 +103,15 @@ 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;
}
//===========================================================================
@ -102,9 +127,10 @@ void PrintUpdate(DWORD totalcycles)
{
return;
}
if ((inactivity += totalcycles) > (10 * 1000 * 1000)) // around 10 seconds
// if ((inactivity += totalcycles) > (Printer_GetIdleLimit () * 1000 * 1000)) //This line seems to give a very big deviation
if ((inactivity += totalcycles) > (Printer_GetIdleLimit () * 710000))
{
// inactive, so close the file (next print will overwrite it)
// inactive, so close the file (next print will overwrite or append to it, according to the settings made)
ClosePrint();
}
}
@ -125,13 +151,99 @@ 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 = value & 0x7F;
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;
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;
}

View File

@ -1,6 +1,18 @@
#pragma once
void PrintDestroy();
void PrintLoadRom(LPBYTE pCxRomPeripheral, UINT uSlot);
void PrintReset();
void PrintUpdate(DWORD);
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;

0
AppleWin/source/Peripheral_Clock_Generic.cpp Normal file → Executable file
View File

0
AppleWin/source/Peripheral_Clock_Generic.h Normal file → Executable file
View File

0
AppleWin/source/Peripheral_Clock_ThunderClockPlus.cpp Normal file → Executable file
View File

View File

@ -113,7 +113,6 @@ UINT g_uMouseShowCrosshair = 0;
UINT g_uMouseRestrictToWindow = 0;
UINT g_uZ80InSlot5 = 0;
//
UINT g_uTheFreezesF8Rom = 0;
@ -125,12 +124,14 @@ 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
@ -247,7 +248,8 @@ static eApple2Type GetApple2Type(DWORD NewCompType, DWORD NewCloneType)
switch (NewCloneType)
{
case 0: return A2TYPE_PRAVETS82; break;
case 1: return A2TYPE_PRAVETS8A; break;
case 1: return A2TYPE_PRAVETS8M; break;
case 2: return A2TYPE_PRAVETS8A; break;
}
default: return A2TYPE_APPLE2EEHANCED;
}
@ -303,7 +305,7 @@ static void ConfigDlg_OK(HWND window, UINT afterclose)
if (NewApple2Type > A2TYPE_CLONE)
NewCloneType = NewApple2Type - A2TYPE_CLONE;
if ((NewApple2Type == A2TYPE_PRAVETS82) || (NewApple2Type == A2TYPE_PRAVETS8A))
if ((NewApple2Type == A2TYPE_PRAVETS82) || (NewApple2Type == A2TYPE_PRAVETS8A) || (NewApple2Type == A2TYPE_PRAVETS8M))
SAVE(TEXT(REGVALUE_APPLE2_TYPE),A2TYPE_CLONE );
else
SAVE(TEXT(REGVALUE_APPLE2_TYPE),NewApple2Type );
@ -414,7 +416,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:
case WM_INITDIALOG: //Init general settings dialog
{
g_nLastPage = PG_CONFIG;
@ -426,10 +428,11 @@ 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_PRAVETS8A: iApple2String = 5; break;
case A2TYPE_PRAVETS8M: iApple2String = 5; break;
case A2TYPE_PRAVETS8A: iApple2String = 6; break;
}
if ((iApple2String == 4) || (iApple2String == 5))
if (iApple2String > 3)
FillComboBox(window,IDC_COMPUTER,computerchoices,4);
else
FillComboBox(window,IDC_COMPUTER,computerchoices,iApple2String);
@ -642,32 +645,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();
@ -675,7 +678,7 @@ static BOOL CALLBACK InputDlgProc (HWND window,
}
break;
case WM_INITDIALOG:
case WM_INITDIALOG: //Init input settings dialog
{
g_nLastPage = PG_INPUT;
@ -694,7 +697,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;
@ -828,12 +831,12 @@ static BOOL CALLBACK SoundDlgProc (HWND window,
{
EnableWindow(GetDlgItem(window, IDC_PHASOR_ENABLE), FALSE);
}
if (g_uZ80InSlot5)
{
EnableWindow(GetDlgItem(window, IDC_MB_ENABLE), FALSE);
}
if (g_uZ80InSlot5)
{
EnableWindow(GetDlgItem(window, IDC_MB_ENABLE), FALSE);
}
afterclose = 0;
break;
}
@ -959,7 +962,8 @@ static BOOL CALLBACK DiskDlgProc (HWND window,
case IDC_CIDERPRESS_BROWSE:
{
string CiderPressLoc = BrowseToCiderPress(window, TEXT("Select path to CiderPress"));
//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") );
RegSaveString(TEXT("Configuration"),REGVALUE_CIDERPRESSLOC,1,CiderPressLoc.c_str());
SendDlgItemMessage(window, IDC_CIDERPRESS_FILENAME, WM_SETTEXT, 0, (LPARAM) CiderPressLoc.c_str());
}
@ -967,7 +971,7 @@ static BOOL CALLBACK DiskDlgProc (HWND window,
}
break;
case WM_INITDIALOG:
case WM_INITDIALOG: //Init disk settings dialog
{
g_nLastPage = PG_DISK;
@ -984,7 +988,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);
@ -1002,20 +1006,20 @@ static BOOL CALLBACK DiskDlgProc (HWND window,
//===========================================================================
static bool g_bSSNewFilename = false;
static char g_szSSNewDirectory[MAX_PATH];
static char g_szNewFilename[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(REG_PREFS),REGVALUE_PREF_START_DIR,1,g_szSSNewDirectory);
}
if(g_szSSNewDirectory[0])
RegSaveString(TEXT("Preferences"),REGVALUE_PREF_START_DIR,1,g_szSSNewDirectory); RegSaveString(TEXT("Preferences"),REGVALUE_PREF_START_DIR,1,g_szSSNewDirectory);
}
}
static int SaveStateSelectImage(HWND hWindow, TCHAR* pszTitle, bool bSave)
@ -1060,22 +1064,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;
}
@ -1106,17 +1110,30 @@ 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);
@ -1144,14 +1161,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;
}
}
@ -1215,6 +1232,15 @@ 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:
@ -1249,13 +1275,19 @@ static BOOL CALLBACK AdvancedDlgProc (HWND window,
}
break;
case WM_INITDIALOG:
case WM_INITDIALOG: //Init advanced settings dialog
{
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);
@ -1585,41 +1617,53 @@ bool PSP_SaveStateSelectImage(HWND hWindow, bool bSave)
}
}
//===========================================================================
static string BrowseToCiderPress (HWND hWindow, TCHAR* pszTitle)
string BrowseToFile (HWND hWindow, TCHAR* pszTitle, TCHAR* REGVALUE,TCHAR* FILEMASKS)
{
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 szCPFilename[MAX_PATH] = TEXT("");
RegLoadString(TEXT("Configuration"), REGVALUE_CIDERPRESSLOC, 1, szCPFilename ,MAX_PATH);
string PathName = szCPFilename;
TCHAR szFilename[MAX_PATH];
strcpy(szFilename, "");
RegLoadString(TEXT("Configuration"), REGVALUE, 1, szFilename ,MAX_PATH);
string PathName = szFilename;
OPENFILENAME ofn;
ZeroMemory(&ofn,sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hWindow;
ofn.hInstance = g_hInstance;
ofn.lpstrFilter = TEXT("Applications (*.exe)\0*.exe\0")
TEXT("All Files\0*.*\0");
ofn.lpstrFile = szCPFilename;
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.nMaxFile = MAX_PATH;
ofn.lpstrInitialDir = szDirectory;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrTitle = pszTitle;
int nRes = GetOpenFileName(&ofn);
if(nRes) //Okay is pressed
{
SetCurrentImageDir(); // Reset, since GetOpenFileName() will've changed curr dir
PathName = szCPFilename;
strcpy(g_szNewFilename, &szFilename[ofn.nFileOffset]);
szFilename[ofn.nFileOffset] = 0;
if (_tcsicmp(szDirectory, szFilename))
strcpy(g_szSSNewDirectory, szFilename);
PathName = szFilename;
PathName.append (g_szNewFilename);
}
else //Cancel is pressed.
{
RegLoadString(TEXT("Configuration"), REGVALUE_CIDERPRESSLOC, 1, szCPFilename, MAX_PATH);
PathName = szCPFilename;
RegLoadString(TEXT("Configuration"), REGVALUE, 1, szFilename,MAX_PATH);
PathName = szFilename;
}
strcpy(g_szNewFilename, PathToFile); //RAPCS, line 3 (last).
return PathName;
}

View File

@ -7,6 +7,7 @@ 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;

View File

@ -1047,12 +1047,13 @@ HBRUSH CreateCustomBrush(COLORREF nColor)
//===========================================================================
void DrawMonoTextSource (HDC hDstDC)
{
static HBITMAP hCharBitmap[3];
static HBITMAP hCharBitmap[4];
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"));
hCharBitmap[2] = LoadBitmap(g_hInstance,TEXT("CHARSET8C")); //Pravets 8M probably has the same charset as Pravets 8C
hCharBitmap[3] = LoadBitmap(g_hInstance,TEXT("CHARSET8C"));
HBRUSH hBrush;
switch (videotype)
@ -1081,11 +1082,12 @@ void DrawMonoTextSource (HDC hDstDC)
void DrawTextSource (HDC dc)
{
HDC memdc = CreateCompatibleDC(dc);
static HBITMAP hCharBitmap[3];
static HBITMAP hCharBitmap[4];
//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"));
hCharBitmap[2] = LoadBitmap(g_hInstance,TEXT("CHARSET8C")); //Pravets 8M probably has the same charset as Pravets 8C
hCharBitmap[3] = LoadBitmap(g_hInstance,TEXT("CHARSET8C"));
SelectObject(memdc,hCharBitmap[g_nCharsetType]);
BitBlt(

0
AppleWin/source/Z80/README.txt Normal file → Executable file
View File

0
AppleWin/source/Z80/z80.cpp Normal file → Executable file
View File

0
AppleWin/source/Z80/z80.h Normal file → Executable file
View File

0
AppleWin/source/Z80/z80codes.h Normal file → Executable file
View File

0
AppleWin/source/Z80/z80daa.h Normal file → Executable file
View File

0
AppleWin/source/Z80/z80emu.cpp Normal file → Executable file
View File

0
AppleWin/source/Z80/z80emu.h Normal file → Executable file
View File

0
AppleWin/source/Z80/z80io.h Normal file → Executable file
View File