trunk/src/emu/ui/devopt.c
| r243019 | r243020 | |
| 46 | 46 | string.catprintf("Option: %s\n", m_option->name()); |
| 47 | 47 | |
| 48 | 48 | dev = const_cast<machine_config &>(machine().config()).device_add(&machine().config().root_device(), m_option->name(), m_option->devtype(), 0); |
| 49 | | |
| 49 | |
| 50 | 50 | string.catprintf("Device: %s\n", dev->name()); |
| 51 | 51 | if (!m_mounted) |
| 52 | 52 | string.cat("\nIf you select this option, the following items will be enabled:\n"); |
| r243019 | r243020 | |
| 153 | 153 | string.cat("\n"); |
| 154 | 154 | } |
| 155 | 155 | } |
| 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 | } |
| 156 | 181 | |
| 157 | 182 | 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; |
| 159 | 184 | astring errors, dips_opt, confs_opt; |
| 160 | 185 | ioport_list portlist; |
| 161 | 186 | device_iterator iptiter(*dev); |
| r243019 | r243020 | |
| 176 | 201 | input_analog++; |
| 177 | 202 | else if (field->type() == IPT_ADJUSTER) |
| 178 | 203 | input_adjust++; |
| 204 | else if (field->type() == IPT_KEYPAD) |
| 205 | input_keypad++; |
| 206 | else if (field->type() == IPT_KEYBOARD) |
| 207 | input_keyboard++; |
| 179 | 208 | else if (field->type() >= IPT_START1 && field->type() < IPT_UI_FIRST) |
| 180 | 209 | input++; |
| 181 | 210 | else if (field->type() == IPT_DIPSWITCH) |
| r243019 | r243020 | |
| 210 | 239 | string.cat("* Dispwitch settings:\n").cat(dips_opt); |
| 211 | 240 | if (confs) |
| 212 | 241 | 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) |
| 214 | 243 | string.cat("* Input device(s):\n"); |
| 215 | 244 | if (input) |
| 216 | | string.catprintf(" Player inputs [%d inputs]\n", input); |
| 245 | string.catprintf(" User inputs [%d inputs]\n", input); |
| 217 | 246 | if (input_mj) |
| 218 | 247 | string.catprintf(" Mahjong inputs [%d inputs]\n", input_mj); |
| 219 | 248 | if (input_hana) |
| r243019 | r243020 | |
| 224 | 253 | string.catprintf(" Analog inputs [%d inputs]\n", input_analog); |
| 225 | 254 | if (input_adjust) |
| 226 | 255 | 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); |
| 227 | 260 | |
| 228 | 261 | image_interface_iterator imgiter(*dev); |
| 229 | 262 | if (imgiter.count() > 0) |
| r243019 | r243020 | |
| 241 | 274 | string.catprintf(" %s [default: %s]\n", slot->device().tag(), slot->default_option() ? slot->default_option() : "----"); |
| 242 | 275 | } |
| 243 | 276 | |
| 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) |
| 245 | 279 | string.cat("[None]\n"); |
| 246 | 280 | |
| 247 | 281 | const_cast<machine_config &>(machine().config()).device_remove(&machine().config().root_device(), m_option->name()); |