From 1a607d0f4db8191117f8abff6e492f199676bf57 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 21 May 2023 21:20:39 +0300 Subject: [PATCH] Striker Manager dongle emulation --- cfgfile.cpp | 1 + dongle.cpp | 30 ++++++++++++++++++++++++++++++ od-win32/win32gui.cpp | 1 + 3 files changed, 32 insertions(+) diff --git a/cfgfile.cpp b/cfgfile.cpp index 78f9610e..2cd55275 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -212,6 +212,7 @@ static const TCHAR *dongles[] = _T("robocop 3"), _T("leaderboard"), _T("b.a.t. ii"), _T("italy'90 soccer"), _T("dames grand maitre"), _T("rugby coach"), _T("cricket captain"), _T("leviathan"), _T("musicmaster"), _T("logistics"), _T("scala red"), _T("scala green"), + _T("strikermanager"), NULL }; static const TCHAR *cdmodes[] = { _T("disabled"), _T(""), _T("image"), _T("ioctl"), _T("spti"), _T("aspi"), 0 }; diff --git a/dongle.cpp b/dongle.cpp index 1a529dcd..c11718c1 100644 --- a/dongle.cpp +++ b/dongle.cpp @@ -15,6 +15,7 @@ #include "dongle.h" #include "events.h" #include "uae.h" +#include "debug.h" #define ROBOCOP3 1 #define LEADERBOARD 2 @@ -28,6 +29,7 @@ #define LOGISTIX 10 #define SCALA_RED 11 #define SCALA_GREEN 12 +#define STRIKERMANAGER 13 static int dflag; static frame_time_t cycles; @@ -93,6 +95,13 @@ Scala MM (Red) - Drives firebutton high, then low - Polls POTGOR second button pin, it must go low between about 350000-540000 DMA cycles. +Striker Manager + +- Writes 0x0F00 to POTGO few times +- Reads JOY1DAT, expects AND 0x303 == 0x200 or 0x203 +- Reads JOY1DAT in a loop until AND 0x303 == 0x200 or 0x203 (opposite from previous read) +- Resets the system if wrong value after 200 000 read attemps. + */ static uae_u8 oldcia[2][16]; @@ -213,6 +222,18 @@ uae_u16 dongle_joydat (int port, uae_u16 val) val = 0x0303; } break; + case STRIKERMANAGER: + if (port == 1) { + if (dflag >= 4) { + val &= ~0x0303; + val |= 0x0203; + dflag--; + } else if (dflag > 0) { + val &= ~0x0303; + val |= 0x0200; + } + } + break; } return val; } @@ -228,6 +249,15 @@ void dongle_potgo (uae_u16 val) case DAMESGRANDMAITRE: dflag = (uaerand () & 7) - 3; break; + case STRIKERMANAGER: + if ((val & 0x0500) == 0x0500) { + dflag++; + } else { + if (dflag > 0) { + dflag--; + } + } + break; } } diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 4866e940..142ab1b7 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -17793,6 +17793,7 @@ static void init_portsdlg (HWND hDlg) xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Logistics/SuperBase")); xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Scala MM (Red)")); xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Scala MM (Green)")); + xSendDlgItemMessage(hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Striker Manager")); xSendDlgItemMessage (hDlg, IDC_SERIAL, CB_RESETCONTENT, 0, 0L); xSendDlgItemMessage (hDlg, IDC_SERIAL, CB_ADDSTRING, 0, (LPARAM)szNone.c_str()); -- 2.47.3