Previous 15994 Revisions Next

r12467 Wednesday 3rd August, 2011 at 13:31:21 UTC by Miodrag Milanović
Added validation to check if required devices with roms are listed in lst file, and added those that were found missing (no whatsnew)
[src/emu]validity.c
[src/mess]mess_dev.lst
[src/mess/machine]comx_prn.c cpc_ssa1.h

src/emu/validity.c
r12466r12467
6363};
6464
6565
66extern const device_type *s_devices_sorted[];
67extern int m_device_count;
6668
6769/***************************************************************************
6870    INLINE FUNCTIONS
r12466r12467
440442   int items_since_region = 1;
441443   bool error = false;
442444
445   const rom_source *first_source = rom_first_source(config);
446   
443447   /* iterate, starting with the driver's ROMs and continuing with device ROMs */
444448   for (const rom_source *source = rom_first_source(config); source != NULL; source = rom_next_source(*source))
445449   {
r12466r12467
559563      /* final check for empty regions */
560564      if (items_since_region == 0)
561565         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      }
562590   }
563591
564592   return error;
r12466r12467
11091137
11101138
11111139/*-------------------------------------------------
1140    validate_slots - run per-slot validity
1141    checks
1142-------------------------------------------------*/
1143
1144static 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/*-------------------------------------------------
11121190    validate_drivers - master validity checker
11131191-------------------------------------------------*/
11141192
r12466r12467
12151293         /* validate devices */
12161294         device_checks -= get_profile_ticks();
12171295         error = validate_devices(drivlist, portlist, &rgninfo) || error;
1296         error = validate_slots(drivlist) || error;
12181297         device_checks += get_profile_ticks();
12191298      }
12201299      catch (emu_fatalerror &err)
src/mess/machine/cpc_ssa1.h
r12466r12467
9999   // device-level overrides
100100   virtual void device_start();
101101   virtual void device_reset();
102    virtual void device_config_complete() { m_shortname = "cpc_ssa1"; }
102    virtual void device_config_complete() { m_shortname = "cpc_dkspeech"; }
103103
104104private:
105105   cpc_expansion_slot_device *m_slot;
src/mess/machine/comx_prn.c
r12466r12467
5050//-------------------------------------------------
5151
5252comx_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),
5454   device_comx_expansion_card_interface(mconfig, *this),
5555   device_slot_card_interface(mconfig, *this)
5656{
src/mess/mess_dev.lst
r12466r12467
7070COMX_CLM
7171COMX_EB
7272COMX_FD
73COMX_EPR
74COMX_THM
75COMX_PRN
7376COMXPL80
7477S100_DJ2DB
78S100_DJDMA
79S100_MM65K16S
7580EGRET
7681ECB_GRIP21
7782HD61830
r12466r12467
8388KB_KEYTRONIC
8489LUXOR_55_10828
8590LUXOR_55_21046
86S100_MM65K16S
8791HFDC
8892NUBUS_48GC
8993NUBUS_CB264
r12466r12467
101105TIFDC
102106UPD7220
103107VIC1112
108ABC_UNI800
109ABC_SLUTPROV
110CPC_SSA1
111CPC_DKSPEECH
112C64_XL80

Previous 15994 Revisions Next


© 1998-2018 The MESS Team