From bdcbeab122d1945a70e65cdbf4c37092290f2fdf Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Fri, 26 May 2023 21:29:25 +0300 Subject: [PATCH] Multi-Player Soccer Manager dongle emulation --- cfgfile.cpp | 2 +- dongle.cpp | 21 +++++++++++++++++++++ od-win32/win32gui.cpp | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cfgfile.cpp b/cfgfile.cpp index 2cd55275..aa49a24b 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -212,7 +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"), + _T("strikermanager"), _T("multi-player soccer manager"), 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 c11718c1..48441ef6 100644 --- a/dongle.cpp +++ b/dongle.cpp @@ -30,6 +30,7 @@ #define SCALA_RED 11 #define SCALA_GREEN 12 #define STRIKERMANAGER 13 +#define MPSOCCERMANAGER 14 static int dflag; static frame_time_t cycles; @@ -102,6 +103,13 @@ Striker Manager - 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. +Multi-Player Soccer Manager + +- Writes 0x0F00 to POTGO few times +- Reads JOY1DAT, expects AND 0x303 == 0x301 or 0x302 +- Reads JOY1DAT in a loop until AND 0x303 == 0x301 or 0x302 (opposite from previous read) +- Resets the system if wrong value after 200 000 read attemps. + */ static uae_u8 oldcia[2][16]; @@ -234,6 +242,18 @@ uae_u16 dongle_joydat (int port, uae_u16 val) } } break; + case MPSOCCERMANAGER: + if (port == 1) { + if (dflag >= 4) { + val &= ~0x0303; + val |= 0x0302; + dflag--; + } else if (dflag > 0) { + val &= ~0x0303; + val |= 0x0301; + } + } + break; } return val; } @@ -250,6 +270,7 @@ void dongle_potgo (uae_u16 val) dflag = (uaerand () & 7) - 3; break; case STRIKERMANAGER: + case MPSOCCERMANAGER: if ((val & 0x0500) == 0x0500) { dflag++; } else { diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 2106e297..071e432d 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -17794,6 +17794,7 @@ static void init_portsdlg (HWND hDlg) 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_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Multi-Player Soccer Manager")); xSendDlgItemMessage (hDlg, IDC_SERIAL, CB_RESETCONTENT, 0, 0L); xSendDlgItemMessage (hDlg, IDC_SERIAL, CB_ADDSTRING, 0, (LPARAM)szNone.c_str()); -- 2.47.3