From 65f8823ba8a961f10e14ab0a688bc3800658d40a Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Mon, 9 May 2022 19:04:23 +0200 Subject: [PATCH] improved Mindlink support --- Changes.txt | 2 ++ src/emucore/DefProps.hxx | 4 ++-- src/emucore/MindLink.cxx | 10 +++++++--- src/emucore/MindLink.hxx | 14 +++++++++----- src/emucore/stella.pro | 2 ++ 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Changes.txt b/Changes.txt index f46e33e52..943f79200 100644 --- a/Changes.txt +++ b/Changes.txt @@ -35,6 +35,8 @@ * Improved controller mappings for Driving controllers. + * Improved Mindlink support + * Added another oddball TIA glitch option for score mode color. * Enhanced support for CDFJ+ bankswitching type. diff --git a/src/emucore/DefProps.hxx b/src/emucore/DefProps.hxx index b56e681c8..fac8b5c8b 100644 --- a/src/emucore/DefProps.hxx +++ b/src/emucore/DefProps.hxx @@ -268,7 +268,7 @@ static constexpr BSPF::array2D DefProps = {{ { "10c47acca2ecd212b900ad3cf6942dbb", "Atari - Axlon, Tod Frye - Heuristica, Agustin Ortiz", "CX26169", "Shooting Arcade (03-07-1989) (Atari) (Prototype) [a4]", "Uses the Light Gun Controller (left only)", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/shootingarcade/shootingarcade.htm" }, { "10c8cfd8c37522f11d47540ff024e5f9", "Canal 3 - Intellivision", "C 3016", "Demon Attack (Canal 3)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"score_addresses\":[\"0x81\",\"0x83\",\"0x85\"],\"score_digits\":6,\"special_address\":\"0x80\",\"special_label\":\"Wave\",\"special_zero_based\":true,\"variations_address\":\"0xea\",\"variations_count\":10}", "" }, { "10eae73a07b3da044b72473d8d366267", "Funvision - Fund. Int'l Co.", "", "Karate (1982) (Funvision) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "10f0ecaf962aef1fc28abed870b01b65", "Atari, Paul Donaldson", "", "Bionic Breakthrough (06-22-1984) (Atari) (Prototype)", "Uses MindLink Controller", "Prototype", "", "", "", "", "", "", "", "MINDLINK", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/bionic/bionic.htm" }, + { "10f0ecaf962aef1fc28abed870b01b65", "Atari, Paul Donaldson", "", "Bionic Breakthrough (06-22-1984) (Atari) (Prototype)", "Uses MindLink Controller", "Prototype", "", "", "", "", "", "", "", "MINDLINK", "", "", "MINDLINK", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/bionic/bionic.htm" }, { "10f62443f1ae087dc588a77f9e8f43e9", "Atari, Carla Meninsky", "CX2637, CX2637P", "Dodge 'Em (1980) (Atari) (PAL) [fixed]", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "110ac8ecaf1b69f41bc94c59dfcb8b2d", "", "", "Demon Attack (Unknown)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"score_addresses\":[\"0x81\",\"0x83\",\"0x85\"],\"score_digits\":6,\"special_address\":\"0x80\",\"special_label\":\"Wave\",\"special_zero_based\":true,\"variations_address\":\"0xea\",\"variations_count\":10}", "" }, { "111029770226b319524134193886a10e", "Hozer Video Games", "", "Gunfight 2600 - One Limit Reached! (2001) (Manuel Rotschkar)", "", "New Release", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, @@ -3318,7 +3318,7 @@ static constexpr BSPF::array2D DefProps = {{ { "f04ee80011d95798006378643650aaa7", "Atari, Bill Aspromonte, John Russell, Michael Sierchio, Robert Zdybel", "CX26114", "Pigs in Space (1983) (Atari) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/pigsinspace/pigsinspace.htm" }, { "f0510abbfbe24ead552e92e3841f63f3", "Thomas Jentzsch", "", "Reactor - Atari Mouse Hack v1.3 (NTSC) (Full-Speed) (Thomas Jentzsch)", "Uses Atari Mouse Controller", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "https://atariage.com/store/index.php?l=product_detail&p=1186" }, { "f0536303f49006806bac3aec15738336", "Arcadia Corporation, Dennis Caswell", "AR-4200", "Escape from the Mindmaster (4 of 4) (1982) (Arcadia)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "f0541d2f7cda5ec7bab6d62b6128b823", "Atari, Paul Donaldson", "", "Bionic Breakthrough (1984) (Atari) (Prototype)", "Uses MindLink Controller", "Prototype", "", "", "", "", "", "", "", "MINDLINK", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/bionic/bionic.htm" }, + { "f0541d2f7cda5ec7bab6d62b6128b823", "Atari, Paul Donaldson", "", "Bionic Breakthrough (1984) (Atari) (Prototype)", "Uses MindLink Controller", "Prototype", "", "", "", "", "", "", "", "MINDLINK", "", "", "MINDLINK", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/bionic/bionic.htm" }, { "f060826626aac9e0d8cda0282f4b7fc3", "Atari, David Crane - Sears", "CX2605 - 6-99822, 49-75109", "Outlaw (1978) (Atari) (4K)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "f0631c6675033428238408885d7e4fde", "Paul Slocum", "", "Test Cart (2002) (Paul Slocum)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "", "", "https://atariage.com/store/index.php?l=product_detail&p=102" }, { "f066bea7ab0a37b83c83c924a87c5b67", "", "", "Air Raiders (2003) (Hack) (Thomas Jentzsch)", "Unlimited ammo hack", "Hack", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, diff --git a/src/emucore/MindLink.cxx b/src/emucore/MindLink.cxx index 5955770ed..e7464eb63 100644 --- a/src/emucore/MindLink.cxx +++ b/src/emucore/MindLink.cxx @@ -35,13 +35,17 @@ void MindLink::update() if(!myMouseEnabled) return; - myMindlinkPos = BSPF::clamp((myMindlinkPos & ~CALIBRATE_FLAG) + + myMindlinkPos = BSPF::clamp((myMindlinkPos & ~TRIGGER_VALUE) + myEvent.get(Event::MouseAxisXMove) * MOUSE_SENSITIVITY, MIN_POS, MAX_POS); - + // Additional option for trigger (NOT existing in orginal hardware!) if(myEvent.get(Event::MouseButtonLeftValue) || myEvent.get(Event::MouseButtonRightValue)) - myMindlinkPos = CALIBRATE_FLAG; // flag starts game & calibates + myMindlinkPos = myMindlinkPos | TRIGGER_VALUE; // starts game, calibration and reverse + +#ifdef DEBUG_BUILD + cerr << std::hex << myMindlinkPos << endl; +#endif myMindlinkShift = 1; // start transfer with least significant bit nextMindlinkBit(); diff --git a/src/emucore/MindLink.hxx b/src/emucore/MindLink.hxx index 03f5a5c60..a07c0a4f6 100644 --- a/src/emucore/MindLink.hxx +++ b/src/emucore/MindLink.hxx @@ -104,15 +104,19 @@ class MindLink : public Controller private: void nextMindlinkBit(); - // Range of valid values - static constexpr int MIN_POS = 0x2700; - static constexpr int MAX_POS = 0x3e00; - static constexpr int CALIBRATE_FLAG = 0x8000; // this causes a left side calibration + // Range of valid values: + // Telepathy: >= 0x6500 for trigger + // Bionic Breakthrough: + // 06-22-84: >= 0x6100 & < 0x0c00 trigger calibration) + // other: : >= 0x4e00 triggers calibration + static constexpr int MIN_POS = 0x0b00; + static constexpr int MAX_POS = 0x6500; + static constexpr int TRIGGER_VALUE = 0x8000; // mouse button support private: // Position value in Mindlink controller // Gets transferred bitwise (16 bits) - int myMindlinkPos{MIN_POS}; + int myMindlinkPos{0x2a00}; // Which bit to transfer next int myMindlinkShift{1}; diff --git a/src/emucore/stella.pro b/src/emucore/stella.pro index 3ea05482c..e4a6c9e3f 100644 --- a/src/emucore/stella.pro +++ b/src/emucore/stella.pro @@ -1555,6 +1555,7 @@ "Cart.Rarity" "Prototype" "Cart.Url" "http://www.atariprotos.com/2600/software/bionic/bionic.htm" "Controller.Left" "MINDLINK" +"Controller.Right" "MINDLINK" "" "Cart.MD5" "10f62443f1ae087dc588a77f9e8f43e9" @@ -21148,6 +21149,7 @@ "Cart.Rarity" "Prototype" "Cart.Url" "http://www.atariprotos.com/2600/software/bionic/bionic.htm" "Controller.Left" "MINDLINK" +"Controller.Right" "MINDLINK" "" "Cart.MD5" "f060826626aac9e0d8cda0282f4b7fc3"