Previous 15994 Revisions Next

r3065 Wednesday 20th August, 2008 at 11:28:51 UTC by Nathan Woods
Fixed bug that caused "categorized" inputs (used on Atari 2600, NES, SMS) to not
be remappable. (bug #1614)
[docs]messnew.txt
[src/emu]inptport.c inptport.h
[src/mess]inputx.c

src/emu/inptport.c
r3064r3065
23852385   input_field_config *curfield = NULL;
23862386   input_port_config *curport = NULL;
23872387   input_port_value maskbits = 0;
2388   UINT16 category;   /* (MESS-specific) category */
23882389
23892390   /* loop over tokens until we hit the end */
23902391   while (entrytype != INPUT_TOKEN_END)
r3064r3065
29362937            curfield->name = input_port_string_from_token(*ipt++);
29372938            break;
29382939
2939         /* configuration setting */
2940         /* category setting */
29402941         case INPUT_TOKEN_CATEGORY_SETTING:
29412942            TOKEN_UNGET_UINT32(ipt);
29422943            if (curfield == NULL)
r3064r3065
29462947               TOKEN_SKIP_STRING(ipt);
29472948               break;
29482949            }
2949            TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, defval, 32);
2950            TOKEN_GET_UINT64_UNPACK3(ipt, entrytype, 8, defval, 32, category, 16);
29502951            cursetting = setting_config_alloc(curfield, defval & curfield->mask, input_port_string_from_token(*ipt++));
2952            cursetting->category = category;
29512953            break;
29522954
29532955         /* analog adjuster definition */
src/emu/inptport.h
r3064r3065
555555   input_port_value         value;         /* value of the bits in this setting */
556556   input_condition            condition;      /* condition under which this setting is valid */
557557   const char *            name;         /* user-friendly name to display */
558   UINT16                  category;      /* (MESS-specific) category */
558559};
559560
560561
src/mess/inputx.c
r3064r3065
14701470
14711471int input_category_active(running_machine *machine, int category)
14721472{
1473   int found;
14741473   const input_port_config *port;
14751474   const input_field_config *field = NULL;
14761475   const input_setting_config *setting;
1476   input_field_user_settings settings;
14771477
14781478   assert(category >= 1);
14791479
1480   found = FALSE;
1481   for (port = machine->portconfig; !found && (port != NULL); port = port->next)
1480   /* loop through the input ports */
1481   for (port = machine->portconfig; port != NULL; port = port->next)
14821482   {
1483      for (field = port->fieldlist; !found && (field != NULL); field = field->next)
1484         found = (field->type == IPT_CATEGORY) && (field->defvalue == category);
1485   }
1483      for (field = port->fieldlist; field != NULL; field = field->next)
1484      {
1485         /* is this field a category? */
1486         if (field->type == IPT_CATEGORY)
1487         {
1488            /* get the settings value */
1489            input_field_get_user_settings(field, &settings);
14861490
1487   if (field != NULL)
1488   {
1489      for (setting = field->settinglist; setting != NULL; setting = setting->next)
1490      {
1491         if (setting->value == field->defvalue)
1492            return TRUE;
1491            for (setting = field->settinglist; setting != NULL; setting = setting->next)
1492            {
1493               /* is this the category we want?  if so, is this settings value correct? */
1494               if ((setting->category == category) && (settings.value == setting->value))
1495                  return TRUE;
1496            }
1497         }
14931498      }
14941499   }
14951500   return FALSE;
docs/messnew.txt
r3064r3065
2727
2828User Interface Changes:
2929-----------------------
30- Fixed bug that caused "categorized" inputs (used on Atari 2600, NES, SMS)
31  to not be remappable.  (bug #1614) [Nate Woods]
32
3033- [Windows] Ensured that the "Debugger..." menu item is always present when
3134  the debugger is enabled in the New UI.  (bug #1636) [Nate Woods]
3235

Previous 15994 Revisions Next


© 1998-2018 The MESS Team