Add support for hardware copy protection dongles in game i/o socket (#1153, PR #1154)

Changes:
- Add a drop-down menu to the 'Advanced' tab that lets the user select a dongle in use
- Add a new file "CopyProtectionDongles.cpp" that is a place to put drivers for these.
- Add a driver for the one known dongle we have now - Speed Star
- Modify Joystick.cpp to allow PB0-PB2 to be "pushed" by the protection dongle.
This commit is contained in:
Matthew D'Asaro
2022-12-16 01:04:29 -08:00
committed by GitHub
parent 5c0f3d03ad
commit e5a87b5063
12 changed files with 152 additions and 2 deletions
+24
View File
@@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../Registry.h"
#include "../SaveState.h"
#include "../CardManager.h"
#include "../CopyProtectionDongles.h"
#include "../resource/resource.h"
CPageAdvanced* CPageAdvanced::ms_this = 0; // reinit'd in ctor
@@ -43,6 +44,11 @@ const TCHAR CPageAdvanced::m_CloneChoices[] =
TEXT("TK3000 //e\0") // Brazilian
TEXT("Base 64A\0"); // Taiwanese
enum COPYPROTECTIONDONGLECHOICE { MENUITEM_NONE, MENUITEM_SPEEDSTAR };
const TCHAR CPageAdvanced::m_CopyProtectionDongleChoices[] =
TEXT("None\0")
TEXT("SDS DataKey - Speed Star\0"); // Protection dongle for Southwestern Data Systems "Speed Star" Applesoft Compiler
INT_PTR CALLBACK CPageAdvanced::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
@@ -123,6 +129,13 @@ INT_PTR CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, L
m_PropertySheetHelper.GetConfigNew().m_Apple2Type = NewCloneType;
m_PropertySheetHelper.GetConfigNew().m_CpuType = ProbeMainCpuDefault(NewCloneType);
}
case IDC_COMBO_CP_DONGLE:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
const DWORD NewCopyProtectionDongleMenuItem = (DWORD)SendDlgItemMessage(hWnd, IDC_COMBO_CP_DONGLE, CB_GETCURSEL, 0, 0);
SetCopyProtectionDongleType(NewCopyProtectionDongleMenuItem);
}
break;
}
break;
@@ -179,6 +192,9 @@ void CPageAdvanced::DlgOK(HWND hWnd)
g_bSaveStateOnExit = IsDlgButtonChecked(hWnd, IDC_SAVESTATE_ON_EXIT) ? true : false;
REGSAVE(TEXT(REGVALUE_SAVE_STATE_ON_EXIT), g_bSaveStateOnExit ? 1 : 0);
// Save the copy protection dongle type
REGSAVE(TEXT(REGVALUE_COPYPROTECTIONDONGLE_TYPE), GetCopyProtectionDongleType());
if (GetCardMgr().IsParallelPrinterCardInstalled())
{
ParallelPrinterCard* card = GetCardMgr().GetParallelPrinterCard();
@@ -217,6 +233,7 @@ void CPageAdvanced::InitOptions(HWND hWnd)
{
InitFreezeDlgButton(hWnd);
InitCloneDropdownMenu(hWnd);
InitCopyProtectionDongleDropdownMenu(hWnd);
}
// Advanced->Clone: Menu item to eApple2Type
@@ -282,3 +299,10 @@ void CPageAdvanced::InitCloneDropdownMenu(HWND hWnd)
const bool bIsClone = IsClone( m_PropertySheetHelper.GetConfigNew().m_Apple2Type );
EnableWindow(GetDlgItem(hWnd, IDC_CLONETYPE), bIsClone ? TRUE : FALSE);
}
void CPageAdvanced::InitCopyProtectionDongleDropdownMenu(HWND hWnd)
{
// Set copy protection dongle menu choice
const int nCurrentChoice = GetCopyProtectionDongleType();
m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_CP_DONGLE, m_CopyProtectionDongleChoices, nCurrentChoice);
}
+2
View File
@@ -35,9 +35,11 @@ private:
int GetCloneMenuItem(void);
void InitFreezeDlgButton(HWND hWnd);
void InitCloneDropdownMenu(HWND hWnd);
void InitCopyProtectionDongleDropdownMenu(HWND hWnd);
static CPageAdvanced* ms_this;
static const TCHAR m_CloneChoices[];
static const TCHAR m_CopyProtectionDongleChoices[];
const PAGETYPE m_Page;
CPropertySheetHelper& m_PropertySheetHelper;