mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
bus/epson_qx: Added hard disk support for the Epson QX-10. (#10378)
* Added IDE hard disk option board. * Added ComFiler CR-1510 option board.
This commit is contained in:
parent
ebbc5a81ab
commit
b4ecb617be
@ -3906,6 +3906,10 @@ end
|
||||
---------------------------------------------------
|
||||
if (BUSES["EPSON_QX"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/bus/epson_qx/cr1510.cpp",
|
||||
MAME_DIR .. "src/devices/bus/epson_qx/cr1510.h",
|
||||
MAME_DIR .. "src/devices/bus/epson_qx/ide.cpp",
|
||||
MAME_DIR .. "src/devices/bus/epson_qx/ide.h",
|
||||
MAME_DIR .. "src/devices/bus/epson_qx/multifont.cpp",
|
||||
MAME_DIR .. "src/devices/bus/epson_qx/multifont.h",
|
||||
MAME_DIR .. "src/devices/bus/epson_qx/option.cpp",
|
||||
|
62
src/devices/bus/epson_qx/cr1510.cpp
Normal file
62
src/devices/bus/epson_qx/cr1510.cpp
Normal file
@ -0,0 +1,62 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Brian Johnson
|
||||
/*******************************************************************
|
||||
*
|
||||
* Comrex ComFiler CR-1510 Card
|
||||
*
|
||||
*******************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cr1510.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// EPSON CR-1510 DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(EPSON_QX_OPTION_CR1510, bus::epson_qx::cr1510_device, "epson_qx_option_cr1510", "Comrex ComFiler CR-1510")
|
||||
|
||||
namespace bus::epson_qx {
|
||||
|
||||
//-------------------------------------------------
|
||||
// cr1510_device - constructor
|
||||
//-------------------------------------------------
|
||||
cr1510_device::cr1510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, EPSON_QX_OPTION_CR1510, tag, owner, clock),
|
||||
device_option_expansion_interface(mconfig, *this),
|
||||
m_hdd(*this, "hdd")
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - device-specific config
|
||||
//-------------------------------------------------
|
||||
void cr1510_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
WD1000(config, m_hdd, 0);
|
||||
|
||||
HARDDISK(config, "hdd:0", 0);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
void cr1510_device::device_start()
|
||||
{
|
||||
address_space &space = m_bus->iospace();
|
||||
space.install_device(0x80, 0x87, *this, &cr1510_device::map);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
void cr1510_device::device_reset()
|
||||
{
|
||||
}
|
||||
|
||||
void cr1510_device::map(address_map &map)
|
||||
{
|
||||
map(0x00, 0x07).rw(m_hdd, FUNC(wd1000_device::read), FUNC(wd1000_device::write));
|
||||
}
|
||||
|
||||
} // namespace bus::epson_qx
|
50
src/devices/bus/epson_qx/cr1510.h
Normal file
50
src/devices/bus/epson_qx/cr1510.h
Normal file
@ -0,0 +1,50 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Brian Johnson
|
||||
/*******************************************************************
|
||||
*
|
||||
* ComFiler CR-1510 Card
|
||||
*
|
||||
*******************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_EPSON_QX_CR1510_H
|
||||
#define MAME_BUS_EPSON_QX_CR1510_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "option.h"
|
||||
|
||||
#include "machine/wd1000.h"
|
||||
|
||||
namespace bus::epson_qx {
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
/* Epson CR-1510 Device */
|
||||
|
||||
class cr1510_device : public device_t, public bus::epson_qx::device_option_expansion_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
cr1510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
void map(address_map &map);
|
||||
private:
|
||||
required_device<wd1000_device> m_hdd;
|
||||
};
|
||||
|
||||
} // namespace bus::epson_qx
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE_NS(EPSON_QX_OPTION_CR1510, bus::epson_qx, cr1510_device)
|
||||
|
||||
#endif // MAME_BUS_EPSON_QX_CR1510_H
|
115
src/devices/bus/epson_qx/ide.cpp
Normal file
115
src/devices/bus/epson_qx/ide.cpp
Normal file
@ -0,0 +1,115 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Brian Johnson
|
||||
/*******************************************************************
|
||||
*
|
||||
* IDE Compact Flash Adapter
|
||||
*
|
||||
* This implements a Compact flash adapter expansion card for QX-10
|
||||
* systems. The boot disk necessary to support this card is listed below.
|
||||
*
|
||||
* Disk Image: https://github.com/brijohn/qx10/raw/master/diskimages/qx10cf.imd
|
||||
* Board Design: https://github.com/brijohn/qx10/tree/master/kicad/cf_adapter
|
||||
*
|
||||
*******************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "ide.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// EPSON IDE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(EPSON_QX_OPTION_IDE, bus::epson_qx::ide_device, "epson_qx_option_ide", "Epson QX-10 Compact Flash Adapter")
|
||||
|
||||
namespace bus::epson_qx {
|
||||
|
||||
static INPUT_PORTS_START( ide )
|
||||
PORT_START("IOBASE")
|
||||
PORT_CONFNAME(0xf0, 0xd0, "IO Base Address Selection")
|
||||
PORT_CONFSETTING(0x80, "&80")
|
||||
PORT_CONFSETTING(0x90, "&90")
|
||||
PORT_CONFSETTING(0xa0, "&A0")
|
||||
PORT_CONFSETTING(0xb0, "&B0")
|
||||
PORT_CONFSETTING(0xc0, "&C0")
|
||||
PORT_CONFSETTING(0xd0, "&D0")
|
||||
PORT_CONFSETTING(0xe0, "&E0")
|
||||
PORT_CONFSETTING(0xf0, "&F0")
|
||||
INPUT_PORTS_END
|
||||
|
||||
//-------------------------------------------------
|
||||
// ide_device - constructor
|
||||
//-------------------------------------------------
|
||||
ide_device::ide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, EPSON_QX_OPTION_IDE, tag, owner, clock),
|
||||
device_option_expansion_interface(mconfig, *this),
|
||||
m_hdd(*this, "hdd"),
|
||||
m_iobase(*this, "IOBASE"),
|
||||
m_installed(false)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_input_ports - device-specific ports
|
||||
//-------------------------------------------------
|
||||
ioport_constructor ide_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( ide );
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - device-specific config
|
||||
//-------------------------------------------------
|
||||
void ide_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
IDE_HARDDISK(config, m_hdd, 0);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
void ide_device::device_start()
|
||||
{
|
||||
m_installed = false;
|
||||
|
||||
save_item(NAME(m_installed));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
void ide_device::device_reset()
|
||||
{
|
||||
if (!m_installed) {
|
||||
address_space &space = m_bus->iospace();
|
||||
offs_t iobase = m_iobase->read() & 0xf0;
|
||||
space.install_device(iobase, iobase+0x0f, *this, &ide_device::map);
|
||||
m_installed = true;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t ide_device::read(offs_t offset)
|
||||
{
|
||||
if (offset < 8) {
|
||||
return m_hdd->read_cs0(offset);
|
||||
} else if (offset == 14 || offset == 15) {
|
||||
return m_hdd->read_cs1(offset & 7);
|
||||
}
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
void ide_device::write(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (offset < 8) {
|
||||
m_hdd->write_cs0(offset, data);
|
||||
} else if (offset == 14) {
|
||||
m_hdd->write_cs1(offset & 7, data);
|
||||
}
|
||||
}
|
||||
|
||||
void ide_device::map(address_map &map)
|
||||
{
|
||||
map(0x00, 0x0f).rw(FUNC(ide_device::read), FUNC(ide_device::write));
|
||||
}
|
||||
|
||||
} // namespace bus::epson_qx
|
58
src/devices/bus/epson_qx/ide.h
Normal file
58
src/devices/bus/epson_qx/ide.h
Normal file
@ -0,0 +1,58 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Brian Johnson
|
||||
/*******************************************************************
|
||||
*
|
||||
* IDE Compact Flash Adapter
|
||||
*
|
||||
*******************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_EPSON_QX_IDE_H
|
||||
#define MAME_BUS_EPSON_QX_IDE_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "option.h"
|
||||
|
||||
#include "bus/ata/idehd.h"
|
||||
|
||||
namespace bus::epson_qx {
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
/* Epson IDE Device */
|
||||
|
||||
class ide_device : public device_t, public bus::epson_qx::device_option_expansion_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
ide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
uint8_t read(offs_t offset);
|
||||
void write(offs_t offset, uint8_t data);
|
||||
|
||||
void map(address_map &map);
|
||||
|
||||
private:
|
||||
required_device<ide_hdd_device> m_hdd;
|
||||
required_ioport m_iobase;
|
||||
|
||||
bool m_installed;
|
||||
};
|
||||
|
||||
} // namespace bus::epson_qx
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE_NS(EPSON_QX_OPTION_IDE, bus::epson_qx, ide_device)
|
||||
|
||||
#endif // MAME_BUS_EPSON_QX_IDE_H
|
@ -7,6 +7,9 @@
|
||||
*******************************************************************/
|
||||
#include "emu.h"
|
||||
#include "option.h"
|
||||
|
||||
#include "cr1510.h"
|
||||
#include "ide.h"
|
||||
#include "multifont.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(EPSON_QX_OPTION_BUS_SLOT, bus::epson_qx::option_slot_device, "epson_qx_option_slot", "QX-10 Option slot")
|
||||
@ -206,6 +209,8 @@ void device_option_expansion_interface::interface_pre_start()
|
||||
|
||||
void option_bus_devices(device_slot_interface &device)
|
||||
{
|
||||
device.option_add("cr1510", EPSON_QX_OPTION_CR1510);
|
||||
device.option_add("ide", EPSON_QX_OPTION_IDE);
|
||||
device.option_add("multifont", EPSON_QX_OPTION_MULTIFONT);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user