Skip to content

Commit 4bbf713

Browse files
ChetSimpsonejaquay
authored andcommitted
refactor ramdisk to implement derived cartridge type and use new interface
1 parent c3a5f56 commit 4bbf713

File tree

9 files changed

+240
-224
lines changed

9 files changed

+240
-224
lines changed

Ramdisk/Ramdisk.cpp

Lines changed: 0 additions & 119 deletions
This file was deleted.

Ramdisk/Ramdisk.vcxproj

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,20 @@
9494
</Link>
9595
</ItemDefinitionGroup>
9696
<ItemGroup>
97-
<ClCompile Include="memboard.cpp" />
98-
<ClCompile Include="Ramdisk.cpp" />
97+
<ClCompile Include="main.cpp" />
98+
<ClCompile Include="ramdisk_cartridge.cpp" />
9999
</ItemGroup>
100100
<ItemGroup>
101-
<ClInclude Include="memboard.h" />
101+
<ClInclude Include="ramdisk_cartridge.h" />
102102
<ClInclude Include="resource.h" />
103103
</ItemGroup>
104104
<ItemGroup>
105-
<ResourceCompile Include="Ramdisk.rc" />
105+
<ResourceCompile Include="main.rc" />
106+
</ItemGroup>
107+
<ItemGroup>
108+
<ProjectReference Include="..\libcommon\libcommon.vcxproj">
109+
<Project>{e0aa25bd-5527-475f-8d8b-b549a6311b0c}</Project>
110+
</ProjectReference>
106111
</ItemGroup>
107112
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
108113
<ImportGroup Label="ExtensionTargets">

Ramdisk/Ramdisk.vcxproj.filters

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<ClCompile Include="main.cpp">
5+
<Filter>Source Files</Filter>
6+
</ClCompile>
7+
<ClCompile Include="ramdisk_cartridge.cpp">
8+
<Filter>Source Files</Filter>
9+
</ClCompile>
10+
</ItemGroup>
11+
<ItemGroup>
12+
<ClInclude Include="ramdisk_cartridge.h">
13+
<Filter>Header Files</Filter>
14+
</ClInclude>
15+
<ClInclude Include="resource.h">
16+
<Filter>Resource Files</Filter>
17+
</ClInclude>
18+
</ItemGroup>
19+
<ItemGroup>
20+
<Filter Include="Header Files">
21+
<UniqueIdentifier>{9acf22b3-e767-4efc-8b2e-849bd513bb7c}</UniqueIdentifier>
22+
</Filter>
23+
<Filter Include="Resource Files">
24+
<UniqueIdentifier>{4c180f5a-6729-48ac-af8b-e022abc0c13b}</UniqueIdentifier>
25+
</Filter>
26+
<Filter Include="Source Files">
27+
<UniqueIdentifier>{45742ace-f5e8-4b92-8ac7-b78f0e995a00}</UniqueIdentifier>
28+
</Filter>
29+
</ItemGroup>
30+
<ItemGroup>
31+
<ResourceCompile Include="main.rc">
32+
<Filter>Resource Files</Filter>
33+
</ResourceCompile>
34+
</ItemGroup>
35+
</Project>

Ramdisk/main.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
////////////////////////////////////////////////////////////////////////////////
2+
// Copyright 2015 by Joseph Forgione
3+
// This file is part of VCC (Virtual Color Computer).
4+
//
5+
// VCC (Virtual Color Computer) is free software: you can redistribute itand/or
6+
// modify it under the terms of the GNU General Public License as published by
7+
// the Free Software Foundation, either version 3 of the License, or (at your
8+
// option) any later version.
9+
//
10+
// VCC (Virtual Color Computer) is distributed in the hope that it will be
11+
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
13+
// Public License for more details.
14+
//
15+
// You should have received a copy of the GNU General Public License along with
16+
// VCC (Virtual Color Computer). If not, see <http://www.gnu.org/licenses/>.
17+
////////////////////////////////////////////////////////////////////////////////
18+
#include "ramdisk_cartridge.h"
19+
#include <vcc/core/cartridge_factory.h>
20+
#include <memory>
21+
#include <Windows.h>
22+
23+
24+
HINSTANCE gModuleInstance;
25+
26+
27+
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
28+
{
29+
if (fdwReason == DLL_PROCESS_ATTACH)
30+
{
31+
gModuleInstance = hinstDLL;
32+
}
33+
34+
return true;
35+
}
36+
37+
38+
//
39+
extern "C" __declspec(dllexport) CreatePakFactoryFunction GetPakFactory()
40+
{
41+
return []([[maybe_unused]] std::unique_ptr<::vcc::core::cartridge_context> context,
42+
[[maybe_unused]] const cpak_cartridge_context& cpak_context) -> std::unique_ptr<::vcc::core::cartridge>
43+
{
44+
return std::make_unique<ramdisk_cartridge>();
45+
};
46+
}
File renamed without changes.

Ramdisk/memboard.cpp

Lines changed: 0 additions & 72 deletions
This file was deleted.

Ramdisk/memboard.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)