added GUID hash to controller name

renamed Joystick Database into Controller Database
This commit is contained in:
Thomas Jentzsch 2021-05-16 21:17:40 +02:00
parent c0eb914981
commit 783a1a5ac2
10 changed files with 28 additions and 16 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -3961,7 +3961,7 @@
<tr><td>Allow all 4 directions ...</td><td>Allow all 4 joystick directions to be pressed simultaneously</td><td>-joyallow4</td></tr>
<tr><td>Use modifier key combos</td><td>Enable using modifier keys in keyboard actions</td><td>-modcombo</td></tr>
<tr><td>Swap Stelladaptor ports</td><td>Swap the order of the detected Stelladaptors/2600-daptors (see <b>Advanced Configuration - <a href="#Adaptor">Stelladaptor/2600-daptor Support</a></b>)</td><td>-saport</td></tr>
<tr><td>Joystick Database</td><td>Show all joysticks that Stella knows about, with the option to remove them</td><td>&nbsp;</td></tr>
<tr><td>Controller Database</td><td>Show all controllers that Stella knows about, with the option to remove them</td><td>&nbsp;</td></tr>
<tr><td>Erase EEPROM</td><td>Erase the whole AtariVox/SaveKey flash memory</td><td>&nbsp;</td></tr>
<tr><td>AtariVox serial port</td><td>Described in further detail in <b>Advanced Configuration - <a href="#AtariVox">AtariVox/SaveKey Support</a></b> </td><td>-avoxport</td></tr>
</table>

View File

@ -262,8 +262,12 @@ EventHandlerSDL2::JoystickSDL2::JoystickSDL2(int idx)
const char* sdlname = SDL_JoystickName(myStick);
const string& desc = BSPF::startsWithIgnoreCase(sdlname, "XInput Controller")
? "XInput Controller" : sdlname;
const SDL_JoystickGUID sdlguid = SDL_JoystickGetDeviceGUID(idx);
char chGuid[33];
initialize(SDL_JoystickInstanceID(myStick), desc,
SDL_JoystickGetGUIDString(sdlguid, chGuid, sizeof(chGuid));
initialize(SDL_JoystickInstanceID(myStick), desc, chGuid,
SDL_JoystickNumAxes(myStick), SDL_JoystickNumButtons(myStick),
SDL_JoystickNumHats(myStick), SDL_JoystickNumBalls(myStick));
}

View File

@ -24,8 +24,9 @@
#include "Driving.hxx"
#include "Settings.hxx"
#include "EventHandler.hxx"
#include "PJoystickHandler.hxx"
#include "Logger.hxx"
#include "MD5.hxx"
#include "PJoystickHandler.hxx"
#ifdef GUI_SUPPORT
#include "DialogContainer.hxx"
@ -138,6 +139,7 @@ int PhysicalJoystickHandler::add(const PhysicalJoystickPtr& stick)
}
stick->type = PhysicalJoystick::Type::REGULAR;
}
stick->name.append(" (" + MD5::hash(stick->guid).substr(0, 4) + ")");
// The stick *must* be inserted here, since it may be used below
mySticks[stick->ID] = stick;
@ -294,9 +296,9 @@ void PhysicalJoystickHandler::mapStelladaptors(const string& saport)
if(found)
{
if(saOrder[saCount] == 1)
_stick->name += " (emulates left joystick port)";
_stick->name += " (emulates left controller port)";
else if(saOrder[saCount] == 2)
_stick->name += " (emulates right joystick port)";
_stick->name += " (emulates right controller port)";
saCount++;
// always map Stelladaptor/2600-daptor to emulation mode defaults

View File

@ -42,11 +42,13 @@ namespace {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PhysicalJoystick::initialize(int index, const string& desc,
int axes, int buttons, int hats, int /*balls*/)
void PhysicalJoystick::initialize(int index,
const string& desc, const string& uid,
int axes, int buttons, int hats, int /*balls*/)
{
ID = index;
name = desc;
guid = uid;
numAxes = axes;
numButtons = buttons;

View File

@ -55,7 +55,7 @@ class PhysicalJoystick
string about() const;
protected:
void initialize(int index, const string& desc,
void initialize(int index, const string& desc, const string& uid,
int axes, int buttons, int hats, int balls);
private:
@ -68,6 +68,7 @@ class PhysicalJoystick
Type type{Type::REGULAR};
int ID{-1};
string name{"None"};
string guid{"None"};
int numAxes{0}, numButtons{0}, numHats{0};
IntArray axisLastValue;
IntArray buttonLast;

View File

@ -1764,7 +1764,7 @@ static const BSPF::array2D<const char*, DEF_PROPS_SIZE, 29> DefProps = {{
{ "7c757bb151269b2a626c907a22f5dae7", "TNT Games - Sculptured Software, Adam Clayton", "26192", "BMX Air Master (1989) (TNT Games) (PAL)", "", "Extremely Rare", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "7c7a4a2d505c2d0c75337c44711d8d54", "Atari, Warren Robinett", "", "Elf Adventure (04-22-83) (Atari) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/elfadventure/elfadventure.htm" },
{ "7c9b3b8b25acf2fe3b8da834f69629c6", "", "", "I Robot (1984) (Atari) (Prototype) [!]", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "7ca7a471d70305c673fedd08174a81e8", "Tim Snider", "", "Venture II (2001) (Tim Snider)", "", "New Release", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "", "", "" },
{ "7ca7a471d70305c673fedd08174a81e8", "Tim Snider", "", "Venture II (2001) (Tim Snider)", "", "New Release", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "", "", "https://atariage.com/store/index.php?l=product_detail&p=38" },
{ "7cc77f6745e1f2b20df4a4327d350545", "Atari, Richard Maurer", "CX2632, CX2632P", "Space Invaders (1980) (Atari) (PAL) [fixed]", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"notes\":\"Only player 1 supported\",\"score_addresses\":[\"0xe6\",\"0xe8\"],\"variations_address\":\"0xdc\",\"variations_bcd\":false,\"variations_bcd_A\":false,\"variations_count\":112,\"variations_zero_based\":true}", "" },
{ "7ccf350354ee15cd9b85564a2014b08c", "", "", "Big Dig (13-04-2003) (CT)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "7cd379da92c93679f3b6d2548617746a", "", "", "Demo Image Series #5 - Clown (19-02-2003) (AD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
@ -2601,7 +2601,7 @@ static const BSPF::array2D<const char*, DEF_PROPS_SIZE, 29> DefProps = {{
{ "be2870a0120fd28d25284e9ccdcbdc99", "", "", "Tomb Raider 2600 [REV 01] (Montezuma's Revenge Hack)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "be35d8b37bbc03848a5f020662a99909", "Atari, Joe Decuir, Steve Mayer, Larry Wagner - Sears", "CX2601 - 99801, 6-99801, 49-75124", "Combat (1977) (Atari) (4K) [a]", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "be3f0e827e2f748819dac2a22d6ac823", "Puzzy - Bit Corporation", "PG202", "Space Tunnel (1982) (Puzzy)", "AKA Le Tunnel de L'Estace", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "be41463cd918daef107d249f8cde3409", "", "", "Berzerk (Voice Enhanced) (Hack)", "Hack of Berzerk", "Hack", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"score_addresses\":[\"0xdd\",\"0xde\",\"0xdf\"],\"score_digits\":6,\"variations_address\":\"0x80\",\"variations_count\":12}", "" },
{ "be41463cd918daef107d249f8cde3409", "", "", "Berzerk (Voice Enhanced) (Hack)", "Hack of Berzerk", "Hack", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"score_addresses\":[\"0xdd\",\"0xde\",\"0xdf\"],\"score_digits\":6,\"variations_address\":\"0x80\",\"variations_count\":12}", "https://atariage.com/store/index.php?l=product_detail&p=29" },
{ "be561b286b6432cac71bccbae68002f7", "", "", "Counter Demo (PD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "be929419902e21bd7830a7a7d746195d", "Activision, Garry Kitchen", "AX-025, AX-025-04", "Keystone Kapers (1983) (Activision)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"score_addresses\":[\"0x9a\",\"0x9b\",\"0x9c\"],\"score_digits\":6,\"variations_count\":1}", "" },
{ "becd908f9d7bb361982c3dc02d6475c6", "Kyle Pittman", "", "THX-1138 (Kyle Pittman) (Hack)", "Hack of Berserk", "Hack", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
@ -3123,7 +3123,7 @@ static const BSPF::array2D<const char*, DEF_PROPS_SIZE, 29> DefProps = {{
{ "e275cbe7d4e11e62c3bfcfb38fca3d49", "M Network - INTV - APh Technological Consulting, Ken Smith", "MT5658", "Super Challenge Football (1982) (M Network)", "AKA Pro Football", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "e27d518993b0a010f16e92b971ecdcdd", "Manuel Polik", "", "Star Fire (2003) (XYPE) (PAL)", "", "Homebrew", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"score_addresses\":[\"0x81\",\"0x82\",\"0x83\"],\"score_digits\":6,\"special_address\":\"0x84\",\"special_label\":\"Wave\",\"special_zero_based\":true,\"variations_count\":1}", "https://atariage.com/store/index.php?l=product_detail&p=229" },
{ "e28113d10c0c14cc3b5f430b0d142fcb", "CCE", "C-816", "Keystone Kappers (1983) (CCE) [a]", "AKA Keystone Kapers", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{\"score_addresses\":[\"0x9a\",\"0x9b\",\"0x9c\"],\"score_digits\":6,\"variations_count\":1}", "" },
{ "e2846af3e4d172b251ab77cbdd01761e", "Steve Engelhardt", "", "Adventure Plus (2003) (Steve Engelhardt) (Hack)", "Hack of Adventure", "Hack", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "e2846af3e4d172b251ab77cbdd01761e", "Steve Engelhardt", "", "Adventure Plus (2003) (Steve Engelhardt) (Hack)", "Hack of Adventure", "Hack", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "https://atariage.com/store/index.php?l=product_detail&p=145" },
{ "e2904748da63dfefc8816652b924b642", "Jone Yuan Telephonic Enterprise Co", "", "Catch Time (Jone Yuan)", "AKA Plaque Attack", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "e2b682f6e6d76b35c180c7d847e93b4f", "", "", "Dodge Demo 4 (PD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
{ "e2c1b60eaa8eda131632d73e4e0c146b", "Atari - GCC, Mark Ackerman, Noellie Alito", "CX2692", "Moon Patrol (07-04-1983) (Atari) (Prototype)", "", "Prototype", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "http://www.atariprotos.com/2600/software/moonpatrol/moonpatrol.htm" },

View File

@ -11113,6 +11113,7 @@
"Cart.Manufacturer" "Tim Snider"
"Cart.Name" "Venture II (2001) (Tim Snider)"
"Cart.Rarity" "New Release"
"Cart.Url" "https://atariage.com/store/index.php?l=product_detail&p=38"
"Display.Phosphor" "YES"
""
@ -16424,6 +16425,7 @@
"Cart.Note" "Hack of Berzerk"
"Cart.Rarity" "Hack"
"Cart.Highscore" "{\"score_addresses\":[\"0xdd\",\"0xde\",\"0xdf\"],\"score_digits\":6,\"variations_address\":\"0x80\",\"variations_count\":12}"
"Cart.Url" "https://atariage.com/store/index.php?l=product_detail&p=29"
""
"Cart.MD5" "be561b286b6432cac71bccbae68002f7"
@ -19744,6 +19746,7 @@
"Cart.Name" "Adventure Plus (2003) (Steve Engelhardt) (Hack)"
"Cart.Note" "Hack of Adventure"
"Cart.Rarity" "Hack"
"Cart.Url" "https://atariage.com/store/index.php?l=product_detail&p=145"
""
"Cart.MD5" "e2904748da63dfefc8816652b924b642"

View File

@ -204,9 +204,9 @@ void InputDialog::addDevicePortTab()
// Show joystick database
ypos += lineHeight;
lwidth = Dialog::buttonWidth("Joystick Database" + ELLIPSIS);
lwidth = Dialog::buttonWidth("Controller Database" + ELLIPSIS);
myJoyDlgButton = new ButtonWidget(myTab, _font, HBORDER, ypos, lwidth, buttonHeight,
"Joystick Database" + ELLIPSIS, kDBButtonPressed);
"Controller Database" + ELLIPSIS, kDBButtonPressed);
wid.push_back(myJoyDlgButton);
// Add EEPROM erase (part 1/2)
@ -691,7 +691,7 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd,
{
const GUI::Font& font = instance().frameBuffer().font();
myJoyDialog = make_unique<JoystickDialog>
(this, font, fontWidth() * 56 + 20, fontHeight() * 18 + 20);
(this, font, fontWidth() * 60 + 20, fontHeight() * 18 + 20);
}
myJoyDialog->show();
break;

View File

@ -27,7 +27,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
JoystickDialog::JoystickDialog(GuiObject* boss, const GUI::Font& font,
int max_w, int max_h)
: Dialog(boss->instance(), boss->parent(), font, "Joystick database", 0, 0, max_w, max_h)
: Dialog(boss->instance(), boss->parent(), font, "Controller database", 0, 0, max_w, max_h)
{
int xpos, ypos;
WidgetArray wid;
@ -48,7 +48,7 @@ JoystickDialog::JoystickDialog(GuiObject* boss, const GUI::Font& font,
// Joystick ID
ypos = _h - VBORDER - (buttonHeight + lineHeight) / 2;
StaticTextWidget* t = new StaticTextWidget(this, font, xpos, ypos+2, "Joystick ID ");
StaticTextWidget* t = new StaticTextWidget(this, font, xpos, ypos+2, "Controller ID ");
xpos += t->getWidth();
myJoyText = new EditTextWidget(this, font, xpos, ypos,
font.getStringWidth("Unplugged "), font.getLineHeight(), "");