summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/bus/abcbus
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2013-10-25 19:40:41 +0000
committer Curt Coder <curtcoder@mail.com>2013-10-25 19:40:41 +0000
commit85e1ff6ff8d177e29b9a6680e1d2f5b7be90b938 (patch)
treec720ccb080810ad07331204249a339aca97adc1b /src/emu/bus/abcbus
parent6812ae93ef6b93590b9de8ba183eaca36ebd8c09 (diff)
(MESS) abc800: Xebec WIP. (nw)
Diffstat (limited to 'src/emu/bus/abcbus')
-rw-r--r--src/emu/bus/abcbus/lux21046.c12
-rw-r--r--src/emu/bus/abcbus/lux21046.h1
-rw-r--r--src/emu/bus/abcbus/lux21056.c341
-rw-r--r--src/emu/bus/abcbus/lux21056.h49
4 files changed, 380 insertions, 23 deletions
diff --git a/src/emu/bus/abcbus/lux21046.c b/src/emu/bus/abcbus/lux21046.c
index b6d40d5df47..fee2c6d6266 100644
--- a/src/emu/bus/abcbus/lux21046.c
+++ b/src/emu/bus/abcbus/lux21046.c
@@ -150,7 +150,7 @@ static ADDRESS_MAP_START( luxor_55_21046_io, AS_IO, 8, luxor_55_21046_device )
AM_RANGE(0x50, 0x50) AM_MIRROR(0xff0f) AM_MASK(0xff00) AM_READ(_9a_r)
AM_RANGE(0x60, 0x63) AM_MIRROR(0xff0c) AM_DEVREAD(SAB1793_TAG, fd1793_t, read)
AM_RANGE(0x70, 0x73) AM_MIRROR(0xff0c) AM_DEVWRITE(SAB1793_TAG, fd1793_t, write)
- AM_RANGE(0x80, 0x80) AM_MIRROR(0xff0f) AM_DEVREADWRITE_LEGACY(Z80DMA_TAG, z80dma_r, z80dma_w)
+ AM_RANGE(0x80, 0x80) AM_MIRROR(0xff0f) AM_DEVREADWRITE(Z80DMA_TAG, z80dma_device, read, write)
ADDRESS_MAP_END
@@ -547,6 +547,16 @@ void luxor_55_21046_device::abcbus_c3(UINT8 data)
}
+//-------------------------------------------------
+// abcbus_c4 -
+//-------------------------------------------------
+
+void luxor_55_21046_device::abcbus_c4(UINT8 data)
+{
+ // TODO connected to PAL16R4 pin 2
+}
+
+
//**************************************************************************
// IMPLEMENTATION
diff --git a/src/emu/bus/abcbus/lux21046.h b/src/emu/bus/abcbus/lux21046.h
index 19677de9a52..529b238cb45 100644
--- a/src/emu/bus/abcbus/lux21046.h
+++ b/src/emu/bus/abcbus/lux21046.h
@@ -92,6 +92,7 @@ protected:
virtual UINT8 abcbus_stat();
virtual void abcbus_c1(UINT8 data);
virtual void abcbus_c3(UINT8 data);
+ virtual void abcbus_c4(UINT8 data);
private:
required_device<cpu_device> m_maincpu;
diff --git a/src/emu/bus/abcbus/lux21056.c b/src/emu/bus/abcbus/lux21056.c
index 37d3bda04c9..f5d811d13b3 100644
--- a/src/emu/bus/abcbus/lux21056.c
+++ b/src/emu/bus/abcbus/lux21056.c
@@ -21,6 +21,9 @@
#define Z80DMA_TAG "6a"
#define SASIBUS_TAG "sasi"
+#define STAT_DIR \
+ BIT(m_stat, 6)
+
//**************************************************************************
@@ -58,7 +61,10 @@ const rom_entry *luxor_55_21056_device::device_rom_region() const
//-------------------------------------------------
static ADDRESS_MAP_START( luxor_55_21056_mem, AS_PROGRAM, 8, luxor_55_21056_device )
- AM_RANGE(0x0000, 0x07ff) AM_ROM AM_REGION(Z80_TAG, 0)
+ ADDRESS_MAP_UNMAP_HIGH
+ ADDRESS_MAP_GLOBAL_MASK(0x3fff)
+ AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_ROM AM_REGION(Z80_TAG, 0)
+ AM_RANGE(0x2000, 0x3fff) AM_RAM
ADDRESS_MAP_END
@@ -67,6 +73,17 @@ ADDRESS_MAP_END
//-------------------------------------------------
static ADDRESS_MAP_START( luxor_55_21056_io, AS_IO, 8, luxor_55_21056_device )
+ ADDRESS_MAP_UNMAP_HIGH
+ ADDRESS_MAP_GLOBAL_MASK(0xf8)
+ AM_RANGE(0x00, 0x00) AM_MIRROR(0xf0) AM_DEVREADWRITE(Z80DMA_TAG, z80dma_device, read, write)
+ AM_RANGE(0x08, 0x08) AM_READ(sasi_status_r)
+ AM_RANGE(0x18, 0x18) AM_WRITE(stat_w)
+ AM_RANGE(0x28, 0x28) AM_READ(out_r)
+ AM_RANGE(0x38, 0x38) AM_WRITE(inp_w)
+ AM_RANGE(0x48, 0x48) AM_READWRITE(sasi_data_r, sasi_data_w)
+ AM_RANGE(0x58, 0x58) AM_READWRITE(rdy_reset_r, rdy_reset_w)
+ AM_RANGE(0x68, 0x68) AM_READWRITE(sasi_sel_r, sasi_sel_w)
+ AM_RANGE(0x78, 0x78) AM_READWRITE(sasi_rst_r, sasi_rst_w)
ADDRESS_MAP_END
@@ -76,7 +93,8 @@ ADDRESS_MAP_END
static const z80_daisy_config daisy_chain[] =
{
- { Z80DMA_TAG }
+ { Z80DMA_TAG },
+ { NULL }
};
@@ -84,28 +102,24 @@ static const z80_daisy_config daisy_chain[] =
// Z80DMA_INTERFACE( dma_intf )
//-------------------------------------------------
-READ8_MEMBER(luxor_55_21056_device::memory_read_byte)
+READ8_MEMBER( luxor_55_21056_device::memory_read_byte )
{
- address_space& prog_space = m_maincpu->space(AS_PROGRAM);
- return prog_space.read_byte(offset);
+ return m_maincpu->space(AS_PROGRAM).read_byte(offset);
}
-WRITE8_MEMBER(luxor_55_21056_device::memory_write_byte)
+WRITE8_MEMBER( luxor_55_21056_device::memory_write_byte )
{
- address_space& prog_space = m_maincpu->space(AS_PROGRAM);
- return prog_space.write_byte(offset, data);
+ return m_maincpu->space(AS_PROGRAM).write_byte(offset, data);
}
-READ8_MEMBER(luxor_55_21056_device::io_read_byte)
+READ8_MEMBER( luxor_55_21056_device::io_read_byte )
{
- address_space& prog_space = m_maincpu->space(AS_IO);
- return prog_space.read_byte(offset);
+ return m_maincpu->space(AS_IO).read_byte(offset);
}
-WRITE8_MEMBER(luxor_55_21056_device::io_write_byte)
+WRITE8_MEMBER( luxor_55_21056_device::io_write_byte )
{
- address_space& prog_space = m_maincpu->space(AS_IO);
- return prog_space.write_byte(offset, data);
+ return m_maincpu->space(AS_IO).write_byte(offset, data);
}
static Z80DMA_INTERFACE( dma_intf )
@@ -119,6 +133,31 @@ 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 )
+{
+ if (state)
+ {
+ m_sasibus->scsi_sel_w(0);
+ }
+}
+
+WRITE_LINE_MEMBER( luxor_55_21056_device::sasi_io_w )
+{
+ if (!state)
+ {
+ m_sasibus->scsi_data_w(m_sasi_data ^ 0xff);
+ }
+}
+
+WRITE_LINE_MEMBER( luxor_55_21056_device::sasi_req_w )
+{
+ if (state)
+ {
+ m_req = 1;
+ m_sasibus->scsi_ack_w(!m_req);
+ }
+}
+
//-------------------------------------------------
// MACHINE_DRIVER( luxor_55_21056 )
@@ -135,6 +174,9 @@ static MACHINE_CONFIG_FRAGMENT( luxor_55_21056 )
MCFG_SCSIBUS_ADD(SASIBUS_TAG)
MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", SCSIHD, 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))
MACHINE_CONFIG_END
@@ -162,7 +204,13 @@ luxor_55_21056_device::luxor_55_21056_device(const machine_config &mconfig, cons
: device_t(mconfig, LUXOR_55_21056, "ABC XEBEC", tag, owner, clock, "luxor_55_21056", __FILE__),
device_abcbus_card_interface(mconfig, *this),
m_maincpu(*this, Z80_TAG),
- m_sasibus(*this, SASIBUS_TAG)
+ m_dma(*this, Z80DMA_TAG),
+ m_sasibus(*this, SASIBUS_TAG ":host"),
+ m_cs(0),
+ m_rdy(0),
+ m_req(1),
+ m_stat(0),
+ m_sasi_data(0)
{
}
@@ -182,6 +230,7 @@ void luxor_55_21056_device::device_start()
void luxor_55_21056_device::device_reset()
{
+ m_stat = 0;
}
@@ -197,3 +246,265 @@ void luxor_55_21056_device::device_reset()
void luxor_55_21056_device::abcbus_cs(UINT8 data)
{
}
+
+
+//-------------------------------------------------
+// abcbus_stat -
+//-------------------------------------------------
+
+UINT8 luxor_55_21056_device::abcbus_stat()
+{
+ UINT8 data = 0xff;
+
+ if (m_cs)
+ {
+ data = m_stat & 0xfe;
+ data |= m_rdy;
+ }
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// abcbus_inp -
+//-------------------------------------------------
+
+UINT8 luxor_55_21056_device::abcbus_inp()
+{
+ UINT8 data = 0xff;
+
+ if (m_cs && !STAT_DIR)
+ {
+ data = m_inp;
+
+ set_rdy(!m_rdy);
+ }
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// abcbus_utp -
+//-------------------------------------------------
+
+void luxor_55_21056_device::abcbus_utp(UINT8 data)
+{
+ if (m_cs)
+ {
+ m_out = data;
+
+ set_rdy(!m_rdy);
+ }
+}
+
+
+//-------------------------------------------------
+// abcbus_c1 -
+//-------------------------------------------------
+
+void luxor_55_21056_device::abcbus_c1(UINT8 data)
+{
+ if (m_cs)
+ {
+ m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+ }
+}
+
+
+//-------------------------------------------------
+// abcbus_c3 -
+//-------------------------------------------------
+
+void luxor_55_21056_device::abcbus_c3(UINT8 data)
+{
+ if (m_cs)
+ {
+ m_maincpu->reset();
+ }
+}
+
+
+//-------------------------------------------------
+// sasi_status_r -
+//-------------------------------------------------
+
+READ8_MEMBER( luxor_55_21056_device::sasi_status_r )
+{
+ /*
+
+ bit description
+
+ 0 RDY
+ 1 REQ
+ 2 I/O
+ 3 C/D
+ 4 MSG
+ 5 BSY
+ 6
+ 7
+
+ */
+
+ UINT8 data = 0;
+
+ data |= m_rdy;
+
+ 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;
+
+ return data ^ 0xff;
+}
+
+
+//-------------------------------------------------
+// stat_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( luxor_55_21056_device::stat_w )
+{
+ m_stat = data;
+}
+
+
+//-------------------------------------------------
+// out_r -
+//-------------------------------------------------
+
+READ8_MEMBER( luxor_55_21056_device::out_r )
+{
+ UINT8 data = m_out;
+
+ set_rdy(!m_rdy);
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// inp_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( luxor_55_21056_device::inp_w )
+{
+ m_inp = data;
+
+ set_rdy(!m_rdy);
+}
+
+
+//-------------------------------------------------
+// sasi_data_r -
+//-------------------------------------------------
+
+READ8_MEMBER( luxor_55_21056_device::sasi_data_r )
+{
+ UINT8 data = m_sasibus->scsi_data_r();
+
+ m_req = !m_sasibus->scsi_req_r();
+ m_sasibus->scsi_ack_w(!m_req);
+
+ return data ^ 0xff;
+}
+
+
+//-------------------------------------------------
+// sasi_data_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( luxor_55_21056_device::sasi_data_w )
+{
+ m_sasi_data = data;
+
+ if (!m_sasibus->scsi_io_r())
+ {
+ m_sasibus->scsi_data_w(m_sasi_data ^ 0xff);
+ }
+
+ m_req = !m_sasibus->scsi_req_r();
+ m_sasibus->scsi_ack_w(!m_req);
+}
+
+
+//-------------------------------------------------
+// rdy_reset_r -
+//-------------------------------------------------
+
+READ8_MEMBER( luxor_55_21056_device::rdy_reset_r )
+{
+ rdy_reset_w(space, offset, 0xff);
+
+ return 0xff;
+}
+
+
+//-------------------------------------------------
+// rdy_reset_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( luxor_55_21056_device::rdy_reset_w )
+{
+ set_rdy(STAT_DIR);
+}
+
+
+//-------------------------------------------------
+// sasi_sel_r -
+//-------------------------------------------------
+
+READ8_MEMBER( luxor_55_21056_device::sasi_sel_r )
+{
+ sasi_sel_w(space, offset, 0xff);
+
+ return 0xff;
+}
+
+
+//-------------------------------------------------
+// sasi_sel_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( luxor_55_21056_device::sasi_sel_w )
+{
+ m_sasibus->scsi_sel_w(m_sasibus->scsi_bsy_r());
+}
+
+
+//-------------------------------------------------
+// sasi_rst_r -
+//-------------------------------------------------
+
+READ8_MEMBER( luxor_55_21056_device::sasi_rst_r )
+{
+ sasi_rst_w(space, offset, 0xff);
+
+ return 0xff;
+}
+
+
+//-------------------------------------------------
+// sasi_rst_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( luxor_55_21056_device::sasi_rst_w )
+{
+ m_sasibus->scsi_rst_w(1);
+ m_sasibus->scsi_rst_w(0);
+}
+
+
+//-------------------------------------------------
+// set_rdy -
+//-------------------------------------------------
+
+void luxor_55_21056_device::set_rdy(int state)
+{
+ m_rdy = state;
+
+ m_dma->rdy_w(m_rdy);
+}
diff --git a/src/emu/bus/abcbus/lux21056.h b/src/emu/bus/abcbus/lux21056.h
index 2ab44d76238..191d4feca9e 100644
--- a/src/emu/bus/abcbus/lux21056.h
+++ b/src/emu/bus/abcbus/lux21056.h
@@ -11,8 +11,8 @@
#pragma once
-#ifndef __ABC_XEBEC__
-#define __ABC_XEBEC__
+#ifndef __LUXOR_55_21056__
+#define __LUXOR_55_21056__
#include "emu.h"
#include "abcbus.h"
@@ -21,6 +21,7 @@
#include "machine/scsibus.h"
#include "machine/scsicb.h"
#include "machine/scsihd.h"
+#include "machine/z80dma.h"
@@ -41,10 +42,27 @@ public:
virtual const rom_entry *device_rom_region() const;
virtual machine_config_constructor device_mconfig_additions() const;
- DECLARE_READ8_MEMBER(memory_read_byte);
- DECLARE_WRITE8_MEMBER(memory_write_byte);
- DECLARE_READ8_MEMBER(io_read_byte);
- DECLARE_WRITE8_MEMBER(io_write_byte);
+ DECLARE_READ8_MEMBER( sasi_status_r );
+ DECLARE_WRITE8_MEMBER( stat_w );
+ DECLARE_READ8_MEMBER( out_r );
+ DECLARE_WRITE8_MEMBER( inp_w );
+ DECLARE_READ8_MEMBER( sasi_data_r );
+ DECLARE_WRITE8_MEMBER( sasi_data_w );
+ DECLARE_READ8_MEMBER( rdy_reset_r );
+ DECLARE_WRITE8_MEMBER( rdy_reset_w );
+ DECLARE_READ8_MEMBER( sasi_sel_r );
+ DECLARE_WRITE8_MEMBER( sasi_sel_w );
+ DECLARE_READ8_MEMBER( sasi_rst_r );
+ DECLARE_WRITE8_MEMBER( sasi_rst_w );
+
+ DECLARE_READ8_MEMBER( memory_read_byte );
+ DECLARE_WRITE8_MEMBER( memory_write_byte );
+ 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 );
protected:
// device-level overrides
@@ -53,10 +71,27 @@ protected:
// device_abcbus_interface overrides
virtual void abcbus_cs(UINT8 data);
+ virtual UINT8 abcbus_inp();
+ virtual void abcbus_utp(UINT8 data);
+ virtual UINT8 abcbus_stat();
+ virtual void abcbus_c1(UINT8 data);
+ virtual void abcbus_c3(UINT8 data);
private:
+ void set_rdy(int state);
+
required_device<cpu_device> m_maincpu;
- required_device<scsibus_device> m_sasibus;
+ required_device<z80dma_device> m_dma;
+ required_device<scsicb_device> m_sasibus;
+
+ int m_cs;
+ int m_rdy;
+ int m_req;
+
+ UINT8 m_inp;
+ UINT8 m_out;
+ UINT8 m_stat;
+ UINT8 m_sasi_data;
};