Skip to content

Commit ebc92de

Browse files
ChetSimpsonejaquay
authored andcommitted
add descriptions to cartridge implementations
- add `PakGetDescription` to each cartridge - add cartridge description to the string table of each pak - update `cartridge` to export description as a property function - update `legacy_cartridge` to support PakGetDescription
1 parent 3d3d8a9 commit ebc92de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+256
-129
lines changed

FD502/fd502.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ extern "C"
125125
return string_buffer;
126126
}
127127

128+
__declspec(dllexport) const char* PakGetDescription()
129+
{
130+
static char string_buffer[MAX_LOADSTRING];
131+
132+
LoadString(gModuleInstance, IDS_DESCRIPTION, string_buffer, MAX_LOADSTRING);
133+
134+
return string_buffer;
135+
}
136+
128137
__declspec(dllexport) void PakInitialize(
129138
void* const host_key,
130139
const char* const configuration_path,

FD502/fd502.rc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ BEGIN
164164
VALUE "FileDescription", "DiskController"
165165
VALUE "FileVersion", "2.1.8.1"
166166
VALUE "InternalName", "DiskController"
167-
VALUE "LegalCopyright", "Copyright � 2010"
167+
VALUE "LegalCopyright", "Copyright � 2010"
168168
VALUE "OriginalFilename", "fd502.dll"
169169
VALUE "ProductName", "Vcc Module file"
170170
VALUE "ProductVersion", "26-3133"
@@ -198,6 +198,7 @@ STRINGTABLE
198198
BEGIN
199199
IDS_MODULE_NAME "FD-502"
200200
IDS_VERSION "3.0.1"
201+
IDS_DESCRIPTION "Turn any Color Computer with Extended BASIC into a disk system. Write your own disk applications or add ready-to-run software. Plugs into the Program Pak port or Multi-Pak Interface."
201202
#ifdef COMBINE_BECKER
202203
IDS_CATNUMBER "+ Becker"
203204
#else

FD502/resource.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#define IDS_MODULE_NAME 1
66
#define IDS_VERSION 2
77
#define IDS_CATNUMBER 3
8+
#define IDS_DESCRIPTION 4
89
#define IDD_CONFIG 101
910
#define IDD_NEWDISK 102
1011
#define IDC_DRIVE0 1000

GMC/Cartridge.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "Cartridge.h"
2+
#include <vcc/core/utils/winapi.h>
23

34

45
namespace detail
@@ -11,10 +12,7 @@ namespace detail
1112
Cartridge* Cartridge::m_Singleton(nullptr);
1213

1314

14-
Cartridge::Cartridge(std::string name, std::string catalogId)
15-
:
16-
m_Name(move(name)),
17-
m_CatalogId(move(catalogId))
15+
Cartridge::Cartridge()
1816
{
1917
if (m_Singleton)
2018
{
@@ -45,21 +43,6 @@ void Cartridge::LoadMenuItems()
4543

4644

4745

48-
49-
std::string Cartridge::GetName() const
50-
{
51-
return m_Name;
52-
}
53-
54-
55-
std::string Cartridge::GetCatalogId() const
56-
{
57-
return m_CatalogId;
58-
}
59-
60-
61-
62-
6346
void Cartridge::SetHostKey(void* key)
6447
{
6548
m_HostKey = key;

GMC/Cartridge.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ class Cartridge
77
{
88
protected:
99

10-
explicit Cartridge(std::string name, std::string catalogId = std::string());
10+
Cartridge();
1111

1212

1313
public:
1414

1515
virtual ~Cartridge();
1616

17-
virtual std::string GetName() const;
18-
virtual std::string GetCatalogId() const;
1917

2018
virtual void SetHostKey(void* key);
2119
virtual void SetCartLineAssertCallback(PakAssertCartridgeLineHostCallback callback);

GMC/CartridgeTrampolines.cpp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
#include "CartridgeTrampolines.h"
22
#include "Cartridge.h"
3+
#include "resource.h"
4+
#include <vcc/core/limits.h>
35

46

57
GMC_EXPORT const char* PakGetName()
68
{
7-
return Cartridge::m_Singleton->GetName().c_str();
9+
static char string_buffer[MAX_LOADSTRING];
10+
11+
LoadString(gModuleInstance, IDS_MODULE_NAME, string_buffer, MAX_LOADSTRING);
12+
13+
return string_buffer;
814
}
915

1016
GMC_EXPORT const char* PakCatalogName()
1117
{
12-
return Cartridge::m_Singleton->GetCatalogId().c_str();
18+
static char string_buffer[MAX_LOADSTRING];
19+
20+
LoadString(gModuleInstance, IDS_CATNUMBER, string_buffer, MAX_LOADSTRING);
21+
22+
return string_buffer;
23+
}
24+
25+
GMC_EXPORT const char* PakGetDescription()
26+
{
27+
static char string_buffer[MAX_LOADSTRING];
28+
29+
LoadString(gModuleInstance, IDS_DESCRIPTION, string_buffer, MAX_LOADSTRING);
30+
31+
return string_buffer;
1332
}
1433

34+
1535
GMC_EXPORT void PakInitialize(
1636
void* const host_key,
1737
const char* const configuration_path,

GMC/GMC.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define GMC_EXPORT
1010
#endif
1111

12+
extern HINSTANCE gModuleInstance;
1213
std::string SelectROMFile();
1314
std::string ExtractFilename(std::string path);
1415

GMC/GMC.rc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ BEGIN
7171
VALUE "FileDescription", "GMC"
7272
VALUE "FileVersion", "2.1.8.1"
7373
VALUE "InternalName", "orch90"
74-
VALUE "LegalCopyright", "Copyright � 2019"
74+
VALUE "LegalCopyright", "Copyright � 2019"
7575
VALUE "OriginalFilename", "gmc.dll"
7676
VALUE "ProductName", "Game Master Cartridge (SN76489)"
7777
VALUE "ProductVersion", "26-XXXX"
@@ -84,6 +84,20 @@ BEGIN
8484
END
8585
END
8686

87+
88+
/////////////////////////////////////////////////////////////////////////////
89+
//
90+
// String Table
91+
//
92+
93+
STRINGTABLE
94+
BEGIN
95+
IDS_MODULE_NAME "Game Master Catridge"
96+
IDS_CATNUMBER "26-XXXX"
97+
IDS_DESCRIPTION "[TODO: DESCRIPTION]"
98+
IDS_VERSION "1.0"
99+
END
100+
87101
#endif // English (United States) resources
88102
/////////////////////////////////////////////////////////////////////////////
89103

GMC/GMCCartridge.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
#include <Windows.h>
33

44

5-
GMCCartridge::GMCCartridge()
6-
: Cartridge("Game Master Catridge", "SN76489")
7-
{}
8-
9-
105
void GMCCartridge::LoadConfiguration(const std::string& filename)
116
{
127
Cartridge::LoadConfiguration(filename);

GMC/GMCCartridge.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ class GMCCartridge : public Cartridge
99
{
1010
public:
1111

12-
GMCCartridge();
13-
1412
void LoadConfiguration(const std::string& filename) override;
1513

1614
std::string GetStatusMessage() const override;

0 commit comments

Comments
 (0)