Esempio n. 1
0
        public input_device add_device(input_device new_device)
        {
            assert(new_device.devclass() == m_devclass);

            // find the next empty index
            for (int devindex = 0; devindex < input_global.DEVICE_INDEX_MAXIMUM; devindex++)
            {
                if (m_device[devindex] == null)
                {
                    // update the device and maximum index found
                    new_device.set_devindex(devindex);
                    m_maxindex = Math.Max(m_maxindex, devindex);

                    if (new_device.id()[0] == 0)
                    {
                        osd_printf_verbose("Input: Adding {0} #{1}: {2}\n", m_name, devindex, new_device.name());
                    }
                    else
                    {
                        osd_printf_verbose("Input: Adding {0} #{1}: {2} (device id: {3})\n", m_name, devindex, new_device.name(), new_device.id());
                    }

                    m_device[devindex] = new_device;
                    return(m_device[devindex]);
                }
            }

            throw new emu_fatalerror("Input: Too many {0} devices\n", m_name);
        }
Esempio n. 2
0
 public input_code code()
 {
     return(new input_code(m_device.devclass(), m_device.devindex(), m_itemclass, input_item_modifier.ITEM_MODIFIER_NONE, m_itemid));
 }