Previous 199869 Revisions Next

r34508 Tuesday 20th January, 2015 at 13:34:59 UTC by Fabio Priuli
ui: added bios settings and keyboard/keypad inputs in the
device option menu. nw.
[src/emu/ui]devopt.c

trunk/src/emu/ui/devopt.c
r243019r243020
4646   string.catprintf("Option: %s\n", m_option->name());
4747
4848   dev = const_cast<machine_config &>(machine().config()).device_add(&machine().config().root_device(), m_option->name(), m_option->devtype(), 0);
49     
49
5050   string.catprintf("Device: %s\n", dev->name());
5151   if (!m_mounted)
5252      string.cat("\nIf you select this option, the following items will be enabled:\n");
r243019r243020
153153            string.cat("\n");
154154      }
155155   }
156
157   // scan for BIOS settings
158   int bios = 0;
159   if (dev->rom_region())
160   {
161      astring bios_str;
162      // first loop through roms in search of default bios (shortname)
163      for (const rom_entry *rom = dev->rom_region(); !ROMENTRY_ISEND(rom); rom++)
164         if (ROMENTRY_ISDEFAULT_BIOS(rom))
165            bios_str.cpy(ROM_GETNAME(rom));
166
167      // then loop again to count bios options and to get the default bios complete name
168      for (const rom_entry *rom = dev->rom_region(); !ROMENTRY_ISEND(rom); rom++)
169      {
170         if (ROMENTRY_ISSYSTEM_BIOS(rom))
171         {
172            bios++;
173            if (bios_str == ROM_GETNAME(rom))
174               bios_str.cpy(ROM_GETHASHDATA(rom));
175         }
176      }
177     
178      if (bios)
179         string.catprintf("* BIOS settings:\n  %d options    [default: %s]\n", bios, bios_str.cstr());
180   }
156181   
157182   int input = 0, input_mj = 0, input_hana = 0, input_gamble = 0, input_analog = 0, input_adjust = 0;
158   int dips = 0, confs = 0;
183   int input_keypad = 0, input_keyboard = 0, dips = 0, confs = 0;
159184   astring errors, dips_opt, confs_opt;
160185   ioport_list portlist;
161186   device_iterator iptiter(*dev);
r243019r243020
176201            input_analog++;
177202         else if (field->type() == IPT_ADJUSTER)
178203            input_adjust++;
204         else if (field->type() == IPT_KEYPAD)
205            input_keypad++;
206         else if (field->type() == IPT_KEYBOARD)
207            input_keyboard++;
179208         else if (field->type() >= IPT_START1 && field->type() < IPT_UI_FIRST)
180209            input++;
181210         else if (field->type() == IPT_DIPSWITCH)
r243019r243020
210239      string.cat("* Dispwitch settings:\n").cat(dips_opt);
211240   if (confs)
212241      string.cat("* Configuration settings:\n").cat(confs_opt);
213   if (input + input_mj + input_hana + input_gamble + input_analog + input_adjust)
242   if (input + input_mj + input_hana + input_gamble + input_analog + input_adjust + input_keypad + input_keyboard)
214243      string.cat("* Input device(s):\n");
215244   if (input)
216      string.catprintf("  Player inputs    [%d inputs]\n", input);
245      string.catprintf("  User inputs    [%d inputs]\n", input);
217246   if (input_mj)
218247      string.catprintf("  Mahjong inputs    [%d inputs]\n", input_mj);
219248   if (input_hana)
r243019r243020
224253      string.catprintf("  Analog inputs    [%d inputs]\n", input_analog);
225254   if (input_adjust)
226255      string.catprintf("  Adjuster inputs    [%d inputs]\n", input_adjust);
256   if (input_keypad)
257      string.catprintf("  Keypad inputs    [%d inputs]\n", input_keypad);
258   if (input_keyboard)
259      string.catprintf("  Keyboard inputs    [%d inputs]\n", input_keyboard);
227260
228261   image_interface_iterator imgiter(*dev);
229262   if (imgiter.count() > 0)
r243019r243020
241274         string.catprintf("  %s    [default: %s]\n", slot->device().tag(), slot->default_option() ? slot->default_option() : "----");
242275   }
243276
244   if ((execiter.count() + scriter.count() + snditer.count() + imgiter.count() + slotiter.count() + input + input_mj + input_hana + input_gamble + input_analog + input_adjust) == 0)
277   if ((execiter.count() + scriter.count() + snditer.count() + imgiter.count() + slotiter.count() + bios + dips + confs
278       + input + input_mj + input_hana + input_gamble + input_analog + input_adjust + input_keypad + input_keyboard) == 0)
245279      string.cat("[None]\n");
246280
247281   const_cast<machine_config &>(machine().config()).device_remove(&machine().config().root_device(), m_option->name());


Previous 199869 Revisions Next


© 1997-2024 The MAME Team