src/emu/validity.c
| r12466 | r12467 | |
| 63 | 63 | }; |
| 64 | 64 | |
| 65 | 65 | |
| 66 | extern const device_type *s_devices_sorted[]; |
| 67 | extern int m_device_count; |
| 66 | 68 | |
| 67 | 69 | /*************************************************************************** |
| 68 | 70 | INLINE FUNCTIONS |
| r12466 | r12467 | |
| 440 | 442 | int items_since_region = 1; |
| 441 | 443 | bool error = false; |
| 442 | 444 | |
| 445 | const rom_source *first_source = rom_first_source(config); |
| 446 | |
| 443 | 447 | /* iterate, starting with the driver's ROMs and continuing with device ROMs */ |
| 444 | 448 | for (const rom_source *source = rom_first_source(config); source != NULL; source = rom_next_source(*source)) |
| 445 | 449 | { |
| r12466 | r12467 | |
| 559 | 563 | /* final check for empty regions */ |
| 560 | 564 | if (items_since_region == 0) |
| 561 | 565 | mame_printf_warning("%s: %s has empty ROM region (warning)\n", driver.source_file, driver.name); |
| 566 | |
| 567 | if (source!=first_source) { |
| 568 | // check for device roms |
| 569 | device_type type = source->type(); |
| 570 | int cnt = 0; |
| 571 | for (const rom_entry *romp = rom_first_region(*source); !ROMENTRY_ISEND(romp); romp++) |
| 572 | { |
| 573 | if (ROMENTRY_ISFILE(romp)) { |
| 574 | cnt++; |
| 575 | } |
| 576 | } |
| 577 | if (cnt > 0) { |
| 578 | bool found = false; |
| 579 | for(int i=0;i<m_device_count;i++) { |
| 580 | if (type==*s_devices_sorted[i]) |
| 581 | { |
| 582 | found = true; |
| 583 | break; |
| 584 | } |
| 585 | } |
| 586 | if (!found) |
| 587 | mame_printf_error("Device %s is not listed in device list\n", source->shortname()); |
| 588 | } |
| 589 | } |
| 562 | 590 | } |
| 563 | 591 | |
| 564 | 592 | return error; |
| r12466 | r12467 | |
| 1109 | 1137 | |
| 1110 | 1138 | |
| 1111 | 1139 | /*------------------------------------------------- |
| 1140 | validate_slots - run per-slot validity |
| 1141 | checks |
| 1142 | -------------------------------------------------*/ |
| 1143 | |
| 1144 | static bool validate_slots(driver_enumerator &drivlist) |
| 1145 | { |
| 1146 | bool error = false; |
| 1147 | const machine_config &config = drivlist.config(); |
| 1148 | |
| 1149 | const device_slot_interface *slot = NULL; |
| 1150 | for (bool gotone = config.devicelist().first(slot); gotone; gotone = slot->next(slot)) |
| 1151 | { |
| 1152 | const slot_interface* intf = slot->get_slot_interfaces(); |
| 1153 | for (int j = 0; intf[j].name != NULL; j++) |
| 1154 | { |
| 1155 | device_t *dev = (*intf[j].devtype)(config, "dummy", config.devicelist().first(), 0); |
| 1156 | dev->config_complete(); |
| 1157 | if (dev->rom_region() != NULL) |
| 1158 | { |
| 1159 | int cnt = 0; |
| 1160 | for (const rom_entry *romp = rom_first_region(*dev); !ROMENTRY_ISEND(romp); romp++) |
| 1161 | { |
| 1162 | if (ROMENTRY_ISFILE(romp)) { |
| 1163 | cnt++; |
| 1164 | } |
| 1165 | } |
| 1166 | |
| 1167 | if (cnt > 0) { |
| 1168 | bool found = false; |
| 1169 | for(int i=0;i<m_device_count;i++) { |
| 1170 | if (intf[j].devtype==*s_devices_sorted[i]) |
| 1171 | { |
| 1172 | found = true; |
| 1173 | break; |
| 1174 | } |
| 1175 | } |
| 1176 | if (!found) { |
| 1177 | mame_printf_error("Device %s in slot %s is not listed in device list\n", dev->name(), intf[j].name); |
| 1178 | error = true; |
| 1179 | } |
| 1180 | } |
| 1181 | } |
| 1182 | global_free(dev); |
| 1183 | } |
| 1184 | } |
| 1185 | return error; |
| 1186 | } |
| 1187 | |
| 1188 | |
| 1189 | /*------------------------------------------------- |
| 1112 | 1190 | validate_drivers - master validity checker |
| 1113 | 1191 | -------------------------------------------------*/ |
| 1114 | 1192 | |
| r12466 | r12467 | |
| 1215 | 1293 | /* validate devices */ |
| 1216 | 1294 | device_checks -= get_profile_ticks(); |
| 1217 | 1295 | error = validate_devices(drivlist, portlist, &rgninfo) || error; |
| 1296 | error = validate_slots(drivlist) || error; |
| 1218 | 1297 | device_checks += get_profile_ticks(); |
| 1219 | 1298 | } |
| 1220 | 1299 | catch (emu_fatalerror &err) |
src/mess/machine/comx_prn.c
| r12466 | r12467 | |
| 50 | 50 | //------------------------------------------------- |
| 51 | 51 | |
| 52 | 52 | comx_prn_device::comx_prn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 53 | | device_t(mconfig, COMX_PRN, "COMX-35 Thermal Printer Card", tag, owner, clock), |
| 53 | device_t(mconfig, COMX_PRN, "COMX-35 F&M Printer Card", tag, owner, clock), |
| 54 | 54 | device_comx_expansion_card_interface(mconfig, *this), |
| 55 | 55 | device_slot_card_interface(mconfig, *this) |
| 56 | 56 | { |