mirror of
https://github.com/holub/mame
synced 2025-07-01 16:19:38 +03:00
bus/bbc/1mhzbus/beebide: Added jumper configuration for address and interrupt enable (nw)
This commit is contained in:
parent
ea0a453be0
commit
b7dd2f6221
@ -5,6 +5,7 @@
|
|||||||
RetroClinic BBC 8-bit IDE Interface
|
RetroClinic BBC 8-bit IDE Interface
|
||||||
|
|
||||||
http://www.retroclinic.com/acorn/bbcide/bbcide.htm
|
http://www.retroclinic.com/acorn/bbcide/bbcide.htm
|
||||||
|
http://www.retroclinic.com/acorn/kitide1mhz/kitide1mhz.htm
|
||||||
|
|
||||||
Sprow BeebIDE 16-bit IDE Interface for the BBC series
|
Sprow BeebIDE 16-bit IDE Interface for the BBC series
|
||||||
|
|
||||||
@ -25,6 +26,30 @@ DEFINE_DEVICE_TYPE(BBC_IDE8, bbc_ide8_device, "bbc_ide8", "RetroClinic BBC 8-bit
|
|||||||
DEFINE_DEVICE_TYPE(BBC_BEEBIDE, bbc_beebide_device, "bbc_beebide", "Sprow BeebIDE 16-bit IDE Interface");
|
DEFINE_DEVICE_TYPE(BBC_BEEBIDE, bbc_beebide_device, "bbc_beebide", "Sprow BeebIDE 16-bit IDE Interface");
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// INPUT_PORTS( beebide )
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
INPUT_PORTS_START(beebide)
|
||||||
|
PORT_START("LINKS")
|
||||||
|
PORT_CONFNAME(0x01, 0x00, "Interrupt Enable")
|
||||||
|
PORT_CONFSETTING(0x00, DEF_STR(No))
|
||||||
|
PORT_CONFSETTING(0x01, DEF_STR(Yes))
|
||||||
|
PORT_CONFNAME(0x10, 0x00, "Address Selection")
|
||||||
|
PORT_CONFSETTING(0x00, "&FC40-&FC4F")
|
||||||
|
PORT_CONFSETTING(0x10, "&FC50-&FC5F")
|
||||||
|
INPUT_PORTS_END
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// input_ports - device-specific input ports
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
ioport_constructor bbc_beebide_device::device_input_ports() const
|
||||||
|
{
|
||||||
|
return INPUT_PORTS_NAME(beebide);
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_add_mconfig - add device configuration
|
// device_add_mconfig - add device configuration
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -32,13 +57,12 @@ DEFINE_DEVICE_TYPE(BBC_BEEBIDE, bbc_beebide_device, "bbc_beebide", "Sprow BeebID
|
|||||||
void bbc_ide8_device::device_add_mconfig(machine_config& config)
|
void bbc_ide8_device::device_add_mconfig(machine_config& config)
|
||||||
{
|
{
|
||||||
ATA_INTERFACE(config, m_ide).options(ata_devices, "hdd", nullptr, false);
|
ATA_INTERFACE(config, m_ide).options(ata_devices, "hdd", nullptr, false);
|
||||||
m_ide->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void bbc_beebide_device::device_add_mconfig(machine_config& config)
|
void bbc_beebide_device::device_add_mconfig(machine_config& config)
|
||||||
{
|
{
|
||||||
ATA_INTERFACE(config, m_ide).options(ata_devices, "hdd", nullptr, false);
|
ATA_INTERFACE(config, m_ide).options(ata_devices, "hdd", nullptr, false);
|
||||||
m_ide->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
|
m_ide->irq_handler().set(FUNC(bbc_beebide_device::irq_w));
|
||||||
|
|
||||||
BBC_1MHZBUS_SLOT(config, m_1mhzbus, DERIVED_CLOCK(1, 1), bbc_1mhzbus_devices, nullptr);
|
BBC_1MHZBUS_SLOT(config, m_1mhzbus, DERIVED_CLOCK(1, 1), bbc_1mhzbus_devices, nullptr);
|
||||||
m_1mhzbus->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
|
m_1mhzbus->irq_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::irq_w));
|
||||||
@ -66,6 +90,7 @@ bbc_beebide_device::bbc_beebide_device(const machine_config& mconfig, const char
|
|||||||
, device_bbc_1mhzbus_interface(mconfig, *this)
|
, device_bbc_1mhzbus_interface(mconfig, *this)
|
||||||
, m_ide(*this, "ide")
|
, m_ide(*this, "ide")
|
||||||
, m_1mhzbus(*this, "1mhzbus")
|
, m_1mhzbus(*this, "1mhzbus")
|
||||||
|
, m_links(*this, "LINKS")
|
||||||
, m_ide_data(0)
|
, m_ide_data(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -94,9 +119,6 @@ uint8_t bbc_ide8_device::fred_r(offs_t offset)
|
|||||||
case 0x40:
|
case 0x40:
|
||||||
data = m_ide->read_cs0(offset & 0x07, 0xff);
|
data = m_ide->read_cs0(offset & 0x07, 0xff);
|
||||||
break;
|
break;
|
||||||
case 0x48:
|
|
||||||
data = m_ide->read_cs1(offset & 0x07, 0xff);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@ -109,9 +131,6 @@ void bbc_ide8_device::fred_w(offs_t offset, uint8_t data)
|
|||||||
case 0x40:
|
case 0x40:
|
||||||
m_ide->write_cs0(offset & 0x07, data, 0xff);
|
m_ide->write_cs0(offset & 0x07, data, 0xff);
|
||||||
break;
|
break;
|
||||||
case 0x48:
|
|
||||||
m_ide->write_cs1(offset & 0x07, data, 0xff);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,23 +139,25 @@ uint8_t bbc_beebide_device::fred_r(offs_t offset)
|
|||||||
{
|
{
|
||||||
uint8_t data = 0xff;
|
uint8_t data = 0xff;
|
||||||
|
|
||||||
switch (offset & 0xf8)
|
if ((offset & 0x50) == ((m_links->read() & 0x10) | 0x40))
|
||||||
|
{
|
||||||
|
switch (offset & 0xe8)
|
||||||
{
|
{
|
||||||
case 0x40:
|
case 0x40:
|
||||||
if (offset == 0x40)
|
if (offset & 0x07)
|
||||||
{
|
{
|
||||||
m_ide_data = m_ide->read_cs0(offset & 0x07);
|
data = m_ide->read_cs0(offset & 0x07, 0xff);
|
||||||
data = m_ide_data & 0x00ff;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = m_ide->read_cs0(offset & 0x07);
|
m_ide_data = m_ide->read_cs0(offset & 0x07);
|
||||||
|
data = m_ide_data & 0xff;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x48:
|
case 0x48:
|
||||||
if (offset & 0x04)
|
if (offset & 0x04)
|
||||||
{
|
{
|
||||||
data = m_ide->read_cs1(offset & 0x07);
|
data = m_ide->read_cs1(offset & 0x07, 0xff);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -144,6 +165,7 @@ uint8_t bbc_beebide_device::fred_r(offs_t offset)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data &= m_1mhzbus->fred_r(offset);
|
data &= m_1mhzbus->fred_r(offset);
|
||||||
|
|
||||||
@ -152,23 +174,25 @@ uint8_t bbc_beebide_device::fred_r(offs_t offset)
|
|||||||
|
|
||||||
void bbc_beebide_device::fred_w(offs_t offset, uint8_t data)
|
void bbc_beebide_device::fred_w(offs_t offset, uint8_t data)
|
||||||
{
|
{
|
||||||
switch (offset & 0xf8)
|
if ((offset & 0x50) == ((m_links->read() & 0x10) | 0x40))
|
||||||
|
{
|
||||||
|
switch (offset & 0xe8)
|
||||||
{
|
{
|
||||||
case 0x40:
|
case 0x40:
|
||||||
if (offset == 0x40)
|
if (offset & 0x07)
|
||||||
{
|
{
|
||||||
m_ide_data = (m_ide_data & 0xff00) | data;
|
m_ide->write_cs0(offset & 0x07, data, 0xff);
|
||||||
m_ide->write_cs0(offset & 0x07, m_ide_data);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_ide->write_cs0(offset & 0x07, data);
|
m_ide_data = (m_ide_data & 0xff00) | data;
|
||||||
|
m_ide->write_cs0(offset & 0x07, m_ide_data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x48:
|
case 0x48:
|
||||||
if (offset & 0x04)
|
if (offset & 0x04)
|
||||||
{
|
{
|
||||||
m_ide->write_cs1(offset & 0x07, data);
|
m_ide->write_cs1(offset & 0x07, data, 0xff);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -176,6 +200,7 @@ void bbc_beebide_device::fred_w(offs_t offset, uint8_t data)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_1mhzbus->fred_w(offset, data);
|
m_1mhzbus->fred_w(offset, data);
|
||||||
}
|
}
|
||||||
@ -189,3 +214,11 @@ void bbc_beebide_device::jim_w(offs_t offset, uint8_t data)
|
|||||||
{
|
{
|
||||||
m_1mhzbus->jim_w(offset, data);
|
m_1mhzbus->jim_w(offset, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER(bbc_beebide_device::irq_w)
|
||||||
|
{
|
||||||
|
if (BIT(m_links->read(), 0))
|
||||||
|
{
|
||||||
|
m_slot->irq_w(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -60,6 +60,7 @@ protected:
|
|||||||
|
|
||||||
// optional information overrides
|
// optional information overrides
|
||||||
virtual void device_add_mconfig(machine_config& config) override;
|
virtual void device_add_mconfig(machine_config& config) override;
|
||||||
|
virtual ioport_constructor device_input_ports() const override;
|
||||||
|
|
||||||
virtual uint8_t fred_r(offs_t offset) override;
|
virtual uint8_t fred_r(offs_t offset) override;
|
||||||
virtual void fred_w(offs_t offset, uint8_t data) override;
|
virtual void fred_w(offs_t offset, uint8_t data) override;
|
||||||
@ -67,8 +68,11 @@ protected:
|
|||||||
virtual void jim_w(offs_t offset, uint8_t data) override;
|
virtual void jim_w(offs_t offset, uint8_t data) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
DECLARE_WRITE_LINE_MEMBER(irq_w);
|
||||||
|
|
||||||
required_device<ata_interface_device> m_ide;
|
required_device<ata_interface_device> m_ide;
|
||||||
required_device<bbc_1mhzbus_slot_device> m_1mhzbus;
|
required_device<bbc_1mhzbus_slot_device> m_1mhzbus;
|
||||||
|
required_ioport m_links;
|
||||||
|
|
||||||
uint16_t m_ide_data;
|
uint16_t m_ide_data;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user