Add a new Registry Configuration interface: "Game I/O Connector" (like Slots).

Change Config->Advanced to show 'Game I/O Connector' (instead of 'Copy Protection Dongle').
This commit is contained in:
tomcw
2022-12-31 17:32:50 +00:00
parent be62e7afa5
commit 043bc49f3d
11 changed files with 53 additions and 32 deletions
+19
View File
@@ -155,6 +155,9 @@ void RegSaveValue (LPCTSTR section, LPCTSTR key, BOOL peruser, DWORD value) {
//===========================================================================
static inline std::string RegGetSlotSection(UINT slot)
{
if (slot == GAME_IO_CONNECTOR)
return std::string(REG_CONFIG_GAME_IO_CONNECTOR);
return (slot == SLOT_AUX)
? std::string(REG_CONFIG_SLOT_AUX)
: (std::string(REG_CONFIG_SLOT) + (char)('0' + slot));
@@ -197,6 +200,8 @@ void RegDeleteConfigSlotSection(UINT slot)
void RegSetConfigSlotNewCardType(UINT slot, SS_CARDTYPE type)
{
_ASSERT(slot != GAME_IO_CONNECTOR);
RegDeleteConfigSlotSection(slot);
std::string regSection;
@@ -204,3 +209,17 @@ void RegSetConfigSlotNewCardType(UINT slot, SS_CARDTYPE type)
RegSaveValue(regSection.c_str(), REGVALUE_CARD_TYPE, TRUE, type);
}
void RegSetConfigGameIOConnectorNewDongleType(UINT slot, DONGLETYPE type)
{
_ASSERT(slot == GAME_IO_CONNECTOR);
if (slot != GAME_IO_CONNECTOR)
return;
RegDeleteConfigSlotSection(slot);
std::string regSection;
regSection = RegGetConfigSlotSection(slot);
RegSaveValue(regSection.c_str(), REGVALUE_GAME_IO_TYPE, TRUE, type);
}