uses device_mconfig_additions() to add ata slots, which allows you to just add the device and configure it rather than using the MCFG_ATA_INTERFACE_ADD #define. [smf]

This commit is contained in:
smf- 2013-12-17 20:37:12 +00:00
parent 0adc956c61
commit 42731038af
7 changed files with 54 additions and 34 deletions

View File

@ -272,6 +272,22 @@ void ata_interface_device::device_start()
}
}
static MACHINE_CONFIG_FRAGMENT( ata_interface )
MCFG_DEVICE_ADD( "0", ATA_SLOT, 0 )
MCFG_DEVICE_ADD( "1", ATA_SLOT, 0 )
MACHINE_CONFIG_END
//-------------------------------------------------
// machine_config_additions - return a pointer to
// the device's machine fragment
//-------------------------------------------------
machine_config_constructor ata_interface_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( ata_interface );
}
//**************************************************************************
// ATA SLOT DEVICE
//**************************************************************************

View File

@ -36,6 +36,7 @@ protected:
// device-level overrides
virtual void device_start();
virtual void device_config_complete();
private:
ata_device_interface *m_dev;
};
@ -62,16 +63,14 @@ SLOT_INTERFACE_EXTERN(ata_devices);
DEVICE CONFIGURATION MACROS
***************************************************************************/
#define MCFG_ATA_INTERFACE_ADD(_tag, _slotintf, _master, _slave, _fixed) \
#define MCFG_ATA_INTERFACE_ADD(_tag, _slot_intf, _master, _slave, _fixed) \
MCFG_DEVICE_ADD(_tag, ATA_INTERFACE, 0) \
MCFG_ATA_SLOT_ADD(_tag ":0", _slotintf, _master, _fixed) \
MCFG_ATA_SLOT_ADD(_tag ":1", _slotintf, _slave, _fixed) \
MCFG_DEVICE_MODIFY(_tag ":0") \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _master, _fixed) \
MCFG_DEVICE_MODIFY(_tag ":1") \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _slave, _fixed) \
MCFG_DEVICE_MODIFY(_tag)
#define MCFG_ATA_SLOT_ADD(_tag, _slot_intf, _def_slot, _fixed) \
MCFG_DEVICE_ADD(_tag, ATA_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _fixed)
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
@ -100,6 +99,7 @@ public:
protected:
// device-level overrides
virtual void device_start();
virtual machine_config_constructor device_mconfig_additions() const;
virtual void set_irq(int state);
virtual void set_dmarq(int state);

View File

@ -22,10 +22,12 @@
DEVICE CONFIGURATION MACROS
***************************************************************************/
#define MCFG_IDE_CONTROLLER_ADD(_tag, _slotintf, _master, _slave, _fixed) \
#define MCFG_IDE_CONTROLLER_ADD(_tag, _slot_intf, _master, _slave, _fixed) \
MCFG_DEVICE_ADD(_tag, IDE_CONTROLLER, 0) \
MCFG_ATA_SLOT_ADD(_tag ":0", _slotintf, _master, _fixed) \
MCFG_ATA_SLOT_ADD(_tag ":1", _slotintf, _slave, _fixed) \
MCFG_DEVICE_MODIFY(_tag ":0") \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _master, _fixed) \
MCFG_DEVICE_MODIFY(_tag ":1") \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _slave, _fixed) \
MCFG_DEVICE_MODIFY(_tag)
class ide_controller_device : public ata_interface_device
@ -43,10 +45,12 @@ public:
extern const device_type IDE_CONTROLLER;
#define MCFG_IDE_CONTROLLER_32_ADD(_tag, _slotintf, _master, _slave, _fixed) \
#define MCFG_IDE_CONTROLLER_32_ADD(_tag, _slot_intf, _master, _slave, _fixed) \
MCFG_DEVICE_ADD(_tag, IDE_CONTROLLER_32, 0) \
MCFG_ATA_SLOT_ADD(_tag ":0", _slotintf, _master, _fixed) \
MCFG_ATA_SLOT_ADD(_tag ":1", _slotintf, _slave, _fixed) \
MCFG_DEVICE_MODIFY(_tag ":0") \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _master, _fixed) \
MCFG_DEVICE_MODIFY(_tag ":1") \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _slave, _fixed) \
MCFG_DEVICE_MODIFY(_tag)
class ide_controller_32_device : public ide_controller_device
@ -70,10 +74,12 @@ private:
extern const device_type IDE_CONTROLLER_32;
#define MCFG_BUS_MASTER_IDE_CONTROLLER_ADD(_tag, _slotintf, _master, _slave, _fixed) \
#define MCFG_BUS_MASTER_IDE_CONTROLLER_ADD(_tag, _slot_intf, _master, _slave, _fixed) \
MCFG_DEVICE_ADD(_tag, BUS_MASTER_IDE_CONTROLLER, 0) \
MCFG_ATA_SLOT_ADD(_tag ":0", _slotintf, _master, _fixed) \
MCFG_ATA_SLOT_ADD(_tag ":1", _slotintf, _slave, _fixed) \
MCFG_DEVICE_MODIFY(_tag ":0") \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _master, _fixed) \
MCFG_DEVICE_MODIFY(_tag ":1") \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _slave, _fixed) \
MCFG_DEVICE_MODIFY(_tag)
#define MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(bmcpu, bmspace) \

View File

@ -22,10 +22,12 @@
DEVICE CONFIGURATION MACROS
***************************************************************************/
#define MCFG_VT83C461_ADD(_tag, _slotintf, _master, _slave, _fixed) \
#define MCFG_VT83C461_ADD(_tag, _slot_intf, _master, _slave, _fixed) \
MCFG_DEVICE_ADD(_tag, VT83C461, 0) \
MCFG_ATA_SLOT_ADD(_tag ":0", _slotintf, _master, _fixed) \
MCFG_ATA_SLOT_ADD(_tag ":1", _slotintf, _slave, _fixed) \
MCFG_DEVICE_MODIFY(_tag ":0") \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _master, _fixed) \
MCFG_DEVICE_MODIFY(_tag ":1") \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _slave, _fixed) \
MCFG_DEVICE_MODIFY(_tag)
#define IDE_CONFIG_REGISTERS 0x10

View File

@ -1806,8 +1806,8 @@ static MACHINE_CONFIG_START( cojagr3k, jaguar_state )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( cojagr3k_rom, cojagr3k )
MCFG_DEVICE_REMOVE("ide:0")
MCFG_ATA_SLOT_ADD("ide:0", ata_devices, NULL, true)
MCFG_DEVICE_MODIFY("ide:0")
MCFG_SLOT_DEFAULT_OPTION(NULL)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( cojag68k, cojagr3k )

View File

@ -2010,10 +2010,6 @@ static double analogue_inputs_callback( device_t *device, UINT8 input )
return 0;
}
SLOT_INTERFACE_START( ksys573_ata_devices )
SLOT_INTERFACE( "cr589", CR589 )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( cr589_config )
MCFG_DEVICE_MODIFY( "cdda" )
MCFG_SOUND_ROUTE( 0, "^^^^lspeaker", 1.0 )
@ -2035,11 +2031,13 @@ static MACHINE_CONFIG_START( konami573, ksys573_state )
MCFG_DEVICE_ADD( "mb89371", MB89371, 0 )
MCFG_ATA_INTERFACE_ADD( "ata", ksys573_ata_devices, "cr589", NULL, true )
MCFG_DEVICE_ADD( "ata", ATA_INTERFACE, 0 )
MCFG_ATA_INTERFACE_IRQ_HANDLER( WRITELINE( ksys573_state, ata_interrupt ) )
MCFG_DEVICE_MODIFY( "ata:0" )
MCFG_DEVICE_CARD_MACHINE_CONFIG( "cr589", cr589_config )
MCFG_SLOT_OPTION_ADD( "cr589", CR589 )
MCFG_SLOT_OPTION_MACHINE_CONFIG( "cr589", cr589_config )
MCFG_SLOT_DEFAULT_OPTION( "cr589" )
MCFG_DEVICE_ADD( "maincpu:sio1:cassette", KONAMI573_CASSETTE_SLOT_SERIAL, 0 )

View File

@ -606,10 +606,6 @@ static const aica_interface dc_aica_interface =
static const struct sh4_config sh4cpu_config = { 1, 0, 1, 0, 0, 0, 1, 1, 0, CPU_CLOCK };
SLOT_INTERFACE_START(dccons_ata_devices)
SLOT_INTERFACE("gdrom", GDROM)
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( gdrom_config )
MCFG_DEVICE_MODIFY("cdda")
MCFG_SOUND_ROUTE(0, "^^^^lspeaker", 1.0)
@ -650,13 +646,15 @@ static MACHINE_CONFIG_START( dc, dc_cons_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(0, "rspeaker", 1.0)
MCFG_AICARTC_ADD("aicartc", XTAL_32_768kHz )
MCFG_AICARTC_ADD("aicartc", XTAL_32_768kHz)
MCFG_ATA_INTERFACE_ADD("ata", dccons_ata_devices, "gdrom", NULL, true)
MCFG_DEVICE_ADD("ata", ATA_INTERFACE, 0)
MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(dc_cons_state, ata_interrupt))
MCFG_DEVICE_MODIFY("ata:0")
MCFG_DEVICE_CARD_MACHINE_CONFIG( "gdrom", gdrom_config )
MCFG_SLOT_OPTION_ADD("gdrom", GDROM)
MCFG_SLOT_OPTION_MACHINE_CONFIG("gdrom", gdrom_config)
MCFG_SLOT_DEFAULT_OPTION("gdrom")
MACHINE_CONFIG_END
/*