GTK+: Don't override command-line port choice.

This commit is contained in:
Brandon Wright 2018-10-03 16:58:40 -05:00
parent bf12c09a12
commit 602919d522
3 changed files with 32 additions and 8 deletions

View File

@ -462,6 +462,10 @@ S9xInitInputDevices (void)
} }
#endif #endif
//First plug in both, they'll change later as needed
S9xSetController (0, CTL_JOYPAD, 0, 0, 0, 0);
S9xSetController (1, CTL_JOYPAD, 1, 0, 0, 0);
return; return;
} }

View File

@ -86,6 +86,32 @@ main (int argc, char *argv[])
S9xPortSoundInit (); S9xPortSoundInit ();
for (int port = 0; port < 2; port++)
{
enum controllers type;
int8 id;
S9xGetController (port, &type, &id, &id, &id, &id);
std::string device_type;
switch (type)
{
case CTL_MP5:
device_type = "multitap";
break;
case CTL_MOUSE:
device_type = "mouse";
break;
case CTL_SUPERSCOPE:
device_type = "superscope";
break;
default:
device_type = "joypad";
}
device_type += std::to_string (port + 1);
top_level->set_menu_item_selected (device_type.c_str ());
}
gui_config->reconfigure (); gui_config->reconfigure ();
top_level->update_accels (); top_level->update_accels ();
@ -705,12 +731,6 @@ S9xExit (void)
void void
S9xPostRomInit (void) S9xPostRomInit (void)
{ {
//First plug in both, they'll change later as needed
S9xSetController (0, CTL_JOYPAD, 0, 0, 0, 0);
S9xSetController (1, CTL_JOYPAD, 1, 0, 0, 0);
top_level->set_menu_item_selected ("joypad1");
top_level->set_menu_item_selected ("joypad2");
if (!strncmp ((const char *) Memory.NSRTHeader + 24, "NSRT", 4)) if (!strncmp ((const char *) Memory.NSRTHeader + 24, "NSRT", 4))
{ {
switch (Memory.NSRTHeader[29]) switch (Memory.NSRTHeader[29])

View File

@ -562,10 +562,10 @@ event_port (GtkWidget *widget, gpointer data)
S9xSetController (1, CTL_SUPERSCOPE, 0, 0, 0, 0); S9xSetController (1, CTL_SUPERSCOPE, 0, 0, 0, 0);
} }
/* else if (!strcasecmp (name, "multitap1")) else if (!strcasecmp (name, "multitap1"))
{ {
S9xSetController (0, CTL_MP5, 0, 1, 2, 3); S9xSetController (0, CTL_MP5, 0, 1, 2, 3);
} */ }
else if (!strcasecmp (name, "multitap2")) else if (!strcasecmp (name, "multitap2"))
{ {