From aabe655f96daecaac5ae6f238668c7c8252f2d98 Mon Sep 17 00:00:00 2001 From: smf- Date: Tue, 28 Aug 2012 17:27:34 +0000 Subject: [PATCH] (MESS) removed SCSIConfigTable from scsibus, scsi devices are now sub devices of the scsi bus (nw) --- src/mess/drivers/abc1600.c | 1 - src/mess/drivers/bullet.c | 16 ++++------------ src/mess/drivers/rmnimbus.c | 25 ++++++------------------- src/mess/drivers/v1050.c | 16 ++++------------ src/mess/includes/abc1600.h | 1 - src/mess/includes/rmnimbus.h | 5 ----- src/mess/machine/abc_hdc.c | 11 +---------- src/mess/machine/abc_xebec.c | 11 +---------- src/mess/machine/d9060.c | 13 ++----------- src/mess/machine/e01.c | 13 ++----------- src/mess/machine/lux4105.c | 15 ++++----------- src/mess/machine/scsibus.c | 6 ++---- src/mess/machine/scsibus.h | 1 - 13 files changed, 26 insertions(+), 108 deletions(-) diff --git a/src/mess/drivers/abc1600.c b/src/mess/drivers/abc1600.c index ec2cd182a81..1e10dc992b0 100644 --- a/src/mess/drivers/abc1600.c +++ b/src/mess/drivers/abc1600.c @@ -1932,7 +1932,6 @@ static MACHINE_CONFIG_START( abc1600, abc1600_state ) MCFG_E0516_ADD(E050_C16PC_TAG, XTAL_32_768kHz) MCFG_FD1797_ADD(SAB1797_02P_TAG, fdc_intf) MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, abc1600_floppy_interface) - MCFG_SCSIDEV_ADD("harddisk0", SCSIHD, SCSI_ID_0) MCFG_ABC99_ADD(abc99_intf) MCFG_S1410_ADD() diff --git a/src/mess/drivers/bullet.c b/src/mess/drivers/bullet.c index a46e27be8f0..d4956206784 100644 --- a/src/mess/drivers/bullet.c +++ b/src/mess/drivers/bullet.c @@ -1024,14 +1024,6 @@ static const wd17xx_interface bulletf_fdc_intf = // SCSIBus_interface scsi_intf //------------------------------------------------- -static const SCSIConfigTable scsi_dev_table = -{ - 1, /* 1 SCSI device */ - { - { "harddisk0" } - } -}; - WRITE_LINE_MEMBER( bulletf_state::req_w ) { if (state) @@ -1047,8 +1039,7 @@ WRITE_LINE_MEMBER( bulletf_state::req_w ) static const SCSIBus_interface scsi_intf = { - &scsi_dev_table, - NULL, + NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -1214,8 +1205,9 @@ static MACHINE_CONFIG_START( bulletf, bulletf_state ) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bullet_floppy_interface) MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics) MCFG_SERIAL_TERMINAL_ADD(TERMINAL_TAG, terminal_intf, 4800) - MCFG_SCSIBUS_ADD(SCSIBUS_TAG, scsi_intf) - MCFG_SCSIDEV_ADD("harddisk0", SCSIHD, SCSI_ID_0) + + MCFG_SCSIBUS_ADD(SCSIBUS_TAG, scsi_intf) + MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0) // software lists MCFG_SOFTWARE_LIST_ADD("flop_list", "wmbullet") diff --git a/src/mess/drivers/rmnimbus.c b/src/mess/drivers/rmnimbus.c index 0e5eb1bad55..6aa28991b1b 100644 --- a/src/mess/drivers/rmnimbus.c +++ b/src/mess/drivers/rmnimbus.c @@ -78,22 +78,9 @@ static const msm5205_interface msm5205_config = MSM5205_S48_4B /* 8 kHz */ }; -static const SCSIConfigTable nimbus_scsi_dev_table = -{ - 4, /* 4 SCSI devices */ - { - { HARDDISK0_TAG }, - { HARDDISK1_TAG }, - { HARDDISK2_TAG }, - { HARDDISK3_TAG }, - } -}; - - static const SCSIBus_interface scsibus_config = { - &nimbus_scsi_dev_table, - &nimbus_scsi_linechange + &nimbus_scsi_linechange }; static const centronics_interface nimbus_centronics_config = @@ -334,11 +321,11 @@ static MACHINE_CONFIG_START( nimbus, rmnimbus_state ) MCFG_WD2793_ADD(FDC_TAG, nimbus_wd17xx_interface ) MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(nimbus_floppy_interface) - MCFG_SCSIDEV_ADD(HARDDISK0_TAG, SCSIHD, SCSI_ID_0) - MCFG_SCSIDEV_ADD(HARDDISK1_TAG, SCSIHD, SCSI_ID_1) - MCFG_SCSIDEV_ADD(HARDDISK2_TAG, SCSIHD, SCSI_ID_2) - MCFG_SCSIDEV_ADD(HARDDISK3_TAG, SCSIHD, SCSI_ID_3) - MCFG_SCSIBUS_ADD(SCSIBUS_TAG, scsibus_config) + MCFG_SCSIBUS_ADD(SCSIBUS_TAG, scsibus_config) + MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0) + MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk1", SCSIHD, SCSI_ID_1) + MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk2", SCSIHD, SCSI_ID_2) + MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk3", SCSIHD, SCSI_ID_3) MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("1536K") diff --git a/src/mess/drivers/v1050.c b/src/mess/drivers/v1050.c index 6c2e10f237e..a1f0ae9ae6e 100644 --- a/src/mess/drivers/v1050.c +++ b/src/mess/drivers/v1050.c @@ -989,18 +989,9 @@ static const floppy_interface v1050_floppy_interface = // SCSIBus_interface sasi_intf //------------------------------------------------- -static const SCSIConfigTable sasi_dev_table = -{ - 1, /* 1 SCSI device */ - { - { "harddisk0" } - } -}; - static const SCSIBus_interface sasi_intf = { - &sasi_dev_table, - NULL, + NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -1120,10 +1111,11 @@ static MACHINE_CONFIG_START( v1050, v1050_state ) MCFG_TIMER_ADD(TIMER_SIO_TAG, sio_8251_tick) // SASI bus - MCFG_SCSIBUS_ADD(SASIBUS_TAG, sasi_intf) + MCFG_SCSIBUS_ADD(SASIBUS_TAG, sasi_intf) + MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0) + MCFG_TIMER_ADD(TIMER_ACK_TAG, sasi_ack_tick) MCFG_TIMER_ADD(TIMER_RST_TAG, sasi_rst_tick) - MCFG_SCSIDEV_ADD("harddisk0", SCSIHD, SCSI_ID_0) // keyboard MCFG_V1050_KEYBOARD_ADD() diff --git a/src/mess/includes/abc1600.h b/src/mess/includes/abc1600.h index 948515487fe..17cf6bbf51c 100644 --- a/src/mess/includes/abc1600.h +++ b/src/mess/includes/abc1600.h @@ -16,7 +16,6 @@ #include "machine/e0516.h" #include "machine/lux4105.h" #include "machine/nmc9306.h" -#include "machine/scsihd.h" #include "machine/s1410.h" #include "machine/wd17xx.h" #include "machine/z80dart.h" diff --git a/src/mess/includes/rmnimbus.h b/src/mess/includes/rmnimbus.h index 60b4e310f63..37100f8646e 100644 --- a/src/mess/includes/rmnimbus.h +++ b/src/mess/includes/rmnimbus.h @@ -314,11 +314,6 @@ extern const wd17xx_interface nimbus_wd17xx_interface; #define NO_DRIVE_SELECTED 0xFF /* SASI harddisk interface */ -#define HARDDISK0_TAG "harddisk0" -#define HARDDISK1_TAG "harddisk1" -#define HARDDISK2_TAG "harddisk2" -#define HARDDISK3_TAG "harddisk3" - #define SCSIBUS_TAG "scsibus" void nimbus_scsi_linechange(device_t *device, UINT8 line, UINT8 state); diff --git a/src/mess/machine/abc_hdc.c b/src/mess/machine/abc_hdc.c index 4acbb0ab8d4..a155d0e1129 100644 --- a/src/mess/machine/abc_hdc.c +++ b/src/mess/machine/abc_hdc.c @@ -88,17 +88,8 @@ static const z80_daisy_config daisy_chain[] = // SCSIBus_interface sasi_intf //------------------------------------------------- -static const SCSIConfigTable sasi_dev_table = -{ - 1, /* 1 SCSI device */ - { - { "harddisk0" } - } -}; - static const SCSIBus_interface sasi_intf = { - &sasi_dev_table, NULL, DEVCB_NULL, DEVCB_NULL, @@ -121,7 +112,7 @@ static MACHINE_CONFIG_FRAGMENT( abc_hdc ) MCFG_CPU_CONFIG(daisy_chain) MCFG_SCSIBUS_ADD(SASIBUS_TAG, sasi_intf) - MCFG_SCSIDEV_ADD("harddisk0", SCSIHD, SCSI_ID_0) + MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0) MACHINE_CONFIG_END diff --git a/src/mess/machine/abc_xebec.c b/src/mess/machine/abc_xebec.c index 9688eb5ec4e..39396c5b9ba 100644 --- a/src/mess/machine/abc_xebec.c +++ b/src/mess/machine/abc_xebec.c @@ -81,17 +81,8 @@ static const z80_daisy_config daisy_chain[] = // SCSIBus_interface sasi_intf //------------------------------------------------- -static const SCSIConfigTable sasi_dev_table = -{ - 1, /* 1 SCSI device */ - { - { "harddisk0" } - } -}; - static const SCSIBus_interface sasi_intf = { - &sasi_dev_table, NULL, DEVCB_NULL, DEVCB_NULL, @@ -114,7 +105,7 @@ static MACHINE_CONFIG_FRAGMENT( abc_xebec ) MCFG_CPU_CONFIG(daisy_chain) MCFG_SCSIBUS_ADD(SASIBUS_TAG, sasi_intf) - MCFG_SCSIDEV_ADD("harddisk0", SCSIHD, SCSI_ID_0) + MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0) MACHINE_CONFIG_END diff --git a/src/mess/machine/d9060.c b/src/mess/machine/d9060.c index 115568baa09..3024c1dda9e 100644 --- a/src/mess/machine/d9060.c +++ b/src/mess/machine/d9060.c @@ -139,14 +139,6 @@ ADDRESS_MAP_END // SCSIBus_interface sasi_intf //------------------------------------------------- -static const SCSIConfigTable sasi_dev_table = -{ - 1, /* 1 SCSI device */ - { - { "harddisk0" } - } -}; - WRITE_LINE_MEMBER( base_d9060_device::req_w ) { m_via->write_ca1(!state); @@ -154,8 +146,7 @@ WRITE_LINE_MEMBER( base_d9060_device::req_w ) static const SCSIBus_interface sasi_intf = { - &sasi_dev_table, - NULL, + NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -469,7 +460,7 @@ static MACHINE_CONFIG_FRAGMENT( d9060 ) MCFG_VIA6522_ADD(M6522_TAG, XTAL_4MHz/4, via_intf) MCFG_SCSIBUS_ADD(SASIBUS_TAG, sasi_intf) - MCFG_SCSIDEV_ADD("harddisk0", SCSIHD, SCSI_ID_0) + MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0) MACHINE_CONFIG_END diff --git a/src/mess/machine/e01.c b/src/mess/machine/e01.c index 88052328690..c414bcf00d9 100644 --- a/src/mess/machine/e01.c +++ b/src/mess/machine/e01.c @@ -262,14 +262,6 @@ static const wd17xx_interface fdc_intf = // SCSIBus_interface scsi_intf //------------------------------------------------- -static const SCSIConfigTable scsi_dev_table = -{ - 1, /* 1 SCSI device */ - { - { "harddisk0" } - } -}; - WRITE_LINE_MEMBER( e01_device::scsi_bsy_w ) { if (!state) @@ -291,8 +283,7 @@ WRITE_LINE_MEMBER( e01_device::scsi_req_w ) static const SCSIBus_interface scsi_intf = { - &scsi_dev_table, - NULL, + NULL, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, scsi_bsy_w), DEVCB_NULL, DEVCB_NULL, @@ -357,7 +348,7 @@ static MACHINE_CONFIG_FRAGMENT( e01 ) MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, e01_centronics_intf) MCFG_SCSIBUS_ADD(SCSIBUS_TAG, scsi_intf) - MCFG_SCSIDEV_ADD("harddisk0", SCSIHD, SCSI_ID_0) + MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0) // internal ram MCFG_RAM_ADD(RAM_TAG) diff --git a/src/mess/machine/lux4105.c b/src/mess/machine/lux4105.c index 16b026e6c69..2a73142c818 100644 --- a/src/mess/machine/lux4105.c +++ b/src/mess/machine/lux4105.c @@ -8,6 +8,7 @@ *********************************************************************/ #include "lux4105.h" +#include "machine/scsihd.h" @@ -30,14 +31,6 @@ const device_type LUXOR_4105 = &device_creator; // SCSIBus_interface sasi_intf //------------------------------------------------- -static const SCSIConfigTable sasi_dev_table = -{ - 1, /* 1 SCSI device */ - { - { "harddisk0" } - } -}; - WRITE_LINE_MEMBER( luxor_4105_device::sasi_bsy_w ) { if (!state) @@ -70,8 +63,7 @@ WRITE_LINE_MEMBER( luxor_4105_device::sasi_req_w ) static const SCSIBus_interface sasi_intf = { - &sasi_dev_table, - NULL, + NULL, DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, luxor_4105_device, sasi_bsy_w), DEVCB_NULL, DEVCB_NULL, @@ -87,7 +79,8 @@ static const SCSIBus_interface sasi_intf = //------------------------------------------------- static MACHINE_CONFIG_FRAGMENT( luxor_4105 ) - MCFG_SCSIBUS_ADD(SASIBUS_TAG, sasi_intf) + MCFG_SCSIBUS_ADD(SASIBUS_TAG, sasi_intf) + MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0) MACHINE_CONFIG_END diff --git a/src/mess/machine/scsibus.c b/src/mess/machine/scsibus.c index 93711343ee2..e364fc37a04 100644 --- a/src/mess/machine/scsibus.c +++ b/src/mess/machine/scsibus.c @@ -883,11 +883,9 @@ void scsibus_device::device_start() sel_timer=timer_alloc(2); dataout_timer=timer_alloc(3); - // try to open the devices - for (int devno = 0; devno < scsidevs->devs_present; devno++) + for( device_t *device = first_subdevice(); device != NULL; device = device->next() ) { - LOG(1,"SCSIBUS:init devno=%d \n",devno); - scsidev_device *scsidev = owner()->subdevice( scsidevs->devices[devno].tag ); + scsidev_device *scsidev = downcast(device); devices[scsidev->GetDeviceID()] = scsidev; } } diff --git a/src/mess/machine/scsibus.h b/src/mess/machine/scsibus.h index 10c35251a07..96e582cc4ad 100644 --- a/src/mess/machine/scsibus.h +++ b/src/mess/machine/scsibus.h @@ -21,7 +21,6 @@ typedef struct _SCSIBus_interface SCSIBus_interface; struct _SCSIBus_interface { - const SCSIConfigTable *scsidevs; /* SCSI devices */ void (*line_change_cb)(device_t *, UINT8 line, UINT8 state); devcb_write_line _out_bsy_func;