SCSI Port using WRITELINE and DEVCB2. The slot number and SCSI ID are separate so you can for example have -harddisk1 as ID 6 and -harddisk 2 as ID 5. The HLE'd CD & HD have configuration switches to set the ID, real emulated hardware will specify the ID using it's own method. [smf]

This commit is contained in:
smf- 2014-04-14 11:50:39 +00:00
parent 51360b1370
commit a039e59ae2
87 changed files with 2495 additions and 2103 deletions

26
.gitattributes vendored
View File

@ -1202,12 +1202,22 @@ src/emu/bus/saturn/sat_slot.c svneol=native#text/plain
src/emu/bus/saturn/sat_slot.h svneol=native#text/plain
src/emu/bus/scsi/acb4070.c svneol=native#text/plain
src/emu/bus/scsi/acb4070.h svneol=native#text/plain
src/emu/bus/scsi/cdu76s.c svneol=native#text/plain
src/emu/bus/scsi/cdu76s.h svneol=native#text/plain
src/emu/bus/scsi/d9060hd.c svneol=native#text/plain
src/emu/bus/scsi/d9060hd.h svneol=native#text/plain
src/emu/bus/scsi/s1410.c svneol=native#text/plain
src/emu/bus/scsi/s1410.h svneol=native#text/plain
src/emu/bus/scsi/sa1403d.c svneol=native#text/plain
src/emu/bus/scsi/sa1403d.h svneol=native#text/plain
src/emu/bus/scsi/scsi.c svneol=native#text/plain
src/emu/bus/scsi/scsi.h svneol=native#text/plain
src/emu/bus/scsi/scsicd.c svneol=native#text/plain
src/emu/bus/scsi/scsicd.h svneol=native#text/plain
src/emu/bus/scsi/scsihd.c svneol=native#text/plain
src/emu/bus/scsi/scsihd.h svneol=native#text/plain
src/emu/bus/scsi/scsihle.c svneol=native#text/plain
src/emu/bus/scsi/scsihle.h svneol=native#text/plain
src/emu/bus/sega8/rom.c svneol=native#text/plain
src/emu/bus/sega8/rom.h svneol=native#text/plain
src/emu/bus/sega8/sega8_slot.c svneol=native#text/plain
@ -2328,8 +2338,6 @@ src/emu/machine/cdp1852.c svneol=native#text/plain
src/emu/machine/cdp1852.h svneol=native#text/plain
src/emu/machine/cdp1871.c svneol=native#text/plain
src/emu/machine/cdp1871.h svneol=native#text/plain
src/emu/machine/cdu76s.c svneol=native#text/plain
src/emu/machine/cdu76s.h svneol=native#text/plain
src/emu/machine/clock.c svneol=native#text/plain
src/emu/machine/clock.h svneol=native#text/plain
src/emu/machine/com8116.c svneol=native#text/plain
@ -2448,6 +2456,8 @@ src/emu/machine/ldv1000.c svneol=native#text/plain
src/emu/machine/ldv1000.h svneol=native#text/plain
src/emu/machine/ldvp931.c svneol=native#text/plain
src/emu/machine/ldvp931.h svneol=native#text/plain
src/emu/machine/legscsi.c svneol=native#text/plain
src/emu/machine/legscsi.h svneol=native#text/plain
src/emu/machine/lh5810.c svneol=native#text/plain
src/emu/machine/lh5810.h svneol=native#text/plain
src/emu/machine/linflash.c svneol=native#text/plain
@ -2600,18 +2610,6 @@ src/emu/machine/s3c24xx.inc svneol=native#text/plain
src/emu/machine/s3c44b0.c svneol=native#text/plain
src/emu/machine/s3c44b0.h svneol=native#text/plain
src/emu/machine/saturn.c svneol=native#text/plain
src/emu/machine/scsibus.c svneol=native#text/plain
src/emu/machine/scsibus.h svneol=native#text/plain
src/emu/machine/scsicb.c svneol=native#text/plain
src/emu/machine/scsicb.h svneol=native#text/plain
src/emu/machine/scsicd.c svneol=native#text/plain
src/emu/machine/scsicd.h svneol=native#text/plain
src/emu/machine/scsidev.c svneol=native#text/plain
src/emu/machine/scsidev.h svneol=native#text/plain
src/emu/machine/scsihd.c svneol=native#text/plain
src/emu/machine/scsihd.h svneol=native#text/plain
src/emu/machine/scsihle.c svneol=native#text/plain
src/emu/machine/scsihle.h svneol=native#text/plain
src/emu/machine/seibu_cop.c svneol=native#text/plain
src/emu/machine/seibu_cop.h svneol=native#text/plain
src/emu/machine/serflash.c svneol=native#text/plain

View File

@ -38,7 +38,6 @@
#include "a2hsscsi.h"
#include "includes/apple2.h"
#include "machine/scsibus.h"
#include "machine/nscsi_cd.h"
#include "machine/nscsi_hd.h"
@ -68,7 +67,6 @@ static SLOT_INTERFACE_START( hsscsi_devices )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( hsscsi )
MCFG_SCSIBUS_ADD("scsi")
MCFG_NSCSI_BUS_ADD(SCSI_BUS_TAG)
MCFG_NSCSI_ADD("scsibus:0", hsscsi_devices, 0, false)
MCFG_NSCSI_ADD("scsibus:1", hsscsi_devices, 0, false)

View File

@ -31,7 +31,6 @@
#include "a2scsi.h"
#include "includes/apple2.h"
#include "machine/scsibus.h"
#include "machine/nscsi_cd.h"
#include "machine/nscsi_hd.h"
@ -61,7 +60,6 @@ static SLOT_INTERFACE_START( scsi_devices )
SLOT_INTERFACE_END
MACHINE_CONFIG_FRAGMENT( scsi )
MCFG_SCSIBUS_ADD("scsi")
MCFG_NSCSI_BUS_ADD(SCSI_BUS_TAG)
MCFG_NSCSI_ADD("scsibus:0", scsi_devices, 0, false)
MCFG_NSCSI_ADD("scsibus:1", scsi_devices, 0, false)

View File

@ -89,9 +89,8 @@ static MACHINE_CONFIG_FRAGMENT( abc_hdc )
MCFG_CPU_IO_MAP(abc_hdc_io)
MCFG_CPU_CONFIG(daisy_chain)
MCFG_SCSIBUS_ADD(SASIBUS_TAG)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0)
MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
MACHINE_CONFIG_END
@ -118,8 +117,7 @@ machine_config_constructor abc_hdc_device::device_mconfig_additions() const
abc_hdc_device::abc_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, ABC_HDC, "ABC HDC", tag, owner, clock, "abc_hdc", __FILE__),
device_abcbus_card_interface(mconfig, *this),
m_maincpu(*this, Z80_TAG),
m_sasibus(*this, SASIBUS_TAG)
m_maincpu(*this, Z80_TAG)
{
}

View File

@ -18,9 +18,7 @@
#include "abcbus.h"
#include "cpu/z80/z80.h"
#include "cpu/z80/z80daisy.h"
#include "machine/scsibus.h"
#include "machine/scsicb.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsihd.h"
@ -51,7 +49,6 @@ protected:
private:
required_device<cpu_device> m_maincpu;
required_device<scsibus_device> m_sasibus;
};

View File

@ -75,6 +75,7 @@
*/
#include "lux21056.h"
#include "bus/scsi/s1410.h"
@ -207,35 +208,49 @@ static Z80DMA_INTERFACE( dma_intf )
DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, luxor_55_21056_device, io_write_byte),
};
WRITE_LINE_MEMBER( luxor_55_21056_device::sasi_bsy_w )
WRITE_LINE_MEMBER( luxor_55_21056_device::write_sasi_bsy )
{
if (state)
m_sasi_bsy = state;
if (m_sasi_bsy)
{
m_sasibus->scsi_sel_w(0);
m_sasibus->write_sel(!m_sasi_bsy);
}
}
WRITE_LINE_MEMBER( luxor_55_21056_device::sasi_io_w )
WRITE_LINE_MEMBER( luxor_55_21056_device::write_sasi_io )
{
if (!state)
m_sasi_io = state;
if (!m_sasi_io)
{
m_sasibus->scsi_data_w(m_sasi_data);
m_sasi_data_out->write(m_sasi_data);
}
else
{
m_sasibus->scsi_data_w(0);
m_sasi_data_out->write(0);
}
}
WRITE_LINE_MEMBER( luxor_55_21056_device::sasi_req_w )
WRITE_LINE_MEMBER( luxor_55_21056_device::write_sasi_req )
{
if (state)
m_sasi_req = state;
if (m_sasi_req)
{
m_req = 0;
m_sasibus->scsi_ack_w(!m_req);
m_sasibus->write_ack(!m_sasi_req);
}
}
WRITE_LINE_MEMBER( luxor_55_21056_device::write_sasi_cd )
{
m_sasi_cd = state;
}
WRITE_LINE_MEMBER( luxor_55_21056_device::write_sasi_msg )
{
m_sasi_msg = state;
}
//-------------------------------------------------
// MACHINE_DRIVER( luxor_55_21056 )
@ -249,12 +264,17 @@ static MACHINE_CONFIG_FRAGMENT( luxor_55_21056 )
MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_8MHz/2, dma_intf)
MCFG_SCSIBUS_ADD(SASIBUS_TAG)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", S1410, SCSI_ID_0)
MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
MCFG_SCSICB_BSY_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_55_21056_device, sasi_bsy_w))
MCFG_SCSICB_IO_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_55_21056_device, sasi_io_w))
MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_55_21056_device, sasi_req_w))
MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
MCFG_SCSI_DATA_INPUT_BUFFER("sasi_data_in")
MCFG_SCSI_REQ_HANDLER(WRITELINE(luxor_55_21056_device, write_sasi_req))
MCFG_SCSI_IO_HANDLER(WRITELINE(luxor_55_21056_device, write_sasi_io))
MCFG_SCSI_CD_HANDLER(WRITELINE(luxor_55_21056_device, write_sasi_cd))
MCFG_SCSI_MSG_HANDLER(WRITELINE(luxor_55_21056_device, write_sasi_msg))
MCFG_SCSI_BSY_HANDLER(WRITELINE(luxor_55_21056_device, write_sasi_bsy))
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", S1410, SCSI_ID_0)
MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", SASIBUS_TAG)
MCFG_DEVICE_ADD("sasi_data_in", INPUT_BUFFER, 0)
MACHINE_CONFIG_END
@ -329,11 +349,17 @@ luxor_55_21056_device::luxor_55_21056_device(const machine_config &mconfig, cons
device_abcbus_card_interface(mconfig, *this),
m_maincpu(*this, Z80_TAG),
m_dma(*this, Z80DMA_TAG),
m_sasibus(*this, SASIBUS_TAG ":host"),
m_sasibus(*this, SASIBUS_TAG),
m_sasi_data_out(*this, "sasi_data_out"),
m_sasi_data_in(*this, "sasi_data_in"),
m_s1(*this, "S1"),
m_cs(false),
m_rdy(0),
m_req(0),
m_sasi_req(0),
m_sasi_io(0),
m_sasi_cd(0),
m_sasi_msg(0),
m_sasi_bsy(0),
m_stat(0),
m_sasi_data(0)
{
@ -349,10 +375,14 @@ void luxor_55_21056_device::device_start()
// state saving
save_item(NAME(m_cs));
save_item(NAME(m_rdy));
save_item(NAME(m_req));
save_item(NAME(m_inp));
save_item(NAME(m_out));
save_item(NAME(m_stat));
save_item(NAME(m_sasi_req));
save_item(NAME(m_sasi_io));
save_item(NAME(m_sasi_cd));
save_item(NAME(m_sasi_msg));
save_item(NAME(m_sasi_bsy));
save_item(NAME(m_sasi_data));
}
@ -492,11 +522,11 @@ READ8_MEMBER( luxor_55_21056_device::sasi_status_r )
data |= m_rdy ^ STAT_DIR;
data |= (m_req || m_sasibus->scsi_req_r()) << 1;
data |= m_sasibus->scsi_io_r() << 2;
data |= !m_sasibus->scsi_cd_r() << 3;
data |= !m_sasibus->scsi_msg_r() << 4;
data |= !m_sasibus->scsi_bsy_r() << 5;
data |= !m_sasi_req << 1;
data |= !m_sasi_io << 2;
data |= !m_sasi_cd << 3;
data |= !m_sasi_msg << 4;
data |= !m_sasi_bsy << 5;
return data ^ 0xff;
}
@ -546,10 +576,9 @@ WRITE8_MEMBER( luxor_55_21056_device::inp_w )
READ8_MEMBER( luxor_55_21056_device::sasi_data_r )
{
UINT8 data = m_sasibus->scsi_data_r();
UINT8 data = m_sasi_data_in->read();
m_req = !m_sasibus->scsi_req_r();
m_sasibus->scsi_ack_w(!m_req);
m_sasibus->write_ack(!m_sasi_req);
return data;
}
@ -563,13 +592,12 @@ WRITE8_MEMBER( luxor_55_21056_device::sasi_data_w )
{
m_sasi_data = data;
if (!m_sasibus->scsi_io_r())
if (!m_sasi_io)
{
m_sasibus->scsi_data_w(m_sasi_data);
m_sasi_data_out->write(m_sasi_data);
}
m_req = !m_sasibus->scsi_req_r();
m_sasibus->scsi_ack_w(!m_req);
m_sasibus->write_ack(!m_sasi_req);
}
@ -613,7 +641,7 @@ READ8_MEMBER( luxor_55_21056_device::sasi_sel_r )
WRITE8_MEMBER( luxor_55_21056_device::sasi_sel_w )
{
m_sasibus->scsi_sel_w(!m_sasibus->scsi_bsy_r());
m_sasibus->write_sel(!m_sasi_bsy);
}
@ -635,8 +663,8 @@ READ8_MEMBER( luxor_55_21056_device::sasi_rst_r )
WRITE8_MEMBER( luxor_55_21056_device::sasi_rst_w )
{
m_sasibus->scsi_rst_w(1);
m_sasibus->scsi_rst_w(0);
m_sasibus->write_rst(1);
m_sasibus->write_rst(0);
}

View File

@ -16,12 +16,9 @@
#include "emu.h"
#include "abcbus.h"
#include "bus/scsi/s1410.h"
#include "bus/scsi/scsi.h"
#include "cpu/z80/z80.h"
#include "cpu/z80/z80daisy.h"
#include "machine/scsibus.h"
#include "machine/scsicb.h"
#include "machine/scsihd.h"
#include "machine/z80dma.h"
@ -62,9 +59,11 @@ public:
DECLARE_READ8_MEMBER( io_read_byte );
DECLARE_WRITE8_MEMBER( io_write_byte );
DECLARE_WRITE_LINE_MEMBER( sasi_bsy_w );
DECLARE_WRITE_LINE_MEMBER( sasi_io_w );
DECLARE_WRITE_LINE_MEMBER( sasi_req_w );
DECLARE_WRITE_LINE_MEMBER( write_sasi_req );
DECLARE_WRITE_LINE_MEMBER( write_sasi_io );
DECLARE_WRITE_LINE_MEMBER( write_sasi_cd );
DECLARE_WRITE_LINE_MEMBER( write_sasi_msg );
DECLARE_WRITE_LINE_MEMBER( write_sasi_bsy );
protected:
// device-level overrides
@ -84,12 +83,18 @@ private:
required_device<cpu_device> m_maincpu;
required_device<z80dma_device> m_dma;
required_device<scsicb_device> m_sasibus;
required_device<SCSI_PORT_DEVICE> m_sasibus;
required_device<output_latch_device> m_sasi_data_out;
required_device<input_buffer_device> m_sasi_data_in;
required_ioport m_s1;
int m_cs;
int m_rdy;
int m_req;
int m_sasi_req;
int m_sasi_io;
int m_sasi_cd;
int m_sasi_msg;
int m_sasi_bsy;
UINT8 m_inp;
UINT8 m_out;

View File

@ -10,9 +10,7 @@
*********************************************************************/
#include "lux4105.h"
#include "machine/scsibus.h"
#include "machine/scsicb.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsihd.h"
#include "bus/scsi/s1410.h"
@ -32,46 +30,61 @@
const device_type LUXOR_4105 = &device_creator<luxor_4105_device>;
WRITE_LINE_MEMBER( luxor_4105_device::sasi_bsy_w )
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_bsy )
{
m_sasi_bsy = state;
if (state)
{
m_sasibus->scsi_sel_w(0);
m_sasibus->write_sel(0);
}
}
WRITE_LINE_MEMBER( luxor_4105_device::sasi_io_w )
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_io )
{
if (!state)
m_sasi_io = state;
if (!m_sasi_io)
{
m_sasibus->scsi_data_w(m_data);
m_sasi_data_out->write(m_data);
}
update_trrq_int();
}
WRITE_LINE_MEMBER( luxor_4105_device::sasi_req_w )
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_req )
{
if (state)
m_sasi_req = state;
if (m_sasi_req)
{
m_sasibus->scsi_ack_w(0);
m_sasibus->write_ack(0);
}
update_trrq_int();
}
WRITE_LINE_MEMBER( luxor_4105_device::write_sasi_cd )
{
m_sasi_cd = state;
}
//-------------------------------------------------
// MACHINE_DRIVER( luxor_4105 )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( luxor_4105 )
MCFG_SCSIBUS_ADD(SASIBUS_TAG)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", S1410, SCSI_ID_0)
MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
MCFG_SCSICB_BSY_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_4105_device, sasi_bsy_w))
MCFG_SCSICB_IO_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_4105_device, sasi_io_w))
MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, luxor_4105_device, sasi_req_w))
MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
MCFG_SCSI_DATA_INPUT_BUFFER("sasi_data_in")
MCFG_SCSI_BSY_HANDLER(WRITELINE(luxor_4105_device, write_sasi_bsy))
MCFG_SCSI_REQ_HANDLER(WRITELINE(luxor_4105_device, write_sasi_req))
MCFG_SCSI_CD_HANDLER(WRITELINE(luxor_4105_device, write_sasi_cd))
MCFG_SCSI_IO_HANDLER(WRITELINE(luxor_4105_device, write_sasi_io))
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", S1410, SCSI_ID_0)
MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", SASIBUS_TAG)
MCFG_DEVICE_ADD("sasi_data_in", INPUT_BUFFER, 0)
MACHINE_CONFIG_END
@ -131,8 +144,8 @@ ioport_constructor luxor_4105_device::device_input_ports() const
inline void luxor_4105_device::update_trrq_int()
{
int cd = !m_sasibus->scsi_cd_r();
int req = !m_sasibus->scsi_req_r();
int cd = !m_sasi_cd;
int req = !m_sasi_req;
int trrq = !(cd & !req);
if (BIT(m_dma, 5))
@ -167,7 +180,9 @@ inline void luxor_4105_device::update_trrq_int()
luxor_4105_device::luxor_4105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, LUXOR_4105, "Luxor 4105", tag, owner, clock, "lux4105", __FILE__),
device_abcbus_card_interface(mconfig, *this),
m_sasibus(*this, SASIBUS_TAG ":host"),
m_sasibus(*this, SASIBUS_TAG),
m_sasi_data_out(*this, "sasi_data_out"),
m_sasi_data_in(*this, "sasi_data_in"),
m_1e(*this, "1E"),
m_5e(*this, "5E")
{
@ -197,8 +212,8 @@ void luxor_4105_device::device_reset()
m_data = 0;
m_dma = 0;
m_sasibus->scsi_rst_w(1);
m_sasibus->scsi_rst_w(0);
m_sasibus->write_rst(1);
m_sasibus->write_rst(0);
m_slot->trrq_w(1);
}
@ -249,10 +264,10 @@ UINT8 luxor_4105_device::abcbus_stat()
*/
data = m_sasibus->scsi_bsy_r();
data |= m_sasibus->scsi_req_r() << 2;
data |= m_sasibus->scsi_cd_r() << 3;
data |= m_sasibus->scsi_io_r() << 6;
data = m_sasi_bsy;
data |= m_sasi_req << 2;
data |= m_sasi_cd << 3;
data |= m_sasi_io << 6;
}
return data;
@ -269,19 +284,19 @@ UINT8 luxor_4105_device::abcbus_inp()
if (m_cs)
{
if (!m_sasibus->scsi_bsy_r())
if (!m_sasi_bsy)
{
data = m_1e->read();
}
else
{
if (m_sasibus->scsi_io_r())
if (m_sasi_io)
{
data = m_sasibus->scsi_data_r();
data = m_sasi_data_in->read();
if (m_sasibus->scsi_req_r())
if (m_sasi_req)
{
m_sasibus->scsi_ack_w(1);
m_sasibus->write_ack(1);
}
}
}
@ -301,13 +316,13 @@ void luxor_4105_device::abcbus_out(UINT8 data)
{
m_data = data;
if (!m_sasibus->scsi_io_r())
if (!m_sasi_io)
{
m_sasibus->scsi_data_w(m_data);
m_sasi_data_out->write(m_data);
if (m_sasibus->scsi_req_r())
if (m_sasi_req)
{
m_sasibus->scsi_ack_w(1);
m_sasibus->write_ack(1);
}
}
}
@ -322,7 +337,7 @@ void luxor_4105_device::abcbus_c1(UINT8 data)
{
if (m_cs)
{
m_sasibus->scsi_sel_w(1);
m_sasibus->write_sel(1);
}
}
@ -338,8 +353,8 @@ void luxor_4105_device::abcbus_c3(UINT8 data)
m_data = 0;
m_dma = 0;
m_sasibus->scsi_rst_w(1);
m_sasibus->scsi_rst_w(0);
m_sasibus->write_rst(1);
m_sasibus->write_rst(0);
}
}

View File

@ -17,7 +17,7 @@
#include "emu.h"
#include "abcbus.h"
#include "machine/scsicb.h"
#include "bus/scsi/scsi.h"
@ -36,7 +36,7 @@
// ======================> luxor_4105_device
class luxor_4105_device : public device_t,
public device_abcbus_card_interface
public device_abcbus_card_interface
{
public:
// construction/destruction
@ -47,9 +47,10 @@ public:
virtual ioport_constructor device_input_ports() const;
// not really public
DECLARE_WRITE_LINE_MEMBER( sasi_bsy_w );
DECLARE_WRITE_LINE_MEMBER( sasi_io_w );
DECLARE_WRITE_LINE_MEMBER( sasi_req_w );
DECLARE_WRITE_LINE_MEMBER( write_sasi_bsy );
DECLARE_WRITE_LINE_MEMBER( write_sasi_req );
DECLARE_WRITE_LINE_MEMBER( write_sasi_cd );
DECLARE_WRITE_LINE_MEMBER( write_sasi_io );
protected:
// device-level overrides
@ -69,13 +70,20 @@ protected:
private:
inline void update_trrq_int();
required_device<scsicb_device> m_sasibus;
required_device<SCSI_PORT_DEVICE> m_sasibus;
required_device<output_latch_device> m_sasi_data_out;
required_device<input_buffer_device> m_sasi_data_in;
required_ioport m_1e;
required_ioport m_5e;
int m_cs;
UINT8 m_data;
UINT8 m_dma;
int m_sasi_bsy;
int m_sasi_req;
int m_sasi_cd;
int m_sasi_io;
};

View File

@ -1030,10 +1030,15 @@ endif
#-------------------------------------------------
#
#@src/emu/bus/scsi/???.h,BUSES += SCSI
#@src/emu/bus/scsi/scsi.h,BUSES += SCSI
#-------------------------------------------------
ifneq ($(filter SCSI,$(BUSES)),)
OBJDIRS += $(BUSOBJ)/scsi
BUSOBJS += $(BUSOBJ)/scsi/scsi.o
BUSOBJS += $(BUSOBJ)/scsi/scsicd.o
BUSOBJS += $(BUSOBJ)/scsi/scsihd.o
BUSOBJS += $(BUSOBJ)/scsi/scsihle.o
BUSOBJS += $(BUSOBJ)/scsi/cdu76s.o
BUSOBJS += $(BUSOBJ)/scsi/acb4070.o
BUSOBJS += $(BUSOBJ)/scsi/d9060hd.o
BUSOBJS += $(BUSOBJ)/scsi/sa1403d.o

View File

@ -101,9 +101,8 @@ static MACHINE_CONFIG_FRAGMENT( cmd_hd )
MCFG_I8255A_ADD(I8255A_TAG, ppi_intf)
//MCFG_RTC72421A_ADD(RTC72421A_TAG)
MCFG_SCSIBUS_ADD(SCSIBUS_TAG)
MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0)
MCFG_SCSICB_ADD(SCSIBUS_TAG ":host")
MCFG_DEVICE_ADD(SCSIBUS_TAG, SCSI_PORT, 0)
MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
MACHINE_CONFIG_END
@ -131,7 +130,7 @@ cmd_hd_device::cmd_hd_device(const machine_config &mconfig, const char *tag, dev
: device_t(mconfig, CMD_HD, "HD", tag, owner, clock, "cmdhd", __FILE__),
device_cbm_iec_interface(mconfig, *this),
m_maincpu(*this, M6502_TAG),
m_scsibus(*this, SCSIBUS_TAG":host")
m_scsibus(*this, SCSIBUS_TAG)
{
}

View File

@ -20,9 +20,7 @@
#include "imagedev/harddriv.h"
#include "machine/6522via.h"
#include "machine/i8255.h"
#include "machine/scsibus.h"
#include "machine/scsicb.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsihd.h"
@ -65,7 +63,7 @@ protected:
void cbm_iec_reset(int state);
required_device<cpu_device> m_maincpu;
required_device<scsicb_device> m_scsibus;
required_device<SCSI_PORT_DEVICE> m_scsibus;
};

View File

@ -55,9 +55,7 @@
*/
#include "e01.h"
#include "machine/scsibus.h"
#include "machine/scsicb.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsihd.h"
@ -206,17 +204,21 @@ WRITE_LINE_MEMBER( e01_device::fdc_drq_w )
WRITE_LINE_MEMBER( e01_device::scsi_bsy_w )
{
m_scsi_ctrl_in->write_bit1(state);
if (state)
{
m_scsibus->scsi_sel_w(0);
m_scsibus->write_sel(0);
}
}
WRITE_LINE_MEMBER( e01_device::scsi_req_w )
{
m_scsi_ctrl_in->write_bit5(state);
if (!state)
{
m_scsibus->scsi_ack_w(0);
m_scsibus->write_ack(0);
}
m_hdc_irq = !state;
@ -240,7 +242,7 @@ static ADDRESS_MAP_START( e01_mem, AS_PROGRAM, 8, e01_device )
AM_RANGE(0xfc28, 0xfc28) AM_MIRROR(0x00c3) AM_READWRITE(network_irq_enable_r, network_irq_enable_w)
AM_RANGE(0xfc2c, 0xfc2c) AM_MIRROR(0x00c3) AM_READ_PORT("FLAP")
AM_RANGE(0xfc30, 0xfc30) AM_MIRROR(0x00c0) AM_READWRITE(hdc_data_r, hdc_data_w)
AM_RANGE(0xfc31, 0xfc31) AM_MIRROR(0x00c0) AM_READ(hdc_status_r)
AM_RANGE(0xfc31, 0xfc31) AM_MIRROR(0x00c0) AM_DEVREAD("scsi_ctrl_in", input_buffer_device, read)
AM_RANGE(0xfc32, 0xfc32) AM_MIRROR(0x00c0) AM_WRITE(hdc_select_w)
AM_RANGE(0xfc33, 0xfc33) AM_MIRROR(0x00c0) AM_WRITE(hdc_irq_enable_w)
ADDRESS_MAP_END
@ -275,11 +277,21 @@ static MACHINE_CONFIG_FRAGMENT( e01 )
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG)
MCFG_SCSIBUS_ADD(SCSIBUS_TAG)
MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0)
MCFG_SCSICB_ADD(SCSIBUS_TAG ":host")
MCFG_SCSICB_BSY_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, e01_device, scsi_bsy_w))
MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, e01_device, scsi_req_w))
MCFG_DEVICE_ADD(SCSIBUS_TAG, SCSI_PORT, 0)
MCFG_SCSI_DATA_INPUT_BUFFER("scsi_data_in")
MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit0))
MCFG_SCSI_BSY_HANDLER(WRITELINE(e01_device, scsi_bsy_w)) // bit1
// bit 2 0
// bit 3 0
// bit 4 NIRQ
MCFG_SCSI_REQ_HANDLER(WRITELINE(e01_device, scsi_req_w)) // bit5
MCFG_SCSI_IO_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit6))
MCFG_SCSI_CD_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit7))
MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
MCFG_SCSI_OUTPUT_LATCH_ADD("scsi_data_out", SCSIBUS_TAG)
MCFG_DEVICE_ADD("scsi_data_in", INPUT_BUFFER, 0)
MCFG_DEVICE_ADD("scsi_ctrl_in", INPUT_BUFFER, 0)
// internal ram
MCFG_RAM_ADD(RAM_TAG)
@ -384,7 +396,10 @@ e01_device::e01_device(const machine_config &mconfig, const char *tag, device_t
m_adlc(*this, MC6854_TAG),
m_rtc(*this, HD146818_TAG),
m_ram(*this, RAM_TAG),
m_scsibus(*this, SCSIBUS_TAG ":host"),
m_scsibus(*this, SCSIBUS_TAG),
m_scsi_data_out(*this, "scsi_data_out"),
m_scsi_data_in(*this, "scsi_data_in"),
m_scsi_ctrl_in(*this, "scsi_ctrl_in"),
m_floppy0(*this, WD2793_TAG":0"),
m_floppy1(*this, WD2793_TAG":1"),
m_rom(*this, R65C102_TAG),
@ -410,7 +425,10 @@ e01_device::e01_device(const machine_config &mconfig, device_type type, const ch
m_adlc(*this, MC6854_TAG),
m_rtc(*this, HD146818_TAG),
m_ram(*this, RAM_TAG),
m_scsibus(*this, SCSIBUS_TAG ":host"),
m_scsibus(*this, SCSIBUS_TAG),
m_scsi_data_out(*this, "scsi_data_out"),
m_scsi_data_in(*this, "scsi_data_in"),
m_scsi_ctrl_in(*this, "scsi_ctrl_in"),
m_floppy0(*this, WD2793_TAG":0"),
m_floppy1(*this, WD2793_TAG":1"),
m_rom(*this, R65C102_TAG),
@ -613,9 +631,9 @@ WRITE8_MEMBER( e01_device::network_irq_enable_w )
READ8_MEMBER( e01_device::hdc_data_r )
{
UINT8 data = m_scsibus->scsi_data_r(space, 0);
UINT8 data = m_scsi_data_in->read();
m_scsibus->scsi_ack_w(1);
m_scsibus->write_ack(1);
return data;
}
@ -627,45 +645,9 @@ READ8_MEMBER( e01_device::hdc_data_r )
WRITE8_MEMBER( e01_device::hdc_data_w )
{
m_scsibus->scsi_data_w(space, 0, data);
m_scsi_data_out->write(data);
m_scsibus->scsi_ack_w(1);
}
//-------------------------------------------------
// hdc_status_r -
//-------------------------------------------------
READ8_MEMBER( e01_device::hdc_status_r )
{
/*
bit description
0 MSG
1 BSY
2 0
3 0
4 NIRQ
5 REQ
6 I/O
7 C/D
*/
UINT8 data = 0;
// SCSI bus
data |= m_scsibus->scsi_msg_r();
data |= m_scsibus->scsi_bsy_r() << 1;
data |= m_scsibus->scsi_req_r() << 5;
data |= m_scsibus->scsi_io_r() << 6;
data |= m_scsibus->scsi_cd_r() << 7;
// TODO NIRQ
return data;
m_scsibus->write_ack(1);
}
@ -675,7 +657,7 @@ READ8_MEMBER( e01_device::hdc_status_r )
WRITE8_MEMBER( e01_device::hdc_select_w )
{
m_scsibus->scsi_sel_w(1);
m_scsibus->write_sel(1);
}

View File

@ -14,15 +14,16 @@
#ifndef __E01__
#define __E01__
#include "emu.h"
#include "econet.h"
#include "bus/centronics/ctronics.h"
#include "bus/scsi/scsi.h"
#include "cpu/m6502/m65c02.h"
#include "machine/6522via.h"
#include "bus/centronics/ctronics.h"
#include "machine/buffer.h"
#include "machine/latch.h"
#include "machine/mc146818.h"
#include "machine/mc6854.h"
#include "machine/ram.h"
#include "machine/scsicb.h"
#include "machine/wd_fdc.h"
class e01_device : public device_t,
@ -86,7 +87,10 @@ protected:
required_device<mc6854_device> m_adlc;
required_device<mc146818_device> m_rtc;
required_device<ram_device> m_ram;
required_device<scsicb_device> m_scsibus;
required_device<SCSI_PORT_DEVICE> m_scsibus;
required_device<output_latch_device> m_scsi_data_out;
required_device<input_buffer_device> m_scsi_data_in;
required_device<input_buffer_device> m_scsi_ctrl_in;
required_device<floppy_connector> m_floppy0;
required_device<floppy_connector> m_floppy1;
required_memory_region m_rom;

View File

@ -32,8 +32,6 @@
#include "d9060.h"
#include "bus/scsi/d9060hd.h"
#include "machine/scsibus.h"
#include "machine/scsicb.h"
@ -336,14 +334,14 @@ static const riot6532_interface riot1_intf =
};
READ8_MEMBER( base_d9060_device::via_pb_r )
WRITE8_MEMBER( base_d9060_device::via_pb_w )
{
/*
bit description
PB0
PB1
PB0 SEL
PB1 RST
PB2 C/D
PB3 BUSY
PB4 J14 (1=9060, 0=9090)
@ -353,43 +351,13 @@ READ8_MEMBER( base_d9060_device::via_pb_r )
*/
UINT8 data = 0;
data |= m_sasibus->scsi_cd_r() << 2;
data |= m_sasibus->scsi_bsy_r() << 3;
data |= m_sasibus->scsi_io_r() << 6;
data |= m_sasibus->scsi_msg_r() << 7;
// drive type
data |= (m_variant == TYPE_9060) << 4;
return data;
}
WRITE8_MEMBER( base_d9060_device::via_pb_w )
{
/*
bit description
PB0 SEL
PB1 RST
PB2
PB3
PB4
PB5
PB6
PB7
*/
m_sasibus->scsi_sel_w(BIT(data, 0));
m_sasibus->scsi_rst_w(BIT(data, 1));
m_sasibus->write_sel(BIT(data, 0));
m_sasibus->write_rst(BIT(data, 1));
}
WRITE_LINE_MEMBER( base_d9060_device::ack_w )
{
m_sasibus->scsi_ack_w(!state);
m_sasibus->write_ack(!state);
}
WRITE_LINE_MEMBER( base_d9060_device::enable_w )
@ -398,11 +366,11 @@ WRITE_LINE_MEMBER( base_d9060_device::enable_w )
if( !m_enable )
{
m_sasibus->scsi_data_w( m_data );
m_sasi_data_out->write( m_data );
}
else
{
m_sasibus->scsi_data_w( 0 );
m_sasi_data_out->write( 0 );
}
}
@ -412,15 +380,10 @@ WRITE8_MEMBER( base_d9060_device::scsi_data_w )
if( !m_enable )
{
m_sasibus->scsi_data_w( m_data );
m_sasi_data_out->write( m_data );
}
}
WRITE_LINE_MEMBER( base_d9060_device::req_w )
{
m_via->write_ca1(state);
}
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( d9060 )
@ -439,18 +402,30 @@ static MACHINE_CONFIG_FRAGMENT( d9060 )
MCFG_CPU_PROGRAM_MAP(d9060_hdc_mem)
MCFG_DEVICE_ADD(M6522_TAG, VIA6522, XTAL_4MHz/4)
MCFG_VIA6522_READPA_HANDLER(DEVREAD8(SASIBUS_TAG ":host", scsicb_device, scsi_data_r))
MCFG_VIA6522_READPB_HANDLER(READ8(base_d9060_device, via_pb_r))
MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(base_d9060_device, scsi_data_w))
MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(base_d9060_device, via_pb_w))
MCFG_VIA6522_CA2_HANDLER(WRITELINE(base_d9060_device, ack_w))
MCFG_VIA6522_CB2_HANDLER(WRITELINE(base_d9060_device, enable_w))
MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE(M6502_HDC_TAG, m6502_device, irq_line))
MCFG_SCSIBUS_ADD(SASIBUS_TAG)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", D9060HD, SCSI_ID_0)
MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, base_d9060_device, req_w))
MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
MCFG_SCSI_REQ_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_ca1))
MCFG_SCSI_CD_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pb2))
MCFG_SCSI_BSY_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pb3))
MCFG_SCSI_IO_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pb6))
MCFG_SCSI_MSG_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pb7))
MCFG_SCSI_DATA0_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa0))
MCFG_SCSI_DATA1_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa1))
MCFG_SCSI_DATA2_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa2))
MCFG_SCSI_DATA3_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa3))
MCFG_SCSI_DATA4_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa4))
MCFG_SCSI_DATA5_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa5))
MCFG_SCSI_DATA6_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa6))
MCFG_SCSI_DATA7_HANDLER(DEVWRITELINE(M6522_TAG, via6522_device, write_pa7))
MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", SASIBUS_TAG)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", D9060HD, SCSI_ID_0)
MACHINE_CONFIG_END
@ -530,7 +505,8 @@ base_d9060_device::base_d9060_device(const machine_config &mconfig, device_type
m_riot0(*this, M6532_0_TAG),
m_riot1(*this, M6532_1_TAG),
m_via(*this, M6522_TAG),
m_sasibus(*this, SASIBUS_TAG ":host"),
m_sasibus(*this, SASIBUS_TAG),
m_sasi_data_out(*this, "sasi_data_out"),
m_address(*this, "ADDRESS"),
m_rfdo(1),
m_daco(1),
@ -568,6 +544,9 @@ void base_d9060_device::device_start()
save_item(NAME(m_daco));
save_item(NAME(m_atna));
save_item(NAME(m_enable));
m_via->write_pb4(!(m_variant == TYPE_9090)); // J14 (6 HEADS)
m_via->write_pb5(!(m_variant == TYPE_9060)); // J13 (4 HEADS)
}

View File

@ -19,7 +19,7 @@
#include "cpu/m6502/m6502.h"
#include "machine/6522via.h"
#include "machine/6532riot.h"
#include "machine/scsicb.h"
#include "bus/scsi/scsi.h"
@ -49,7 +49,6 @@ public:
virtual ioport_constructor device_input_ports() const;
// not really public
DECLARE_WRITE_LINE_MEMBER( req_w );
DECLARE_READ8_MEMBER( dio_r );
DECLARE_WRITE8_MEMBER( dio_w );
DECLARE_READ8_MEMBER( riot1_pa_r );
@ -79,7 +78,8 @@ private:
required_device<riot6532_device> m_riot0;
required_device<riot6532_device> m_riot1;
required_device<via6522_device> m_via;
required_device<scsicb_device> m_sasibus;
required_device<SCSI_PORT_DEVICE> m_sasibus;
required_device<output_latch_device> m_sasi_data_out;
required_ioport m_address;
// IEEE-488 bus

View File

@ -3,7 +3,6 @@
*
*/
#include "emu.h"
#include "acb4070.h"
// device type definition

View File

@ -3,7 +3,7 @@
#ifndef __ACB4070__
#define __ACB4070__
#include "machine/scsihd.h"
#include "scsihd.h"
class acb4070_device : public scsihd_device
{

View File

@ -15,7 +15,7 @@
#define __CDU76S_H__
#include "scsicd.h"
#include "t10mmc.h"
#include "machine/t10mmc.h"
class sony_cdu76s_device : public scsicd_device
{

View File

@ -3,7 +3,6 @@
*
*/
#include "emu.h"
#include "d9060hd.h"
// device type definition

View File

@ -3,7 +3,7 @@
#ifndef __D9060HD__
#define __D9060HD__
#include "machine/scsihd.h"
#include "scsihd.h"
class d9060hd_device : public scsihd_device
{

View File

@ -86,7 +86,6 @@ Notes:
*/
#include "emu.h"
#include "s1410.h"
#include "cpu/z80/z80.h"
#include "imagedev/harddriv.h"

View File

@ -14,8 +14,7 @@
#ifndef __S1410__
#define __S1410__
#include "emu.h"
#include "machine/scsihd.h"
#include "scsihd.h"
class s1410_device : public scsihd_device
{

View File

@ -14,9 +14,8 @@
#ifndef __SA1403D__
#define __SA1403D__
#include "emu.h"
#include "scsihd.h"
#include "imagedev/harddriv.h"
#include "machine/scsihd.h"
class sa1403d_device : public scsihd_device
{

690
src/emu/bus/scsi/scsi.c Normal file
View File

@ -0,0 +1,690 @@
// license:MAME
// copyright-holders:smf
#include "scsi.h"
SCSI_PORT_DEVICE::SCSI_PORT_DEVICE(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, SCSI_PORT, "SCSI Port", tag, owner, clock, "scsi", __FILE__),
m_bsy_handler(*this),
m_sel_handler(*this),
m_cd_handler(*this),
m_io_handler(*this),
m_msg_handler(*this),
m_req_handler(*this),
m_ack_handler(*this),
m_atn_handler(*this),
m_rst_handler(*this),
m_data0_handler(*this),
m_data1_handler(*this),
m_data2_handler(*this),
m_data3_handler(*this),
m_data4_handler(*this),
m_data5_handler(*this),
m_data6_handler(*this),
m_data7_handler(*this),
m_bsy_in(0),
m_sel_in(0),
m_cd_in(0),
m_io_in(0),
m_msg_in(0),
m_req_in(0),
m_ack_in(0),
m_rst_in(0),
m_data0_in(0),
m_data1_in(0),
m_data2_in(0),
m_data3_in(0),
m_data4_in(0),
m_data5_in(0),
m_data6_in(0),
m_data7_in(0),
m_bsy_out(0),
m_sel_out(0),
m_cd_out(0),
m_io_out(0),
m_msg_out(0),
m_req_out(0),
m_ack_out(0),
m_rst_out(0),
m_data0_out(0),
m_data1_out(0),
m_data2_out(0),
m_data3_out(0),
m_data4_out(0),
m_data5_out(0),
m_data6_out(0),
m_data7_out(0)
{
}
static MACHINE_CONFIG_FRAGMENT( scsi_port )
MCFG_DEVICE_ADD( SCSI_PORT_DEVICE1, SCSI_PORT_SLOT, 0 )
MCFG_DEVICE_ADD( SCSI_PORT_DEVICE2, SCSI_PORT_SLOT, 0 )
MCFG_DEVICE_ADD( SCSI_PORT_DEVICE3, SCSI_PORT_SLOT, 0 )
MCFG_DEVICE_ADD( SCSI_PORT_DEVICE4, SCSI_PORT_SLOT, 0 )
MCFG_DEVICE_ADD( SCSI_PORT_DEVICE5, SCSI_PORT_SLOT, 0 )
MCFG_DEVICE_ADD( SCSI_PORT_DEVICE6, SCSI_PORT_SLOT, 0 )
MCFG_DEVICE_ADD( SCSI_PORT_DEVICE7, SCSI_PORT_SLOT, 0 )
MACHINE_CONFIG_END
machine_config_constructor SCSI_PORT_DEVICE::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( scsi_port );
}
void SCSI_PORT_DEVICE::device_start()
{
const char *deviceName[] =
{
SCSI_PORT_DEVICE1,
SCSI_PORT_DEVICE2,
SCSI_PORT_DEVICE3,
SCSI_PORT_DEVICE4,
SCSI_PORT_DEVICE5,
SCSI_PORT_DEVICE6,
SCSI_PORT_DEVICE7
};
m_device_count = 0;
for (int i = 0; i < 7; i++)
{
SCSI_PORT_SLOT_device *slot = subdevice<SCSI_PORT_SLOT_device>(deviceName[i]);
m_slot[i] = slot;
if (slot != NULL)
m_device_count = i + 1;
}
m_bsy_handler.resolve_safe();
m_sel_handler.resolve_safe();
m_cd_handler.resolve_safe();
m_io_handler.resolve_safe();
m_msg_handler.resolve_safe();
m_req_handler.resolve_safe();
m_ack_handler.resolve_safe();
m_atn_handler.resolve_safe();
m_rst_handler.resolve_safe();
m_data0_handler.resolve_safe();
m_data1_handler.resolve_safe();
m_data2_handler.resolve_safe();
m_data3_handler.resolve_safe();
m_data4_handler.resolve_safe();
m_data5_handler.resolve_safe();
m_data6_handler.resolve_safe();
m_data7_handler.resolve_safe();
}
void SCSI_PORT_DEVICE::update_bsy()
{
int bsy = m_bsy_in;
for (int i = 0; i < m_device_count; i++)
{
bsy |= m_slot[i]->m_bsy;
}
if (m_bsy_out != bsy)
{
m_bsy_out = bsy;
m_bsy_handler(bsy);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_bsy(bsy);
}
}
}
void SCSI_PORT_DEVICE::update_sel()
{
int sel = m_sel_in;
for (int i = 0; i < m_device_count; i++)
{
sel |= m_slot[i]->m_sel;
}
if (m_sel_out != sel)
{
m_sel_out = sel;
m_sel_handler(sel);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_sel(sel);
}
}
}
void SCSI_PORT_DEVICE::update_cd()
{
int cd = m_cd_in;
for (int i = 0; i < m_device_count; i++)
{
cd |= m_slot[i]->m_cd;
}
if (m_cd_out != cd)
{
m_cd_out = cd;
m_cd_handler(cd);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_cd(cd);
}
}
}
void SCSI_PORT_DEVICE::update_io()
{
int io = m_io_in;
for (int i = 0; i < m_device_count; i++)
{
io |= m_slot[i]->m_io;
}
if (m_io_out != io)
{
m_io_out = io;
m_io_handler(io);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_io(io);
}
}
}
void SCSI_PORT_DEVICE::update_msg()
{
int msg = m_msg_in;
for (int i = 0; i < m_device_count; i++)
{
msg |= m_slot[i]->m_msg;
}
if (m_msg_out != msg)
{
m_msg_out = msg;
m_msg_handler(msg);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_msg(msg);
}
}
}
void SCSI_PORT_DEVICE::update_req()
{
int req = m_req_in;
for (int i = 0; i < m_device_count; i++)
{
req |= m_slot[i]->m_req;
}
if (m_req_out != req)
{
m_req_out = req;
m_req_handler(req);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_req(req);
}
}
}
void SCSI_PORT_DEVICE::update_ack()
{
int ack = m_ack_in;
for (int i = 0; i < m_device_count; i++)
{
ack |= m_slot[i]->m_ack;
}
if (m_ack_out != ack)
{
m_ack_out = ack;
m_ack_handler(ack);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_ack(ack);
}
}
}
void SCSI_PORT_DEVICE::update_atn()
{
int atn = m_atn_in;
for (int i = 0; i < m_device_count; i++)
{
atn |= m_slot[i]->m_atn;
}
if (m_atn_out != atn)
{
m_atn_out = atn;
m_atn_handler(atn);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_atn(atn);
}
}
}
void SCSI_PORT_DEVICE::update_rst()
{
int rst = m_rst_in;
for (int i = 0; i < m_device_count; i++)
{
rst |= m_slot[i]->m_rst;
}
if (m_rst_out != rst)
{
m_rst_out = rst;
m_rst_handler(rst);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_rst(rst);
}
}
}
void SCSI_PORT_DEVICE::update_data0()
{
int data0 = m_data0_in;
for (int i = 0; i < m_device_count; i++)
{
data0 |= m_slot[i]->m_data0;
}
if (m_data0_out != data0)
{
m_data0_out = data0;
m_data0_handler(data0);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_data0(data0);
}
}
}
void SCSI_PORT_DEVICE::update_data1()
{
int data1 = m_data1_in;
for (int i = 0; i < m_device_count; i++)
{
data1 |= m_slot[i]->m_data1;
}
if (m_data1_out != data1)
{
m_data1_out = data1;
m_data1_handler(data1);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_data1(data1);
}
}
}
void SCSI_PORT_DEVICE::update_data2()
{
int data2 = m_data2_in;
for (int i = 0; i < m_device_count; i++)
{
data2 |= m_slot[i]->m_data2;
}
if (m_data2_out != data2)
{
m_data2_out = data2;
m_data2_handler(data2);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_data2(data2);
}
}
}
void SCSI_PORT_DEVICE::update_data3()
{
int data3 = m_data3_in;
for (int i = 0; i < m_device_count; i++)
{
data3 |= m_slot[i]->m_data3;
}
if (m_data3_out != data3)
{
m_data3_out = data3;
m_data3_handler(data3);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_data3(data3);
}
}
}
void SCSI_PORT_DEVICE::update_data4()
{
int data4 = m_data4_in;
for (int i = 0; i < m_device_count; i++)
{
data4 |= m_slot[i]->m_data4;
}
if (m_data4_out != data4)
{
m_data4_out = data4;
m_data4_handler(data4);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_data4(data4);
}
}
}
void SCSI_PORT_DEVICE::update_data5()
{
int data5 = m_data5_in;
for (int i = 0; i < m_device_count; i++)
{
data5 |= m_slot[i]->m_data5;
}
if (m_data5_out != data5)
{
m_data5_out = data5;
m_data5_handler(data5);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_data5(data5);
}
}
}
void SCSI_PORT_DEVICE::update_data6()
{
int data6 = m_data6_in;
for (int i = 0; i < m_device_count; i++)
{
data6 |= m_slot[i]->m_data6;
}
if (m_data6_out != data6)
{
m_data6_out = data6;
m_data6_handler(data6);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_data6(data6);
}
}
}
void SCSI_PORT_DEVICE::update_data7()
{
int data7 = m_data7_in;
for (int i = 0; i < m_device_count; i++)
{
data7 |= m_slot[i]->m_data7;
}
if (m_data7_out != data7)
{
m_data7_out = data7;
m_data7_handler(data7);
for (int i = 0; i < m_device_count; i++)
{
scsi_port_interface *dev = m_slot[i]->dev();
if (dev != NULL)
dev->input_data7(data7);
}
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_bsy )
{
if (m_bsy_in != state)
{
m_bsy_in = state;
update_bsy();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_sel )
{
if (m_sel_in != state)
{
m_sel_in = state;
update_sel();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_cd )
{
if (m_cd_in != state)
{
m_cd_in = state;
update_cd();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_io )
{
if (m_io_in != state)
{
m_io_in = state;
update_io();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_msg )
{
if (m_msg_in != state)
{
m_msg_in = state;
update_msg();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_req )
{
if (m_req_in != state)
{
m_req_in = state;
update_req();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_ack )
{
if (m_ack_in != state)
{
m_ack_in = state;
update_ack();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_atn )
{
if (m_atn_in != state)
{
m_atn_in = state;
update_atn();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_rst )
{
if (m_rst_in != state)
{
m_rst_in = state;
update_rst();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data0 )
{
if (m_data0_in != state)
{
m_data0_in = state;
update_data0();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data1 )
{
if (m_data1_in != state)
{
m_data1_in = state;
update_data1();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data2 )
{
if (m_data2_in != state)
{
m_data2_in = state;
update_data2();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data3 )
{
if (m_data3_in != state)
{
m_data3_in = state;
update_data3();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data4 )
{
if (m_data4_in != state)
{
m_data4_in = state;
update_data4();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data5 )
{
if (m_data5_in != state)
{
m_data5_in = state;
update_data5();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data6 )
{
if (m_data6_in != state)
{
m_data6_in = state;
update_data6();
}
}
WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data7 )
{
if (m_data7_in != state)
{
m_data7_in = state;
update_data7();
}
}
const device_type SCSI_PORT = &device_creator<SCSI_PORT_DEVICE>;
SCSI_PORT_SLOT_device::SCSI_PORT_SLOT_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, SCSI_PORT_SLOT, "SCSI Connector", tag, owner, clock, "scsi_slot", __FILE__),
device_slot_interface(mconfig, *this),
m_dev(NULL),
m_bsy(0),
m_sel(0),
m_cd(0),
m_io(0),
m_msg(0),
m_req(0),
m_ack(0),
m_rst(0),
m_data0(0),
m_data1(0),
m_data2(0),
m_data3(0),
m_data4(0),
m_data5(0),
m_data6(0),
m_data7(0)
{
m_port = dynamic_cast<SCSI_PORT_DEVICE *>(device().owner());
}
void SCSI_PORT_SLOT_device::device_config_complete()
{
m_dev = dynamic_cast<scsi_port_interface *>(get_card_device());
}
void SCSI_PORT_SLOT_device::device_start()
{
}
const device_type SCSI_PORT_SLOT = &device_creator<SCSI_PORT_SLOT_device>;
scsi_port_interface::scsi_port_interface(const machine_config &mconfig, device_t &device)
: device_slot_card_interface(mconfig, device)
{
m_slot = dynamic_cast<SCSI_PORT_SLOT_device *>(device.owner());
}
scsi_port_interface::~scsi_port_interface()
{
}

313
src/emu/bus/scsi/scsi.h Normal file
View File

@ -0,0 +1,313 @@
// license:MAME
// copyright-holders:smf
#pragma once
#ifndef _SCSI_H_
#define _SCSI_H_
#include "emu.h"
#include "machine/buffer.h"
#include "machine/latch.h"
#define SCSI_PORT_DEVICE1 "1"
#define SCSI_PORT_DEVICE2 "2"
#define SCSI_PORT_DEVICE3 "3"
#define SCSI_PORT_DEVICE4 "4"
#define SCSI_PORT_DEVICE5 "5"
#define SCSI_PORT_DEVICE6 "6"
#define SCSI_PORT_DEVICE7 "7"
#define MCFG_SCSI_BSY_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_bsy_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_SEL_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_sel_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_CD_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_cd_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_IO_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_io_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_MSG_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_msg_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_REQ_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_req_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_ACK_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_ack_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_ATN_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_atn_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_RST_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_rst_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_DATA0_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_data0_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_DATA1_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_data1_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_DATA2_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_data2_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_DATA3_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_data3_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_DATA4_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_data4_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_DATA5_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_data5_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_DATA6_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_data6_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_DATA7_HANDLER(_devcb) \
devcb = &SCSI_PORT_DEVICE::set_data7_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSI_OUTPUT_LATCH_ADD(_tag, scsi_port_tag) \
MCFG_DEVICE_ADD(_tag, OUTPUT_LATCH, 0) \
MCFG_OUTPUT_LATCH_BIT0_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data0)) \
MCFG_OUTPUT_LATCH_BIT1_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data1)) \
MCFG_OUTPUT_LATCH_BIT2_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data2)) \
MCFG_OUTPUT_LATCH_BIT3_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data3)) \
MCFG_OUTPUT_LATCH_BIT4_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data4)) \
MCFG_OUTPUT_LATCH_BIT5_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data5)) \
MCFG_OUTPUT_LATCH_BIT6_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data6)) \
MCFG_OUTPUT_LATCH_BIT7_HANDLER(DEVWRITELINE(scsi_port_tag, SCSI_PORT_DEVICE, write_data7))
#define MCFG_SCSI_DATA_INPUT_BUFFER(_tag) \
MCFG_SCSI_DATA0_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit0)) \
MCFG_SCSI_DATA1_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit1)) \
MCFG_SCSI_DATA2_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit2)) \
MCFG_SCSI_DATA3_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit3)) \
MCFG_SCSI_DATA4_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit4)) \
MCFG_SCSI_DATA5_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit5)) \
MCFG_SCSI_DATA6_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit6)) \
MCFG_SCSI_DATA7_HANDLER(DEVWRITELINE(_tag, input_buffer_device, write_bit7))
class SCSI_PORT_SLOT_device;
class scsi_port_interface;
class SCSI_PORT_DEVICE : public device_t
{
friend class scsi_port_interface;
public:
// construction/destruction
SCSI_PORT_DEVICE(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
template<class _Object> static devcb2_base &set_bsy_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_bsy_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_sel_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_sel_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_cd_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_cd_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_io_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_io_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_msg_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_msg_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_req_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_req_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_ack_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_ack_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_atn_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_atn_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_rst_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_rst_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_data0_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data0_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_data1_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data1_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_data2_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data2_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_data3_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data3_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_data4_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data4_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_data5_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data5_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_data6_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data6_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_data7_handler(device_t &device, _Object object) { return downcast<SCSI_PORT_DEVICE &>(device).m_data7_handler.set_callback(object); }
DECLARE_WRITE_LINE_MEMBER( write_bsy );
DECLARE_WRITE_LINE_MEMBER( write_sel );
DECLARE_WRITE_LINE_MEMBER( write_cd );
DECLARE_WRITE_LINE_MEMBER( write_io );
DECLARE_WRITE_LINE_MEMBER( write_msg );
DECLARE_WRITE_LINE_MEMBER( write_req );
DECLARE_WRITE_LINE_MEMBER( write_ack );
DECLARE_WRITE_LINE_MEMBER( write_atn );
DECLARE_WRITE_LINE_MEMBER( write_rst );
DECLARE_WRITE_LINE_MEMBER( write_data0 );
DECLARE_WRITE_LINE_MEMBER( write_data1 );
DECLARE_WRITE_LINE_MEMBER( write_data2 );
DECLARE_WRITE_LINE_MEMBER( write_data3 );
DECLARE_WRITE_LINE_MEMBER( write_data4 );
DECLARE_WRITE_LINE_MEMBER( write_data5 );
DECLARE_WRITE_LINE_MEMBER( write_data6 );
DECLARE_WRITE_LINE_MEMBER( write_data7 );
protected:
// device-level overrides
virtual void device_start();
virtual machine_config_constructor device_mconfig_additions() const;
void update_bsy();
void update_sel();
void update_cd();
void update_io();
void update_msg();
void update_req();
void update_ack();
void update_atn();
void update_rst();
void update_data0();
void update_data1();
void update_data2();
void update_data3();
void update_data4();
void update_data5();
void update_data6();
void update_data7();
private:
devcb2_write_line m_bsy_handler;
devcb2_write_line m_sel_handler;
devcb2_write_line m_cd_handler;
devcb2_write_line m_io_handler;
devcb2_write_line m_msg_handler;
devcb2_write_line m_req_handler;
devcb2_write_line m_ack_handler;
devcb2_write_line m_atn_handler;
devcb2_write_line m_rst_handler;
devcb2_write_line m_data0_handler;
devcb2_write_line m_data1_handler;
devcb2_write_line m_data2_handler;
devcb2_write_line m_data3_handler;
devcb2_write_line m_data4_handler;
devcb2_write_line m_data5_handler;
devcb2_write_line m_data6_handler;
devcb2_write_line m_data7_handler;
SCSI_PORT_SLOT_device *m_slot[7];
int m_device_count;
int m_bsy_in;
int m_sel_in;
int m_cd_in;
int m_io_in;
int m_msg_in;
int m_req_in;
int m_ack_in;
int m_atn_in;
int m_rst_in;
int m_data0_in;
int m_data1_in;
int m_data2_in;
int m_data3_in;
int m_data4_in;
int m_data5_in;
int m_data6_in;
int m_data7_in;
int m_bsy_out;
int m_sel_out;
int m_cd_out;
int m_io_out;
int m_msg_out;
int m_req_out;
int m_ack_out;
int m_atn_out;
int m_rst_out;
int m_data0_out;
int m_data1_out;
int m_data2_out;
int m_data3_out;
int m_data4_out;
int m_data5_out;
int m_data6_out;
int m_data7_out;
};
extern const device_type SCSI_PORT;
class scsi_port_interface;
class SCSI_PORT_SLOT_device : public device_t,
public device_slot_interface
{
friend class SCSI_PORT_DEVICE;
friend class scsi_port_interface;
public:
SCSI_PORT_SLOT_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
scsi_port_interface *dev() { return m_dev; }
SCSI_PORT_DEVICE *port() { return m_port; }
protected:
// device-level overrides
virtual void device_start();
virtual void device_config_complete();
protected:
scsi_port_interface *m_dev;
SCSI_PORT_DEVICE *m_port;
int m_bsy;
int m_sel;
int m_cd;
int m_io;
int m_msg;
int m_req;
int m_ack;
int m_atn;
int m_rst;
int m_data0;
int m_data1;
int m_data2;
int m_data3;
int m_data4;
int m_data5;
int m_data6;
int m_data7;
};
extern const device_type SCSI_PORT_SLOT;
class scsi_port_interface : public device_slot_card_interface
{
public:
scsi_port_interface(const machine_config &mconfig, device_t &device);
virtual ~scsi_port_interface();
virtual DECLARE_WRITE_LINE_MEMBER( input_bsy ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_sel ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_cd ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_io ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_msg ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_req ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_ack ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_atn ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_rst ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_data0 ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_data1 ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_data2 ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_data3 ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_data4 ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_data5 ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_data6 ) {}
virtual DECLARE_WRITE_LINE_MEMBER( input_data7 ) {}
DECLARE_WRITE_LINE_MEMBER( output_bsy ) { if (m_slot->m_bsy != state) { m_slot->m_bsy = state; m_slot->port()->update_bsy(); } }
DECLARE_WRITE_LINE_MEMBER( output_sel ) { if (m_slot->m_sel != state) { m_slot->m_sel = state; m_slot->port()->update_sel(); } }
DECLARE_WRITE_LINE_MEMBER( output_cd ) { if (m_slot->m_cd != state) { m_slot->m_cd = state; m_slot->port()->update_cd(); } }
DECLARE_WRITE_LINE_MEMBER( output_io ) { if (m_slot->m_io != state) { m_slot->m_io = state; m_slot->port()->update_io(); } }
DECLARE_WRITE_LINE_MEMBER( output_msg ) { if (m_slot->m_msg != state) { m_slot->m_msg = state; m_slot->port()->update_msg(); } }
DECLARE_WRITE_LINE_MEMBER( output_req ) { if (m_slot->m_req != state) { m_slot->m_req = state; m_slot->port()->update_req(); } }
DECLARE_WRITE_LINE_MEMBER( output_ack ) { if (m_slot->m_ack != state) { m_slot->m_ack = state; m_slot->port()->update_ack(); } }
DECLARE_WRITE_LINE_MEMBER( output_atn ) { if (m_slot->m_atn != state) { m_slot->m_atn = state; m_slot->port()->update_atn(); } }
DECLARE_WRITE_LINE_MEMBER( output_rst ) { if (m_slot->m_rst != state) { m_slot->m_rst = state; m_slot->port()->update_rst(); } }
DECLARE_WRITE_LINE_MEMBER( output_data0 ) { if (m_slot->m_data0 != state) { m_slot->m_data0 = state; m_slot->port()->update_data0(); } }
DECLARE_WRITE_LINE_MEMBER( output_data1 ) { if (m_slot->m_data1 != state) { m_slot->m_data1 = state; m_slot->port()->update_data1(); } }
DECLARE_WRITE_LINE_MEMBER( output_data2 ) { if (m_slot->m_data2 != state) { m_slot->m_data2 = state; m_slot->port()->update_data2(); } }
DECLARE_WRITE_LINE_MEMBER( output_data3 ) { if (m_slot->m_data3 != state) { m_slot->m_data3 = state; m_slot->port()->update_data3(); } }
DECLARE_WRITE_LINE_MEMBER( output_data4 ) { if (m_slot->m_data4 != state) { m_slot->m_data4 = state; m_slot->port()->update_data4(); } }
DECLARE_WRITE_LINE_MEMBER( output_data5 ) { if (m_slot->m_data5 != state) { m_slot->m_data5 = state; m_slot->port()->update_data5(); } }
DECLARE_WRITE_LINE_MEMBER( output_data6 ) { if (m_slot->m_data6 != state) { m_slot->m_data6 = state; m_slot->port()->update_data6(); } }
DECLARE_WRITE_LINE_MEMBER( output_data7 ) { if (m_slot->m_data7 != state) { m_slot->m_data7 = state; m_slot->port()->update_data7(); } }
private:
SCSI_PORT_SLOT_device *m_slot;
};
#endif

View File

@ -12,7 +12,7 @@
const device_type SCSICD = &device_creator<scsicd_device>;
scsicd_device::scsicd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
scsihle_device(mconfig, SCSICD, "SCSICD", tag, owner, clock, "scsicd", __FILE__)
scsihle_device(mconfig, SCSICD, "SCSI CD", tag, owner, clock, "scsicd", __FILE__)
{
}

View File

@ -9,7 +9,7 @@
#ifndef _SCSICD_H_
#define _SCSICD_H_
#include "machine/scsihle.h"
#include "scsihle.h"
#include "machine/t10mmc.h"
class scsicd_device : public scsihle_device,

View File

@ -12,7 +12,7 @@
const device_type SCSIHD = &device_creator<scsihd_device>;
scsihd_device::scsihd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: scsihle_device(mconfig, SCSIHD, "SCSIHD", tag, owner, clock, "scsihd", __FILE__)
: scsihle_device(mconfig, SCSIHD, "SCSI HD", tag, owner, clock, "scsihd", __FILE__)
{
}

View File

@ -9,7 +9,7 @@
#ifndef _SCSIHD_H_
#define _SCSIHD_H_
#include "machine/scsihle.h"
#include "scsihle.h"
#include "machine/t10sbc.h"
class scsihd_device : public scsihle_device,

View File

@ -8,16 +8,68 @@ Base class for HLE'd SCSI devices.
*/
#include "machine/scsihle.h"
#include "scsihle.h"
scsihle_device::scsihle_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) :
scsidev_device(mconfig, type, name, tag, owner, clock, shortname, source)
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
scsi_port_interface(mconfig, *this),
m_scsi_id(*this, "SCSI_ID"),
m_input_data(0)
{
}
static INPUT_PORTS_START(scsihle)
PORT_START("SCSI_ID")
PORT_CONFNAME(0x07, 0x07, "SCSI ID")
PORT_CONFSETTING( 0x00, "0")
PORT_CONFSETTING( 0x01, "1")
PORT_CONFSETTING( 0x02, "2")
PORT_CONFSETTING( 0x03, "3")
PORT_CONFSETTING( 0x04, "4")
PORT_CONFSETTING( 0x05, "5")
PORT_CONFSETTING( 0x06, "6")
PORT_CONFSETTING( 0x07, "7")
INPUT_PORTS_END
DEVICE_INPUT_DEFAULTS_START( SCSI_ID_0 )
DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 0 )
DEVICE_INPUT_DEFAULTS_END
DEVICE_INPUT_DEFAULTS_START( SCSI_ID_1 )
DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 1 )
DEVICE_INPUT_DEFAULTS_END
DEVICE_INPUT_DEFAULTS_START( SCSI_ID_2 )
DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 2 )
DEVICE_INPUT_DEFAULTS_END
DEVICE_INPUT_DEFAULTS_START( SCSI_ID_3 )
DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 3 )
DEVICE_INPUT_DEFAULTS_END
DEVICE_INPUT_DEFAULTS_START( SCSI_ID_4 )
DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 4 )
DEVICE_INPUT_DEFAULTS_END
DEVICE_INPUT_DEFAULTS_START( SCSI_ID_5 )
DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 5 )
DEVICE_INPUT_DEFAULTS_END
DEVICE_INPUT_DEFAULTS_START( SCSI_ID_6 )
DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 6 )
DEVICE_INPUT_DEFAULTS_END
DEVICE_INPUT_DEFAULTS_START( SCSI_ID_7 )
DEVICE_INPUT_DEFAULTS( "SCSI_ID", 7, 7 )
DEVICE_INPUT_DEFAULTS_END
ioport_constructor scsihle_device::device_input_ports() const
{
return INPUT_PORTS_NAME(scsihle);
}
void scsihle_device::device_start()
{
scsidev_device::device_start();
t10_start(*this);
req_timer = timer_alloc(0);
@ -27,6 +79,7 @@ void scsihle_device::device_start()
void scsihle_device::device_reset()
{
scsiID = m_scsi_id->read();
t10_reset();
}
@ -35,12 +88,6 @@ int scsihle_device::GetDeviceID()
return scsiID;
}
void scsihle_device::static_set_deviceid( device_t &device, int _scsiID )
{
scsihle_device &scsidev = downcast<scsihle_device &>(device);
scsidev.scsiID = _scsiID;
}
#define BSY_DELAY_NS 50
#define REQ_DELAY_NS 90
@ -49,7 +96,7 @@ static const char *const phasenames[] =
"data out", "data in", "command", "status", "none", "none", "message out", "message in", "bus free","select"
};
// scsidev
// scsihle
#define SCSI_CMD_BUFFER_WRITE ( 0x3b )
#define SCSI_CMD_BUFFER_READ ( 0x3c )
@ -75,6 +122,19 @@ static const char *const phasenames[] =
#define LOG(level, ...) if(LOGLEVEL>=level) logerror(__VA_ARGS__)
void scsihle_device::data_out(UINT8 data)
{
// printf( "%s data out %02x\n", tag(), data );
output_data0(BIT(data, 0));
output_data1(BIT(data, 1));
output_data2(BIT(data, 2));
output_data3(BIT(data, 3));
output_data4(BIT(data, 4));
output_data5(BIT(data, 5));
output_data6(BIT(data, 6));
output_data7(BIT(data, 7));
}
void scsihle_device::scsi_out_req_delay(UINT8 state)
{
req_timer->adjust(attotime::from_nsec(REQ_DELAY_NS),state);
@ -117,7 +177,7 @@ void scsihle_device::scsibus_read_data()
ReadData(buffer, data_last);
bytes_left-=data_last;
scsi_out( buffer[ data_idx++ ], SCSI_MASK_DATA );
data_out(buffer[ data_idx++ ]);
}
}
@ -126,7 +186,7 @@ void scsihle_device::scsibus_write_data()
if (data_last > 0)
{
WriteData(buffer, data_last);
bytes_left-=data_last;
bytes_left -= data_last;
}
data_idx=0;
@ -134,33 +194,33 @@ void scsihle_device::scsibus_write_data()
void scsihle_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
{
switch( tid )
switch (tid)
{
case 0:
scsi_out(param ? SCSI_MASK_REQ : 0, SCSI_MASK_REQ);
output_req(param);
break;
case 1:
scsi_out(param ? SCSI_MASK_BSY : 0, SCSI_MASK_BSY);
output_bsy(param);
break;
case 2:
// Some drives, notably the ST225N and ST125N, accept fromat unit commands
// with flags set indicating that bad block data should be transfered but
// don't then implemnt a data in phase, this timeout it to catch these !
if(IS_COMMAND(SCSI_CMD_FORMAT_UNIT) && (data_idx==0))
if (IS_COMMAND(SCSI_CMD_FORMAT_UNIT) && (data_idx==0))
{
scsi_change_phase(SCSI_PHASE_STATUS);
}
}
break;
}
}
}
void scsihle_device::scsibus_exec_command()
{
int command_local = 0;
if(LOGLEVEL)
if (LOGLEVEL)
dump_command_bytes();
//is_linked=command[cmd_idx-1] & 0x01;
@ -173,7 +233,7 @@ void scsihle_device::scsibus_exec_command()
case SCSI_CMD_FORMAT_UNIT:
LOG(1,"SCSIBUS: format unit command[1]=%02X & 0x10\n",(command[1] & 0x10));
command_local=1;
if((command[1] & 0x10)==0x10)
if ((command[1] & 0x10)==0x10)
m_phase = SCSI_PHASE_DATAOUT;
else
m_phase = SCSI_PHASE_STATUS;
@ -218,7 +278,7 @@ void scsihle_device::scsibus_exec_command()
case SCSI_CMD_BUFFER_READ:
LOG(1,"SCSIBUS: read_buffer\n");
command_local=1;
bytes_left=(command[7]<<8)+command[8];
bytes_left = (command[7]<<8) + command[8];
m_phase = SCSI_PHASE_DATAIN;
m_status_code = SCSI_STATUS_CODE_GOOD;
break;
@ -227,7 +287,7 @@ void scsihle_device::scsibus_exec_command()
// Check for locally executed command, if not then pass it on
// to the disk driver
if(!command_local)
if (!command_local)
{
SetCommand(command, cmd_idx);
ExecCommand();
@ -271,230 +331,248 @@ void scsihle_device::scsi_change_phase(UINT8 newphase)
switch(m_phase)
{
case SCSI_PHASE_BUS_FREE:
scsi_out( 0, SCSI_MASK_ALL );
output_bsy(0);
// sel
output_cd(0);
output_io(0);
output_msg(0);
output_req(0);
// ack
// atn
// rst
data_out(0);
LOG(1,"SCSIBUS: done\n\n");
break;
case SCSI_PHASE_COMMAND:
scsi_out( SCSI_MASK_CD, SCSI_MASK_DATA | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );
output_cd(1);
output_io(0);
output_msg(0);
scsi_out_req_delay(1);
data_out(0);
LOG(1,"\nSCSIBUS: Command begin\n");
scsi_out_req_delay( 1 );
break;
case SCSI_PHASE_DATAOUT:
scsi_out( 0, SCSI_MASK_DATA | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );
scsi_out_req_delay( 1 );
output_cd(0);
output_io(0);
output_msg(0);
scsi_out_req_delay(1);
data_out(0);
break;
case SCSI_PHASE_DATAIN:
scsi_out( SCSI_MASK_IO, SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );
scsi_out_req_delay( 1 );
output_cd(0);
output_io(1);
output_msg(0);
scsi_out_req_delay(1);
break;
case SCSI_PHASE_STATUS:
scsi_out( m_status_code | SCSI_MASK_CD | SCSI_MASK_IO, SCSI_MASK_DATA | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );
scsi_out_req_delay( 1 );
output_cd(1);
output_io(1);
output_msg(0);
scsi_out_req_delay(1);
data_out(m_status_code);
break;
case SCSI_PHASE_MESSAGE_OUT:
scsi_out( SCSI_MASK_CD | SCSI_MASK_MSG, SCSI_MASK_DATA | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );
scsi_out_req_delay( 1 );
output_cd(1);
output_io(0);
output_msg(1);
scsi_out_req_delay(1);
data_out(0);
break;
case SCSI_PHASE_MESSAGE_IN:
scsi_out( 0 | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG, SCSI_MASK_DATA | SCSI_MASK_CD | SCSI_MASK_IO | SCSI_MASK_MSG );// no errors for the time being !
scsi_out_req_delay( 1 );
output_cd(1);
output_io(1);
output_msg(1);
scsi_out_req_delay(1);
data_out(0); // no errors for the time being !
break;
}
}
void scsihle_device::scsi_in( UINT32 data, UINT32 mask )
WRITE_LINE_MEMBER( scsihle_device::input_sel )
{
// Reset aborts and returns to bus free
if( ( mask & SCSI_MASK_RST ) != 0 && ( data & SCSI_MASK_RST ) != 0 )
{
scsi_change_phase(SCSI_PHASE_BUS_FREE);
cmd_idx=0;
data_idx=0;
is_linked=0;
return;
}
// printf( "sel %d %d %02x\n", state, m_phase, m_input_data );
switch (m_phase)
{
case SCSI_PHASE_BUS_FREE:
// Note this assumes we only have one initiator and therefore
// only one line active.
if( ( mask & SCSI_MASK_SEL ) != 0 && scsibus_driveno(data & SCSI_MASK_DATA) == scsiID)
case SCSI_PHASE_BUS_FREE:
// Note this assumes we only have one initiator and therefore
// only one line active.
if (scsibus_driveno(m_input_data) == scsiID)
{
void *hdfile = NULL;
// Check to see if device had image file mounted, if not, do not set busy,
// and stay busfree.
GetDevice(&hdfile);
if (hdfile != NULL)
{
void *hdfile = NULL;
// Check to see if device had image file mounted, if not, do not set busy,
// and stay busfree.
GetDevice(&hdfile);
if(hdfile!=(void *)NULL)
if (!state)
{
if( ( data & SCSI_MASK_SEL ) == 0 )
{
scsi_change_phase(SCSI_PHASE_COMMAND);
}
else
{
sel_timer->adjust(attotime::from_nsec(BSY_DELAY_NS),1);
}
}
}
break;
case SCSI_PHASE_COMMAND:
if( ( mask & SCSI_MASK_ACK ) != 0 )
{
if( ( data & SCSI_MASK_ACK ) == 0 )
{
command[ cmd_idx++ ] = data & SCSI_MASK_DATA;
// If the command is ready go and execute it
if(cmd_idx==get_scsi_cmd_len(command[0]))
{
scsibus_exec_command();
}
else
{
scsi_out_req_delay( 1 );
}
scsi_change_phase(SCSI_PHASE_COMMAND);
}
else
{
scsi_out_req_delay( 0 );
sel_timer->adjust(attotime::from_nsec(BSY_DELAY_NS),1);
}
}
}
break;
}
}
WRITE_LINE_MEMBER( scsihle_device::input_ack )
{
switch (m_phase)
{
case SCSI_PHASE_COMMAND:
if (!state)
{
command[ cmd_idx++ ] = m_input_data;
// If the command is ready go and execute it
if (cmd_idx == get_scsi_cmd_len(command[0]))
{
scsibus_exec_command();
}
else
{
scsi_out_req_delay(1);
}
}
else
{
scsi_out_req_delay(0);
}
break;
case SCSI_PHASE_DATAIN:
if( ( mask & SCSI_MASK_ACK ) != 0 )
if (!state)
{
if( ( data & SCSI_MASK_ACK ) == 0 )
// check to see if we have reached the end of the block buffer
// and that there is more data to read from the scsi disk
if (data_idx == m_sector_bytes && bytes_left > 0)
{
// check to see if we have reached the end of the block buffer
// and that there is more data to read from the scsi disk
if(data_idx == m_sector_bytes && bytes_left > 0)
{
scsibus_read_data();
scsi_out_req_delay( 1 );
}
else if(data_idx == data_last && bytes_left == 0)
{
scsi_change_phase(SCSI_PHASE_STATUS);
}
else
{
scsi_out( buffer[ data_idx++ ], SCSI_MASK_DATA );
scsi_out_req_delay( 1 );
}
scsibus_read_data();
scsi_out_req_delay(1);
}
else if (data_idx == data_last && bytes_left == 0)
{
scsi_change_phase(SCSI_PHASE_STATUS);
}
else
{
scsi_out_req_delay( 0 );
data_out(buffer[data_idx++]);
scsi_out_req_delay(1);
}
}
else
{
scsi_out_req_delay(0);
}
break;
case SCSI_PHASE_DATAOUT:
if( ( mask & SCSI_MASK_ACK ) != 0 )
if (!state)
{
if( ( data & SCSI_MASK_ACK ) == 0 )
//LOG(1,"SCSIBUS:bytes_left=%02X data_idx=%02X\n",bytes_left,data_idx);
buffer[data_idx++] = m_input_data;
if (IS_COMMAND(SCSI_CMD_FORMAT_UNIT))
{
//LOG(1,"SCSIBUS:bytes_left=%02X data_idx=%02X\n",bytes_left,data_idx);
buffer[data_idx++]=data & SCSI_MASK_DATA;
// If we have the first byte, then cancel the dataout timout
if (data_idx == 1)
dataout_timer->adjust(attotime::never);
if(IS_COMMAND(SCSI_CMD_FORMAT_UNIT))
// When we have the first 3 bytes, calculate how many more are in the
// bad block list.
if (data_idx == 3)
{
// If we have the first byte, then cancel the dataout timout
if(data_idx==1)
dataout_timer->adjust(attotime::never);
// When we have the first 3 bytes, calculate how many more are in the
// bad block list.
if(data_idx==3)
{
bytes_left+=((buffer[2]<<8)+buffer[3]);
LOG(1,"format_unit reading an extra %d bytes\n",bytes_left-4);
dump_data_bytes(4);
}
bytes_left += ((buffer[2]<<8) + buffer[3]);
LOG(1, "format_unit reading an extra %d bytes\n", bytes_left - 4);
dump_data_bytes(4);
}
}
// If the data buffer is full flush it to the SCSI disk
// If the data buffer is full flush it to the SCSI disk
data_last = (bytes_left >= m_sector_bytes) ? m_sector_bytes : bytes_left;
data_last = (bytes_left >= m_sector_bytes) ? m_sector_bytes : bytes_left;
if(data_idx == data_last)
scsibus_write_data();
if (data_idx == data_last)
scsibus_write_data();
if(data_idx == 0 && bytes_left == 0)
{
scsi_change_phase(SCSI_PHASE_STATUS);
}
else
{
scsi_out_req_delay( 1 );
}
if (data_idx == 0 && bytes_left == 0)
{
scsi_change_phase(SCSI_PHASE_STATUS);
}
else
{
scsi_out_req_delay( 0 );
scsi_out_req_delay(1);
}
}
else
{
scsi_out_req_delay(0);
}
break;
case SCSI_PHASE_STATUS:
if( ( mask & SCSI_MASK_ACK ) != 0 )
if (!state)
{
if( ( data & SCSI_MASK_ACK ) == 0 )
if (cmd_idx > 0)
{
if(cmd_idx > 0)
{
scsi_change_phase(SCSI_PHASE_MESSAGE_IN);
}
else
{
scsi_out_req_delay( 1 );
}
scsi_change_phase(SCSI_PHASE_MESSAGE_IN);
}
else
{
cmd_idx++;
scsi_out_req_delay( 0 );
scsi_out_req_delay(1);
}
}
else
{
cmd_idx++;
scsi_out_req_delay(0);
}
break;
case SCSI_PHASE_MESSAGE_IN:
if( ( mask & SCSI_MASK_ACK ) != 0 )
if (!state)
{
if( ( data & SCSI_MASK_ACK ) == 0 )
if (cmd_idx > 0)
{
if(cmd_idx > 0)
{
if(is_linked)
scsi_change_phase(SCSI_PHASE_COMMAND);
else
scsi_change_phase(SCSI_PHASE_BUS_FREE);
}
if (is_linked)
scsi_change_phase(SCSI_PHASE_COMMAND);
else
{
scsi_out_req_delay( 1 );
}
scsi_change_phase(SCSI_PHASE_BUS_FREE);
}
else
{
cmd_idx++;
scsi_out_req_delay( 0 );
scsi_out_req_delay(1);
}
}
else
{
cmd_idx++;
scsi_out_req_delay(0);
}
break;
}
}
WRITE_LINE_MEMBER( scsihle_device::input_rst )
{
if (state)
{
scsi_change_phase(SCSI_PHASE_BUS_FREE);
cmd_idx = 0;
data_idx = 0;
is_linked = 0;
}
}
// get the length of a SCSI command based on it's command byte type
int scsihle_device::get_scsi_cmd_len(int cbyte)
{

View File

@ -0,0 +1,91 @@
// license:MAME
// copyright-holders:smf
/*
scsihle.h
Base class for HLE'd SCSI devices.
*/
#ifndef _SCSIHLE_H_
#define _SCSIHLE_H_
#include "scsi.h"
#include "machine/t10spc.h"
class scsihle_device : public device_t,
public scsi_port_interface,
public virtual t10spc
{
public:
// construction/destruction
scsihle_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);
virtual int GetDeviceID(); // hack for legacy_scsi_host_adapter::get_device
virtual DECLARE_WRITE_LINE_MEMBER( input_sel );
virtual DECLARE_WRITE_LINE_MEMBER( input_ack );
virtual DECLARE_WRITE_LINE_MEMBER( input_rst );
virtual DECLARE_WRITE_LINE_MEMBER( input_data0 ) { if (state) m_input_data |= 0x01; else m_input_data &= ~0x01; }
virtual DECLARE_WRITE_LINE_MEMBER( input_data1 ) { if (state) m_input_data |= 0x02; else m_input_data &= ~0x02; }
virtual DECLARE_WRITE_LINE_MEMBER( input_data2 ) { if (state) m_input_data |= 0x04; else m_input_data &= ~0x04; }
virtual DECLARE_WRITE_LINE_MEMBER( input_data3 ) { if (state) m_input_data |= 0x08; else m_input_data &= ~0x08; }
virtual DECLARE_WRITE_LINE_MEMBER( input_data4 ) { if (state) m_input_data |= 0x10; else m_input_data &= ~0x10; }
virtual DECLARE_WRITE_LINE_MEMBER( input_data5 ) { if (state) m_input_data |= 0x20; else m_input_data &= ~0x20; }
virtual DECLARE_WRITE_LINE_MEMBER( input_data6 ) { if (state) m_input_data |= 0x40; else m_input_data &= ~0x40; }
virtual DECLARE_WRITE_LINE_MEMBER( input_data7 ) { if (state) m_input_data |= 0x80; else m_input_data &= ~0x80; }
protected:
// device-level overrides
virtual ioport_constructor device_input_ports() const;
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
private:
required_ioport m_scsi_id;
void data_out(UINT8 data);
void scsi_out_req_delay(UINT8 state);
void scsi_change_phase(UINT8 newphase);
int get_scsi_cmd_len(int cbyte);
UINT8 scsibus_driveno(UINT8 drivesel);
void scsibus_read_data();
void scsibus_write_data();
void scsibus_exec_command();
void dump_command_bytes();
void dump_data_bytes(int count);
void dump_bytes(UINT8 *buff, int count);
emu_timer *req_timer;
emu_timer *sel_timer;
emu_timer *dataout_timer;
UINT8 cmd_idx;
UINT8 is_linked;
UINT8 buffer[ 1024 ];
UINT16 data_idx;
int bytes_left;
int data_last;
int scsiID;
UINT8 m_input_data;
};
extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_0)[];
extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_1)[];
extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_2)[];
extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_3)[];
extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_4)[];
extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_5)[];
extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_6)[];
extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_7)[];
#define MCFG_SCSIDEV_ADD(_tag, _option, _type, _id) \
MCFG_DEVICE_MODIFY(_tag ) \
MCFG_SLOT_OPTION_ADD( _option, _type ) \
MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS( _option, _id ) \
MCFG_SLOT_DEFAULT_OPTION( _option ) \
#endif

View File

@ -10,7 +10,7 @@
**********************************************************************/
#include "wdc.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsihd.h"

View File

@ -7,8 +7,8 @@
*/
#include "emu.h"
#include "machine/scsibus.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsihd.h"
#include "machine/mb89352.h"
#include "x68k_scsiext.h"
@ -34,17 +34,19 @@ const rom_entry *x68k_scsiext_device::device_rom_region() const
// device machine config
static MACHINE_CONFIG_FRAGMENT( x68k_scsiext )
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk0", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_2)
MCFG_SCSIDEV_ADD("scsi:harddisk3", SCSIHD, SCSI_ID_3)
MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_scsiext_device, irq_w))
MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_scsiext_device, drq_w))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "harddisk", SCSIHD, SCSI_ID_2)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE4, "harddisk", SCSIHD, SCSI_ID_3)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE5, "harddisk", SCSIHD, SCSI_ID_4)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE6, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE7, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_DEVICE_ADD("mb89352", MB89352A, 0)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_MB89352A_IRQ_CB(WRITELINE(x68k_scsiext_device, irq_w))
MCFG_MB89352A_DRQ_CB(WRITELINE(x68k_scsiext_device, drq_w))
MACHINE_CONFIG_END
machine_config_constructor x68k_scsiext_device::device_mconfig_additions() const
@ -55,7 +57,7 @@ machine_config_constructor x68k_scsiext_device::device_mconfig_additions() const
x68k_scsiext_device::x68k_scsiext_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, X68K_SCSIEXT, "Sharp CZ-6BS1 SCSI-1", tag, owner, clock, "x68k_cz6bs1", __FILE__),
device_x68k_expansion_card_interface(mconfig, *this),
m_spc(*this, "scsi:mb89352")
m_spc(*this, "mb89352")
{
}

View File

@ -171,6 +171,7 @@ EMUMACHINEOBJS = \
$(EMUMACHINE)/netlist.o \
$(EMUMACHINE)/nvram.o \
$(EMUMACHINE)/ram.o \
$(EMUMACHINE)/legscsi.o \
$(EMUMACHINE)/terminal.o \
EMUIMAGEDEVOBJS = \

View File

@ -2,7 +2,7 @@
#include "emu.h"
#include "53c810.h"
#include "machine/scsihle.h"
#include "bus/scsi/scsihle.h"
#define DMA_MAX_ICOUNT 512 /* Maximum number of DMA Scripts opcodes to run */
#define DASM_OPCODES 0
@ -104,6 +104,8 @@ void lsi53c810_device::dmaop_select()
}
else
{
select((dcmd>>16)&7);
/* initiator mode */
logerror("53c810: SELECT: our ID %d, target ID %d\n", scid&7, (dcmd>>16)&7);
@ -616,12 +618,14 @@ void lsi53c810_device::add_opcode(UINT8 op, UINT8 mask, opcode_handler_delegate
}
lsi53c810_device::lsi53c810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, LSI53C810, "53C810 SCSI", tag, owner, clock, "lsi53c810", __FILE__)
: legacy_scsi_host_adapter(mconfig, LSI53C810, "53C810 SCSI", tag, owner, clock, "lsi53c810", __FILE__)
{
}
void lsi53c810_device::device_start()
{
legacy_scsi_host_adapter::device_start();
m_irq_cb.bind_relative_to(*owner());
m_dma_cb.bind_relative_to(*owner());
m_fetch_cb.bind_relative_to(*owner());
@ -647,42 +651,6 @@ void lsi53c810_device::device_start()
add_opcode(0xc0, 0xfe, opcode_handler_delegate(FUNC( lsi53c810_device::dmaop_move_memory ), this));
add_opcode(0xe0, 0xed, opcode_handler_delegate(FUNC( lsi53c810_device::dmaop_store ), this));
add_opcode(0xe1, 0xed, opcode_handler_delegate(FUNC( lsi53c810_device::dmaop_load ), this));
memset(devices, 0, sizeof(devices));
// try to open the devices
for (device_t *device = owner()->first_subdevice(); device != NULL; device = device->next())
{
scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
if (scsidev != NULL)
{
devices[scsidev->GetDeviceID()] = scsidev;
}
}
}
void lsi53c810_device::lsi53c810_read_data(int bytes, UINT8 *pData)
{
if (devices[last_id])
{
devices[last_id]->ReadData( pData, bytes);
}
else
{
logerror("lsi53c810: read unknown device SCSI ID %d\n", last_id);
}
}
void lsi53c810_device::lsi53c810_write_data(int bytes, UINT8 *pData)
{
if (devices[last_id])
{
devices[last_id]->WriteData( pData, bytes );
}
else
{
logerror("lsi53c810: write to unknown device SCSI ID %d\n", last_id);
}
}
/*************************************

View File

@ -1,7 +1,7 @@
#ifndef LSI53C810_H
#define LSI53C810_H
#include "machine/scsihle.h"
#include "legscsi.h"
typedef device_delegate<void (int state)> lsi53c810_irq_delegate;
#define LSI53C810_IRQ_CB(name) void name(int state)
@ -13,7 +13,7 @@ typedef device_delegate<UINT32 (UINT32 dsp)> lsi53c810_fetch_delegate;
#define LSI53C810_FETCH_CB(name) UINT32 name(UINT32 dsp)
class lsi53c810_device : public device_t
class lsi53c810_device : public legacy_scsi_host_adapter
{
public:
// construction/destruction
@ -67,7 +67,6 @@ private:
UINT32 lsi53c810_dasm_fetch(UINT32 pc);
unsigned lsi53c810_dasm(char *buf, UINT32 pc);
scsihle_device *devices[8]; /* SCSI IDs 0-7 */
UINT8 last_id;
UINT8 scntl0;

View File

@ -11,7 +11,7 @@
#include "emu.h"
#include "am53cf96.h"
#include "machine/scsihle.h"
#include "bus/scsi/scsihle.h"
READ8_MEMBER( am53cf96_device::read )
{
@ -90,23 +90,18 @@ WRITE8_MEMBER( am53cf96_device::write )
scsi_regs[REG_IRQSTATE] = 8; // indicate success
xfer_state = 0;
break;
case 2: // reset device
case 2: // reset am53cf96
scsi_regs[REG_IRQSTATE] = 8; // indicate success
logerror("53cf96: reset target ID = %d (PC = %x)\n", last_id, space.device().safe_pc());
if (last_id <= 7 && devices[last_id])
{
devices[last_id]->reset();
}
else
{
logerror("53cf96: reset request for unknown device SCSI ID %d\n", last_id);
}
xfer_state = 0;
break;
case 3: // reset SCSI bus
scsi_regs[REG_INTSTATE] = 4; // command sent OK
reset_bus();
xfer_state = 0;
m_transfer_timer->adjust( attotime::from_hz( 16384 ) );
break;
@ -122,18 +117,9 @@ WRITE8_MEMBER( am53cf96_device::write )
}
logerror("53cf96: command %x exec. target ID = %d (PC = %x)\n", fifo[1], last_id, space.device().safe_pc());
if (last_id <= 7 && devices[last_id])
{
int length;
devices[last_id]->SetCommand( &fifo[1], 12 );
devices[last_id]->ExecCommand();
devices[last_id]->GetLength(&length);
}
else
{
logerror("53cf96: request for unknown device SCSI ID %d\n", last_id);
}
select(last_id);
send_command(&fifo[1], 12);
xfer_state = 0;
break;
case 0x44: // enable selection/reselection
@ -159,27 +145,18 @@ WRITE8_MEMBER( am53cf96_device::write )
}
am53cf96_device::am53cf96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, AM53CF96, "53CF96 SCSI", tag, owner, clock, "am53cf96", __FILE__),
legacy_scsi_host_adapter(mconfig, AM53CF96, "53CF96 SCSI", tag, owner, clock, "am53cf96", __FILE__),
m_irq_handler(*this)
{
}
void am53cf96_device::device_start()
{
legacy_scsi_host_adapter::device_start();
m_irq_handler.resolve_safe();
memset(scsi_regs, 0, sizeof(scsi_regs));
memset(devices, 0, sizeof(devices));
// try to open the devices
for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
{
scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
if( scsidev != NULL )
{
devices[scsidev->GetDeviceID()] = scsidev;
}
}
fptr = 0;
xfer_state = 0;
@ -199,14 +176,7 @@ void am53cf96_device::dma_read_data(int bytes, UINT8 *pData)
{
scsi_regs[REG_STATUS] |= 0x10; // indicate DMA finished
if (last_id <= 7 && devices[last_id])
{
devices[last_id]->ReadData( pData, bytes );
}
else
{
logerror("53cf96: request for unknown device SCSI ID %d\n", last_id);
}
read_data(pData, bytes);
}
// write data to the SCSI controller
@ -216,14 +186,7 @@ void am53cf96_device::dma_write_data(int bytes, UINT8 *pData)
scsi_regs[REG_STATUS] |= 0x10; // indicate DMA finished
if (last_id <= 7 && devices[last_id])
{
devices[last_id]->WriteData( pData, bytes );
}
else
{
logerror("53cf96: request for unknown device SCSI ID %d\n", last_id);
}
write_data(pData, bytes);
}
const device_type AM53CF96 = &device_creator<am53cf96_device>;

View File

@ -6,13 +6,13 @@
#ifndef _AM53CF96_H_
#define _AM53CF96_H_
#include "machine/scsihle.h"
#pragma once
#define MCFG_AM53CF96_ADD( _tag ) \
MCFG_DEVICE_ADD( _tag, AM53CF96, 0 )
#include "legscsi.h"
#define MCFG_AM53CF96_IRQ_HANDLER(_devcb) \
devcb = &am53cf96_device::set_irq_handler(*device, DEVCB2_##_devcb);
// 53CF96 register set
enum
{
@ -35,7 +35,7 @@ enum
REG_DATAALIGN // data alignment (write only)
};
class am53cf96_device : public device_t
class am53cf96_device : public legacy_scsi_host_adapter
{
public:
// construction/destruction
@ -58,8 +58,6 @@ protected:
private:
static const device_timer_id TIMER_TRANSFER = 0;
scsihle_device *devices[8];
UINT8 scsi_regs[32];
UINT8 fifo[16];
UINT8 fptr;

View File

@ -17,7 +17,7 @@
#define __ATAPIHLE_H__
#include "atahle.h"
#include "scsihle.h"
#include "t10spc.h"
class atapi_hle_device : public ata_hle_device,
public virtual t10spc

150
src/emu/machine/legscsi.c Normal file
View File

@ -0,0 +1,150 @@
#include "legscsi.h"
legacy_scsi_host_adapter::legacy_scsi_host_adapter(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
m_scsi_port(*this)
{
}
void legacy_scsi_host_adapter::device_start()
{
}
void legacy_scsi_host_adapter::reset_bus()
{
for (int i = 0; i <= 7; i++)
{
scsihle_device *scsidev = get_device(i);
if (scsidev != NULL)
{
scsidev->reset();
}
}
}
bool legacy_scsi_host_adapter::select(int id)
{
m_selected = id;
scsihle_device *scsidev = get_device(m_selected);
if (scsidev != NULL)
{
return true;
}
return false;
}
void legacy_scsi_host_adapter::send_command(UINT8 *data, int bytes)
{
scsihle_device *scsidev = get_device(m_selected);
if (scsidev != NULL)
{
scsidev->SetCommand(data, bytes);
scsidev->ExecCommand();
}
else
{
logerror("%s: send_command unknown SCSI id %d\n", tag(), m_selected);
}
}
int legacy_scsi_host_adapter::get_length(void)
{
scsihle_device *scsidev = get_device(m_selected);
if (scsidev != NULL)
{
int length;
scsidev->GetLength(&length);
return length;
}
else
{
logerror("%s: get_length unknown SCSI id %d\n", tag(), m_selected);
return 0;
}
}
int legacy_scsi_host_adapter::get_phase(void)
{
scsihle_device *scsidev = get_device(m_selected);
if (scsidev != NULL)
{
int phase;
scsidev->GetPhase(&phase);
return phase;
}
else
{
logerror("%s: get_phase unknown SCSI id %d\n", tag(), m_selected);
return 0;
}
}
void legacy_scsi_host_adapter::read_data(UINT8 *data, int bytes)
{
scsihle_device *scsidev = get_device(m_selected);
if (scsidev != NULL)
{
scsidev->ReadData(data, bytes);
}
else
{
logerror("%s: read_data unknown SCSI id %d\n", tag(), m_selected);
}
}
void legacy_scsi_host_adapter::write_data(UINT8 *data, int bytes)
{
scsihle_device *scsidev = get_device(m_selected);
if (scsidev != NULL)
{
scsidev->WriteData(data, bytes);
}
else
{
logerror("%s: write_data unknown SCSI id %d\n", tag(), m_selected);
}
}
UINT8 legacy_scsi_host_adapter::get_status()
{
scsihle_device *scsidev = get_device(m_selected);
if (scsidev != NULL)
{
void *image;
scsidev->GetDevice(&image);
if (image != NULL)
return 0x00;
return 0x02;
}
else
{
logerror("%s: get_status unknown SCSI id %d\n", tag(), m_selected);
return 0;
}
}
scsihle_device *legacy_scsi_host_adapter::get_device(int id)
{
// steal scsi devices from bus
for (device_t *device = m_scsi_port->first_subdevice(); device != NULL; device = device->next())
{
SCSI_PORT_SLOT_device *slot = dynamic_cast<SCSI_PORT_SLOT_device *>(device);
if (slot != NULL)
{
scsihle_device *scsidev = dynamic_cast<scsihle_device *>(slot->dev());
if (scsidev != NULL)
{
if (scsidev->GetDeviceID() == id)
{
return scsidev;
}
}
}
}
return NULL;
}

37
src/emu/machine/legscsi.h Normal file
View File

@ -0,0 +1,37 @@
#ifndef _LEGSCSI_H_
#define _LEGSCSI_H_
#pragma once
#include "bus/scsi/scsihle.h"
#define MCFG_LEGACY_SCSI_PORT(_tag) \
legacy_scsi_host_adapter::set_scsi_port(*device, "^" _tag);
class legacy_scsi_host_adapter : public device_t
{
public:
legacy_scsi_host_adapter(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
static void set_scsi_port(device_t &device, const char *tag) { downcast<legacy_scsi_host_adapter &>(device).m_scsi_port.set_tag(tag); }
protected:
virtual void device_start();
void reset_bus();
bool select(int id);
void send_command(UINT8 *data, int bytes);
int get_length();
int get_phase();
void read_data(UINT8 *data, int bytes);
void write_data(UINT8 *data, int bytes);
UINT8 get_status();
private:
int m_selected;
scsihle_device *get_device(int id);
required_device<SCSI_PORT_DEVICE> m_scsi_port;
};
#endif

View File

@ -370,15 +370,6 @@ ifneq ($(filter CDP1871,$(MACHINES)),)
MACHINEOBJS += $(MACHINEOBJ)/cdp1871.o
endif
#-------------------------------------------------
#
#@src/emu/machine/cdu76s.h,MACHINES += CDU76S
#-------------------------------------------------
ifneq ($(filter CDU76S,$(MACHINES)),)
MACHINEOBJS += $(MACHINEOBJ)/cdu76s.o
endif
#-------------------------------------------------
#
#@src/emu/machine/com8116.h,MACHINES += COM8116
@ -1368,26 +1359,6 @@ ifneq ($(filter SATURN,$(MACHINES)),)
MACHINEOBJS += $(MACHINEOBJ)/saturn.o
endif
#-------------------------------------------------
#
#@src/emu/machine/scsibus.h,MACHINES += SCSI
#@src/emu/machine/scsicb.h,MACHINES += SCSI
#@src/emu/machine/scsicd.h,MACHINES += SCSI
#@src/emu/machine/scsidev.h,MACHINES += SCSI
#@src/emu/machine/scsihd.h,MACHINES += SCSI
#@src/emu/machine/scsihle.h,MACHINES += SCSI
#-------------------------------------------------
ifneq ($(filter SCSI,$(MACHINES)),)
MACHINEOBJS += $(MACHINEOBJ)/scsibus.o
MACHINEOBJS += $(MACHINEOBJ)/scsicb.o
MACHINEOBJS += $(MACHINEOBJ)/scsicd.o
MACHINEOBJS += $(MACHINEOBJ)/scsidev.o
MACHINEOBJS += $(MACHINEOBJ)/scsihd.o
MACHINEOBJS += $(MACHINEOBJ)/scsihle.o
MACHINES += T10
endif
#-------------------------------------------------
#
#@src/emu/machine/seibu_cop.h,MACHINES += SEIBU_COP
@ -1435,13 +1406,17 @@ endif
#-------------------------------------------------
#
#
#-------------------------------------------------
ifneq ($(filter SCSI,$(BUSES)),)
MACHINES += T10
endif
ifneq ($(filter T10,$(MACHINES)),)
MACHINEOBJS += $(MACHINEOBJ)/t10mmc.o
MACHINEOBJS += $(MACHINEOBJ)/t10sbc.o
MACHINEOBJS += $(MACHINEOBJ)/t10spc.o
MACHINES += T10
endif
#-------------------------------------------------

View File

@ -113,15 +113,17 @@ const device_type MB89352A = &device_creator<mb89352_device>;
* Device
*/
mb89352_device::mb89352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MB89352A, "MB89352A", tag, owner, clock, "mb89352", __FILE__),
m_irq_cb(*this),
m_drq_cb(*this)
mb89352_device::mb89352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
legacy_scsi_host_adapter(mconfig, MB89352A, "MB89352A", tag, owner, clock, "mb89352", __FILE__),
m_irq_cb(*this),
m_drq_cb(*this)
{
}
void mb89352_device::device_start()
{
legacy_scsi_host_adapter::device_start();
m_phase = SCSI_PHASE_BUS_FREE;
m_target = 0;
m_command_index = 0;
@ -136,20 +138,8 @@ void mb89352_device::device_start()
m_irq_cb.resolve_safe();
m_drq_cb.resolve_safe();
memset(m_SCSIdevices,0,sizeof(m_SCSIdevices));
// allocate read timer
m_transfer_timer = timer_alloc(TIMER_TRANSFER);
// try to open the devices
for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
{
scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
if( scsidev != NULL )
{
m_SCSIdevices[scsidev->GetDeviceID()] = scsidev;
}
}
}
void mb89352_device::device_reset()
@ -304,7 +294,7 @@ READ8_MEMBER( mb89352_device::mb89352_r )
m_transfer_index++;
m_transfer_count--;
if(m_transfer_index % 512 == 0)
m_SCSIdevices[m_target]->ReadData(m_buffer,512);
read_data(m_buffer, 512);
if(m_transfer_count == 0)
{
// End of transfer
@ -437,6 +427,7 @@ WRITE8_MEMBER( mb89352_device::mb89352_w )
{
//m_ints |= INTS_SELECTION;
}
select(m_target);
set_phase(SCSI_PHASE_COMMAND); // straight to command phase, may need a delay between selection and command phases
m_line_status |= MB89352_LINE_SEL;
m_line_status |= MB89352_LINE_BSY;
@ -462,7 +453,7 @@ WRITE8_MEMBER( mb89352_device::mb89352_w )
if(m_phase == SCSI_PHASE_DATAIN) // if we are reading data...
{
m_spc_status &= ~SSTS_DREG_EMPTY; // DREG is no longer empty
m_SCSIdevices[m_target]->ReadData(m_buffer,512);
read_data(m_buffer, 512);
}
if(m_phase == SCSI_PHASE_MESSAGE_IN)
{
@ -504,10 +495,8 @@ WRITE8_MEMBER( mb89352_device::mb89352_w )
int x;
int phase;
// execute SCSI command
m_SCSIdevices[m_target]->SetCommand(m_command,m_command_index);
m_SCSIdevices[m_target]->ExecCommand();
m_SCSIdevices[m_target]->GetLength(&m_result_length);
m_SCSIdevices[m_target]->GetPhase(&phase);
send_command(m_command, m_command_index);
phase = get_phase();
if(m_command[0] == 1) // Rezero Unit - not implemented in SCSI code
set_phase(SCSI_PHASE_STATUS);
else
@ -521,12 +510,7 @@ WRITE8_MEMBER( mb89352_device::mb89352_w )
}
if(m_phase == SCSI_PHASE_STATUS)
{
void *image;
m_SCSIdevices[m_target]->GetDevice(&image);
if (image != NULL)
m_temp = 0x00;
else
m_temp = 0x02;
m_temp = get_status();
set_phase(SCSI_PHASE_MESSAGE_IN);
return;
}
@ -570,10 +554,8 @@ WRITE8_MEMBER( mb89352_device::mb89352_w )
int x;
int phase;
// execute SCSI command
m_SCSIdevices[m_target]->SetCommand(m_command,m_command_index);
m_SCSIdevices[m_target]->ExecCommand();
m_SCSIdevices[m_target]->GetLength(&m_result_length);
m_SCSIdevices[m_target]->GetPhase(&phase);
send_command(m_command, m_command_index);
phase = get_phase();
if(m_command[0] == 1) // Rezero Unit - not implemented in SCSI code
set_phase(SCSI_PHASE_STATUS);
else
@ -592,7 +574,7 @@ WRITE8_MEMBER( mb89352_device::mb89352_w )
m_transfer_index++;
m_transfer_count--;
if(m_transfer_index % 512 == 0)
m_SCSIdevices[m_target]->WriteData(m_buffer,512);
write_data(m_buffer, 512);
if(m_transfer_count == 0)
{
// End of transfer

View File

@ -7,7 +7,7 @@
#ifndef MB89352_H_
#define MB89352_H_
#include "machine/scsihle.h"
#include "legscsi.h"
// SCSI lines readable via PSNS register (reg 5)
#define MB89352_LINE_REQ 0x80
@ -54,7 +54,7 @@
#define MCFG_MB89352A_DRQ_CB(_devcb) \
devcb = &mb89352_device::set_drq_callback(*device, DEVCB2_##_devcb);
class mb89352_device : public device_t
class mb89352_device : public legacy_scsi_host_adapter
{
public:
// construction/destruction
@ -87,8 +87,6 @@ private:
devcb2_write_line m_irq_cb; /* irq callback */
devcb2_write_line m_drq_cb; /* drq callback */
scsihle_device* m_SCSIdevices[8];
UINT8 m_phase; // current SCSI phase
UINT8 m_target; // current SCSI target
UINT8 m_bdid; // Bus device ID (SCSI ID of the bus?)
@ -109,7 +107,6 @@ private:
UINT8 m_command_index;
UINT8 m_command[16];
UINT32 m_transfer_index;
int m_result_length;
UINT8 m_buffer[512];
emu_timer* m_transfer_timer;

View File

@ -75,8 +75,8 @@ const device_type NCR5380 = &device_creator<ncr5380_device>;
// ncr5380_device - constructor/destructor
//-------------------------------------------------
ncr5380_device::ncr5380_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, NCR5380, "5380 SCSI", tag, owner, clock, "ncr5380", __FILE__),
ncr5380_device::ncr5380_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
legacy_scsi_host_adapter(mconfig, NCR5380, "5380 SCSI", tag, owner, clock, "ncr5380", __FILE__),
m_irq_cb(*this)
{
}
@ -87,9 +87,10 @@ ncr5380_device::ncr5380_device(const machine_config &mconfig, const char *tag, d
void ncr5380_device::device_start()
{
legacy_scsi_host_adapter::device_start();
memset(m_5380_Registers, 0, sizeof(m_5380_Registers));
memset(m_5380_Data, 0, sizeof(m_5380_Data));
memset(m_scsi_devices, 0, sizeof(m_scsi_devices));
m_next_req_flag = 0;
m_irq_cb.resolve_safe();
@ -102,16 +103,6 @@ void ncr5380_device::device_start()
save_item(NAME(m_d_ptr));
save_item(NAME(m_d_limit));
save_item(NAME(m_next_req_flag));
// try to open the devices
for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
{
scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
if( scsidev != NULL )
{
m_scsi_devices[scsidev->GetDeviceID()] = scsidev;
}
}
}
//-------------------------------------------------
@ -184,7 +175,7 @@ UINT8 ncr5380_device::ncr5380_read_reg(UINT32 offset)
// don't issue a "false" read
if (m_d_limit > 0)
{
ncr5380_read_data((m_d_limit < 512) ? m_d_limit : 512, m_5380_Data);
read_data(m_5380_Data, (m_d_limit < 512) ? m_d_limit : 512);
}
else
{
@ -282,7 +273,7 @@ void ncr5380_device::ncr5380_write_reg(UINT32 offset, UINT8 data)
// if we've hit a sector, flush
if (m_d_ptr == 511)
{
ncr5380_write_data(512, &m_5380_Data[0]);
write_data(&m_5380_Data[0], 512);
m_d_limit -= 512;
m_d_ptr = 0;
@ -318,9 +309,8 @@ void ncr5380_device::ncr5380_write_reg(UINT32 offset, UINT8 data)
if (VERBOSE)
logerror("%s NCR5380: Command (to ID %d): %x %x %x %x %x %x %x %x %x %x\n", machine().describe_context(), m_last_id, m_5380_Command[0], m_5380_Command[1], m_5380_Command[2], m_5380_Command[3], m_5380_Command[4], m_5380_Command[5], m_5380_Command[6], m_5380_Command[7], m_5380_Command[8], m_5380_Command[9]);
m_scsi_devices[m_last_id]->SetCommand(&m_5380_Command[0], 16);
m_scsi_devices[m_last_id]->ExecCommand();
m_scsi_devices[m_last_id]->GetLength(&m_d_limit);
send_command(&m_5380_Command[0], 16);
m_d_limit = get_length();
if (VERBOSE)
logerror("NCR5380: Command returned %d bytes\n", m_d_limit);
@ -337,7 +327,7 @@ void ncr5380_device::ncr5380_write_reg(UINT32 offset, UINT8 data)
}
// read back the amount available, or 512 bytes, whichever is smaller
ncr5380_read_data((m_d_limit < 512) ? m_d_limit : 512, m_5380_Data);
read_data(m_5380_Data, (m_d_limit < 512) ? m_d_limit : 512);
// raise REQ to indicate data is available
m_5380_Registers[R5380_BUSSTATUS] |= 0x20;
@ -352,7 +342,7 @@ void ncr5380_device::ncr5380_write_reg(UINT32 offset, UINT8 data)
// if the device exists, make the bus busy.
// otherwise don't.
if (m_scsi_devices[m_last_id])
if (select(m_last_id))
{
if (VERBOSE)
logerror("NCR5380: Giving the bus for ID %d\n", m_last_id);
@ -429,31 +419,3 @@ void ncr5380_device::ncr5380_write_reg(UINT32 offset, UINT8 data)
m_5380_Registers[R5380_BUSANDSTAT] = 0x48;
}
}
void ncr5380_device::ncr5380_read_data(int bytes, UINT8 *pData)
{
if (m_scsi_devices[m_last_id])
{
if (VERBOSE)
logerror("NCR5380: issuing read for %d bytes\n", bytes);
m_scsi_devices[m_last_id]->ReadData(pData, bytes);
}
else
{
logerror("ncr5380: read unknown device SCSI ID %d\n", m_last_id);
}
}
void ncr5380_device::ncr5380_write_data(int bytes, UINT8 *pData)
{
if (m_scsi_devices[m_last_id])
{
m_scsi_devices[m_last_id]->WriteData(pData, bytes);
}
else
{
logerror("ncr5380: write to unknown device SCSI ID %d\n", m_last_id);
}
}

View File

@ -6,7 +6,7 @@
#ifndef _NCR5380_H_
#define _NCR5380_H_
#include "machine/scsihle.h"
#include "legscsi.h"
// 5380 registers
enum
@ -35,7 +35,7 @@ enum
#define MCFG_NCR5380_IRQ_CB(_devcb) \
devcb = &ncr5380_device::set_irq_callback(*device, DEVCB2_##_devcb);
class ncr5380_device : public device_t
class ncr5380_device : public legacy_scsi_host_adapter
{
public:
// construction/destruction
@ -47,9 +47,6 @@ public:
UINT8 ncr5380_read_reg(UINT32 offset);
void ncr5380_write_reg(UINT32 offset, UINT8 data);
void ncr5380_read_data(int bytes, UINT8 *pData);
void ncr5380_write_data(int bytes, UINT8 *pData);
protected:
// device-level overrides
virtual void device_start();
@ -57,8 +54,6 @@ protected:
virtual void device_stop();
private:
scsihle_device *m_scsi_devices[8];
UINT8 m_5380_Registers[8];
UINT8 m_last_id;
UINT8 m_5380_Command[32];

View File

@ -114,8 +114,8 @@ const device_type NCR539X = &device_creator<ncr539x_device>;
// ncr539x_device - constructor/destructor
//-------------------------------------------------
ncr539x_device::ncr539x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, NCR539X, "539x SCSI", tag, owner, clock, "ncr539x", __FILE__),
ncr539x_device::ncr539x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
legacy_scsi_host_adapter(mconfig, NCR539X, "539x SCSI", tag, owner, clock, "ncr539x", __FILE__),
m_out_irq_cb(*this),
m_out_drq_cb(*this)
{
@ -127,22 +127,12 @@ ncr539x_device::ncr539x_device(const machine_config &mconfig, const char *tag, d
void ncr539x_device::device_start()
{
memset(m_scsi_devices, 0, sizeof(m_scsi_devices));
legacy_scsi_host_adapter::device_start();
// resolve line callbacks
m_out_irq_cb.resolve_safe();
m_out_drq_cb.resolve_safe();
// try to open the devices
for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
{
scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
if( scsidev != NULL )
{
m_scsi_devices[scsidev->GetDeviceID()] = scsidev;
}
}
m_operation_timer = timer_alloc(0, NULL);
}
@ -152,8 +142,6 @@ void ncr539x_device::device_start()
void ncr539x_device::device_reset()
{
memset(m_scsi_devices, 0, sizeof(m_scsi_devices));
m_fifo_ptr = 0;
m_irq_status = 0;
m_status = SCSI_PHASE_STATUS;
@ -174,32 +162,13 @@ void ncr539x_device::device_reset()
void ncr539x_device::dma_read_data(int bytes, UINT8 *pData)
{
if (m_scsi_devices[m_last_id])
{
if (VERBOSE)
logerror("NCR539x: issuing read for %d bytes\n", bytes);
m_scsi_devices[m_last_id]->ReadData(pData, bytes);
}
else
{
logerror("ncr539x: read unknown device SCSI ID %d\n", m_last_id);
}
read_data(pData, bytes);
}
void ncr539x_device::dma_write_data(int bytes, UINT8 *pData)
{
if (bytes)
{
if (m_scsi_devices[m_last_id])
{
m_scsi_devices[m_last_id]->WriteData(pData, bytes);
}
else
{
logerror("ncr539x: write to unknown device SCSI ID %d\n", m_last_id);
}
}
write_data(pData, bytes);
}
void ncr539x_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
@ -218,7 +187,7 @@ void ncr539x_device::device_timer(emu_timer &timer, device_timer_id tid, int par
switch (m_command & 0x7f)
{
case 0x41: // select without ATN steps
if (m_scsi_devices[m_last_id])
if (select(m_last_id))
{
m_irq_status |= IRQ_STATUS_SERVICE_REQUEST | IRQ_STATUS_SUCCESS;
// we should now be in the command phase
@ -250,7 +219,7 @@ void ncr539x_device::device_timer(emu_timer &timer, device_timer_id tid, int par
break;
case 0x42: // Select with ATN steps
if (m_scsi_devices[m_last_id])
if (select(m_last_id))
{
m_irq_status |= IRQ_STATUS_SERVICE_REQUEST | IRQ_STATUS_SUCCESS;
// we should now be in the command phase
@ -532,7 +501,7 @@ WRITE8_MEMBER( ncr539x_device::write )
m_irq_status = IRQ_STATUS_SUCCESS;
int phase;
m_scsi_devices[m_last_id]->GetPhase( &phase );
phase = get_phase();
#if VERBOSE
printf("Information transfer: phase %d buffer remaining %x\n", phase, m_buffer_remaining);
@ -556,7 +525,7 @@ WRITE8_MEMBER( ncr539x_device::write )
if (amtToGet > 0)
{
m_scsi_devices[m_last_id]->ReadData(m_buffer, amtToGet);
read_data(m_buffer, amtToGet);
m_total_data -= amtToGet;
m_buffer_offset = 0;
@ -647,7 +616,7 @@ WRITE8_MEMBER( ncr539x_device::write )
break;
case 0x47: // Reselect with ATN3 steps
if (m_scsi_devices[m_last_id])
if (select(m_last_id))
{
m_irq_status |= IRQ_STATUS_SERVICE_REQUEST | IRQ_STATUS_SUCCESS;
// we should now be in the command phase
@ -754,10 +723,9 @@ void ncr539x_device::exec_fifo()
{
int length, phase;
m_scsi_devices[m_last_id]->SetCommand(&m_fifo[0], 12);
m_scsi_devices[m_last_id]->ExecCommand();
m_scsi_devices[m_last_id]->GetLength(&length);
m_scsi_devices[m_last_id]->GetPhase(&phase);
send_command(&m_fifo[0], 12);
length = get_length();
phase = get_phase();
#if VERBOSE
printf("Command executed (id %d), new phase %d, length %x\n", m_last_id, phase, length);
@ -818,7 +786,7 @@ void ncr539x_device::fifo_write(UINT8 data)
#if VERBOSE
printf("Flushing buffer to device, %x bytes left in buffer (%x total)\n", m_xfer_count, m_total_data);
#endif
m_scsi_devices[m_last_id]->WriteData(m_buffer, flush_size);
write_data(m_buffer, flush_size);
m_buffer_offset = 0;
// need a service request here too

View File

@ -6,7 +6,7 @@
#ifndef _NCR539x_H_
#define _NCR539x_H_
#include "machine/scsihle.h"
#include "legscsi.h"
//// 539x registers
//enum
@ -21,8 +21,7 @@
#define MCFG_NCR539X_OUT_DRQ_CB(_devcb) \
devcb = &ncr539x_device::set_out_drq_callback(*device, DEVCB2_##_devcb);
class ncr539x_device : public device_t
class ncr539x_device : public legacy_scsi_host_adapter
{
public:
// construction/destruction
@ -50,8 +49,6 @@ private:
void exec_fifo();
void update_fifo_internal_state(int bytes);
scsihle_device *m_scsi_devices[8];
UINT32 m_xfer_count;
UINT32 m_dma_size;
UINT8 m_command;

View File

@ -1,58 +0,0 @@
// license:MAME
// copyright-holders:smf
/*
scsibus.c
*/
#include "emu.h"
#include "machine/scsibus.h"
void scsibus_device::scsi_update()
{
UINT32 newdata = 0;
for( int i = 0; i < deviceCount; i++ )
{
newdata |= devices[ i ]->data_out;
}
newdata &= SCSI_MASK_ALL;
UINT32 mask = data ^ newdata;
if( mask != 0 )
{
data = newdata;
for( int i = 0; i < deviceCount; i++ )
{
devices[ i ]->scsi_in( data, mask );
}
}
}
scsibus_device::scsibus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, SCSIBUS, "SCSI bus", tag, owner, clock, "scsibus", __FILE__)
{
}
void scsibus_device::device_start()
{
deviceCount = 0;
for( device_t *device = first_subdevice(); device != NULL; device = device->next() )
{
scsidev_device *scsidev = dynamic_cast<scsidev_device *>(device);
if( scsidev != NULL )
{
devices[ deviceCount++ ] = scsidev;
scsidev->m_scsibus = this;
}
}
data = 0;
}
const device_type SCSIBUS = &device_creator<scsibus_device>;

View File

@ -1,42 +0,0 @@
// license:MAME
// copyright-holders:smf
/*
scsibus.h
*/
#pragma once
#ifndef _SCSIBUS_H_
#define _SCSIBUS_H_
#include "machine/scsidev.h"
class scsibus_device : public device_t
{
public:
// construction/destruction
scsibus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
/* SCSI Bus read/write */
void scsi_update();
protected:
// device-level overrides
virtual void device_start();
private:
scsidev_device *devices[16];
UINT32 data;
int deviceCount;
};
#define MCFG_SCSIBUS_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, SCSIBUS, 0)
// device type definition
extern const device_type SCSIBUS;
#endif

View File

@ -1,208 +0,0 @@
// license:MAME
// copyright-holders:smf
/*
scsicb.c
Implementation of a raw SCSI/SASI bus for machines that don't use a SCSI
controler chip such as the RM Nimbus, which implements it as a bunch of
74LS series chips.
*/
#include "scsicb.h"
#include "scsibus.h"
#define VERBOSE_LEVEL ( 0 )
INLINE void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, running_machine &machine, const char *s_fmt, ... )
{
if( VERBOSE_LEVEL >= n_level )
{
va_list v;
char buf[ 32768 ];
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
logerror( "%s: %s", machine.describe_context( ), buf );
}
}
scsicb_device::scsicb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: scsidev_device(mconfig, SCSICB, "SCSI callback", tag, owner, clock, "scsicb", __FILE__),
m_bsy_handler(*this),
m_sel_handler(*this),
m_cd_handler(*this),
m_io_handler(*this),
m_msg_handler(*this),
m_req_handler(*this),
m_ack_handler(*this),
m_atn_handler(*this),
m_rst_handler(*this)
{
}
void scsicb_device::device_start()
{
scsidev_device::device_start();
linestate = 0;
m_bsy_handler.resolve_safe();
m_sel_handler.resolve_safe();
m_cd_handler.resolve_safe();
m_io_handler.resolve_safe();
m_msg_handler.resolve_safe();
m_req_handler.resolve_safe();
m_ack_handler.resolve_safe();
m_atn_handler.resolve_safe();
m_rst_handler.resolve_safe();
}
void scsicb_device::scsi_in( UINT32 data, UINT32 mask )
{
linestate = data;
trigger_callback( mask, SCSI_MASK_BSY, m_bsy_handler );
trigger_callback( mask, SCSI_MASK_SEL, m_sel_handler );
trigger_callback( mask, SCSI_MASK_CD, m_cd_handler );
trigger_callback( mask, SCSI_MASK_IO, m_io_handler );
trigger_callback( mask, SCSI_MASK_MSG, m_msg_handler );
trigger_callback( mask, SCSI_MASK_REQ, m_req_handler );
trigger_callback( mask, SCSI_MASK_ACK, m_ack_handler );
trigger_callback( mask, SCSI_MASK_ATN, m_atn_handler );
trigger_callback( mask, SCSI_MASK_RST, m_rst_handler );
}
UINT8 scsicb_device::scsi_data_r()
{
UINT8 data = linestate & SCSI_MASK_DATA;
verboselog( 1, machine(), "%s scsi_data_r() %02x\n", tag(), data );
return data;
}
void scsicb_device::scsi_data_w( UINT8 data )
{
verboselog( 1, machine(), "%s scsi_data_w( %02x )\n", tag(), data );
scsi_out( data, SCSI_MASK_DATA );
}
READ8_MEMBER( scsicb_device::scsi_data_r )
{
return scsi_data_r();
}
WRITE8_MEMBER( scsicb_device::scsi_data_w )
{
scsi_data_w( data );
}
READ_LINE_MEMBER( scsicb_device::scsi_bsy_r ) { return get_scsi_line(SCSI_MASK_BSY); }
READ_LINE_MEMBER( scsicb_device::scsi_sel_r ) { return get_scsi_line(SCSI_MASK_SEL); }
READ_LINE_MEMBER( scsicb_device::scsi_cd_r ) { return get_scsi_line(SCSI_MASK_CD); }
READ_LINE_MEMBER( scsicb_device::scsi_io_r ) { return get_scsi_line(SCSI_MASK_IO); }
READ_LINE_MEMBER( scsicb_device::scsi_msg_r ) { return get_scsi_line(SCSI_MASK_MSG); }
READ_LINE_MEMBER( scsicb_device::scsi_req_r ) { return get_scsi_line(SCSI_MASK_REQ); }
READ_LINE_MEMBER( scsicb_device::scsi_ack_r ) { return get_scsi_line(SCSI_MASK_ACK); }
READ_LINE_MEMBER( scsicb_device::scsi_atn_r ) { return get_scsi_line(SCSI_MASK_ATN); }
READ_LINE_MEMBER( scsicb_device::scsi_rst_r ) { return get_scsi_line(SCSI_MASK_RST); }
WRITE_LINE_MEMBER( scsicb_device::scsi_bsy_w ) { set_scsi_line(SCSI_MASK_BSY, state); }
WRITE_LINE_MEMBER( scsicb_device::scsi_sel_w ) { set_scsi_line(SCSI_MASK_SEL, state); }
WRITE_LINE_MEMBER( scsicb_device::scsi_cd_w ) { set_scsi_line(SCSI_MASK_CD, state); }
WRITE_LINE_MEMBER( scsicb_device::scsi_io_w ) { set_scsi_line(SCSI_MASK_IO, state); }
WRITE_LINE_MEMBER( scsicb_device::scsi_msg_w ) { set_scsi_line(SCSI_MASK_MSG, state); }
WRITE_LINE_MEMBER( scsicb_device::scsi_req_w ) { set_scsi_line(SCSI_MASK_REQ, state); }
WRITE_LINE_MEMBER( scsicb_device::scsi_ack_w ) { set_scsi_line(SCSI_MASK_ACK, state); }
WRITE_LINE_MEMBER( scsicb_device::scsi_atn_w ) { set_scsi_line(SCSI_MASK_ATN, state); }
WRITE_LINE_MEMBER( scsicb_device::scsi_rst_w ) { set_scsi_line(SCSI_MASK_RST, state); }
UINT8 scsicb_device::get_scsi_line( UINT32 mask )
{
UINT8 state;
if( ( linestate & mask ) != 0 )
{
state = 1;
}
else
{
state = 0;
}
verboselog( 1, machine(), "%s get_scsi_line %s %d\n", tag(), get_line_name( mask ), state );
return state;
}
void scsicb_device::set_scsi_line( UINT32 mask, UINT8 state )
{
verboselog( 1, machine(), "%s set_scsi_line %s %d\n", tag(), get_line_name( mask ), state );
if( state )
{
scsi_out( mask, mask );
}
else
{
scsi_out( 0, mask );
}
}
void scsicb_device::trigger_callback( UINT32 update_mask, UINT32 line_mask, devcb2_write_line &write_line )
{
if( ( update_mask & line_mask ) != 0 && !write_line.isnull() )
{
UINT8 state;
if( ( linestate & line_mask ) != 0 )
{
state = 1;
}
else
{
state = 0;
}
verboselog( 1, machine(), "%s trigger_callback %s %d\n", tag(), get_line_name( line_mask ), state );
write_line( state );
}
}
const char *scsicb_device::get_line_name( UINT32 mask )
{
switch( mask )
{
case SCSI_MASK_BSY:
return "bsy";
case SCSI_MASK_SEL:
return "sel";
case SCSI_MASK_CD:
return "cd";
case SCSI_MASK_IO:
return "io";
case SCSI_MASK_MSG:
return "msg";
case SCSI_MASK_REQ:
return "req";
case SCSI_MASK_ACK:
return "ack";
case SCSI_MASK_ATN:
return "atn";
case SCSI_MASK_RST:
return "rst";
}
return "?";
}
const device_type SCSICB = &device_creator<scsicb_device>;

View File

@ -1,112 +0,0 @@
// license:MAME
// copyright-holders:smf
/*
scsicb.h
Implementation of a raw SCSI/SASI bus for machines that don't use a SCSI
controler chip such as the RM Nimbus, which implements it as a bunch of
74LS series chips.
*/
#pragma once
#ifndef _SCSICB_H_
#define _SCSICB_H_
#include "scsidev.h"
class scsicb_device : public scsidev_device
{
public:
// construction/destruction
scsicb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// static configuration helpers
template<class _Object> static devcb2_base &set_bsy_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_bsy_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_sel_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_sel_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_cd_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_cd_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_io_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_io_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_msg_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_msg_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_req_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_req_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_ack_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_ack_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_atn_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_atn_handler.set_callback(object); }
template<class _Object> static devcb2_base &set_rst_handler(device_t &device, _Object object) { return downcast<scsicb_device &>(device).m_rst_handler.set_callback(object); }
virtual void scsi_in( UINT32 data, UINT32 mask );
UINT8 scsi_data_r();
void scsi_data_w( UINT8 data );
DECLARE_READ8_MEMBER( scsi_data_r );
DECLARE_WRITE8_MEMBER( scsi_data_w );
DECLARE_READ_LINE_MEMBER( scsi_bsy_r );
DECLARE_READ_LINE_MEMBER( scsi_sel_r );
DECLARE_READ_LINE_MEMBER( scsi_cd_r );
DECLARE_READ_LINE_MEMBER( scsi_io_r );
DECLARE_READ_LINE_MEMBER( scsi_msg_r );
DECLARE_READ_LINE_MEMBER( scsi_req_r );
DECLARE_READ_LINE_MEMBER( scsi_ack_r );
DECLARE_READ_LINE_MEMBER( scsi_atn_r );
DECLARE_READ_LINE_MEMBER( scsi_rst_r );
DECLARE_WRITE_LINE_MEMBER( scsi_bsy_w );
DECLARE_WRITE_LINE_MEMBER( scsi_sel_w );
DECLARE_WRITE_LINE_MEMBER( scsi_cd_w );
DECLARE_WRITE_LINE_MEMBER( scsi_io_w );
DECLARE_WRITE_LINE_MEMBER( scsi_msg_w );
DECLARE_WRITE_LINE_MEMBER( scsi_req_w );
DECLARE_WRITE_LINE_MEMBER( scsi_ack_w );
DECLARE_WRITE_LINE_MEMBER( scsi_atn_w );
DECLARE_WRITE_LINE_MEMBER( scsi_rst_w );
protected:
// device-level overrides
virtual void device_start();
private:
UINT8 get_scsi_line(UINT32 mask);
void set_scsi_line(UINT32 mask, UINT8 state);
void trigger_callback(UINT32 update_mask, UINT32 line_mask, devcb2_write_line &write_line);
const char *get_line_name(UINT32 mask);
devcb2_write_line m_bsy_handler;
devcb2_write_line m_sel_handler;
devcb2_write_line m_cd_handler;
devcb2_write_line m_io_handler;
devcb2_write_line m_msg_handler;
devcb2_write_line m_req_handler;
devcb2_write_line m_ack_handler;
devcb2_write_line m_atn_handler;
devcb2_write_line m_rst_handler;
UINT32 linestate;
};
#define MCFG_SCSICB_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, SCSICB, 0)
#define MCFG_SCSICB_BSY_HANDLER(_devcb) \
devcb = &scsicb_device::set_bsy_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSICB_SEL_HANDLER(_devcb) \
devcb = &scsicb_device::set_sel_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSICB_CD_HANDLER(_devcb) \
devcb = &scsicb_device::set_cd_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSICB_IO_HANDLER(_devcb) \
devcb = &scsicb_device::set_io_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSICB_MSG_HANDLER(_devcb) \
devcb = &scsicb_device::set_msg_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSICB_REQ_HANDLER(_devcb) \
devcb = &scsicb_device::set_req_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSICB_ACK_HANDLER(_devcb) \
devcb = &scsicb_device::set_ack_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSICB_ATN_HANDLER(_devcb) \
devcb = &scsicb_device::set_atn_handler(*device, DEVCB2_##_devcb);
#define MCFG_SCSICB_RST_HANDLER(_devcb) \
devcb = &scsicb_device::set_rst_handler(*device, DEVCB2_##_devcb);
// device type definition
extern const device_type SCSICB;
#endif

View File

@ -1,157 +0,0 @@
// license:MAME
// copyright-holders:smf
/*
scsidev.c
Base class for SCSI devices.
*/
#include "machine/scsibus.h"
#include "machine/scsidev.h"
#define LOG ( 0 )
scsidev_device::scsidev_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) :
device_t(mconfig, type, name, tag, owner, clock, shortname, source)
{
}
void scsidev_device::device_start()
{
data_out = 0;
}
void scsidev_device::scsi_out( UINT32 data, UINT32 mask )
{
#if LOG
printf( "%s scsi_out", tag() );
printf( " rst " );
if( ( mask & SCSI_MASK_RST ) != 0 )
{
printf( "%d", (int)( ( data & SCSI_MASK_RST ) != 0 ) );
}
else
{
printf( "-" );
}
printf( " atn " );
if( ( mask & SCSI_MASK_ATN ) != 0 )
{
printf( " %d", (int)( ( data & SCSI_MASK_ATN ) != 0 ) );
}
else
{
printf( "-" );
}
printf( " ack " );
if( ( mask & SCSI_MASK_ACK ) != 0 )
{
printf( "%d", (int)( ( data & SCSI_MASK_ACK ) != 0 ) );
}
else
{
printf( "-" );
}
printf( " req " );
if( ( mask & SCSI_MASK_REQ ) != 0 )
{
printf( "%d", (int)( ( data & SCSI_MASK_REQ ) != 0 ) );
}
else
{
printf( "-" );
}
printf( " msg " );
if( ( mask & SCSI_MASK_MSG ) != 0 )
{
printf( "%d", (int)( ( data & SCSI_MASK_MSG ) != 0 ) );
}
else
{
printf( "-" );
}
printf( " io " );
if( ( mask & SCSI_MASK_IO ) != 0 )
{
printf( "%d", (int)( ( data & SCSI_MASK_IO ) != 0 ) );
}
else
{
printf( "-" );
}
printf( " cd " );
if( ( mask & SCSI_MASK_CD ) != 0 )
{
printf( "%d", (int)( ( data & SCSI_MASK_CD ) != 0 ) );
}
else
{
printf( "-" );
}
printf( " sel " );
if( ( mask & SCSI_MASK_SEL ) != 0 )
{
printf( "%d", (int)( ( data & SCSI_MASK_SEL ) != 0 ) );
}
else
{
printf( "-" );
}
printf( " bsy " );
if( ( mask & SCSI_MASK_BSY ) != 0 )
{
printf( "%d", (int)( ( data & SCSI_MASK_BSY ) != 0 ) );
}
else
{
printf( "-" );
}
printf( " p " );
if( ( mask & SCSI_MASK_DATAP ) != 0 )
{
printf( "%d", (int)( ( data & SCSI_MASK_DATAP ) != 0 ) );
}
else
{
printf( "-" );
}
printf( " " );
if( ( mask & SCSI_MASK_DATAH ) != 0 )
{
printf( "%02x", ( data & SCSI_MASK_DATAH ) >> 8 );
}
else
{
printf( "--" );
}
if( ( mask & SCSI_MASK_DATA ) != 0 )
{
printf( "%02x", data & SCSI_MASK_DATA );
}
else
{
printf( "--" );
}
printf( "\n" );
#endif
data_out = ( data_out & ~mask ) | ( data & mask );
m_scsibus->scsi_update();
}

View File

@ -1,54 +0,0 @@
// license:MAME
// copyright-holders:smf
/*
scsidev.h
Base class for SCSI devices.
*/
#ifndef _SCSIDEV_H_
#define _SCSIDEV_H_
#include "emu.h"
#define SCSI_MASK_DATA ( 0x00000ff )
#define SCSI_MASK_DATAH ( 0x000ff00 )
#define SCSI_MASK_DATAP ( 0x0010000 )
#define SCSI_MASK_BSY ( 0x0020000 )
#define SCSI_MASK_SEL ( 0x0040000 )
#define SCSI_MASK_CD ( 0x0080000 )
#define SCSI_MASK_IO ( 0x0100000 )
#define SCSI_MASK_MSG ( 0x0200000 )
#define SCSI_MASK_REQ ( 0x0400000 )
#define SCSI_MASK_ACK ( 0x0800000 )
#define SCSI_MASK_ATN ( 0x1000000 )
#define SCSI_MASK_RST ( 0x2000000 )
#define SCSI_MASK_ALL ( 0x3ffffff )
class scsibus_device;
// base handler
class scsidev_device : public device_t
{
friend class scsibus_device;
public:
// construction/destruction
scsidev_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);
protected:
// device-level overrides
virtual void device_start();
void scsi_out( UINT32 data, UINT32 mask );
private:
virtual void scsi_in( UINT32 data, UINT32 mask ) = 0;
UINT32 data_out;
scsibus_device *m_scsibus;
};
#endif

View File

@ -1,86 +0,0 @@
// license:MAME
// copyright-holders:smf
/*
scsihle.h
Base class for HLE'd SCSI devices.
*/
#ifndef _SCSIHLE_H_
#define _SCSIHLE_H_
#include "machine/scsibus.h"
#include "machine/scsidev.h"
#include "machine/t10spc.h"
class scsihle_device : public scsidev_device,
public virtual t10spc
{
public:
// construction/destruction
scsihle_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);
virtual int GetDeviceID();
virtual void scsi_in( UINT32 data, UINT32 mask );
// configuration helpers
static void static_set_deviceid(device_t &device, int _scsiID);
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
private:
void scsi_out_req_delay(UINT8 state);
void scsi_change_phase(UINT8 newphase);
int get_scsi_cmd_len(int cbyte);
UINT8 scsibus_driveno(UINT8 drivesel);
void scsibus_read_data();
void scsibus_write_data();
void scsibus_exec_command();
void dump_command_bytes();
void dump_data_bytes(int count);
void dump_bytes(UINT8 *buff, int count);
emu_timer *req_timer;
emu_timer *sel_timer;
emu_timer *dataout_timer;
UINT8 cmd_idx;
UINT8 is_linked;
UINT8 buffer[ 1024 ];
UINT16 data_idx;
int bytes_left;
int data_last;
int scsiID;
};
//
// Status / Sense data taken from Adaptec ACB40x0 documentation.
//
// SCSI IDs
enum
{
SCSI_ID_0 = 0,
SCSI_ID_1,
SCSI_ID_2,
SCSI_ID_3,
SCSI_ID_4,
SCSI_ID_5,
SCSI_ID_6,
SCSI_ID_7
};
#define MCFG_SCSIDEV_ADD(_tag, _type, _id) \
MCFG_DEVICE_ADD(_tag, _type, 0) \
scsihle_device::static_set_deviceid(*device, _id);
#endif

View File

@ -162,20 +162,6 @@ int wd33c93_device::get_xfer_count( void )
return count;
}
void wd33c93_device::read_data(int bytes, UINT8 *pData)
{
UINT8 unit = getunit();
if ( devices[unit] )
{
devices[unit]->ReadData( pData, bytes );
}
else
{
logerror("wd33c93: request for unknown device SCSI ID %d\n", unit);
}
}
void wd33c93_device::complete_immediate( int status )
{
/* reset our timer */
@ -285,7 +271,7 @@ void wd33c93_device::select_cmd()
UINT8 newstatus;
/* see if we can select that device */
if ( devices[unit] )
if (select(unit))
{
/* device is available - signal selection done */
newstatus = CSR_SELECT;
@ -321,19 +307,16 @@ void wd33c93_device::selectxfer_cmd()
UINT8 newstatus;
/* see if we can select that device */
if ( devices[unit] )
if (select(unit))
{
if ( regs[WD_COMMAND_PHASE] < 0x45 )
{
/* device is available */
int xfercount;
int phase;
/* do the request */
devices[unit]->SetCommand( &regs[WD_CDB_1], 12 );
devices[unit]->ExecCommand();
devices[unit]->GetLength( &xfercount );
devices[unit]->GetPhase( &phase );
send_command(&regs[WD_CDB_1], 12);
phase = get_phase();
/* set transfer count */
if ( get_xfer_count() > TEMP_INPUT_LEN )
@ -357,7 +340,7 @@ void wd33c93_device::selectxfer_cmd()
if ( get_xfer_count() < len ) len = get_xfer_count();
memset( &temp_input[0], 0, TEMP_INPUT_LEN );
read_data( len, &temp_input[0] );
read_data(&temp_input[0], len);
temp_input_pos = 0;
read_pending = 0;
}
@ -549,15 +532,13 @@ WRITE8_MEMBER(wd33c93_device::write)
case PHS_COMMAND:
{
UINT8 unit = getunit();
int xfercount;
int phase;
/* Execute the command. Depending on the command, we'll move to data in or out */
devices[unit]->SetCommand( &fifo[0], 12 );
devices[unit]->ExecCommand();
devices[unit]->GetLength( &xfercount );
devices[unit]->GetPhase( &phase );
send_command(&fifo[0], 12);
xfercount = get_length();
phase = get_phase();
/* reset fifo */
fifo_pos = 0;
@ -586,7 +567,7 @@ WRITE8_MEMBER(wd33c93_device::write)
case PHS_DATA_OUT:
{
/* write data out to device */
write_data( fifo_pos, fifo );
write_data(fifo, fifo_pos);
/* reset fifo */
fifo_pos = 0;
@ -683,7 +664,7 @@ READ8_MEMBER(wd33c93_device::read)
int len = TEMP_INPUT_LEN;
if ( (count+1) < len ) len = count+1;
read_data( len, &temp_input[0] );
read_data(&temp_input[0], len);
temp_input_pos = 0;
read_pending = 0;
}
@ -741,16 +722,17 @@ READ8_MEMBER(wd33c93_device::read)
return 0;
}
wd33c93_device::wd33c93_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, WD33C93, "33C93 SCSI", tag, owner, clock, "wd33c93", __FILE__),
m_irq_cb(*this)
wd33c93_device::wd33c93_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
legacy_scsi_host_adapter(mconfig, WD33C93, "33C93 SCSI", tag, owner, clock, "wd33c93", __FILE__),
m_irq_cb(*this)
{
}
void wd33c93_device::device_start()
{
legacy_scsi_host_adapter::device_start();
memset(regs, 0, sizeof(regs));
memset(devices, 0, sizeof(devices));
memset(fifo, 0, sizeof(fifo));
memset(temp_input, 0, sizeof(temp_input));
@ -761,15 +743,6 @@ void wd33c93_device::device_start()
identify = 0;
read_pending = 0;
// try to open the devices
for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
{
scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
if( scsidev != NULL )
{
devices[scsidev->GetDeviceID()] = scsidev;
}
}
m_irq_cb.resolve();
/* allocate a timer for commands */
@ -788,7 +761,7 @@ void wd33c93_device::device_start()
save_item( NAME( read_pending ) );
}
void wd33c93_device::get_dma_data( int bytes, UINT8 *pData )
void wd33c93_device::dma_read_data( int bytes, UINT8 *pData )
{
int len = bytes;
@ -813,18 +786,9 @@ void wd33c93_device::get_dma_data( int bytes, UINT8 *pData )
set_xfer_count(len);
}
void wd33c93_device::write_data(int bytes, UINT8 *pData)
void wd33c93_device::dma_write_data(int bytes, UINT8 *pData)
{
UINT8 unit = getunit();
if (devices[unit])
{
devices[unit]->WriteData( pData, bytes );
}
else
{
logerror("wd33c93: request for unknown device SCSI ID %d\n", unit);
}
write_data(pData, bytes);
}
void wd33c93_device::clear_dma()

View File

@ -6,7 +6,7 @@
#ifndef _WD33C93_H_
#define _WD33C93_H_
#include "machine/scsihle.h"
#include "legscsi.h"
/* wd register names */
@ -48,7 +48,7 @@ enum
#define MCFG_WD33C93_IRQ_CB(_devcb) \
devcb = &wd33c93_device::set_irq_callback(*device, DEVCB2_##_devcb);
class wd33c93_device : public device_t
class wd33c93_device : public legacy_scsi_host_adapter
{
public:
// construction/destruction
@ -59,8 +59,8 @@ public:
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
void get_dma_data( int bytes, UINT8 *pData );
void write_data(int bytes, UINT8 *pData);
void dma_read_data( int bytes, UINT8 *pData );
void dma_write_data(int bytes, UINT8 *pData);
void clear_dma();
int get_dma_count();
@ -73,7 +73,6 @@ private:
UINT8 getunit( void );
void set_xfer_count( int count );
int get_xfer_count( void );
void read_data(int bytes, UINT8 *pData);
void complete_immediate( int status );
void complete_cmd( UINT8 status );
void unimplemented_cmd();
@ -87,8 +86,6 @@ private:
void xferinfo_cmd();
void dispatch_command();
scsihle_device *devices[8]; // SCSI IDs 0-7
UINT8 sasr;
UINT8 regs[WD_AUXILIARY_STATUS+1];
UINT8 fifo[FIFO_SIZE];

View File

@ -462,8 +462,8 @@ hardware modification to the security cart.....
#include "machine/intelfsh.h"
#include "machine/nvram.h"
#include "includes/cps3.h"
#include "machine/scsibus.h"
#include "machine/scsicd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsicd.h"
#include "machine/wd33c93.h"
#define MASTER_CLOCK 42954500
@ -2234,7 +2234,7 @@ static ADDRESS_MAP_START( cps3_map, AS_PROGRAM, 32, cps3_state )
AM_RANGE(0x05100000, 0x05100003) AM_WRITE(cps3_irq12_ack_w )
AM_RANGE(0x05110000, 0x05110003) AM_WRITE(cps3_irq10_ack_w )
AM_RANGE(0x05140000, 0x05140003) AM_DEVREADWRITE8("scsi:wd33c93", wd33c93_device, read, write, 0x00ff00ff )
AM_RANGE(0x05140000, 0x05140003) AM_DEVREADWRITE8("wd33c93", wd33c93_device, read, write, 0x00ff00ff )
AM_RANGE(0x06000000, 0x067fffff) AM_READWRITE(cps3_flash1_r, cps3_flash1_w ) /* Flash ROMs simm 1 */
AM_RANGE(0x06800000, 0x06ffffff) AM_READWRITE(cps3_flash2_r, cps3_flash2_w ) /* Flash ROMs simm 2 */
@ -2560,9 +2560,11 @@ static MACHINE_CONFIG_START( cps3, cps3_state )
MCFG_CPU_PERIODIC_INT_DRIVER(cps3_state, cps3_other_interrupt, 80) /* ?source? */
MCFG_CPU_CONFIG(sh2_conf_cps3)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_1)
MCFG_DEVICE_ADD("scsi:wd33c93", WD33C93, 0)
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_1)
MCFG_DEVICE_ADD("wd33c93", WD33C93, 0)
MCFG_LEGACY_SCSI_PORT("scsi")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@ -2648,7 +2650,7 @@ ROM_START( redearth )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "redearth_euro.29f400.u2", 0x000000, 0x080000, CRC(02e0f336) SHA1(acc37e830dfeb9674f5a0fb24f4cc23217ae4ff5) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-wzd-5", 0, BAD_DUMP SHA1(e5676752b08283dc4a98c3d7b759e8aa6dcd0679) )
ROM_END
@ -2656,7 +2658,7 @@ ROM_START( redearthr1 )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "redearth_euro.29f400.u2", 0x000000, 0x080000, CRC(02e0f336) SHA1(acc37e830dfeb9674f5a0fb24f4cc23217ae4ff5) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-wzd-3", 0, SHA1(a6ff67093db6bc80ee5fc46e4300e0177b213a52) )
ROM_END
@ -2664,7 +2666,7 @@ ROM_START( warzard )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "warzard_japan.29f400.u2", 0x000000, 0x080000, CRC(f8e2f0c6) SHA1(93d6a986f44c211fff014e55681eca4d2a2774d6) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-wzd-5", 0, BAD_DUMP SHA1(e5676752b08283dc4a98c3d7b759e8aa6dcd0679) )
ROM_END
@ -2672,7 +2674,7 @@ ROM_START( warzardr1 )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "warzard_japan.29f400.u2", 0x000000, 0x080000, CRC(f8e2f0c6) SHA1(93d6a986f44c211fff014e55681eca4d2a2774d6) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-wzd-3", 0, SHA1(a6ff67093db6bc80ee5fc46e4300e0177b213a52) )
ROM_END
@ -2681,7 +2683,7 @@ ROM_START( sfiii )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "sfiii_euro.29f400.u2", 0x000000, 0x080000, CRC(27699ddc) SHA1(d8b525cd27e584560b129598df31fd2c5b2a682a) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
ROM_END
@ -2689,7 +2691,7 @@ ROM_START( sfiiiu )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "sfiii_usa_region_b1.29f400.u2", 0x000000, 0x080000, CRC(fb172a8e) SHA1(48ebf59910f246835f7dc0c588da30f7a908072f) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
ROM_END
@ -2697,7 +2699,7 @@ ROM_START( sfiiia )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "sfiii_asia_region_bd.29f400.u2", 0x000000, 0x080000, CRC(cbd28de7) SHA1(9c15ecb73b9587d20850e62e8683930a45caa01b) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
ROM_END
@ -2705,7 +2707,7 @@ ROM_START( sfiiij )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "sfiii_japan.29f400.u2", 0x000000, 0x080000, CRC(74205250) SHA1(c3e83ace7121d32da729162662ec6b5285a31211) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
ROM_END
@ -2713,7 +2715,7 @@ ROM_START( sfiiih )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "sfiii_hispanic.29f400.u2", 0x000000, 0x080000, CRC(d2b3cd48) SHA1(00ebb270c24a66515c97e35331de54ff5358000e) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-sf3-3", 0, BAD_DUMP SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
ROM_END
@ -2722,7 +2724,7 @@ ROM_START( sfiii2 )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "sfiii2_usa.29f400.u2", 0x000000, 0x080000, CRC(75dd72e0) SHA1(5a12d6ea6734df5de00ecee6f9ef470749d2f242) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-3ga000", 0, BAD_DUMP SHA1(4e162885b0b3265a56e0265037bcf247e820f027) )
ROM_END
@ -2730,7 +2732,7 @@ ROM_START( sfiii2j )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "sfiii2_japan.29f400.u2", 0x000000, 0x080000, CRC(faea0a3e) SHA1(a03cd63bcf52e4d57f7a598c8bc8e243694624ec) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-3ga000", 0, BAD_DUMP SHA1(4e162885b0b3265a56e0265037bcf247e820f027) )
ROM_END
@ -2739,7 +2741,7 @@ ROM_START( jojo )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-jjk-3", 0, SHA1(dc6e74b5e02e13f62cb8c4e234dd6061501e49c1) )
ROM_END
@ -2747,7 +2749,7 @@ ROM_START( jojor1 )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-jjk-2", 0, BAD_DUMP SHA1(0f5c09171409213e191a607ee89ca3a91fe9c96a) )
ROM_END
@ -2755,7 +2757,7 @@ ROM_START( jojor2 )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-jjk000", 0, BAD_DUMP SHA1(09869f6d8c032b527e02d815749dc8fab1289e86) )
ROM_END
@ -2763,7 +2765,7 @@ ROM_START( jojoj )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-jjk-3", 0, SHA1(dc6e74b5e02e13f62cb8c4e234dd6061501e49c1) )
ROM_END
@ -2771,7 +2773,7 @@ ROM_START( jojojr1 )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-jjk-2", 0, BAD_DUMP SHA1(0f5c09171409213e191a607ee89ca3a91fe9c96a) )
ROM_END
@ -2779,7 +2781,7 @@ ROM_START( jojojr2 )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-jjk000", 0, BAD_DUMP SHA1(09869f6d8c032b527e02d815749dc8fab1289e86) )
ROM_END
@ -2788,7 +2790,7 @@ ROM_START( sfiii3 )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "sfiii3_euro.29f400.u2", 0x000000, 0x080000, CRC(30bbf293) SHA1(f094c2eeaf4f6709060197aca371a4532346bf78) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-33s-2", 0, BAD_DUMP SHA1(41b0e246db91cbfc3f8f0f62d981734feb4b4ab5) )
ROM_END
@ -2796,7 +2798,7 @@ ROM_START( sfiii3r1 )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "sfiii3_euro.29f400.u2", 0x000000, 0x080000, CRC(30bbf293) SHA1(f094c2eeaf4f6709060197aca371a4532346bf78) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-33s-1", 0, BAD_DUMP SHA1(2f4a9006a31903114f9f9dc09465ae253e565c51) )
ROM_END
@ -2804,7 +2806,7 @@ ROM_START( sfiii3u )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-33s-2", 0, BAD_DUMP SHA1(41b0e246db91cbfc3f8f0f62d981734feb4b4ab5) )
ROM_END
@ -2812,7 +2814,7 @@ ROM_START( sfiii3ur1 )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-33s-1", 0, BAD_DUMP SHA1(2f4a9006a31903114f9f9dc09465ae253e565c51) )
ROM_END
@ -2821,7 +2823,7 @@ ROM_START( jojoba )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "jojoba_japan.29f400.u2", 0x000000, 0x080000, CRC(3085478c) SHA1(055eab1fc42816f370a44b17fd7e87ffcb10e8b7) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-jjm-1", 0, SHA1(8628d3fa555fbd5f4121082e925c1834b76c5e65) )
ROM_END
@ -2829,7 +2831,7 @@ ROM_START( jojobar1 )
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "jojoba_japan.29f400.u2", 0x000000, 0x080000, CRC(3085478c) SHA1(055eab1fc42816f370a44b17fd7e87ffcb10e8b7) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "cap-jjm-0", 0, BAD_DUMP SHA1(0678a0baeb853dcff1d230c14f0873cc9f143d7b) )
ROM_END
@ -3690,7 +3692,7 @@ ROM_START( cps3boot ) // for cart with standard SH2
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07))
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "no-battery_multi-game_bootleg_cd_for_hd6417095_sh2", 0, SHA1(123f2fcb0f3dd3d6b859e82a51d0127e46763776) )
ROM_END
@ -3698,7 +3700,7 @@ ROM_START( cps3bs32 ) // for cart with standard SH2
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07))
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "sfiii_2nd_impact_converted_for_standard_sh2_v3", 0, SHA1(8f180d159e88042a1e819cefd39eef67f5e86e3d) )
ROM_END
@ -3706,7 +3708,7 @@ ROM_START( cps3bs32a ) // for cart with standard SH2
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07))
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "sfiii_2nd_impact_converted_for_standard_sh2_older", 0, SHA1(8a8e4138c3bf12435933ab9d9ace510513200843) ) // v1 or v2?
ROM_END
@ -3714,7 +3716,7 @@ ROM_START( cps3boota ) // for cart with dead custom SH2 (or 2nd Impact CPU which
ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
ROM_LOAD( "no-battery_bios_29f400_for_dead_security_cart.u2", 0x000000, 0x080000, CRC(0fd56fb3) SHA1(5a8bffc07eb7da73cf4bca6718df72e471296bfd) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "no-battery_multi-game_bootleg_cd_for_dead_security_cart", 0, SHA1(4b0b673b45dac94da018576c0a7f8644653fc564) )
ROM_END

View File

@ -53,8 +53,8 @@
#include "machine/am53cf96.h"
#include "machine/eepromser.h"
#include "machine/mb89371.h"
#include "machine/scsibus.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsihd.h"
#include "sound/k056800.h"
#include "sound/k054539.h"
@ -66,7 +66,7 @@ public:
m_maincpu(*this, "maincpu"),
m_soundcpu(*this, "soundcpu"),
m_dasp(*this, "dasp"),
m_am53cf96(*this, "scsi:am53cf96"),
m_am53cf96(*this, "am53cf96"),
m_k056800(*this, "k056800")
{
}
@ -135,7 +135,7 @@ READ8_MEMBER(konamigq_state::pcmram_r)
/* Video */
static ADDRESS_MAP_START( konamigq_map, AS_PROGRAM, 32, konamigq_state )
AM_RANGE(0x1f000000, 0x1f00001f) AM_DEVREADWRITE8("scsi:am53cf96", am53cf96_device, read, write, 0x00ff00ff)
AM_RANGE(0x1f000000, 0x1f00001f) AM_DEVREADWRITE8("am53cf96", am53cf96_device, read, write, 0x00ff00ff)
AM_RANGE(0x1f100000, 0x1f10001f) AM_DEVREADWRITE8("k056800", k056800_device, host_r, host_w, 0x00ff00ff)
AM_RANGE(0x1f180000, 0x1f180003) AM_WRITE16(eeprom_w, 0x0000ffff)
AM_RANGE(0x1f198000, 0x1f198003) AM_WRITENOP /* cabinet lamps? */
@ -315,10 +315,12 @@ static MACHINE_CONFIG_START( konamigq, konamigq_state )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
MCFG_EEPROM_SERIAL_DATA(konamigq_def_eeprom, 128)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:disk", SCSIHD, SCSI_ID_0)
MCFG_AM53CF96_ADD("scsi:am53cf96")
MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("^maincpu:irq", psxirq_device, intin10))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
MCFG_DEVICE_ADD("am53cf96", AM53CF96, 0)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("maincpu:irq", psxirq_device, intin10))
/* video hardware */
MCFG_PSXGPU_ADD("maincpu", "gpu", CXD8538Q, 0x200000, XTAL_53_693175MHz)
@ -433,7 +435,7 @@ ROM_START( cryptklr )
ROM_REGION32_LE( 0x080000, "maincpu:rom", 0 ) /* bios */
ROM_LOAD( "420b03.27p", 0x0000000, 0x080000, CRC(aab391b1) SHA1(bf9dc7c0c8168c22a4be266fe6a66d3738df916b) )
DISK_REGION( "scsi:disk:image" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":harddisk:image" )
DISK_IMAGE( "420uaa04", 0, SHA1(67cb1418fc0de2a89fc61847dc9efb9f1bebb347) )
ROM_END

View File

@ -127,8 +127,8 @@ Notes:
#include "machine/eepromser.h"
#include "machine/intelfsh.h"
#include "machine/mb89371.h"
#include "machine/scsibus.h"
#include "machine/scsicd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsicd.h"
#include "sound/spu.h"
#include "sound/cdda.h"
@ -137,7 +137,7 @@ class konamigv_state : public driver_device
public:
konamigv_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_am53cf96(*this, "scsi:am53cf96"),
m_am53cf96(*this, "am53cf96"),
m_maincpu(*this, "maincpu")
{
}
@ -174,7 +174,7 @@ private:
};
static ADDRESS_MAP_START( konamigv_map, AS_PROGRAM, 32, konamigv_state )
AM_RANGE(0x1f000000, 0x1f00001f) AM_DEVREADWRITE8("scsi:am53cf96", am53cf96_device, read, write, 0x00ff00ff)
AM_RANGE(0x1f000000, 0x1f00001f) AM_DEVREADWRITE8("am53cf96", am53cf96_device, read, write, 0x00ff00ff)
AM_RANGE(0x1f100000, 0x1f100003) AM_READ_PORT("P1")
AM_RANGE(0x1f100004, 0x1f100007) AM_READ_PORT("P2")
AM_RANGE(0x1f100008, 0x1f10000b) AM_READ_PORT("P3_P4")
@ -309,6 +309,12 @@ void konamigv_state::driver_start()
save_item(NAME(m_btc_trackball_data));
}
static MACHINE_CONFIG_FRAGMENT( cdrom_config )
MCFG_DEVICE_MODIFY( "cdda" )
MCFG_SOUND_ROUTE( 0, "^^^^lspeaker", 1.0 )
MCFG_SOUND_ROUTE( 1, "^^^^rspeaker", 1.0 )
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( konamigv, konamigv_state )
/* basic machine hardware */
MCFG_CPU_ADD( "maincpu", CXD8530BQ, XTAL_67_7376MHz )
@ -323,10 +329,13 @@ static MACHINE_CONFIG_START( konamigv, konamigv_state )
MCFG_DEVICE_ADD("mb89371", MB89371, 0)
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_4)
MCFG_AM53CF96_ADD("scsi:am53cf96")
MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("^maincpu:irq", psxirq_device, intin10))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_4)
MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_config)
MCFG_DEVICE_ADD("am53cf96", AM53CF96, 0)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("maincpu:irq", psxirq_device, intin10))
/* video hardware */
MCFG_PSXGPU_ADD( "maincpu", "gpu", CXD8514Q, 0x100000, XTAL_53_693175MHz )
@ -337,10 +346,6 @@ static MACHINE_CONFIG_START( konamigv, konamigv_state )
MCFG_SPU_ADD( "spu", XTAL_67_7376MHz/2 )
MCFG_SOUND_ROUTE( 0, "lspeaker", 0.75 )
MCFG_SOUND_ROUTE( 1, "rspeaker", 0.75 )
MCFG_SOUND_MODIFY( "scsi:cdrom:cdda" )
MCFG_SOUND_ROUTE( 0, "^^^lspeaker", 1.0 )
MCFG_SOUND_ROUTE( 1, "^^^rspeaker", 1.0 )
MACHINE_CONFIG_END
@ -679,7 +684,7 @@ ROM_START( lacrazyc )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "lacrazyc.25c", 0x000000, 0x000080, CRC(e20e5730) SHA1(066b49236c658a4ef2930f7bacc4b2354dd7f240) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "gv027-a1", 0, BAD_DUMP SHA1(840d0d4876cf1b814c9d8db975aa6c92e1fe4039) )
ROM_END
@ -689,7 +694,7 @@ ROM_START( susume )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "susume.25c", 0x000000, 0x000080, CRC(52f17df7) SHA1(b8ad7787b0692713439d7d9bebfa0c801c806006) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "gv027j1", 0, BAD_DUMP SHA1(e7e6749ac65de7771eb8fed7d5eefaec3f902255) )
ROM_END
@ -699,7 +704,7 @@ ROM_START( hyperath )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "hyperath.25c", 0x000000, 0x000080, CRC(20a8c435) SHA1(a0f203a999757fba68b391c525ac4b9684a57ba9) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "gv021-j1", 0, SHA1(579442444025b18da658cd6455c51459fbc3de0e) )
ROM_END
@ -709,7 +714,7 @@ ROM_START( powyak96 )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "powyak96.25c", 0x000000, 0x000080, CRC(405a7fc9) SHA1(e2d978f49748ba3c4a425188abcd3d272ec23907) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "powyak96", 0, BAD_DUMP SHA1(ebd0ea18ff9ce300ea1e30d66a739a96acfb0621) )
ROM_END
@ -719,7 +724,7 @@ ROM_START( weddingr )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "weddingr.25c", 0x000000, 0x000080, CRC(b90509a0) SHA1(41510a0ceded81dcb26a70eba97636d38d3742c3) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "weddingr", 0, BAD_DUMP SHA1(4e7122b191747ab7220fe4ce1b4483d62ab579af) )
ROM_END
@ -729,7 +734,7 @@ ROM_START( simpbowl )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "simpbowl.25c", 0x000000, 0x000080, CRC(2c61050c) SHA1(16ae7f81cbe841c429c5c7326cf83e87db1782bf) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "simpbowl", 0, BAD_DUMP SHA1(72b32a863e6891ad3bfc1fdfe9cb90a2bd334d71) )
ROM_END
@ -739,7 +744,7 @@ ROM_START( btchamp )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "btchmp.25c", 0x000000, 0x000080, CRC(6d02ea54) SHA1(d3babf481fd89db3aec17f589d0d3d999a2aa6e1) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "btchamp", 0, BAD_DUMP SHA1(c9c858e9034826e1a12c3c003dd068a49a3577e1) )
ROM_END
@ -749,7 +754,7 @@ ROM_START( kdeadeye )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "kdeadeye.25c", 0x000000, 0x000080, CRC(3935d2df) SHA1(cbb855c475269077803c380dbc3621e522efe51e) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "kdeadeye", 0, BAD_DUMP SHA1(3c737c51717925be724dcb93d30769649029b8ce) )
ROM_END
@ -759,7 +764,7 @@ ROM_START( nagano98 )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "nagano98.25c", 0x000000, 0x000080, CRC(b64b7451) SHA1(a77a37e0cc580934d1e7e05d523bae0acd2c1480) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "nagano98", 0, BAD_DUMP SHA1(1be7bd4531f249ff2233dd40a206c8d60054a8c6) )
ROM_END
@ -769,7 +774,7 @@ ROM_START( naganoj )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "720ja.25c", 0x000000, 0x000080, CRC(34c473ba) SHA1(768225b04a293bdbc114a092d14dee28d52044e9) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "720jaa01", 0, SHA1(437160996551ef4dfca43899d1d14beca62eb4c9) )
ROM_END
@ -779,7 +784,7 @@ ROM_START( tmosh )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "tmosh.25c", 0x000000, 0x000080, NO_DUMP )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "673jaa01", 0, SHA1(eaa76073749f9db48c1bee3dff9bea955683c8a8) )
ROM_END
@ -789,7 +794,7 @@ ROM_START( tmoshs )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "tmoshs.25c", 0x000000, 0x000080, CRC(e57b833f) SHA1(f18a0974a6be69dc179706643aab837ff61c2738) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "755jaa01", 0, SHA1(fc742a0b763ba38350ba7eb5d775948632aafd9d) )
ROM_END
@ -799,7 +804,7 @@ ROM_START( tmoshsp )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "tmoshsp.25c", 0x000000, 0x000080, CRC(af4cdd87) SHA1(97041e287e4c80066043967450779b81b62b2b8e) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "756jab01", 0, SHA1(b2c59b9801debccbbd986728152f314535c67e53) )
ROM_END
@ -809,7 +814,7 @@ ROM_START( tmoshspa )
ROM_REGION16_BE( 0x0000080, "eeprom", 0 ) /* default eeprom */
ROM_LOAD( "tmoshsp.25c", 0x000000, 0x000080, CRC(af4cdd87) SHA1(97041e287e4c80066043967450779b81b62b2b8e) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "756jaa01", 0, BAD_DUMP SHA1(5e6d349ad1a22c0dbb1ec26aa05febc830254339) ) // The CD was damaged
ROM_END

View File

@ -5436,11 +5436,13 @@ static MACHINE_CONFIG_START( model3_10, model3_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 2.0)
MCFG_SOUND_ROUTE(0, "rspeaker", 2.0)
MCFG_SCSIBUS_ADD("scsi")
MCFG_DEVICE_ADD("scsi:lsi53c810", LSI53C810, 0)
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_DEVICE_ADD("lsi53c810", LSI53C810, 0)
MCFG_LSI53C810_IRQ_CB(model3_state, scsi_irq_callback)
MCFG_LSI53C810_DMA_CB(model3_state, real3d_dma_callback)
MCFG_LSI53C810_FETCH_CB(model3_state, scsi_fetch)
MCFG_LEGACY_SCSI_PORT("scsi")
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( model3_15, model3_state )
@ -5479,11 +5481,13 @@ static MACHINE_CONFIG_START( model3_15, model3_state )
MCFG_SOUND_ROUTE(0, "lspeaker", 2.0)
MCFG_SOUND_ROUTE(0, "rspeaker", 2.0)
MCFG_SCSIBUS_ADD("scsi")
MCFG_DEVICE_ADD("scsi:lsi53c810", LSI53C810, 0)
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_DEVICE_ADD("lsi53c810", LSI53C810, 0)
MCFG_LSI53C810_IRQ_CB(model3_state, scsi_irq_callback)
MCFG_LSI53C810_DMA_CB(model3_state, real3d_dma_callback)
MCFG_LSI53C810_FETCH_CB(model3_state, scsi_fetch)
MCFG_LEGACY_SCSI_PORT("scsi")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED(scud, model3_15)

View File

@ -230,8 +230,8 @@ Notes:
#include "cpu/psx/psx.h"
#include "cpu/m68000/m68000.h"
#include "video/psx.h"
#include "machine/scsibus.h"
#include "machine/scsicd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsicd.h"
#include "machine/am53cf96.h"
#include "machine/rtc65271.h"
#include "machine/i2cmem.h"
@ -246,7 +246,7 @@ class twinkle_state : public driver_device
public:
twinkle_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_am53cf96(*this, "scsi:am53cf96"),
m_am53cf96(*this, "am53cf96"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu")
{
@ -673,7 +673,7 @@ READ8_MEMBER(twinkle_state::shared_psx_r)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, twinkle_state )
AM_RANGE(0x1f000000, 0x1f0007ff) AM_READWRITE8(shared_psx_r, shared_psx_w, 0x00ff00ff)
AM_RANGE(0x1f200000, 0x1f20001f) AM_DEVREADWRITE8("scsi:am53cf96", am53cf96_device, read, write, 0x00ff00ff)
AM_RANGE(0x1f200000, 0x1f20001f) AM_DEVREADWRITE8("am53cf96", am53cf96_device, read, write, 0x00ff00ff)
AM_RANGE(0x1f20a01c, 0x1f20a01f) AM_WRITENOP /* scsi? */
AM_RANGE(0x1f210400, 0x1f2107ff) AM_READNOP
AM_RANGE(0x1f218000, 0x1f218003) AM_WRITE8(watchdog_reset_w, 0x000000ff) /* LTC1232 */
@ -855,6 +855,12 @@ static void scsi_dma_write( twinkle_state *state, UINT32 *p_n_psxram, UINT32 n_a
}
static MACHINE_CONFIG_FRAGMENT( cdrom_config )
MCFG_DEVICE_MODIFY( "cdda" )
MCFG_SOUND_ROUTE( 0, "^^^^speakerleft", 1.0 )
MCFG_SOUND_ROUTE( 1, "^^^^speakerright", 1.0 )
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( twinkle, twinkle_state )
/* basic machine hardware */
MCFG_CPU_ADD( "maincpu", CXD8530CQ, XTAL_67_7376MHz )
@ -871,10 +877,13 @@ static MACHINE_CONFIG_START( twinkle, twinkle_state )
MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1200)) /* check TD pin on LTC1232 */
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_4)
MCFG_AM53CF96_ADD("scsi:am53cf96")
MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("^maincpu:irq", psxirq_device, intin10))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_4)
MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_config)
MCFG_DEVICE_ADD("am53cf96", AM53CF96, 0)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_AM53CF96_IRQ_HANDLER(DEVWRITELINE("maincpu:irq", psxirq_device, intin10))
MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", NULL, true)
MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(twinkle_state, ide_interrupt))
@ -894,10 +903,6 @@ static MACHINE_CONFIG_START( twinkle, twinkle_state )
MCFG_RF5C400_ADD("rfsnd", 32000000/2)
MCFG_SOUND_ROUTE(0, "speakerleft", 1.0)
MCFG_SOUND_ROUTE(1, "speakerright", 1.0)
MCFG_SOUND_MODIFY( "scsi:cdrom:cdda" )
MCFG_SOUND_ROUTE( 0, "^^^speakerleft", 1.0 )
MCFG_SOUND_ROUTE( 1, "^^^speakerright", 1.0 )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( twinklex, twinkle )
@ -1001,7 +1006,7 @@ ROM_START( bmiidx )
ROM_REGION( 0x224, "security", 0 )
ROM_LOAD( "863a02", 0x000000, 0x000224, BAD_DUMP CRC(7b2a429b) SHA1(f710d19c7b900a58584c07ab8fd3ab7b9f0121d7) )
DISK_REGION( "scsi:cdrom" ) // program
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" ) // program
DISK_IMAGE_READONLY( "gq863-jab01", 0, SHA1(331f80b40ed560c7e017621b7daeeb8275d92b9a) )
DISK_REGION( "cdrom1" ) // video CD
@ -1017,7 +1022,7 @@ ROM_START( bmiidxa )
ROM_REGION( 0x224, "security", 0 )
ROM_LOAD( "863a02", 0x000000, 0x000224, BAD_DUMP CRC(7b2a429b) SHA1(f710d19c7b900a58584c07ab8fd3ab7b9f0121d7) )
DISK_REGION( "scsi:cdrom" ) // program
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" ) // program
DISK_IMAGE_READONLY( "gq863a01", 0, SHA1(07fc467f6500504729becbaf77dabc093a134e65) )
DISK_REGION( "cdrom1" ) // video CD
@ -1033,7 +1038,7 @@ ROM_START( bmiidx2 )
ROM_REGION( 0x100, "security", 0 )
ROM_LOAD( "985a02", 0x000000, 0x000100, BAD_DUMP CRC(a35143a9) SHA1(1c0feeab60d9dc50dc4b9a2f3dac73ca619e74b0) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "gc985a01", 0, SHA1(0b783f11317f64552ebf3323459139529e7f315f) )
DISK_REGION( "cdrom1" ) // video CD
@ -1049,7 +1054,7 @@ ROM_START( bmiidx3 )
ROM_REGION( 0x100, "security", 0 )
ROM_LOAD( "992a02", 0x000000, 0x000100, BAD_DUMP CRC(51f24913) SHA1(574b555e3d0c234011198d218d7ae5e95091acb1) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "gc992-jac01", 0, NO_DUMP )
DISK_REGION( "cdrom1" ) // video CD
@ -1065,7 +1070,7 @@ ROM_START( bmiidx3a )
ROM_REGION( 0x100, "security", 0 )
ROM_LOAD( "992a02", 0x000000, 0x000100, BAD_DUMP CRC(51f24913) SHA1(574b555e3d0c234011198d218d7ae5e95091acb1) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "gc992-jaa01", 0, BAD_DUMP SHA1(7e5389735dff379bb286ba3744edf59b7dfcc74b) )
DISK_REGION( "cdrom1" ) // video CD
@ -1081,7 +1086,7 @@ ROM_START( bmiidx4 )
ROM_REGION( 0x100, "security", 0 )
ROM_LOAD( "a03", 0x000000, 0x000100, BAD_DUMP CRC(8860cfb6) SHA1(85a5b27f24d4baa7960e692b91c0cf3dc5388e72) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "a03jaa01", 0, SHA1(f54fc778c2187ccd950402a159babef956b71492 ) )
DISK_REGION( "cdrom1" ) // video CD
@ -1097,7 +1102,7 @@ ROM_START( bmiidx5 )
ROM_REGION( 0x100, "security", 0 )
ROM_LOAD( "a17", 0x000000, 0x000100, BAD_DUMP CRC(9428afb0) SHA1(ba907d3361256b022583d6a42fe223e90590e3c6) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "a17jaa01", 0, BAD_DUMP SHA1(9f552eaa0acbdbddf93cabe99f8f829afbf29e02) )
DISK_REGION( "cdrom1" ) // video CD
@ -1113,7 +1118,7 @@ ROM_START( bmiidx6 )
ROM_REGION( 0x100, "security", 0 )
ROM_LOAD( "b4u", 0x000000, 0x000100, BAD_DUMP CRC(0ab15633) SHA1(df004ff41f35b16089f69808ccf53a5e5cc13ac3) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "b4ujab01", 0, NO_DUMP )
DISK_REGION( "cdrom1" ) // DVD
@ -1129,7 +1134,7 @@ ROM_START( bmiidx6a )
ROM_REGION( 0x100, "security", 0 )
ROM_LOAD( "b4u", 0x000000, 0x000100, BAD_DUMP CRC(0ab15633) SHA1(df004ff41f35b16089f69808ccf53a5e5cc13ac3) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "b4ujaa01", 0, BAD_DUMP SHA1(d8f5d56b8728bea761dc4cdbc04851094d276bd6) )
DISK_REGION( "cdrom1" ) // DVD
@ -1145,7 +1150,7 @@ ROM_START( bmiidx7 )
ROM_REGION( 0x100, "security", 0 )
ROM_LOAD( "b44", 0x000000, 0x000100, BAD_DUMP CRC(5baf4761) SHA1(aa7e07eb2cada03b85bdf11ac6a3de65f4253eef) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "b44jaa01", 0, SHA1(57fb0312d8102e959658e48a97e46aa16e592b60) )
DISK_REGION( "cdrom1" ) // DVD
@ -1161,7 +1166,7 @@ ROM_START( bmiidx8 )
ROM_REGION( 0x100, "security", 0 )
ROM_LOAD( "c44", 0x000000, 0x000100, BAD_DUMP CRC(04c22349) SHA1(d1cb78911cb1ca660d393a81ed3ed07b24c51525) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "c44jaa01", 0, BAD_DUMP SHA1(8b544c81bc56b19e4aa1649e68824811d6d51ce5) )
DISK_REGION( "cdrom1" ) // DVD
@ -1177,7 +1182,7 @@ ROM_START( bmiidxc )
ROM_REGION( 0x224, "security", 0 )
ROM_LOAD( "896a02", 0x000000, 0x000224, BAD_DUMP CRC(7b2a429b) SHA1(f710d19c7b900a58584c07ab8fd3ab7b9f0121d7) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "896jabbm", 0, BAD_DUMP SHA1(117ae4c876207bbaf9e8fe0fdf5bb161155c1bdb) )
DISK_REGION( "cdrom1" ) // video CD
@ -1193,7 +1198,7 @@ ROM_START( bmiidxca )
ROM_REGION( 0x224, "security", 0 )
ROM_LOAD( "896a02", 0x000000, 0x000224, BAD_DUMP CRC(7b2a429b) SHA1(f710d19c7b900a58584c07ab8fd3ab7b9f0121d7) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "896jaabm", 0, SHA1(ea7205f86543d9273efcc226666ab530c32b23c1) )
DISK_REGION( "cdrom1" ) // video CD
@ -1209,7 +1214,7 @@ ROM_START( bmiidxs )
ROM_REGION( 0x224, "security", 0 )
ROM_LOAD( "983a02", 0x000000, 0x000224, NO_DUMP )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "gc983a01", 0, NO_DUMP )
DISK_REGION( "cdrom1" ) // video CD
@ -1225,7 +1230,7 @@ ROM_START( bmiidxc2 )
ROM_REGION( 0x224, "security", 0 )
ROM_LOAD( "984a02", 0x000000, 0x000224, BAD_DUMP CRC(5b08e1ef) SHA1(d43ad5d958313ccb2420246621d9180230b4782d) )
DISK_REGION( "scsi:cdrom" )
DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
DISK_IMAGE_READONLY( "ge984a01(bm)", 0, SHA1(03b083ba09652dfab6f328000c3c9de2a7a4e618) )
DISK_REGION( "cdrom1" ) // video CD

View File

@ -1,5 +1,5 @@
#include "video/polylgcy.h"
#include "machine/scsibus.h"
#include "bus/scsi/scsi.h"
#include "machine/53c810.h"
#include "audio/dsbz80.h"
#include "machine/eepromser.h"
@ -21,7 +21,7 @@ public:
model3_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu"),
m_lsi53c810(*this, "scsi:lsi53c810"),
m_lsi53c810(*this, "lsi53c810"),
m_audiocpu(*this, "audiocpu"),
m_scsp1(*this, "scsp1"),
m_eeprom(*this, "eeprom"),

View File

@ -494,6 +494,7 @@ MACHINES += PCCARD
#-------------------------------------------------
BUSES += CENTRONICS
BUSES += ISA
BUSES += SCSI
#-------------------------------------------------
# this is the list of driver libraries that

View File

@ -24,12 +24,12 @@
#include "machine/idectrl.h"
#include "bus/pci/mpc105.h"
#include "machine/intelfsh.h"
#include "machine/scsibus.h"
#include "bus/scsi/scsi.h"
#include "machine/53c810.h"
/* Devices */
#include "machine/scsicd.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsicd.h"
#include "bus/scsi/scsihd.h"
#include "formats/pc_dsk.h"
#include "machine/ram.h"
#include "machine/8042kbdc.h"
@ -188,13 +188,15 @@ static MACHINE_CONFIG_START( bebox, bebox_state )
MCFG_FUJITSU_29F016A_ADD("flash")
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_3)
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "cdrom", SCSICD, SCSI_ID_3)
MCFG_DEVICE_ADD("scsi:lsi53c810", LSI53C810, 0)
MCFG_LSI53C810_IRQ_CB(bebox_state, scsi_irq_callback)
MCFG_LSI53C810_DMA_CB(bebox_state, scsi_dma_callback)
MCFG_LSI53C810_FETCH_CB(bebox_state, scsi_fetch)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_IDE_CONTROLLER_ADD( "ide", ata_devices, "hdd", NULL, false ) /* FIXME */
MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(bebox_state, bebox_ide_interrupt))

View File

@ -60,6 +60,7 @@ Notes:
#include "includes/bullet.h"
#include "bus/rs232/rs232.h"
#include "bus/scsi/scsihd.h"
@ -530,9 +531,9 @@ WRITE8_MEMBER( bulletf_state::mbank_w )
READ8_MEMBER( bulletf_state::scsi_r )
{
UINT8 data = m_scsibus->scsi_data_r();
UINT8 data = m_scsi_data_in->read();
m_scsibus->scsi_ack_w(1);
m_scsibus->write_ack(1);
m_wack = 0;
update_dma_rdy();
@ -547,9 +548,9 @@ READ8_MEMBER( bulletf_state::scsi_r )
WRITE8_MEMBER( bulletf_state::scsi_w )
{
m_scsibus->scsi_data_w(data);
m_scsi_data_out->write(data);
m_scsibus->scsi_ack_w(1);
m_scsibus->write_ack(1);
m_wack = 0;
update_dma_rdy();
@ -970,38 +971,6 @@ static Z80PIO_INTERFACE( pio_intf )
};
//-------------------------------------------------
// Z80PIO_INTERFACE( bulletf_pio_intf )
//-------------------------------------------------
READ8_MEMBER( bulletf_state::pio_pa_r )
{
/*
bit signal
0
1
2
3 BUSY
4 MSG
5 C/D
6 REQ
7 I/O
*/
UINT8 data = 0;
data |= m_scsibus->scsi_bsy_r() << 3;
data |= m_scsibus->scsi_msg_r() << 4;
data |= m_scsibus->scsi_cd_r() << 5;
data |= m_scsibus->scsi_req_r() << 6;
data |= m_scsibus->scsi_io_r() << 7;
return data;
}
WRITE8_MEMBER( bulletf_state::pio_pa_w )
{
/*
@ -1011,17 +980,17 @@ WRITE8_MEMBER( bulletf_state::pio_pa_w )
0 ATN
1 RST
2 SEL
3
4
5
6
7
3 BUSY
4 MSG
5 C/D
6 REQ
7 I/O
*/
m_scsibus->scsi_atn_w(BIT(data, 0));
m_scsibus->scsi_rst_w(BIT(data, 1));
m_scsibus->scsi_sel_w(BIT(data, 2));
m_scsibus->write_atn(BIT(data, 0));
m_scsibus->write_rst(BIT(data, 1));
m_scsibus->write_sel(BIT(data, 2));
}
WRITE_LINE_MEMBER( bulletf_state::cstrb_w )
@ -1032,7 +1001,7 @@ WRITE_LINE_MEMBER( bulletf_state::cstrb_w )
static Z80PIO_INTERFACE( bulletf_pio_intf )
{
DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),
DEVCB_DRIVER_MEMBER(bulletf_state, pio_pa_r),
DEVCB_DEVICE_MEMBER("scsi_ctrl_in", input_buffer_device, read),
DEVCB_DRIVER_MEMBER(bulletf_state, pio_pa_w),
DEVCB_DEVICE_MEMBER("cent_data_out", output_latch_device, write),
DEVCB_NULL,
@ -1070,13 +1039,15 @@ WRITE_LINE_MEMBER( bulletf_state::req_w )
{
if (!state)
{
m_scsibus->scsi_ack_w(0);
m_scsibus->write_ack(0);
m_wack = 1;
}
m_wrdy = !state;
update_dma_rdy();
m_scsi_ctrl_in->write_bit6(state);
}
@ -1304,10 +1275,19 @@ static MACHINE_CONFIG_START( bulletf, bulletf_state )
MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL)
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(Z80DART_TAG, z80dart_device, rxb_w))
MCFG_SCSIBUS_ADD(SCSIBUS_TAG)
MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk0", SCSIHD, SCSI_ID_0)
MCFG_SCSICB_ADD(SCSIBUS_TAG ":host")
MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, bulletf_state, req_w))
MCFG_DEVICE_ADD(SCSIBUS_TAG, SCSI_PORT, 0)
MCFG_SCSI_BSY_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit3))
MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit4))
MCFG_SCSI_CD_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit5))
MCFG_SCSI_REQ_HANDLER(WRITELINE(bulletf_state, req_w))
MCFG_SCSI_IO_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit7))
MCFG_SCSI_DATA_INPUT_BUFFER("scsi_data_in")
MCFG_SCSI_OUTPUT_LATCH_ADD("scsi_data_out", SCSIBUS_TAG)
MCFG_DEVICE_ADD("scsi_ctrl_in", INPUT_BUFFER, 0)
MCFG_DEVICE_ADD("scsi_data_in", INPUT_BUFFER, 0)
MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
// software lists
MCFG_SOFTWARE_LIST_ADD("flop_list", "wmbullet")

View File

@ -173,8 +173,8 @@ Notes:
*/
#include "includes/fmtowns.h"
#include "machine/scsibus.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsihd.h"
// CD controller IRQ types
#define TOWNS_CD_IRQ_MPU 1
@ -2253,7 +2253,7 @@ static ADDRESS_MAP_START( towns_io , AS_IO, 32, towns_state)
// Keyboard (8042 MCU)
AM_RANGE(0x0600,0x0607) AM_READWRITE8(towns_keyboard_r, towns_keyboard_w,0x00ff00ff)
// SCSI controller
AM_RANGE(0x0c30,0x0c37) AM_DEVREADWRITE8("scsi:fm",fmscsi_device,fmscsi_r,fmscsi_w,0x00ff00ff)
AM_RANGE(0x0c30,0x0c37) AM_DEVREADWRITE8("fmscsi",fmscsi_device,fmscsi_r,fmscsi_w,0x00ff00ff)
// CMOS
AM_RANGE(0x3000,0x4fff) AM_READWRITE8(towns_cmos_r, towns_cmos_w,0x00ff00ff)
// Something (MS-DOS wants this 0x41ff to be 1)
@ -2305,7 +2305,7 @@ static ADDRESS_MAP_START( towns16_io , AS_IO, 16, towns_state) // for the 386SX
// Keyboard (8042 MCU)
AM_RANGE(0x0600,0x0607) AM_READWRITE8(towns_keyboard_r, towns_keyboard_w,0x00ff)
// SCSI controller
AM_RANGE(0x0c30,0x0c37) AM_DEVREADWRITE8("scsi:fm",fmscsi_device,fmscsi_r,fmscsi_w,0x00ff)
AM_RANGE(0x0c30,0x0c37) AM_DEVREADWRITE8("fmscsi",fmscsi_device,fmscsi_r,fmscsi_w,0x00ff)
// CMOS
AM_RANGE(0x3000,0x4fff) AM_READWRITE8(towns_cmos_r, towns_cmos_w,0x00ff)
// Something (MS-DOS wants this 0x41ff to be 1)
@ -2614,7 +2614,7 @@ void towns_state::machine_reset()
m_messram = m_ram;
m_cdrom = machine().device<cdrom_image_device>("cdrom");
m_cdda = machine().device<cdda_device>("cdda");
m_scsi = machine().device<fmscsi_device>("scsi:fm");
m_scsi = machine().device<fmscsi_device>("fmscsi");
m_ftimer = 0x00;
m_freerun_timer = 0x00;
m_nmi_mask = 0x00;
@ -2759,15 +2759,17 @@ static MACHINE_CONFIG_FRAGMENT( towns_base )
MCFG_CDROM_ADD("cdrom",towns_cdrom)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk0", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_2)
MCFG_SCSIDEV_ADD("scsi:harddisk3", SCSIHD, SCSI_ID_3)
MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
MCFG_FMSCSI_ADD("scsi:fm")
MCFG_FMSCSI_IRQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, towns_state, towns_scsi_irq))
MCFG_FMSCSI_DRQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, towns_state, towns_scsi_drq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "harddisk", SCSIHD, SCSI_ID_2)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE4, "harddisk", SCSIHD, SCSI_ID_3)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE5, "harddisk", SCSIHD, SCSI_ID_4)
MCFG_FMSCSI_ADD("fmscsi")
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_FMSCSI_IRQ_HANDLER(WRITELINE(towns_state, towns_scsi_irq))
MCFG_FMSCSI_DRQ_HANDLER(WRITELINE(towns_state, towns_scsi_drq))
MCFG_UPD71071_ADD("dma_1",towns_dma_config)
MCFG_UPD71071_ADD("dma_2",towns_dma_config)

View File

@ -21,8 +21,8 @@
#include "machine/8530scc.h"
#include "machine/sgi.h"
#include "machine/eepromser.h"
#include "machine/scsibus.h"
#include "machine/scsicd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsicd.h"
#include "machine/wd33c93.h"
struct HPC_t
@ -51,13 +51,14 @@ public:
TIMER_RTC
};
ip20_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_wd33c93(*this, "scsi:wd33c93"),
m_scc(*this, "scc"),
m_eeprom(*this, "eeprom"),
m_maincpu(*this, "maincpu") { }
ip20_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_wd33c93(*this, "wd33c93"),
m_scc(*this, "scc"),
m_eeprom(*this, "eeprom"),
m_maincpu(*this, "maincpu")
{
}
HPC_t m_HPC;
RTC_t m_RTC;
@ -580,6 +581,11 @@ static const mips3_config config =
};
#endif
static MACHINE_CONFIG_FRAGMENT( cdrom_config )
MCFG_DEVICE_MODIFY( "cdda" )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "^^^^mono", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( ip204415, ip20_state )
MCFG_CPU_ADD( "maincpu", R4600BE, 50000000*3 )
MCFG_CPU_CONFIG( config )
@ -604,13 +610,13 @@ static MACHINE_CONFIG_START( ip204415, ip20_state )
MCFG_DEVICE_ADD("sgi_mc", SGI_MC, 0)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_6)
MCFG_DEVICE_ADD("scsi:wd33c93", WD33C93, 0)
MCFG_WD33C93_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, ip20_state, scsi_irq)) /* command completion IRQ */
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "cdrom", SCSICD, SCSI_ID_6)
MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_config)
MCFG_SOUND_MODIFY( "scsi:cdrom:cdda" )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "^^^mono", 1.0)
MCFG_DEVICE_ADD("wd33c93", WD33C93, 0)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_WD33C93_IRQ_CB(WRITELINE(ip20_state, scsi_irq)) /* command completion IRQ */
MCFG_EEPROM_SERIAL_93C56_ADD("eeprom")
MACHINE_CONFIG_END

View File

@ -50,9 +50,9 @@
#include "video/newport.h"
#include "sound/dac.h"
#include "machine/nvram.h"
#include "machine/scsibus.h"
#include "machine/scsicd.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsicd.h"
#include "bus/scsi/scsihd.h"
#include "machine/wd33c93.h"
struct RTC_t
@ -97,19 +97,20 @@ public:
TIMER_IP22_MSEC
};
ip22_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_wd33c93(*this, "scsi:wd33c93"),
m_unkpbus0(*this, "unkpbus0"),
m_mainram(*this, "mainram"),
m_lpt0(*this, "lpt_0"),
m_pit(*this, "pit8254"),
m_sgi_mc(*this, "sgi_mc"),
m_newport(*this, "newport"),
m_dac(*this, "dac"),
m_kbdc8042(*this, "kbdc")
{ }
ip22_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_wd33c93(*this, "wd33c93"),
m_unkpbus0(*this, "unkpbus0"),
m_mainram(*this, "mainram"),
m_lpt0(*this, "lpt_0"),
m_pit(*this, "pit8254"),
m_sgi_mc(*this, "sgi_mc"),
m_newport(*this, "newport"),
m_dac(*this, "dac"),
m_kbdc8042(*this, "kbdc")
{
}
required_device<cpu_device> m_maincpu;
required_device<wd33c93_device> m_wd33c93;
@ -1275,7 +1276,7 @@ WRITE_LINE_MEMBER(ip22_state::scsi_irq)
if (words <= (512/4))
{
// one-shot
//m_wd33c93->get_dma_data(m_wd33c93->get_dma_count(), m_dma_buffer);
//m_wd33c93->dma_read_data(m_wd33c93->get_dma_count(), m_dma_buffer);
while (words)
{
@ -1302,13 +1303,13 @@ WRITE_LINE_MEMBER(ip22_state::scsi_irq)
}
words = m_wd33c93->get_dma_count();
m_wd33c93->write_data(words, m_dma_buffer);
m_wd33c93->dma_write_data(words, m_dma_buffer);
}
else
{
while (words)
{
//m_wd33c93->get_dma_data(512, m_dma_buffer);
//m_wd33c93->dma_read_data(512, m_dma_buffer);
twords = 512/4;
m_HPC3.nSCSI0Descriptor += 512;
dptr = 0;
@ -1337,7 +1338,7 @@ WRITE_LINE_MEMBER(ip22_state::scsi_irq)
twords--;
}
m_wd33c93->write_data(512, m_dma_buffer);
m_wd33c93->dma_write_data(512, m_dma_buffer);
words -= (512/4);
}
@ -1416,7 +1417,7 @@ WRITE_LINE_MEMBER(ip22_state::scsi_irq)
if (words <= (1024/4))
{
// one-shot
m_wd33c93->get_dma_data(m_wd33c93->get_dma_count(), m_dma_buffer);
m_wd33c93->dma_read_data(m_wd33c93->get_dma_count(), m_dma_buffer);
while (words)
{
@ -1439,7 +1440,7 @@ WRITE_LINE_MEMBER(ip22_state::scsi_irq)
{
while (words)
{
m_wd33c93->get_dma_data(512, m_dma_buffer);
m_wd33c93->dma_read_data(512, m_dma_buffer);
twords = 512/4;
sptr = 0;
@ -1585,6 +1586,12 @@ static const mips3_config config =
};
#endif
static MACHINE_CONFIG_FRAGMENT( cdrom_config )
MCFG_DEVICE_MODIFY( "cdda" )
MCFG_SOUND_ROUTE( 0, "^^^^lspeaker", 1.0 )
MCFG_SOUND_ROUTE( 1, "^^^^rspeaker", 1.0 )
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( ip225015, ip22_state )
MCFG_CPU_ADD( "maincpu", R5000BE, 50000000*3 )
MCFG_CPU_CONFIG( config )
@ -1622,15 +1629,14 @@ static MACHINE_CONFIG_START( ip225015, ip22_state )
MCFG_SOUND_ADD( "dac", DAC, 0 )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:cdrom", SCSICD, SCSI_ID_4)
MCFG_DEVICE_ADD("scsi:wd33c93", WD33C93, 0)
MCFG_WD33C93_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, ip22_state,scsi_irq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "cdrom", SCSICD, SCSI_ID_4)
MCFG_SLOT_OPTION_MACHINE_CONFIG("cdrom", cdrom_config)
MCFG_SOUND_MODIFY( "scsi:cdrom:cdda" )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "^^^lspeaker", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "^^^rspeaker", 1.0)
MCFG_DEVICE_ADD("wd33c93", WD33C93, 0)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_WD33C93_IRQ_CB(WRITELINE(ip22_state,scsi_irq))
MCFG_DEVICE_ADD("kbdc", KBDC8042, 0)
MCFG_KBDC8042_KEYBOARD_TYPE(KBDC8042_STANDARD)

View File

@ -53,9 +53,9 @@
#include "machine/sonydriv.h"
#include "formats/ap_dsk35.h"
#include "machine/ram.h"
#include "machine/scsibus.h"
#include "machine/scsihd.h"
#include "machine/scsicd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsihd.h"
#include "bus/scsi/scsicd.h"
#include "sound/asc.h"
#include "sound/awacs.h"
#include "sound/cdda.h"
@ -972,11 +972,13 @@ static MACHINE_CONFIG_DERIVED( macplus, mac512ke )
MCFG_CPU_MODIFY( "maincpu" )
MCFG_CPU_PROGRAM_MAP(macplus_map)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_MODIFY(mac_floppy_interface)
@ -1064,11 +1066,14 @@ static MACHINE_CONFIG_START( macprtb, mac_state )
/* devices */
MCFG_RTC3430042_ADD("rtc", XTAL_32_768kHz)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
MCFG_IWM_ADD("fdc", mac_iwm_interface)
MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
@ -1116,12 +1121,14 @@ static MACHINE_CONFIG_START( macii, mac_state )
MCFG_NUBUS_SLOT_ADD("nubus","nbd", mac_nubus_cards, NULL)
MCFG_NUBUS_SLOT_ADD("nubus","nbe", mac_nubus_cards, NULL)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
MCFG_SCSIDEV_ADD("scsi:cdrom1", SCSICD, SCSI_ID_4)
MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "cdrom", SCSICD, SCSI_ID_4)
MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
MCFG_IWM_ADD("fdc", mac_iwm_interface)
MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
@ -1181,11 +1188,13 @@ static MACHINE_CONFIG_START( maciifx, mac_state )
MCFG_NUBUS_SLOT_ADD("nubus","nbd", mac_nubus_cards, NULL)
MCFG_NUBUS_SLOT_ADD("nubus","nbe", mac_nubus_cards, NULL)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
MCFG_IWM_ADD("fdc", mac_iwm_interface)
MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
@ -1424,11 +1433,14 @@ static MACHINE_CONFIG_START( macse30, mac_state )
/* devices */
MCFG_RTC3430042_ADD("rtc", XTAL_32_768kHz)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
MCFG_NUBUS_BUS_ADD("pds", "maincpu", nubus_intf)
MCFG_NUBUS_SLOT_ADD("pds","pds030", mac_pds030_cards, NULL)
@ -1490,11 +1502,13 @@ static MACHINE_CONFIG_START( macpb140, mac_state )
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
/* devices */
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
MCFG_SWIM_ADD("fdc", mac_iwm_interface)
MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
@ -1573,11 +1587,13 @@ static MACHINE_CONFIG_START( macpb160, mac_state )
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
/* devices */
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
MCFG_SWIM_ADD("fdc", mac_iwm_interface)
MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
@ -1770,11 +1786,13 @@ static MACHINE_CONFIG_START( pwrmac, mac_state )
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
/* devices */
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("scsi:ncr5380", NCR5380, C7M)
MCFG_NCR5380_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, mac_scsi_irq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("ncr5380", NCR5380, C7M)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_NCR5380_IRQ_CB(WRITELINE(mac_state, mac_scsi_irq))
MCFG_IWM_ADD("fdc", mac_iwm_interface)
MCFG_LEGACY_FLOPPY_SONY_2_DRIVES_ADD(mac_floppy_interface)
@ -1859,13 +1877,15 @@ static MACHINE_CONFIG_START( macqd700, mac_state )
MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(mac_state,mac_via2_out_b))
MCFG_VIA6522_IRQ_HANDLER(WRITELINE(mac_state,mac_via2_irq))
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_DEVICE_ADD(MAC_539X_1_TAG, NCR539X, C7M)
MCFG_NCR539X_OUT_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, irq_539x_1_w))
MCFG_NCR539X_OUT_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, mac_state, drq_539x_1_w))
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_NCR539X_OUT_IRQ_CB(WRITELINE(mac_state, irq_539x_1_w))
MCFG_NCR539X_OUT_DRQ_CB(WRITELINE(mac_state, drq_539x_1_w))
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("4M")

View File

@ -400,9 +400,10 @@ Keyboard TX commands:
#include "machine/i8251.h"
#include "bus/scsi/s1410.h"
#include "machine/scsibus.h"
#include "machine/scsicb.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsihd.h"
#include "machine/buffer.h"
#include "machine/latch.h"
#include "sound/beep.h"
#include "sound/speaker.h"
@ -445,7 +446,10 @@ public:
m_sio(*this, UPD8251_TAG),
m_hgdc1(*this, "upd7220_chr"),
m_hgdc2(*this, "upd7220_btm"),
m_sasibus(*this, SASIBUS_TAG ":host"),
m_sasibus(*this, SASIBUS_TAG),
m_sasi_data_out(*this, "sasi_data_out"),
m_sasi_data_in(*this, "sasi_data_in"),
m_sasi_ctrl_in(*this, "sasi_ctrl_in"),
m_ide(*this, "ide"),
m_video_ram_1(*this, "video_ram_1"),
m_video_ram_2(*this, "video_ram_2"),
@ -468,7 +472,10 @@ public:
required_device<i8251_device> m_sio;
required_device<upd7220_device> m_hgdc1;
required_device<upd7220_device> m_hgdc2;
optional_device<scsicb_device> m_sasibus;
optional_device<SCSI_PORT_DEVICE> m_sasibus;
optional_device<output_latch_device> m_sasi_data_out;
optional_device<input_buffer_device> m_sasi_data_in;
optional_device<input_buffer_device> m_sasi_ctrl_in;
optional_device<ata_interface_device> m_ide;
required_shared_ptr<UINT8> m_video_ram_1;
required_shared_ptr<UINT8> m_video_ram_2;
@ -590,14 +597,13 @@ public:
UINT32 pc9801_286_a20(bool state);
DECLARE_WRITE8_MEMBER(sasi_data_w);
DECLARE_WRITE_LINE_MEMBER(sasi_io_w);
DECLARE_READ8_MEMBER( sasi_status_r );
DECLARE_WRITE8_MEMBER( sasi_ctrl_w );
DECLARE_WRITE_LINE_MEMBER(write_sasi_io);
DECLARE_READ8_MEMBER(sasi_status_r);
DECLARE_WRITE8_MEMBER(sasi_ctrl_w);
struct{
UINT8 data_out;
UINT8 ctrl;
}m_sasi;
UINT8 m_sasi_data;
int m_sasi_data_enable;
UINT8 m_sasi_ctrl;
DECLARE_READ8_MEMBER(pc9801rs_wram_r);
DECLARE_WRITE8_MEMBER(pc9801rs_wram_w);
@ -1723,23 +1729,27 @@ WRITE8_MEMBER(pc9801_state::pc9801_mouse_w)
WRITE8_MEMBER( pc9801_state::sasi_data_w )
{
m_sasi.data_out = data;
m_sasi_data = data;
if( !m_sasibus->scsi_io_r() )
if (m_sasi_data_enable)
{
m_sasibus->scsi_data_w( data );
m_sasi_data_out->write(m_sasi_data);
}
}
WRITE_LINE_MEMBER( pc9801_state::sasi_io_w )
WRITE_LINE_MEMBER( pc9801_state::write_sasi_io )
{
if( !state )
m_sasi_ctrl_in->write_bit2(state);
m_sasi_data_enable = !state;
if (m_sasi_data_enable)
{
m_sasibus->scsi_data_w( m_sasi.data_out );
m_sasi_data_out->write(m_sasi_data);
}
else
{
m_sasibus->scsi_data_w( 0 );
m_sasi_data_out->write(0);
}
}
@ -1749,7 +1759,7 @@ READ8_MEMBER( pc9801_state::sasi_status_r )
{
UINT8 res = 0;
if(m_sasi.ctrl & 0x40) // read status
if(m_sasi_ctrl & 0x40) // read status
{
/*
x--- -.-- REQ
@ -1760,13 +1770,7 @@ READ8_MEMBER( pc9801_state::sasi_status_r )
---- -x-- IO
---- ---x INT?
*/
// res |= m_sasibus->scsi_cd_r() << 0;
res |= m_sasibus->scsi_io_r() << 2;
res |= m_sasibus->scsi_cd_r() << 3;
res |= m_sasibus->scsi_msg_r() << 4;
res |= m_sasibus->scsi_bsy_r() << 5;
res |= m_sasibus->scsi_ack_r() << 6;
res |= m_sasibus->scsi_req_r() << 7;
res |= m_sasi_ctrl_in->read();
}
else // read drive info
{
@ -1793,19 +1797,19 @@ WRITE8_MEMBER( pc9801_state::sasi_ctrl_w )
---- ---x irq enable
*/
m_sasibus->scsi_sel_w(BIT(data, 5));
m_sasibus->write_sel(BIT(data, 5));
if(m_sasi.ctrl & 8 && ((data & 8) == 0)) // 1 -> 0 transition
if(m_sasi_ctrl & 8 && ((data & 8) == 0)) // 1 -> 0 transition
{
m_sasibus->scsi_rst_w(1);
m_sasibus->write_rst(1);
// m_timer_rst->adjust(attotime::from_nsec(100));
}
else
m_sasibus->scsi_rst_w(0); // TODO
m_sasibus->write_rst(0); // TODO
m_sasi.ctrl = data;
m_sasi_ctrl = data;
// m_sasibus->scsi_sel_w(BIT(data, 0));
// m_sasibus->write_sel(BIT(data, 0));
}
static ADDRESS_MAP_START( pc9801_map, AS_PROGRAM, 16, pc9801_state )
@ -1832,7 +1836,7 @@ static ADDRESS_MAP_START( pc9801_io, AS_IO, 16, pc9801_state )
// AM_RANGE(0x006c, 0x006f) border color / <undefined>
AM_RANGE(0x0070, 0x007b) AM_READWRITE8(pc9801_70_r,pc9801_70_w,0xffff) //display registers / i8253 pit
// AM_RANGE(0x0080, 0x0083) AM_READWRITE8(pc9801_sasi_r,pc9801_sasi_w,0xffff) //HDD SASI interface / <undefined>
AM_RANGE(0x0080, 0x0081) AM_DEVREAD8(SASIBUS_TAG ":host", scsicb_device, scsi_data_r, 0x00ff) AM_WRITE8(sasi_data_w, 0x00ff)
AM_RANGE(0x0080, 0x0081) AM_DEVREAD8("scsi_data_in", input_buffer_device, read, 0x00ff) AM_WRITE8(sasi_data_w, 0x00ff)
AM_RANGE(0x0082, 0x0083) AM_READWRITE8(sasi_status_r, sasi_ctrl_w,0x00ff)
AM_RANGE(0x0090, 0x0097) AM_READWRITE8(pc9801_fdc_2hd_r,pc9801_fdc_2hd_w,0xffff) //upd765a 2hd / cmt
AM_RANGE(0x00a0, 0x00af) AM_READWRITE8(pc9801_a0_r,pc9801_a0_w,0xffff) //upd7220 bitmap ports / display registers
@ -3378,6 +3382,10 @@ MACHINE_START_MEMBER(pc9801_state,pc9801_common)
m_ipl_rom = memregion("ipl")->base();
m_sound_bios = memregion("sound_bios")->base();
save_item(NAME(m_sasi_data));
save_item(NAME(m_sasi_data_enable));
save_item(NAME(m_sasi_ctrl));
}
MACHINE_START_MEMBER(pc9801_state,pc9801f)
@ -3583,10 +3591,20 @@ static MACHINE_CONFIG_FRAGMENT( pc9801_cbus )
MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( pc9801_sasi )
MCFG_SCSIBUS_ADD(SASIBUS_TAG)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", S1410, SCSI_ID_0) // TODO: correct one, perhaps ttl
MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
MCFG_SCSICB_IO_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, pc9801_state, sasi_io_w))
MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
MCFG_SCSI_DATA_INPUT_BUFFER("sasi_data_in")
MCFG_SCSI_IO_HANDLER(WRITELINE(pc9801_state, write_sasi_io)) // bit2
MCFG_SCSI_CD_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit3))
MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit4))
MCFG_SCSI_BSY_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit5))
MCFG_SCSI_ACK_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit6))
MCFG_SCSI_REQ_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit7))
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", S1410, SCSI_ID_0) // TODO: correct one, perhaps ttl
MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", SASIBUS_TAG)
MCFG_DEVICE_ADD("sasi_data_in", INPUT_BUFFER, 0)
MCFG_DEVICE_ADD("sasi_ctrl_in", INPUT_BUFFER, 0)
MACHINE_CONFIG_END

View File

@ -14,9 +14,7 @@
#include "machine/ram.h"
#include "formats/pc_dsk.h"
#include "includes/rmnimbus.h"
#include "machine/scsibus.h"
#include "machine/scsicb.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsihd.h"
#include "bus/scsi/s1410.h"
#include "bus/scsi/acb4070.h"
#include "machine/6522via.h"
@ -297,17 +295,26 @@ 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_SCSIBUS_ADD(SCSIBUS_TAG)
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", ACB4070, SCSI_ID_2)
MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":harddisk3", S1410, SCSI_ID_3)
MCFG_SCSICB_ADD(SCSIBUS_TAG ":host")
MCFG_SCSICB_BSY_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, rmnimbus_state, nimbus_scsi_bsy_w))
MCFG_SCSICB_CD_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, rmnimbus_state, nimbus_scsi_cd_w))
MCFG_SCSICB_IO_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, rmnimbus_state, nimbus_scsi_io_w))
MCFG_SCSICB_MSG_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, rmnimbus_state, nimbus_scsi_msg_w))
MCFG_SCSICB_REQ_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, rmnimbus_state, nimbus_scsi_req_w))
MCFG_DEVICE_ADD(SCSIBUS_TAG, SCSI_PORT, 0)
MCFG_SCSI_DATA_INPUT_BUFFER("scsi_data_in")
MCFG_SCSI_MSG_HANDLER(WRITELINE(rmnimbus_state, write_scsi_msg))
MCFG_SCSI_BSY_HANDLER(WRITELINE(rmnimbus_state, write_scsi_bsy))
MCFG_SCSI_IO_HANDLER(WRITELINE(rmnimbus_state, write_scsi_io))
MCFG_SCSI_CD_HANDLER(WRITELINE(rmnimbus_state, write_scsi_cd))
MCFG_SCSI_REQ_HANDLER(WRITELINE(rmnimbus_state, write_scsi_req))
MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE3, "harddisk", ACB4070, SCSI_ID_2)
MCFG_SCSIDEV_ADD(SCSIBUS_TAG ":" SCSI_PORT_DEVICE4, "harddisk", S1410, SCSI_ID_3)
MCFG_SCSI_OUTPUT_LATCH_ADD("scsi_data_out", SCSIBUS_TAG)
MCFG_DEVICE_ADD("scsi_data_in", INPUT_BUFFER, 0)
MCFG_DEVICE_ADD("scsi_ctrl_out", OUTPUT_LATCH, 0)
MCFG_OUTPUT_LATCH_BIT0_HANDLER(DEVWRITELINE(SCSIBUS_TAG, SCSI_PORT_DEVICE, write_rst))
MCFG_OUTPUT_LATCH_BIT1_HANDLER(DEVWRITELINE(SCSIBUS_TAG, SCSI_PORT_DEVICE, write_sel))
MCFG_OUTPUT_LATCH_BIT2_HANDLER(WRITELINE(rmnimbus_state, write_scsi_iena))
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("1536K")

View File

@ -388,62 +388,38 @@ WRITE8_MEMBER( v1050_state::dvint_clr_w )
WRITE8_MEMBER( v1050_state::sasi_data_w )
{
data_out = data;
m_sasi_data = data;
if( !m_sasibus->scsi_io_r() )
if (m_sasi_data_enable)
{
m_sasibus->scsi_data_w( data );
m_sasi_data_out->write(m_sasi_data);
}
}
WRITE_LINE_MEMBER( v1050_state::sasi_io_w )
WRITE_LINE_MEMBER( v1050_state::write_sasi_io )
{
if( !state )
m_sasi_ctrl_in->write_bit4(state);
m_sasi_data_enable = state;
if (m_sasi_data_enable)
{
m_sasibus->scsi_data_w( data_out );
m_sasi_data_out->write(m_sasi_data);
}
else
{
m_sasibus->scsi_data_w( 0 );
m_sasi_data_out->write(0);
}
}
READ8_MEMBER( v1050_state::sasi_status_r )
{
/*
bit description
0 REQ-
1 BUSY
2 MESSAGE
3 C/D-
4 I-/O
5
6
7
*/
UINT8 data = 0;
data |= !m_sasibus->scsi_req_r();
data |= m_sasibus->scsi_bsy_r() << 1;
data |= m_sasibus->scsi_msg_r() << 2;
data |= m_sasibus->scsi_cd_r() << 3;
data |= !m_sasibus->scsi_io_r() << 4;
return data;
}
TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::sasi_ack_tick)
{
m_sasibus->scsi_ack_w(0);
m_sasibus->write_ack(0);
}
TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::sasi_rst_tick)
{
m_sasibus->scsi_rst_w(0);
m_sasibus->write_rst(0);
}
WRITE8_MEMBER( v1050_state::sasi_ctrl_w )
@ -463,12 +439,12 @@ WRITE8_MEMBER( v1050_state::sasi_ctrl_w )
*/
m_sasibus->scsi_sel_w(BIT(data, 0));
m_sasibus->write_sel(BIT(data, 0));
if (BIT(data, 1))
{
// send acknowledge pulse
m_sasibus->scsi_ack_w(1);
m_sasibus->write_ack(1);
m_timer_ack->adjust(attotime::from_nsec(100));
}
@ -476,7 +452,7 @@ WRITE8_MEMBER( v1050_state::sasi_ctrl_w )
if (BIT(data, 7))
{
// send reset pulse
m_sasibus->scsi_rst_w(1);
m_sasibus->write_rst(1);
m_timer_rst->adjust(attotime::from_nsec(100));
}
@ -510,8 +486,8 @@ static ADDRESS_MAP_START( v1050_io, AS_IO, 8, v1050_state )
AM_RANGE(0xb0, 0xb0) AM_READWRITE(dint_clr_r, dint_clr_w)
AM_RANGE(0xc0, 0xc0) AM_WRITE(v1050_i8214_w)
AM_RANGE(0xd0, 0xd0) AM_WRITE(bank_w)
AM_RANGE(0xe0, 0xe0) AM_WRITE(sasi_data_w) AM_DEVREAD(SASIBUS_TAG ":host", scsicb_device, scsi_data_r)
AM_RANGE(0xe1, 0xe1) AM_READWRITE(sasi_status_r, sasi_ctrl_w)
AM_RANGE(0xe0, 0xe0) AM_WRITE(sasi_data_w) AM_DEVREAD("scsi_data_in", input_buffer_device, read)
AM_RANGE(0xe1, 0xe1) AM_DEVREAD("scsi_ctrl_in", input_buffer_device, read) AM_WRITE(sasi_ctrl_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( v1050_crt_mem, AS_PROGRAM, 8, v1050_state )
@ -1157,10 +1133,18 @@ static MACHINE_CONFIG_START( v1050, v1050_state )
MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":3", v1050_floppies, NULL, floppy_image_device::default_floppy_formats)
// SASI bus
MCFG_SCSIBUS_ADD(SASIBUS_TAG)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", S1410, SCSI_ID_0)
MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
MCFG_SCSICB_IO_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, v1050_state, sasi_io_w))
MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
MCFG_SCSI_DATA_INPUT_BUFFER("scsi_data_in")
MCFG_SCSI_REQ_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit0)) MCFG_DEVCB_XOR(1)
MCFG_SCSI_BSY_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit1))
MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit2))
MCFG_SCSI_CD_HANDLER(DEVWRITELINE("scsi_ctrl_in", input_buffer_device, write_bit3))
MCFG_SCSI_IO_HANDLER(WRITELINE(v1050_state, write_sasi_io)) MCFG_DEVCB_XOR(1) // bit4
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", S1410, SCSI_ID_0)
MCFG_SCSI_OUTPUT_LATCH_ADD("scsi_data_out", SASIBUS_TAG)
MCFG_DEVICE_ADD("scsi_data_in", INPUT_BUFFER, 0)
MCFG_DEVICE_ADD("scsi_ctrl_in", INPUT_BUFFER, 0)
MCFG_TIMER_DRIVER_ADD(TIMER_ACK_TAG, v1050_state, sasi_ack_tick)
MCFG_TIMER_DRIVER_ADD(TIMER_RST_TAG, v1050_state, sasi_rst_tick)

View File

@ -130,8 +130,8 @@
#include "bus/x68k/x68kexp.h"
#include "bus/x68k/x68k_neptunex.h"
#include "bus/x68k/x68k_scsiext.h"
#include "machine/scsibus.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsihd.h"
#include "x68000.lh"
@ -1275,7 +1275,7 @@ static ADDRESS_MAP_START(x68kxvi_map, AS_PROGRAM, 16, x68k_state )
AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff)
AM_RANGE(0xe94004, 0xe94007) AM_READWRITE(x68k_fdc_r, x68k_fdc_w)
// AM_RANGE(0xe96000, 0xe9601f) AM_DEVREADWRITE("x68k_hdc", x68k_hdc_image_device, hdc_r, hdc_w)
AM_RANGE(0xe96020, 0xe9603f) AM_DEVREADWRITE8("scsi:mb89352",mb89352_device,mb89352_r,mb89352_w,0x00ff)
AM_RANGE(0xe96020, 0xe9603f) AM_DEVREADWRITE8("mb89352",mb89352_device,mb89352_r,mb89352_w,0x00ff)
AM_RANGE(0xe98000, 0xe99fff) AM_READWRITE(x68k_scc_r, x68k_scc_w)
AM_RANGE(0xe9a000, 0xe9bfff) AM_READWRITE(x68k_ppi_r, x68k_ppi_w)
AM_RANGE(0xe9c000, 0xe9dfff) AM_READWRITE(x68k_ioc_r, x68k_ioc_w)
@ -1314,7 +1314,7 @@ static ADDRESS_MAP_START(x68030_map, AS_PROGRAM, 32, x68k_state )
AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff00ff)
AM_RANGE(0xe94004, 0xe94007) AM_READWRITE16(x68k_fdc_r, x68k_fdc_w,0xffffffff)
// AM_RANGE(0xe96000, 0xe9601f) AM_DEVREADWRITE16("x68k_hdc", x68k_hdc_image_device, hdc_r, hdc_w, 0xffffffff)
AM_RANGE(0xe96020, 0xe9603f) AM_DEVREADWRITE8("scsi:mb89352",mb89352_device,mb89352_r,mb89352_w,0x00ff00ff)
AM_RANGE(0xe96020, 0xe9603f) AM_DEVREADWRITE8("mb89352",mb89352_device,mb89352_r,mb89352_w,0x00ff00ff)
AM_RANGE(0xe98000, 0xe99fff) AM_READWRITE16(x68k_scc_r, x68k_scc_w,0xffffffff)
AM_RANGE(0xe9a000, 0xe9bfff) AM_READWRITE16(x68k_ppi_r, x68k_ppi_w,0xffffffff)
AM_RANGE(0xe9c000, 0xe9dfff) AM_READWRITE16(x68k_ioc_r, x68k_ioc_w,0xffffffff)
@ -1906,17 +1906,19 @@ static MACHINE_CONFIG_START( x68ksupr, x68k_state )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(x68kxvi_map)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk0", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_2)
MCFG_SCSIDEV_ADD("scsi:harddisk3", SCSIHD, SCSI_ID_3)
MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_irq))
MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_drq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "harddisk", SCSIHD, SCSI_ID_2)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE4, "harddisk", SCSIHD, SCSI_ID_3)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE5, "harddisk", SCSIHD, SCSI_ID_4)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE6, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE7, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_DEVICE_ADD("mb89352", MB89352A, 0)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_MB89352A_IRQ_CB(WRITELINE(x68k_state, x68k_scsi_irq))
MCFG_MB89352A_DRQ_CB(WRITELINE(x68k_state, x68k_scsi_drq))
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( x68kxvi, x68k_state )
@ -1929,17 +1931,19 @@ static MACHINE_CONFIG_START( x68kxvi, x68k_state )
MCFG_CPU_CLOCK(16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(x68kxvi_map)
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk0", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_2)
MCFG_SCSIDEV_ADD("scsi:harddisk3", SCSIHD, SCSI_ID_3)
MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_irq))
MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_drq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "harddisk", SCSIHD, SCSI_ID_2)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE4, "harddisk", SCSIHD, SCSI_ID_3)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE5, "harddisk", SCSIHD, SCSI_ID_4)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE6, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE7, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_DEVICE_ADD("mb89352", MB89352A, 0)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_MB89352A_IRQ_CB(WRITELINE(x68k_state, x68k_scsi_irq))
MCFG_MB89352A_DRQ_CB(WRITELINE(x68k_state, x68k_scsi_drq))
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( x68030, x68k_state )
@ -1953,17 +1957,19 @@ static MACHINE_CONFIG_START( x68030, x68k_state )
MCFG_NVRAM_ADD_0FILL("nvram32")
MCFG_SCSIBUS_ADD("scsi")
MCFG_SCSIDEV_ADD("scsi:harddisk0", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:harddisk1", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:harddisk2", SCSIHD, SCSI_ID_2)
MCFG_SCSIDEV_ADD("scsi:harddisk3", SCSIHD, SCSI_ID_3)
MCFG_SCSIDEV_ADD("scsi:harddisk4", SCSIHD, SCSI_ID_4)
MCFG_SCSIDEV_ADD("scsi:harddisk5", SCSIHD, SCSI_ID_5)
MCFG_SCSIDEV_ADD("scsi:harddisk6", SCSIHD, SCSI_ID_6)
MCFG_DEVICE_ADD("scsi:mb89352", MB89352A, 0)
MCFG_MB89352A_IRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_irq))
MCFG_MB89352A_DRQ_CB(DEVWRITELINE(DEVICE_SELF_OWNER, x68k_state, x68k_scsi_drq))
MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE2, "harddisk", SCSIHD, SCSI_ID_1)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE3, "harddisk", SCSIHD, SCSI_ID_2)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE4, "harddisk", SCSIHD, SCSI_ID_3)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE5, "harddisk", SCSIHD, SCSI_ID_4)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE6, "harddisk", SCSIHD, SCSI_ID_5)
MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE7, "harddisk", SCSIHD, SCSI_ID_6)
MCFG_DEVICE_ADD("mb89352", MB89352A, 0)
MCFG_LEGACY_SCSI_PORT("scsi")
MCFG_MB89352A_IRQ_CB(WRITELINE(x68k_state, x68k_scsi_irq))
MCFG_MB89352A_DRQ_CB(WRITELINE(x68k_state, x68k_scsi_drq))
MACHINE_CONFIG_END
ROM_START( x68000 )

View File

@ -355,53 +355,25 @@ static Z80PIO_INTERFACE( gppio_intf )
DEVCB_NULL /* portB ready active callback */
};
READ8_MEMBER( xerox820ii_state::rdpio_pb_r )
{
/*
bit description
0 NBSY
1 NMSG
2 NC/D
3 NREQ
4 NI/O
5
6 LS74 Q
7
*/
UINT8 data = 0;
data |= !m_sasibus->scsi_bsy_r();
data |= !m_sasibus->scsi_msg_r() << 1;
data |= !m_sasibus->scsi_cd_r() << 2;
data |= !m_sasibus->scsi_req_r() << 3;
data |= !m_sasibus->scsi_io_r() << 4;
return data;
}
WRITE8_MEMBER( xerox820ii_state::rdpio_pb_w )
{
/*
bit description
0
1
2
3
4
0 NBSY
1 NMSG
2 NC/D
3 NREQ
4 NI/O
5 NSEL
6
6 LS74 Q
7 NRST
*/
m_sasibus->scsi_sel_w(!BIT(data, 5));
m_sasibus->scsi_rst_w(!BIT(data, 7));
m_sasibus->write_sel(!BIT(data, 5));
m_sasibus->write_rst(!BIT(data, 7));
// TODO: LS74 Q
}
WRITE_LINE_MEMBER( xerox820ii_state::rdpio_pardy_w )
@ -412,10 +384,10 @@ WRITE_LINE_MEMBER( xerox820ii_state::rdpio_pardy_w )
static Z80PIO_INTERFACE( rdpio_intf )
{
DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0), /* callback when change interrupt status */
DEVCB_DEVICE_MEMBER(SASIBUS_TAG ":host", scsicb_device, scsi_data_r), /* port A read callback */
DEVCB_DEVICE_MEMBER(SASIBUS_TAG ":host", scsicb_device, scsi_data_w), /* port A write callback */
DEVCB_DEVICE_MEMBER("sasi_data_in", input_buffer_device, read), /* port A read callback */
DEVCB_DEVICE_MEMBER("sasi_data_out", output_latch_device, write), /* port A write callback */
DEVCB_DRIVER_LINE_MEMBER(xerox820ii_state, rdpio_pardy_w), /* portA ready active callback */
DEVCB_DRIVER_MEMBER(xerox820ii_state, rdpio_pb_r), /* port B read callback */
DEVCB_DEVICE_MEMBER("sasi_ctrl_in", input_buffer_device, read), /* port B read callback */
DEVCB_DRIVER_MEMBER(xerox820ii_state, rdpio_pb_w), /* port B write callback */
DEVCB_NULL /* portB ready active callback */
};
@ -779,9 +751,19 @@ static MACHINE_CONFIG_START( xerox820ii, xerox820ii_state )
MCFG_GENERIC_KEYBOARD_CB(WRITE8(xerox820_state, kbd_w))
// SASI bus
MCFG_SCSIBUS_ADD(SASIBUS_TAG)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", SA1403D, SCSI_ID_0)
MCFG_SCSICB_ADD(SASIBUS_TAG ":host")
MCFG_DEVICE_ADD(SASIBUS_TAG, SCSI_PORT, 0)
MCFG_SCSI_DATA_INPUT_BUFFER("sasi_data_in")
MCFG_SCSI_BSY_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit0)) MCFG_DEVCB_XOR(1)
MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit1)) MCFG_DEVCB_XOR(1)
MCFG_SCSI_CD_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit2)) MCFG_DEVCB_XOR(1)
MCFG_SCSI_REQ_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit3)) MCFG_DEVCB_XOR(1)
MCFG_SCSI_IO_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit4)) MCFG_DEVCB_XOR(1)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", SA1403D, SCSI_ID_0)
MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", SASIBUS_TAG)
MCFG_DEVICE_ADD("sasi_data_in", INPUT_BUFFER, 0)
MCFG_DEVICE_ADD("sasi_ctrl_in", INPUT_BUFFER, 0)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)

View File

@ -31,7 +31,7 @@ public:
: driver_device(mconfig, type, tag),
m_ppc1(*this, "ppc1"),
m_ppc2(*this, "ppc2"),
m_lsi53c810(*this, "scsi:lsi53c810"),
m_lsi53c810(*this, "lsi53c810"),
m_dma8237_1(*this, "dma8237_1"),
m_dma8237_2(*this, "dma8237_2"),
m_pic8259_1(*this, "pic8259_1"),

View File

@ -9,9 +9,7 @@
#include "cpu/z80/z80.h"
#include "bus/centronics/ctronics.h"
#include "machine/ram.h"
#include "machine/scsibus.h"
#include "machine/scsicb.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsi.h"
#include "machine/wd_fdc.h"
#include "machine/z80ctc.h"
#include "machine/z80dart.h"
@ -136,16 +134,23 @@ public:
class bulletf_state : public bullet_state
{
public:
bulletf_state(const machine_config &mconfig, device_type type, const char *tag)
: bullet_state(mconfig, type, tag),
m_floppy8(*this, MB8877_TAG":8"),
m_floppy9(*this, MB8877_TAG":9"),
m_scsibus(*this, SCSIBUS_TAG ":host")
{ }
bulletf_state(const machine_config &mconfig, device_type type, const char *tag) :
bullet_state(mconfig, type, tag),
m_floppy8(*this, MB8877_TAG":8"),
m_floppy9(*this, MB8877_TAG":9"),
m_scsibus(*this, SCSIBUS_TAG),
m_scsi_data_in(*this, "scsi_data_in"),
m_scsi_data_out(*this, "scsi_data_out"),
m_scsi_ctrl_in(*this, "scsi_ctrl_in")
{
}
required_device<floppy_connector> m_floppy8;
required_device<floppy_connector> m_floppy9;
required_device<scsicb_device> m_scsibus;
required_device<SCSI_PORT_DEVICE> m_scsibus;
required_device<input_buffer_device> m_scsi_data_in;
required_device<output_latch_device> m_scsi_data_out;
required_device<input_buffer_device> m_scsi_ctrl_in;
virtual void machine_start();
virtual void machine_reset();
@ -161,7 +166,6 @@ public:
DECLARE_READ8_MEMBER( dma_mreq_r );
DECLARE_WRITE8_MEMBER( dma_mreq_w );
DECLARE_READ8_MEMBER( pio_pa_r );
DECLARE_WRITE8_MEMBER( pio_pa_w );
DECLARE_WRITE_LINE_MEMBER( cstrb_w );
DECLARE_WRITE_LINE_MEMBER( req_w );

View File

@ -25,8 +25,8 @@
#include "cpu/m68000/m68000.h"
#define MAC_SCREEN_NAME "screen"
#define MAC_539X_1_TAG "scsi:539x_1"
#define MAC_539X_2_TAG "scsi:539x_2"
#define MAC_539X_1_TAG "539x_1"
#define MAC_539X_2_TAG "539x_2"
#define MACKBD_TAG "mackbd"
// uncomment to run i8021 keyboard in orignal Mac/512(e)/Plus
@ -200,7 +200,7 @@ public:
m_ram(*this, RAM_TAG),
m_539x_1(*this, MAC_539X_1_TAG),
m_539x_2(*this, MAC_539X_2_TAG),
m_ncr5380(*this, "scsi:ncr5380"),
m_ncr5380(*this, "ncr5380"),
m_mackbd(*this, MACKBD_TAG),
m_rtc(*this,"rtc"),
m_mouse0(*this, "MOUSE0"),

View File

@ -9,7 +9,7 @@
#include "cpu/i86/i186.h"
#include "machine/z80sio.h"
#include "machine/wd17xx.h"
#include "machine/scsicb.h"
#include "bus/scsi/scsi.h"
#include "machine/6522via.h"
#include "machine/ram.h"
#include "machine/er59256.h"
@ -133,8 +133,6 @@ struct keyboard_t
struct nimbus_drives_t
{
UINT8 reg400;
UINT8 reg410_in;
UINT8 reg410_out;
UINT8 reg418;
UINT8 drq_ff;
@ -283,33 +281,6 @@ extern const wd17xx_interface nimbus_wd17xx_interface;
#define HDC_DRQ_ENABLED() ((m_nimbus_drives.reg400 & HDC_DRQ_MASK) ? 1 : 0)
#define FDC_DRQ_ENABLED() ((m_nimbus_drives.reg400 & FDC_DRQ_MASK) ? 1 : 0)
/* Masks for port 0x410 read*/
#define FDC_READY_MASK 0x01
#define FDC_INDEX_MASK 0x02
#define FDC_MOTOR_MASKI 0x04
#define HDC_MSG_MASK 0x08
#define HDC_BSY_MASK 0x10
#define HDC_IO_MASK 0x20
#define HDC_CD_MASK 0x40
#define HDC_REQ_MASK 0x80
#define FDC_BITS_410 (FDC_READY_MASK | FDC_INDEX_MASK | FDC_MOTOR_MASKI)
#define HDC_BITS_410 (HDC_MSG_MASK | HDC_BSY_MASK | HDC_IO_MASK | HDC_CD_MASK | HDC_REQ_MASK)
#define INV_BITS_410 (HDC_BSY_MASK | HDC_IO_MASK | HDC_CD_MASK | HDC_REQ_MASK)
#define HDC_INT_TRIGGER (HDC_IO_MASK | HDC_CD_MASK | HDC_REQ_MASK)
/* Masks for port 0x410 write*/
#define HDC_RESET_MASK 0x01
#define HDC_SEL_MASK 0x02
#define HDC_IRQ_MASK 0x04
#define HDC_IRQ_ENABLED() ((m_nimbus_drives.reg410_out & HDC_IRQ_MASK) ? 1 : 0)
#define SCSI_ID_NONE 0x80
/* 8031/8051 Peripheral controler */
@ -388,29 +359,35 @@ enum
class rmnimbus_state : public driver_device
{
public:
rmnimbus_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
rmnimbus_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_msm(*this, MSM5205_TAG),
m_ay8910(*this, AY8910_TAG),
m_scsibus(*this, SCSIBUS_TAG ":host"),
m_scsibus(*this, SCSIBUS_TAG),
m_ram(*this, RAM_TAG),
m_eeprom(*this, ER59256_TAG),
m_via(*this, VIA_TAG),
m_centronics(*this, CENTRONICS_TAG),
m_palette(*this, "palette")
m_palette(*this, "palette"),
m_scsi_data_out(*this, "scsi_data_out"),
m_scsi_data_in(*this, "scsi_data_in"),
m_scsi_ctrl_out(*this, "scsi_ctrl_out")
{
}
required_device<i80186_cpu_device> m_maincpu;
required_device<msm5205_device> m_msm;
required_device<ay8910_device> m_ay8910;
required_device<scsicb_device> m_scsibus;
required_device<SCSI_PORT_DEVICE> m_scsibus;
required_device<ram_device> m_ram;
required_device<er59256_device> m_eeprom;
required_device<via6522_device> m_via;
required_device<centronics_device> m_centronics;
required_device<palette_device> m_palette;
required_device<output_latch_device> m_scsi_data_out;
required_device<input_buffer_device> m_scsi_data_in;
required_device<output_latch_device> m_scsi_ctrl_out;
UINT32 m_debug_machine;
// i186_state m_i186;
@ -476,14 +453,14 @@ public:
DECLARE_WRITE8_MEMBER(nimbus_via_write_portb);
DECLARE_WRITE_LINE_MEMBER(nimbus_via_irq_w);
DECLARE_WRITE_LINE_MEMBER(nimbus_ack_w);
DECLARE_WRITE_LINE_MEMBER(nimbus_scsi_bsy_w);
DECLARE_WRITE_LINE_MEMBER(nimbus_scsi_cd_w);
DECLARE_WRITE_LINE_MEMBER(nimbus_scsi_io_w);
DECLARE_WRITE_LINE_MEMBER(nimbus_scsi_msg_w);
DECLARE_WRITE_LINE_MEMBER(nimbus_scsi_req_w);
DECLARE_WRITE_LINE_MEMBER(write_scsi_bsy);
DECLARE_WRITE_LINE_MEMBER(write_scsi_cd);
DECLARE_WRITE_LINE_MEMBER(write_scsi_io);
DECLARE_WRITE_LINE_MEMBER(write_scsi_msg);
DECLARE_WRITE_LINE_MEMBER(write_scsi_req);
DECLARE_WRITE_LINE_MEMBER(nimbus_msm5205_vck);
DECLARE_WRITE_LINE_MEMBER(write_scsi_iena);
void nimbus_scsi_linechange( UINT8 mask, UINT8 state );
IRQ_CALLBACK_MEMBER(int_callback);
UINT8 get_pixel(UINT16 x, UINT16 y);
UINT16 read_pixel_line(UINT16 x, UINT16 y, UINT8 width);
@ -535,4 +512,11 @@ public:
void iou_reset();
void rmni_sound_reset();
void mouse_js_reset();
int m_scsi_iena;
int m_scsi_msg;
int m_scsi_bsy;
int m_scsi_io;
int m_scsi_cd;
int m_scsi_req;
};

View File

@ -16,9 +16,8 @@
#include "machine/i8255.h"
#include "machine/msm58321.h"
#include "machine/ram.h"
#include "machine/scsibus.h"
#include "machine/scsicb.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsihd.h"
#include "machine/v1050kb.h"
#include "machine/wd_fdc.h"
#include "video/mc6845.h"
@ -84,7 +83,10 @@ public:
m_clock_sio(*this, CLOCK_SIO_TAG),
m_timer_ack(*this, TIMER_ACK_TAG),
m_timer_rst(*this, TIMER_RST_TAG),
m_sasibus(*this, SASIBUS_TAG ":host"),
m_sasibus(*this, SASIBUS_TAG),
m_sasi_data_out(*this, "scsi_data_out"),
m_sasi_data_in(*this, "scsi_data_in"),
m_sasi_ctrl_in(*this, "scsi_ctrl_in"),
m_rom(*this, Z80_TAG),
m_video_ram(*this, "video_ram"),
m_attr_ram(*this, "attr_ram"),
@ -124,7 +126,7 @@ public:
DECLARE_WRITE8_MEMBER( videoram_w );
DECLARE_WRITE_LINE_MEMBER( crtc_vs_w );
DECLARE_WRITE8_MEMBER(sasi_data_w);
DECLARE_WRITE_LINE_MEMBER(sasi_io_w);
DECLARE_WRITE_LINE_MEMBER(write_sasi_io);
DECLARE_READ8_MEMBER( sasi_status_r );
DECLARE_WRITE8_MEMBER( sasi_ctrl_w );
@ -182,7 +184,10 @@ public: // HACK for MC6845
required_device<clock_device> m_clock_sio;
required_device<timer_device> m_timer_ack;
required_device<timer_device> m_timer_rst;
required_device<scsicb_device> m_sasibus;
required_device<SCSI_PORT_DEVICE> m_sasibus;
required_device<output_latch_device> m_sasi_data_out;
required_device<input_buffer_device> m_sasi_data_in;
required_device<input_buffer_device> m_sasi_ctrl_in;
required_memory_region m_rom;
required_shared_ptr<UINT8> m_video_ram;
optional_shared_ptr<UINT8> m_attr_ram;
@ -211,7 +216,8 @@ public: // HACK for MC6845
UINT8 m_attr; // attribute latch
// sasi state
UINT8 data_out;
UINT8 m_sasi_data;
int m_sasi_data_enable;
UINT8 m_rtc_ppi_pa;
UINT8 m_rtc_ppi_pc;

View File

@ -11,9 +11,8 @@
#include "machine/com8116.h"
#include "machine/keyboard.h"
#include "machine/ram.h"
#include "machine/scsibus.h"
#include "machine/scsicb.h"
#include "machine/scsihd.h"
#include "bus/scsi/scsi.h"
#include "bus/scsi/scsihd.h"
#include "machine/wd_fdc.h"
#include "machine/z80pio.h"
#include "machine/z80ctc.h"
@ -140,14 +139,15 @@ public:
class xerox820ii_state : public xerox820_state
{
public:
xerox820ii_state(const machine_config &mconfig, device_type type, const char *tag)
: xerox820_state(mconfig, type, tag),
m_speaker(*this, "speaker"),
m_sasibus(*this, SASIBUS_TAG ":host")
{ }
xerox820ii_state(const machine_config &mconfig, device_type type, const char *tag) :
xerox820_state(mconfig, type, tag),
m_speaker(*this, "speaker"),
m_sasibus(*this, SASIBUS_TAG)
{
}
required_device<speaker_sound_device> m_speaker;
required_device<scsicb_device> m_sasibus;
required_device<SCSI_PORT_DEVICE> m_sasibus;
virtual void machine_reset();
@ -157,7 +157,6 @@ public:
DECLARE_WRITE8_MEMBER( lowlite_w );
DECLARE_WRITE8_MEMBER( sync_w );
DECLARE_READ8_MEMBER( rdpio_pb_r );
DECLARE_WRITE8_MEMBER( rdpio_pb_w );
DECLARE_WRITE_LINE_MEMBER( rdpio_pardy_w );

View File

@ -37,7 +37,7 @@ const device_type FMSCSI = &device_creator<fmscsi_device>;
*/
fmscsi_device::fmscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, FMSCSI, "FM-SCSI", tag, owner, clock, "fmscsi", __FILE__),
: legacy_scsi_host_adapter(mconfig, FMSCSI, "FM-SCSI", tag, owner, clock, "fmscsi", __FILE__),
m_irq_handler(*this),
m_drq_handler(*this)
{
@ -56,18 +56,6 @@ void fmscsi_device::device_start()
m_irq_handler.resolve_safe();
m_drq_handler.resolve_safe();
memset(m_SCSIdevices,0,sizeof(m_SCSIdevices));
// try to open the devices
for( device_t *device = owner()->first_subdevice(); device != NULL; device = device->next() )
{
scsihle_device *scsidev = dynamic_cast<scsihle_device *>(device);
if( scsidev != NULL )
{
m_SCSIdevices[scsidev->GetDeviceID()] = scsidev;
}
}
// allocate read timer
m_transfer_timer = timer_alloc(TIMER_TRANSFER);
m_phase_timer = timer_alloc(TIMER_PHASE);
@ -133,7 +121,7 @@ UINT8 fmscsi_device::fmscsi_data_r(void)
//logerror("FMSCSI: DATAIN phase read data %02x\n",m_data);
m_result_index++;
if(m_result_index % 512 == 0)
m_SCSIdevices[m_target]->ReadData(m_buffer,512); // read next sector
read_data(m_buffer,512); // read next sector
if(m_result_index >= m_result_length)
{
@ -198,7 +186,7 @@ void fmscsi_device::fmscsi_data_w(UINT8 data)
m_buffer[m_result_index % 512] = m_data;
m_result_index++;
if(m_result_index % 512 == 0)
m_SCSIdevices[m_target]->WriteData(m_buffer,512); // write buffer to disc
write_data(m_buffer,512); // write buffer to disc
if(m_result_index >= m_result_length)
{
// end of data transfer
@ -219,10 +207,9 @@ void fmscsi_device::fmscsi_data_w(UINT8 data)
if(m_command_index >= get_scsi_cmd_len(m_command[0]))
{
// command complete
m_SCSIdevices[m_target]->SetCommand(m_command,m_command_index);
m_SCSIdevices[m_target]->ExecCommand();
m_SCSIdevices[m_target]->GetLength(&m_result_length);
m_SCSIdevices[m_target]->GetPhase(&phase);
send_command(m_command,m_command_index);
m_result_length = get_length();
phase = get_phase();
if(m_command[0] == 1) // rezero unit command - not implemented in SCSI code
m_phase_timer->adjust(attotime::from_usec(800),SCSI_PHASE_STATUS);
else
@ -275,7 +262,7 @@ void fmscsi_device::set_phase(int phase)
set_input_line(FMSCSI_LINE_REQ,1);
// start transfer timer
m_transfer_timer->adjust(attotime::zero,0,attotime::from_hz(3000000)); // arbitrary value for now
m_SCSIdevices[m_target]->ReadData(m_buffer,512);
read_data(m_buffer,512);
m_result_index = 0;
logerror("FMSCSI: Starting transfer (%i)\n",m_result_length);
break;
@ -356,9 +343,7 @@ void fmscsi_device::set_output_line(UINT8 line, UINT8 state)
{
if(state != 0 && !(m_output_lines & FMSCSI_LINE_SEL)) // low to high transition
{
void *image;
m_SCSIdevices[m_target]->GetDevice(&image);
if (image != NULL) // if device is mounted
if (select(m_target))
{
m_phase_timer->adjust(attotime::from_usec(800),SCSI_PHASE_COMMAND);
m_data = 0x08;

View File

@ -8,7 +8,7 @@
#ifndef FM_SCSI_H_
#define FM_SCSI_H_
#include "machine/scsihle.h"
#include "machine/legscsi.h"
// SCSI input lines (from target)
#define FMSCSI_LINE_REQ 0x80
@ -37,7 +37,8 @@
devcb = &fmscsi_device::set_irq_handler(*device, DEVCB2_##_devcb);
#define MCFG_FMSCSI_DRQ_HANDLER(_devcb) \
devcb = &fmscsi_device::set_drq_handler(*device, DEVCB2_##_devcb);
class fmscsi_device : public device_t
class fmscsi_device : public legacy_scsi_host_adapter
{
public:
// construction/destruction
@ -78,7 +79,6 @@ private:
devcb2_write_line m_irq_handler;
devcb2_write_line m_drq_handler;
scsihle_device* m_SCSIdevices[8];
UINT8 m_command[32];
//UINT8 m_result[32];
UINT8 m_command_index;

View File

@ -65,7 +65,7 @@ chdman createhd -o ST125N.chd -chs 407,4,26 -ss 512
#include "machine/pit8253.h"
#include "machine/i8251.h"
#include "machine/6522via.h"
#include "machine/scsibus.h"
#include "bus/scsi/scsi.h"
#include "includes/rmnimbus.h"
@ -2205,8 +2205,7 @@ void rmnimbus_state::fdc_reset()
wd2793_device *fdc = machine().device<wd2793_device>(FDC_TAG);
m_nimbus_drives.reg400=0;
m_nimbus_drives.reg410_in=0;
m_nimbus_drives.reg410_out=0;
m_scsi_ctrl_out->write(0);
m_nimbus_drives.int_ff=0;
fdc->set_pause_time(FDC_PAUSE);
}
@ -2292,16 +2291,17 @@ READ8_MEMBER(rmnimbus_state::nimbus_disk_r)
result = fdc->data_r(space, 0);
break;
case 0x10 :
m_nimbus_drives.reg410_in &= ~FDC_BITS_410;
m_nimbus_drives.reg410_in |= (FDC_MOTOR() ? FDC_MOTOR_MASKI : 0x00);
m_nimbus_drives.reg410_in |= (drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX) ? 0x00 : FDC_INDEX_MASK);
m_nimbus_drives.reg410_in |= (drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY) ? FDC_READY_MASK : 0x00);
// Flip inverted bits
result=m_nimbus_drives.reg410_in ^ INV_BITS_410;
result |= !m_scsi_req << 7;
result |= !m_scsi_cd << 6;
result |= !m_scsi_io << 5;
result |= !m_scsi_bsy << 4;
result |= m_scsi_msg << 3;
result |= FDC_MOTOR() << 2;
result |= !drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX) << 1;
result |= drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY) << 0;
break;
case 0x18 :
result = m_scsibus->scsi_data_r();
result = m_scsi_data_in->read();
hdc_post_rw();
default:
break;
@ -2375,11 +2375,11 @@ WRITE8_MEMBER(rmnimbus_state::nimbus_disk_w)
fdc->data_w(space, 0, data);
break;
case 0x10 :
hdc_ctrl_write(data);
m_scsi_ctrl_out->write(data);
break;
case 0x18 :
m_scsibus->scsi_data_w(data);
m_scsi_data_out->write(data);
hdc_post_rw();
break;
}
@ -2387,33 +2387,23 @@ WRITE8_MEMBER(rmnimbus_state::nimbus_disk_w)
void rmnimbus_state::hdc_reset()
{
m_nimbus_drives.reg410_in=0;
m_nimbus_drives.reg410_in |= (m_scsibus->scsi_req_r() ? 0 : HDC_REQ_MASK);
m_nimbus_drives.reg410_in |= (m_scsibus->scsi_cd_r() ? 0 : HDC_CD_MASK);
m_nimbus_drives.reg410_in |= (m_scsibus->scsi_io_r() ? 0 : HDC_IO_MASK);
m_nimbus_drives.reg410_in |= (m_scsibus->scsi_bsy_r() ? 0 : HDC_BSY_MASK);
m_nimbus_drives.reg410_in |= (m_scsibus->scsi_msg_r() ? 0 : HDC_MSG_MASK);
m_nimbus_drives.drq_ff=0;
}
void rmnimbus_state::hdc_ctrl_write(UINT8 data)
WRITE_LINE_MEMBER(rmnimbus_state::write_scsi_iena)
{
int last = m_scsi_iena;
m_scsi_iena = state;
// If we enable the HDC interupt, and an interrupt is pending, go deal with it.
if(((data & HDC_IRQ_MASK) && (~m_nimbus_drives.reg410_out & HDC_IRQ_MASK)) &&
((~m_nimbus_drives.reg410_in & HDC_INT_TRIGGER)==HDC_INT_TRIGGER))
if (m_scsi_iena && !last && !m_scsi_io && !m_scsi_cd && !m_scsi_req)
set_disk_int(1);
m_nimbus_drives.reg410_out=data;
m_scsibus->scsi_rst_w((data & HDC_RESET_MASK) ? 1 : 0);
m_scsibus->scsi_sel_w((data & HDC_SEL_MASK) ? 1 : 0);
}
void rmnimbus_state::hdc_post_rw()
{
if((m_nimbus_drives.reg410_in & HDC_REQ_MASK)==0)
m_scsibus->scsi_ack_w(1);
if(!m_scsi_req)
m_scsibus->write_ack(1);
m_nimbus_drives.drq_ff=0;
}
@ -2426,71 +2416,47 @@ void rmnimbus_state::hdc_drq()
}
}
WRITE_LINE_MEMBER( rmnimbus_state::nimbus_scsi_bsy_w )
WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_bsy )
{
nimbus_scsi_linechange( HDC_BSY_MASK, state );
m_scsi_bsy = state;
}
WRITE_LINE_MEMBER( rmnimbus_state::nimbus_scsi_cd_w )
WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_cd )
{
nimbus_scsi_linechange( HDC_CD_MASK, state );
m_scsi_cd = state;
}
WRITE_LINE_MEMBER( rmnimbus_state::nimbus_scsi_io_w )
WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_io )
{
nimbus_scsi_linechange( HDC_IO_MASK, state );
}
m_scsi_io = state;
WRITE_LINE_MEMBER( rmnimbus_state::nimbus_scsi_msg_w )
{
nimbus_scsi_linechange( HDC_MSG_MASK, state );
}
WRITE_LINE_MEMBER( rmnimbus_state::nimbus_scsi_req_w )
{
nimbus_scsi_linechange( HDC_REQ_MASK, state );
}
void rmnimbus_state::nimbus_scsi_linechange( UINT8 mask, UINT8 state )
{
UINT8 last = 0;
last=m_nimbus_drives.reg410_in & mask;
if(!state)
m_nimbus_drives.reg410_in|=mask;
else
m_nimbus_drives.reg410_in&=~mask;
if(HDC_IRQ_ENABLED() && ((~m_nimbus_drives.reg410_in & HDC_INT_TRIGGER)==HDC_INT_TRIGGER))
set_disk_int(1);
else
set_disk_int(0);
switch( mask )
if (m_scsi_io)
{
case HDC_REQ_MASK:
if (state)
{
if(((m_nimbus_drives.reg410_in & HDC_CD_MASK)==HDC_CD_MASK) && (last!=0))
{
m_nimbus_drives.drq_ff=1;
hdc_drq();
}
}
else
{
m_scsibus->scsi_ack_w(0);
}
break;
m_scsi_data_out->write(0);
}
}
case HDC_IO_MASK:
if (state)
WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_msg )
{
m_scsi_msg = state;
}
WRITE_LINE_MEMBER( rmnimbus_state::write_scsi_req )
{
int last = m_scsi_req;
m_scsi_req = state;
if (state)
{
if (m_scsi_cd && last)
{
m_scsibus->scsi_data_w(0);
m_nimbus_drives.drq_ff=1;
hdc_drq();
}
break;
}
else
{
m_scsibus->write_ack(0);
}
}

View File

@ -469,7 +469,6 @@ MACHINES += S3C2410
MACHINES += S3C2440
MACHINES += S3C44B0
MACHINES += SATURN
MACHINES += SCSI
MACHINES += SCUDSP
MACHINES += SECFLASH
MACHINES += SEIBU_COP