bus/bbc/1mhzbus: Added Sprow BeebIDE 16-bit and RetroClinic BBC 8-bit IDE interfaces.

This commit is contained in:
Nigel Barnes 2020-01-03 14:02:47 +00:00
parent b1d16b6c9a
commit 5b46a3b8ab
4 changed files with 280 additions and 0 deletions

View File

@ -473,6 +473,8 @@ if (BUSES["BBC_1MHZBUS"]~=null) then
MAME_DIR .. "src/devices/bus/bbc/1mhzbus/beebsid.h",
MAME_DIR .. "src/devices/bus/bbc/1mhzbus/emrmidi.cpp",
MAME_DIR .. "src/devices/bus/bbc/1mhzbus/emrmidi.h",
MAME_DIR .. "src/devices/bus/bbc/1mhzbus/ide.cpp",
MAME_DIR .. "src/devices/bus/bbc/1mhzbus/ide.h",
MAME_DIR .. "src/devices/bus/bbc/1mhzbus/ieee488.cpp",
MAME_DIR .. "src/devices/bus/bbc/1mhzbus/ieee488.h",
MAME_DIR .. "src/devices/bus/bbc/1mhzbus/m2000.cpp",

View File

@ -112,6 +112,7 @@ void bbc_1mhzbus_slot_device::jim_w(offs_t offset, uint8_t data)
//#include "teletext.h"
//#include "digitiser.h"
#include "emrmidi.h"
#include "ide.h"
#include "ieee488.h"
#include "m2000.h"
//#include "m5000.h"
@ -135,6 +136,8 @@ void bbc_1mhzbus_devices(device_slot_interface &device)
//device.option_add("m500", BBC_M500); /* Acorn ANV02 Music 500 */
//device.option_add("awdd", BBC_AWDD); /* Acorn Winchester 110/130 */
device.option_add("autoprom", BBC_AUTOPROM); /* ATPL AutoPrommer */
device.option_add("beebide", BBC_BEEBIDE); /* Sprow BeebIDE 16-bit */
device.option_add("ide8", BBC_IDE8); /* RetroClinic BBC 8-bit IDE */
//device.option_add("beebscan", BBC_BEEBSCAN); /* Beeb HandScan */
device.option_add("b488", BBC_B488); /* Aries B488 */
//device.option_add("videodig", BBC_VIDEODIG); /* Video Digitiser (RH Electronics) */
@ -158,6 +161,8 @@ void bbcm_1mhzbus_devices(device_slot_interface &device)
device.option_add("ieee488", BBC_IEEE488); /* Acorn ANK01 IEEE488 Interface */
//device.option_add("m500", BBC_M500); /* Acorn ANV02 Music 500 */
//device.option_add("awdd", BBC_AWDD); /* Acorn Winchester 110/130 */
device.option_add("beebide", BBC_BEEBIDE); /* Sprow BeebIDE 16-bit */
device.option_add("ide8", BBC_IDE8); /* RetroClinic BBC 8-bit IDE */
device.option_add("b488", BBC_B488); /* Aries B488 */
//device.option_add("videodig", BBC_VIDEODIG); /* Video Digitiser (RH Electronics) */
device.option_add("emrmidi", BBC_EMRMIDI); /* EMR Midi Interface */

View File

@ -0,0 +1,191 @@
// license:BSD-3-Clause
// copyright-holders:Nigel Barnes
/**********************************************************************
RetroClinic BBC 8-bit IDE Interface
http://www.retroclinic.com/acorn/bbcide/bbcide.htm
Sprow BeebIDE 16-bit IDE Interface for the BBC series
http://www.sprow.co.uk/bbc/beebide.htm
**********************************************************************/
#include "emu.h"
#include "ide.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
DEFINE_DEVICE_TYPE(BBC_IDE8, bbc_ide8_device, "bbc_ide8", "RetroClinic BBC 8-bit IDE Interface");
DEFINE_DEVICE_TYPE(BBC_BEEBIDE, bbc_beebide_device, "bbc_beebide", "Sprow BeebIDE 16-bit IDE Interface");
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
void bbc_ide8_device::device_add_mconfig(machine_config& config)
{
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)
{
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));
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->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(bbc_1mhzbus_slot_device::nmi_w));
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// bbc_ide_device - constructor
//-------------------------------------------------
bbc_ide8_device::bbc_ide8_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock)
: device_t(mconfig, BBC_IDE8, tag, owner, clock)
, device_bbc_1mhzbus_interface(mconfig, *this)
, m_ide(*this, "ide")
{
}
bbc_beebide_device::bbc_beebide_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock)
: device_t(mconfig, BBC_BEEBIDE, tag, owner, clock)
, device_bbc_1mhzbus_interface(mconfig, *this)
, m_ide(*this, "ide")
, m_1mhzbus(*this, "1mhzbus")
, m_ide_data(0)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void bbc_beebide_device::device_start()
{
save_item(NAME(m_ide_data));
}
//**************************************************************************
// IMPLEMENTATION
//**************************************************************************
uint8_t bbc_ide8_device::fred_r(offs_t offset)
{
uint8_t data = 0xff;
switch (offset & 0xf8)
{
case 0x40:
data = m_ide->read_cs0(offset & 0x07, 0xff);
break;
case 0x48:
data = m_ide->read_cs1(offset & 0x07, 0xff);
break;
}
return data;
}
void bbc_ide8_device::fred_w(offs_t offset, uint8_t data)
{
switch (offset & 0xf8)
{
case 0x40:
m_ide->write_cs0(offset & 0x07, data, 0xff);
break;
case 0x48:
m_ide->write_cs1(offset & 0x07, data, 0xff);
break;
}
}
uint8_t bbc_beebide_device::fred_r(offs_t offset)
{
uint8_t data = 0xff;
switch (offset & 0xf8)
{
case 0x40:
if (offset == 0x40)
{
m_ide_data = m_ide->read_cs0(offset & 0x07);
data = m_ide_data & 0x00ff;
}
else
{
data = m_ide->read_cs0(offset & 0x07);
}
break;
case 0x48:
if (offset & 0x04)
{
data = m_ide->read_cs1(offset & 0x07);
}
else
{
data = m_ide_data >> 8;
}
break;
}
data &= m_1mhzbus->fred_r(offset);
return data;
}
void bbc_beebide_device::fred_w(offs_t offset, uint8_t data)
{
switch (offset & 0xf8)
{
case 0x40:
if (offset == 0x40)
{
m_ide_data = (m_ide_data & 0xff00) | data;
m_ide->write_cs0(offset & 0x07, m_ide_data);
}
else
{
m_ide->write_cs0(offset & 0x07, data);
}
break;
case 0x48:
if (offset & 0x04)
{
m_ide->write_cs1(offset & 0x07, data);
}
else
{
m_ide_data = data << 8;
}
break;
}
m_1mhzbus->fred_w(offset, data);
}
uint8_t bbc_beebide_device::jim_r(offs_t offset)
{
return m_1mhzbus->jim_r(offset);
}
void bbc_beebide_device::jim_w(offs_t offset, uint8_t data)
{
m_1mhzbus->jim_w(offset, data);
}

View File

@ -0,0 +1,82 @@
// license:BSD-3-Clause
// copyright-holders:Nigel Barnes
/**********************************************************************
RetroClinic BBC 8-bit IDE Interface
http://www.retroclinic.com/acorn/bbcide/bbcide.htm
Sprow BeebIDE 16-bit IDE Interface for the BBC series
http://www.sprow.co.uk/bbc/beebide.htm
**********************************************************************/
#ifndef MAME_BUS_BBC_1MHZBUS_IDE_H
#define MAME_BUS_BBC_1MHZBUS_IDE_H
#include "1mhzbus.h"
#include "bus/ata/ataintf.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
class bbc_ide8_device :
public device_t,
public device_bbc_1mhzbus_interface
{
public:
// construction/destruction
bbc_ide8_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override { }
// optional information overrides
virtual void device_add_mconfig(machine_config& config) override;
virtual uint8_t fred_r(offs_t offset) override;
virtual void fred_w(offs_t offset, uint8_t data) override;
private:
required_device<ata_interface_device> m_ide;
};
class bbc_beebide_device :
public device_t,
public device_bbc_1mhzbus_interface
{
public:
// construction/destruction
bbc_beebide_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override;
// optional information overrides
virtual void device_add_mconfig(machine_config& config) override;
virtual uint8_t fred_r(offs_t offset) override;
virtual void fred_w(offs_t offset, uint8_t data) override;
virtual uint8_t jim_r(offs_t offset) override;
virtual void jim_w(offs_t offset, uint8_t data) override;
private:
required_device<ata_interface_device> m_ide;
required_device<bbc_1mhzbus_slot_device> m_1mhzbus;
uint16_t m_ide_data;
};
// device type definition
DECLARE_DEVICE_TYPE(BBC_IDE8, bbc_ide8_device);
DECLARE_DEVICE_TYPE(BBC_BEEBIDE, bbc_beebide_device);
#endif /* MAME_BUS_BBC_1MHZBUS_IDE_H */