mirror of
https://github.com/holub/mame
synced 2025-06-01 02:21:48 +03:00
pci: Autodetect multifunction devices [O. Galibert]
This commit is contained in:
parent
7b2709ae75
commit
5d4e31f8b1
@ -63,6 +63,7 @@ pci_device::pci_device(const machine_config &mconfig, device_type type, const ch
|
||||
revision = 0x00;
|
||||
pclass = 0xffffff;
|
||||
subsystem_id = 0xffffffff;
|
||||
is_multifunction_device = false;
|
||||
}
|
||||
|
||||
void pci_device::set_ids(UINT32 _main_id, UINT8 _revision, UINT32 _pclass, UINT32 _subsystem_id)
|
||||
@ -194,9 +195,14 @@ READ8_MEMBER(pci_device::latency_timer_r)
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
void pci_device::set_multifunction_device(bool enable)
|
||||
{
|
||||
is_multifunction_device = enable;
|
||||
}
|
||||
|
||||
READ8_MEMBER(pci_device::header_type_r)
|
||||
{
|
||||
return 0x00;
|
||||
return is_multifunction_device ? 0x80 : 0x00;
|
||||
}
|
||||
|
||||
READ8_MEMBER(pci_device::bist_r)
|
||||
@ -237,10 +243,6 @@ READ8_MEMBER(pci_device::capptr_r)
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
void pci_device::scan_sub_devices(pci_device **devices, dynamic_array<pci_device *> &all, dynamic_array<pci_device *> &bridges, device_t *root)
|
||||
{
|
||||
}
|
||||
|
||||
void pci_device::set_remap_cb(mapper_cb _remap_cb)
|
||||
{
|
||||
remap_cb = _remap_cb;
|
||||
@ -425,6 +427,9 @@ void pci_bridge_device::device_start()
|
||||
|
||||
for(int i=0; i<32*8; i++)
|
||||
if(sub_devices[i]) {
|
||||
if((i & 7) && sub_devices[i & ~7])
|
||||
sub_devices[i & ~7]->set_multifunction_device(true);
|
||||
|
||||
all_devices.append(sub_devices[i]);
|
||||
if(sub_devices[i] != this) {
|
||||
sub_devices[i]->remap_config_cb = cf_cb;
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
pci_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
|
||||
|
||||
void set_ids(UINT32 main_id, UINT8 revision, UINT32 pclass, UINT32 subsystem_id);
|
||||
void set_multifunction_device(bool enable);
|
||||
|
||||
virtual void set_remap_cb(mapper_cb _remap_cb);
|
||||
virtual void reset_all_mappings();
|
||||
@ -109,12 +110,11 @@ protected:
|
||||
const UINT8 *expansion_rom;
|
||||
UINT32 expansion_rom_size;
|
||||
UINT32 expansion_rom_base;
|
||||
bool is_multifunction_device;
|
||||
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
static void scan_sub_devices(pci_device **devices, dynamic_array<pci_device *> &all, dynamic_array<pci_device *> &bridges, device_t *root);
|
||||
|
||||
void skip_map_regs(int count);
|
||||
void add_map(UINT64 size, int flags, address_map_delegate &map);
|
||||
template <typename T> void add_map(UINT64 size, int flags, void (T::*map)(address_map &map, device_t &device), const char *name) {
|
||||
|
Loading…
Reference in New Issue
Block a user