Skip to content

Commit c3a5f56

Browse files
ChetSimpsonejaquay
authored andcommitted
refactor orhestra-90cc to implement derived cartridge type and use new interface
1 parent c7973cb commit c3a5f56

File tree

8 files changed

+246
-201
lines changed

8 files changed

+246
-201
lines changed

orch90/main.cpp

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 "orchestra90cc_cartridge.h"
19+
#include <Windows.h>
20+
#include <stdio.h>
21+
#include "resource.h"
22+
#include <vcc/common/FileOps.h>
23+
#include <vcc/core/legacy_cartridge_definitions.h>
24+
#include <vcc/core/limits.h>
25+
#include <memory>
26+
#include <vcc/core/utils/winapi.h>
27+
#include <vcc/core/utils/filesystem.h>
28+
#include <vcc/core/cartridge_factory.h>
29+
30+
31+
static HINSTANCE gModuleInstance=nullptr;
32+
33+
34+
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
35+
{
36+
if (fdwReason == DLL_PROCESS_ATTACH)
37+
{
38+
gModuleInstance = hinstDLL;
39+
}
40+
41+
return TRUE;
42+
}
43+
44+
extern "C" __declspec(dllexport) CreatePakFactoryFunction GetPakFactory()
45+
{
46+
return [](
47+
std::unique_ptr<::vcc::core::cartridge_context> context,
48+
[[maybe_unused]] const cpak_cartridge_context& cpak_context) -> std::unique_ptr<::vcc::core::cartridge>
49+
{
50+
return std::make_unique<orchestra90cc_cartridge>(gModuleInstance, move(context));
51+
};
52+
}
File renamed without changes.

orch90/orch90.cpp

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

orch90/orch90.h

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

orch90/orch90.vcxproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@
9393
</Link>
9494
</ItemDefinitionGroup>
9595
<ItemGroup>
96-
<ClCompile Include="orch90.cpp" />
96+
<ClCompile Include="main.cpp" />
97+
<ClCompile Include="orchestra90cc_cartridge.cpp" />
9798
</ItemGroup>
9899
<ItemGroup>
99-
<ClInclude Include="orch90.h" />
100+
<ClInclude Include="orchestra90cc_cartridge.h" />
100101
<ClInclude Include="resource.h" />
101102
</ItemGroup>
102103
<ItemGroup>
103-
<ResourceCompile Include="orch90.rc" />
104+
<ResourceCompile Include="main.rc" />
104105
</ItemGroup>
105106
<ItemGroup>
106107
<ProjectReference Include="..\libcommon\libcommon.vcxproj">

orch90/orch90.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="orchestra90cc_cartridge.cpp">
8+
<Filter>Source Files</Filter>
9+
</ClCompile>
10+
</ItemGroup>
11+
<ItemGroup>
12+
<ClInclude Include="orchestra90cc_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>{02502bce-4b00-4780-975c-1d0973ad5f40}</UniqueIdentifier>
22+
</Filter>
23+
<Filter Include="Source Files">
24+
<UniqueIdentifier>{60dff0ec-8022-4fc3-b612-7cb1e85c2bfb}</UniqueIdentifier>
25+
</Filter>
26+
<Filter Include="Resource Files">
27+
<UniqueIdentifier>{a871e955-c2ae-4eae-bc4c-8ce9030ca49e}</UniqueIdentifier>
28+
</Filter>
29+
</ItemGroup>
30+
<ItemGroup>
31+
<ResourceCompile Include="main.rc">
32+
<Filter>Resource Files</Filter>
33+
</ResourceCompile>
34+
</ItemGroup>
35+
</Project>

0 commit comments

Comments
 (0)