示例#1
0
        protected machine_static_info(ui_options options, machine_config config, ioport_list ports)
        {
            m_options             = options;
            m_flags               = config.gamedrv().flags;
            m_unemulated_features = config.gamedrv().type.unemulated_features();
            m_imperfect_features  = config.gamedrv().type.imperfect_features();
            m_has_bioses          = false;
            m_has_dips            = false;
            m_has_configs         = false;
            m_has_keyboard        = false;
            m_has_test_switch     = false;
            m_has_analog          = false;


            ioport_list local_ports = new ioport_list();
            string      sink;

            foreach (device_t device in new device_enumerator(config.root_device()))
            {
                // the "no sound hardware" warning doesn't make sense when you plug in a sound card
                if (device.GetClassInterface <device_sound_interface>() != null)  // dynamic_cast<device_sound_interface *>(&device))
                {
                    m_flags &= ~machine_flags.type.NO_SOUND_HW;
                }

                // build overall emulation status
                m_unemulated_features |= device.type().unemulated_features();
                m_imperfect_features  |= device.type().imperfect_features();

                // look for BIOS options
                device_t parent            = device.owner();
                device_slot_interface slot = device.GetClassInterface <device_slot_interface>();  //device_slot_interface const *const slot(dynamic_cast<device_slot_interface const *>(parent));
                if (parent == null || (slot != null && (slot.get_card_device() == device)))
                {
                    for (Pointer <tiny_rom_entry> rom = device.rom_region(); !m_has_bioses && rom != null && !ROMENTRY_ISEND(rom.op); ++rom)  //for (tiny_rom_entry const *rom = device.rom_region(); !m_has_bioses && rom && !ROMENTRY_ISEND(rom); ++rom)
                    {
                        if (ROMENTRY_ISSYSTEM_BIOS(rom.op))
                        {
                            m_has_bioses = true;
                        }
                    }
                }
            }

            // suppress "requires external artwork" warning when external artwork was loaded
            if (config.root_device().has_running_machine())
            {
                for (render_target target = config.root_device().machine().render().first_target(); target != null; target = target.next())
                {
                    if (!target.hidden() && target.external_artwork())
                    {
                        m_flags &= ~machine_flags.type.REQUIRES_ARTWORK;
                        break;
                    }
                }
            }

            // unemulated trumps imperfect when aggregating (always be pessimistic)
            m_imperfect_features &= ~m_unemulated_features;

            // scan the input port array to see what options we need to enable
            foreach (var port in (ports != null ? ports : local_ports))
            {
                foreach (ioport_field field in port.Value.fields())
                {
                    switch (field.type())
                    {
                    case ioport_type.IPT_DIPSWITCH: m_has_dips = true;          break;

                    case ioport_type.IPT_CONFIG:    m_has_configs = true;       break;

                    case ioport_type.IPT_KEYBOARD:  m_has_keyboard = true;      break;

                    case ioport_type.IPT_SERVICE:   m_has_test_switch = true;   break;

                    default: break;
                    }

                    if (field.is_analog())
                    {
                        m_has_analog = true;
                    }
                }
            }
        }
示例#2
0
文件: info.cs 项目: kwanboy/mcs
        protected machine_static_info(machine_config config, ioport_list ports)
        {
            m_flags = config.gamedrv().flags;
            m_unemulated_features = config.gamedrv().type.unemulated_features();
            m_imperfect_features  = config.gamedrv().type.imperfect_features();
            m_has_bioses          = false;
            m_has_dips            = false;
            m_has_configs         = false;
            m_has_keyboard        = false;
            m_has_test_switch     = false;
            m_has_analog          = false;


            ioport_list local_ports = new ioport_list();
            string      sink;

            foreach (device_t device in new device_iterator(config.root_device()))
            {
                // the "no sound hardware" warning doesn't make sense when you plug in a sound card
                if (device.GetClassInterface <device_sound_interface>() != null)  // dynamic_cast<device_sound_interface *>(&device))
                {
                    m_flags &= ~machine_flags.type.NO_SOUND_HW;
                }

                // build overall emulation status
                m_unemulated_features |= device.type().unemulated_features();
                m_imperfect_features  |= device.type().imperfect_features();

                // look for BIOS options
                List <tiny_rom_entry> rom = device.rom_region();
                for (int romOffset = 0; !m_has_bioses && rom != null && rom[romOffset] != null && !romload_global.ROMENTRY_ISEND(rom[romOffset]); ++romOffset)
                {
                    if (romload_global.ROMENTRY_ISSYSTEM_BIOS(rom[romOffset]))
                    {
                        m_has_bioses = true;
                    }
                }

                // if we don't have ports passed in, build here
                if (ports == null)
                {
                    local_ports.append(device, out sink);
                }
            }

            // unemulated trumps imperfect when aggregating (always be pessimistic)
            m_imperfect_features &= ~m_unemulated_features;

            // scan the input port array to see what options we need to enable
            foreach (var port in (ports != null ? ports : local_ports))
            {
                foreach (ioport_field field in port.Value.fields())
                {
                    switch (field.type())
                    {
                    case ioport_type.IPT_DIPSWITCH: m_has_dips = true;          break;

                    case ioport_type.IPT_CONFIG:    m_has_configs = true;       break;

                    case ioport_type.IPT_KEYBOARD:  m_has_keyboard = true;      break;

                    case ioport_type.IPT_SERVICE:   m_has_test_switch = true;   break;

                    default: break;
                    }

                    if (field.is_analog())
                    {
                        m_has_analog = true;
                    }
                }
            }
        }