Merge remote-tracking branch 'upstream/master'

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>

# Conflicts:
#	source/StdAfx.h
This commit is contained in:
Andrea Odetti 2018-06-09 09:39:11 +01:00
commit ae25b518a7
22 changed files with 914 additions and 157 deletions

View file

@ -6,6 +6,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Applewin", "AppleWinExpress
{5CE8051A-3F0C-4C39-B1C0-3338E48BA60F} = {5CE8051A-3F0C-4C39-B1C0-3338E48BA60F}
{7935B998-C713-42AE-8F6D-9FF9080A1B1B} = {7935B998-C713-42AE-8F6D-9FF9080A1B1B}
{2CC8CA9F-E37E-41A4-BFAD-77E54EB783A2} = {2CC8CA9F-E37E-41A4-BFAD-77E54EB783A2}
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A} = {AA5854AD-2BC7-4EFD-9790-349ADB35E35A}
{709278B8-C583-4BD8-90DE-4E4F35A3BD8B} = {709278B8-C583-4BD8-90DE-4E4F35A3BD8B}
{0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB} = {0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}
EndProjectSection
@ -20,6 +21,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml", "libyaml\win32\yaml2
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestDebugger", "test\TestDebugger\TestDebugger.vcproj", "{0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookFilter", "HookFilter\HookFilter.vcproj", "{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -50,6 +53,10 @@ Global
{0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}.Debug|Win32.Build.0 = Debug|Win32
{0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}.Release|Win32.ActiveCfg = Release|Win32
{0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}.Release|Win32.Build.0 = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.ActiveCfg = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.Build.0 = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.ActiveCfg = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -1,10 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppleWin", "AppleWinExpress2013.vcxproj", "{0A960136-A00A-4D4B-805F-664D9950D2CA}"
ProjectSection(ProjectDependencies) = postProject
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A} = {AA5854AD-2BC7-4EFD-9790-349ADB35E35A}
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45} = {CF5A49BF-62A5-41BB-B10C-F34D556A7A45}
{0212E0DF-06DA-4080-BD1D-F3B01599F70F} = {0212E0DF-06DA-4080-BD1D-F3B01599F70F}
{509739E7-0AF3-4C09-A1A9-F0B1BC31B39D} = {509739E7-0AF3-4C09-A1A9-F0B1BC31B39D}
@ -19,6 +20,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml", "libyaml\win32\yaml2
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCPU6502", "test\TestCPU6502\TestCPU6502-vs2013.vcxproj", "{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookFilter", "HookFilter\HookFilter-vs2013.vcxproj", "{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug NoDX|Win32 = Debug NoDX|Win32
@ -67,6 +70,14 @@ Global
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release NoDX|Win32.Build.0 = Release|Win32
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release|Win32.ActiveCfg = Release|Win32
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release|Win32.Build.0 = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug NoDX|Win32.ActiveCfg = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug NoDX|Win32.Build.0 = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.ActiveCfg = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.Build.0 = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release NoDX|Win32.ActiveCfg = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release NoDX|Win32.Build.0 = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.ActiveCfg = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppleWin", "AppleWinExpress2015.vcxproj", "{0A960136-A00A-4D4B-805F-664D9950D2CA}"
ProjectSection(ProjectDependencies) = postProject
@ -19,6 +19,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml", "libyaml\win32\yaml2
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCPU6502", "test\TestCPU6502\TestCPU6502-vs2015.vcxproj", "{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookFilter", "HookFilter\HookFilter-vs2015.vcxproj", "{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug NoDX|Win32 = Debug NoDX|Win32
@ -67,6 +69,14 @@ Global
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release NoDX|Win32.Build.0 = Release|Win32
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release|Win32.ActiveCfg = Release|Win32
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release|Win32.Build.0 = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug NoDX|Win32.ActiveCfg = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug NoDX|Win32.Build.0 = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.ActiveCfg = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.Build.0 = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release NoDX|Win32.ActiveCfg = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release NoDX|Win32.Build.0 = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.ActiveCfg = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -1,10 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
VisualStudioVersion = 15.0.26430.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppleWin", "AppleWinExpress2017.vcxproj", "{0A960136-A00A-4D4B-805F-664D9950D2CA}"
ProjectSection(ProjectDependencies) = postProject
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A} = {AA5854AD-2BC7-4EFD-9790-349ADB35E35A}
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45} = {CF5A49BF-62A5-41BB-B10C-F34D556A7A45}
{0212E0DF-06DA-4080-BD1D-F3B01599F70F} = {0212E0DF-06DA-4080-BD1D-F3B01599F70F}
{509739E7-0AF3-4C09-A1A9-F0B1BC31B39D} = {509739E7-0AF3-4C09-A1A9-F0B1BC31B39D}
@ -19,6 +20,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml", "libyaml\win32\yaml2
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCPU6502", "test\TestCPU6502\TestCPU6502-vs2017.vcxproj", "{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookFilter", "HookFilter\HookFilter-vs2017.vcxproj", "{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug NoDX|Win32 = Debug NoDX|Win32
@ -67,6 +70,14 @@ Global
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release NoDX|Win32.Build.0 = Release|Win32
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release|Win32.ActiveCfg = Release|Win32
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release|Win32.Build.0 = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug NoDX|Win32.ActiveCfg = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug NoDX|Win32.Build.0 = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.ActiveCfg = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.Build.0 = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release NoDX|Win32.ActiveCfg = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release NoDX|Win32.Build.0 = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.ActiveCfg = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>HookFilter</ProjectName>
<ProjectGuid>{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}</ProjectGuid>
<RootNamespace>HookFilter</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="HookFilter.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="HookFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>HookFilter</ProjectName>
<ProjectGuid>{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}</ProjectGuid>
<RootNamespace>HookFilter</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>14.0.25420.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="HookFilter.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="HookFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>HookFilter</ProjectName>
<ProjectGuid>{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}</ProjectGuid>
<RootNamespace>HookFilter</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>15.0.26419.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="HookFilter.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="HookFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

64
HookFilter/HookFilter.cpp Normal file
View file

@ -0,0 +1,64 @@
#include <windows.h>
static HWND g_hFrameWindow = (HWND)0;
// NB. __stdcall (or WINAPI) and extern "C":
// . symbol is decorated as _<symbol>@bytes
// . so use the #pragma to create an undecorated alias for our symbol
extern "C" __declspec(dllexport) LRESULT CALLBACK LowLevelKeyboardProc(
_In_ int nCode,
_In_ WPARAM wParam,
_In_ LPARAM lParam)
{
#pragma comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__)
if (nCode == HC_ACTION)
{
bool suppress = false;
PKBDLLHOOKSTRUCT pKbdLlHookStruct = (PKBDLLHOOKSTRUCT) lParam;
UINT newMsg = pKbdLlHookStruct->flags & LLKHF_UP ? WM_KEYUP : WM_KEYDOWN;
LPARAM newlParam = newMsg == WM_KEYUP ? 3<<30 : 0; // b31:transition state, b30:previous key state
// Note about PostMessage() and use of VkKeyScan():
// . Convert the ascii code to virtual key code, so that the message pump can do TranslateMessage()
// . NB. From MSDN for "WM_KEYDOWN" && "WM_KEYUP" : "Applications must pass wParam to TranslateMessage without altering it at all."
// Suppress alt-tab
if (pKbdLlHookStruct->vkCode == VK_TAB && (pKbdLlHookStruct->flags & LLKHF_ALTDOWN))
{
PostMessage(g_hFrameWindow, newMsg, LOBYTE(VkKeyScan(0x09)), newlParam);
suppress = true;
}
// Suppress alt-escape
if (pKbdLlHookStruct->vkCode == VK_ESCAPE && (pKbdLlHookStruct->flags & LLKHF_ALTDOWN))
{
PostMessage(g_hFrameWindow, newMsg, LOBYTE(VkKeyScan(0x1B)), newlParam);
suppress = true;
}
// Suppress alt-space
if (pKbdLlHookStruct->vkCode == VK_SPACE && (pKbdLlHookStruct->flags & LLKHF_ALTDOWN))
{
PostMessage(g_hFrameWindow, newMsg, LOBYTE(VkKeyScan(0x20)), newlParam);
suppress = true;
}
// Suppress ctrl-escape
bool ControlDown = (GetKeyState(VK_CONTROL) & 0x8000) != 0;
if (pKbdLlHookStruct->vkCode == VK_ESCAPE && ControlDown)
suppress = true;
// Suppress keys by returning 1
if (suppress)
return 1;
}
return CallNextHookEx(0/*parameter is ignored*/, nCode, wParam, lParam);
}
extern "C" __declspec(dllexport) void __cdecl RegisterHWND(HWND hWnd)
{
g_hFrameWindow = hWnd;
}

View file

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="HookFilter"
ProjectGUID="{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}"
RootNamespace="HookFilter"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\HookFilter.cpp"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -9,11 +9,19 @@ https://github.com/AppleWin/AppleWin/issues/new
Tom Charlesworth
1.27.3.0 - 14 Apr 2018
1.27.4.0 - 26 May 2018
----------------------
. [Bug #555] Fix for showing 559th DHGR vertical column.
- But now an HGR HCOLOR=2 vertical line at column 0 is only 1 DHGR pixel wide.
- Fix TEXT80 to be aligned with DHGR.
- Fix FLASH in TEXT80 (the inverse aux-memory char would overwrite the main-memory char).
. [Change #554] Help: Added a new help page about AppleWin's SSC emulation.
. [Change #522] SSC: ZLINK not starting unless DCD is set.
- DCD state is now a mirror of DSR unless -dcd switch is used.
- Removed -dsr,-dtr switches, so -modem is now an alias for -dcd.
. [Bug #308] SSC: For TCP mode, support DSR, DCD & CTS status bits.
. SSC: Now DTR must also be set to enable interrupts (in addition to the respective Tx/Rx interrupt bit).
. SSC: When reading the Status register, throttle calls to GetCommModemStatus() to a maximum of once every 8ms.
. SSC: Change DIPSW1's baud rate to 9600 (was 19200).
1.27.2.0 - 12 Apr 2018

View file

@ -37,7 +37,7 @@
<li>For the TCP mode it doesn't matter what baud rate, stop-bit, byte size and parity are set to.
<ul>
<li>It always uses an unthrottled data-rate of 8-bit bytes (no stop-bit, no parity).
<li>When there's an active TCP connection, then the 6551's Status register has DCD,DSR bits clear (active low), and DIPSW2 has CTS bit clear (active low). When there's no TCP connection, then all these bits are set (inactive).
<li>When there's an active TCP connection, then the 6551's Status register has DCD,DSR bits clear (active low), and DIPSW2 has CTS bit clear (active low). When there's no TCP connection, then all these bits are set (inactive).
</ul>
<li>The TCP mode can expose buggy Rx interrupt handling code where the 6551's Status register is read more than once in the Interrupt Service Routine (ISR).
<ul>
@ -58,7 +58,7 @@
<li>6551 ACIA Status register's error bits: overrun, framing and parity (these are all hardcoded to 0).
<li>6551 ACIA Status register's DCD bit (Data Carrier Detect). This is just set the same as DSR.
<ul>
<li>NB. Use command line -dcd to force AppleWin to use the state of the MS_RLSD_ON bit from GetCommModemStatus().
<li>NB. For COM mode, use command line -dcd to force AppleWin to use the state of the MS_RLSD_ON bit from GetCommModemStatus().
</ul>
<li>NMOS 6551 ACIA CTS bug: transmission of an already-started frame will stop immediately when CTS is taken false, the byte will be lost, and the TxD line will go to marking.
<ul>

View file

@ -252,8 +252,8 @@ DISK_ICON ICON "DISK.ICO"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,27,3,0
PRODUCTVERSION 1,27,3,0
FILEVERSION 1,27,4,0
PRODUCTVERSION 1,27,4,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -271,12 +271,12 @@ BEGIN
VALUE "Comments", "https://github.com/AppleWin"
VALUE "CompanyName", "AppleWin"
VALUE "FileDescription", "Apple //e Emulator for Windows"
VALUE "FileVersion", "1, 27, 3, 0"
VALUE "FileVersion", "1, 27, 4, 0"
VALUE "InternalName", "APPLEWIN"
VALUE "LegalCopyright", " 1994-2018 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, 27, 3, 0"
VALUE "ProductVersion", "1, 27, 4, 0"
END
END
BLOCK "VarFileInfo"

View file

@ -821,7 +821,7 @@ void RegisterExtensions(void)
//===========================================================================
// NB. On a restart, it's OK to call RegisterHotKey() again since the old g_hFrameWindow has been destroyed
static void AppleWin_RegisterHotKeys(void)
static void RegisterHotKeys(void)
{
BOOL bStatus[3] = {0,0,0};
@ -865,6 +865,49 @@ static void AppleWin_RegisterHotKeys(void)
}
}
//---------------------------------------------------------------------------
static HINSTANCE g_hinstDLL = 0;
static HHOOK g_hhook = 0;
// Pre: g_hFrameWindow must be valid
void HookFilterForKeyboard()
{
g_hinstDLL = LoadLibrary(TEXT("HookFilter.dll"));
_ASSERT(g_hFrameWindow);
typedef void (*RegisterHWNDProc)(HWND);
RegisterHWNDProc RegisterHWND = (RegisterHWNDProc) GetProcAddress(g_hinstDLL, "RegisterHWND");
if (RegisterHWND)
RegisterHWND(g_hFrameWindow);
HOOKPROC hkprcLowLevelKeyboardProc = (HOOKPROC) GetProcAddress(g_hinstDLL, "LowLevelKeyboardProc");
g_hhook = SetWindowsHookEx(
WH_KEYBOARD_LL,
hkprcLowLevelKeyboardProc,
g_hinstDLL,
0);
if (g_hhook == 0 || g_hFrameWindow == 0)
{
std::string msg("Failed to install hook filter for system keys");
DWORD dwErr = GetLastError();
MessageBox(GetDesktopWindow(), msg.c_str(), "Warning", MB_ICONASTERISK | MB_OK);
msg += "\n";
LogFileOutput(msg.c_str());
}
}
void UnhookFilterForKeyboard()
{
UnhookWindowsHookEx(g_hhook);
FreeLibrary(g_hinstDLL);
}
//===========================================================================
LPSTR GetCurrArg(LPSTR lpCmdLine)
@ -1362,10 +1405,13 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
RegSaveString(TEXT(REG_CONFIG), TEXT(REGVALUE_VERSION), 1, VERSIONSTRING); // Only save version after user accepts license
}
// PrintScrn support
if (g_bCapturePrintScreenKey)
AppleWin_RegisterHotKeys(); // needs valid g_hFrameWindow
LogFileOutput("Main: AppleWin_RegisterHotKeys()\n");
{
RegisterHotKeys(); // needs valid g_hFrameWindow
LogFileOutput("Main: RegisterHotKeys()\n");
}
HookFilterForKeyboard(); // needs valid g_hFrameWindow (for message pump)
// 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
@ -1472,6 +1518,8 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
DSUninit();
LogFileOutput("Main: DSUninit()\n");
UnhookFilterForKeyboard();
}
while (g_bRestart);

View file

@ -1319,7 +1319,18 @@ LRESULT CALLBACK FrameWndProc (
Config_Save_Video();
}
else if ((wparam == VK_F11) && (GetKeyState(VK_CONTROL) >= 0)) // Save state (F11)
else if (wparam == VK_F10)
{
if (g_Apple2Type == A2TYPE_PRAVETS8A && !g_bCtrlKey)
{
KeybToggleP8ACapsLock (); // F10: Toggles P8 Capslock
}
else
{
SetUsingCursor(FALSE); // Ctrl+F10
}
}
else if (wparam == VK_F11 && !g_bCtrlKey) // Save state (F11)
{
SoundCore_SetFade(FADE_OUT);
if(sg_PropertySheet.SaveStateSelectImage(window, true))
@ -1328,7 +1339,7 @@ LRESULT CALLBACK FrameWndProc (
}
SoundCore_SetFade(FADE_IN);
}
else if (wparam == VK_F12) // Load state (F12 or Ctrl+F12)
else if (wparam == VK_F12) // Load state (F12 or Ctrl+F12)
{
SoundCore_SetFade(FADE_OUT);
if(sg_PropertySheet.SaveStateSelectImage(window, false))
@ -1374,28 +1385,23 @@ LRESULT CALLBACK FrameWndProc (
// Note about Alt Gr (Right-Alt):
// . WM_KEYDOWN[Left-Control], then:
// . WM_KEYDOWN[Right-Alt]
BOOL extended = ((lparam & 0x01000000) != 0);
BOOL extended = (HIWORD(lparam) & KF_EXTENDED) != 0;
BOOL down = 1;
BOOL autorep = ((lparam & 0x40000000) != 0);
if ((!JoyProcessKey((int)wparam,extended,down,autorep)) && (g_nAppMode != MODE_LOGO))
KeybQueueKeypress((int)wparam,NOT_ASCII);
BOOL autorep = (HIWORD(lparam) & KF_REPEAT) != 0;
BOOL IsJoyKey = JoyProcessKey((int)wparam, extended, down, autorep);
if (!IsJoyKey && (g_nAppMode != MODE_LOGO))
{
KeybQueueKeypress((int)wparam, NOT_ASCII);
if ((HIWORD(lparam) & KF_REPEAT) == 0)
KeybAnyKeyDown(WM_KEYDOWN, wparam);
}
}
else if (g_nAppMode == MODE_DEBUG)
{
DebuggerProcessKey(wparam); // Debugger already active, re-direct key to debugger
}
if (wparam == VK_F10)
{
if ((g_Apple2Type == A2TYPE_PRAVETS8A) && (GetKeyState(VK_CONTROL) >= 0))
{
KeybToggleP8ACapsLock ();//Toggles P8 Capslock
}
else
{
SetUsingCursor(FALSE);
}
}
break;
case WM_KEYUP:
@ -1411,10 +1417,13 @@ LRESULT CALLBACK FrameWndProc (
}
else
{
BOOL extended = ((lparam & 0x01000000) != 0);
BOOL extended = (HIWORD(lparam) & KF_EXTENDED) != 0;
BOOL down = 0;
BOOL autorep = 0;
JoyProcessKey((int)wparam,extended,down,autorep);
BOOL bIsJoyKey = JoyProcessKey((int)wparam, extended, down, autorep);
if (!bIsJoyKey)
KeybAnyKeyDown(WM_KEYUP, wparam);
}
break;
@ -1736,6 +1745,7 @@ LRESULT CALLBACK FrameWndProc (
if ((wparam == VK_F10) || (wparam == VK_MENU)) // VK_MENU == ALT Key
return 0;
break;
case WM_SYSKEYUP:
@ -1748,6 +1758,9 @@ LRESULT CALLBACK FrameWndProc (
PostMessage(window,WM_KEYUP,wparam,lparam);
break;
case WM_MENUCHAR: // GH#556 - Suppress the Windows Default Beep (ie. Ding) whenever ALT+<key> is pressed
return (MNC_CLOSE << 16) | (wparam & 0xffff);
case WM_USER_BENCHMARK: {
UpdateWindow(window);
ResetMachineState();

View file

@ -119,7 +119,7 @@ BYTE KeybGetKeycode () // Used by MemCheckPaging() & VideoCheckMode()
//===========================================================================
void KeybQueueKeypress (int key, BOOL bASCII)
{
if (bASCII == ASCII)
if (bASCII == ASCII) // WM_CHAR
{
if (g_bFreshReset && key == VK_CANCEL) // OLD HACK: 0x03
{
@ -274,9 +274,10 @@ void KeybQueueKeypress (int key, BOOL bASCII)
keycode = key;
}
}
lastvirtkey = LOBYTE(VkKeyScan(key));
}
else //(bASCII != ASCII)
else //(bASCII != ASCII) // WM_KEYDOWN
{
// Note: VK_CANCEL is Control-Break
if ((key == VK_CANCEL) && (GetKeyState(VK_CONTROL) < 0))
@ -389,14 +390,58 @@ static char ClipboardCurrChar(bool bIncPtr)
//===========================================================================
static uint64_t g_AKDFlags[4] = {0,0,0,0};
// NB. Don't need to be concerned about if numpad/cursors are used for joystick,
// since parent calls JoyProcessKey() just before this.
void KeybAnyKeyDown(UINT message, WPARAM wparam)
{
if (wparam > 255)
{
_ASSERT(0);
return;
}
if (wparam == VK_BACK ||
wparam == VK_TAB ||
wparam == VK_RETURN ||
wparam == VK_ESCAPE ||
wparam == VK_SPACE ||
(wparam >= VK_LEFT && wparam <= VK_DOWN) ||
wparam == VK_DELETE ||
(wparam >= '0' && wparam <= '9') ||
(wparam >= 'A' && wparam <= 'Z') ||
(wparam >= VK_NUMPAD0 && wparam <= VK_NUMPAD9) ||
(wparam >= VK_MULTIPLY && wparam <= VK_DIVIDE) ||
(wparam >= VK_OEM_1 && wparam <= VK_OEM_3) || // 7 in total
(wparam >= VK_OEM_4 && wparam <= VK_OEM_8) || // 5 in total
(wparam == VK_OEM_102))
{
UINT offset = wparam >> 6;
UINT bit = wparam & 0x3f;
if (message == WM_KEYDOWN)
g_AKDFlags[offset] |= (1LL<<bit);
else
g_AKDFlags[offset] &= ~(1LL<<bit);
}
}
static bool IsAKD(void)
{
return g_AKDFlags[0] || g_AKDFlags[1] || g_AKDFlags[2] || g_AKDFlags[3];
}
//===========================================================================
BYTE __stdcall KeybReadData (WORD, WORD, BYTE, BYTE, ULONG)
{
LogFileTimeUntilFirstKeyRead();
if(g_bPasteFromClipboard)
if (g_bPasteFromClipboard)
ClipboardInit();
if(g_bClipboardActive)
if (g_bClipboardActive)
{
if(*lptstr == 0)
ClipboardDone();
@ -413,10 +458,10 @@ BYTE __stdcall KeybReadData (WORD, WORD, BYTE, BYTE, ULONG)
BYTE __stdcall KeybReadFlag (WORD, WORD, BYTE, BYTE, ULONG)
{
if(g_bPasteFromClipboard)
if (g_bPasteFromClipboard)
ClipboardInit();
if(g_bClipboardActive)
if (g_bClipboardActive)
{
if(*lptstr == 0)
ClipboardDone();
@ -428,7 +473,12 @@ BYTE __stdcall KeybReadFlag (WORD, WORD, BYTE, BYTE, ULONG)
keywaiting = 0;
return keycode | ((GetKeyState(lastvirtkey) < 0) ? 0x80 : 0);
if (IS_APPLE2) // Include Pravets machines too?
return keycode;
// AKD
return keycode | (IsAKD() ? 0x80 : 0);
}
//===========================================================================

View file

@ -14,6 +14,7 @@ BYTE KeybGetKeycode ();
void KeybQueueKeypress (int,BOOL);
void KeybToggleCapsLock ();
void KeybToggleP8ACapsLock ();
void KeybAnyKeyDown(UINT message, WPARAM wparam);
void KeybSetSnapshot_v1(const BYTE LastKey);
void KeybSaveSnapshot(class YamlSaveHelper& yamlSaveHelper);
void KeybLoadSnapshot(class YamlLoadHelper& yamlLoadHelper);

View file

@ -481,7 +481,7 @@ inline uint16_t getLoResBits( uint8_t iByte )
//===========================================================================
inline uint32_t getScanlineColor( const uint16_t signal, const bgra_t *pTable )
{
g_nSignalBitsNTSC = ((g_nSignalBitsNTSC << 1) | signal) & 0xFFF; // 14-bit
g_nSignalBitsNTSC = ((g_nSignalBitsNTSC << 1) | signal) & 0xFFF; // 12-bit
return *(uint32_t*) &pTable[ g_nSignalBitsNTSC ];
}
@ -658,6 +658,9 @@ inline void updateFramebufferMonitorDoubleScanline( uint16_t signal, bgra_t *pTa
#endif
//===========================================================================
// NB. g_nLastColumnPixelNTSC = bits.b13 will be superseded by these parent funcs which use bits.b14:
// . updateScreenDoubleHires80(), updateScreenDoubleLores80(), updateScreenText80()
inline void updatePixels( uint16_t bits )
{
if (g_nColorBurstPixels < 2)
@ -683,7 +686,7 @@ inline void updatePixels( uint16_t bits )
/* #7 of 7 */
g_pFuncUpdateBnWPixel(bits & 1); bits >>= 1;
g_pFuncUpdateBnWPixel(bits & 1);
g_nLastColumnPixelNTSC=bits& 1 ; bits >>= 1;
g_nLastColumnPixelNTSC = bits & 1;
}
else
{
@ -708,7 +711,7 @@ inline void updatePixels( uint16_t bits )
/* #7 of 7 */
g_pFuncUpdateHuePixel(bits & 1); bits >>= 1; // 0000 0000 0000 0abc
g_pFuncUpdateHuePixel(bits & 1);
g_nLastColumnPixelNTSC=bits& 1 ; bits >>= 1; // 0000 0000 0000 00ab
g_nLastColumnPixelNTSC = bits & 1;
}
}
@ -723,7 +726,7 @@ inline void updateVideoScannerHorzEOL()
if (g_nColorBurstPixels < 2)
{
// NOTE: This writes out-of-bounds for a 560x384 framebuffer
g_pFuncUpdateBnWPixel(0);
g_pFuncUpdateBnWPixel(g_nLastColumnPixelNTSC);
g_pFuncUpdateBnWPixel(0);
g_pFuncUpdateBnWPixel(0);
g_pFuncUpdateBnWPixel(0);
@ -731,10 +734,10 @@ inline void updateVideoScannerHorzEOL()
else
{
// NOTE: This writes out-of-bounds for a 560x384 framebuffer
g_pFuncUpdateHuePixel(g_nLastColumnPixelNTSC);
g_pFuncUpdateHuePixel(0);
g_pFuncUpdateHuePixel(0);
g_pFuncUpdateHuePixel(0);
g_pFuncUpdateHuePixel(g_nLastColumnPixelNTSC); // BUGFIX: ARCHON: green fringe on end of line
}
}
@ -745,7 +748,6 @@ inline void updateVideoScannerHorzEOL()
g_nVideoClockVert = 0;
updateFlashRate();
//VideoRefreshScreen(); // ContinueExecution() calls VideoRefreshScreen() every dwClksPerFrame (17030)
}
if (g_nVideoClockVert < VIDEO_SCANNER_Y_DISPLAY)
@ -1155,8 +1157,6 @@ void updateScreenDoubleHires40 (long cycles6502) // wsUpdateVideoHires0
//===========================================================================
void updateScreenDoubleHires80 (long cycles6502 ) // wsUpdateVideoDblHires
{
uint16_t bits;
if (g_nVideoMixed && g_nVideoClockVert >= VIDEO_SCANNER_Y_MIXED)
{
g_pFuncUpdateTextScreen( cycles6502 );
@ -1181,10 +1181,10 @@ void updateScreenDoubleHires80 (long cycles6502 ) // wsUpdateVideoDblHires
uint8_t m = pMain[0];
uint8_t a = pAux [0];
bits = ((m & 0x7f) << 7) | (a & 0x7f);
uint16_t bits = ((m & 0x7f) << 7) | (a & 0x7f);
bits = (bits << 1) | g_nLastColumnPixelNTSC;
updatePixels( bits );
g_nLastColumnPixelNTSC = (bits >> 14) & 3;
g_nLastColumnPixelNTSC = (bits >> 14) & 1;
}
}
updateVideoScannerHorzEOL();
@ -1257,12 +1257,10 @@ void updateScreenDoubleLores80 (long cycles6502) // wsUpdateVideoDblLores
uint16_t aux = hi >> (((1 - (g_nVideoClockHorz & 1)) * 2) + 3);
uint16_t bits = (main << 7) | (aux & 0x7f);
updatePixels( bits );
g_nLastColumnPixelNTSC = (bits >> 14) & 3;
g_nLastColumnPixelNTSC = (bits >> 14) & 1;
}
}
updateVideoScannerHorzEOL();
}
}
@ -1274,7 +1272,7 @@ void updateScreenSingleHires40 (long cycles6502)
g_pFuncUpdateTextScreen( cycles6502 );
return;
}
for (; cycles6502 > 0; --cycles6502)
{
uint16_t addr = updateVideoScannerAddressHGR();
@ -1394,8 +1392,10 @@ void updateScreenText80 (long cycles6502)
if ((0 == g_nVideoCharSet) && 0x40 == (a & 0xC0)) // Flash only if mousetext not active
aux ^= g_nTextFlashMask;
uint16_t bits = (main << 7) | aux;
uint16_t bits = (main << 7) | (aux & 0x7f);
bits = (bits << 1) | g_nLastColumnPixelNTSC; // GH#555: Align TEXT80 chars with DHGR
updatePixels( bits );
g_nLastColumnPixelNTSC = (bits >> 14) & 1;
}
}
updateVideoScannerHorzEOL();
@ -1629,7 +1629,11 @@ void NTSC_VideoInit( uint8_t* pFramebuffer ) // wsVideoInit
updateMonochromeTables( 0xFF, 0xFF, 0xFF );
for (int y = 0; y < (VIDEO_SCANNER_Y_DISPLAY*2); y++)
g_pScanLines[y] = (bgra_t*)(g_pFramebufferbits + sizeof(bgra_t) * GetFrameBufferWidth() * ((GetFrameBufferHeight() - 1) - y - GetFrameBufferBorderHeight()) + (sizeof(bgra_t) * GetFrameBufferBorderWidth()));
{
uint32_t offset = sizeof(bgra_t) * GetFrameBufferWidth() * ((GetFrameBufferHeight() - 1) - y - GetFrameBufferBorderHeight()) + (sizeof(bgra_t) * GetFrameBufferBorderWidth());
offset -= sizeof(bgra_t); // GH#555: Start 1 RGBA pixel before frame to account for g_nLastColumnPixelNTSC
g_pScanLines[y] = (bgra_t*) (g_pFramebufferbits + offset);
}
g_pVideoAddress = g_pScanLines[0];

View file

@ -91,26 +91,18 @@ void CSuperSerialCard::InternalReset()
{
GetDIPSW();
// SY6551 datasheet: Hardware reset sets Control register to 0 - the DIPSW settings are not used by h/w to setup this register
m_uControlByte = 0;
// SY6551 datasheet: Hardware reset sets Command register to 0
// . NB. MOS6551 datasheet: Hardware reset: b#00000010 (so ACIA not init'd on IN#2!)
UpdateCommandReg(0);
m_uBaudRate = m_kDefaultBaudRate; // Undefined, as CONTROL.CLK_SOURCE=0=External clock is not supported for SSC - so nominally AppleWin default
m_uStopBits = ONESTOPBIT;
m_uByteSize = 8;
m_uParity = NOPARITY;
// SY6551 datasheet: Hardware reset sets Control register to 0 - the DIPSW settings are not used by h/w to setup this register
UpdateCommandAndControlRegs(0, 0); // Baud=External clock! 8-N-1
//
m_vuRxCurrBuffer = 0;
m_vbTxIrqPending = false;
m_vbRxIrqPending = false;
m_vbTxEmpty = true;
m_vuRxCurrBuffer = 0;
m_qComSerialBuffer[0].clear();
m_qComSerialBuffer[1].clear();
m_qTcpSerialBuffer.clear();
@ -468,6 +460,13 @@ BYTE __stdcall CSuperSerialCard::CommProgramReset(WORD, WORD, BYTE, BYTE, ULONG)
//===========================================================================
void CSuperSerialCard::UpdateCommandAndControlRegs(BYTE uCommandByte, BYTE uControlByte)
{
// UpdateCommandReg() first to initialise m_uParity, before calling UpdateControlReg()
UpdateCommandReg(uCommandByte);
UpdateControlReg(uControlByte);
}
void CSuperSerialCard::UpdateCommandReg(BYTE command)
{
m_uCommandByte = command;
@ -514,6 +513,10 @@ void CSuperSerialCard::UpdateCommandReg(BYTE command)
if (m_DIPSWCurrent.bInterrupts && m_uCommandByte & CMD_DTR)
{
// Assume enabling Rx IRQ if STATUS.ST_RX_FULL *does not* trigger an IRQ
// . EG. Disable Rx IRQ, receive a byte (don't read STATUS or RX_DATA register), enable Rx IRQ
// Assume enabling Tx IRQ if STATUS.ST_TX_EMPTY *does not* trigger an IRQ
// . otherwise there'd be a "false" TX Empty IRQ even if nothing had ever been transferred!
m_bTxIrqEnabled = (m_uCommandByte & CMD_TX_MASK) == CMD_TX_IRQ_ENA_RTS_LOW;
m_bRxIrqEnabled = (m_uCommandByte & CMD_RX_IRQ_DIS) == 0;
}
@ -543,6 +546,67 @@ BYTE __stdcall CSuperSerialCard::CommCommand(WORD, WORD, BYTE write, BYTE value,
//===========================================================================
void CSuperSerialCard::UpdateControlReg(BYTE control)
{
m_uControlByte = control;
// UPDATE THE BAUD RATE
switch (m_uControlByte & 0x0F)
{
// Note that 1 MHz Apples (everything other than the Apple IIgs and //c
// Plus running in "fast" mode) cannot handle 19.2 kbps, and even 9600
// bps on these machines requires either some highly optimised code or
// a decent buffer in the device being accessed. The faster Apples
// have no difficulty with this speed, however. [Ref.1]
case 0x00: m_uBaudRate = CBR_115200; break; // Internal clk: undoc'd 115.2K (or 16x external clock)
case 0x01: // fall through [50 bps]
case 0x02: // fall through [75 bps]
case 0x03: // fall through [109.92 bps]
case 0x04: // fall through [134.58 bps]
case 0x05: m_uBaudRate = CBR_110; break; // [150 bps]
case 0x06: m_uBaudRate = CBR_300; break;
case 0x07: m_uBaudRate = CBR_600; break;
case 0x08: m_uBaudRate = CBR_1200; break;
case 0x09: // fall through [1800 bps]
case 0x0A: m_uBaudRate = CBR_2400; break;
case 0x0B: // fall through [3600 bps]
case 0x0C: m_uBaudRate = CBR_4800; break;
case 0x0D: // fall through [7200 bps]
case 0x0E: m_uBaudRate = CBR_9600; break;
case 0x0F: m_uBaudRate = CBR_19200; break;
}
if (m_uControlByte & 0x10)
{
// receiver clock source [0= external, 1= internal]
}
// UPDATE THE BYTE SIZE
switch (m_uControlByte & 0x60)
{
case 0x00: m_uByteSize = 8; break;
case 0x20: m_uByteSize = 7; break;
case 0x40: m_uByteSize = 6; break;
case 0x60: m_uByteSize = 5; break;
}
// UPDATE THE NUMBER OF STOP BITS
if (m_uControlByte & 0x80)
{
if ((m_uByteSize == 8) && (m_uParity != NOPARITY))
m_uStopBits = ONESTOPBIT;
else if ((m_uByteSize == 5) && (m_uParity == NOPARITY))
m_uStopBits = ONE5STOPBITS;
else
m_uStopBits = TWOSTOPBITS;
}
else
{
m_uStopBits = ONESTOPBIT;
}
}
BYTE __stdcall CSuperSerialCard::CommControl(WORD, WORD, BYTE write, BYTE value, ULONG)
{
if (!CheckComm())
@ -550,64 +614,7 @@ BYTE __stdcall CSuperSerialCard::CommControl(WORD, WORD, BYTE write, BYTE value,
if (write && (value != m_uControlByte))
{
m_uControlByte = value;
// UPDATE THE BAUD RATE
switch (m_uControlByte & 0x0F)
{
// Note that 1 MHz Apples (everything other than the Apple IIgs and //c
// Plus running in "fast" mode) cannot handle 19.2 kbps, and even 9600
// bps on these machines requires either some highly optimised code or
// a decent buffer in the device being accessed. The faster Apples
// have no difficulty with this speed, however. [Ref.1]
case 0x00: m_uBaudRate = CBR_115200; break; // Internal clk: undoc'd 115.2K (or 16x external clock)
case 0x01: // fall through [50 bps]
case 0x02: // fall through [75 bps]
case 0x03: // fall through [109.92 bps]
case 0x04: // fall through [134.58 bps]
case 0x05: m_uBaudRate = CBR_110; break; // [150 bps]
case 0x06: m_uBaudRate = CBR_300; break;
case 0x07: m_uBaudRate = CBR_600; break;
case 0x08: m_uBaudRate = CBR_1200; break;
case 0x09: // fall through [1800 bps]
case 0x0A: m_uBaudRate = CBR_2400; break;
case 0x0B: // fall through [3600 bps]
case 0x0C: m_uBaudRate = CBR_4800; break;
case 0x0D: // fall through [7200 bps]
case 0x0E: m_uBaudRate = CBR_9600; break;
case 0x0F: m_uBaudRate = CBR_19200; break;
}
if (m_uControlByte & 0x10)
{
// receiver clock source [0= external, 1= internal]
}
// UPDATE THE BYTE SIZE
switch (m_uControlByte & 0x60)
{
case 0x00: m_uByteSize = 8; break;
case 0x20: m_uByteSize = 7; break;
case 0x40: m_uByteSize = 6; break;
case 0x60: m_uByteSize = 5; break;
}
// UPDATE THE NUMBER OF STOP BITS
if (m_uControlByte & 0x80)
{
if ((m_uByteSize == 8) && (m_uParity != NOPARITY))
m_uStopBits = ONESTOPBIT;
else if ((m_uByteSize == 5) && (m_uParity == NOPARITY))
m_uStopBits = ONE5STOPBITS;
else
m_uStopBits = TWOSTOPBITS;
}
else
{
m_uStopBits = ONESTOPBIT;
}
UpdateControlReg(value);
UpdateCommState();
}
@ -1354,20 +1361,22 @@ void CSuperSerialCard::SetSnapshot_v1( const DWORD baudrate,
const BYTE parity,
const BYTE stopbits)
{
m_uBaudRate = baudrate;
m_uStopBits = stopbits;
m_uByteSize = bytesize;
// m_dwCommInactivity = comminactivity; // Obsolete
m_uControlByte = controlbyte;
// m_uParity = parity; // Redundant: derived from commandbyte in UpdateCommandReg()
// memcpy(m_RecvBuffer, pSS->recvbuffer, uRecvBufferSize);
// m_vRecvBytes = recvbytes;
// Redundant:
// . baudrate, stopbits, bytesize (encapsulated in controlbyte)
// . parity (encapsulated in commandbyte)
// Obsolete:
// . comminactivity
UpdateCommandReg(commandbyte);
UpdateCommandAndControlRegs(commandbyte, controlbyte);
}
//===========================================================================
// Unit version history:
// 2: Added: Support DCD flag
// Removed: redundant data (encapsulated in Command & Control bytes)
static const UINT kUNIT_VERSION = 2;
#define SS_YAML_VALUE_CARD_SSC "Super Serial Card"
#define SS_YAML_KEY_DIPSWDEFAULT "DIPSW Default"
@ -1389,6 +1398,7 @@ void CSuperSerialCard::SetSnapshot_v1( const DWORD baudrate,
#define SS_YAML_KEY_RXIRQPENDING "RX IRQ Pending"
#define SS_YAML_KEY_WRITTENTX "Written TX"
#define SS_YAML_KEY_SERIALPORTNAME "Serial Port Name"
#define SS_YAML_KEY_SUPPORT_DCD "Support DCD"
std::string CSuperSerialCard::GetSnapshotCardName(void)
{
@ -1410,23 +1420,17 @@ void CSuperSerialCard::SaveSnapshotDIPSW(YamlSaveHelper& yamlSaveHelper, std::st
void CSuperSerialCard::SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
{
YamlSaveHelper::Slot slot(yamlSaveHelper, GetSnapshotCardName(), m_uSlot, 1);
YamlSaveHelper::Slot slot(yamlSaveHelper, GetSnapshotCardName(), m_uSlot, kUNIT_VERSION);
YamlSaveHelper::Label unit(yamlSaveHelper, "%s:\n", SS_YAML_KEY_STATE);
SaveSnapshotDIPSW(yamlSaveHelper, SS_YAML_KEY_DIPSWDEFAULT, m_DIPSWDefault);
SaveSnapshotDIPSW(yamlSaveHelper, SS_YAML_KEY_DIPSWCURRENT, m_DIPSWCurrent);
yamlSaveHelper.SaveUint(SS_YAML_KEY_BAUDRATE, m_uBaudRate);
yamlSaveHelper.SaveUint(SS_YAML_KEY_STOPBITS, m_uStopBits);
yamlSaveHelper.SaveUint(SS_YAML_KEY_BYTESIZE, m_uByteSize);
yamlSaveHelper.SaveUint(SS_YAML_KEY_PARITY, m_uParity); // Redundant
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_CONTROL, m_uControlByte);
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_COMMAND, m_uCommandByte);
yamlSaveHelper.SaveUint(SS_YAML_KEY_INACTIVITY, 0); // Obsolete
yamlSaveHelper.SaveBool(SS_YAML_KEY_TXIRQENABLED, m_bTxIrqEnabled); // Redundant
yamlSaveHelper.SaveBool(SS_YAML_KEY_RXIRQENABLED, m_bRxIrqEnabled); // Redundant
yamlSaveHelper.SaveBool(SS_YAML_KEY_TXIRQPENDING, m_vbTxIrqPending);
yamlSaveHelper.SaveBool(SS_YAML_KEY_RXIRQPENDING, m_vbRxIrqPending);
yamlSaveHelper.SaveBool(SS_YAML_KEY_WRITTENTX, m_vbTxEmpty);
yamlSaveHelper.SaveBool(SS_YAML_KEY_SUPPORT_DCD, m_bCfgSupportDCD);
yamlSaveHelper.SaveString(SS_YAML_KEY_SERIALPORTNAME, GetSerialPortName());
}
@ -1451,27 +1455,37 @@ bool CSuperSerialCard::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, U
if (slot != 2) // fixme
throw std::string("Card: wrong slot");
if (version != 1)
if (version < 1 || version > kUNIT_VERSION)
throw std::string("Card: wrong version");
LoadSnapshotDIPSW(yamlLoadHelper, SS_YAML_KEY_DIPSWDEFAULT, m_DIPSWDefault);
LoadSnapshotDIPSW(yamlLoadHelper, SS_YAML_KEY_DIPSWCURRENT, m_DIPSWCurrent);
m_uBaudRate = yamlLoadHelper.LoadUint(SS_YAML_KEY_BAUDRATE);
m_uStopBits = yamlLoadHelper.LoadUint(SS_YAML_KEY_STOPBITS);
m_uByteSize = yamlLoadHelper.LoadUint(SS_YAML_KEY_BYTESIZE);
yamlLoadHelper.LoadUint(SS_YAML_KEY_PARITY); // Redundant: derived from uCommandByte in UpdateCommandReg()
m_uControlByte = yamlLoadHelper.LoadUint(SS_YAML_KEY_CONTROL);
if (version == 1) // Consume redundant/obsolete data
{
yamlLoadHelper.LoadUint(SS_YAML_KEY_PARITY); // Redundant: derived from uCommandByte in UpdateCommandReg()
yamlLoadHelper.LoadBool(SS_YAML_KEY_TXIRQENABLED); // Redundant: derived from uCommandByte in UpdateCommandReg()
yamlLoadHelper.LoadBool(SS_YAML_KEY_RXIRQENABLED); // Redundant: derived from uCommandByte in UpdateCommandReg()
yamlLoadHelper.LoadUint(SS_YAML_KEY_BAUDRATE); // Redundant: derived from uControlByte in UpdateControlReg()
yamlLoadHelper.LoadUint(SS_YAML_KEY_STOPBITS); // Redundant: derived from uControlByte in UpdateControlReg()
yamlLoadHelper.LoadUint(SS_YAML_KEY_BYTESIZE); // Redundant: derived from uControlByte in UpdateControlReg()
yamlLoadHelper.LoadUint(SS_YAML_KEY_INACTIVITY); // Obsolete (so just consume)
}
else if (version >= 2)
{
SupportDCD( yamlLoadHelper.LoadBool(SS_YAML_KEY_SUPPORT_DCD) );
}
UINT uCommandByte = yamlLoadHelper.LoadUint(SS_YAML_KEY_COMMAND);
yamlLoadHelper.LoadUint(SS_YAML_KEY_INACTIVITY); // Obsolete (so just consume)
yamlLoadHelper.LoadBool(SS_YAML_KEY_TXIRQENABLED); // Redundant: derived from uCommandByte in UpdateCommandReg()
yamlLoadHelper.LoadBool(SS_YAML_KEY_RXIRQENABLED); // Redundant: derived from uCommandByte in UpdateCommandReg()
UINT uControlByte = yamlLoadHelper.LoadUint(SS_YAML_KEY_CONTROL);
UpdateCommandAndControlRegs(uCommandByte, uControlByte);
m_vbTxIrqPending = yamlLoadHelper.LoadBool(SS_YAML_KEY_TXIRQPENDING);
m_vbRxIrqPending = yamlLoadHelper.LoadBool(SS_YAML_KEY_RXIRQPENDING);
m_vbTxEmpty = yamlLoadHelper.LoadBool(SS_YAML_KEY_WRITTENTX);
UpdateCommandReg(uCommandByte);
std::string serialPortName = yamlLoadHelper.LoadString(SS_YAML_KEY_SERIALPORTNAME);
SetSerialPortName(serialPortName.c_str());

View file

@ -62,7 +62,9 @@ private:
BYTE __stdcall CommProgramReset(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles);
void InternalReset();
void UpdateCommandAndControlRegs(BYTE command, BYTE control);
void UpdateCommandReg(BYTE command);
void UpdateControlReg(BYTE control);
void GetDIPSW();
void SetDIPSWDefaults();
UINT BaudRateToIndex(UINT uBaudRate);