和製MESSでPC-6001 その4

今回は以下のSC-3000をベースに、PHC-25のVDGとPSGを移植する方針。なのでグラフィックも、サウンドもあっさり動きました。

http://homepage3.nifty.com/takeda-toshiya/common/index.html

f:id:tanam:20130721011805p:image:w360

ところで、PC-6001ビルド方法ですが、以下からsource.zipをダウンロードして、以下のフォルダ構成になります。

http://homepage3.nifty.com/takeda-toshiya/common/index.html

+source ←和製MESSを解凍して、以下のファイルのみ差し替える
 pc6001.vcproj
+src 
 emu.cpp
 emu.h
 win32_input.cpp
 +res 
  pc6001.ico
  pc6001.rc
 +vm
  vm.h
  i8255.cpp
  mc6847.cpp
  +pc6001
   joystick.cpp
   keyboard.cpp
   memory.cpp
      system.cpp  
      d88.cpp  
   pc6001.cpp
   joystick.h
   keyboard.h
   memory.h
      system.h
      d88.h
   pc6001.h

pc6001.vcproj

<?xml version="1.0" encoding="shift_jis"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="9.00"
	Name="pc6001"
	ProjectGUID="{F62D036D-7569-431B-9C55-C056A4D3145A}"
	TargetFrameworkVersion="131072"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory=".\Debug"
			IntermediateDirectory=".\Debug"
			ConfigurationType="1"
			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
			UseOfMFC="0"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="2"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
				PreprocessorDefinitions="_DEBUG"
				MkTypLibCompatible="true"
				SuppressStartupBanner="true"
				TargetEnvironment="1"
				TypeLibraryName=".\Debug/pc6001.tlb"
				HeaderFileName=""
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				AdditionalIncludeDirectories=""C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Include""
				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_PC6001;_CRT_SECURE_NO_WARNINGS"
				MinimalRebuild="true"
				BasicRuntimeChecks="3"
				RuntimeLibrary="1"
				PrecompiledHeaderFile=".\Debug/pc6001.pch"
				AssemblerListingLocation=".\Debug/"
				ObjectFile=".\Debug/"
				ProgramDataBaseFileName=".\Debug/"
				BrowseInformation="1"
				WarningLevel="3"
				SuppressStartupBanner="true"
				DebugInformationFormat="4"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="_DEBUG"
				Culture="1041"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib dsound.lib imm32.lib vfw32.lib shlwapi.lib"
				OutputFile=".\Debug/pc6001.exe"
				LinkIncremental="2"
				SuppressStartupBanner="true"
				AdditionalLibraryDirectories=""C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Lib\x86""
				GenerateDebugInformation="true"
				ProgramDatabaseFile=".\Debug/pc6001.pdb"
				SubSystem="2"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
				TargetMachine="1"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
				SuppressStartupBanner="true"
				OutputFile=".\Debug/pc6001.bsc"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory=".\Release"
			IntermediateDirectory=".\Release"
			ConfigurationType="1"
			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
			UseOfMFC="0"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="2"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
				PreprocessorDefinitions="NDEBUG"
				MkTypLibCompatible="true"
				SuppressStartupBanner="true"
				TargetEnvironment="1"
				TypeLibraryName=".\Release/pc6001.tlb"
				HeaderFileName=""
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="2"
				InlineFunctionExpansion="2"
				AdditionalIncludeDirectories=""C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Include""
				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_PC6001;_CRT_SECURE_NO_WARNINGS"
				StringPooling="true"
				RuntimeLibrary="0"
				EnableFunctionLevelLinking="true"
				PrecompiledHeaderFile=".\Release/pc6001.pch"
				AssemblerListingLocation=".\Release/"
				ObjectFile=".\Release/"
				ProgramDataBaseFileName=".\Release/"
				BrowseInformation="1"
				WarningLevel="3"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG"
				Culture="1033"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib dsound.lib imm32.lib vfw32.lib"
				OutputFile=".\Release/pc6001.exe"
				LinkIncremental="1"
				SuppressStartupBanner="true"
				AdditionalLibraryDirectories=""C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\Lib\x86""
				ProgramDatabaseFile=".\Release/pc6001.pdb"
				SubSystem="2"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
				TargetMachine="1"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
				SuppressStartupBanner="true"
				OutputFile=".\Release/pc6001.bsc"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<Filter
			Name="Source Files"
			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
			>
			<File
				RelativePath="src\common.cpp"
				>
				<FileConfiguration
					Name="Debug|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						PreprocessorDefinitions=""
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						PreprocessorDefinitions=""
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="src\config.cpp"
				>
				<FileConfiguration
					Name="Debug|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						PreprocessorDefinitions=""
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						PreprocessorDefinitions=""
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="src\fileio.cpp"
				>
				<FileConfiguration
					Name="Debug|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						PreprocessorDefinitions=""
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						PreprocessorDefinitions=""
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="src\winmain.cpp"
				>
				<FileConfiguration
					Name="Debug|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						PreprocessorDefinitions=""
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32"
					>
					<Tool
						Name="VCCLCompilerTool"
						PreprocessorDefinitions=""
					/>
				</FileConfiguration>
			</File>
			<Filter
				Name="EMU Source Files"
				Filter="cpp"
				>
				<File
					RelativePath="src\emu.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\win32_input.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\win32_screen.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\win32_sound.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
			</Filter>
			<Filter
				Name="VM Common Source Files"
				Filter="cpp"
				>
				<File
					RelativePath="src\vm\datarec.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\vm\disk.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\vm\event.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\vm\i8255.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\vm\io.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\vm\mc6847.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath=".\src\vm\upd765a.cpp"
					>
				</File>
				<File
					RelativePath="src\vm\ym2203.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\vm\z80.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<Filter
					Name="fmgen Source Files"
					Filter="cpp"
					>
					<File
						RelativePath="src\vm\fmgen\file.cpp"
						>
						<FileConfiguration
							Name="Debug|Win32"
							>
							<Tool
								Name="VCCLCompilerTool"
								PreprocessorDefinitions=""
							/>
						</FileConfiguration>
						<FileConfiguration
							Name="Release|Win32"
							>
							<Tool
								Name="VCCLCompilerTool"
								PreprocessorDefinitions=""
							/>
						</FileConfiguration>
					</File>
					<File
						RelativePath="src\vm\fmgen\fmgen.cpp"
						>
						<FileConfiguration
							Name="Debug|Win32"
							>
							<Tool
								Name="VCCLCompilerTool"
								PreprocessorDefinitions=""
							/>
						</FileConfiguration>
						<FileConfiguration
							Name="Release|Win32"
							>
							<Tool
								Name="VCCLCompilerTool"
								PreprocessorDefinitions=""
							/>
						</FileConfiguration>
					</File>
					<File
						RelativePath="src\vm\fmgen\fmtimer.cpp"
						>
						<FileConfiguration
							Name="Debug|Win32"
							>
							<Tool
								Name="VCCLCompilerTool"
								PreprocessorDefinitions=""
							/>
						</FileConfiguration>
						<FileConfiguration
							Name="Release|Win32"
							>
							<Tool
								Name="VCCLCompilerTool"
								PreprocessorDefinitions=""
							/>
						</FileConfiguration>
					</File>
					<File
						RelativePath="src\vm\fmgen\opna.cpp"
						>
						<FileConfiguration
							Name="Debug|Win32"
							>
							<Tool
								Name="VCCLCompilerTool"
								PreprocessorDefinitions=""
							/>
						</FileConfiguration>
						<FileConfiguration
							Name="Release|Win32"
							>
							<Tool
								Name="VCCLCompilerTool"
								PreprocessorDefinitions=""
							/>
						</FileConfiguration>
					</File>
					<File
						RelativePath="src\vm\fmgen\psg.cpp"
						>
						<FileConfiguration
							Name="Debug|Win32"
							>
							<Tool
								Name="VCCLCompilerTool"
								PreprocessorDefinitions=""
							/>
						</FileConfiguration>
						<FileConfiguration
							Name="Release|Win32"
							>
							<Tool
								Name="VCCLCompilerTool"
								PreprocessorDefinitions=""
							/>
						</FileConfiguration>
					</File>
				</Filter>
			</Filter>
			<Filter
				Name="VM Driver Source Files"
				Filter="cpp"
				>
				<File
					RelativePath=".\src\vm\pc6001\d88.cpp"
					>
				</File>
				<File
					RelativePath="src\vm\pc6001\joystick.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\vm\pc6001\keyboard.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\vm\pc6001\memory.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\vm\pc6001\pc6001.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
				<File
					RelativePath="src\vm\pc6001\system.cpp"
					>
					<FileConfiguration
						Name="Debug|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
					<FileConfiguration
						Name="Release|Win32"
						>
						<Tool
							Name="VCCLCompilerTool"
							PreprocessorDefinitions=""
						/>
					</FileConfiguration>
				</File>
			</Filter>
		</Filter>
		<Filter
			Name="Header Files"
			Filter="h;hpp;hxx;hm;inl"
			>
			<File
				RelativePath="src\common.h"
				>
			</File>
			<File
				RelativePath="src\config.h"
				>
			</File>
			<File
				RelativePath="src\fifo.h"
				>
			</File>
			<File
				RelativePath="src\fileio.h"
				>
			</File>
			<Filter
				Name="EMU Header Files"
				Filter="h"
				>
				<File
					RelativePath="src\emu.h"
					>
				</File>
			</Filter>
			<Filter
				Name="VM Common Header Files"
				Filter="h"
				>
				<File
					RelativePath="src\vm\datarec.h"
					>
				</File>
				<File
					RelativePath="src\vm\device.h"
					>
				</File>
				<File
					RelativePath="src\vm\disk.h"
					>
				</File>
				<File
					RelativePath="src\vm\event.h"
					>
				</File>
				<File
					RelativePath="src\vm\i8255.h"
					>
				</File>
				<File
					RelativePath="src\vm\io.h"
					>
				</File>
				<File
					RelativePath="src\vm\mc6847.h"
					>
				</File>
				<File
					RelativePath=".\src\vm\upd765a.h"
					>
				</File>
				<File
					RelativePath="src\vm\vm.h"
					>
				</File>
				<File
					RelativePath="src\vm\ym2203.h"
					>
				</File>
				<File
					RelativePath="src\vm\z80.h"
					>
				</File>
				<Filter
					Name="fmgen Header Files"
					>
					<File
						RelativePath="src\vm\fmgen\diag.h"
						>
					</File>
					<File
						RelativePath="src\vm\fmgen\file.h"
						>
					</File>
					<File
						RelativePath="src\vm\fmgen\fmgen.h"
						>
					</File>
					<File
						RelativePath="src\vm\fmgen\fmgeninl.h"
						>
					</File>
					<File
						RelativePath="src\vm\fmgen\fmtimer.h"
						>
					</File>
					<File
						RelativePath="src\vm\fmgen\headers.h"
						>
					</File>
					<File
						RelativePath="src\vm\fmgen\misc.h"
						>
					</File>
					<File
						RelativePath="src\vm\fmgen\opna.h"
						>
					</File>
					<File
						RelativePath="src\vm\fmgen\psg.h"
						>
					</File>
					<File
						RelativePath="src\vm\fmgen\types.h"
						>
					</File>
				</Filter>
			</Filter>
			<Filter
				Name="VM Driver Header Files"
				Filter="h"
				>
				<File
					RelativePath=".\src\vm\pc6001\d88.h"
					>
				</File>
				<File
					RelativePath="src\vm\pc6001\joystick.h"
					>
				</File>
				<File
					RelativePath="src\vm\pc6001\keyboard.h"
					>
				</File>
				<File
					RelativePath="src\vm\pc6001\memory.h"
					>
				</File>
				<File
					RelativePath="src\vm\pc6001\pc6001.h"
					>
				</File>
				<File
					RelativePath="src\vm\pc6001\system.h"
					>
				</File>
			</Filter>
		</Filter>
		<Filter
			Name="Resource Files"
			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
			>
			<File
				RelativePath="src\res\pc6001.ico"
				>
			</File>
			<File
				RelativePath="src\res\pc6001.rc"
				>
				<FileConfiguration
					Name="Debug|Win32"
					>
					<Tool
						Name="VCResourceCompilerTool"
						PreprocessorDefinitions=""
						AdditionalIncludeDirectories="src\res"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32"
					>
					<Tool
						Name="VCResourceCompilerTool"
						PreprocessorDefinitions=""
						AdditionalIncludeDirectories="src\res"
					/>
				</FileConfiguration>
			</File>
			<File
				RelativePath="src\res\resource.h"
				>
			</File>
		</Filter>
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>

pc6001.rc

//Microsoft Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// 日本語 resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
#ifdef _WIN32
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
#pragma code_page(932)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE DISCARDABLE 
BEGIN
    "\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//

IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE 
BEGIN
    VK_RETURN,      ID_ACCEL_SCREEN,        VIRTKEY, ALT, NOINVERT
END

#endif    // 日本語 resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// 英語 (アメリカ) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDR_MENU1 MENU DISCARDABLE 
BEGIN
    POPUP "Control"
    BEGIN
        MENUITEM "Reset",                       ID_RESET
        MENUITEM SEPARATOR
        MENUITEM "CPU x1",                      ID_CPU_POWER0
        MENUITEM "CPU x2",                      ID_CPU_POWER1
        MENUITEM "CPU x4",                      ID_CPU_POWER2
        MENUITEM "CPU x8",                      ID_CPU_POWER3
        MENUITEM "CPU x16",                     ID_CPU_POWER4
        MENUITEM SEPARATOR
        MENUITEM "Paste",                       ID_AUTOKEY_START
        MENUITEM "Stop",                        ID_AUTOKEY_STOP
        MENUITEM SEPARATOR
        MENUITEM "Exit",                        ID_EXIT
    END
    POPUP "FD1"
    BEGIN
        MENUITEM "Open",                        ID_OPEN_FD1
        MENUITEM "Close",                       ID_CLOSE_FD1
        MENUITEM SEPARATOR
        MENUITEM "Recent",                      ID_RECENT_FD1
    END
    POPUP "FD2"
    BEGIN
        MENUITEM "Open",                        ID_OPEN_FD2
        MENUITEM "Close",                       ID_CLOSE_FD2
        MENUITEM SEPARATOR
        MENUITEM "Recent",                      ID_RECENT_FD2
    END
    POPUP "FD3"
    BEGIN
        MENUITEM "Open"		                    ID_OPEN_FD3
        MENUITEM "Close",                       ID_CLOSE_FD3
        MENUITEM SEPARATOR
        MENUITEM "Recent",                      ID_RECENT_FD3
    END
    POPUP "FD4"
    BEGIN
        MENUITEM "Open"		                    ID_OPEN_FD4
        MENUITEM "Close",                       ID_CLOSE_FD4
        MENUITEM SEPARATOR
        MENUITEM "Recent",                      ID_RECENT_FD4
    END
    POPUP "Screen"
    BEGIN
        MENUITEM "Rec 60fps",                   ID_SCREEN_REC60
        MENUITEM "Rec 30fps",                   ID_SCREEN_REC30
        MENUITEM "Rec 15fps",                   ID_SCREEN_REC15
        MENUITEM "Stop",                        ID_SCREEN_STOP
        MENUITEM "Capture",                     ID_SCREEN_CAPTURE
        MENUITEM SEPARATOR
        MENUITEM "Window x1",                   ID_SCREEN_WINDOW1
        MENUITEM "Window x2",                   ID_SCREEN_WINDOW2
        MENUITEM "Window x3",                   ID_SCREEN_WINDOW3
        MENUITEM "Window x4",                   ID_SCREEN_WINDOW4
        MENUITEM "Window x5",                   ID_SCREEN_WINDOW5
        MENUITEM "Window x6",                   ID_SCREEN_WINDOW6
        MENUITEM "Window x7",                   ID_SCREEN_WINDOW7
        MENUITEM "Window x8",                   ID_SCREEN_WINDOW8
        MENUITEM "Fullscreen 1",                ID_SCREEN_FULLSCREEN1
        MENUITEM "Fullscreen 2",                ID_SCREEN_FULLSCREEN2
        MENUITEM "Fullscreen 3",                ID_SCREEN_FULLSCREEN3
        MENUITEM "Fullscreen 4",                ID_SCREEN_FULLSCREEN4
        MENUITEM "Fullscreen 5",                ID_SCREEN_FULLSCREEN5
        MENUITEM "Fullscreen 6",                ID_SCREEN_FULLSCREEN6
        MENUITEM "Fullscreen 7",                ID_SCREEN_FULLSCREEN7
        MENUITEM "Fullscreen 8",                ID_SCREEN_FULLSCREEN8
        MENUITEM "Fullscreen 9",                ID_SCREEN_FULLSCREEN9
        MENUITEM "Fullscreen 10",               ID_SCREEN_FULLSCREEN10
        MENUITEM "Fullscreen 11",               ID_SCREEN_FULLSCREEN11
        MENUITEM "Fullscreen 12",               ID_SCREEN_FULLSCREEN12
        MENUITEM "Fullscreen 13",               ID_SCREEN_FULLSCREEN13
        MENUITEM "Fullscreen 14",               ID_SCREEN_FULLSCREEN14
        MENUITEM "Fullscreen 15",               ID_SCREEN_FULLSCREEN15
        MENUITEM "Fullscreen 16",               ID_SCREEN_FULLSCREEN16
        MENUITEM "Fullscreen 17",               ID_SCREEN_FULLSCREEN17
        MENUITEM "Fullscreen 18",               ID_SCREEN_FULLSCREEN18
        MENUITEM "Fullscreen 19",               ID_SCREEN_FULLSCREEN19
        MENUITEM "Fullscreen 20",               ID_SCREEN_FULLSCREEN20
        MENUITEM "Fullscreen 21",               ID_SCREEN_FULLSCREEN21
        MENUITEM "Fullscreen 22",               ID_SCREEN_FULLSCREEN22
        MENUITEM "Fullscreen 23",               ID_SCREEN_FULLSCREEN23
        MENUITEM "Fullscreen 24",               ID_SCREEN_FULLSCREEN24
        MENUITEM "Fullscreen 25",               ID_SCREEN_FULLSCREEN25
        MENUITEM "Fullscreen 26",               ID_SCREEN_FULLSCREEN26
        MENUITEM "Fullscreen 27",               ID_SCREEN_FULLSCREEN27
        MENUITEM "Fullscreen 28",               ID_SCREEN_FULLSCREEN28
        MENUITEM "Fullscreen 29",               ID_SCREEN_FULLSCREEN29
        MENUITEM "Fullscreen 30",               ID_SCREEN_FULLSCREEN30
        MENUITEM SEPARATOR
        MENUITEM "Use Direct3D9",               ID_SCREEN_USE_D3D9
        MENUITEM "Wait Vsync",                  ID_SCREEN_WAIT_VSYNC
        MENUITEM "Stretch Screen",              ID_SCREEN_STRETCH
    END
    POPUP "Sound"
    BEGIN
        MENUITEM "Rec",                         ID_SOUND_REC
        MENUITEM "Stop",                        ID_SOUND_STOP
        MENUITEM SEPARATOR
        MENUITEM "2000Hz",                      ID_SOUND_FREQ0
        MENUITEM "4000Hz",                      ID_SOUND_FREQ1
        MENUITEM "8000Hz",                      ID_SOUND_FREQ2
        MENUITEM "11025Hz",                     ID_SOUND_FREQ3
        MENUITEM "22050Hz",                     ID_SOUND_FREQ4
        MENUITEM "44100Hz",                     ID_SOUND_FREQ5
        MENUITEM "48000Hz",                     ID_SOUND_FREQ6
        MENUITEM "96000Hz",                     ID_SOUND_FREQ7
        MENUITEM SEPARATOR
        MENUITEM "50msec",                      ID_SOUND_LATE0
        MENUITEM "100msec",                     ID_SOUND_LATE1
        MENUITEM "200msec",                     ID_SOUND_LATE2
        MENUITEM "300msec",                     ID_SOUND_LATE3
        MENUITEM "400msec",                     ID_SOUND_LATE4
    END
END


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1               ICON    DISCARDABLE     "pc6001.ico"
#endif    // 英語 (アメリカ) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

joystick.cpp

/*
	SANYO PHC-25 Emulator 'ePHC-25'
	SEIKO MAP-1010 Emulator 'eMAP-1010'

	Author : Takeda.Toshiya
	Date   : 2010.08.06-

	[ joystick ]
*/

#include "joystick.h"
#include "../ym2203.h"

void JOYSTICK::initialize()
{
	joy_stat = emu->joy_buffer();
	
	// register event to update the key status
	register_frame_event(this);
}

void JOYSTICK::event_frame()
{
#ifdef _PC6001
	d_psg->write_signal(SIG_YM2203_PORT_A, ~(joy_stat[0] & 0x3f), 0xff);
#else
	d_psg->write_signal(SIG_YM2203_PORT_A, ~(joy_stat[0] & 0x1f), 0xff);
#endif
	d_psg->write_signal(SIG_YM2203_PORT_B, ~(joy_stat[1] & 0x1f), 0xff);
}

joystick.h

/*
	SANYO PHC-25 Emulator 'ePHC-25'
	SEIKO MAP-1010 Emulator 'eMAP-1010'
	Skelton for retropc emulator

	Author : Takeda.Toshiya
	Date   : 2010.08.06-

	[ joystick ]
*/

#ifndef _JOYSTICK_H_
#define _JOYSTICK_H_

#include "../vm.h"
#include "../../emu.h"
#include "../device.h"

class JOYSTICK : public DEVICE
{
private:
	DEVICE *d_psg;
	uint32 *joy_stat;
	
public:
	JOYSTICK(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
	~JOYSTICK() {}
	
	// common functions
	void initialize();
	void event_frame();
	
	// unique function
	void set_context_psg(DEVICE* device) {
		d_psg = device;
	}
};

#endif

keyboard.h

/*
	NEC PC-6001 Emulator 'yaPC6001'
	Skelton for retropc emulator

	Author : tanam
	Date   : 2013.07.15-

	[ keyboard ]
*/

#ifndef _KEYBOARD_H_
#define _KEYBOARD_H_

#include "../vm.h"
#include "../../emu.h"
#include "../device.h"

#define STICK0_SPACE 0x80
#define STICK0_LEFT  0x20
#define STICK0_RIGHT 0x10
#define STICK0_DOWN  0x08
#define STICK0_UP    0x04
#define STICK0_STOP  0x02
#define STICK0_SHIFT 0x01

class KEYBOARD : public DEVICE
{
private:
	DEVICE *d_cpu, *d_pio, *d_mem;
	uint8* key_stat;
	uint32* joy_stat;
   	byte stick0;
	int kbFlagFunc;
	int kbFlagGraph;
	int kbFlagCtrl;
	int kanaMode;
	int katakana;
	void update_keyboard();
	
public:
	KEYBOARD(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
	~KEYBOARD() {}
	
	// common functions
	void initialize();
	void event_frame();
	
	// unique functions
	void set_context_cpu(DEVICE* device) {
		d_cpu = device;
	}
	void set_context_pio(DEVICE* device) {
		d_pio = device;
	}
	void set_context_memory(DEVICE* device) {
		d_mem = device;
	}
	// interrupt cpu to device
	uint32 intr_ack();
};

#endif

emu.h


(省略)

#ifdef _PC6001
	uint32 joy_status[3];	// joystick #1, #2 (b0 = up, b1 = down, b2 = left, b3 = right, b4- = buttons
	int joy_num;
	uint32 joy_mask[3];
#else
	uint32 joy_status[2];	// joystick #1, #2 (b0 = up, b1 = down, b2 = left, b3 = right, b4- = buttons
	int joy_num;
	uint32 joy_mask[2];
#endif

(省略)