Previous 15994 Revisions Next

r11510 Wednesday 11th May, 2011 at 08:50:42 UTC by Miodrag Milanović
Fix build for winui/newui (no whatsnew)
[src/osd/winui]menu.c mui_util.c

src/osd/winui/menu.c
r11509r11510
8686//============================================================
8787
8888static int input_item_from_serial_number(running_machine &machine, int serial_number,
89   const input_port_config **port, const input_field_config **field, const input_setting_config **setting)
89   input_port_config **port, input_field_config **field, input_setting_config **setting)
9090{
9191   int i;
92   const input_port_config *this_port = NULL;
93   const input_field_config *this_field = NULL;
94   const input_setting_config *this_setting = NULL;
92   input_port_config *this_port = NULL;
93   input_field_config *this_field = NULL;
94   input_setting_config *this_setting = NULL;
9595
9696   i = 0;
9797   for (this_port = machine.m_portlist.first(); (i != serial_number) && (this_port != NULL); this_port = this_port->next())
9898   {
9999      i++;
100      for (this_field = this_port->fieldlist; (i != serial_number) && (this_field != NULL); this_field = this_field->next)
100      for (this_field = this_port->fieldlist().first(); (i != serial_number) && (this_field != NULL); this_field = this_field->next())
101101      {
102102         i++;
103         for (this_setting = this_field->settinglist; (i != serial_number) && (this_setting != NULL); this_setting = this_setting->next)
103         for (this_setting = this_field->settinglist().first(); (i != serial_number) && (this_setting != NULL); this_setting = this_setting->next())
104104         {
105105            i++;
106106         }
107107      }
108108   }
109109
110   if (this_setting != NULL)
111      this_field = this_setting->field;
112110   if (this_field != NULL)
113      this_port = this_field->port;
111      this_port = &this_field->port();
114112
115113   if (port != NULL)
116114      *port = this_port;
r11509r11510
127125//  serial_number_from_input_item
128126//============================================================
129127
130static int serial_number_from_input_item(running_machine &machine, const input_port_config *port,
131   const input_field_config *field, const input_setting_config *setting)
128static int serial_number_from_input_item(running_machine &machine, input_port_config *port,
129   input_field_config *field, input_setting_config *setting)
132130{
133131   int i;
134   const input_port_config *this_port;
135   const input_field_config *this_field;
136   const input_setting_config *this_setting;
132   input_port_config *this_port;
133   input_field_config *this_field;
134   input_setting_config *this_setting;
137135
138136   i = 0;
139137   for (this_port = machine.m_portlist.first(); this_port != NULL; this_port = this_port->next())
r11509r11510
142140         return i;
143141
144142      i++;
145      for (this_field = this_port->fieldlist; this_field != NULL; this_field = this_field->next)
143      for (this_field = this_port->fieldlist().first(); this_field != NULL; this_field = this_field->next())
146144      {
147145         if ((port == this_port) && (field == this_field) && (setting == NULL))
148146            return i;
149147
150148         i++;
151         for (this_setting = this_field->settinglist; this_setting != NULL; this_setting = this_setting->next)
149         for (this_setting = this_field->settinglist().first(); this_setting != NULL; this_setting = this_setting->next())
152150         {
153151            if ((port == this_port) && (field == this_field) && (setting == this_setting))
154152               return i;
r11509r11510
169167static void customize_input(running_machine &machine, HWND wnd, const char *title, int player, int inputclass)
170168{
171169   dialog_box *dlg;
172   const input_port_config *port;
173   const input_field_config *field;
170   input_port_config *port;
171   input_field_config *field;
174172   int this_inputclass, this_player, portslot_count = 0, i;
175173
176174   struct
r11509r11510
185183
186184   for (port = machine.m_portlist.first(); port != NULL; port = port->next())
187185   {
188      for (field = port->fieldlist; field != NULL; field = field->next)
186      for (field = port->fieldlist().first(); field != NULL; field = field->next())
189187      {
190188         this_inputclass = input_classify_port(field);
191189         if (input_field_name(field) && (this_inputclass == inputclass))
r11509r11510
307305static void customize_switches(running_machine &machine, HWND wnd, const char* title_string, UINT32 ipt_name)
308306{
309307   dialog_box *dlg;
310   const input_port_config *port;
311   const input_field_config *field;
312   const input_setting_config *setting;
308   input_port_config *port;
309   input_field_config *field;
310   input_setting_config *setting;
313311   const char *switch_name = NULL;
314312   input_field_user_settings settings;
315313
r11509r11510
321319
322320   for (port = machine.m_portlist.first(); port != NULL; port = port->next())
323321   {
324      for (field = port->fieldlist; field != NULL; field = field->next)
322      for (field = port->fieldlist().first(); field != NULL; field = field->next())
325323      {
326324         type = field->type;
327325
r11509r11510
334332            if (win_dialog_add_combobox(dlg, switch_name, settings.value, storeval_inputport, (void *) field))
335333               goto done;
336334
337            for (setting = field->settinglist; setting != NULL; setting = setting->next)
335            for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
338336            {
339337               if (win_dialog_add_combobox_item(dlg, setting->name, setting->value))
340338                  goto done;
r11509r11510
448446static void customize_analogcontrols(running_machine &machine, HWND wnd)
449447{
450448   dialog_box *dlg;
451   const input_port_config *port;
452   const input_field_config *field;
449   input_port_config *port;
450   input_field_config *field;
453451   input_field_user_settings settings;
454452   const char *name;
455453   char buf[255];
r11509r11510
461459
462460   for (port = machine.m_portlist.first(); port != NULL; port = port->next())
463461   {
464      for (field = port->fieldlist; field != NULL; field = field->next)
462      for (field = port->fieldlist().first(); field != NULL; field = field->next())
465463      {
466464         if (port_type_is_analog(field->type))
467465         {
r11509r11510
11171115   int i;
11181116   UINT command;
11191117   HMENU submenu = NULL;
1120   const input_port_config *port;
1121   const input_field_config *field;
1122   const input_setting_config *setting;
1118   input_port_config *port;
1119   input_field_config *field;
1120   input_setting_config *setting;
11231121   char buf[256];
11241122   int child_count = 0;
11251123
11261124   use_input_categories = 0;
11271125   for (port = machine.m_portlist.first(); port != NULL; port = port->next())
11281126   {
1129      for (field = port->fieldlist; field != NULL; field = field->next)
1127      for (field = port->fieldlist().first(); field != NULL; field = field->next())
11301128      {
11311129         if (field->type == IPT_CATEGORY)
11321130         {
r11509r11510
11451143      // using input categories
11461144      for (port = machine.m_portlist.first(); port != NULL; port = port->next())
11471145      {
1148         for (field = port->fieldlist; field != NULL; field = field->next)
1146         for (field = port->fieldlist().first(); field != NULL; field = field->next())
11491147         {
11501148            if (field->type == IPT_CATEGORY)
11511149            {
r11509r11510
11541152                  return;
11551153
11561154               // append all of the category settings
1157               for (setting = field->settinglist; setting != NULL; setting = setting->next)
1155               for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
11581156               {
11591157                  command = ID_INPUT_0 + serial_number_from_input_item(machine, port, field, setting);
11601158                  win_append_menu_utf8(submenu, MF_STRING, command, setting->name);
r11509r11510
12411239   UINT flags_for_writing;
12421240   device_image_interface *img = NULL;
12431241   int has_config, has_dipswitch, has_keyboard, has_analog, has_misc;
1244   const input_port_config *port;
1245   const input_field_config *field;
1246   const input_setting_config *setting;
1242   input_port_config *port;
1243   input_field_config *field;
1244   input_setting_config *setting;
12471245   int frameskip;
12481246   int orientation;
12491247   int speed;
r11509r11510
12781276   has_analog = 0;
12791277   for (port = window->machine().m_portlist.first(); port != NULL; port = port->next())
12801278   {
1281      for (field = port->fieldlist; field != NULL; field = field->next)
1279      for (field = port->fieldlist().first(); field != NULL; field = field->next())
12821280      {
12831281         if (port_type_is_analog(field->type))
12841282         {
r11509r11510
13401338   {
13411339      for (port = window->machine().m_portlist.first(); port != NULL; port = port->next())
13421340      {
1343         for (field = port->fieldlist; field != NULL; field = field->next)
1341         for (field = port->fieldlist().first(); field != NULL; field = field->next())
13441342         {
13451343            if (field->type == IPT_CATEGORY)
13461344            {
13471345               input_field_get_user_settings(field, &settings);
1348               for (setting = field->settinglist; setting != NULL; setting = setting->next)
1346               for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
13491347               {
13501348                  command = ID_INPUT_0 + serial_number_from_input_item(window->machine(), port, field, setting);
13511349                  set_command_state(menu_bar, command, (setting->value == settings.value) ? MFS_CHECKED : MFS_ENABLED);
r11509r11510
16781676   int dev_command;
16791677   device_image_interface *img;
16801678   UINT16 category;
1681   const input_field_config *field;
1682   const input_setting_config *setting;
1679   input_field_config *field;
1680   input_setting_config *setting;
16831681   LONG_PTR ptr = GetWindowLongPtr(wnd, GWLP_USERDATA);
16841682   win_window_info *window = (win_window_info *)ptr;
16851683   input_field_user_settings settings;
r11509r11510
18841882               input_field_get_user_settings(field, &settings);
18851883               category = 0;
18861884
1887               for (setting = field->settinglist; setting != NULL; setting = setting->next)
1885               for (setting = field->settinglist().first(); setting != NULL; setting = setting->next())
18881886               {
18891887                  if (settings.value == setting->value)
18901888                  {
src/osd/winui/mui_util.c
r11509r11510
432432         gameinfo->usesLightGun = FALSE;
433433         if (gamedrv->ipt != NULL)
434434         {
435            const input_port_config *port;
435            input_port_config *port;
436436            ioport_list portlist;
437
438            input_port_list_init(portlist, gamedrv->ipt, NULL, 0, FALSE, NULL);
437            astring errors;
439438            for (device_t *cfg = config.devicelist().first(); cfg != NULL; cfg = cfg->next())
440439            {
441440               if (cfg->input_ports()!=NULL) {
442      // workaround for r11433                input_port_list_init(portlist, cfg->input_ports(), NULL, 0, FALSE, cfg);
441                  input_port_list_init(*cfg, portlist, errors);
443442               }
444443            }
445444
446445            for (port = portlist.first(); port != NULL; port = port->next())
447446            {
448               const input_field_config *field;
449               for (field = port->fieldlist; field != NULL; field = field->next)
447               input_field_config *field;
448               for (field = port->fieldlist().first(); field != NULL; field = field->next())
450449               {
451450                  UINT32 type;
452451                  type = field->type;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team