-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
外部プログラムと連携するためのプラグインシステムを試験的に導入
- Loading branch information
Showing
27 changed files
with
665 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
src/objs_d | ||
src/objs | ||
src/stderr.txt | ||
src/stdout.txt | ||
|
||
src/mucom88 | ||
src/mucom88.exe | ||
src/mucom88_d | ||
src/mucom88_d.exe | ||
src/osdep_test | ||
src/osdep_test.exe | ||
src/mod_test | ||
src/mod_test.exe | ||
src/miniplay | ||
src/miniplay.exe | ||
|
||
xcode/miniosx.xcodeproj/xcuserdata | ||
xcode/DerivedData | ||
xcode/miniosx.xcodeproj/project.xcworkspace/xcuserdata | ||
|
||
src/mucom88.vcxproj.user | ||
src/.vs/ | ||
src/Debug | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// dllmain.cpp : DLL アプリケーションのエントリ ポイントを定義します。 | ||
#include "stdafx.h" | ||
|
||
BOOL APIENTRY DllMain( HMODULE hModule, | ||
DWORD ul_reason_for_call, | ||
LPVOID lpReserved | ||
) | ||
{ | ||
switch (ul_reason_for_call) | ||
{ | ||
case DLL_PROCESS_ATTACH: | ||
case DLL_THREAD_ATTACH: | ||
case DLL_THREAD_DETACH: | ||
case DLL_PROCESS_DETACH: | ||
break; | ||
} | ||
return TRUE; | ||
} | ||
|
||
//-------------------------------------------------- | ||
// プラグイン機能コールバック | ||
//-------------------------------------------------- | ||
|
||
static int noticeCallback(void *instance, int cmd, void *p1, void *p2) | ||
{ | ||
Mucom88Plugin *plg = (Mucom88Plugin *)instance; | ||
printf( "#Notice %d.\n",cmd ); | ||
return 0; | ||
} | ||
|
||
|
||
//-------------------------------------------------- | ||
// プラグイン初期化 | ||
//-------------------------------------------------- | ||
extern "C" __declspec(dllexport) int InitalizePlugin(Mucom88Plugin *plugin, int bootopt ) | ||
{ | ||
plugin->info = "MUCOM88 TEST PLUGIN"; // プラグイン情報テキスト | ||
plugin->type = MUCOM88IF_TYPE_SILENT; // プラグインタイプを設定(MUCOM88IF_TYPE_*) | ||
plugin->if_notice = noticeCallback; // 通知用コールバックを登録する | ||
|
||
printf( "Welcome! plugin!\n" ); | ||
|
||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// muplug_test.cpp : DLL アプリケーション用にエクスポートされる関数を定義します。 | ||
// | ||
|
||
#include "stdafx.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28307.271 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "muplug_test", "muplug_test.vcxproj", "{356DCF99-2D8A-4047-8BA2-0E3693CA2558}" | ||
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 | ||
{356DCF99-2D8A-4047-8BA2-0E3693CA2558}.Debug|x64.ActiveCfg = Debug|x64 | ||
{356DCF99-2D8A-4047-8BA2-0E3693CA2558}.Debug|x64.Build.0 = Debug|x64 | ||
{356DCF99-2D8A-4047-8BA2-0E3693CA2558}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{356DCF99-2D8A-4047-8BA2-0E3693CA2558}.Debug|x86.Build.0 = Debug|Win32 | ||
{356DCF99-2D8A-4047-8BA2-0E3693CA2558}.Release|x64.ActiveCfg = Release|x64 | ||
{356DCF99-2D8A-4047-8BA2-0E3693CA2558}.Release|x64.Build.0 = Release|x64 | ||
{356DCF99-2D8A-4047-8BA2-0E3693CA2558}.Release|x86.ActiveCfg = Release|Win32 | ||
{356DCF99-2D8A-4047-8BA2-0E3693CA2558}.Release|x86.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {88821FC9-F18A-49C8-A8D5-656E2358F4FB} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|Win32"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|Win32"> | ||
<Configuration>Release</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Debug|x64"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|x64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<VCProjectVersion>15.0</VCProjectVersion> | ||
<ProjectGuid>{356DCF99-2D8A-4047-8BA2-0E3693CA2558}</ProjectGuid> | ||
<Keyword>Win32Proj</Keyword> | ||
<RootNamespace>muplugtest</RootNamespace> | ||
<WindowsTargetPlatformVersion>7.0</WindowsTargetPlatformVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v141</PlatformToolset> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v141_xp</PlatformToolset> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>MultiByte</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v141</PlatformToolset> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v141</PlatformToolset> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
<ImportGroup Label="Shared"> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<LinkIncremental>true</LinkIncremental> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<LinkIncremental>true</LinkIncremental> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<LinkIncremental>false</LinkIncremental> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<LinkIncremental>false</LinkIncremental> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<ClCompile> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>Disabled</Optimization> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>WIN32;_DEBUG;MUPLUGTEST_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>true</ConformanceMode> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<ClCompile> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>Disabled</Optimization> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>_DEBUG;MUPLUGTEST_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>true</ConformanceMode> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<ClCompile> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>MaxSpeed</Optimization> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>WIN32;NDEBUG;MUPLUGTEST_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>true</ConformanceMode> | ||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
</Link> | ||
<PostBuildEvent> | ||
<Command>copy /Y /V $(TargetPath) ..\\src\\Release</Command> | ||
</PostBuildEvent> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<ClCompile> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>MaxSpeed</Optimization> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>NDEBUG;MUPLUGTEST_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>true</ConformanceMode> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<ClInclude Include="stdafx.h" /> | ||
<ClInclude Include="targetver.h" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="dllmain.cpp" /> | ||
<ClCompile Include="muplug_test.cpp" /> | ||
<ClCompile Include="stdafx.cpp"> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> | ||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> | ||
</ClCompile> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
</ImportGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="ソース ファイル"> | ||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||
</Filter> | ||
<Filter Include="ヘッダー ファイル"> | ||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions> | ||
</Filter> | ||
<Filter Include="リソース ファイル"> | ||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="stdafx.h"> | ||
<Filter>ヘッダー ファイル</Filter> | ||
</ClInclude> | ||
<ClInclude Include="targetver.h"> | ||
<Filter>ヘッダー ファイル</Filter> | ||
</ClInclude> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="stdafx.cpp"> | ||
<Filter>ソース ファイル</Filter> | ||
</ClCompile> | ||
<ClCompile Include="muplug_test.cpp"> | ||
<Filter>ソース ファイル</Filter> | ||
</ClCompile> | ||
<ClCompile Include="dllmain.cpp"> | ||
<Filter>ソース ファイル</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "stdafx.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// stdafx.h : 標準のシステム インクルード ファイルのインクルード ファイル、 | ||
// または、参照回数が多く、かつあまり変更されない、プロジェクト専用のインクルード ファイル | ||
// を記述します。 | ||
// | ||
|
||
#pragma once | ||
|
||
#define MUCOM88WIN | ||
|
||
#include <stdio.h> | ||
|
||
#include "targetver.h" | ||
|
||
#define WIN32_LEAN_AND_MEAN // Windows ヘッダーからほとんど使用されていない部分を除外する | ||
// Windows ヘッダー ファイル | ||
#include <windows.h> | ||
#include <windows.h> | ||
|
||
#include "../src/mucom88config.h" | ||
#include "../src/plugin/mucom88if.h" | ||
#include "../src/mucomvm.h" | ||
#include "../src/cmucom.h" | ||
|
||
// プログラムに必要な追加ヘッダーをここで参照してください |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
// SDKDDKVer.h をインクルードすると、利用できる最も上位の Windows プラットフォームが定義されます。 | ||
|
||
// 以前の Windows プラットフォーム用にアプリケーションをビルドする場合は、WinSDKVer.h をインクルードし、 | ||
// SDKDDKVer.h をインクルードする前に、サポート対象とするプラットフォームを示すように _WIN32_WINNT マクロを設定します。 | ||
|
||
#include <SDKDDKVer.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.