First Addition of the Win32 binary (using Visual Studio 2022)

This commit is contained in:
Olivier Goguel 2022-08-31 22:29:43 +02:00
parent 5b8e1f795f
commit 9283b0436c
105 changed files with 13456 additions and 7 deletions

4
.gitignore vendored
View File

@ -2,3 +2,7 @@
xcuserdata/
ActiveGS_AsmJS/out
contents.xcworkspacedata
.vs/
~Build/
*.vcxproj.user

31
ActiveGS.exe/ActiveGS.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32819.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ActiveGS", "ActiveGS91.exe.vcxproj", "{49D558B6-A2BC-4F7F-9F20-8C722193DD76}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{49D558B6-A2BC-4F7F-9F20-8C722193DD76}.Debug|x64.ActiveCfg = Debug|x64
{49D558B6-A2BC-4F7F-9F20-8C722193DD76}.Debug|x64.Build.0 = Debug|x64
{49D558B6-A2BC-4F7F-9F20-8C722193DD76}.Debug|x86.ActiveCfg = Debug|Win32
{49D558B6-A2BC-4F7F-9F20-8C722193DD76}.Debug|x86.Build.0 = Debug|Win32
{49D558B6-A2BC-4F7F-9F20-8C722193DD76}.Release|x64.ActiveCfg = Release|x64
{49D558B6-A2BC-4F7F-9F20-8C722193DD76}.Release|x64.Build.0 = Release|x64
{49D558B6-A2BC-4F7F-9F20-8C722193DD76}.Release|x86.ActiveCfg = Release|Win32
{49D558B6-A2BC-4F7F-9F20-8C722193DD76}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B0B0FDD8-92C9-4AF4-A72D-4DAFD4AAF4BF}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,412 @@
<?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="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>ActiveGS</ProjectName>
<ProjectGuid>{49D558B6-A2BC-4F7F-9F20-8C722193DD76}</ProjectGuid>
<RootNamespace>ActiveGS91exe</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<UseOfMfc>Static</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</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)'=='Release|x64'" 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>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" 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>16.0.30427.251</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)~Build\$(ProjectName)\$(Configuration)\$(PlatformShortName)</OutDir>
<IntDir>$(SolutionDir)~Build\Objs\$(ProjectName)\$(Configuration)\$(PlatformShortName)</IntDir>
<LinkIncremental>true</LinkIncremental>
<TargetName>A$(TargetExt)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)~Build\$(ProjectName)\$(Configuration)\$(PlatformShortName)</OutDir>
<IntDir>$(SolutionDir)~Build\Objs\$(ProjectName)\$(Configuration)\$(PlatformShortName)</IntDir>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)~Build\$(ProjectName)\$(Configuration)\$(PlatformShortName)</OutDir>
<IntDir>$(SolutionDir)~Build\Objs\$(ProjectName)\$(Configuration)\$(PlatformShortName)</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)~Build\$(ProjectName)\$(Configuration)\$(PlatformShortName)</OutDir>
<IntDir>$(SolutionDir)~Build\Objs\$(ProjectName)\$(Configuration)\$(PlatformShortName)</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;KEGS_LITTLE_ENDIAN;ACTIVEGS;KEGS91;KEGS_BETAVERSION;DRIVER_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>winmm.lib;comctl32.lib;nafxcwd.lib;libcmtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>msvcrtd.lib nafxcwd.lib libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<OutputFile>$(OutDir)$(TargetName)</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;KEGS_LITTLE_ENDIAN;ACTIVEGS;KEGS91;KEGS_BETAVERSION;DRIVER_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>winmm.lib;comctl32.lib;nafxcwd.lib;libcmtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>msvcrtd.lib nafxcwd.lib libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;KEGS_LITTLE_ENDIAN;ACTIVEGS;KEGS91;KEGS_BETAVERSION;DRIVER_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<PrecompiledHeaderFile>../Common.win32/StdAfx.h</PrecompiledHeaderFile>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>winmm.lib;comctl32.lib;nafxcw.lib;libcmt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(SolutionDir)run\ActiveGS.exe</OutputFile>
<IgnoreSpecificDefaultLibraries>msvcrt.lib nafxcw.lib libcmt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;KEGS_LITTLE_ENDIAN;ACTIVEGS;KEGS91;KEGS_BETAVERSION;DRIVER_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>../Common.win32/StdAfx.h</PrecompiledHeaderFile>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>winmm.lib;comctl32.lib;nafxcw.lib;libcmt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<IgnoreSpecificDefaultLibraries>msvcrt.lib nafxcw.lib libcmt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\Common.win32\ActiveCommon.cpp" />
<ClCompile Include="..\Common.win32\ActiveDownloadWin32.cpp" />
<ClCompile Include="..\Common.win32\ActiveInfo.cpp" />
<ClCompile Include="..\Common.win32\ActiveStatus.cpp" />
<ClCompile Include="..\Common.win32\ChildView.cpp" />
<ClCompile Include="..\Common.win32\DiskEditURL.cpp" />
<ClCompile Include="..\Common.win32\HyperLink.cpp" />
<ClCompile Include="..\Common.win32\SliderZip.cpp" />
<ClCompile Include="..\Common.win32\stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\Common.win32\TabGeneral.cpp" />
<ClCompile Include="..\Common.win32\TabOption.cpp" />
<ClCompile Include="..\Common.win32\TabRuntime.cpp" />
<ClCompile Include="..\Common.win32\TabXml.cpp" />
<ClCompile Include="..\Common.win32\winconsole.cpp" />
<ClCompile Include="..\Common\3rdpartylib\simplexml.cpp" />
<ClCompile Include="..\Common\activeconfig.cpp" />
<ClCompile Include="..\Common\ActiveDownload.cpp" />
<ClCompile Include="..\Common\ActiveGSList.cpp" />
<ClCompile Include="..\Common\ActiveZip.cpp" />
<ClCompile Include="..\Common\apple2e.cpp" />
<ClCompile Include="..\Common\CA2Text.cpp" />
<ClCompile Include="..\Common\CEmulatorCtrl.cpp" />
<ClCompile Include="..\Common\interface.cpp" />
<ClCompile Include="..\Common\libpng.cpp" />
<ClCompile Include="..\Common\rom.cpp" />
<ClCompile Include="..\Drivers\activegs_driver.cpp" />
<ClCompile Include="..\Libraries\libpng\png.cpp" />
<ClCompile Include="..\Libraries\libpng\pngerror.cpp" />
<ClCompile Include="..\Libraries\libpng\pnggccrd.cpp" />
<ClCompile Include="..\Libraries\libpng\pngget.cpp" />
<ClCompile Include="..\Libraries\libpng\pngmem.cpp" />
<ClCompile Include="..\Libraries\libpng\pngpread.cpp" />
<ClCompile Include="..\Libraries\libpng\pngread.cpp" />
<ClCompile Include="..\Libraries\libpng\pngrio.cpp" />
<ClCompile Include="..\Libraries\libpng\pngrtran.cpp" />
<ClCompile Include="..\Libraries\libpng\pngrutil.cpp" />
<ClCompile Include="..\Libraries\libpng\pngset.cpp" />
<ClCompile Include="..\Libraries\libpng\pngtrans.cpp" />
<ClCompile Include="..\Libraries\libpng\pngvcrd.cpp" />
<ClCompile Include="..\Libraries\libpng\pngwio.cpp" />
<ClCompile Include="..\Libraries\libpng\pngwrite.cpp" />
<ClCompile Include="..\Libraries\libpng\pngwtran.cpp" />
<ClCompile Include="..\Libraries\libpng\pngwutil.cpp" />
<ClCompile Include="..\kegs\Src\adb.cpp" />
<ClCompile Include="..\kegs\Src\async_event.cpp" />
<ClCompile Include="..\kegs\Src\bigfile.cpp" />
<ClCompile Include="..\kegs\Src\clock.cpp" />
<ClCompile Include="..\kegs\Src\compile_time.cpp" />
<ClCompile Include="..\kegs\Src\compression.cpp" />
<ClCompile Include="..\kegs\Src\config_generic.cpp" />
<ClCompile Include="..\kegs\Src\dis.cpp" />
<ClCompile Include="..\kegs\Src\driver.cpp" />
<ClCompile Include="..\kegs\Src\engine_c.cpp" />
<ClCompile Include="..\kegs\Src\GraphCounter.cpp" />
<ClCompile Include="..\kegs\Src\iwm.cpp" />
<ClCompile Include="..\kegs\Src\marinetti.cpp" />
<ClCompile Include="..\kegs\Src\marinetti_helper.cpp" />
<ClCompile Include="..\kegs\Src\moremem.cpp" />
<ClCompile Include="..\kegs\Src\paddles.cpp" />
<ClCompile Include="..\kegs\Src\SaveState.cpp" />
<ClCompile Include="..\kegs\Src\scc.cpp" />
<ClCompile Include="..\kegs\Src\scc_socket_driver.cpp" />
<ClCompile Include="..\kegs\Src\sim65816.cpp" />
<ClCompile Include="..\kegs\Src\smartport.cpp" />
<ClCompile Include="..\kegs\Src\sound.cpp" />
<ClCompile Include="..\kegs\Src\sound_driver.cpp" />
<ClCompile Include="..\kegs\Src\video.cpp" />
<ClCompile Include="..\Libraries\unzip101e\ioapi.cpp" />
<ClCompile Include="..\Libraries\unzip101e\iowin32.cpp" />
<ClCompile Include="..\Libraries\unzip101e\unzip.cpp" />
<ClCompile Include="..\Libraries\unzip101e\zip.cpp" />
<ClCompile Include="..\kegs\Win\joystick_win.cpp" />
<ClCompile Include="..\kegs\Win\scc_windriver.cpp" />
<ClCompile Include="..\kegs\Win\win32snd_driver.cpp" />
<ClCompile Include="..\kegs\Win\win_activegs.cpp" />
<ClCompile Include="..\kegs\Win\win_generic.cpp" />
<ClCompile Include="..\kegs\Win\win_raster.cpp" />
<ClCompile Include="..\Libraries\zlib123\adler32.cpp" />
<ClCompile Include="..\Libraries\zlib123\compress.cpp" />
<ClCompile Include="..\Libraries\zlib123\crc32.cpp" />
<ClCompile Include="..\Libraries\zlib123\deflate.cpp" />
<ClCompile Include="..\Libraries\zlib123\inffast.cpp" />
<ClCompile Include="..\Libraries\zlib123\inflate.cpp" />
<ClCompile Include="..\Libraries\zlib123\inftrees.cpp" />
<ClCompile Include="..\Libraries\zlib123\trees.cpp" />
<ClCompile Include="..\Libraries\zlib123\uncompr.cpp" />
<ClCompile Include="..\Libraries\zlib123\zutil.cpp" />
<ClCompile Include="ActiveGSApp.cpp" />
<ClCompile Include="cgfiltyp.cpp" />
<ClCompile Include="MainFrm.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Common.win32\activecommon.h" />
<ClInclude Include="..\Common.win32\activecommonres.h" />
<ClInclude Include="..\Common.win32\ActiveInfo.h" />
<ClInclude Include="..\Common.win32\ActiveStatus.h" />
<ClInclude Include="..\Common.win32\ChildView.h" />
<ClInclude Include="..\Common.win32\consoleresrc.h" />
<ClInclude Include="..\Common.win32\DiskEditURL.h" />
<ClInclude Include="..\Common.win32\HyperLink.h" />
<ClInclude Include="..\Common.win32\SliderZip.h" />
<ClInclude Include="..\Common.win32\TabGeneral.h" />
<ClInclude Include="..\Common.win32\TabOption.h" />
<ClInclude Include="..\Common.win32\TabRuntime.h" />
<ClInclude Include="..\Common.win32\TabXml.h" />
<ClInclude Include="..\Common\3rdpartylib\simplexml.h" />
<ClInclude Include="..\Common\ActiveDownload.h" />
<ClInclude Include="..\Common\ActiveGSList.h" />
<ClInclude Include="..\Common\CEMulatorCtrl.h" />
<ClInclude Include="..\Libraries\libpng\png.h" />
<ClInclude Include="..\Libraries\libpng\pngconf.h" />
<ClInclude Include="..\kegs\Src\16inst_c.h" />
<ClInclude Include="..\kegs\Src\8inst_c.h" />
<ClInclude Include="..\kegs\Src\8inst_s.h" />
<ClInclude Include="..\kegs\Src\adb.h" />
<ClInclude Include="..\kegs\Src\async_event.h" />
<ClInclude Include="..\kegs\Src\bigfile.h" />
<ClInclude Include="..\kegs\Src\clock.h" />
<ClInclude Include="..\kegs\Src\compression.h" />
<ClInclude Include="..\kegs\Src\config.h" />
<ClInclude Include="..\kegs\Src\defc.h" />
<ClInclude Include="..\kegs\Src\defcomm.h" />
<ClInclude Include="..\kegs\Src\defs.h" />
<ClInclude Include="..\kegs\Src\defs_instr.h" />
<ClInclude Include="..\kegs\Src\disas.h" />
<ClInclude Include="..\kegs\Src\driver.h" />
<ClInclude Include="..\kegs\Src\graphcounter.h" />
<ClInclude Include="..\kegs\Src\iwm.h" />
<ClInclude Include="..\kegs\Src\iwm_35_525.h" />
<ClInclude Include="..\kegs\Src\kegsfont.h" />
<ClInclude Include="..\kegs\Src\kegsversion.h" />
<ClInclude Include="..\kegs\Src\marinetti.h" />
<ClInclude Include="..\kegs\Src\moremem.h" />
<ClInclude Include="..\kegs\Src\op_routs.h" />
<ClInclude Include="..\kegs\Src\paddles.h" />
<ClInclude Include="..\kegs\Src\prodos.h" />
<ClInclude Include="..\kegs\Src\prodos_protos.h" />
<ClInclude Include="..\kegs\Src\protos.h" />
<ClInclude Include="..\kegs\Src\protos_engine_c.h" />
<ClInclude Include="..\kegs\Src\protos_macdriver.h" />
<ClInclude Include="..\kegs\Src\protos_macsnd_driver.h" />
<ClInclude Include="..\kegs\Src\protos_windriver.h" />
<ClInclude Include="..\kegs\Src\protos_xdriver.h" />
<ClInclude Include="..\kegs\Src\raster.h" />
<ClInclude Include="..\kegs\Src\SaveState.h" />
<ClInclude Include="..\kegs\Src\scc.h" />
<ClInclude Include="..\kegs\Src\sim65816.h" />
<ClInclude Include="..\kegs\Src\size_c.h" />
<ClInclude Include="..\kegs\Src\size_tab.h" />
<ClInclude Include="..\kegs\Src\sound.h" />
<ClInclude Include="..\kegs\Src\StdString.h" />
<ClInclude Include="..\kegs\Src\superhires.h" />
<ClInclude Include="..\kegs\Src\video.h" />
<ClInclude Include="..\Libraries\unzip101e\crypt.h" />
<ClInclude Include="..\Libraries\unzip101e\ioapi.h" />
<ClInclude Include="..\Libraries\unzip101e\iowin32.h" />
<ClInclude Include="..\Libraries\unzip101e\unzip.h" />
<ClInclude Include="..\Libraries\unzip101e\zip.h" />
<ClInclude Include="..\kegs\Win\dirent-win32.h" />
<ClInclude Include="..\kegs\Win\winresource.h" />
<ClInclude Include="..\Libraries\zlib123\crc32.h" />
<ClInclude Include="..\Libraries\zlib123\deflate.h" />
<ClInclude Include="..\Libraries\zlib123\inffast.h" />
<ClInclude Include="..\Libraries\zlib123\inffixed.h" />
<ClInclude Include="..\Libraries\zlib123\inflate.h" />
<ClInclude Include="..\Libraries\zlib123\inftrees.h" />
<ClInclude Include="..\Libraries\zlib123\trees.h" />
<ClInclude Include="..\Libraries\zlib123\zconf.h" />
<ClInclude Include="..\Libraries\zlib123\zconf.in.h" />
<ClInclude Include="..\Libraries\zlib123\zlib.h" />
<ClInclude Include="..\Libraries\zlib123\zutil.h" />
<ClInclude Include="ActiveGSApp.h" />
<ClInclude Include="cgfiltyp.h" />
<ClInclude Include="MainFrm.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="resource1.h" />
<ClInclude Include="stdafx.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\Common.win32\ActiveCommon.rc" />
<ResourceCompile Include="..\Common.win32\ActiveGS.rc" />
<ResourceCompile Include="..\Common.win32\console.rc" />
<ResourceCompile Include="ActiveGSApp.rc" />
</ItemGroup>
<ItemGroup>
<Xml Include="..\run\activegsappconfig.xml" />
</ItemGroup>
<ItemGroup>
<Image Include="..\Common.win32\bitmap2.bmp" />
<Image Include="..\Common.win32\bmp00001.bmp" />
<Image Include="..\Common.win32\disk52.bmp" />
<Image Include="..\Common.win32\disk54.bmp" />
<Image Include="..\Common.win32\disk55.bmp" />
<Image Include="..\Common32\bitmap2.bmp" />
<Image Include="..\Common32\disk52.bmp" />
<Image Include="..\Common32\disk54.bmp" />
<Image Include="..\Common32\disk55.bmp" />
<Image Include="res\ActiveGSApp.ico" />
<Image Include="res\idr_22mg.ico" />
<Image Include="res\idr_2mg1.ico" />
<Image Include="res\idr_main.ico" />
<Image Include="res\Toolbar.bmp" />
</ItemGroup>
<ItemGroup>
<Manifest Include="res\ActiveGSApp.manifest" />
</ItemGroup>
<ItemGroup>
<None Include="..\Common.win32\cursor1.cur" />
</ItemGroup>
<ItemGroup>
<Media Include="..\Common\sounds\Spin Up Search 1.wav" />
<Media Include="..\Common\sounds\Spin Up Search 2.wav" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties RESOURCE_FILE="ActiveGSApp.rc" />
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@ -0,0 +1,615 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Common">
<UniqueIdentifier>{0876290e-5ea0-4529-80ca-3e33de8b9a40}</UniqueIdentifier>
</Filter>
<Filter Include="common.win32">
<UniqueIdentifier>{6da1666e-cbb0-4abb-a97f-ac0478b844f8}</UniqueIdentifier>
</Filter>
<Filter Include="Src">
<UniqueIdentifier>{b38e7a11-43e1-4c45-9e0a-298f7faa5b34}</UniqueIdentifier>
</Filter>
<Filter Include="Src\H">
<UniqueIdentifier>{12d375d5-3df0-4a7e-9086-c545dbdf625d}</UniqueIdentifier>
</Filter>
<Filter Include="Run">
<UniqueIdentifier>{51dc8c41-b398-47e4-b68a-61417da40967}</UniqueIdentifier>
</Filter>
<Filter Include="activegs.exe">
<UniqueIdentifier>{3dfcff28-c626-4032-b6ff-b8dc129d187a}</UniqueIdentifier>
</Filter>
<Filter Include="activegs.exe\Header Files">
<UniqueIdentifier>{3f6df060-e239-4886-b77c-b474461ce911}</UniqueIdentifier>
</Filter>
<Filter Include="libpng">
<UniqueIdentifier>{411622c0-1a8d-4b39-9fee-49dcbb8dd4c6}</UniqueIdentifier>
</Filter>
<Filter Include="win">
<UniqueIdentifier>{a0ee4f56-59a4-46a1-aa53-a3effdb48cbc}</UniqueIdentifier>
</Filter>
<Filter Include="unzip">
<UniqueIdentifier>{e88f5577-5dd9-4f81-adc3-d2e0001f5661}</UniqueIdentifier>
</Filter>
<Filter Include="zlib">
<UniqueIdentifier>{4b8c0a8d-8a74-40fa-aa3c-be5fb3ec4e7e}</UniqueIdentifier>
</Filter>
<Filter Include="Drivers">
<UniqueIdentifier>{b96f449f-29ea-4305-b074-52155c15c111}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Common\activeconfig.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\ActiveDownload.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\ActiveGSList.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\ActiveZip.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\apple2e.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\CA2Text.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\CEmulatorCtrl.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\interface.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\libpng.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\rom.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\3rdpartylib\simplexml.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\ActiveCommon.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\ActiveDownloadWin32.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\ActiveInfo.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\ActiveStatus.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\ChildView.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\DiskEditURL.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\HyperLink.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\SliderZip.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\TabGeneral.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\TabOption.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\TabRuntime.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\TabXml.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\winconsole.cpp">
<Filter>common.win32</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\adb.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\async_event.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\clock.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\compile_time.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\compression.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\config_generic.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\dis.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\driver.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\engine_c.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\GraphCounter.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\iwm.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\marinetti.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\marinetti_helper.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\moremem.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\paddles.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\SaveState.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\scc.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\scc_socket_driver.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\sim65816.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\smartport.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\sound.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\sound_driver.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\video.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="ActiveGSApp.cpp">
<Filter>activegs.exe</Filter>
</ClCompile>
<ClCompile Include="cgfiltyp.cpp">
<Filter>activegs.exe</Filter>
</ClCompile>
<ClCompile Include="MainFrm.cpp">
<Filter>activegs.exe</Filter>
</ClCompile>
<ClCompile Include="..\Common.win32\stdafx.cpp">
<Filter>activegs.exe</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Win\joystick_win.cpp">
<Filter>win</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Win\scc_windriver.cpp">
<Filter>win</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Win\win32snd_driver.cpp">
<Filter>win</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Win\win_activegs.cpp">
<Filter>win</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Win\win_generic.cpp">
<Filter>win</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Win\win_raster.cpp">
<Filter>win</Filter>
</ClCompile>
<ClCompile Include="..\Drivers\activegs_driver.cpp">
<Filter>Drivers</Filter>
</ClCompile>
<ClCompile Include="..\kegs\Src\bigfile.cpp">
<Filter>Src</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngwutil.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\png.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngerror.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pnggccrd.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngget.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngmem.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngpread.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngread.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngrio.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngrtran.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngrutil.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngset.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngtrans.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngvcrd.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngwio.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngwrite.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\libpng\pngwtran.cpp">
<Filter>libpng</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\zlib123\compress.cpp">
<Filter>zlib</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\zlib123\crc32.cpp">
<Filter>zlib</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\zlib123\adler32.cpp">
<Filter>zlib</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\zlib123\deflate.cpp">
<Filter>unzip</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\zlib123\inffast.cpp">
<Filter>zlib</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\zlib123\inflate.cpp">
<Filter>zlib</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\zlib123\inftrees.cpp">
<Filter>zlib</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\unzip101e\ioapi.cpp">
<Filter>unzip</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\unzip101e\iowin32.cpp">
<Filter>unzip</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\zlib123\trees.cpp">
<Filter>zlib</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\zlib123\uncompr.cpp">
<Filter>zlib</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\unzip101e\unzip.cpp">
<Filter>unzip</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\unzip101e\zip.cpp">
<Filter>unzip</Filter>
</ClCompile>
<ClCompile Include="..\Libraries\zlib123\zutil.cpp">
<Filter>zlib</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Common\ActiveDownload.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\Common\ActiveGSList.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\Common\CEMulatorCtrl.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\Common\3rdpartylib\simplexml.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\activecommon.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\activecommonres.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\ActiveInfo.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\ActiveStatus.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\ChildView.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\consoleresrc.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\DiskEditURL.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\HyperLink.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\SliderZip.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\TabGeneral.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\TabOption.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\TabRuntime.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\Common.win32\TabXml.h">
<Filter>common.win32</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\16inst_c.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\8inst_c.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\8inst_s.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\adb.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\async_event.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\clock.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\compression.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\config.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\defc.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\defcomm.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\defs.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\defs_instr.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\disas.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\driver.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\graphcounter.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\iwm.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\iwm_35_525.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\kegsfont.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\kegsversion.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\marinetti.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\moremem.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\op_routs.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\paddles.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\prodos.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\prodos_protos.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\protos.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\protos_engine_c.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\protos_macdriver.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\protos_macsnd_driver.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\protos_windriver.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\protos_xdriver.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\raster.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\SaveState.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\scc.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\sim65816.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\size_c.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\size_tab.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\sound.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\StdString.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\superhires.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Src\video.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="cgfiltyp.h">
<Filter>activegs.exe</Filter>
</ClInclude>
<ClInclude Include="ActiveGSApp.h">
<Filter>activegs.exe\Header Files</Filter>
</ClInclude>
<ClInclude Include="MainFrm.h">
<Filter>activegs.exe\Header Files</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>activegs.exe\Header Files</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>activegs.exe\Header Files</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Win\dirent-win32.h">
<Filter>win</Filter>
</ClInclude>
<ClInclude Include="..\kegs\Win\winresource.h">
<Filter>win</Filter>
</ClInclude>
<ClInclude Include="resource1.h" />
<ClInclude Include="..\kegs\Src\bigfile.h">
<Filter>Src\H</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\libpng\png.h">
<Filter>libpng</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\libpng\pngconf.h">
<Filter>libpng</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\zlib123\crc32.h">
<Filter>zlib</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\unzip101e\crypt.h">
<Filter>unzip</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\zlib123\deflate.h">
<Filter>unzip</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\zlib123\inftrees.h">
<Filter>zlib</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\zlib123\inffast.h">
<Filter>zlib</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\zlib123\inffixed.h">
<Filter>zlib</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\zlib123\inflate.h">
<Filter>zlib</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\unzip101e\iowin32.h">
<Filter>unzip</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\unzip101e\ioapi.h">
<Filter>unzip</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\zlib123\trees.h">
<Filter>zlib</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\unzip101e\unzip.h">
<Filter>unzip</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\zlib123\zconf.h">
<Filter>zlib</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\zlib123\zconf.in.h">
<Filter>zlib</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\unzip101e\zip.h">
<Filter>unzip</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\zlib123\zutil.h">
<Filter>zlib</Filter>
</ClInclude>
<ClInclude Include="..\Libraries\zlib123\zlib.h">
<Filter>zlib</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\Common.win32\ActiveCommon.rc">
<Filter>common.win32</Filter>
</ResourceCompile>
<ResourceCompile Include="..\Common.win32\ActiveGS.rc">
<Filter>common.win32</Filter>
</ResourceCompile>
<ResourceCompile Include="..\Common.win32\console.rc">
<Filter>common.win32</Filter>
</ResourceCompile>
<ResourceCompile Include="ActiveGSApp.rc">
<Filter>activegs.exe\Header Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Xml Include="..\run\activegsappconfig.xml">
<Filter>Run</Filter>
</Xml>
</ItemGroup>
<ItemGroup>
<Image Include="res\ActiveGSApp.ico">
<Filter>activegs.exe\Header Files</Filter>
</Image>
<Image Include="..\Common32\bitmap2.bmp" />
<Image Include="..\Common.win32\bitmap2.bmp" />
<Image Include="..\Common.win32\bmp00001.bmp" />
<Image Include="..\Common32\disk52.bmp" />
<Image Include="..\Common.win32\disk52.bmp" />
<Image Include="..\Common32\disk54.bmp" />
<Image Include="..\Common.win32\disk54.bmp" />
<Image Include="..\Common.win32\disk55.bmp" />
<Image Include="..\Common32\disk55.bmp" />
<Image Include="res\idr_22mg.ico" />
<Image Include="res\idr_2mg1.ico" />
<Image Include="res\idr_main.ico" />
<Image Include="res\Toolbar.bmp" />
</ItemGroup>
<ItemGroup>
<Manifest Include="res\ActiveGSApp.manifest" />
</ItemGroup>
<ItemGroup>
<None Include="..\Common.win32\cursor1.cur" />
</ItemGroup>
<ItemGroup>
<Media Include="..\Common\sounds\Spin Up Search 1.wav" />
<Media Include="..\Common\sounds\Spin Up Search 2.wav" />
</ItemGroup>
</Project>

Binary file not shown.

View File

@ -0,0 +1,80 @@
// ActiveGSApp.cpp : Définit les comportements de classe pour l'application.
//
#include "../Common.win32/stdafx.h"
#include "ActiveGSApp.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CActiveGSAppAp
BEGIN_MESSAGE_MAP(CActiveGSAppApp, CWinApp)
// ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
END_MESSAGE_MAP()
// construction CActiveGSAppApp
CActiveGSAppApp::CActiveGSAppApp()
{
// TODO : ajoutez ici du code de construction,
// Placez toutes les initialisations significatives dans InitInstance
}
// Seul et unique objet CActiveGSAppApp
CActiveGSAppApp theApp;
// initialisation CActiveGSAppApp
BOOL CActiveGSAppApp::InitInstance()
{
// InitCommonControls() est requis sur Windows XP si le manifeste de l'application
// spécifie l'utilisation de ComCtl32.dll version 6 ou ultérieure pour activer
// les styles visuels. Dans le cas contraire, la création de fenêtres échouera.
InitCommonControls();
CWinApp::InitInstance();
// Initialiser les bibliothèques OLE
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// Initialisation standard
// Si vous n'utilisez pas ces fonctionnalités et que vous souhaitez réduire la taille
// de votre exécutable final, vous devez supprimer ci-dessous
// les routines d'initialisation spécifiques dont vous n'avez pas besoin.
// Changez la clé de Registre sous laquelle nos paramètres sont enregistrés.
// TODO : Modifiez cette chaîne avec des informations appropriées,
// telles que le nom de votre société ou organisation
SetRegistryKey(_T("Applications locales générées par AppWizard"));
// Pour créer la fenêtre principale, ce code crée un nouvel objet fenêtre frame
// qu'il définit ensuite en tant qu'objet fenêtre principale de l'application
int argc = __argc;
char** argv = __argv;
CMainFrame* pFrame = new CMainFrame(argc,argv);
if (!pFrame)
return FALSE;
m_pMainWnd = pFrame;
// MEts à jour le nom de la fenetre
// La seule fenêtre a été initialisée et peut donc être affichée et mise à jour
pFrame->ShowWindow(SW_SHOW);
pFrame->UpdateWindow();
// appelle DragAcceptFiles uniquement s'il y a un suffixe
// Dans une application SDI, cet appel doit avoir lieu juste après ProcessShellCommand
return TRUE;
}

View File

@ -0,0 +1,32 @@
// ActiveGSApp.h : fichier d'en-tête principal pour l'application ActiveGSApp
//
#pragma once
#ifndef __AFXWIN_H__
#error inclut 'stdafx.h' avant d'inclure ce fichier pour PCH
#endif
#include "resource.h" // symboles principaux
// CActiveGSAppApp :
// Consultez ActiveGSApp.cpp pour l'implémentation de cette classe
//
class CActiveGSAppApp : public CWinApp
{
public:
CActiveGSAppApp();
// Substitutions
public:
virtual BOOL InitInstance();
// Implémentation
public:
// afx_msg void OnAppAbout();
DECLARE_MESSAGE_MAP()
};
extern CActiveGSAppApp theApp;

323
ActiveGS.exe/ActiveGSApp.rc Normal file
View File

@ -0,0 +1,323 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)\r\n"
"LANGUAGE 12, 1\r\n"
"#pragma code_page(1252)\r\n"
"#include ""res\\ActiveGSApp.rc2"" // ressources non modifiées par Microsoft Visual C++ \r\n"
"#include ""afxres.rc"" // Composants standard\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON "res\\ActiveGSApp.ico"
IDR_2DSK ICON "res\\idr_2mg1.ico"
IDR_32MG ICON "res\\idr_22mg.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDR_MAINFRAME BITMAP "res\\Toolbar.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_MAINFRAME TOOLBAR 16, 15
BEGIN
BUTTON ID_EDIT_CUT
BUTTON ID_EDIT_COPY
BUTTON ID_EDIT_PASTE
SEPARATOR
BUTTON ID_APP_ABOUT
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MAINFRAME MENU
BEGIN
POPUP "&Fichier"
BEGIN
MENUITEM "&quitter", ID_APP_EXIT
END
POPUP "&Edition"
BEGIN
MENUITEM "&Annuler\tCtrl+Z", ID_EDIT_UNDO
MENUITEM SEPARATOR
MENUITEM "&Couper\tCtrl+X", ID_EDIT_CUT
MENUITEM "C&opier\tCtrl+C", ID_EDIT_COPY
MENUITEM "Co&ller\tCtrl+V", ID_EDIT_PASTE
END
POPUP "&Affichage"
BEGIN
MENUITEM "&barre d'outils", ID_VIEW_TOOLBAR
MENUITEM "&barre d'état", ID_VIEW_STATUS_BAR
END
POPUP "&Aide"
BEGIN
MENUITEM "&À propos de ActiveGSApp...", ID_APP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_MAINFRAME ACCELERATORS
BEGIN
"C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT
VK_F6, ID_NEXT_PANE, VIRTKEY, NOINVERT
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT, NOINVERT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
"X", ID_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "À propos de ActiveGSApp"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "ActiveGSApp Version 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX
LTEXT "Copyright (C) 2003",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,50,16,WS_GROUP
END
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,7,1199,0
PRODUCTVERSION 3,7,1199,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040c04e4"
BEGIN
VALUE "CompanyName", "Second Sight Software"
VALUE "FileDescription", "ActiveGS StandAlone Application"
VALUE "FileVersion", "3.7.1199"
VALUE "InternalName", "ActiveGS.exe"
VALUE "LegalCopyright", "(c) Second Sight Software 2009-2011"
VALUE "OriginalFilename", "ActiveGSApp.exe"
VALUE "ProductName", "ActiveGS Standalone Application"
VALUE "ProductVersion", "3.7.1199"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x40c, 1252
END
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDR_MAINFRAME "ActiveGSApp"
END
STRINGTABLE
BEGIN
AFX_IDS_APP_TITLE "ActiveGSApp"
AFX_IDS_IDLEMESSAGE "Prêt"
END
STRINGTABLE
BEGIN
ID_INDICATOR_EXT "EXT"
ID_INDICATOR_CAPS "MAJ"
ID_INDICATOR_NUM "NUM"
ID_INDICATOR_SCRL "DÉFIL"
ID_INDICATOR_OVR "RFP"
ID_INDICATOR_REC "ENR"
END
STRINGTABLE
BEGIN
ID_APP_ABOUT "Affiche des informations concernant le programme, le numéro de version et le copyright\nÀ propos de"
ID_APP_EXIT "Quitte l'application et invite à enregistrer les documents\nQuitter"
END
STRINGTABLE
BEGIN
ID_NEXT_PANE "Bascule vers le volet de fenêtre suivant\nVolet suivant"
ID_PREV_PANE "Bascule vers le volet de fenêtre précédent\nVolet précédent"
END
STRINGTABLE
BEGIN
ID_WINDOW_SPLIT "Fractionne la fenêtre active en volets\nFractionner"
END
STRINGTABLE
BEGIN
ID_EDIT_CLEAR "Efface la sélection\nEffacer"
ID_EDIT_CLEAR_ALL "Efface tout\nEffacer tout"
ID_EDIT_COPY "Copie la sélection et la place dans le Presse-papiers\nCopier"
ID_EDIT_CUT "Coupe la sélection et la place dans le Presse-papiers\nCouper"
ID_EDIT_FIND "Recherche le texte spécifié\nRechercher"
ID_EDIT_PASTE "Insère le contenu du presse-papiers\nColler"
ID_EDIT_REPEAT "Répète la dernière action\nRépéter"
ID_EDIT_REPLACE "Remplace un texte spécifié par un texte différent\nRemplacer"
ID_EDIT_SELECT_ALL "Sélectionne la totalité du document\nSélectionner tout"
ID_EDIT_UNDO "Annule la dernière action\nAnnuler"
ID_EDIT_REDO "Rétablit l'action précédemment annulée\nRétablir"
END
STRINGTABLE
BEGIN
ID_VIEW_TOOLBAR "Affiche ou masque la barre d'outils\nActiver/Désactiver Barre d'outils"
ID_VIEW_STATUS_BAR "Affiche ou masque la barre d'état\nActiver/Désactiver Barre d'état"
END
STRINGTABLE
BEGIN
AFX_IDS_SCSIZE "Modifie la taille de la fenêtre"
AFX_IDS_SCMOVE "Modifie la position de la fenêtre"
AFX_IDS_SCMINIMIZE "Affiche la fenêtre sous forme d'icône"
AFX_IDS_SCMAXIMIZE "Affiche la fenêtre en plein écran"
AFX_IDS_SCNEXTWINDOW "Bascule vers la fenêtre de document suivante"
AFX_IDS_SCPREVWINDOW "Bascule vers la fenêtre de document précédente"
AFX_IDS_SCCLOSE "Ferme la fenêtre active et propose l'enregistrement des documents"
END
STRINGTABLE
BEGIN
AFX_IDS_SCRESTORE "Restaure la fenêtre à sa taille normale"
AFX_IDS_SCTASKLIST "Active la liste des tâches"
END
#endif // French (France) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
LANGUAGE 12, 1
#pragma code_page(1252)
#include "res\ActiveGSApp.rc2" // ressources non modifiées par Microsoft Visual C++
#include "afxres.rc" // Composants standard
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -0,0 +1,323 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)\r\n"
"LANGUAGE 12, 1\r\n"
"#pragma code_page(1252)\r\n"
"#include ""res\\ActiveGSApp.rc2"" // ressources non modifiées par Microsoft Visual C++ \r\n"
"#include ""afxres.rc"" // Composants standard\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON "res\\ActiveGSApp.ico"
IDR_2DSK ICON "res\\idr_2mg1.ico"
IDR_32MG ICON "res\\idr_22mg.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDR_MAINFRAME BITMAP "res\\Toolbar.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_MAINFRAME TOOLBAR 16, 15
BEGIN
BUTTON ID_EDIT_CUT
BUTTON ID_EDIT_COPY
BUTTON ID_EDIT_PASTE
SEPARATOR
BUTTON ID_APP_ABOUT
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MAINFRAME MENU
BEGIN
POPUP "&Fichier"
BEGIN
MENUITEM "&quitter", ID_APP_EXIT
END
POPUP "&Edition"
BEGIN
MENUITEM "&Annuler\tCtrl+Z", ID_EDIT_UNDO
MENUITEM SEPARATOR
MENUITEM "&Couper\tCtrl+X", ID_EDIT_CUT
MENUITEM "C&opier\tCtrl+C", ID_EDIT_COPY
MENUITEM "Co&ller\tCtrl+V", ID_EDIT_PASTE
END
POPUP "&Affichage"
BEGIN
MENUITEM "&barre d'outils", ID_VIEW_TOOLBAR
MENUITEM "&barre d'état", ID_VIEW_STATUS_BAR
END
POPUP "&Aide"
BEGIN
MENUITEM "&À propos de ActiveGSApp...", ID_APP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_MAINFRAME ACCELERATORS
BEGIN
"C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT
VK_F6, ID_NEXT_PANE, VIRTKEY, NOINVERT
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT, NOINVERT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
"X", ID_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "À propos de ActiveGSApp"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "ActiveGSApp Version 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX
LTEXT "Copyright (C) 2003",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,50,16,WS_GROUP
END
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION $MAJORVER$,$MINORVER$,$WCREV$,0
PRODUCTVERSION $MAJORVER$,$MINORVER$,$WCREV$,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040c04e4"
BEGIN
VALUE "CompanyName", "Second Sight Software"
VALUE "FileDescription", "ActiveGS StandAlone Application"
VALUE "FileVersion", "$MAJORVER$.$MINORVER$.$WCREV$"
VALUE "InternalName", "ActiveGS.exe"
VALUE "LegalCopyright", "(c) Second Sight Software 2009-2011"
VALUE "OriginalFilename", "ActiveGSApp.exe"
VALUE "ProductName", "ActiveGS Standalone Application"
VALUE "ProductVersion", "$MAJORVER$.$MINORVER$.$WCREV$"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x40c, 1252
END
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDR_MAINFRAME "ActiveGSApp"
END
STRINGTABLE
BEGIN
AFX_IDS_APP_TITLE "ActiveGSApp"
AFX_IDS_IDLEMESSAGE "Prêt"
END
STRINGTABLE
BEGIN
ID_INDICATOR_EXT "EXT"
ID_INDICATOR_CAPS "MAJ"
ID_INDICATOR_NUM "NUM"
ID_INDICATOR_SCRL "DÉFIL"
ID_INDICATOR_OVR "RFP"
ID_INDICATOR_REC "ENR"
END
STRINGTABLE
BEGIN
ID_APP_ABOUT "Affiche des informations concernant le programme, le numéro de version et le copyright\nÀ propos de"
ID_APP_EXIT "Quitte l'application et invite à enregistrer les documents\nQuitter"
END
STRINGTABLE
BEGIN
ID_NEXT_PANE "Bascule vers le volet de fenêtre suivant\nVolet suivant"
ID_PREV_PANE "Bascule vers le volet de fenêtre précédent\nVolet précédent"
END
STRINGTABLE
BEGIN
ID_WINDOW_SPLIT "Fractionne la fenêtre active en volets\nFractionner"
END
STRINGTABLE
BEGIN
ID_EDIT_CLEAR "Efface la sélection\nEffacer"
ID_EDIT_CLEAR_ALL "Efface tout\nEffacer tout"
ID_EDIT_COPY "Copie la sélection et la place dans le Presse-papiers\nCopier"
ID_EDIT_CUT "Coupe la sélection et la place dans le Presse-papiers\nCouper"
ID_EDIT_FIND "Recherche le texte spécifié\nRechercher"
ID_EDIT_PASTE "Insère le contenu du presse-papiers\nColler"
ID_EDIT_REPEAT "Répète la dernière action\nRépéter"
ID_EDIT_REPLACE "Remplace un texte spécifié par un texte différent\nRemplacer"
ID_EDIT_SELECT_ALL "Sélectionne la totalité du document\nSélectionner tout"
ID_EDIT_UNDO "Annule la dernière action\nAnnuler"
ID_EDIT_REDO "Rétablit l'action précédemment annulée\nRétablir"
END
STRINGTABLE
BEGIN
ID_VIEW_TOOLBAR "Affiche ou masque la barre d'outils\nActiver/Désactiver Barre d'outils"
ID_VIEW_STATUS_BAR "Affiche ou masque la barre d'état\nActiver/Désactiver Barre d'état"
END
STRINGTABLE
BEGIN
AFX_IDS_SCSIZE "Modifie la taille de la fenêtre"
AFX_IDS_SCMOVE "Modifie la position de la fenêtre"
AFX_IDS_SCMINIMIZE "Affiche la fenêtre sous forme d'icône"
AFX_IDS_SCMAXIMIZE "Affiche la fenêtre en plein écran"
AFX_IDS_SCNEXTWINDOW "Bascule vers la fenêtre de document suivante"
AFX_IDS_SCPREVWINDOW "Bascule vers la fenêtre de document précédente"
AFX_IDS_SCCLOSE "Ferme la fenêtre active et propose l'enregistrement des documents"
END
STRINGTABLE
BEGIN
AFX_IDS_SCRESTORE "Restaure la fenêtre à sa taille normale"
AFX_IDS_SCTASKLIST "Active la liste des tâches"
END
#endif // French (France) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
LANGUAGE 12, 1
#pragma code_page(1252)
#include "res\ActiveGSApp.rc2" // ressources non modifiées par Microsoft Visual C++
#include "afxres.rc" // Composants standard
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

281
ActiveGS.exe/MainFrm.cpp Normal file
View File

@ -0,0 +1,281 @@
// MainFrm.cpp : implémentation de la classe CMainFrame
//
#include "../Common.win32/stdafx.h"
#include "ActiveGSApp.h"
#include "../common.win32/activecommon.h"
#include "../common/CEmulatorCtrl.h"
#include "mainfrm.h"
#include "../common/ki.h"
#include "../common/svnversion.h"
#include "../kegs/src/defcomm.h"
#include "../kegs/src/savestate.h"
#include "../kegs/src/driver.h"
#include "cgfiltyp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CMainFrame
IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_CREATE()
ON_WM_SETFOCUS()
ON_WM_DESTROY()
ON_WM_SIZING()
END_MESSAGE_MAP()
void associateActiceGSConfig(const char* _ext, const char* _desc, int _icon)
{
CGCFileTypeAccess TheFTA;
// get full file path to program executable file
TCHAR szProgPath[MAX_PATH * 2];
::GetModuleFileName(NULL, szProgPath, sizeof(szProgPath)/sizeof(TCHAR));
CString csTempText;
TheFTA.SetExtension(_ext);
// just pass file path in quotes on command line
csTempText = szProgPath;
csTempText += " \"%1\"";
TheFTA.SetShellOpenCommand(csTempText);
TheFTA.SetDocumentShellOpenCommand(csTempText);
CString classname("ActiveGS.");
classname += _ext;
TheFTA.SetDocumentClassName(classname);
TheFTA.SetDocumentDescription(_desc);
// use first icon in program
csTempText = szProgPath;
csTempText += ",";
csTempText += (char)(_icon+'0');
TheFTA.SetDocumentDefaultIcon(csTempText);
// set the necessary registry entries
TheFTA.RegSetAllInfo();
}
CMainFrame::CMainFrame(int _argc, char** _argv)
{
outputInfo("CMainFrame() (inst:%0X)\n",this);
// Répertoire par default = pour une appli, le répertoire courant
char windir[1024];
GetCurrentDirectory(1024,windir);
#ifndef ACTIVEGSKARATEKA
associateActiceGSConfig("activegsxml","ActiveGS Configuration file",0);
associateActiceGSConfig("nib","Apple II 5.25 Disk Image",1);
associateActiceGSConfig("dsk","Apple II 5.25 Disk Image",1);
associateActiceGSConfig("2mg","Apple II 3.5 Image",2);
associateActiceGSConfig("po","Apple II 3.5 Disk Image",2);
associateActiceGSConfig("do","Apple II 5.25 Disk Image",1);
#endif
void (*driver)() = NULL;
#ifdef VIRTUALAPPLE
extern void jniSetup(const char*);
jniSetup(NULL);
#else
#ifdef ACTIVEGSKARATEKA
extern void karateka_driver();
driver = karateka_driver;
#else
extern void activegs_driver();
driver = activegs_driver;
#endif
g_driver.init( driver );
#endif
CDownload::initPersistentPath();
option.initOptions();
m_wndView.config.setBaseURL(windir);
#ifdef VIRTUALAPPLE
m_wndView.config.xmlconfig =g_driver.activegsxml;
#else
#ifdef ACTIVEGSPOP
m_wndView.config.xmlconfig ="http://asset/pop.activegsxml";
#elif ACTIVEGSKARATEKA
m_wndView.config.xmlconfig ="http://asset/karateka.activegsxml";
#else
m_wndView.config.xmlconfig ="default.activegsxml";
m_wndView.config.processCommandLine(_argc,_argv);
#endif
#endif
RECT r;
r.left = 100;
r.top = 100;
r.right = r.left+X_A2_WINDOW_WIDTH;
#ifdef VIDEO_SINGLEHLINE
float w = X_A2_WINDOW_WIDTH*2;
#else
float w = X_A2_WINDOW_WIDTH;
#endif
r.right = r.left + w * 2;
#ifdef VIDEO_SINGLEVLINE
float h = X_A2_WINDOW_HEIGHT*2;
#else
float h = X_A2_WINDOW_HEIGHT;
#endif
r.bottom = r.top + h * 2;
const char* ver = ACTIVEGSVERSIONSTR;
Create(NULL, ver, WS_THICKFRAME | WS_SYSMENU,r, NULL,NULL, 0, NULL );
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
outputInfo("OnCreate (inst:%0X)\n",lpCreateStruct->hInstance);
m_wndView.CreateEmulatorWindow(this);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
// diagnostics pour CMainFrame
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
// gestionnaires de messages pour CMainFrame
void CMainFrame::OnSetFocus(CWnd* /*pOldWnd*/)
{
// passe le focus à la fenêtre d'affichage
m_wndView.SetFocus();
}
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
/*
// laisser la priorité à la vue pour cette commande
if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
*/
// sinon, la gestion par défaut est utilisée
return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
void CMainFrame::OnDestroy()
{
outputInfo("OnDestroy() (inst:%0X)\n",this);
CFrameWnd::OnDestroy();
}
extern void window_needs_full_refresh();
LRESULT CMainFrame::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if (message==WM_SIZE)
{
m_wndView.resize();
return 1;
}
else
if (message==WM_ERASEBKGND)
{
// prevent mainframe to refresh its background
return 1;
}
else
return CFrameWnd::DefWindowProc(message, wParam, lParam);
}
void CMainFrame::OnSizing(UINT nSide,LPRECT lpRect)
{
RECT rcClient, rcWindow;
GetClientRect( &rcClient);
GetWindowRect( &rcWindow);
int borderw = (rcWindow.right - rcClient.right) + (rcClient.left - rcWindow.left );
int borderh = (rcWindow.bottom - rcClient.bottom) + (rcClient.top - rcWindow.top );
// détermine le sens du resize (en x ou en y)
int deltax = (rcWindow.right-lpRect->right) + (rcWindow.left-lpRect->left);
if (deltax<0) deltax = -deltax;
int deltay = (rcWindow.bottom-lpRect->bottom) + (rcWindow.top-lpRect->top);
if (deltay<0) deltay = -deltay;
#ifdef VIDEO_SINGLEVLINE
int bottom = X_A2_WINDOW_HEIGHT*2;
#else
int bottom = X_A2_WINDOW_HEIGHT;
#endif
#ifdef VIDEO_SINGLEHLINE
int right = X_A2_WINDOW_WIDTH*2;
#else
int right = X_A2_WINDOW_WIDTH;
#endif
const float ratio = (float)right/(float)bottom;
int w = (lpRect->right - lpRect->left) - borderw ;
int h = (lpRect->bottom - lpRect->top) - borderh ;
if (deltax || deltay)
{
if (nSide !=6)
lpRect->bottom = lpRect->top + (int)(w/ratio) + borderh;
else
lpRect->right = lpRect->left + (int)(h*ratio) + borderw;
}
return CFrameWnd::OnSizing(nSide,lpRect);
}

54
ActiveGS.exe/MainFrm.h Normal file
View File

@ -0,0 +1,54 @@
// MainFrm.h : interface de la classe CMainFrame
//
#pragma once
#include "../Common.win32/ChildView.h"
//#include "../common32/activecommon.h"
class CMainFrame : public CFrameWnd
{
public:
CMainFrame(int _argc, char ** _argv);
protected:
DECLARE_DYNAMIC(CMainFrame)
// Attributs
public:
CChildView m_wndView;
// Opérations
public:
// Substitutions
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
// Implémentation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // membres incorporés de la barre de contrôle
/*
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
*/
// Fonctions générées de la table des messages
protected:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSetFocus(CWnd *pOldWnd);
DECLARE_MESSAGE_MAP()
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
afx_msg void OnSizing(UINT nSide,LPRECT lpRect);
public:
afx_msg void OnDestroy();
};

24
ActiveGS.exe/Resource.h Normal file
View File

@ -0,0 +1,24 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ActiveGSApp.rc
//
#define IDD_ABOUTBOX 100
#define IDP_OLE_INIT_FAILED 100
#define IDR_HTML_TABDISKURL 103
#define IDR_MAINFRAME 128
#define IDR_ActiveGSAppTYPE 129
#define IDR_1APP 129
#define IDR_3DSK 130
#define IDR_2DSK 130
#define IDR_32MG 131
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 130
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 104
#endif
#endif

328
ActiveGS.exe/cgfiltyp.cpp Normal file
View File

@ -0,0 +1,328 @@
//- -----------------------------------------------------------------
//- (C) Copyright 2000 Blake V. Miller
//- All Rights Reserved.
//- -----------------------------------------------------------------
//- File : CGFILTYP.CPP
//- Author : Blake Miller
//- Version : June 16, 2000
//- Purpose : File Type Access
//- -----------------------------------------------------------------
#include "../Common.win32/stdafx.h"
#include "winerror.h"
#ifndef __CGFILTYP_H__
#include "CGFILTYP.H" // CGCFileTypeAccess
#endif
#undef THIS_FILE
static char THIS_FILE[] = "CGFILTYP.CPP";
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
IMPLEMENT_DYNAMIC(CGCFileTypeAccess, CObject)
CGCFileTypeAccess::CGCFileTypeAccess()
{
}
// virtual
CGCFileTypeAccess::~CGCFileTypeAccess()
{
}
//- *****************************************************************
//- Functions Affecting Registry
//- *****************************************************************
// virtual
BOOL CGCFileTypeAccess::RegSetAllInfo(void)
{
RegSetExtension();
RegSetDocumentType();
RegSetCLSID();
RegSetShellInfo();
return TRUE;
}
// HKEY_CLASSES_ROOT\.<Extension>
// virtual
BOOL CGCFileTypeAccess::RegSetExtension(void)
{
if( m_csExtension.IsEmpty() ){
return TRUE;
}
CString csKey = "." + m_csExtension;
SetRegistryValue(HKEY_CLASSES_ROOT, csKey, "", m_csDocumentClassName);
if( !m_csShellOpenCommand.IsEmpty() ){
csKey += "\\shell\\open\\command";
SetRegistryValue(HKEY_CLASSES_ROOT, csKey, "", m_csShellOpenCommand);
}
return TRUE;
}
// HKEY_CLASSES_ROOT\.<Document Type>
// virtual
BOOL CGCFileTypeAccess::RegSetDocumentType(void)
{
if( m_csDocumentClassName.IsEmpty()){
return TRUE;
}
CString csKey = m_csDocumentClassName;
SetRegistryValue(HKEY_CLASSES_ROOT, csKey, "", m_csDocumentDescription);
// DefaultIcon
if( !m_csDocumentDefaultIcon.IsEmpty() ){
csKey = m_csDocumentClassName;
csKey += "\\DefaultIcon";
SetRegistryValue(HKEY_CLASSES_ROOT, csKey, "", m_csDocumentDefaultIcon);
}
// shell\open\command
if( !m_csShellOpenCommand.IsEmpty() ){
csKey = m_csDocumentClassName;
csKey += "\\shell\\open\\command";
SetRegistryValue(HKEY_CLASSES_ROOT, csKey, "", m_csShellOpenCommand);
}
return TRUE;
}
// HKEY_CLASSES_ROOT\CLSID\<GUID>
// virtual
BOOL CGCFileTypeAccess::RegSetCLSID(void)
{
return TRUE;
}
//
// virtual
BOOL CGCFileTypeAccess::RegSetShellInfo(void)
{
return TRUE;
}
//- *****************************************************************
//- Member Variable Get/Set Methods
//- *****************************************************************
void CGCFileTypeAccess::SetExtension(
LPCTSTR szExtension
){
m_csExtension = szExtension;
}
void CGCFileTypeAccess::GetExtension(
CString& csExtension
) const {
csExtension = m_csExtension;
}
void CGCFileTypeAccess::SetContentType(
LPCTSTR szContentType
){
m_csContentType = szContentType;
}
void CGCFileTypeAccess::GetContentType(
CString& csContentType
) const {
csContentType = m_csContentType;
}
void CGCFileTypeAccess::SetShellOpenCommand(
LPCTSTR szShellOpenCommand
){
m_csShellOpenCommand = szShellOpenCommand;
}
void CGCFileTypeAccess::GetShellOpenCommand(
CString& csShellOpenCommand
) const {
csShellOpenCommand = m_csShellOpenCommand;
}
void CGCFileTypeAccess::SetShellNewCommand(
LPCTSTR szShellNewCommand
){
m_csShellNewCommand = szShellNewCommand;
}
void CGCFileTypeAccess::GetShellNewCommand(
CString& csShellNewCommand
) const {
csShellNewCommand = m_csShellNewCommand;
}
void CGCFileTypeAccess::SetShellNewFileName(
LPCTSTR szShellNewFileName
){
m_csShellNewFileName = szShellNewFileName;
}
void CGCFileTypeAccess::GetShellNewFileName(
CString& csShellNewFileName
) const {
csShellNewFileName = m_csShellNewFileName;
}
void CGCFileTypeAccess::SetDocumentClassName(
LPCTSTR szDocumentClassName
){
m_csDocumentClassName = szDocumentClassName;
}
void CGCFileTypeAccess::GetDocumentClassName(
CString& csDocumentClassName
) const {
csDocumentClassName = m_csDocumentClassName;
}
void CGCFileTypeAccess::SetDocumentDescription(
LPCTSTR szDocumentDescription
){
m_csDocumentDescription = szDocumentDescription;
}
void CGCFileTypeAccess::GetDocumentDescription(
CString& csDocumentDescription
) const {
csDocumentDescription = m_csDocumentDescription;
}
void CGCFileTypeAccess::SetDocumentCLSID(
LPCTSTR szDocumentCLSID
){
m_csDocumentCLSID = szDocumentCLSID;
}
void CGCFileTypeAccess::GetDocumentCLSID(
CString& csDocumentCLSID
) const {
csDocumentCLSID = m_csDocumentCLSID;
}
void CGCFileTypeAccess::SetDocumentCurrentVersion(
LPCTSTR szDocumentCurrentVersion
){
m_csDocumentCurrentVersion = szDocumentCurrentVersion;
}
void CGCFileTypeAccess::GetDocumentCurrentVersion(
CString& csDocumentCurrentVersion
) const {
csDocumentCurrentVersion = m_csDocumentCurrentVersion;
}
void CGCFileTypeAccess::SetDocumentDefaultIcon(
LPCTSTR szDocumentDefaultIcon
){
m_csDocumentDefaultIcon = szDocumentDefaultIcon;
}
void CGCFileTypeAccess::GetDocumentDefaultIcon(
CString& csDocumentDefaultIcon
) const {
csDocumentDefaultIcon = m_csDocumentDefaultIcon;
}
void CGCFileTypeAccess::SetDocumentShellOpenCommand(
LPCTSTR szDocumentShellOpenCommand
){
m_csDocumentShellOpenCommand = szDocumentShellOpenCommand;
}
void CGCFileTypeAccess::GetDocumentShellOpenCommand(
CString& csDocumentShellOpenCommand
) const {
csDocumentShellOpenCommand = m_csDocumentShellOpenCommand;
}
// virtual
void CGCFileTypeAccess::ClearAllData(void)
{
m_csExtension.Empty();
m_csContentType.Empty();
m_csShellOpenCommand.Empty();
m_csShellNewCommand.Empty();
m_csShellNewFileName.Empty();
m_csDocumentClassName.Empty();
m_csDocumentDescription.Empty();
m_csDocumentCLSID.Empty();
m_csDocumentCurrentVersion.Empty();
m_csDocumentDefaultIcon.Empty();
m_csDocumentShellOpenCommand.Empty();
}
//- -----------------------------------------------------------------
//- set string value into registry
BOOL CGCFileTypeAccess::SetRegistryValue(
HKEY hOpenKey,
LPCTSTR szKey,
LPCTSTR szValue,
LPCTSTR szData
){
// OG HACK
// Write to the Current User instead of Class Root : bypass UAC !!!
hOpenKey = HKEY_CURRENT_USER ;
CString newKey;
newKey.Format("Software\\Classes\\%s",szKey);
szKey = (const char*)newKey;
// validate input
if( !hOpenKey || !szKey || !szKey[0] ||
!szValue || !szData ){
::SetLastError(E_INVALIDARG);
return FALSE;
}
BOOL bRetVal = FALSE;
DWORD dwDisposition;
DWORD dwReserved = 0;
HKEY hTempKey = (HKEY)0;
// length specifier is in bytes, and some TCHAR
// are more than 1 byte each
DWORD dwBufferLength = lstrlen(szData) * sizeof(TCHAR);
// Open key of interest
// Assume all access is okay and that all keys will be stored to file
// Utilize the default security attributes
// OG Track error
LONG err = ::RegCreateKeyEx(hOpenKey, szKey, dwReserved,
(LPTSTR)0, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, 0,
&hTempKey, &dwDisposition);
if( ERROR_SUCCESS ==err )
{
// dwBufferLength must include size of terminating nul
// character when using REG_SZ with RegSetValueEx function
dwBufferLength += sizeof(TCHAR);
err = ::RegSetValueEx(hTempKey, (LPTSTR)szValue,
dwReserved, REG_SZ, (LPBYTE)szData, dwBufferLength) ;
if( ERROR_SUCCESS == err )
bRetVal = TRUE;
}
if (err != ERROR_SUCCESS)
{
char errstr[1024];
sprintf(errstr,"RegSetValueEx: %Xn",err);
OutputDebugString(errstr);
}
// close opened key
if( hTempKey ){
::RegCloseKey(hTempKey);
}
return bRetVal;
}
//- -----------------------------------------------------------------
//- END CGFILTYP.CPP Source File
//- -----------------------------------------------------------------

100
ActiveGS.exe/cgfiltyp.h Normal file
View File

@ -0,0 +1,100 @@
//- -----------------------------------------------------------------
//- (C) Copyright 2000 Blake V. Miller
//- All Rights Reserved.
//- -----------------------------------------------------------------
//- File : CGFILTYP.H
//- Author : Blake Miller
//- Version : June 16, 2000
//- Purpose : File Type Access
//- -----------------------------------------------------------------
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef __CGFILTYP_H__
#define __CGFILTYP_H__
#ifdef __cplusplus
class CGCFileTypeAccess : public CObject
{
DECLARE_DYNAMIC(CGCFileTypeAccess)
public:
CGCFileTypeAccess();
virtual ~CGCFileTypeAccess();
virtual void ClearAllData(void);
//- ----------------------------------------
//- Effect Registry
virtual BOOL RegSetAllInfo (void);
virtual BOOL RegSetExtension (void);
virtual BOOL RegSetDocumentType (void);
virtual BOOL RegSetCLSID (void);
virtual BOOL RegSetShellInfo (void);
//- ----------------------------------------
//- Modify Member Variables
void SetExtension (LPCTSTR);
void GetExtension (CString&) const;
void SetContentType (LPCTSTR);
void GetContentType (CString&) const;
void SetShellOpenCommand (LPCTSTR);
void GetShellOpenCommand (CString&) const;
void SetShellNewCommand (LPCTSTR);
void GetShellNewCommand (CString&) const;
void SetShellNewFileName (LPCTSTR);
void GetShellNewFileName (CString&) const;
void SetDocumentClassName (LPCTSTR);
void GetDocumentClassName (CString&) const;
void SetDocumentDescription (LPCTSTR);
void GetDocumentDescription (CString&) const;
void SetDocumentCLSID (LPCTSTR);
void GetDocumentCLSID (CString&) const;
void SetDocumentCurrentVersion (LPCTSTR);
void GetDocumentCurrentVersion (CString&) const;
void SetDocumentDefaultIcon (LPCTSTR);
void GetDocumentDefaultIcon (CString&) const;
void SetDocumentShellOpenCommand (LPCTSTR);
void GetDocumentShellOpenCommand (CString&) const;
protected:
BOOL SetRegistryValue(HKEY, LPCTSTR, LPCTSTR, LPCTSTR);
CString m_csExtension;
CString m_csContentType;
CString m_csShellOpenCommand;
CString m_csShellNewCommand;
CString m_csShellNewFileName;
CString m_csDocumentClassName;
CString m_csDocumentDescription;
CString m_csDocumentCLSID;
CString m_csDocumentCurrentVersion;
CString m_csDocumentDefaultIcon;
CString m_csDocumentShellOpenCommand;
};
#endif // __cplusplus
#endif // __CGFILTYP_H__
//- -----------------------------------------------------------------
//- END CGFILTYP.H Header File
//- -----------------------------------------------------------------

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="*"
name="Microsoft.Windows.ActiveGSApp"
type="win32"
/>
<description>Tapez ici une description de votre application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

View File

@ -0,0 +1,13 @@
//
// ActiveGSApp.RC2 - ressources que Microsoft Visual C++ ne modifie pas directement
//
#ifdef APSTUDIO_INVOKED
#error "ce fichier n'est pas modifiable par Microsoft Visual C++"
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Ajouter ici les ressources modifiées manuellement...
/////////////////////////////////////////////////////////////////////////////

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

View File

@ -0,0 +1,664 @@
#include "../common.win32/stdafx.h"
#include <Psapi.h>
#include <mmsystem.h>
#include "activecommon.h"
#include "../kegs/src/sim65816.h"
#include "../kegs/src/driver.h"
#include "../kegs/src/adb.h"
#include "../common.win32/activegs.rc.h"
extern const char* currentBuild;
void x_display_alert(int _abord, const char* _title, const char* _msg)
{
CString strsys(_msg);
CString titlesys(_title);
MessageBox(NULL,strsys,titlesys,MB_OK);
}
CEmulatorWin32::CEmulatorWin32(CEmulator** _parent) : CEmulator(_parent)
{
m_hWnd = NULL;
hThread = NULL;
#ifndef UNDER_CE
hAlphaCursor = NULL;
activeInfo = NULL;
wStatus=NULL;
wLoading=NULL;
theConsole=NULL;
hhkLowLevelKybd=NULL;
#endif
}
extern void my_exit(int);
CEmulatorWin32::~CEmulatorWin32()
{
outputInfo("~CEmulatorWin32 (%X)\n",this);
destroy();
#ifndef UNDER_CE
disableSystemKeys();
#endif
}
extern void kegsshut();
DWORD WINAPI CEmulatorWin32::myThread(LPVOID lpParameter)
{
CEmulatorWin32* emu = (CEmulatorWin32*)lpParameter;
kegsinit(emu->m_hWnd);
emu->theThread();
kegsshut();
CloseHandle(emu->hThread);
emu->hThread=NULL;
return 0;
}
int CEmulatorWin32::initWindow(HWND _hWnd, HINSTANCE _hInstance)
{
m_hWnd = _hWnd;
hInst = _hInstance;
#ifndef UNDER_CE
theConsole=new CConsole();
CWnd *pw =CWnd::FromHandle(m_hWnd);
wStatus = new CActiveStatus(pw);
wStatus->Create(CActiveStatus::IDD,pw);
wLoading = new CActiveStatus(pw);
wLoading->Create(IDD_LOADING,pw);
wLoadingBitmap[0].LoadBitmap(IDB_DISK51);
wLoadingBitmap[1].LoadBitmap(IDB_DISK52);
wLoadingBitmap[2].LoadBitmap(IDB_DISK61);
wLoadingBitmap[3].LoadBitmap(IDB_DISK62);
enableSystemKeys();
#endif
resetLocalIMG();
return 1;
}
void async_snd_shutdown();
void async_sound_init();
void CEmulatorWin32::x_WaitForEndThread()
{
// enlËve le mode pause
//g_pause=0;
DWORD r;
MSG msg;
while ( ::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE )||bInThread )
{
// Sleep(20);
int bStillRunning = hThread && (r=WaitForSingleObject(hThread,0)==WAIT_TIMEOUT);
if (!bStillRunning)
{
outputInfo("exiting thread %X %X\n",hThread,r);
break;
}
}
}
/*
void CEmulatorWin32::activateEmulator()
{
if (theEmulator != this)
return ;
launchEmulator( this->hInst,this->m_hWnd );
}
*/
void CEmulatorWin32::x_LaunchThread( )
{
if (theEmulator != this) return ;
outputInfo("launching win32 thread\n");
DWORD threadID;
#ifndef UNDER_CE
theConsole->initConsole(this->hInst,this->m_hWnd);
hAlphaCursor = CreateAlphaCursor(hInst);
#endif
// initialize le son async
//async_sound_init();
hThread= CreateThread(NULL,0,myThread,this,0,&threadID );
if (!hThread)
outputInfo("thread initialisation failed!\n");
/*
else
bRun = true;
*/
}
LRESULT CEmulatorWin32::eventHandler(UINT umsg, WPARAM wParam, LPARAM lParam)
{
return win_event_handler(m_hWnd,umsg,wParam,lParam);
}
void win_event_key_async(HWND hwnd, UINT raw_vk, BOOL down, int repeat, UINT flags);
void CEmulatorWin32::keyHandler(UINT raw_vk,BOOL down, UINT flags)
{
win_event_key_async(m_hWnd,raw_vk, down, 0/*repeat*/, flags);
}
int CEmulatorWin32::hasFocus()
{
HWND h = ::GetFocus();
if (h == m_hWnd) return 1;
else return 0;
}
#ifndef UNDER_CE
LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
{
BOOL fEatKeystroke = FALSE;
CEmulatorWin32* emu = (CEmulatorWin32*)CEmulator::theEmulator;
// Manage the key only if the emulator has the focus
if (emu && emu->hasFocus() && nCode == HC_ACTION)
{
PKBDLLHOOKSTRUCT p;
p = (PKBDLLHOOKSTRUCT) lParam;
int down=0;
switch (wParam)
{
case WM_SYSKEYDOWN:
case WM_KEYDOWN:
down=1;
case WM_SYSKEYUP:
case WM_KEYUP:
int syskeys = ( p->vkCode == VK_TAB && p->flags & LLKHF_ALTDOWN ) ||
( p->vkCode == VK_ESCAPE && p->flags & LLKHF_ALTDOWN ) ||
( p->vkCode == VK_ESCAPE && (GetKeyState(VK_CONTROL) & 0x8000)) ||
p->vkCode == VK_LWIN ||
p->vkCode == VK_RWIN ||
p->vkCode==VK_CANCEL ||
p->vkCode==VK_SCROLL ||
p->vkCode==VK_TAB ||
p->vkCode==VK_LMENU ||
p->vkCode == VK_APPS;
if (syskeys )
{
fEatKeystroke = 1;
// outputInfo("LLSYKEY: %X\n",p->vkCode);
ASSERT(emu);
emu->keyHandler(p->vkCode,down,((p->flags&0x1)<<8));
}
else
{
// outputInfo("LLKEY: %X\n",p->vkCode);
}
break;
}
}
else
{
// outputInfo("NO LL: %X %X %X",GetActiveWindow(),::GetFocus(),emu?emu->m_hWnd:0 );
}
return(fEatKeystroke ? 1 : CallNextHookEx(NULL, nCode, wParam,
lParam));
}
void CEmulatorWin32::enableSystemKeys()
{
hhkLowLevelKybd = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, AfxGetInstanceHandle(), 0);
}
void CEmulatorWin32::disableSystemKeys()
{
if (hhkLowLevelKybd)
UnhookWindowsHookEx(hhkLowLevelKybd);
}
#endif
extern const char * activegsdownloaddir ;
extern int g_config_control_panel;
LRESULT CEmulatorWin32::windowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
{
if (message==WM_USER)
{
if (wParam==LOADING_ON)
{
showLoading(TRUE,lParam);
return TRUE;
}
else
if (wParam==LOADING_OFF)
{
showLoading(FALSE,lParam);
return TRUE;
}
else
if (wParam==REFRESH_STATUS)
{
refreshStatus(this->statusMsg.c_str());
return TRUE;
}
else
return eventHandler(message,wParam,lParam);
}
else
#ifndef UNDER_CE
if (message==WM_SETCURSOR)
{
if (hasFocus() && !g_config_control_panel)
{
SetCursor(hAlphaCursor);
return TRUE;
}
else
{
//outputInfo("nofocus\n");
return FALSE;
}
}
else
#endif
if (message==WM_RBUTTONDOWN)
{
ShowActiveInfo();
}
else
return eventHandler(message,wParam,lParam);
}
return DefWindowProc(m_hWnd,message, wParam, lParam);
}
void CEmulatorWin32::destroy()
{
outputInfo("onDestroy\n");
#ifndef UNDER_CE
if (hAlphaCursor)
{
DestroyIcon(hAlphaCursor);
hAlphaCursor = NULL;
}
if (activeInfo)
{
activeInfo->DestroyWindow();
delete activeInfo;
activeInfo=NULL;
}
if (wStatus )
{
// if (IsWindow(wStatus->m_hWnd))
wStatus->DestroyWindow();
delete wStatus;
wStatus = NULL;
}
if (wLoading )
{
// if (IsWindow(wLoading->m_hWnd))
wLoading->DestroyWindow();
delete wLoading;
wLoading=NULL;
}
for(int i=0;i<4;i++)
wLoadingBitmap[i].DeleteObject();
if (theConsole)
{
theConsole->shutConsole(this->m_hWnd);
delete theConsole;
theConsole=NULL;
}
#endif
}
void CEmulatorWin32::ShowActiveInfo()
{
if(!bInThread)
{
MessageBox(m_hWnd,_T("Close other instances first & reload page"),_T("ActiveGS"),MB_OK);
return ;
}
#ifndef UNDER_CE
if (!activeInfo)
{
CWnd *pw =CWnd::FromHandle(m_hWnd);
activeInfo = new CActiveInfo(pw); // this?
activeInfo->Create(CActiveInfo::IDD,pw); // this ?
}
g_adb.g_warp_pointer=WARP_NONE;
g_adb.g_hide_pointer = 0;
x_hide_pointer(false);
activeInfo->ShowWindow(SW_SHOW);
#endif
}
void CEmulatorWin32::refreshStatus(const char* _msg)
{
#ifndef UNDER_CE
if (wStatus)
{
RECT my;
wStatus->GetWindowRect(&my);
wStatus->ScreenToClient(&my);
my.left += 8;
my.right += 8;
my.bottom += 8;
my.top +=8;
wStatus->MoveWindow(&my);
wStatus->SendDlgItemMessage(IDC_STATUS,WM_SETTEXT,0,(LPARAM)(LPCSTR)_msg);
wStatus->ShowWindow(SW_SHOWNOACTIVATE);
OutputDebugString(_msg);
if (wStatus->TimerID)
wStatus->KillTimer(wStatus->TimerID);
wStatus->TimerID = wStatus->SetTimer(0,2000,NULL);
}
#endif
}
void CEmulatorWin32::showLoading( int _loading,int _disk)
{
#ifndef UNDER_CE
if (wLoading)
{
if (_loading)
{
RECT my;
wLoading->GetWindowRect(&my);
wLoading->ScreenToClient(&my);
CWnd* w = CWnd::FromHandle(this->m_hWnd);
RECT wrect;
w->GetClientRect(&wrect);
my.left += wrect.right-56;
my.right += wrect.right-56;
my.bottom += 8;
my.top +=8;
wLoading->MoveWindow(&my);
CWnd * hWndViewer = wLoading->GetDlgItem(IDC_IMAGECTRLDISK);
hWndViewer->SendMessage( STM_SETIMAGE, (WPARAM) IMAGE_BITMAP, (LPARAM) wLoadingBitmap[_disk].m_hObject );
wLoading->ShowWindow(SW_SHOWNOACTIVATE);
if (wLoading->TimerID)
{
wLoading->KillTimer(wLoading->TimerID);
wLoading->TimerID = NULL;
}
}
else
{
if (!wLoading->TimerID)
wLoading->TimerID = wLoading->SetTimer(2,2000,NULL);
}
}
#endif
}
#ifndef UNDER_CE
void DeleteCursor(HCURSOR theCursor)
{
DestroyIcon(theCursor);
}
typedef struct {
DWORD bV5Size;
LONG bV5Width;
LONG bV5Height;
WORD bV5Planes;
WORD bV5BitCount;
DWORD bV5Compression;
DWORD bV5SizeImage;
LONG bV5XPelsPerMeter;
LONG bV5YPelsPerMeter;
DWORD bV5ClrUsed;
DWORD bV5ClrImportant;
DWORD bV5RedMask;
DWORD bV5GreenMask;
DWORD bV5BlueMask;
DWORD bV5AlphaMask;
DWORD bV5CSType;
CIEXYZTRIPLE bV5Endpoints;
DWORD bV5GammaRed;
DWORD bV5GammaGreen;
DWORD bV5GammaBlue;
DWORD bV5Intent;
DWORD bV5ProfileData;
DWORD bV5ProfileSize;
DWORD bV5Reserved;
} MYBITMAPV5HEADER;
HCURSOR CreateAlphaCursor(HINSTANCE hInst)
{
HDC hMemDC;
DWORD dwWidth, dwHeight;
MYBITMAPV5HEADER bi;
HBITMAP hBitmap, hOldBitmap;
void *lpBits;
DWORD x,y;
HCURSOR hAlphaCursor = NULL;
HDC hdc;
HDC src;
HBITMAP hMonoBitmap;
DWORD *lpdwPixel;
ICONINFO ii;
HGDIOBJ hOldSrc;
HBITMAP hBm = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_ALPHACURSOR));
if (!hBm)
{
outputInfo("Load AlphaCursor failed (inst:%0X)\n",hInst);
return NULL;
}
BITMAP bm;
GetObject(hBm, sizeof(bm), &bm);
/*
alpha.GetBitmap(&bm);
*/
dwWidth = bm.bmWidth; // width of cursor
dwHeight = bm.bmHeight; // height of cursor
ZeroMemory(&bi,sizeof(MYBITMAPV5HEADER));
bi.bV5Size = sizeof(MYBITMAPV5HEADER);
bi.bV5Width = dwWidth;
bi.bV5Height = dwHeight;
bi.bV5Planes = 1;
bi.bV5BitCount = 32;
bi.bV5Compression = BI_BITFIELDS;
// The following mask specification specifies a supported 32 BPP
// alpha format for Windows XP.
bi.bV5RedMask = 0x00FF0000;
bi.bV5GreenMask = 0x0000FF00;
bi.bV5BlueMask = 0x000000FF;
bi.bV5AlphaMask = 0xFF000000;
hdc = GetDC(NULL);
// Create the DIB section with an alpha channel.
hBitmap = CreateDIBSection(hdc, (BITMAPINFO *)&bi, DIB_RGB_COLORS,
(void **)&lpBits, NULL, (DWORD)0);
hMemDC = CreateCompatibleDC(hdc);
src = CreateCompatibleDC(hdc);
ReleaseDC(NULL,hdc);
hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);
hOldSrc = SelectObject( src, hBm );
BitBlt(hMemDC,0,0,dwWidth,dwHeight,src,0,0,SRCCOPY);
SelectObject(src,hOldSrc);
DeleteDC(src);
SelectObject(hMemDC,hOldBitmap);
DeleteDC(hMemDC);
// Create an empty mask bitmap
hMonoBitmap = CreateBitmap(dwWidth,dwHeight,1,1,NULL);
lpdwPixel = (DWORD *)lpBits;
for (x=0;x<dwWidth;x++)
for (y=0;y<dwHeight;y++)
{
// Clear the alpha bits
*lpdwPixel &= 0x00FFFFFF;
// Set the alpha bits to 0x9F (semi-transparent)
if (*lpdwPixel!=0x00FFFFFF)
*lpdwPixel |= 0x9F000000;
lpdwPixel++;
}
ii.fIcon = FALSE; // Change fIcon to TRUE to create an alpha icon
ii.xHotspot = 0;
ii.yHotspot = 0;
ii.hbmMask = hMonoBitmap;
ii.hbmColor = hBitmap;
// Create the alpha cursor with the alpha DIB section
hAlphaCursor = CreateIconIndirect(&ii);
DeleteObject(hBitmap);
DeleteObject(hMonoBitmap);
return hAlphaCursor;
}
#endif
void CEmulatorWin32::showStatus(const char* _msg)
{
if (IsWindow(m_hWnd))
{
statusMsg = _msg;
SendMessage(m_hWnd,WM_USER,REFRESH_STATUS,0);
}
}
void CEmulatorWin32::loadingInProgress(int _motorOn,int _slot, int _drive)
{
int msg;
if (!_motorOn)
msg =LOADING_OFF;
else
msg=LOADING_ON;
if (IsWindow(m_hWnd))
{
SendMessage(m_hWnd,WM_USER,msg,((_slot-5)&1)*2+((_drive-1)&1));
}
}
void CEmulatorWin32::disableConsole(void)
{
#ifndef UNDER_CE
if (!theConsole) return ;
theConsole->disableConsole();
#endif
}
int CEmulatorWin32::activeRead(char *buf)
{
#ifndef UNDER_CE
CConsole* c = theConsole;
if (c)
return c->read(buf);
#endif
buf[0]=0;
return 0;
}
void CEmulatorWin32::getEngineString(MyString& _engine)
{
_engine ="WIN32";
#ifdef USE_RASTER
_engine+="(vbl)";
#endif
};
void x_refresh_panel(int _enum)
{
#ifndef UNDER_CE
CEmulatorWin32* p = (CEmulatorWin32*)CEmulator::theEmulator;
if (!p) return;
if (!p->activeInfo) return ;
if (_enum & PANEL_PARAMS)
p->activeInfo->updateParams();
if (_enum & (PANEL_DISK | PANEL_RUNTIME))
p->activeInfo->refresh();
#endif
}
const int soundWin32Ressources[]=
{
NULL,
IDR_SPINUPSEARCH1,
IDR_SPINUPSEARCH2
};
void x_play_sound(enum_sound hSound)
{
HINSTANCE h = ((CEmulatorWin32*)CEmulator::theEmulator)->hInst;
BOOL err = PlaySound(MAKEINTRESOURCE(soundWin32Ressources[hSound]), h, SND_RESOURCE | SND_ASYNC);
}
int x_is_sound_playing(enum_sound _hSound)
{
return 0;
};

View File

@ -0,0 +1,334 @@
// Microsoft Visual C++ generated resource script.
//
#include "activecommonres.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Français (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"activecommonres.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_DISK51 BITMAP "bitmap2.bmp"
IDB_DISK52 BITMAP "disk52.bmp"
IDB_DISK61 BITMAP "disk54.bmp"
IDB_DISK62 BITMAP "disk55.bmp"
IDB_ALPHACURSOR BITMAP "bmp00001.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ACTIVEINFO DIALOGEX 0, 0, 247, 143
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "ActiveGS v2.3 (Build BETA 07/MAY/09)"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_ACTIVETAB,"SysTabControl32",0x0,7,7,233,129
END
IDD_TABGENERAL DIALOGEX 0, 0, 192, 105
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "ActiveGS v3.6",IDC_STATIC,6,18,72,8
LTEXT "Olivier Goguel",IDC_URLOG,84,18,54,8
LTEXT "Kegs v0.91",IDC_STATIC,6,30,72,8
LTEXT "Kent Dickey",IDC_URLKD,84,30,54,8
LTEXT "Active GS Home Page",IDC_STATIC,6,66,70,8
LTEXT "http://activegs.freetoolsassociation.com",IDC_URLFTA,84,66,99,8
LTEXT "Build :",IDC_BUILD,7,97,178,8
LTEXT "Active GS Home Page",IDC_VERSION,7,90,178,8
LTEXT "Disk Drive Sounds",IDC_STATIC,7,44,72,8
LTEXT "Moose O'Malley",IDC_URLKD2,85,44,54,8
END
IDD_TABDISKCONF DIALOGEX 0, 0, 230, 117
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_SLOTLIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,6,6,209,68
PUSHBUTTON "Mount",IDC_MOUNTBUTTON,174,96,41,12
EDITTEXT IDC_EDITURL,48,96,96,12,ES_AUTOHSCROLL,WS_EX_ACCEPTFILES
PUSHBUTTON "EJect",IDC_EJECT,48,78,30,12
PUSHBUTTON "Reload",IDC_RELOAD,6,96,36,12
PUSHBUTTON "5",IDC_REBOOT5,161,78,16,12
PUSHBUTTON "6",IDC_REBOOT6,179,78,16,12
PUSHBUTTON "7",IDC_REBOOT7,198,78,16,12
LTEXT "Reboot",IDC_STATICSLOT2,136,80,23,9
COMBOBOX IDC_COMBOSLOT,6,78,36,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "...",IDC_FILESELECT,146,96,16,12
PUSHBUTTON "Swap",IDC_SWAP,81,78,30,12
END
IDD_TABPARAM DIALOGEX 0, 0, 198, 120
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_PARAMLIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,26,184,78
END
IDD_TABOPTION DIALOGEX 0, 0, 239, 113
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Use persistent storage",IDC_NOIECACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,18,108,10
LTEXT "Persistent Directory",IDC_STATIC,12,30,64,12
EDITTEXT IDC_PERSISTENT,78,30,138,14,ES_AUTOHSCROLL | ES_READONLY
GROUPBOX "Persistent Storage",IDC_STATIC,6,6,216,40
GROUPBOX "Debug Options (for advanced users only)",IDC_STATIC,6,48,216,40
CONTROL "Halt on bad memory read",IDC_HALTBADREAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,60,96,10
CONTROL "Halt on all events",IDC_HALTEVENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,60,84,10
CONTROL "Halt on bad memory access",IDC_HALTBADACCESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,72,102,10
PUSHBUTTON "Default Options",IDC_DEFAULTOPTIONS,150,72,66,12
PUSHBUTTON "Clear Cache",IDC_CLEARCACHE,150,12,66,12,WS_DISABLED
CONTROL "Enable Realtime capture (Rewind Mode)",IDC_ENABLEREWIND,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,90,162,10
END
IDD_TABHELP DIALOGEX 0, 0, 230, 110
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "F4",IDC_STATIC,12,84,9,8
LTEXT "Toggle joystick mode",IDC_STATIC,66,84,68,8
LTEXT "ALT or F1",IDC_STATIC,12,18,32,8
LTEXT "Open-Apple",IDC_STATIC,66,18,39,8
LTEXT "WIN or F2",IDC_STATIC,12,30,34,8
LTEXT "Closed-Apple / Option",IDC_STATIC,66,30,82,8
LTEXT "F8",IDC_STATIC,12,72,9,8
LTEXT "Toggle mouse lock",IDC_STATIC,66,72,59,8
GROUPBOX "Apple II GS",IDC_STATIC,6,6,216,48
GROUPBOX "Emulator",IDC_STATIC,6,60,216,48
LTEXT "PAUSE or F12",IDC_STATIC,12,42,45,8
LTEXT "Reset",IDC_STATIC,66,42,20,8
LTEXT "F5",IDC_STATIC,12,97,9,8
LTEXT "Pause/Resume",IDC_STATIC,66,97,48,8
END
IDD_TABRUNTIME1 DIALOGEX 0, 0, 230, 117
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "?",IDC_SPEED,144,6,79,8
COMBOBOX IDC_SPEEDMODE,60,6,66,53,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "",IDC_ZIPSLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_TOOLTIPS | WS_TABSTOP,60,18,66,24
LTEXT "Joystick Mode",IDC_STATIC,6,42,46,12
COMBOBOX IDC_JOYSTICK,60,42,66,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Pause",IDC_PAUSE,144,78,66,12
PUSHBUTTON "Screenshot",IDC_CONSOLEBUTTON2,144,60,66,12
PUSHBUTTON "Capture State",IDC_SAVESTATE,60,96,66,12
PUSHBUTTON "Restore State",IDC_RESTORESTATE,144,96,66,12
LTEXT "Speed Mode",IDC_STATIC,6,6,48,12
LTEXT "Video Type",IDC_STATIC,6,60,46,12
COMBOBOX IDC_VIDEOFX,60,60,66,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "Color Mode",IDC_STATIC,6,78,46,12
COMBOBOX IDC_COLORMODE,60,78,66,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "Zip Speed",IDC_STATIC,6,24,48,12
PUSHBUTTON "Display Console",IDC_CONSOLEBUTTON3,144,24,66,12
COMBOBOX IDC_STATE,7,96,36,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
IDD_LOADING DIALOGEX 0, 0, 30, 24
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_IMAGECTRLDISK,"Static",SS_BITMAP | SS_CENTERIMAGE,0,0,30,24
END
IDD_STATUS DIALOGEX 0, 0, 252, 22
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_BORDER
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "(...)",IDC_STATUS,7,7,238,8,0,WS_EX_TRANSPARENT
END
IDD_TABXML DIALOGEX 0, 0, 230, 110
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Name",-1,12,18,32,8
LTEXT "Open-Apple",IDC_MULTIPLENAME,66,18,138,8
LTEXT "Publisher",-1,12,30,31,8
LTEXT "Closed-Apple / Option",IDC_MULTIPLEPUBLISHER,66,30,145,8
LTEXT "Current",-1,12,72,26,8
LTEXT "...",IDC_MULTIPLECURRENT,66,72,59,8
GROUPBOX "Running",-1,6,6,216,48
GROUPBOX "Multiple Disk",-1,6,60,216,42
LTEXT "Year",-1,12,42,45,8
LTEXT "Reset",IDC_MULTIPLEYEAR,66,42,148,8
PUSHBUTTON "Swap",IDC_MULTIPLESWAP,161,69,54,12
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_ACTIVEINFO, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 240
TOPMARGIN, 7
BOTTOMMARGIN, 136
END
IDD_TABGENERAL, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 185
TOPMARGIN, 7
BOTTOMMARGIN, 90
END
IDD_TABDISKCONF, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 223
TOPMARGIN, 7
BOTTOMMARGIN, 108
END
IDD_TABPARAM, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 191
TOPMARGIN, 7
BOTTOMMARGIN, 113
END
IDD_TABOPTION, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 232
TOPMARGIN, 7
BOTTOMMARGIN, 106
END
IDD_TABHELP, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 223
TOPMARGIN, 7
BOTTOMMARGIN, 103
END
IDD_TABRUNTIME1, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 223
TOPMARGIN, 7
BOTTOMMARGIN, 110
END
IDD_LOADING, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 23
TOPMARGIN, 7
BOTTOMMARGIN, 17
END
IDD_STATUS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 245
TOPMARGIN, 7
BOTTOMMARGIN, 15
END
IDD_TABXML, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 223
TOPMARGIN, 7
BOTTOMMARGIN, 103
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
IDC_CURSOR1 CURSOR "cursor1.cur"
/////////////////////////////////////////////////////////////////////////////
//
// AFX_DIALOG_LAYOUT
//
IDD_TABGENERAL AFX_DIALOG_LAYOUT
BEGIN
0
END
#endif // Français (France) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -0,0 +1,256 @@
#include "../common.win32/stdafx.h"
#include <afxinet.h>
#ifndef UNDER_CE
#include <sys/stat.h>
#include <io.h>
#endif
#include <oleidl.h.>
#include "../common/cemulatorctrl.h"
#include "../Libraries/unzip101e/unzip.h"
#include "../kegs/src/sim65816.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
bool CDownload::GetFile( const char *url, const char *filename)
{
#define HTTPBUFLEN 4096 // Size of HTTP Buffer...
char httpbuff[HTTPBUFLEN];
#if defined(ACTIVEGSKARATEKA)
if (!strncmp(url,"http://asset/",13))
{
extern bool x_load_asset( const char *url, const char *filename);
return x_load_asset(url,filename);
}
#endif
CHttpConnection* pServer = NULL;
//CFile* remoteFile=NULL;
CHttpFile* remoteFile=NULL;
CFile* myfile = NULL;
int remotefileopen=0;
TOSYSTEMCHAR(filename,filenamesys);
if (filename)
{
outputInfo("*** Downloading %s to %s \n",url,filename);
showProgress(url,0);
}
DWORD dwLength=0;
TRY
{
CString serverName;
CString serverFile;
DWORD dwServiceType;
INTERNET_PORT nPort;
DWORD dwRet;
CInternetSession mysession(_T("ActiveGS"));
TOSYSTEMCHAR(url,urlsys);
if (!AfxParseURLEx(urlsys,dwServiceType,serverName,serverFile,nPort,CString(),CString(),ICU_NO_ENCODE))
{
outputInfo("*** misformed url/filename : %s",url);
AfxThrowFileException(0,0,NULL);
return false;
}
if (dwServiceType ==AFX_INET_SERVICE_FILE)
{
outputInfo("*** not an http file : %s",url);
AfxThrowFileException(0,0,NULL);
return false;
}
pServer = mysession.GetHttpConnection(serverName/*,INTERNET_FLAG_ASYNC*/, nPort);
//outputInfo("*** GetHttpConnection %s\n",serverName);
remoteFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_GET, serverFile);
//outputInfo("*** OpenRequest %s\n",serverFile);
if (!remoteFile->SendRequest())
{
outputInfo("*** cannot SendRequest : %s",serverName);
AfxThrowFileException(0,0,NULL);
return false;
}
remotefileopen=1;
if (!remoteFile->QueryInfoStatusCode(dwRet))
{
outputInfo("*** QueryInfoStatusCode failed (%d)\n",GetLastError());
}
if (dwRet != HTTP_STATUS_OK)
{
outputInfo("*** cannot query http serveur : %s (status=%d)\n",serverName,dwRet);
AfxThrowFileException(0,0,NULL);
return false;
}
DWORD BufferLength=sizeof(dwLength);
if (!remoteFile->QueryInfo( HTTP_QUERY_CONTENT_LENGTH|HTTP_QUERY_FLAG_NUMBER, &dwLength, &BufferLength, NULL))
{
// File does not exist ?
if (GetLastError()!=ERROR_HTTP_HEADER_NOT_FOUND)
{
outputInfo("*** cannot query file size (%d) (%s || %s)\n",GetLastError(),serverName,serverFile);
AfxThrowFileException(0,0,NULL);
return false;
}
else
{
// ce message apparait dans le cas des stats : pas de header ?
if (filename)
outputInfo("*** cannot query file size ERROR_HTTP_HEADER_NOT_FOUND (%s || %s)\n",serverName,serverFile);
}
}
if (filename)
myfile = new CFile(filenamesys, CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
int nbread=0;
int numbytes;
int pourcent=0;
while (numbytes = remoteFile->Read(httpbuff, HTTPBUFLEN))
{
nbread+=numbytes;
if (myfile)
myfile->Write(httpbuff, numbytes);
if (dwLength)
pourcent = (nbread*100)/dwLength;
else
pourcent = (pourcent+5)%100;
if (myfile)
{
showProgress(url,pourcent); //("downloading: %s (%3d%%)",getfile(url),pourcent);
if (r_sim65816.should_emulator_terminate())
{
outputInfo("Download aborted (%s)\n",url);
AfxThrowFileException(0,0,NULL);
}
}
}
if (remoteFile)
{
remoteFile->Close();
delete remoteFile;
remoteFile=NULL;
}
if (pServer)
{
pServer->Close();
delete pServer;
pServer=NULL;
}
if (myfile)
{
myfile->Close();
delete myfile;
myfile=NULL;
}
}
CATCH_ALL(error)
{
int err = GetLastError();
showStatus("Cannot download %s\n",getfile(url));
if (myfile) { myfile->Close(); delete myfile; }
if (remoteFile && remotefileopen) { remoteFile->Close(); delete remoteFile; }
if (pServer) { pServer->Close(); delete pServer; }
DeleteFile(filenamesys);
return false;
}
END_CATCH_ALL;
return true;
}
bool CDownload::retrievePersistentZippedFile(const char* url,int _order,MyString& _path, MyString& _short)
{
MyString pdir = getPersistentDir(url);
CString dir(pdir);
// enum
CString search;
search.Format(_T("%s\\%d_*.*"),dir.GetString(),_order);
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
hFind = FindFirstFile(search, &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
return false;
MyString found(FindFileData.cFileName);
_path.Format("%s\\%s",pdir,found.c_str());
_short = found.Mid(2);
return true;
}
void CDownload::createDirectory(const char *_dir)
{
TOSYSTEMCHAR(_dir,dirsys);
CreateDirectory(dirsys,NULL);
}
extern const char * activegsdownloaddir;
extern const char * activegspersistentdir;
void CDownload::initPersistentSystemPath(MyString& path)
{
TCHAR pfraw[MAX_PATH];
SHGetSpecialFolderPath(NULL,pfraw,CSIDL_PERSONAL,TRUE);
path = pfraw;
}
void CDownload::deleteFile(const char* _dir)
{
#ifndef WINCE
remove(_dir);
#endif
}
void CDownload::deleteDirectory(const char* _dir, int keepDir)
{
}

BIN
Common.win32/ActiveGS.aps Normal file

Binary file not shown.

71
Common.win32/ActiveGS.rc Normal file
View File

@ -0,0 +1,71 @@
// Microsoft Visual C++ generated resource script.
//
#include "ActiveGS.rc.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"ActiveGS.rc.\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// WAVE
//
IDR_SPINUPSEARCH1 WAVE "..\\Common\\sounds\\Spin Up Search 1.wav"
IDR_SPINUPSEARCH2 WAVE "..\\Common\\sounds\\Spin Up Search 2.wav"
#endif // French (France) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -0,0 +1,17 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ActiveGS.rc
//
#define IDR_SPINUPSEARCH1 101
#define IDR_SPINUPSEARCH2 102
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

111
Common.win32/ActiveHook.cpp Normal file
View File

@ -0,0 +1,111 @@
#include "stdafx.h"
#include <afxinet.h>
#include "ZipArchive.h"
#include <sys/stat.h>
#include "activetools.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
TCActiveBaseCollection CActiveBase::m_Collection;
HHOOK CActiveBase::m_hHook=NULL;
LRESULT CALLBACK CActiveBase::GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam)
{
// If this is a keystrokes message, pass it to IsDialogMessage for tab
// and accelerator processing
LPMSG lpMsg = (LPMSG) lParam;
if (
(nCode >= 0) &&
// PM_REMOVE == wParam &&
(
(lpMsg->message == WM_LBUTTONDOWN) ||
(lpMsg->message == WM_MOUSEMOVE) ||
(lpMsg->message == WM_LBUTTONUP) ||
(lpMsg->message == WM_RBUTTONDOWN) ||
(lpMsg->message == WM_MBUTTONDOWN) ||
(lpMsg->message == WM_MBUTTONUP) ||
(lpMsg->message == WM_RBUTTONUP)
)
)
{
CActiveBase* pObj; //, hActiveWindow = GetActiveWindow();
TCActiveBaseCollection::iterator it =m_Collection.begin();
// check each window we manage to see if the message is meant for them
while (it != m_Collection.end())
{
pObj = *it;
// if (::IsWindow(hWnd))
// ::IsDialogMessage(hWnd, lpMsg)
{
pObj->m_ttip.RelayEvent(lpMsg);
/*
lpMsg->hwnd = NULL;
lpMsg->message = WM_NULL;
lpMsg->lParam = 0L;
lpMsg->wParam = 0;
*/
// break;
}
it++;
}
}
// Passes the hook information to the next hook procedure in
// the current hook chain.
return ::CallNextHookEx(m_hHook, nCode, wParam, lParam);
}
HRESULT CActiveBase::InstallHook()
{
// make sure the hook is installed
if (m_hHook == NULL)
{
m_hHook = ::SetWindowsHookEx(WH_GETMESSAGE,
GetMessageProc,
AfxGetInstanceHandle(),
GetCurrentThreadId());
// is the hook set?
if (m_hHook == NULL)
{
return E_UNEXPECTED;
}
}
// add the window to our list of managed windows
if (m_Collection.find(this) == m_Collection.end())
m_Collection.insert(this);
return S_OK;
}
HRESULT CActiveBase::UninstallHook()
{
HRESULT hr = S_OK;
// was the window found?
if (m_Collection.erase(this) == 0)
return E_INVALIDARG;
// is this the last window? if so, then uninstall the hook
if (m_Collection.size() == 0 && m_hHook)
{
if (!::UnhookWindowsHookEx(m_hHook))
hr = HRESULT_FROM_WIN32(::GetLastError());
m_hHook = NULL;
}
return hr;
}

440
Common.win32/ActiveInfo.cpp Normal file
View File

@ -0,0 +1,440 @@
// ActiveInfo.cpp : fichier d'implémentation
//
#include "../common.win32/stdafx.h"
#include "activeinfo.h"
#include "tabgeneral.h"
#include "taboption.h"
#include "tabruntime.h"
#include "tabxml.h"
#include "diskediturl.h"
#include "activecommon.h"
#include "../common/svnversion.h"
#include "../kegs/src/moremem.h"
#include "../kegs/src/sim65816.h"
// Boîte de dialogue CActiveInfo
IMPLEMENT_DYNAMIC(CActiveInfo, CDialog)
CActiveInfo::CActiveInfo(CWnd* pParent /*=NULL*/)
: CDialog(CActiveInfo::IDD, pParent)
{
pTabDialog = NULL;
uTimer=0;
}
CActiveInfo::~CActiveInfo()
{
}
void CActiveInfo::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
// DDX_Control(pDX, IDC_ACTIVETAB, m_InfoTab);
// DDX_Control(pDX, IDC_URLOG, urlOG);
}
BEGIN_MESSAGE_MAP(CActiveInfo, CDialog)
ON_NOTIFY(TCN_SELCHANGE, IDC_ACTIVETAB, OnTcnSelchangeActivetab)
ON_WM_TIMER()
ON_WM_DESTROY()
END_MESSAGE_MAP()
void CActiveInfo::freeTabDialog()
{
if (pTabDialog)
{
if (uTimer) KillTimer(uTimer);
uTimer=0;
pTabDialog->DestroyWindow();
delete pTabDialog;
pTabDialog=NULL;
}
}
// Gestionnaires de messages CActiveInfo
BOOL CActiveInfo::OnInitDialog()
{
CDialog::OnInitDialog();
int i=0;
CTabCtrl* infoTab = (CTabCtrl*)GetDlgItem(IDC_ACTIVETAB);
if (infoTab)
{
//infoTab->InsertItem(i++,"Image") ;
infoTab->InsertItem(i++,"Disk Conf.");
infoTab->InsertItem(i++,"Runtime Info");
infoTab->InsertItem(i++,"Options");
infoTab->InsertItem(i++,"Variables");
infoTab->InsertItem(i++,"Help");
infoTab->InsertItem(i++,"Credits");
OnTcnSelchangeActivetab(NULL,NULL);
}
else
outputInfo("getdlgitem failed: %d",GetLastError());
/*
m_InfoTab.InsertItem(1,"Runtime Info");
m_InfoTab.InsertItem(2,"Console");
*/
// change le titre
SetWindowText(ACTIVEGSVERSIONSTR);
//char s[1024];
//GetWindowText(hWnd,s,1024);
CenterWindow();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION : les pages de propriétés OCX devraient retourner FALSE
}
extern int g_zipgs_reg_c05a;
void CActiveInfo::OnTcnSelchangeActivetab(NMHDR *pNMHDR, LRESULT *pResult)
{
CTabCtrl* infoTab = (CTabCtrl*)GetDlgItem(IDC_ACTIVETAB);
//static const int sel2id[]={ IDD_TABGENERAL,IDD_TABOPTION,IDD_TABRUNTIME1,IDD_TABDISKCONF,IDD_TABPARAM,IDD_TABHELP,0};
static const int sel2id[]={
// IDD_TABXML,
IDD_TABDISKCONF,
IDD_TABRUNTIME1,
IDD_TABOPTION,
IDD_TABPARAM,
IDD_TABHELP,
IDD_TABGENERAL,
0};
int sel = infoTab->GetCurSel();
int id = sel2id[sel];
freeTabDialog();
if (!id) return;
CRect m_ClientRect,WindowRect;
// Determine the size of the area for the contents
infoTab->GetClientRect(&m_ClientRect);
infoTab->AdjustRect(FALSE, &m_ClientRect);
// Determine the offset within the view's client area
infoTab->GetWindowRect(&WindowRect);
infoTab->ScreenToClient(WindowRect);
m_ClientRect.OffsetRect(WindowRect.left, WindowRect.top);
switch(id)
{
case IDD_TABGENERAL:
pTabDialog = new CTabGeneral(infoTab);
break;
case IDD_TABOPTION:
pTabDialog = new CTabOption(infoTab);
break;
case IDD_TABRUNTIME1:
pTabDialog = new CTabRuntime(infoTab);
break;
case IDD_TABDISKCONF:
pTabDialog = new CDiskEditURL(infoTab);
break;
case IDD_TABXML:
pTabDialog = new CTabXML(infoTab);
break;
default:
pTabDialog = new CTabActiveInfo(id,infoTab);
}
pTabDialog->Create(id,infoTab);
switch(id)
{
case IDD_TABDISKCONF:
{
CComboBox *pCombo = (CComboBox*)pTabDialog->GetDlgItem(IDC_COMBOSLOT);
ASSERT(pCombo);
CDiskEditURL* pDialogDisk = (CDiskEditURL*)pTabDialog;
MyString s;
int id;
int err;
for(int slot=5;slot<=7;slot++)
{
int maxdrive=2;
if (slot==7) maxdrive=MAXSLOT7DRIVES;
for(int disk=1;disk<=maxdrive;disk++)
{
s.Format("S%dD%d",slot,disk);
id = slot*10+disk ;
err = pCombo->InsertString(-1,s.c_str());
pCombo->SetItemData(err,id);
}
}
int d = pDialogDisk->selectedItem ;
if (d==-1) d=0;
pCombo->SetCurSel(d);
pDialogDisk->OnCbnSelchangeComboslot();
CListCtrl *pList = (CListCtrl*)pTabDialog->GetDlgItem(IDC_SLOTLIST);
pList->InsertColumn(0,"Slot");
pList->SetColumnWidth(0,40);
/*
pList->InsertColumn(1,"(E)");
pList->SetColumnWidth(1,10);
*/
pList->InsertColumn(1,"Filename");
pList->SetColumnWidth(1,100);
pList->InsertColumn(2,"Size");
pList->SetColumnWidth(2,50);
pList->InsertColumn(3,"Prefix");
pList->SetColumnWidth(3,120);
/*
pList->InsertColumn(5,"Path");
pList->SetColumnWidth(5,1000);
*/
// updateRuntimeImages();
}
break;
case IDD_TABRUNTIME1:
{
CSliderCtrl *pSlider = (CSliderCtrl*)pTabDialog->GetDlgItem(IDC_ZIPSLIDER);
pSlider->SetRange(0,15);
pSlider->SetPos(15-(g_moremem.g_zipgs_reg_c05a>>4)&0x0F);
updateRuntimeSpeed();
uTimer = SetTimer(1, 1000, 0);
break;
}
case IDD_TABPARAM:
{
CListCtrl *pList = (CListCtrl*)pTabDialog->GetDlgItem(IDC_PARAMLIST);
pList->InsertColumn(0,"Name");
pList->SetColumnWidth(0,80);
pList->InsertColumn(1,"Value");
pList->SetColumnWidth(1,160);
pList->InsertColumn(2,"Hex");
pList->SetColumnWidth(2,80);
updateParams();
break;
}
case IDD_TABOPTION:
{
}
break;
case IDD_TABXML:
break;
case IDD_TABGENERAL:
{
CWnd *pText = (CWnd*)pTabDialog->GetDlgItem(IDC_BUILD);
if (pText)
{
const char * builddate = "Built on " ACTIVEGSDATE ;
pText->SetWindowText(builddate);
}
pText = (CWnd*)pTabDialog->GetDlgItem(IDC_VERSION);
if (pText)
{
const char * builddate = ACTIVEGSVERSIONSTRFULL;
pText->SetWindowText(builddate);
}
}
break;
default:
break;
}
refresh();
pTabDialog->MoveWindow(m_ClientRect);
pTabDialog->ShowWindow(SW_SHOW);
if (pResult)
*pResult = 0;
}
/*
void CActiveInfo::updateRuntimeImages()
{
CListCtrl *pList = (CListCtrl*)pTabDialog->GetDlgItem(IDC_SLOTLIST);
if (!pList) return ;
pList->DeleteAllItems();
int nbi=0;
for(int slot=5;slot<=7;slot++)
for(int disk=1;disk<=2;disk++)
for(int active=0;active<ACTIVEGSMAXIMAGE;active++)
{
CSlotInfo info;
CEmulator* emu=CEmulator::theEmulator;
int ret = emu->getLocalMultipleIMGInfo(slot,disk,info,active);
if (!ret) continue;
if (info.status==UNDEFINED || info.status ==NOTHING) continue;
MyString str;
str.Format("S%dD%d",slot,disk);
if (ret==1)
str +="*";
pList->InsertItem(nbi,str.c_str());
// pList->SetItemData(nbi,(slot-5);
// pList->SetItemText(nbi,1,"e");
MyString shortname (info.shortname.c_str());
MyString sizeStr;
if (info.size>1*1024*1024)
sizeStr.Format("%4dMb",info.size/(1024*1024));
else
sizeStr.Format("%4dKo",info.size/1024);
MyString prefix;
switch(info.status)
{
case MOUNTED:
prefix = info.prefix.c_str();
break;
case EJECTED:
if (!info.filename.IsEmpty())
prefix = "*EJECTED*";
break;
case READY2MOUNT:
prefix = "*READY2MOUNT*";
shortname = getfile(info.url);
break;
case DELAYEDMOUNT:
prefix = "*DELAYEDMOUNT*";
shortname = getfile(info.url);
break;
case FAILED:
prefix ="*FAILED*";
break;
}
pList->SetItemText(nbi,1,shortname.c_str());
pList->SetItemText(nbi,2,sizeStr.c_str());
pList->SetItemText(nbi,3,prefix.c_str());
// pList->SetItemText(nbi,5,info.name);
nbi++;
}
}
*/
//extern char targetSpeed[256];
extern char estimatedSpeed[256];
//extern int g_speed_fast;
void CActiveInfo::updateRuntimeSpeed()
{
CWnd* speedTab = (CWnd*)pTabDialog->GetDlgItem(IDC_SPEED);
if (!speedTab) return ;
CString speed; // pour AppendFormat
speed.Format("%s MHz ",estimatedSpeed);
if (g_sim65816.g_speed_fast)
{
// speed.AppendFormat("(%s MHz)",targetSpeed);
}
else
speed.Append("(1.0 MHz*)");
speedTab->SetWindowText(speed);
CComboBox *pCombo = (CComboBox*)pTabDialog->GetDlgItem(IDC_SPEEDMODE);
if (pCombo && ( ((CTabRuntime*)pTabDialog)->enableSpeedChange))
{
CEmulator* emu = CEmulator::theEmulator ;
int sel = pCombo->GetCurSel();
int speed = pCombo->GetItemData(sel);
int sp = g_sim65816.get_limit_speed();
if (sp != speed)
{
namevalue& nv = option.find(OPTION_SPEED);
int ispeed = nv.getOrder(g_sim65816.get_limit_speed());
pCombo->SetCurSel(ispeed);
printf("resetting speed to %s (%d)\n",nv.getDescription(sp),sp);
}
}
CSliderCtrl *pSlider = (CSliderCtrl*)pTabDialog->GetDlgItem(IDC_ZIPSLIDER);
if (pSlider)
pSlider->SetPos(15-(g_moremem.g_zipgs_reg_c05a>>4)&0x0F);
}
void CActiveInfo::OnTimer(UINT_PTR nIDEvent)
{
updateRuntimeSpeed();
CDialog::OnTimer(nIDEvent);
}
void CActiveInfo::updateParams()
{
CListCtrl *pList = (CListCtrl*)pTabDialog->GetDlgItem(IDC_PARAMLIST);
if (!pList) return ;
pList->DeleteAllItems();
CEmulator* emu=CEmulator::theEmulator;
int pos = 0;
for(int i=0;i<emu->nbparams;i++)
{
pList->InsertItem(pos,emu->params[i].data.c_str());
pList->SetItemText(pos,1,emu->params[i].value.c_str());
MyString hex;
hex.Format("(%X)",emu->params[i].hex);
pList->SetItemText(pos,2,hex.c_str());
pos++;
}
for(int i=0;i<NB_OPTIONS;i++)
{
const char* name = option.options[i].def->name;
pList->InsertItem(pos,name);
MyString desc; option.getStrValue(desc,(option_id)i);
pList->SetItemText(pos,1,desc.c_str());
if (option.options[i].def->convertTableInt)
{
MyString hex;
hex.Format("(%d)",option.options[i].intvalue);
pList->SetItemText(pos,2,hex.c_str());
}
pos++;
}
}
void CActiveInfo::OnDestroy()
{
CDialog::OnDestroy();
// TODO : ajoutez ici le code de votre gestionnaire de messages
freeTabDialog();
}
void CActiveInfo::refresh()
{
if (pTabDialog)
pTabDialog->refresh();
}

47
Common.win32/ActiveInfo.h Normal file
View File

@ -0,0 +1,47 @@
#pragma once
#include "afxcmn.h"
#include "hyperlink.h"
#include "activecommonres.h"
class CTabActiveInfo : public CDialog
{
public:
CTabActiveInfo(UINT IDD, CWnd* pParent /*=NULL*/)
: CDialog(IDD, pParent) {}
virtual void refresh() {} ;
};
// Boîte de dialogue CActiveInfo
class CActiveInfo : public CDialog
{
DECLARE_DYNAMIC(CActiveInfo)
public:
CActiveInfo(CWnd* pParent = NULL); // constructeur standard
virtual ~CActiveInfo();
// Données de boîte de dialogue
enum { IDD = IDD_ACTIVEINFO };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // Prise en charge DDX/DDV
DECLARE_MESSAGE_MAP()
public:
// CActiveTab m_InfoTab;
CTabActiveInfo* pTabDialog;
UINT uTimer;
virtual BOOL OnInitDialog();
afx_msg void OnTcnSelchangeActivetab(NMHDR *pNMHDR, LRESULT *pResult);
void updateRuntimeSpeed();
// void updateRuntimeImages();
void updateParams();
afx_msg void OnTimer(UINT_PTR nIDEvent);
void freeTabDialog();
afx_msg void OnDestroy();
void refresh();
};

View File

@ -0,0 +1,49 @@
// ActiveStatus.cpp : implementation file
//
#include "../common.win32/stdafx.h"
//#include "ActiveGS.h"
#include "ActiveStatus.h"
//#include "ActiveGSCtrl.h"
// CActiveStatus dialog
IMPLEMENT_DYNAMIC(CActiveStatus, CDialog)
CActiveStatus::CActiveStatus(CWnd* pParent /*=NULL*/)
: CDialog(CActiveStatus::IDD, pParent)
{
TimerID = NULL;
}
CActiveStatus::~CActiveStatus()
{
}
void CActiveStatus::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CActiveStatus, CDialog)
ON_WM_TIMER()
ON_WM_DESTROY()
END_MESSAGE_MAP()
// CActiveStatus message handlers
void CActiveStatus::OnTimer(UINT_PTR nIDEvent)
{
ShowWindow(SW_HIDE);
CDialog::OnTimer(nIDEvent);
TimerID = NULL;
}
void CActiveStatus::OnDestroy()
{
if (TimerID)
KillTimer(TimerID);
TimerID = NULL;
}

View File

@ -0,0 +1,26 @@
#pragma once
//#include "activegsresrc.h"
#include "activecommonres.h"
// CActiveStatus dialog
class CActiveStatus : public CDialog
{
DECLARE_DYNAMIC(CActiveStatus)
public:
CActiveStatus(CWnd* pParent = NULL); // standard constructor
virtual ~CActiveStatus();
UINT_PTR TimerID;
// Dialog Data
enum { IDD = IDD_STATUS };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg void OnDestroy();
};

298
Common.win32/ChildView.cpp Normal file
View File

@ -0,0 +1,298 @@
// ChildView.cpp : implementation of the CChildView class
//
#include "../Common.win32/stdafx.h"
#include "ChildView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CChildView
CChildView::CChildView()
{
pEmulatorCtrl = NULL;
parent = NULL;
//pConfig = NULL;
}
CChildView::~CChildView()
{
}
BEGIN_MESSAGE_MAP(CChildView, CWnd)
ON_WM_PAINT()
ON_WM_CREATE()
ON_WM_DESTROY()
ON_WM_SETFOCUS()
ON_WM_SETTINGCHANGE()
#ifndef UNDER_CE
ON_WM_MOUSEACTIVATE()
#endif
ON_WM_SIZE()
// ON_WM_ERASEBACKGND()
END_MESSAGE_MAP()
// CChildView message handlers
BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
{
OutputDebugString("PreCreateWindow");
if (!CWnd::PreCreateWindow(cs))
return FALSE;
/* cs.dwExStyle |= WS_EX_CLIENTEDGE;
cs.style &= ~WS_BORDER;
*/
cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS,
::LoadCursor(NULL, IDC_SIZEALL /*IDC_ARROW*/), NULL /*reinterpret_cast<HBRUSH>(COLOR_WINDOW+1)*/, NULL);
return TRUE;
}
int CChildView::CreateEmulatorWindow(CWnd* _w)
{
/*
strMyClass = AfxRegisterWndClass(
CS_VREDRAW | CS_HREDRAW,
::LoadCursor(NULL, IDC_ARROW),
(HBRUSH) ::GetStockObject(WHITE_BRUSH),
::LoadIcon(NULL, IDI_APPLICATION));
*/
outputInfo("CreateEmulatorWindow w:%X this:%X pEmulator:%X theEmulator:%X\n",_w,this,pEmulatorCtrl,CEmulator::theEmulator);
CRect rect;
parent = _w;
_w->GetClientRect(&rect);
outputInfo("Rect width:%d, height:%d\n",rect.Width(),rect.Height());
BOOL (__thiscall CWnd::* p )(LPCTSTR,LPCTSTR,DWORD,const RECT &,CWnd *,UINT,CCreateContext *) = &CChildView::Create;
outputInfo("p=%X",p);
int r = Create(NULL, _T("activegs"), WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN/*AFX_WS_DEFAULT_VIEW*/,
rect,_w
// CRect(rect0, 0, 704, 460),
// CRect(0, 0, 1000, 600),
, AFX_IDW_PANE_FIRST, NULL);
SetFocus();
return r;
}
extern int g_window_width;
extern int g_window_height;
void CChildView::resize()
{
extern void window_needs_full_refresh();
if (!parent) return ;
RECT rcClient, rcWindow;
RECT localClient, localWindow;
POINT ptDiff;
parent->GetClientRect( &rcClient);
parent->GetWindowRect( &rcWindow);
GetClientRect( &localClient);
GetWindowRect( &localWindow);
#ifdef VIDEO_SINGLEVLINE
localClient.bottom *=2;
#endif
ptDiff.x = (rcWindow.right - rcWindow.left) - rcClient.right;
ptDiff.y = (rcWindow.bottom - rcWindow.top) - rcClient.bottom;
int nWidth = rcClient.right - rcClient.left;
int nHeight = rcClient.bottom - rcClient.top;
MoveWindow(0/*rcWindow.left*/, 0/*rcWindow.top*/, nWidth + ptDiff.x, nHeight + ptDiff.y, TRUE);
window_needs_full_refresh();
}
int CChildView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
outputInfo("OnCreate CChildView:%X CurrentEmulator:%X\n",this,CEmulator::theEmulator);
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
#ifdef UNDER_CE
DEVMODE mode;
memset(&mode,0,sizeof(DEVMODE));
mode.dmSize = sizeof(DEVMODE);
mode.dmFields=DM_DISPLAYORIENTATION;
mode.dmDisplayOrientation = DMDO_90;
LONG Err= ChangeDisplaySettingsEx(NULL,&mode,NULL,0,NULL);
if (Err!=DISP_CHANGE_SUCCESSFUL)
outputInfo("failed to change display\n");
#endif
if (CEmulator::theEmulator)
{
outputInfo("Emulator was running: kill it (%X)\n",CEmulator::theEmulator);
CEmulator::theEmulator->terminateEmulator();
delete CEmulator::theEmulator;
}
resize();
pEmulatorCtrl = new CEmulatorWin32((CEmulator**)&this->pEmulatorCtrl);
//id = pEmulatorCtrl->id;
//outputInfo("new emulator (%X)(%X)(%d)\n",this,pEmulatorCtrl,CEmulator::theEmulator->id);
hInst = lpCreateStruct->hInstance;
CEmulatorConfig* pConfig = &config;
// g_download.initPersistentPath();
pEmulatorCtrl->initWindow(m_hWnd,hInst);
pEmulatorCtrl->setConfig(pConfig);
pEmulatorCtrl->launchEmulator();
return 0;
}
void CChildView::OnPaint()
{
if ( pEmulatorCtrl && pEmulatorCtrl == CEmulator::theEmulator )
{
CWnd::OnPaint();
}
else
{
PAINTSTRUCT ps;
CDC* cdc = BeginPaint(&ps);
RECT r;
GetClientRect(&r);
CBrush brush;
brush.CreateSolidBrush(RGB(36,34,244));
cdc->FillRect(&r,&brush);
#ifdef UNDER_CE
cdc->DrawText( _T("PAUSED"), -1, &r, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
#else
cdc->SetTextColor(RGB(255,255,255));
cdc->SetBkColor(RGB(36,34,244));
int l = (r.bottom - r.top)/2 - 20;
const char* line1="The emulator has been closed as another instance is running.";
cdc->TextOut(100 ,l, line1,strlen(line1));
const char line2[]="Refresh this window to re-activate the emulator.";
cdc->TextOut(100 ,l+20, line2,strlen(line2));
#endif
EndPaint(&ps);
}
}
void CChildView::OnDestroy()
{
outputInfo("OnDestroy CChildView:%X theEmulator:%X\n",this,pEmulatorCtrl);
if (pEmulatorCtrl)
{
// ASSERT(CEmulator::theEmulator == pEmulatorCtrl);
if (CEmulator::theEmulator == pEmulatorCtrl)
{
pEmulatorCtrl->terminateEmulator();
delete pEmulatorCtrl;
pEmulatorCtrl = NULL;
}
else
outputInfo("ERR:OnDestroy but pEMulatorCtrl not owned by us ... CChildView:%X theEmulator:%X\n",this,pEmulatorCtrl);
}
}
LRESULT CChildView::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
#if 0
switch(message)
{
case WM_KEYUP:
outputInfo("DefWindowProc: WM_KEYUP: %X\n",wParam);
break;
case WM_KEYDOWN:
outputInfo("DefWindowProc: WM_KEYDOWN: %X\n",wParam);
break;
default:
break;
}
#endif
if (CEmulator::theEmulator && pEmulatorCtrl == CEmulator::theEmulator)
return pEmulatorCtrl->windowProc(message,wParam,lParam);
else
return CWnd::DefWindowProc(message, wParam, lParam);
}
BOOL CChildView::PreTranslateMessage(MSG* pMsg)
{
switch(pMsg->message)
{
case WM_KEYDOWN:
case WM_KEYUP:
case WM_SYSKEYUP:
case WM_SYSKEYDOWN:
if (pEmulatorCtrl && pEmulatorCtrl == CEmulator::theEmulator)
pEmulatorCtrl->windowProc(pMsg->message,pMsg->wParam,pMsg->lParam);
return 1;
/*
case WM_LBUTTONDOWN:
outputInfo("WM_LBUTTONDOWN\n");
break;
case WM_LBUTTONUP:
outputInfo("WM_LBUTTONUP\n");
break;
*/
default:
break;
}
return 0; // to dispatch messag
}
void CChildView::OnSetFocus(CWnd* pOldWnd )
{
// outputInfo("OnSetFocus\n");
CWnd::OnSetFocus(pOldWnd);
}
CWnd* CChildView::SetFocus()
{
// outputInfo("SetFocus\n");
CWnd* w = CWnd::SetFocus();
return w;
}
#ifndef UNDER_CE
int CChildView::OnMouseActivate(CWnd* pDesktopWnd,UINT nHitTest,UINT message )
{
// outputInfo("child OnMouseActivate\n");
// Was used in the .OCX version
// OnActivateInPlace(TRUE, NULL); // OnActivateInPlace() is an undocumented function
return CWnd::OnMouseActivate(pDesktopWnd,nHitTest, message);
// return MA_ACTIVATEANDEAT ;
}
#endif
BOOL CChildView::OnEraseBkgnd(CDC* pDC)
{
return 1;
}
void CChildView::OnSettingChange(UINT uFlags,LPCTSTR lpszSection)
{
outputInfo("OnSettingChange");
}

53
Common.win32/ChildView.h Normal file
View File

@ -0,0 +1,53 @@
// ChildView.h : interface of the CChildView class
//
#pragma once
#include "../common.win32/activecommon.h"
#include "../common/ki.h"
// CChildView window
class CChildView : public CWnd
{
// Construction
public:
CChildView();
// Attributes
public:
CEmulatorWin32* pEmulatorCtrl;
int id;
HINSTANCE hInst;
CEmulatorConfig config;
CWnd* parent;
// Operations
public:
int CreateEmulatorWindow(CWnd* _w);
// Overrides
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
// Implementation
public:
virtual ~CChildView();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSetFocus(CWnd* pOldWnd );
afx_msg void OnDestroy();
afx_msg int OnMouseActivate(CWnd* pDesktopWnd,UINT nHitTest,UINT message );
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnSettingChange(UINT uFlags,LPCTSTR lpszSection);
virtual CWnd*SetFocus();
virtual BOOL PreTranslateMessage(MSG* pMsg);
void resize();
// Generated message map functions
//protected:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
};

View File

@ -0,0 +1,324 @@
// DiskEditURL.cpp : implementation file
//
#include "../Common.win32/stdafx.h"
//#include "ActiveGSApp.h"
#include "activecommon.h"
#include "DiskEditURL.h"
#include <Windowsx.h>
// CDiskEditURL dialog
IMPLEMENT_DYNAMIC(CDiskEditURL, CDialog)
CDiskEditURL::CDiskEditURL(CWnd* pParent /*=NULL*/)
: CTabActiveInfo(CDiskEditURL::IDD, pParent)
{
selectedItem=0;
}
CDiskEditURL::~CDiskEditURL()
{
}
BOOL CDiskEditURL::OnInitDialog()
{
selectedItem = 0;
CDialog::OnInitDialog();
/*
DragAcceptFiles(TRUE);
CDialog* edit = (CDialog*)GetDlgItem(IDC_EDITURL);
ASSERT(edit);
edit->DragAcceptFiles(TRUE);
*/
return TRUE;
}
void CDiskEditURL::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
void CDiskEditURL::OnDropFiles()
{
/*
HDROP hDrop = (HDROP)wParam;
char filename[MAX_PATH];
DragQueryFile(hDrop, // Struture Identifier
0, // -1 to Drop more than one file or ( integer 0 to max )
// to drop selected No of files
filename,// Droped File Name
MAX_PATH); // Max char
*/
}
BEGIN_MESSAGE_MAP(CDiskEditURL, CDialog)
// ON_MESSAGE(WM_DROPFILES,OnDropFiles)// Message Handler for Drang and Drop
ON_CONTROL(WM_DROPFILES,IDC_EDITURL,OnDropFiles)
// ON_CONTROL(EN_UPDATE,IDC_EDITURL,OnDropFiles)
ON_BN_CLICKED(IDC_MOUNTBUTTON, &CDiskEditURL::OnBnClickedMountbutton)
ON_BN_CLICKED(IDC_EJECT, &CDiskEditURL::OnBnClickedEject)
ON_BN_CLICKED(IDC_RELOAD, &CDiskEditURL::OnBnClickedReload)
ON_NOTIFY(LVN_ITEMACTIVATE, IDC_SLOTLIST, &CDiskEditURL::OnLvnItemActivateSlotlist)
ON_NOTIFY(HDN_ITEMCLICK, 0, &CDiskEditURL::OnHdnItemclickSlotlist)
ON_BN_CLICKED(IDC_REBOOT5, &CDiskEditURL::OnBnClickedReboot5)
ON_BN_CLICKED(IDC_REBOOT6, &CDiskEditURL::OnBnClickedReboot6)
ON_BN_CLICKED(IDC_REBOOT7, &CDiskEditURL::OnBnClickedReboot7)
ON_BN_CLICKED(IDC_MOUNTBUTTON, &CDiskEditURL::OnBnClickedMountbutton)
ON_CBN_SELCHANGE(IDC_COMBOSLOT, &CDiskEditURL::OnCbnSelchangeComboslot)
ON_BN_CLICKED(IDC_FILESELECT, &CDiskEditURL::OnBnClickedFileselect)
ON_BN_CLICKED(IDC_SWAP, &CDiskEditURL::OnBnClickedSwap)
END_MESSAGE_MAP()
// CDiskEditURL message handlers
void CDiskEditURL::OnBnClickedMountbutton()
{
// TODO: Add your control notification handler code here
CDialog* edit = (CDialog*)GetDlgItem(IDC_EDITURL);
char path[MAX_PATH];
int l = Edit_GetLine(edit->m_hWnd,0,path,MAX_PATH);
path[l]=0;
int slot,drive;
if (getCurrentSlotAndDrive(slot,drive))
{
CEmulator::theEmulator->config->setSlot(slot,drive,path,REPLACECURRENT);
}
}
void CDiskEditURL::OnBnClickedEject()
{
int slot,drive;
if (!getCurrentSlotAndDrive(slot,drive)) return ;
CEmulator::theEmulator->ejectDisk(slot,drive);
}
void CDiskEditURL::OnBnClickedReload()
{
int slot,drive;
if (!getCurrentSlotAndDrive(slot,drive)) return ;
CEmulator::theEmulator->reloadDisk(slot,drive);
}
void CDiskEditURL::OnLvnItemActivateSlotlist(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pNMIA = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
// TODO: Add your control notification handler code here
/*
CListCtrl *pList = (CListCtrl*)GetDlgItem(IDC_SLOTLIST);
ASSERT(pList);
POSITION p = pList->GetFirstSelectedItemPosition();
if (!p) return ;
int i =pList->GetNextSelectedItem(p);
selectedItem = pList->GetItemData(i);
refreshItem();
*/
*pResult = 0;
}
int CDiskEditURL::getCurrentSlotAndDrive(int& slot, int &drive)
{
if (selectedItem==-1) return 0;
CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_COMBOSLOT);
int data = pCombo->GetItemData(selectedItem);
slot = data / 10;
drive = data %10;
return 1;
}
void CDiskEditURL::refresh()
{
CListCtrl *pList = (CListCtrl*)GetDlgItem(IDC_SLOTLIST);
if (pList)
{
pList->DeleteAllItems();
int nbi=0;
for(int slot=5;slot<=7;slot++)
{
int maxdrive=2;
if (slot==7) maxdrive=MAXSLOT7DRIVES;
for(int disk=1;disk<=maxdrive;disk++)
for(int active=0;active<ACTIVEGSMAXIMAGE;active++)
{
CSlotInfo info;
CEmulator* emu=CEmulator::theEmulator;
int ret = emu->getLocalMultipleIMGInfo(slot,disk,info,active);
if (!ret) continue;
if (info.status==UNDEFINED || info.status ==NOTHING) continue;
MyString str;
str.Format("S%dD%d",slot,disk);
if (ret==1)
str +="*";
pList->InsertItem(nbi,str.c_str());
// pList->SetItemData(nbi,(slot-5);
// pList->SetItemText(nbi,1,"e");
MyString shortname (info.shortname.c_str());
MyString sizeStr;
if (info.size>1*1024*1024)
sizeStr.Format(_T("%4dMb"),info.size/(1024*1024));
else
sizeStr.Format(_T("%4dKo"),info.size/1024);
MyString prefix;
switch(info.status)
{
case MOUNTED:
prefix = info.prefix.c_str();
break;
case EJECTED:
if (!info.filename.IsEmpty())
prefix = "*EJECTED*";
break;
case READY2MOUNT:
prefix = "*READY2MOUNT*";
shortname = getfile(info.url);
break;
case DELAYEDMOUNT:
prefix = "*DELAYEDMOUNT*";
shortname = getfile(info.url);
break;
case FAILED:
prefix ="*FAILED*";
break;
}
pList->SetItemText(nbi,1,shortname.c_str());
pList->SetItemText(nbi,2,sizeStr.c_str());
pList->SetItemText(nbi,3,prefix.c_str());
// pList->SetItemText(nbi,5,info.name);
nbi++;
}
}
}
// int slot = selectedItem;
BOOL beject = TRUE;
BOOL breload = TRUE;
BOOL bmount = TRUE;
BOOL bSwap = FALSE;
int slot,drive;
if (getCurrentSlotAndDrive(slot,drive))
{
const CSlotInfo& info = CEmulator::theEmulator->getLocalIMGInfo(slot,drive);
SetDlgItemText(IDC_EDITURL,info.url);
switch(info.status)
{
case UNDEFINED:
beject=FALSE;
breload=FALSE;
break;
case FAILED:
beject=FALSE;
breload=TRUE;
break;
case EJECTED:
beject=FALSE;
breload=TRUE;
break;
case READY2MOUNT:
case DELAYEDMOUNT:
beject=TRUE;
breload=FALSE;
break;
case MOUNTED:
beject=TRUE;
breload=FALSE;
}
int sw = CEmulator::theEmulator->getSmartSwap();
if ( ((sw/10) == slot) && ( (sw%10) == drive ) ) // OG A UNIFIER!!!!
bSwap = TRUE;
}
else
{
beject=FALSE;
breload=FALSE;
}
::EnableWindow(GetDlgItem(IDC_EJECT)->m_hWnd,beject);
::EnableWindow(GetDlgItem(IDC_RELOAD)->m_hWnd,breload);
::EnableWindow(GetDlgItem(IDC_MOUNTBUTTON)->m_hWnd,bmount);
::EnableWindow(GetDlgItem(IDC_SWAP)->m_hWnd,bSwap);
}
void CDiskEditURL::OnHdnItemclickSlotlist(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);
// TODO: Add your control notification handler code here
*pResult = 0;
}
void CDiskEditURL::OnBnClickedReboot5()
{
CEmulator::theEmulator->onBootSlotChanged(5);
}
void CDiskEditURL::OnBnClickedReboot6()
{
CEmulator::theEmulator->onBootSlotChanged(6);
}
void CDiskEditURL::OnBnClickedReboot7()
{
CEmulator::theEmulator->onBootSlotChanged(7);}
void CDiskEditURL::OnCbnSelchangeComboslot()
{
// TODO: Add your control notification handler code here
CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_COMBOSLOT);
selectedItem = pCombo->GetCurSel();
refresh();
// SetDlgItemText(IDC_EDITURL,l_strFileName);
}
void CDiskEditURL::OnBnClickedFileselect()
{
// CFileDialog l_SampleDlg(TRUE,NULL,NULL,OFN_OVERWRITEPROMPT,"2MG Images (*.img)|*.2mg|II Images (*.dsk)|*.dsk|II Images (*.nib)|*.nib|Archives (*.zip)|*.zip||");
CFileDialog l_SampleDlg(TRUE,NULL,NULL,OFN_OVERWRITEPROMPT,"Disk Image (*.img;*.dsk;*.nib;*.bin;*.zip)||");
int iRet = l_SampleDlg.DoModal();
CString l_strFileName;
l_strFileName = l_SampleDlg.GetPathName();
if(iRet == IDOK)
{
// CDialog* edit = (CDialog*)GetDlgItem(IDC_EDITURL);
SetDlgItemText(IDC_EDITURL,l_strFileName);
OnBnClickedMountbutton();
// MessageBox(l_strFileName);
// MessageBox(l_strFileName);
}
/*
else
MessageBox("No File Selected!");
*/
}
void CDiskEditURL::OnBnClickedSwap()
{
// int slot = selectedItem;
int slot,drive;
if (!getCurrentSlotAndDrive(slot,drive)) return ;
CEmulator::theEmulator->swapDisk(slot,drive);
}

View File

@ -0,0 +1,37 @@
#pragma once
// CDiskEditURL dialog
class CDiskEditURL : public CTabActiveInfo
{
DECLARE_DYNAMIC(CDiskEditURL)
public:
CDiskEditURL(CWnd* pParent = NULL); // standard constructor
virtual ~CDiskEditURL();
int selectedItem;
// Dialog Data
enum { IDD = IDD_TABDISKCONF };
virtual void refresh();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
void OnDropFiles();
BOOL OnInitDialog();
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedMountbutton();
afx_msg void OnBnClickedEject();
afx_msg void OnBnClickedReload();
afx_msg void OnLvnItemActivateSlotlist(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnHdnItemclickSlotlist(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnBnClickedReboot5();
afx_msg void OnBnClickedReboot6();
afx_msg void OnBnClickedReboot7();
// afx_msg void OnBnClickedMountbutton();
afx_msg void OnCbnSelchangeComboslot();
afx_msg void OnBnClickedFileselect();
afx_msg void OnBnClickedSwap();
int getCurrentSlotAndDrive(int& slot, int &drive);
};

498
Common.win32/HyperLink.cpp Normal file
View File

@ -0,0 +1,498 @@
// HyperLink.cpp : implementation file
//
// HyperLink static control. Will open the default browser with the given URL
// when the user clicks on the link.
//
// Copyright (C) 1997 - 1999 Chris Maunder
// All rights reserved. May not be sold for profit.
//
// Thanks to Pål K. Tønder for auto-size and window caption changes.
//
// "GotoURL" function by Stuart Patterson
// As seen in the August, 1997 Windows Developer's Journal.
// Copyright 1997 by Miller Freeman, Inc. All rights reserved.
// Modified by Chris Maunder to use TCHARs instead of chars.
//
// "Default hand cursor" from Paul DiLascia's Jan 1998 MSJ article.
//
// 2/29/00 -- P. Shaffer standard font mod.
#include "../Common.win32/stdafx.h"
#include "HyperLink.h"
#include "atlconv.h" // for Unicode conversion - requires #include <afxdisp.h> // MFC OLE automation classes
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define TOOLTIP_ID 1
/////////////////////////////////////////////////////////////////////////////
// CHyperLink
CHyperLink::CHyperLink()
{
m_hLinkCursor = NULL; // No cursor as yet
m_crLinkColour = RGB( 0, 0, 238); // Blue
// m_crVisitedColour = RGB( 85, 26, 139); // Purple
m_crVisitedColour = RGB( 0, 0, 238); // Purple
m_crHoverColour = RGB(255, 0, 0); // Red
m_bOverControl = FALSE; // Cursor not yet over control
m_bVisited = FALSE; // Hasn't been visited yet.
m_nUnderline = ulHover; // Underline the link?
m_bAdjustToFit = TRUE; // Resize the window to fit the text?
m_strURL.Empty();
m_nTimerID = 100;
}
CHyperLink::~CHyperLink()
{
m_UnderlineFont.DeleteObject();
}
/////////////////////////////////////////////////////////////////////////////
// CHyperLink overrides
BOOL CHyperLink::DestroyWindow()
{
KillTimer(m_nTimerID);
return CStatic::DestroyWindow();
}
BOOL CHyperLink::PreTranslateMessage(MSG* pMsg)
{
m_ToolTip.RelayEvent(pMsg);
return CStatic::PreTranslateMessage(pMsg);
}
void CHyperLink::PreSubclassWindow()
{
// We want to get mouse clicks via STN_CLICKED
DWORD dwStyle = GetStyle();
::SetWindowLong(GetSafeHwnd(), GWL_STYLE, dwStyle | SS_NOTIFY);
// Set the URL as the window text
if (m_strURL.IsEmpty())
GetWindowText(m_strURL);
// Check that the window text isn't empty. If it is, set it as the URL.
CString strWndText;
GetWindowText(strWndText);
if (strWndText.IsEmpty())
{
ASSERT(!m_strURL.IsEmpty()); // Window and URL both NULL. DUH!
SetWindowText(m_strURL);
}
CFont* pFont = GetFont();
if (!pFont)
{
HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
if (hFont == NULL)
hFont = (HFONT) GetStockObject(ANSI_VAR_FONT);
if (hFont)
pFont = CFont::FromHandle(hFont);
}
ASSERT(pFont->GetSafeHandle());
// Create the underline font
LOGFONT lf;
pFont->GetLogFont(&lf);
m_StdFont.CreateFontIndirect(&lf);
lf.lfUnderline = (BYTE) TRUE;
m_UnderlineFont.CreateFontIndirect(&lf);
PositionWindow(); // Adjust size of window to fit URL if necessary
SetDefaultCursor(); // Try and load up a "hand" cursor
SetUnderline(ulAlways);
// Create the tooltip
CRect rect;
GetClientRect(rect);
m_ToolTip.Create(this);
m_ToolTip.AddTool(this, m_strURL, rect, TOOLTIP_ID);
CStatic::PreSubclassWindow();
}
BEGIN_MESSAGE_MAP(CHyperLink, CStatic)
//{{AFX_MSG_MAP(CHyperLink)
ON_WM_CTLCOLOR_REFLECT()
ON_WM_SETCURSOR()
ON_WM_MOUSEMOVE()
ON_WM_TIMER()
ON_CONTROL_REFLECT(STN_CLICKED, OnClicked)
ON_WM_ERASEBKGND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CHyperLink message handlers
void CHyperLink::OnClicked()
{
m_bOverControl = FALSE;
int result = (int)GotoURL(m_strURL, SW_SHOW);
m_bVisited = (result > HINSTANCE_ERROR);
if (!m_bVisited)
{
MessageBeep(MB_ICONEXCLAMATION); // Unable to follow link
ReportError(result);
}
else
SetVisited(); // Repaint to show visited colour
}
HBRUSH CHyperLink::CtlColor(CDC* pDC, UINT nCtlColor)
{
ASSERT(nCtlColor == CTLCOLOR_STATIC);
if (m_bOverControl)
pDC->SetTextColor(m_crHoverColour);
else if (m_bVisited)
pDC->SetTextColor(m_crVisitedColour);
else
pDC->SetTextColor(m_crLinkColour);
// transparent text.
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
void CHyperLink::OnMouseMove(UINT nFlags, CPoint point)
{
if (!m_bOverControl) // Cursor has just moved over control
{
m_bOverControl = TRUE;
if (m_nUnderline == ulHover)
SetFont(&m_UnderlineFont);
Invalidate();
SetTimer(m_nTimerID, 100, NULL);
}
CStatic::OnMouseMove(nFlags, point);
}
void CHyperLink::OnTimer(UINT_PTR nIDEvent)
{
CPoint p(GetMessagePos());
ScreenToClient(&p);
CRect rect;
GetClientRect(rect);
if (!rect.PtInRect(p))
{
m_bOverControl = FALSE;
KillTimer(m_nTimerID);
if (m_nUnderline != ulAlways)
SetFont(&m_StdFont);
rect.bottom+=10;
InvalidateRect(rect);
}
CStatic::OnTimer(nIDEvent);
}
BOOL CHyperLink::OnSetCursor(CWnd* /*pWnd*/, UINT /*nHitTest*/, UINT /*message*/)
{
if (m_hLinkCursor)
{
::SetCursor(m_hLinkCursor);
return TRUE;
}
return FALSE;
}
BOOL CHyperLink::OnEraseBkgnd(CDC* pDC)
{
CRect rect;
GetClientRect(rect);
pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE));
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CHyperLink operations
void CHyperLink::SetURL(CString strURL)
{
m_strURL = strURL;
if (::IsWindow(GetSafeHwnd())) {
PositionWindow();
m_ToolTip.UpdateTipText(strURL, this, TOOLTIP_ID);
}
}
CString CHyperLink::GetURL() const
{
return m_strURL;
}
void CHyperLink::SetColours(COLORREF crLinkColour, COLORREF crVisitedColour,
COLORREF crHoverColour /* = -1 */)
{
m_crLinkColour = crLinkColour;
m_crVisitedColour = crVisitedColour;
if (crHoverColour == -1)
m_crHoverColour = ::GetSysColor(COLOR_HIGHLIGHT);
else
m_crHoverColour = crHoverColour;
if (::IsWindow(m_hWnd))
Invalidate();
}
COLORREF CHyperLink::GetLinkColour() const
{
return m_crLinkColour;
}
COLORREF CHyperLink::GetVisitedColour() const
{
return m_crVisitedColour;
}
COLORREF CHyperLink::GetHoverColour() const
{
return m_crHoverColour;
}
void CHyperLink::SetVisited(BOOL bVisited /* = TRUE */)
{
m_bVisited = bVisited;
if (::IsWindow(GetSafeHwnd()))
Invalidate();
}
BOOL CHyperLink::GetVisited() const
{
return m_bVisited;
}
void CHyperLink::SetLinkCursor(HCURSOR hCursor)
{
m_hLinkCursor = hCursor;
if (m_hLinkCursor == NULL)
SetDefaultCursor();
}
HCURSOR CHyperLink::GetLinkCursor() const
{
return m_hLinkCursor;
}
void CHyperLink::SetUnderline(int nUnderline /*=ulHover*/)
{
if (m_nUnderline == nUnderline)
return;
if (::IsWindow(GetSafeHwnd()))
{
if (nUnderline == ulAlways)
SetFont(&m_UnderlineFont);
else
SetFont(&m_StdFont);
Invalidate();
}
m_nUnderline = nUnderline;
}
int CHyperLink::GetUnderline() const
{
return m_nUnderline;
}
void CHyperLink::SetAutoSize(BOOL bAutoSize /* = TRUE */)
{
m_bAdjustToFit = bAutoSize;
if (::IsWindow(GetSafeHwnd()))
PositionWindow();
}
BOOL CHyperLink::GetAutoSize() const
{
return m_bAdjustToFit;
}
// Move and resize the window so that the window is the same size
// as the hyperlink text. This stops the hyperlink cursor being active
// when it is not directly over the text. If the text is left justified
// then the window is merely shrunk, but if it is centred or right
// justified then the window will have to be moved as well.
//
// Suggested by Pål K. Tønder
void CHyperLink::PositionWindow()
{
if (!::IsWindow(GetSafeHwnd()) || !m_bAdjustToFit)
return;
// Get the current window position
CRect WndRect, ClientRect;
GetWindowRect(WndRect);
GetClientRect(ClientRect);
ClientToScreen(ClientRect);
CWnd* pParent = GetParent();
if (pParent)
{
pParent->ScreenToClient(WndRect);
pParent->ScreenToClient(ClientRect);
}
// Get the size of the window text
CString strWndText;
GetWindowText(strWndText);
CDC* pDC = GetDC();
CFont* pOldFont = pDC->SelectObject(&m_UnderlineFont);
CSize Extent = pDC->GetTextExtent(strWndText);
pDC->SelectObject(pOldFont);
ReleaseDC(pDC);
// Adjust for window borders
Extent.cx += WndRect.Width() - ClientRect.Width();
Extent.cy += WndRect.Height() - ClientRect.Height();
// Get the text justification via the window style
DWORD dwStyle = GetStyle();
// Recalc the window size and position based on the text justification
if (dwStyle & SS_CENTERIMAGE)
WndRect.DeflateRect(0, (WndRect.Height() - Extent.cy)/2);
else
WndRect.bottom = WndRect.top + Extent.cy;
if (dwStyle & SS_CENTER)
WndRect.DeflateRect((WndRect.Width() - Extent.cx)/2, 0);
else if (dwStyle & SS_RIGHT)
WndRect.left = WndRect.right - Extent.cx;
else // SS_LEFT = 0, so we can't test for it explicitly
WndRect.right = WndRect.left + Extent.cx;
// Move the window
SetWindowPos(NULL, WndRect.left, WndRect.top, WndRect.Width(), WndRect.Height(), SWP_NOZORDER);
}
/////////////////////////////////////////////////////////////////////////////
// CHyperLink implementation
// The following appeared in Paul DiLascia's Jan 1998 MSJ articles.
// It loads a "hand" cursor from the winhlp32.exe module
void CHyperLink::SetDefaultCursor()
{
if (m_hLinkCursor == NULL) // No cursor handle - load our own
{
/*
// Get the windows directory
CString strWndDir;
GetWindowsDirectory(strWndDir.GetBuffer(MAX_PATH), MAX_PATH);
strWndDir.ReleaseBuffer();
strWndDir += _T("\\winhlp32.exe");
// This retrieves cursor #106 from winhlp32.exe, which is a hand pointer
HMODULE hModule = LoadLibrary(strWndDir);
if (hModule) {
HCURSOR hHandCursor = ::LoadCursor(hModule, MAKEINTRESOURCE(106));
if (hHandCursor)
m_hLinkCursor = CopyCursor(hHandCursor);
}
FreeLibrary(hModule);
*/
}
}
LONG CHyperLink::GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata)
{
HKEY hkey;
LONG retval = RegOpenKeyEx(key, subkey, 0, KEY_QUERY_VALUE, &hkey);
if (retval == ERROR_SUCCESS) {
long datasize = MAX_PATH;
TCHAR data[MAX_PATH];
RegQueryValue(hkey, NULL, data, &datasize);
lstrcpy(retdata,data);
RegCloseKey(hkey);
}
return retval;
}
void CHyperLink::ReportError(int nError)
{
CString str;
switch (nError) {
case 0: str = "The operating system is out\nof memory or resources."; break;
case SE_ERR_PNF: str = "The specified path was not found."; break;
case SE_ERR_FNF: str = "The specified file was not found."; break;
case ERROR_BAD_FORMAT: str = "The .EXE file is invalid\n(non-Win32 .EXE or error in .EXE image)."; break;
case SE_ERR_ACCESSDENIED: str = "The operating system denied\naccess to the specified file."; break;
case SE_ERR_ASSOCINCOMPLETE: str = "The filename association is\nincomplete or invalid."; break;
case SE_ERR_DDEBUSY: str = "The DDE transaction could not\nbe completed because other DDE transactions\nwere being processed."; break;
case SE_ERR_DDEFAIL: str = "The DDE transaction failed."; break;
case SE_ERR_DDETIMEOUT: str = "The DDE transaction could not\nbe completed because the request timed out."; break;
case SE_ERR_DLLNOTFOUND: str = "The specified dynamic-link library was not found."; break;
case SE_ERR_NOASSOC: str = "There is no application associated\nwith the given filename extension."; break;
case SE_ERR_OOM: str = "There was not enough memory to complete the operation."; break;
case SE_ERR_SHARE: str = "A sharing violation occurred. ";
default: str.Format(_T("Unknown Error (%d) occurred."), nError); break;
}
str = "Unable to open hyperlink:\n\n" + str;
AfxMessageBox(str, MB_ICONEXCLAMATION | MB_OK);
}
HINSTANCE CHyperLink::GotoURL(LPCTSTR url, int showcmd)
{
TCHAR key[MAX_PATH + MAX_PATH];
// First try ShellExecute()
HINSTANCE result = ShellExecute(NULL, _T("open"), url, NULL,NULL, showcmd);
// If it failed, get the .htm regkey and lookup the program
if ((UINT)result <= HINSTANCE_ERROR) {
if (GetRegKey(HKEY_CLASSES_ROOT, _T(".htm"), key) == ERROR_SUCCESS) {
lstrcat(key, _T("\\shell\\open\\command"));
if (GetRegKey(HKEY_CLASSES_ROOT,key,key) == ERROR_SUCCESS) {
TCHAR *pos;
pos = _tcsstr(key, _T("\"%1\""));
if (pos == NULL) { // No quotes found
pos = _tcsstr(key, _T("%1")); // Check for %1, without quotes
if (pos == NULL) // No parameter at all...
pos = key+lstrlen(key)-1;
else
*pos = '\0'; // Remove the parameter
}
else
*pos = '\0'; // Remove the parameter
lstrcat(pos, _T(" "));
lstrcat(pos, url);
USES_CONVERSION;
result = (HINSTANCE) WinExec(T2A(key),showcmd);
}
}
}
return result;
}

106
Common.win32/HyperLink.h Normal file
View File

@ -0,0 +1,106 @@
// HyperLink.h : header file
//
//
// HyperLink static control. Will open the default browser with the given URL
// when the user clicks on the link.
//
// Copyright Chris Maunder, 1997-1999 (cmaunder@mail.com)
// Feel free to use and distribute. May not be sold for profit.
// 2/29/00 -- P. Shaffer standard font mod.
#if !defined(AFX_HYPERLINK_H__D1625061_574B_11D1_ABBA_00A0243D1382__INCLUDED_)
#define AFX_HYPERLINK_H__D1625061_574B_11D1_ABBA_00A0243D1382__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
/////////////////////////////////////////////////////////////////////////////
// CHyperLink window
class CHyperLink : public CStatic
{
// Construction/destruction
public:
CHyperLink();
virtual ~CHyperLink();
public:
enum UnderLineOptions { ulHover = -1, ulNone = 0, ulAlways = 1};
// Attributes
public:
void SetURL(CString strURL);
CString GetURL() const;
void SetColours(COLORREF crLinkColour, COLORREF crVisitedColour,
COLORREF crHoverColour = -1);
COLORREF GetLinkColour() const;
COLORREF GetVisitedColour() const;
COLORREF GetHoverColour() const;
void SetVisited(BOOL bVisited = TRUE);
BOOL GetVisited() const;
void SetLinkCursor(HCURSOR hCursor);
HCURSOR GetLinkCursor() const;
void SetUnderline(int nUnderline = ulHover);
int GetUnderline() const;
void SetAutoSize(BOOL bAutoSize = TRUE);
BOOL GetAutoSize() const;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHyperLink)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
virtual BOOL DestroyWindow();
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUAL
// Implementation
protected:
HINSTANCE GotoURL(LPCTSTR url, int showcmd);
void ReportError(int nError);
LONG GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata);
void PositionWindow();
void SetDefaultCursor();
// Protected attributes
protected:
COLORREF m_crLinkColour, m_crVisitedColour; // Hyperlink colours
COLORREF m_crHoverColour; // Hover colour
BOOL m_bOverControl; // cursor over control?
BOOL m_bVisited; // Has it been visited?
int m_nUnderline; // underline hyperlink?
BOOL m_bAdjustToFit; // Adjust window size to fit text?
CString m_strURL; // hyperlink URL
CFont m_UnderlineFont; // Font for underline display
CFont m_StdFont; // Standard font
HCURSOR m_hLinkCursor; // Cursor for hyperlink
CToolTipCtrl m_ToolTip; // The tooltip
UINT m_nTimerID;
// Generated message map functions
protected:
//{{AFX_MSG(CHyperLink)
afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
afx_msg void OnClicked();
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_HYPERLINK_H__D1625061_574B_11D1_ABBA_00A0243D1382__INCLUDED_)

View File

@ -0,0 +1,38 @@
// SliderZip.cpp : fichier d'implémentation
//
#include "../common.win32/stdafx.h"
#include "activecommon.h"
#include "SliderZip.h"
#include "../kegs/src/moremem.h"
// Boîte de dialogue CSliderZip
IMPLEMENT_DYNAMIC(CSliderZip, CSliderCtrl)
CSliderZip::CSliderZip(CWnd* pParent /*=NULL*/)
: CSliderCtrl()
{
}
CSliderZip::~CSliderZip()
{
}
void CSliderZip::DoDataExchange(CDataExchange* pDX)
{
CSliderCtrl::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CSliderZip, CSliderCtrl)
ON_NOTIFY_REFLECT(NM_RELEASEDCAPTURE, OnNMReleasedcapture)
END_MESSAGE_MAP()
// Gestionnaires de messages CSliderZip
void CSliderZip::OnNMReleasedcapture(NMHDR *pNMHDR, LRESULT *pResult)
{
g_moremem.g_zipgs_reg_c05a = ((15-(GetPos() & 0x0F))<< 4 )|(g_moremem.g_zipgs_reg_c05a&0x0F);
*pResult = 0;
}

27
Common.win32/SliderZip.h Normal file
View File

@ -0,0 +1,27 @@
#pragma once
// Boîte de dialogue CSliderZip
class CSliderZip : public CSliderCtrl
{
DECLARE_DYNAMIC(CSliderZip)
public:
CSliderZip(CWnd* pParent = NULL); // constructeur standard
virtual ~CSliderZip();
// Données de boîte de dialogue
enum { IDD = IDD_TABRUNTIME };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // Prise en charge DDX/DDV
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnNMReleasedcapture(NMHDR *pNMHDR, LRESULT *pResult);
protected:
};

View File

@ -0,0 +1,67 @@
// TabGeneral.cpp : fichier d'implémentation
//
#include "../Common.win32/stdafx.h"
#include "activecommon.h"
#include "tabgeneral.h"
// Boîte de dialogue CTabGeneral
IMPLEMENT_DYNAMIC(CTabGeneral, CDialog)
CTabGeneral::CTabGeneral(CWnd* pParent /*=NULL*/)
: CTabActiveInfo(CTabGeneral::IDD, pParent)
{
HCURSOR hHand = NULL;
}
CTabGeneral::~CTabGeneral()
{
if (hHand)
DeleteObject(hHand);
}
void CTabGeneral::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_URLOG, urlOG);
DDX_Control(pDX, IDC_URLKD, m_urlKD);
// DDX_Control(pDX, IDC_URLTD, urlTD);
DDX_Control(pDX, IDC_URLFTA, urlFTA);
}
BEGIN_MESSAGE_MAP(CTabGeneral, CDialog)
ON_STN_CLICKED(IDC_URLKD2, &CTabGeneral::OnStnClickedUrlkd2)
END_MESSAGE_MAP()
// Gestionnaires de messages CTabGeneral
BOOL CTabGeneral::OnInitDialog()
{
CDialog::OnInitDialog();
CEmulatorWin32* pEmu = (CEmulatorWin32*)CEmulator::theEmulator;
if (pEmu)
hHand = LoadCursor(pEmu->hInst,MAKEINTRESOURCE(IDC_CURSOR1));
m_urlKD.SetURL("mailto:kadickey@alumni.princeton.edu");
m_urlKD.SetLinkCursor(hHand);
urlOG.SetURL("mailto:o@goguel.com");
urlOG.SetLinkCursor(hHand);
// urlTD.SetURL("mailto:tdracz@artpol.com.pl");
urlFTA.SetURL("http://activegs.freetoolsassociation.com");
urlFTA.SetLinkCursor(hHand);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION : les pages de propriétés OCX devraient retourner FALSE
}
void CTabGeneral::OnStnClickedUrlkd2()
{
// TODO: ajoutez ici le code de votre gestionnaire de notification de contrôle
}

29
Common.win32/TabGeneral.h Normal file
View File

@ -0,0 +1,29 @@
#pragma once
#include "hyperlink.h"
// Boîte de dialogue CTabGeneral
class CTabGeneral : public CTabActiveInfo
{
DECLARE_DYNAMIC(CTabGeneral)
public:
CTabGeneral(CWnd* pParent = NULL); // constructeur standard
virtual ~CTabGeneral();
HCURSOR hHand;
// Données de boîte de dialogue
enum { IDD = IDD_TABGENERAL };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // Prise en charge DDX/DDV
DECLARE_MESSAGE_MAP()
public:
CHyperLink urlOG;
virtual BOOL OnInitDialog();
CHyperLink m_urlKD;
CHyperLink urlTD;
CHyperLink urlFTA;
afx_msg void OnStnClickedUrlkd2();
};

123
Common.win32/TabOption.cpp Normal file
View File

@ -0,0 +1,123 @@
// TabOption.cpp : fichier d'implémentation
//
#include "../Common.win32/stdafx.h"
#include "activecommon.h"
#include "taboption.h"
// Boîte de dialogue CTabOption
IMPLEMENT_DYNAMIC(CTabOption, CDialog)
CTabOption::CTabOption(CWnd* pParent /*=NULL*/)
: CTabActiveInfo(CTabOption::IDD, pParent)
{
}
CTabOption::~CTabOption()
{
}
void CTabOption::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CTabOption, CDialog)
ON_BN_CLICKED(IDC_NOIECACHE, OnBnClickedNoiecache)
ON_BN_CLICKED(IDC_HALTBADREAD, OnBnClickedHaltbadread)
ON_BN_CLICKED(IDC_HALTBADACCESS, OnBnClickedHaltbadaccess)
ON_BN_CLICKED(IDC_HALTEVENT, OnBnClickedHaltevent)
ON_BN_CLICKED(IDC_DEFAULTOPTIONS, OnBnClickedDefaultoptions)
ON_BN_CLICKED(IDC_DISABLEREWIND, &CTabOption::OnBnClickedDisablerewind)
END_MESSAGE_MAP()
BOOL CTabOption::OnInitDialog()
{
CDialog::OnInitDialog();
initOptionDialog();
return TRUE;
}
void CTabOption::initOptionDialog()
{
CButton *pButton = (CButton*)GetDlgItem(IDC_NOIECACHE);
pButton->SetCheck(1); //pEmu->option.getIntValue(OPTION_PERSISTENTDIR));
pButton->EnableWindow(0);
pButton = (CButton*)GetDlgItem(IDC_HALTBADREAD);
pButton->SetCheck(option.getIntValue(OPTION_HALTONBADREAD));
pButton = (CButton*)GetDlgItem(IDC_HALTBADACCESS);
pButton->SetCheck(option.getIntValue(OPTION_HALTONBADACC));
pButton = (CButton*)GetDlgItem(IDC_HALTEVENT);
pButton->SetCheck(option.getIntValue(OPTION_HALTONHALTS));
pButton = (CButton*)GetDlgItem(IDC_ENABLEREWIND);
pButton->SetCheck(option.getIntValue(OPTION_ENABLEREWIND));
CWnd *pWnd = (CWnd*)GetDlgItem(IDC_PERSISTENT);
pWnd->SetWindowText(CDownload::getPersistentPath());
}
void CTabOption::OnBnClickedNoiecache()
{
}
void CTabOption::OnBnClickedHaltbadread()
{
// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
CButton *pButton = (CButton*)GetDlgItem(IDC_HALTBADREAD);
if (!pButton) return ;
int ck = pButton->GetCheck();
option.setIntValue(OPTION_HALTONBADREAD,ck);
option.saveOptions(1);
}
void CTabOption::OnBnClickedHaltbadaccess()
{
// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
CButton *pButton = (CButton*)GetDlgItem(IDC_HALTBADACCESS);
if (!pButton) return ;
int ck = pButton->GetCheck();
option.setIntValue(OPTION_HALTONBADACC,ck);
option.saveOptions(1);
}
void CTabOption::OnBnClickedHaltevent()
{
// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
CButton *pButton = (CButton*)GetDlgItem(IDC_HALTEVENT);
if (!pButton) return ;
int ck = pButton->GetCheck();
option.setIntValue(OPTION_HALTONHALTS,ck);
option.saveOptions(1);
}
void CTabOption::OnBnClickedDefaultoptions()
{
option.setDefaultOptions();
option.saveOptions(1);
initOptionDialog();
}
void CTabOption::OnBnClickedDisablerewind()
{
CButton *pButton = (CButton*)GetDlgItem(IDC_ENABLEREWIND);
if (!pButton) return ;
int ck = pButton->GetCheck();
option.setIntValue(OPTION_ENABLEREWIND,ck);
option.saveOptions(1);
}

30
Common.win32/TabOption.h Normal file
View File

@ -0,0 +1,30 @@
#pragma once
// Boîte de dialogue CTabOption
class CTabOption : public CTabActiveInfo
{
DECLARE_DYNAMIC(CTabOption)
public:
CTabOption(CWnd* pParent = NULL); // constructeur standard
virtual ~CTabOption();
// Données de boîte de dialogue
enum { IDD = IDD_TABOPTION };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // Prise en charge DDX/DDV
void initOptionDialog();
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
afx_msg void OnBnClickedNoiecache();
afx_msg void OnBnClickedHaltbadread();
afx_msg void OnBnClickedHaltbadaccess();
afx_msg void OnBnClickedHaltevent();
afx_msg void OnBnClickedDefaultoptions();
afx_msg void OnBnClickedHaltbadread2();
afx_msg void OnBnClickedDisablerewind();
};

298
Common.win32/TabRuntime.cpp Normal file
View File

@ -0,0 +1,298 @@
// TabRuntime.cpp : fichier d'implémentation
//
#include "../Common.win32/stdafx.h"
#include "activecommon.h"
#include "tabruntime.h"
#include "../common/ki.h"
#include "sliderzip.h"
#include "../kegs/src/defcomm.h"
#include "../kegs/src/moremem.h"
#include "../kegs/src/paddles.h"
#include "../kegs/src/sim65816.h"
#include "../kegs/src/saveState.h"
#include "../kegs/src/video.h"
// Boîte de dialogue CTabRuntime
IMPLEMENT_DYNAMIC(CTabRuntime, CDialog)
CTabRuntime::CTabRuntime(CWnd* pParent /*=NULL*/)
: CTabActiveInfo(CTabRuntime::IDD, pParent)
{
}
CTabRuntime::~CTabRuntime()
{
}
void CTabRuntime::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_ZIPSLIDER, m_SliderZip);
}
BEGIN_MESSAGE_MAP(CTabRuntime, CDialog)
ON_CBN_SELCHANGE(IDC_SPEEDMODE, OnCbnSelchangeSpeedmode)
ON_CBN_DROPDOWN(IDC_SPEEDMODE, OnCbnDropdownSpeedmode)
ON_CBN_CLOSEUP(IDC_SPEEDMODE, OnCbnCloseupSpeedmode)
ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnNeedText )
ON_CBN_SELCHANGE(IDC_JOYSTICK, OnCbnSelchangeJoystick)
ON_BN_CLICKED(IDC_CONSOLEBUTTON3, OnBnClickedConsolebutton)
ON_BN_CLICKED(IDC_PAUSE, OnBnClickedButton1)
ON_BN_CLICKED(IDC_CONSOLEBUTTON2, &CTabRuntime::OnBnClickedConsolebutton2)
ON_BN_CLICKED(IDC_SAVESTATE, &CTabRuntime::OnBnClickedSavestate)
ON_BN_CLICKED(IDC_RESTORESTATE, &CTabRuntime::OnBnClickedRestorestate)
ON_CBN_SELCHANGE(IDC_VIDEOFX, &CTabRuntime::OnCbnSelchangeVideofx)
ON_CBN_SELCHANGE(IDC_COLORMODE, &CTabRuntime::OnCbnSelchangeColormode)
END_MESSAGE_MAP()
// Gestionnaires de messages CTabRuntime
void fillCombo(CComboBox *_combo,option_id _id,int _cur)
{
int pos=0;
int i=0;
const char* s;
namevalue& nv = option.find(_id);
while(s=nv.def->convertTableDesc[i])
{
_combo->InsertString(pos,s);
_combo->SetItemData(pos,nv.def->convertTableInt[i]);
pos++;
i++;
}
int o = nv.getOrder(_cur);
_combo->SetCurSel(o);
}
BOOL CTabRuntime::OnInitDialog()
{
CDialog::OnInitDialog();
CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_SPEEDMODE);
fillCombo(pCombo,OPTION_SPEED,g_sim65816.get_limit_speed());
/*CComboBox * */pCombo = (CComboBox*)GetDlgItem(IDC_COLORMODE);
fillCombo(pCombo,OPTION_COLORMODE,r_sim65816.get_color_mode());
/*CComboBox * */pCombo = (CComboBox*)GetDlgItem(IDC_VIDEOFX);
fillCombo(pCombo,OPTION_VIDEOFX,r_sim65816.get_video_fx());
CSliderCtrl *pSlider = (CSliderCtrl*)GetDlgItem(IDC_ZIPSLIDER);
pSlider->SetRange(0,15);
pSlider->SetPos(g_moremem.g_zipgs_reg_c05a&0x0F);
CComboBox *pComboJoy = (CComboBox*)GetDlgItem(IDC_JOYSTICK);
fillCombo(pComboJoy,OPTION_JOYSTICKMODE,g_joystick_type);
CComboBox *pComboState = (CComboBox*)GetDlgItem(IDC_STATE);
for(int i=0;i<5;i++)
{
MyString str;
int state_id = i;
if (state_id==0)
str = "Mem";
else
str.Format("#%d",state_id);
pComboState->InsertString(i,str.c_str());
pComboState->SetItemData(i,state_id);
}
pComboState->SetCurSel(0);
enableSpeedChange=true;
OnCbnSelchangeSpeedmode();
refresh();
setPauseText();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION : les pages de propriétés OCX devraient retourner FALSE
}
void CTabRuntime::OnCbnSelchangeSpeedmode()
{
CComboBox *pCombo = (CComboBox*)GetDlgItem(IDC_SPEEDMODE);
int sel = pCombo->GetCurSel();
int sp = pCombo->GetItemData(sel);
CEmulator* emu = CEmulator::theEmulator ;
emu->onSpeedChanged(sp);
if (enableSpeedChange)
{
CWnd *pSlider = (CWnd*)GetDlgItem(IDC_ZIPSLIDER);
pSlider->EnableWindow(g_sim65816.get_limit_speed() == SPEED_ZIP?SW_SHOW:SW_HIDE);
}
}
void CTabRuntime::OnCbnDropdownSpeedmode()
{
enableSpeedChange=false;
}
void CTabRuntime::OnCbnCloseupSpeedmode()
{
enableSpeedChange=true;
}
BOOL CTabRuntime::OnNeedText( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
CSliderCtrl *pSlider = (CSliderCtrl*)GetDlgItem(IDC_ZIPSLIDER);
if (pSlider)
{
CString string;
string.Format("%3d%%", (pSlider->GetPos()+1)*100/16);
::lstrcpy(pTTT->szText, (LPCTSTR) string);
return TRUE;
}
return FALSE;
}
void CTabRuntime::refresh()
{
CComboBox *pComboJoy = (CComboBox*)GetDlgItem(IDC_JOYSTICK);
namevalue& nv = option.find(OPTION_JOYSTICKMODE);
int sel = nv.getOrder(g_joystick_type);
pComboJoy->SetCurSel(sel);
}
int toggleJoystick(int _force);
void CTabRuntime::OnCbnSelchangeJoystick()
{
CComboBox *pComboJoy = (CComboBox*)GetDlgItem(IDC_JOYSTICK);
int sel = pComboJoy->GetCurSel();
int joy = pComboJoy->GetItemData(sel);
option.setIntValue(OPTION_JOYSTICKMODE,joy);
outputInfo("switching to %s\n",option.getDescription(OPTION_JOYSTICKMODE,joy));
option.saveOptions(1);
refresh();
}
void CTabRuntime::OnBnClickedConsolebutton()
{
CConsole* c = ((CEmulatorWin32*)CEmulator::theEmulator)->theConsole;
if (c)
c->toggleConsole();
}
void CTabRuntime::setPauseText()
{
CWnd *pWnd = (CWnd*)GetDlgItem(IDC_PAUSE);
if (pWnd)
{/*
if (r_sim65816.get_state() == IN_PAUSE )
pWnd->SetWindowText("Resume");
else
pWnd->SetWindowText("Pause");
*/
pWnd->SetWindowText("Pause/Resume");
}
}
void CTabRuntime::OnBnClickedButton1()
{
if (r_sim65816.get_state()==IN_PAUSE)
r_sim65816.resume();
else
if (r_sim65816.get_state()==RUNNING)
r_sim65816.pause();
else
{
printf("emulator not running nor in pause...\n");
return ;
}
setPauseText();
}
void CTabRuntime::OnBnClickedConsolebutton2()
{
CEmulator*pEmu = CEmulator::theEmulator;
if (!pEmu)
return ;
MyString ret;
pEmu->processCommand("screenshot",ret);
::MessageBox(NULL,ret.c_str(),"Screenshot saved",MB_OK);
}
void CTabRuntime::getStateFilename(MyString& filename)
{
CComboBox *pComboState = (CComboBox*)GetDlgItem(IDC_STATE);
int s = pComboState->GetCurSel();
int id = pComboState->GetItemData(s);
if (id==0)
return ;
filename = CDownload::getPersistentPath();
filename += ACTIVEGS_DIRECTORY_SEPARATOR;
MyString f;
f.Format( "state_%d.state",id);
filename += f;
}
void CTabRuntime::OnBnClickedSavestate()
{
MyString path;
getStateFilename(path);
g_savestate.saveState(path.c_str());
}
void CTabRuntime::OnBnClickedRestorestate()
{
MyString path;
getStateFilename(path);
g_savestate.restoreState(path.c_str());
}
void CTabRuntime::OnCbnSelchangeVideofx()
{
CComboBox *pComboJoy = (CComboBox*)GetDlgItem(IDC_VIDEOFX);
int vfx = pComboJoy->GetCurSel();
int vfxdata = pComboJoy->GetItemData(vfx);
option.setIntValue(OPTION_VIDEOFX,vfxdata);
option.saveOptions(1);
x_refresh_video();
}
void CTabRuntime::OnCbnSelchangeColormode()
{
CComboBox *pComboJoy = (CComboBox*)GetDlgItem(IDC_COLORMODE);
int cm = pComboJoy->GetCurSel();
int cmdata = pComboJoy->GetItemData(cm);
option.setIntValue(OPTION_COLORMODE,cmdata);
option.saveOptions(1);
x_refresh_video();
}

45
Common.win32/TabRuntime.h Normal file
View File

@ -0,0 +1,45 @@
#pragma once
#include "sliderzip.h"
#include "../Kegs/Src/StdString.h"
// Boîte de dialogue CTabRuntime
class CTabRuntime : public CTabActiveInfo
{
DECLARE_DYNAMIC(CTabRuntime)
void getStateFilename(MyString& filename);
public:
CTabRuntime(CWnd* pParent = NULL); // constructeur standard
virtual ~CTabRuntime();
bool enableSpeedChange;
// Données de boîte de dialogue
enum { IDD = IDD_TABRUNTIME };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // Prise en charge DDX/DDV
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
afx_msg void OnCbnSelchangeSpeedmode();
CSliderZip m_SliderZip;
afx_msg void OnCbnDropdownSpeedmode();
afx_msg void OnCbnCloseupSpeedmode();
BOOL OnNeedText( UINT id, NMHDR * pTTTStruct, LRESULT * pResult );
virtual void refresh();
void setPauseText();
afx_msg void OnCbnSelchangeJoystick();
afx_msg void OnBnClickedConsolebutton();
afx_msg void OnBnClickedButton1();
afx_msg void OnBnClickedConsolebutton2();
afx_msg void OnBnClickedSavestate();
afx_msg void OnBnClickedRestorestate();
afx_msg void OnCbnSelchangeVideofx();
afx_msg void OnCbnSelchangeColormode();
afx_msg void OnBnClickedConsolebutton3();
};

122
Common.win32/TabXml.cpp Normal file
View File

@ -0,0 +1,122 @@
// TabOption.cpp : fichier d'implémentation
//
#include "../Common.win32/stdafx.h"
#include "activecommon.h"
#include "tabxml.h"
// Boîte de dialogue CTabOption
IMPLEMENT_DYNAMIC(CTabXML, CDialog)
CTabXML::CTabXML(CWnd* pParent /*=NULL*/)
: CTabActiveInfo(CTabXML::IDD, pParent)
{
}
CTabXML::~CTabXML()
{
}
void CTabXML::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_MULTIPLENAME, urlName);
DDX_Control(pDX, IDC_MULTIPLEPUBLISHER, urlPublisher);
}
BEGIN_MESSAGE_MAP(CTabXML, CDialog)
ON_BN_CLICKED(IDC_MULTIPLESWAP, OnBnClickedSwap)
END_MESSAGE_MAP()
/*
BOOL CTabOption::OnInitDialog()
{
CDialog::OnInitDialog();
initOptionDialog();
return TRUE;
}
*/
void CTabXML::OnBnClickedSwap()
{
CEmulator* emu = CEmulator::theEmulator ;
if (!emu) return ;
emu->smartSwap();
}
void CTabXML::refresh()
{
CEmulator* emu = CEmulator::theEmulator;
if (!emu) return ;
/*
const char * name = "*Custom Config*";
const char * publisher = "";
const char * year = "";
const char * nameurl = NULL;
const char * publisherurl = NULL;
MyString swapdisk = "*not available*";
int swapdiskenable = 0;
if (emu->config->pure)
{
name = emu->config->name.c_str();
year = emu->config->year.c_str();
publisher = emu->config->publisher.c_str();
nameurl = emu->config->nameurl.c_str();
publisherurl = emu->config->publisherurl.c_str();
int smart = emu->getSmartSwap();
if (smart)
{
CSlotInfo ref = emu->getLocalIMGInfo(smart/10,smart%10);
if (ref.status == DELAYEDMOUNT)
swapdisk.Format("*%s*",ref.shortname.c_str());
else
swapdisk = ref.shortname.c_str();
swapdiskenable=1;
}
}
CWnd* pText = GetDlgItem(IDC_MULTIPLENAME);
if (nameurl && nameurl[0])
{
urlName.SetURL(nameurl);
urlName.SetWindowText(name);
if (pText)
pText->SetWindowText(NULL);
}
else
{
if (pText)
pText->SetWindowText(name);
}
if( publisherurl && publisherurl[0])
urlPublisher.SetURL(publisherurl);
urlPublisher.SetWindowText(publisher);
pText = GetDlgItem(IDC_MULTIPLEYEAR);
if (pText)
pText->SetWindowText(year);
pText = GetDlgItem(IDC_MULTIPLEPUBLISHER);
if (pText)
pText->SetWindowText(publisher);
pText = GetDlgItem(IDC_MULTIPLECURRENT);
if (pText)
pText->SetWindowText(swapdisk.c_str());
CWnd *swapbutton = GetDlgItem(IDC_MULTIPLESWAP);
if (swapbutton)
::EnableWindow(swapbutton->m_hWnd,swapdiskenable);
*/
}

29
Common.win32/TabXml.h Normal file
View File

@ -0,0 +1,29 @@
#pragma once
// Boîte de dialogue CTabXML
class CTabXML : public CTabActiveInfo
{
DECLARE_DYNAMIC(CTabXML)
public:
CTabXML(CWnd* pParent = NULL); // constructeur standard
virtual ~CTabXML();
// Données de boîte de dialogue
enum { IDD = IDD_TABXML };
CHyperLink urlName;
CHyperLink urlPublisher;
protected:
virtual void DoDataExchange(CDataExchange* pDX); // Prise en charge DDX/DDV
void initOptionDialog();
DECLARE_MESSAGE_MAP()
public:
// virtual BOOL OnInitDialog();
afx_msg void OnBnClickedSwap();
virtual void refresh();
};

114
Common.win32/activecommon.h Normal file
View File

@ -0,0 +1,114 @@
#pragma once
#include "stdafx.h"
#include "../Common/CEmulatorCtrl.h"
#ifndef UNDER_CE
#include "activeinfo.h"
#include "activecommonres.h" // main symbols
#include "activestatus.h"
#endif
//#define FTAURL "http://www.freetoolsassociation.com/stat/stat.php?ver=2,0,0,11"
bool retrieveProgramFilesPath(MyString& path);
#define HIST_DEFAULT_LIMIT 262144
HCURSOR CreateAlphaCursor(HINSTANCE hInst);
struct CConsole
{
CConsole* theConsole;
HMODULE mod;
HWND hWnd;
HWND hWndParent;
int visible;
char ConsoleHistory[HIST_DEFAULT_LIMIT];
int HistorySize;
int BufferSize;
int kNbVisibleLinesInEditCtrl;
int enable;
char inputBuffer[256];
WNDPROC OldProc;
HFONT hFont;
CConsole();
~CConsole();
void showConsole();
void hideConsole();
void initConsole(HINSTANCE hInst,HWND hWnd);
void shutConsole(HWND);
void toggleConsole();
void addLine(const char* buf);
void enableConsole();
void disableConsole();
int read(char* buf);
void refreshLine();
};
const int DEFAULTCONFIGPARAM = -1000;
class CEmulatorWin32 : public CEmulator
{
public:
#ifndef UNDER_CE
CConsole* theConsole;
CActiveInfo* activeInfo;
CActiveStatus* wStatus;
CActiveStatus* wLoading;
CBitmap wLoadingBitmap[4];
HCURSOR hAlphaCursor;
#endif
HANDLE hThread;
HWND m_hWnd;
HMODULE mod;
HHOOK hhkLowLevelKybd;
void enableSystemKeys();
void disableSystemKeys();
int hasFocus();
static DWORD WINAPI myThread(LPVOID lpParameter);
HINSTANCE hInst;
CEmulatorWin32(CEmulator** _parent);
int initWindow(HWND _hWnd,HINSTANCE _hInst);
~CEmulatorWin32();
LRESULT windowProc(UINT message, WPARAM wParam, LPARAM lParam);
void destroy();
LRESULT eventHandler(UINT umsg, WPARAM wParam, LPARAM lParam);
void keyHandler(UINT raw_vk,BOOL down, UINT flags);
void x_LaunchThread();
void x_WaitForEndThread();
virtual void refreshStatus(const char* _msg);
virtual void showLoading( int _loading,int _disk);
void ShowActiveInfo();
virtual void showStatus(const char* _msg);
virtual void loadingInProgress(int _motorOn,int _slot, int _drive);
virtual void disableConsole();
virtual int activeRead(char *buf);
virtual void getEngineString(MyString& _engine);
};

View File

@ -0,0 +1,90 @@
//{{NO_DEPENDENCIES}}
// fichier Include Microsoft Visual C++.
// Utilisé par ActiveCommon.rc
//
#define IDB_ALPHACURSOR 102
#define IDD_STATUS 202
#define IDD_LOADING 203
#define IDC_RICHEDIT22 205
#define IDC_EDIT22 205
#define IDB_DISK51 205
#define IDB_DISK52 206
#define IDC_STATUS 207
#define IDD_ACTIVEINFO 208
#define IDB_DISK61 209
#define IDD_TABGENERAL 209
#define IDB_DISK62 210
#define IDD_TABRUNTIME 210
#define IDD_TABDISKCONF 210
#define IDD_TABPARAM 211
#define IDC_IMAGECTRLDISK 211
#define IDD_TABOPTION 212
#define IDD_TABHELP 213
#define IDD_TABRUNTIME1 214
#define IDC_CURSOR1 214
#define IDC_URLFTA 215
#define IDD_TABXML 215
#define IDC_URLOG 217
#define IDC_URLKD 218
#define IDC_SPEED 219
#define IDC_URLKD2 219
#define IDC_SLOTLIST 220
#define IDC_ACTIVETAB 221
#define IDC_PARAMLIST 222
#define IDC_URLTD 223
#define IDC_NOIECACHE 224
#define IDC_PERSISTENT 225
#define IDC_SPEEDMODE 226
#define IDC_ZIPSLIDER 227
#define IDC_JOYSTICK 228
#define IDC_CONSOLEBUTTON 229
#define IDC_PAUSE 230
#define IDC_HALTBADREAD 231
#define IDC_CONSOLEBUTTON2 231
#define IDC_HALTEVENT 232
#define IDC_SAVESTATE 232
#define IDC_HALTBADACCESS 233
#define IDC_CONSOLEBUTTON4 233
#define IDC_RESTORESTATE 233
#define IDC_DEFAULTOPTIONS 234
#define IDC_RESTORESTATE2 234
#define IDC_REWINDSTATE 234
#define IDC_VIDEOFX 234
#define IDC_COLORMODE 235
#define IDC_EDITURL 236
#define IDC_CLEARCACHE 236
#define IDC_CONSOLEBUTTON3 236
#define IDC_DISABLEREWIND 237
#define IDC_ENABLEREWIND 237
#define IDC_MOUNTSLOT 238
#define IDC_MOUNTBUTTON 239
#define IDC_EJECT 240
#define IDC_RELOAD 241
#define IDC_FILESELECT 242
#define IDC_REBOOT5 243
#define IDC_REBOOT6 244
#define IDC_REBOOT7 245
#define IDC_STATICSLOT2 246
#define IDC_EJECT2 247
#define IDC_SWAP 247
#define IDC_COMBOSLOT 248
#define IDC_BUILD 249
#define IDC_VERSION 250
#define IDC_MULTIPLECURRENT 251
#define IDC_MULTIPLENAME 252
#define IDC_MULTIPLEPUBLISHER 253
#define IDC_MULTIPLEYEAR 254
#define IDC_MULTIPLESWAP 255
#define IDC_COMBO1 257
#define IDC_STATE 257
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 216
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 258
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

239
Common.win32/activeconfig.c Normal file
View File

@ -0,0 +1,239 @@
#include <windows.h>
#include <stdarg.h>
#include <stdio.h>
#include "../src/defc.h"
#include "ki.h"
extern Iwm iwm;
void (*ki_loadingptr)(int,int,int) = NULL;
void prepareDriveInfo(Disk* dsk,int slot, int drive)
{
int l = dsk->image_size;
int s = dsk->image_start ;
int p = (dsk->image_type == DSK_TYPE_PRODOS);
readImageInfo(slot,drive+1,l,s,p);
}
int toggleJoystick(int _force)
{
if (_force==-2)
{
// auto
joystick_init(); // ? Joy
}
else
if (_force==-1)
{
if (g_joystick_type == JOYSTICK_MOUSE)
g_joystick_type = JOYSTICK_NONE;
else
if (g_joystick_type == JOYSTICK_NONE)
{
joystick_init(); // ? Joy
// can be mouse if not detected
}
else
{
// joystick_win32
g_joystick_type=JOYSTICK_MOUSE;
}
}
else
{
g_joystick_type = _force;
if (g_joystick_type == JOYSTICK_WIN32_1)
joystick_init();
}
if (g_joystick_type == JOYSTICK_MOUSE)
printf("joystick set to mouse emulation\n");
else
if (g_joystick_type == JOYSTICK_NONE)
printf("joystick set to none\n");
else
printf("joystick set to native\n");
refreshInfo();
return 1;
}
#ifndef _CONSOLE
/*
void ejectDisk(int slot,int disk)
{
setLocalIMG(slot,disk,NULL);
}
*/
void checkImages()
{
extern int g_highest_smartport_unit ;
extern Iwm iwm;
if (mountImages())
{
printf("Mounting images...\n");
g_highest_smartport_unit = -1;
insert_disk(5,0,getLocalIMG(5,1),0,0,0,0);
insert_disk(5,1,getLocalIMG(5,2),0,0,0,0);
insert_disk(6,0,getLocalIMG(6,1),0,0,0,0);
insert_disk(6,1,getLocalIMG(6,2),0,0,0,0);
insert_disk(7,0,getLocalIMG(7,1),0,0,0,0);
insert_disk(7,1,getLocalIMG(7,2),0,0,0,0);
refreshInfo();
}
}
/*
extern void ejectDiskCtrl(int _slot,int _drive);
void ejectDisk(int _slot,int _drive)
{
if (!g_inMount)
ejectDiskCtrl(_slot,_drive);
}
*/
void config_init()
{
/*
#ifndef _USRDLL
insert_disk(5,0,"nucleus.2mg",0,0,0,0);
insert_disk(6,0,"flobynoid (2002).dsk",0,0,0,0);
#endif
*/
}
char bram_default[]={
(char)0x00, (char)0x00, (char)0x00, (char)0x01, (char)0x00, (char)0x00, (char)0x0D, (char)0x06, (char)0x02, (char)0x01, (char)0x01, (char)0x00, (char)0x01, (char)0x00, (char)0x00, (char)0x00,
(char)0x00, (char)0x00, (char)0x07, (char)0x06, (char)0x02, (char)0x01, (char)0x01, (char)0x00, (char)0x00, (char)0x00, (char)0x0F, (char)0x06, (char)0x06, (char)0x00, (char)0x05, (char)0x06,
(char)0x01, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x01, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x03, (char)0x02, (char)0x02, (char)0x02,
(char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x01, (char)0x02, (char)0x03, (char)0x04, (char)0x05, (char)0x06,
(char)0x07, (char)0x00, (char)0x00, (char)0x01, (char)0x02, (char)0x03, (char)0x04, (char)0x05, (char)0x06, (char)0x07, (char)0x08, (char)0x09, (char)0x0A, (char)0x0B, (char)0x0C, (char)0x0D,
(char)0x0E, (char)0x0F, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
(char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
(char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
(char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
(char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
(char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
(char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
(char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
(char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
(char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF,
(char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFF, (char)0xFD, (char)0x96, (char)0x57, (char)0x3C
};
void updateBramCheckSum(unsigned char* buf) // original code in FF/B61D
{
register short int crc=0; // LDA #0
int i; // CLC
for(i=255-4-1;i>=0;i--) // LDX #FA
{
crc = (crc << 1) | ((crc>>15) & 1); // ROL (1-bits)
#ifdef UNDER_CE
crc += buf[i];
crc += buf[i+1]*256;
#else
crc += *(unsigned short*)(buf+i); // ADC bram,X
#endif
} // DEX
// CPX #FF
// BNE Loop
*(unsigned short*)(buf+252) = crc; // TAX
*(unsigned short*)(buf+254) = crc ^0xAAAA; // EOR #AAAA
}
void initializeBram(byte* g_bram_ptr)
{
memcpy(g_bram_ptr,bram_default,256);
updateBramParameters(g_bram_ptr);
updateBramCheckSum(g_bram_ptr);
}
#else
void config_init()
{
// insert_disk(7,0,"system6.2mg",0,0,0,0);
// insert_disk(7,0,"C:\\Work\\GS\\Images\\GSOS_6.2MG",0,0,0,0);
// insert_disk(7,0,"OOTW.2MG",0,0,0,0);
// insert_disk(7,0,"C:\\Work\\GS\\Images\\NFCDemoDrive.2mg",0,0,0,0);
insert_disk(5,0,"nucleus.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\ACS_Demo2.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\StarWizard(OK).2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\BeamDemo.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\Bestof2vol1.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\MODULAE.2MG",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\delta.2MG",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\TFORCE1.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\manoir.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\BOUNCIN_FERNO.2MG",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\Rastan with Intro Disk 1.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\Aaargh!.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\CaliforniaDemo.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\xmasdemo.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\nodrugs.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\Star_Trek_Classic.2mg",0,0,0,0);
// insert_disk(5,0,"C:\\Work\\GS\\Images\\shark.2mg",0,0,0,0);
// insert_disk(6,0,"C:\\Work\\GS\\Images\\flobynoid (2002).dsk",0,0,0,0);
// insert_disk(6,0,"C:\\Work\\GS\\Images\\Ultima III - Exodus (Master) (Disk 1 of 2).zip_0_Ultima III - Exodus (Master) (Disk 1 of 2)[1].dsk",0,0,0,0);
// insert_disk(6,0,"C:\\Work\\GS\\Images\\karateka.dsk",0,0,0,0);
}
#endif
void monitorStatus(int motorOn,int drive,int select)
{
if (ki_loadingptr)
ki_loadingptr(motorOn,drive,select);
}
#ifndef UNDER_CE
char targetSpeed[256];
char estimatedSpeed[256];
void updateInfo(const char* target,const char *speed)
{
strcpy(targetSpeed,target);
strcpy(estimatedSpeed,speed);
}
#endif
// SIM86516
void fatalExit(int ret)
{
char str[255];
unsigned short strw[1024];
sprintf(str,"Critical Error : %d",ret);
#ifndef UNDER_CE
MessageBox(NULL,str,"ActiveGS Halted!",MB_OK);
#else
MultiByteToWideChar(CP_ACP, 0,str,strlen(str),strw,1024);
MessageBox(NULL,strw,_T("ActiveGS Halted!"),MB_OK);
#endif
ExitThread(ret);
}

BIN
Common.win32/bitmap1.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
Common.win32/bitmap2.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

BIN
Common.win32/bmp00001.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
Common.win32/console.aps Normal file

Binary file not shown.

114
Common.win32/console.rc Normal file
View File

@ -0,0 +1,114 @@
// Microsoft Visual C++ generated resource script.
//
#include "consoleresrc.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"consoleresrc.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_CONSOLE DIALOGEX 0, 0, 418, 252
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "ActiveGS Console v1.1"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
GROUPBOX "Command",IDC_STATIC,6,216,405,30
PUSHBUTTON "Go!",IDC_GO,12,228,24,12
PUSHBUTTON "Step",IDC_STEP,42,228,24,12
PUSHBUTTON "Regs",IDC_REGS,72,228,24,12
PUSHBUTTON "Brk!",IDC_BUTTONBRK,102,228,24,12
CONTROL "",IDC_EDIT2,"RichEdit20A",ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_VSCROLL | WS_TABSTOP,7,7,404,203
EDITTEXT IDC_EDIT1,138,228,267,12,ES_AUTOHSCROLL | WS_DISABLED
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_CONSOLE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 411
TOPMARGIN, 7
BOTTOMMARGIN, 245
END
END
#endif // APSTUDIO_INVOKED
#endif // French (France) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -0,0 +1,23 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by console.rc
//
#define IDD_CONSOLE 101
#define IDC_EDIT2 103
#define IDC_EDIT1 104
#define IDC_GO 105
#define IDC_STEP 106
#define IDC_REGS 107
#define IDC_BUTTONBRK 108
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 114
#define _APS_NEXT_COMMAND_VALUE 40013
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_SYMED_VALUE 109
#endif
#endif

BIN
Common.win32/cursor1.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
Common.win32/disk52.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

BIN
Common.win32/disk54.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

BIN
Common.win32/disk55.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

7
Common.win32/stdafx.cpp Normal file
View File

@ -0,0 +1,7 @@
// stdafx.cpp : fichier source incluant simplement les fichiers Include standard
// ActiveGSApp.pch représente l'en-tête précompilé
// stdafx.obj contient les informations de type précompilées
#include "../Common.Win32/stdafx.h"

49
Common.win32/stdafx.h Normal file
View File

@ -0,0 +1,49 @@
// stdafx.h : Fichier Include pour les fichiers Include système standard,
// ou les fichiers Include spécifiques aux projets qui sont utilisés fréquemment,
// et sont rarement modifiés
#pragma once
#define WINVER 0x0600
#define _WIN32_WINNT 0x0600
/*
// FOR VS2010
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclure les en-têtes Windows rarement utilisés
#endif
// Modifiez les définitions suivantes si vous devez cibler une plate-forme avant celles spécifiées ci-dessous.
// Reportez-vous à MSDN pour obtenir les dernières informations sur les valeurs correspondantes pour les différentes plates-formes.
#ifndef WINVER // Autorise l'utilisation des fonctionnalités spécifiques à Windows 95 et Windows NT 4 ou version ultérieure.
#define WINVER 0x0400 // Attribuez la valeur appropriée à cet élément pour cibler Windows 98 et Windows 2000 ou version ultérieure.
#endif
#ifndef _WIN32_WINNT // Autorise l'utilisation des fonctionnalités spécifiques à Windows NT 4 ou version ultérieure.
#define _WIN32_WINNT 0x0400 // Attribuez la valeur appropriée à cet élément pour cibler Windows 98 et Windows 2000 ou version ultérieure.
#endif
#ifndef _WIN32_WINDOWS // Autorise l'utilisation des fonctionnalités spécifiques à Windows 98 ou version ultérieure.
#define _WIN32_WINDOWS 0x0410 // Attribuez la valeur appropriée à cet élément pour cibler Windows Me ou version ultérieure.
#endif
#ifndef _WIN32_IE // Autorise l'utilisation des fonctionnalités spécifiques à IE 4.0 ou version ultérieure.
#define _WIN32_IE 0x0400 // Attribuez la valeur appropriée à cet élément pour cibler IE 5.0 ou version ultérieure.
#endif
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // certains constructeurs CString seront explicites
// désactive le masquage MFC de certains messages d'avertissement courants et par ailleurs souvent ignorés
#define _AFX_ALL_WARNINGS
*/
#include <afxwin.h> // composants MFC principaux et standard
#include <afxext.h> // extensions MFC
#include <afxdisp.h> // Classes MFC Automation
#include <afxctl.h> // MFC support for ActiveX Controls
#include <afxdtctl.h> // Prise en charge des MFC pour les contrôles communs Internet Explorer 4
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // Prise en charge des MFC pour les contrôles communs Windows
#endif // _AFX_NO_AFXCMN_SUPPORT

View File

@ -0,0 +1,378 @@
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
//
// CWnd support for MFC Control containment (Feature Pack controls)
//
#include "..\stdafx.h"
#include "afxpriv.h"
#include "afxole.h"
#include "..\src\mfc\oleimpl2.h"
#include "..\src\mfc\afximpl.h"
#include "afxctrlcontainer.h"
// OG TO REDUCE EXE SIZE
/*
#include "afxtagmanager.h"
#include "afxbutton.h"
#include "afxcolorbutton.h"
#include "afxeditbrowsectrl.h"
#include "afxfontcombobox.h"
#include "afxlinkctrl.h"
#include "afxmaskededit.h"
#include "afxmenubutton.h"
#include "afxpropertygridctrl.h"
#include "afxshelllistctrl.h"
#include "afxshelltreectrl.h"
#include "afxvslistbox.h"
*/
////////////////////////////////////////////////////////////////////////////
static void DoRegisterWindowClass(LPCTSTR lpszClassName, LPCTSTR lpszBaseClassName)
{
ASSERT(lpszClassName != NULL);
ASSERT(lpszBaseClassName != NULL);
WNDCLASS wnd = {0};
HINSTANCE hInst = AfxGetInstanceHandle();
if (!AfxCtxGetClassInfo(hInst, lpszBaseClassName, &wnd))
{
wnd.style = CS_DBLCLKS;
wnd.hInstance = hInst;
wnd.lpfnWndProc = ::DefWindowProc;
}
wnd.lpszClassName = lpszClassName;
AfxRegisterClass(&wnd);
}
void AfxRegisterMFCCtrlClasses()
{
DoRegisterWindowClass(_T("MFCButton"), WC_BUTTON);
DoRegisterWindowClass(_T("MFCColorButton"), WC_BUTTON);
DoRegisterWindowClass(_T("MFCEditBrowse"), WC_EDIT);
DoRegisterWindowClass(_T("MFCFontComboBox"), WC_COMBOBOX);
DoRegisterWindowClass(_T("MFCLink"), WC_BUTTON);
DoRegisterWindowClass(_T("MFCMaskedEdit"), WC_EDIT);
DoRegisterWindowClass(_T("MFCMenuButton"), WC_BUTTON);
DoRegisterWindowClass(_T("MFCPropertyGrid"), WC_STATIC);
DoRegisterWindowClass(_T("MFCShellList"), WC_LISTVIEW);
DoRegisterWindowClass(_T("MFCShellTree"), WC_TREEVIEW);
DoRegisterWindowClass(_T("MFCVSListBox"), WC_STATIC);
}
////////////////////////////////////////////////////////////////////////////
// CMFCControlContainer
CMFCControlContainer::CMFCControlContainer(CWnd* pWnd) : m_pWnd(pWnd)
{
}
CMFCControlContainer::~CMFCControlContainer()
{
FreeSubclassedControls();
ClearControlData();
}
BOOL CMFCControlContainer::SubclassDlgControls()
{
if (m_pWnd->GetSafeHwnd() != NULL)
{
// Subclass Feature Pack controls:
CWnd* pWndChild = m_pWnd->GetWindow(GW_CHILD);
while (pWndChild != NULL)
{
ASSERT_VALID(pWndChild);
TCHAR lpszClassName [MAX_CLASS_NAME + 1];
::GetClassName(pWndChild->GetSafeHwnd(), lpszClassName, MAX_CLASS_NAME);
CWnd* pWndSubclassedCtrl = CreateDlgControl(lpszClassName);
if (pWndSubclassedCtrl != NULL)
{
m_arSubclassedCtrls.Add((CObject*)pWndSubclassedCtrl);
pWndSubclassedCtrl->SubclassWindow(pWndChild->GetSafeHwnd());
}
pWndChild = pWndChild->GetNextWindow();
}
return TRUE;
}
return FALSE;
}
void CMFCControlContainer::FreeSubclassedControls()
{
// Free subclassed controls:
for (int i = 0; i < m_arSubclassedCtrls.GetCount(); i++)
{
if (m_arSubclassedCtrls [i] != NULL)
{
delete m_arSubclassedCtrls [i];
}
}
m_arSubclassedCtrls.RemoveAll();
}
CWnd* CMFCControlContainer::CreateDlgControl(LPCTSTR lpszClassName)
{
ASSERT(m_pWnd->GetSafeHwnd() != NULL);
if (lpszClassName != NULL)
{
CString strClass = lpszClassName;
CWnd* pWndSubclassedCtrl = NULL;
/*
if (strClass == _T("MFCButton"))
{
pWndSubclassedCtrl = new CMFCButton;
}
else if (strClass == _T("MFCColorButton"))
{
pWndSubclassedCtrl = new CMFCColorButton;
}
else if (strClass == _T("MFCEditBrowse"))
{
pWndSubclassedCtrl = new CMFCEditBrowseCtrl;
}
else if (strClass == _T("MFCFontComboBox"))
{
pWndSubclassedCtrl = new CMFCFontComboBox;
}
else if (strClass == _T("MFCLink"))
{
pWndSubclassedCtrl = new CMFCLinkCtrl;
}
else if (strClass == _T("MFCMaskedEdit"))
{
pWndSubclassedCtrl = new CMFCMaskedEdit;
}
else if (strClass == _T("MFCMenuButton"))
{
pWndSubclassedCtrl = new CMFCMenuButton;
}
else if (strClass == _T("MFCPropertyGrid"))
{
pWndSubclassedCtrl = new CMFCPropertyGridCtrl;
}
else if (strClass == _T("MFCShellList"))
{
pWndSubclassedCtrl = new CMFCShellListCtrl;
}
else if (strClass == _T("MFCShellTree"))
{
pWndSubclassedCtrl = new CMFCShellTreeCtrl;
}
else if (strClass == _T("MFCVSListBox"))
{
pWndSubclassedCtrl = new CVSListBox;
}
*/
return pWndSubclassedCtrl;
}
return NULL;
}
BOOL CMFCControlContainer::IsSubclassedFeaturePackControl(HWND hWndCtrl)
{
if (hWndCtrl == NULL)
{
return FALSE;
}
for (int i = 0; i < m_arSubclassedCtrls.GetCount(); i++)
{
CWnd* pWnd = (CWnd*)m_arSubclassedCtrls[i];
if (pWnd->GetSafeHwnd() == hWndCtrl)
{
return TRUE;
}
}
return FALSE;
}
void CMFCControlContainer::PreUnsubclassControl(CWnd* pControl)
{
/*
CMFCShellListCtrl* pListCtrl = DYNAMIC_DOWNCAST(CMFCShellListCtrl, pControl);
if (pListCtrl != NULL && pListCtrl->GetHeaderCtrl().GetSafeHwnd() != NULL)
{
pListCtrl->GetHeaderCtrl().UnsubclassWindow();
}
*/
}
BOOL CMFCControlContainer::ReSubclassControl(HWND hWndCtrl, WORD nIDC, CWnd& control)
{
if (hWndCtrl == NULL)
{
return FALSE;
}
int nIndex = -1;
for (int i = 0; i < m_arSubclassedCtrls.GetCount(); i++)
{
CWnd* pWnd = (CWnd*)m_arSubclassedCtrls [i];
if (pWnd->GetSafeHwnd() == hWndCtrl)
{
nIndex = i;
break;
}
}
if (nIndex != -1)
{
CWnd* pWnd = DYNAMIC_DOWNCAST(CWnd, m_arSubclassedCtrls [nIndex]);
if (pWnd->GetSafeHwnd() != NULL)
{
ASSERT_VALID(pWnd);
// get init state
DWORD dwSize = 0;
BYTE* pbInitData = NULL;
GetControlData(nIDC, dwSize, pbInitData);
// Free old subclassed control:
m_arSubclassedCtrls [nIndex] = NULL;
// unsubclass
PreUnsubclassControl(pWnd);
VERIFY(pWnd->UnsubclassWindow() == hWndCtrl);
// destroy
delete pWnd;
// subclass
if (!control.SubclassWindow(hWndCtrl))
{
ASSERT(FALSE); // possibly trying to subclass twice?
AfxThrowNotSupportedException();
}
// set init state
if (dwSize > 0)
{
control.SendMessage(WM_MFC_INITCTRL, (WPARAM)dwSize, (LPARAM)pbInitData);
}
return TRUE;
}
}
return FALSE;
}
void CMFCControlContainer::SetControlData(WORD nIDC, DWORD dwSize, BYTE* pbData)
{
CByteArray* pArray = new CByteArray;
pArray->SetSize(dwSize);
BYTE* pbBuffer = pArray->GetData();
if (memcpy_s(pbBuffer, dwSize, pbData, dwSize) != 0)
{
delete pArray;
ASSERT(FALSE);
return;
}
m_mapControlData.SetAt(nIDC, pArray);
}
BOOL CMFCControlContainer::GetControlData(WORD nIDC, DWORD& dwSize, BYTE*& pbData)
{
CObject* pData = NULL;
if (m_mapControlData.Lookup(nIDC, pData) && pData != NULL)
{
CByteArray* pArray = (CByteArray*)pData;
dwSize = (DWORD)pArray->GetSize();
pbData = pArray->GetData();
return TRUE;
}
return FALSE;
}
void CMFCControlContainer::ClearControlData()
{
WORD nIDC;
CObject* pData = NULL;
POSITION pos = m_mapControlData.GetStartPosition();
while (pos != NULL)
{
m_mapControlData.GetNextAssoc(pos, nIDC, pData);
CByteArray* pArray = (CByteArray*)pData;
delete pArray;
}
m_mapControlData.RemoveAll();
}
////////////////////////////////////////////////////////////////////////////
// Accessing dialog DLGINIT helpers
int __stdcall CMFCControlContainer::UTF8ToString(LPCSTR lpSrc, CString& strDst, int nLength)
{
LPTSTR lpDst = NULL;
int count = ::MultiByteToWideChar(CP_UTF8, 0, lpSrc, nLength, NULL, 0);
if (count <= 0)
{
return 0;
}
LPWSTR lpWide = new WCHAR[count + 1];
memset(lpWide, 0, (count + 1) * sizeof(WCHAR));
::MultiByteToWideChar(CP_UTF8, 0, lpSrc, nLength, lpWide, count);
#ifdef _UNICODE
lpDst = lpWide;
#else
count = ::WideCharToMultiByte(::GetACP(), 0, lpWide, -1, NULL, 0, NULL, 0);
if (count > 0)
{
lpDst = new char[count + 1];
memset(lpDst, 0, count + 1);
::WideCharToMultiByte(::GetACP(), 0, lpWide, -1, lpDst, count, NULL, 0);
}
delete [] lpWide;
#endif
strDst = lpDst;
delete[] lpDst;
return count;
}
BOOL __stdcall CMFCControlContainer::ReadBoolProp(CTagManager& tagManager, LPCTSTR lpszTag, BOOL& bMember)
{
if (lpszTag == NULL)
{
return FALSE;
}
CString str;
// tagManager.ExcludeTag(lpszTag, str);
if (str.IsEmpty())
{
return FALSE;
}
bMember = (str.CompareNoCase(PS_True) == 0);
return TRUE;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

389
Common.win32/winconsole.cpp Normal file
View File

@ -0,0 +1,389 @@
#include "../common.win32/stdafx.h"
#include <Richedit.h>
#include "consoleresrc.h"
#include "activecommon.h"
#include "../common/ki.h"
#include "../common/svnversion.h"
#include "../kegs/src/sim65816.h"
int outputInfoInternal(const char* _str)
{
CEmulatorWin32* p = (CEmulatorWin32*)CEmulator::theEmulator;
if (p)
{
CConsole* c = p->theConsole;
if (c && IsWindow(c->hWnd))
c->addLine(_str);
}
OutputDebugString(_str);
return 0;
}
int outputInfo(const MYCHAR* format,...)
{
va_list argptr;
va_start( argptr, format );
CString st;
st.FormatV(format,argptr);
va_end(argptr);
outputInfoInternal(st);
return 0;
}
int fOutputInfo(FILE* _file,const char* format,...)
{
va_list argptr;
va_start( argptr, format );
CString st;
st.FormatV(format,argptr);
va_end(argptr);
if ((_file!=stdout) && (_file!=stderr))
fprintf(_file,st);
else
outputInfoInternal(st);
return 0;
}
void CConsole::showConsole()
{
if (!IsWindow(hWnd)) return ;
ShowWindow(hWnd,SW_SHOW);
visible++;
}
void CConsole::hideConsole()
{
if (!IsWindow(hWnd)) return ;
ShowWindow(hWnd,SW_HIDE);
visible--;
/*
if (enable)
// run the emulator
strcpy(inputBuffer,"g");
*/
}
BOOL CALLBACK EditProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
HWND parent = GetParent(hwnd);
CConsole* theConsole = (CConsole*)GetWindowLongPtr(parent,GWLP_USERDATA);
switch(Message)
{
case WM_CHAR:
if (wParam==VK_RETURN)
{
SendMessage( hwnd, WM_GETTEXT, (WPARAM)255, (LPARAM)(LPCSTR)(theConsole->inputBuffer));
outputInfo(">%s\n",theConsole->inputBuffer);
SendMessage( hwnd, WM_SETTEXT, (WPARAM)NULL, (LPARAM)(LPCSTR)NULL);
UpdateWindow(hwnd);
return 0;
}
break;
}
return CallWindowProc(theConsole->OldProc,hwnd,Message,wParam,lParam);
}
INT_PTR CALLBACK ConsoleProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
CConsole* theConsole = (CConsole*)GetWindowLongPtr(hwnd,GWLP_USERDATA);
switch(Message)
{
case WM_USER:
if (theConsole)
theConsole->refreshLine();
break;
case WM_DESTROY:
OutputDebugString("WM_DESTROY Console\n");
// détruit la font
if (theConsole)
{
if ( theConsole->hFont)
{
DeleteObject(theConsole->hFont);
theConsole->hFont=NULL;
}
theConsole->hWnd=NULL;
}
break;
case WM_CLOSE:
outputInfo("WM_CLOSE\n");
theConsole->hideConsole();
break;
case WM_COMMAND:
if (theConsole)
switch (LOWORD(wParam))
{
case IDC_GO:
theConsole->inputBuffer[0]='g';
theConsole->inputBuffer[1]=0;
break;
case IDC_REGS:
theConsole->inputBuffer[0]=0x05;
theConsole->inputBuffer[1]=0;
break;
case IDC_STEP:
theConsole->inputBuffer[0]='s';
theConsole->inputBuffer[1]=0;
break;
case IDC_BUTTONBRK:
{
extern int g_config_control_panel;
if (!g_config_control_panel)
set_halt_act(HALT_WANTTOBRK);
else
outputInfo("Emulator not ready (likely in pause)...\n");
}
break;
}
break;
case WM_CREATE:
outputInfo("WM_CREATE\n");
break;
case WM_INITDIALOG:
{
// récupère le bon ptr
theConsole = (CConsole*)lParam;
// associe la classe à la fenetre
SetLastError(0);
if (! SetWindowLongPtr(hwnd,GWLP_USERDATA,(LONG_PTR)theConsole) && GetLastError())
{
LONG err = GetLastError();
char str[255];
sprintf(str,"SetWindowLong(initdialog) Failed (%X %d)\n",hwnd,err);
OutputDebugString(str);
}
LOGFONT lf;
// Creates a non proportionnal font for both EDIT1 & EDIT2
memset( &lf, 0, sizeof(LOGFONT) ); // zero out structure
lf.lfHeight = 14; // request a 12-pixel-height font
lf.lfWeight = FW_NORMAL;
lf.lfCharSet = ANSI_CHARSET;
lf.lfPitchAndFamily = FIXED_PITCH & FF_DONTCARE;
strcpy( lf.lfFaceName, "Courier New" ); // request a face name "Arial"
if (!(theConsole->hFont = CreateFontIndirect( &lf )) )
OutputDebugString("font failed\n");
// Hook a new windw procedure for EDIT1
HWND edit2 = GetDlgItem(hwnd,IDC_EDIT1);
ASSERT(edit2!=NULL);
if (!SetWindowLongPtr(edit2,GWLP_USERDATA,(LONG_PTR)theConsole))
{
LONG err = GetLastError();
char str[255];
sprintf(str,"SetWindowLongPtr(edit2) Failed (%X %d)\n",edit2,err);
OutputDebugString(str);
}
theConsole->OldProc = (WNDPROC)GetWindowLongPtr(edit2,GWLP_WNDPROC);
if (!SetWindowLongPtr(edit2,GWLP_WNDPROC,(LONG_PTR)EditProc))
{
LONG err = GetLastError();
char str[255];
sprintf(str,"SetWindowLong(proc) Failed (%X %d)\n",edit2,err);
OutputDebugString(str);
}
SendDlgItemMessage(hwnd,IDC_EDIT2,WM_SETFONT,(WPARAM)theConsole->hFont,TRUE);
SendDlgItemMessage(hwnd,IDC_EDIT1,WM_SETFONT,(WPARAM)theConsole->hFont,TRUE);
break;
}
default:
return FALSE;
}
return TRUE;
}
void CConsole::addLine(const char* buf)
{
int lb,i;
lb = (int)strlen(buf);
// ignore un message qui ne tient pas dans le buffer
if (lb+16>HIST_DEFAULT_LIMIT)
return ;
if (HistorySize+lb > (BufferSize-8) )
HistorySize = 0;
strcpy(ConsoleHistory+HistorySize, buf);
HistorySize += lb;
for(i=0;i<lb;i++)
if (buf[i]=='\n') break;
if (i==lb){
// no line break = no nead to refresh
return ;
}
PostMessage(hWnd,WM_USER,NULL,NULL);
}
void CConsole::refreshLine()
{
LONG lcount,CurLine,NbLinesToScroll;
if (!IsWindow(hWnd)) return ;
SendDlgItemMessage(hWnd,IDC_EDIT2,WM_SETTEXT,0,(LPARAM)(LPCSTR)ConsoleHistory);
lcount = (LONG)SendDlgItemMessage(hWnd,IDC_EDIT2,EM_GETLINECOUNT,0,0);
if( lcount > 1 )
{
CurLine = (int)SendDlgItemMessage(hWnd,IDC_EDIT2, EM_GETFIRSTVISIBLELINE, 0, 0 );
if( CurLine > lcount )
CurLine = lcount;
NbLinesToScroll = lcount - CurLine - kNbVisibleLinesInEditCtrl;
if( NbLinesToScroll < 0 )
NbLinesToScroll = 0;
SendDlgItemMessage(hWnd,IDC_EDIT2, EM_LINESCROLL, 0, NbLinesToScroll );
}
}
void CConsole::shutConsole(HWND _hWndParent)
{
// if (_hWndParent!=hWndParent) return ;
OutputDebugString("shutConsole\n");
if (IsWindow(hWnd))
{
DestroyWindow(hWnd);
hWnd=NULL;
}
}
CConsole::CConsole()
{
mod = LoadLibrary("riched20.dll");
// CEmulator::theEmulator->theConsole=this;
hWnd = NULL;
enable = 0;
}
CConsole::~CConsole()
{
FreeLibrary(mod);
// CEmulator::theEmulator->theConsole=NULL;
}
void CConsole::initConsole(HINSTANCE _hInst,HWND _hWndParent)
{
if (hWnd)
{
outputInfo("Console already running\n");
return ; // Already running
}
hWndParent = _hWndParent;
//theConsole=this;
HistorySize = 0;
visible=0;
kNbVisibleLinesInEditCtrl = 23;
BufferSize = HIST_DEFAULT_LIMIT;
inputBuffer[0]=0;
// console
// __asm int 3;
OutputDebugString("createConsole\n");
hWnd = CreateDialogParam(_hInst, MAKEINTRESOURCE(IDD_CONSOLE), _hWndParent, ConsoleProc,(LPARAM)this);
if (!hWnd)
{
outputInfo("createConsole failed... %d (%X)\n",GetLastError(),_hInst);
// theConsole=NULL;
return ;
}
SendDlgItemMessage(hWnd,IDC_EDIT2, EM_EXLIMITTEXT, (WPARAM)HIST_DEFAULT_LIMIT, 0);
return ;
}
void CConsole::toggleConsole()
{
outputInfo("toggleConsole\n");
if (!visible)
showConsole();
else
hideConsole();
}
int CConsole::read(char* buf)
{
int l;
if (!enable) enableConsole();
while(!inputBuffer[0] && IsWindow(hWnd))
{
Sleep(100);
if (r_sim65816.should_emulator_terminate())
break;
}
strcpy(buf,inputBuffer);
l = strlen(buf);
if (l)
buf[l++]=0x0A;
buf[l]=0;
inputBuffer[0]=0;
return l;
}
void CConsole::enableConsole()
{
EnableWindow(GetDlgItem(hWnd,IDC_EDIT1),TRUE);
enable=1;
inputBuffer[0]=0; // clear previous commands
if (!visible)
showConsole();
}
void CConsole::disableConsole()
{
EnableWindow(GetDlgItem(hWnd,IDC_EDIT1),FALSE);
enable=0;
}

Binary file not shown.

View File

@ -0,0 +1,130 @@
Apple 2 Disk Drive Sounds Copyright (C) Moose O'Malley,
-------------------------- January 2011.
+===========================================================+
| T A B L E O F C O N T E N T S |
+===========================================================+
| * Introduction |
| * Other Projects Using These Sounds |
| * License / Limitations / Restrictions |
| * Amendment History |
| * Contacting the Program's Author |
+===========================================================+
Introduction :
--------------
This ZIP file contains the Apple 2 disk drive sounds that I recorded for
use with my "Apple 2 Disk Drive Sound Simulator" program (Windows 95 / 98 /
ME / NT / 2000 / XP, Vista, etc).
About the Disk Drive Sounds: (from my "Apple 2 Disk Drive Sound Simulator" program's readme).
-----------------------------
As people may know from the Apple 2 Emulation section of my WEB pages :
At the best of times, the Apple 2 disk drive used to make horrible
grunting and scrapping sounds as it loaded programs. When I used to go
to the local Burleigh Heads library and used the Apple 2 there, everyone
in the library would stop and stare (and sometimes glare !) at us
whenever the Apple 2 was reading floppy disks - the grunts and groans
from the drive were *that* loud !!
N.B. These terrible sounds were perfectly normal for Apple 2 drives,
and they were quite loud as well, even when using brand new floppy
disks and brand new floppy drives.
However, people today didn't believe me about the sounds or how loud they
really were.
So now, a short MP3 of some Apple 2 disk drive sounds is available from my
WEB page.
And, in addition, I have written this program to simulate some Apple 2
disk drive sounds.
All of the Apple 2 disk drive sounds were recorded by me on April 10 and 11,
2000. To record the sounds, I used a cheap microphone hooked up to my
Windows 98 PC, which was running Goldwave a good sound editing program.
I placed the microphone at the entrance to the Apple 2 floppy drive, and
then proceeded to record the loading sounds the drive made for a bunch
of games and programs. (I own an Apple ][c with both internal and
external drives).
Finally, in December 2001, I again listened carefully to the sounds I recorded
18 months ago, and edited out some of the more common sound bytes.
Then, I wrote a Delphi program to play them back, and compiled all of the
sounds into a single resource file, which was later compiled and compressed
into the Executable program. That is why there are no WAV files accompanying
this program - they are all contained inside the EXE file !! (See my
"Apple 2 Disk Drive Sound Simulator" program).
The "squeak" was a sound that the disk drive makes very occassionally
when (I think) it is swinging its read head backwards and forwards
very quickly and the rubber belt slips - not sure about how it happens
but it does happen. It is definitely a sound the drive makes - not
the door on the drive. I rember it happening on all of the Apple ]['s I
used in the early 1980's and it still happens on my Apple ][c - but it is
very occasional.
The "Ghostbusters" digitised speech sound is not a disk drive sound,
but I thought it would be fun to add this sound in as well to show
what digitised speech on the Apple ][ sounded like. Back in the
early 80's, this speech was state of the art and I remember
times when people used to crowd around my Apple ][ just to
hear it say "Ghostbusters" !!
Other Projects Using These Sounds :
------------------------------------
See the readme file that accompanies my "Apple 2 Disk Drive Sound Simulator"
program.
License / Limitations / Restrictions :
---------------------------------------
These sounds are freeware - which means they are copyrighted, but
any person and any company is welcome to use them in your own programs /
projects, subject to one condition.
I am a friendly guy and I like supporting / helping other software
developers. If you want to use these sounds in your own programs /
projects, then that is fine: all I ask is that you add a credit to me
on your projects's web page, the credits screen, the help file,
or similar. A credit something like this would be perfect:
Apple ][ disk drive sounds courtesy of
Moose's Software Valley: http://move.to/moose
Please don't just rip off my work / take my work without giving me
any credit.
Hope this is OK.
Long Live the Apple ][ !!!
Amendment History :
--------------------
Vers Date Description
1.0 25-Jan-2011 First Public Release of these sounds on their own.
If this ZIP file was not downloaded from my Home Page, then
it is possibly an old version. The latest version of this
ZIP file is available from my WEB page - see below.
Mike "Moose" O'Malley
____________________________________________________
Moose's Software Valley - Established July, 1996.
WEB: http://move.to/moose
____________________________________________________

BIN
Common/sounds/Beep Beep.wav Normal file

Binary file not shown.

BIN
Common/sounds/Beep.wav Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Common/sounds/Read 1.wav Normal file

Binary file not shown.

BIN
Common/sounds/Read 2.wav Normal file

Binary file not shown.

BIN
Common/sounds/Read 3.wav Normal file

Binary file not shown.

BIN
Common/sounds/Read 4.wav Normal file

Binary file not shown.

BIN
Common/sounds/Read 5.wav Normal file

Binary file not shown.

BIN
Common/sounds/Read 6.wav Normal file

Binary file not shown.

BIN
Common/sounds/Read 7.wav Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Common/sounds/Spin.wav Normal file

Binary file not shown.

BIN
Common/sounds/Sqweak.wav Normal file

Binary file not shown.

BIN
Common/sounds/eject.aiff Normal file

Binary file not shown.

View File

@ -447,7 +447,9 @@ inline const Type& SSMAX(const Type& arg1, const Type& arg2)
#elif defined(_MSC_VER )
#define SS_USE_FACET(loc, fac) std::_USE(loc, fac)
// #define SS_USE_FACET(loc, fac) std::_USE(loc, fac)
#define SS_USE_FACET(loc, fac) std::use_facet<fac>(loc)
// ...and
#elif defined(_RWSTD_NO_TEMPLATE_ON_RETURN_TYPE)

184
kegs/Src/bigfile.cpp Normal file
View File

@ -0,0 +1,184 @@
//
// bigfile.cpp
// ActiveGS_Karateka
//
// Created by Olivier Goguel on 14/12/2017.
//
#include "bigfile.h"
#if KARATEKA_BIGFILE
#define ONLY_BIG
#endif
#define BIG 0x8000
struct CBigFile
{
const char* filename;
off_t seek_pos;
const char* buffer;
int size;
bool opened;
int code;
};
#if KARATEKA_BIGFILE
extern "C" const char karateka_bin[];
extern "C" const char karateka_activegsxml[];
CBigFile files[] ={
"karateka.bin", 0, karateka_bin,143360,false,0xEA,
"karateka.activegsxml", 0, karateka_activegsxml,5260,false,0XEA,
NULL,0,NULL,0,false
};
#else
CBigFile files[] ={
NULL,0,NULL,0,false
};
#endif
/*
off_t seek_pos = -1;
const char* buffer = NULL;
int file_size = -1;
*/
static const char* getfile(const char* p)
{
int l = strlen(p);
while(l>=0)
{
if (p[l]=='/')
return p+l+1;
l--;
}
return p;
}
int big_open(const char *_pathname, int _flags, mode_t _mode)
{
const char* file = getfile(_pathname);
if (file[0]=='*')
{
#if KARATEKA_BIGFILE
int l = 0;
while(files[l].filename != NULL)
{
if (!strcmp(file+1,files[l].filename))
{
if (files[l].opened)
{
printf("already opened %s",_pathname);
// return -1;
}
files[l].opened = true;
files[l].seek_pos = 0;
return BIG+l;
}
l++;
}
return -1;
#else
return open(_pathname+1,_flags,_mode);
#endif
}
else
{
#ifdef ONLY_BIG
printf("missing file %s\n",_pathname);
return -1;
#else
return open(_pathname,_flags,_mode);
#endif
}
}
off_t big_lseek(int _fd, off_t _offset, int _whence)
{
if ( ( _fd & BIG ) == 0 )
{
#ifdef ONLY_BIG
return 0;
#else
return lseek(_fd, _offset, _whence);
#endif
}
else
{
CBigFile& file = files[_fd &~BIG];
if (_whence == SEEK_SET)
file.seek_pos = _offset;
else
if (_whence == SEEK_END)
file.seek_pos = file.size-1;
return file.seek_pos;
}
}
ssize_t big_read(int _fd, void *_buf, size_t _count)
{
if ( ( _fd & BIG ) == 0 )
{
#ifdef ONLY_BIG
return 0;
#else
return read(_fd, _buf, _count);
#endif
}
else
{
CBigFile& file = files[_fd &~BIG];
if (_count + file.seek_pos > file.size)
_count = file.size - file.seek_pos;
memcpy(_buf,file.buffer+file.seek_pos,_count);
char *decode = (char*)_buf;
for(int i=0;i<_count;i++)
decode[i] ^= file.code;
file.seek_pos += _count;
return _count;
}
}
ssize_t big_write(int _fd, void* _buf, size_t _count)
{
if ( ( _fd & BIG ) == 0 )
{
return _count;
}
else {
return write(_fd, _buf, _count);
}
}
int big_close(int _fd)
{
if ( ( _fd & BIG ) == 0 )
{
CBigFile& file = files[_fd &~BIG];
if (!file.opened)
{
printf("nothing to close");
return -1;
}
file.opened=false;
}
else
close(_fd);
return 0;
}

27
kegs/Src/bigfile.h Normal file
View File

@ -0,0 +1,27 @@
//
// bigfile.hpp
// ActiveGS_Karateka
//
// Created by Olivier Goguel on 14/12/2017.
//
#ifndef bigfile_hpp
#define bigfile_hpp
#include "defc.h"
#if _MSC_VER
#define mode_t int
#define ssize_t int
#endif
int big_open(const char *_pathname, int _flags, mode_t _mode);
off_t big_lseek(int _fd, off_t _offset, int _whence);
ssize_t big_read(int _fd, void *_buf, size_t _count);
ssize_t big_write(int _fd, void *_buf, size_t _count);
int big_close(int _fd);
ssize_t big_write(int _fd, const void* _buf, size_t _count);
#endif /* bigfile_hpp */

View File

@ -1,9 +1,9 @@
/*
ActiveGS, Copyright 2004-2016 Olivier Goguel, https://github.com/ogoguel/ActiveGS
Based on Kegs, Copyright 2004 Kent Dickey, https://kegs.sourceforge.net
This code is covered by the GNU GPL licence
*/
/*
ActiveGS, Copyright 2004-2016 Olivier Goguel, https://github.com/ogoguel/ActiveGS
Based on Kegs, Copyright 2004 Kent Dickey, https://kegs.sourceforge.net
This code is covered by the GNU GPL licence
*/
#pragma once
#define START_DCYCS (0.0)

230
kegs/Win/dirent-win32.h Normal file
View File

@ -0,0 +1,230 @@
/*****************************************************************************
* dirent.h - dirent API for Microsoft Visual Studio
*
* Copyright (C) 2006 Toni Ronkko
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* ``Software''), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Dec 15, 2009, John Cunningham
* Added rewinddir member function
*
* Jan 18, 2008, Toni Ronkko
* Using FindFirstFileA and WIN32_FIND_DATAA to avoid converting string
* between multi-byte and unicode representations. This makes the
* code simpler and also allows the code to be compiled under MingW. Thanks
* to Azriel Fasten for the suggestion.
*
* Mar 4, 2007, Toni Ronkko
* Bug fix: due to the strncpy_s() function this file only compiled in
* Visual Studio 2005. Using the new string functions only when the
* compiler version allows.
*
* Nov 2, 2006, Toni Ronkko
* Major update: removed support for Watcom C, MS-DOS and Turbo C to
* simplify the file, updated the code to compile cleanly on Visual
* Studio 2005 with both unicode and multi-byte character strings,
* removed rewinddir() as it had a bug.
*
* Aug 20, 2006, Toni Ronkko
* Removed all remarks about MSVC 1.0, which is antiqued now. Simplified
* comments by removing SGML tags.
*
* May 14 2002, Toni Ronkko
* Embedded the function definitions directly to the header so that no
* source modules need to be included in the Visual Studio project. Removed
* all the dependencies to other projects so that this very header can be
* used independently.
*
* May 28 1998, Toni Ronkko
* First version.
*****************************************************************************/
#ifndef DIRENT_H
#define DIRENT_H
#include <windows.h>
#include <string.h>
#include <assert.h>
typedef struct dirent
{
char d_name[MAX_PATH + 1]; /* current dir entry (multi-byte char string) */
WIN32_FIND_DATAA data; /* file attributes */
} dirent;
typedef struct DIR
{
dirent current; /* Current directory entry */
int cached; /* Indicates un-processed entry in memory */
HANDLE search_handle; /* File search handle */
char patt[MAX_PATH + 3]; /* search pattern (3 = pattern + "\\*\0") */
} DIR;
/* Forward declarations */
static DIR *opendir (const char *dirname);
static struct dirent *readdir (DIR *dirp);
static int closedir (DIR *dirp);
static void rewinddir(DIR* dirp);
/* Use the new safe string functions introduced in Visual Studio 2005 */
#if defined(_MSC_VER) && _MSC_VER >= 1400
# define STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE)
#else
# define STRNCPY(dest,src,size) strncpy((dest),(src),(size))
#endif
/*****************************************************************************
* Open directory stream DIRNAME for read and return a pointer to the
* internal working area that is used to retrieve individual directory
* entries.
*/
static DIR *opendir(const char *dirname)
{
DIR *dirp;
assert (dirname != NULL);
assert (strlen (dirname) < MAX_PATH);
/* construct new DIR structure */
dirp = (DIR*) malloc (sizeof (struct DIR));
if (dirp != NULL) {
char *p;
/* take directory name... */
STRNCPY (dirp->patt, dirname, sizeof(dirp->patt));
dirp->patt[MAX_PATH] = '\0';
/* ... and append search pattern to it */
p = strchr (dirp->patt, '\0');
if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') {
*p++ = '\\';
}
*p++ = '*';
*p = '\0';
/* open stream and retrieve first file */
dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
/* invalid search pattern? */
free (dirp);
return NULL;
}
/* there is an un-processed directory entry in memory now */
dirp->cached = 1;
}
return dirp;
}
/*****************************************************************************
* Read a directory entry, and return a pointer to a dirent structure
* containing the name of the entry in d_name field. Individual directory
* entries returned by this very function include regular files,
* sub-directories, pseudo-directories "." and "..", but also volume labels,
* hidden files and system files may be returned.
*/
static struct dirent *readdir(DIR *dirp)
{
assert (dirp != NULL);
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
/* directory stream was opened/rewound incorrectly or ended normally */
return NULL;
}
/* get next directory entry */
if (dirp->cached != 0) {
/* a valid directory entry already in memory */
dirp->cached = 0;
} else {
/* read next directory entry from disk */
if (FindNextFileA (dirp->search_handle, &dirp->current.data) == FALSE) {
/* the very last file has been processed or an error occured */
FindClose (dirp->search_handle);
dirp->search_handle = INVALID_HANDLE_VALUE;
return NULL;
}
}
/* copy as a multibyte character string */
STRNCPY ( dirp->current.d_name,
dirp->current.data.cFileName,
sizeof(dirp->current.d_name) );
dirp->current.d_name[MAX_PATH] = '\0';
return &dirp->current;
}
/*****************************************************************************
* Close directory stream opened by opendir() function. Close of the
* directory stream invalidates the DIR structure as well as any previously
* read directory entry.
*/
static int closedir(DIR *dirp)
{
assert (dirp != NULL);
/* release search handle */
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
FindClose (dirp->search_handle);
dirp->search_handle = INVALID_HANDLE_VALUE;
}
/* release directory handle */
free (dirp);
return 0;
}
/*****************************************************************************
* Resets the position of the directory stream to which dirp refers to the
* beginning of the directory. It also causes the directory stream to refer
* to the current state of the corresponding directory, as a call to opendir()
* would have done. If dirp does not refer to a directory stream, the effect
* is undefined.
*/
static void rewinddir(DIR* dirp)
{
/* release search handle */
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
FindClose (dirp->search_handle);
dirp->search_handle = INVALID_HANDLE_VALUE;
}
/* open new search handle and retrieve first file */
dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
/* invalid search pattern? */
free (dirp);
return;
}
/* there is an un-processed directory entry in memory now */
dirp->cached = 1;
}
#endif /*DIRENT_H*/

123
kegs/Win/joystick_win.cpp Normal file
View File

@ -0,0 +1,123 @@
/************************************************************************/
/* KEGS: Apple //gs Emulator */
/* Copyright 2002 by Kent Dickey */
/* */
/* This code is covered by the GNU GPL */
/* */
/* The KEGS web page is kegs.sourceforge.net */
/* You may contact the author at: kadickey@alumni.princeton.edu */
/************************************************************************/
const char rcsid_joystick_driver_c[] = "@(#)$KmKId: joystick_driver.c,v 1.12 2004-10-17 21:28:48-04 kentd Exp $";
#include "../src/defc.h"
#include "../src/moremem.h"
#include "../src/paddles.h"
# include <windows.h>
# include <mmsystem.h>
void joystick_init()
{
JOYINFO info;
JOYCAPS joycap;
MMRESULT ret1, ret2;
int i;
// Check that there is a joystick device
if(joyGetNumDevs() <= 0) {
printf("No joystick hardware detected\n");
g_joystick_native_type1 = -1;
g_joystick_native_type2 = -1;
return;
}
g_joystick_native_type1 = -1;
g_joystick_native_type2 = -1;
// Check that at least joystick 1 or joystick 2 is available
ret1 = joyGetPos(JOYSTICKID1, &info);
ret2 = joyGetDevCaps(JOYSTICKID1, &joycap, sizeof(joycap));
if(ret1 == JOYERR_NOERROR && ret2 == JOYERR_NOERROR) {
g_joystick_native_type1 = JOYSTICKID1;
printf("Joystick #1 = %s\n", joycap.szPname);
g_joystick_native_type = JOYSTICKID1;
}
ret1 = joyGetPos(JOYSTICKID2, &info);
ret2 = joyGetDevCaps(JOYSTICKID2, &joycap, sizeof(joycap));
if(ret1 == JOYERR_NOERROR && ret2 == JOYERR_NOERROR) {
g_joystick_native_type2 = JOYSTICKID2;
printf("Joystick #2 = %s\n", joycap.szPname);
if(g_joystick_native_type < 0) {
g_joystick_native_type = JOYSTICKID2;
}
}
for(i = 0; i < 4; i++) {
g_paddles.g_paddle_val[i] = 32767;
}
g_moremem.g_paddle_buttons = 0xc;
joystick_update(0.0);
}
void
joystick_update(double dcycs)
{
JOYCAPS joycap;
JOYINFO info;
UINT id;
MMRESULT ret1, ret2;
id = g_joystick_native_type;
ret1 = joyGetDevCaps(id, &joycap, sizeof(joycap));
ret2 = joyGetPos(id, &info);
if(ret1 == JOYERR_NOERROR && ret2 == JOYERR_NOERROR) {
// OG Convert to -32767/32767
g_paddles.g_paddle_val[0] = (info.wXpos - joycap.wXmin) * 65535 / (joycap.wXmax - joycap.wXmin) - 32768;
g_paddles.g_paddle_val[1] = (info.wYpos - joycap.wYmin) * 65535 / (joycap.wYmax - joycap.wYmin) - 32768;
if(info.wButtons & JOY_BUTTON1) {
g_moremem.g_paddle_buttons = g_moremem.g_paddle_buttons | 1;
} else {
g_moremem.g_paddle_buttons = g_moremem.g_paddle_buttons & (~1);
}
if(info.wButtons & JOY_BUTTON2) {
g_moremem.g_paddle_buttons = g_moremem.g_paddle_buttons | 2;
} else {
g_moremem.g_paddle_buttons = g_moremem.g_paddle_buttons & (~2);
}
paddle_update_trigger_dcycs(dcycs);
}
}
void
joystick_update_buttons()
{
JOYINFOEX info;
UINT id;
id = g_joystick_native_type;
info.dwSize = sizeof(JOYINFOEX);
info.dwFlags = JOY_RETURNBUTTONS;
if(joyGetPosEx(id, &info) == JOYERR_NOERROR) {
if(info.dwButtons & JOY_BUTTON1) {
g_moremem.g_paddle_buttons = g_moremem.g_paddle_buttons | 1;
} else {
g_moremem.g_paddle_buttons = g_moremem.g_paddle_buttons & (~1);
}
if(info.dwButtons & JOY_BUTTON2) {
g_moremem.g_paddle_buttons = g_moremem.g_paddle_buttons | 2;
} else {
g_moremem.g_paddle_buttons = g_moremem.g_paddle_buttons & (~2);
}
}
}
// OG
void joystick_shut()
{
}

260
kegs/Win/scc_windriver.cpp Normal file
View File

@ -0,0 +1,260 @@
/************************************************************************/
/* KEGS: Apple //gs Emulator */
/* Copyright 2002 by Kent Dickey */
/* */
/* This code is covered by the GNU GPL */
/* */
/* The KEGS web page is kegs.sourceforge.net */
/* You may contact the author at: kadickey@alumni.princeton.edu */
/************************************************************************/
const char rcsid_scc_windriver_c[] = "@(#)$KmKId: scc_windriver.c,v 1.4 2004-11-19 02:00:46-05 kentd Exp $";
/* This file contains the Win32 COM1/COM2 calls */
#include "../src/defc.h"
#include "../src/scc.h"
#ifdef UNDER_CE
#define vsnprintf _vsnprintf
#endif
extern word32 g_c025_val;
#ifdef _WIN32
int
scc_serial_win_init(int port)
{
COMMTIMEOUTS commtimeouts;
TCHAR str_buf[8];
Scc *scc_ptr;
HANDLE host_handle;
int state;
int ret;
scc_ptr = &(g_scc.scc_stat[port]);
scc_ptr->state = 0; /* mark as failed */
#ifdef UNICODE
wsprintf(&str_buf[0], _T("COM%d"), port+1);
#else
sprintf(&str_buf[0], "COM%d", port+1);
#endif
host_handle = CreateFile(&str_buf[0], GENERIC_READ | GENERIC_WRITE,
0, NULL, OPEN_EXISTING, 0, NULL);
scc_ptr->host_handle = host_handle;
scc_ptr->host_handle2 = malloc(sizeof(DCB));
printf("scc_socket_init %d called, host_handle: %p\n", port,
host_handle);
if(host_handle == INVALID_HANDLE_VALUE) {
scc_ptr->host_handle = 0;
return 0;
}
scc_serial_win_change_params(port);
commtimeouts.ReadIntervalTimeout = MAXDWORD;
commtimeouts.ReadTotalTimeoutMultiplier = 0;
commtimeouts.ReadTotalTimeoutConstant = 0;
commtimeouts.WriteTotalTimeoutMultiplier = 0;
commtimeouts.WriteTotalTimeoutConstant = 10;
ret = SetCommTimeouts(host_handle, &commtimeouts);
if(ret == 0) {
printf("setcommtimeout ret: %d\n", ret);
}
state = 2; /* raw serial */
scc_ptr->state = state;
return state;
}
void
scc_serial_win_change_params(int port)
{
DCB *dcbptr;
HANDLE host_handle;
Scc *scc_ptr;
int ret;
scc_ptr = &(g_scc.scc_stat[port]);
host_handle = scc_ptr->host_handle;
dcbptr = (DCB*)scc_ptr->host_handle2; // OG Added cast
if(host_handle == 0) {
return;
}
ret = GetCommState(host_handle, dcbptr);
if(ret == 0) {
printf("getcomm port%d ret: %d\n", port, ret);
}
#if 1
printf("dcb.baudrate: %d, bytesize:%d, stops:%d, parity:%d\n",
(int)dcbptr->BaudRate, (int)dcbptr->ByteSize,
(int)dcbptr->StopBits, (int)dcbptr->Parity);
printf("dcb.binary: %d, ctsflow: %d, dsrflow: %d, dtr: %d, dsr: %d\n",
(int)dcbptr->fBinary,
(int)dcbptr->fOutxCtsFlow,
(int)dcbptr->fOutxDsrFlow,
(int)dcbptr->fDtrControl,
(int)dcbptr->fDsrSensitivity);
printf("dcb.txonxoff:%d, outx:%d, inx: %d, null: %d, rts: %d\n",
(int)dcbptr->fTXContinueOnXoff,
(int)dcbptr->fOutX,
(int)dcbptr->fInX,
(int)dcbptr->fNull,
(int)dcbptr->fRtsControl);
printf("dcb.fAbortOnErr:%d, fParity:%d\n", (int)dcbptr->fAbortOnError,
(int)dcbptr->fParity);
#endif
dcbptr->fAbortOnError = 0;
dcbptr->BaudRate = scc_ptr->baud_rate;
dcbptr->ByteSize = scc_ptr->char_size;
dcbptr->StopBits = ONESTOPBIT;
switch((scc_ptr->reg[4] >> 2) & 0x3) {
case 2: // 1.5 stop bits
dcbptr->StopBits = ONE5STOPBITS;
break;
case 3: // 2 stop bits
dcbptr->StopBits = TWOSTOPBITS;
break;
}
dcbptr->Parity = NOPARITY;
switch((scc_ptr->reg[4]) & 0x3) {
case 1: // Odd parity
dcbptr->Parity = ODDPARITY;
break;
case 3: // Even parity
dcbptr->Parity = EVENPARITY;
break;
}
dcbptr->fNull = 0;
dcbptr->fDtrControl = DTR_CONTROL_ENABLE;
dcbptr->fDsrSensitivity = 0;
dcbptr->fOutxCtsFlow = 0;
dcbptr->fOutxDsrFlow = 0;
dcbptr->fParity = 0;
dcbptr->fInX = 0;
dcbptr->fOutX = 0;
dcbptr->fRtsControl = RTS_CONTROL_ENABLE;
ret = SetCommState(host_handle, dcbptr);
if(ret == 0) {
printf("SetCommState ret: %d, new baud: %d\n", ret,
(int)dcbptr->BaudRate);
}
}
void
scc_serial_win_fill_readbuf(int port, int space_left, double dcycs)
{
byte tmp_buf[256];
Scc *scc_ptr;
HANDLE host_handle;
DWORD bytes_read;
DWORD i;
int ret;
scc_ptr = &(g_scc.scc_stat[port]);
host_handle = scc_ptr->host_handle;
if(host_handle == 0) {
return;
}
/* Try reading some bytes */
space_left = MIN(256, space_left);
ret = ReadFile(host_handle, tmp_buf, space_left, &bytes_read, NULL);
if(ret == 0) {
printf("ReadFile ret 0\n");
}
if(ret && (bytes_read > 0)) {
for(i = 0; i < bytes_read; i++) {
scc_add_to_readbuf(port, tmp_buf[i], dcycs);
}
}
}
void
scc_serial_win_empty_writebuf(int port)
{
Scc *scc_ptr;
HANDLE host_handle;
int rdptr;
int wrptr;
int done;
word32 err_code;
DWORD bytes_written;
int ret;
int len;
scc_ptr = &(g_scc.scc_stat[port]);
//printf("win_empty_writebuf, host_handle: %d\n", scc_ptr->host_handle);
host_handle = scc_ptr->host_handle;
if(host_handle == 0) {
return;
}
/* Try writing some bytes */
done = 0;
while(!done) {
rdptr = scc_ptr->out_rdptr;
wrptr = scc_ptr->out_wrptr;
if(rdptr == wrptr) {
//printf("...rdptr == wrptr\n");
done = 1;
break;
}
len = wrptr - rdptr;
if(len < 0) {
len = SCC_OUTBUF_SIZE - rdptr;
}
if(len > 32) {
len = 32;
}
if(len <= 0) {
done = 1;
break;
}
bytes_written = 1;
ret = WriteFile(host_handle, &(scc_ptr->out_buf[rdptr]), len,
&bytes_written, NULL);
printf("WriteFile ret: %d, bytes_written:%d, len:%d\n", ret,
(int)bytes_written, len);
err_code = (word32)-1;
if(ret == 0) {
err_code = (word32)GetLastError();
printf("WriteFile ret:0, err_code: %08x\n", err_code);
}
if(ret == 0 || (bytes_written == 0)) {
done = 1;
break;
} else {
rdptr = rdptr + bytes_written;
if(rdptr >= SCC_OUTBUF_SIZE) {
rdptr = rdptr - SCC_OUTBUF_SIZE;
}
scc_ptr->out_rdptr = rdptr;
}
}
}
#endif

View File

@ -0,0 +1,261 @@
/************************************************************************/
/* KEGS: Apple //gs Emulator */
/* Copyright 2002 by Kent Dickey */
/* */
/* This code is covered by the GNU GPL */
/* */
/* The KEGS web page is kegs.sourceforge.net */
/* You may contact the author at: kadickey@alumni.princeton.edu */
/************************************************************************/
const char rcsid_win32snd_driver_c[] = "@(#)$KmKId: win32snd_driver.c,v 1.5 2002-11-19 03:09:59-05 kadickey Exp $";
#include "../src/defc.h"
#include "../src/sound.h"
# include <windows.h>
# include <mmsystem.h>
//extern int Verbose;
//extern int g_audio_rate;
unsigned int __stdcall child_sound_loop_win32(void *param);
void check_wave_error(int res, char *str);
#define NUM_WAVE_HEADERS 8
#ifndef __CYGWIN__
HWAVEOUT g_wave_handle = NULL; // OG Default value must be set
WAVEHDR g_wavehdr[NUM_WAVE_HEADERS];
#endif
//extern int g_audio_enable;
extern word32 *g_sound_shm_addr;
// extern int g_preferred_rate;
int g_win32snd_buflen = 0x1000;
void
x_snd_init(word32 *shmaddr)
{
// printf("win32snd_init\n");
// child_sound_loop(-1, -1, shmaddr);
return;
}
// OG Added global to free the dedicated win32 sound memory
byte *bptr = NULL;
// OG shut win32 sound resources
void
x_snd_shutdown()
{
if (g_wave_handle)
{
MMRESULT res = waveOutReset(g_wave_handle);
if (res!=MMSYSERR_NOERROR )
printf("waveOutReset Failed");
res = waveOutClose(g_wave_handle);
if (res!=MMSYSERR_NOERROR )
printf("waveOutClose Failed");
g_wave_handle=NULL;
}
// OG Free dedicated sound memory
if (bptr)
{
free(bptr);
bptr = NULL;
}
}
void CALLBACK handle_wav_snd(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
LPWAVEHDR lpwavehdr;
/* Only service "buffer done playing messages */
if(uMsg == WOM_DONE) {
lpwavehdr = (LPWAVEHDR)dwParam1;
if(lpwavehdr->dwFlags == (WHDR_DONE | WHDR_PREPARED)) {
lpwavehdr->dwUser = FALSE;
}
}
return;
}
void
check_wave_error(int res, char *str)
{
TCHAR buf[256];
if(res == MMSYSERR_NOERROR) {
return;
}
waveOutGetErrorText(res, &buf[0], sizeof(buf));
printf("%s: %s\n", str, buf);
x_exit(1);
}
void
x_snd_child_init()
{
WAVEFORMATEX wavefmt;
WAVEOUTCAPS caps;
// OG Moved as global variable (to rename)
// byte *bptr;
int bits_per_sample, channels, block_align;
int blen;
int res;
int i;
memset(&wavefmt, 0, sizeof(WAVEFORMATEX));
wavefmt.wFormatTag = WAVE_FORMAT_PCM;
#ifndef UNDER_CE
bits_per_sample = 16;
wavefmt.nSamplesPerSec = g_sound.g_audio_rate;
#else
bits_per_sample = 16;
wavefmt.nSamplesPerSec = 12000;
#endif
channels = 2;
wavefmt.wBitsPerSample = bits_per_sample;
wavefmt.nChannels = channels;
block_align = channels * (bits_per_sample / 8);
wavefmt.nBlockAlign = block_align;
wavefmt.nAvgBytesPerSec = block_align * g_sound.g_audio_rate;
res = waveOutOpen(&g_wave_handle, WAVE_MAPPER, &wavefmt, 0, 0,
WAVE_FORMAT_QUERY);
if(res != MMSYSERR_NOERROR) {
printf("Cannot open audio device\n");
g_sound.g_audio_enable = 0;
return;
}
res = waveOutOpen(&g_wave_handle, WAVE_MAPPER, &wavefmt,
(DWORD_PTR)handle_wav_snd, 0, CALLBACK_FUNCTION | WAVE_ALLOWSYNC);
if(res != MMSYSERR_NOERROR) {
printf("Cannot register audio\n");
g_sound.g_audio_enable = 0;
return;
}
g_sound.g_audio_rate = wavefmt.nSamplesPerSec;
blen = (SOUND_SHM_SAMP_SIZE * 4 * 2) / NUM_WAVE_HEADERS;
g_win32snd_buflen = blen;
bptr = (byte*)malloc(blen * NUM_WAVE_HEADERS); // OG Added cast
if(bptr == NULL) {
printf("Unabled to allocate sound buffer\n");
x_exit(1);
}
for(i = 0; i < NUM_WAVE_HEADERS; i++) {
memset(&g_wavehdr[i], 0, sizeof(WAVEHDR));
g_wavehdr[i].dwUser = FALSE;
g_wavehdr[i].lpData = (LPSTR)&(bptr[i*blen]); // OG Added cast
g_wavehdr[i].dwBufferLength = blen;
g_wavehdr[i].dwFlags = 0;
g_wavehdr[i].dwLoops = 0;
res = waveOutPrepareHeader(g_wave_handle, &g_wavehdr[i],
sizeof(WAVEHDR));
check_wave_error(res, "waveOutPrepareHeader");
}
res = waveOutGetDevCaps((UINT_PTR)g_wave_handle, &caps, sizeof(caps));
check_wave_error(res, "waveOutGetDevCaps");
printf("Using %s\n", caps.szPname);
printf(" Bits per Sample = %d. Channels = %d\n",
wavefmt.wBitsPerSample, wavefmt.nChannels);
printf(" Sampling rate = %d, avg_bytes_per_sec = %d\n",
(int)wavefmt.nSamplesPerSec, (int)wavefmt.nAvgBytesPerSec);
set_audio_rate(g_sound.g_audio_rate);
}
void
win32_send_audio2(byte *ptr, int size)
{
int found;
int res;
int i;
found = 0;
for(i = 0; i < NUM_WAVE_HEADERS; i++) {
if(g_wavehdr[i].dwUser == FALSE) {
found = 1;
break;
}
}
if(!found) {
/* all audio buffers busy, just get out */
return;
}
memcpy(g_wavehdr[i].lpData, ptr, size);
g_wavehdr[i].dwBufferLength = size;
g_wavehdr[i].dwUser = TRUE;
res = waveOutWrite(g_wave_handle, &g_wavehdr[i], sizeof(g_wavehdr));
check_wave_error(res, "waveOutWrite");
return;
}
int
x_snd_send_audio(byte *ptr, int in_size)
{
int size;
int tmpsize;
size = in_size;
while(size > 0) {
tmpsize = size;
if(size > g_win32snd_buflen) {
tmpsize = g_win32snd_buflen;
}
win32_send_audio2(ptr, tmpsize);
ptr += tmpsize;
size = size - tmpsize;
}
return in_size;
}
word32* x_sound_allocate(int size)
{
word32 *shmaddr;
shmaddr = (word32*)malloc(size);
memset(shmaddr, 0, size);
return shmaddr;
}
void x_sound_free(word32* _mem)
{
if (_mem)
free(_mem);
}
void x_async_sound_init()
{
}
void x_async_snd_shutdown()
{
}

Some files were not shown because too many files have changed in this diff Show More