summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/hp80_io/hp80_io.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/hp80_io/hp80_io.cpp')
-rw-r--r--src/devices/bus/hp80_io/hp80_io.cpp57
1 files changed, 29 insertions, 28 deletions
diff --git a/src/devices/bus/hp80_io/hp80_io.cpp b/src/devices/bus/hp80_io/hp80_io.cpp
index 8004ce06bd4..5ca970060bf 100644
--- a/src/devices/bus/hp80_io/hp80_io.cpp
+++ b/src/devices/bus/hp80_io/hp80_io.cpp
@@ -23,7 +23,7 @@ DEFINE_DEVICE_TYPE(HP80_IO_SLOT, hp80_io_slot_device, "hp80_io_slot", "HP80 I/O
// +-------------------+
hp80_io_slot_device::hp80_io_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, HP80_IO_SLOT, tag, owner, clock),
- device_slot_interface(mconfig, *this),
+ device_single_card_slot_interface<device_hp80_io_interface>(mconfig, *this),
m_irl_cb_func(*this),
m_halt_cb_func(*this),
m_slot_no(0)
@@ -36,17 +36,15 @@ hp80_io_slot_device::~hp80_io_slot_device()
void hp80_io_slot_device::device_start()
{
- m_irl_cb_func.resolve_safe();
- m_halt_cb_func.resolve_safe();
}
-WRITE_LINE_MEMBER(hp80_io_slot_device::irl_w)
+void hp80_io_slot_device::irl_w(int state)
{
LOG("irl_w slot %u=%d\n" , m_slot_no , state);
m_irl_cb_func(m_slot_no , state , 0xff);
}
-WRITE_LINE_MEMBER(hp80_io_slot_device::halt_w)
+void hp80_io_slot_device::halt_w(int state)
{
LOG("halt_w slot %u=%d\n" , m_slot_no , state);
m_halt_cb_func(m_slot_no , state , 0xff);
@@ -54,7 +52,7 @@ WRITE_LINE_MEMBER(hp80_io_slot_device::halt_w)
void hp80_io_slot_device::inten()
{
- hp80_io_card_device *card = downcast<hp80_io_card_device*>(get_card_device());
+ device_hp80_io_interface *card = get_card_device();
if (card != nullptr) {
card->inten();
@@ -63,7 +61,7 @@ void hp80_io_slot_device::inten()
void hp80_io_slot_device::clear_service()
{
- hp80_io_card_device *card = downcast<hp80_io_card_device*>(get_card_device());
+ device_hp80_io_interface *card = get_card_device();
if (card != nullptr) {
card->clear_service();
@@ -72,7 +70,7 @@ void hp80_io_slot_device::clear_service()
void hp80_io_slot_device::install_read_write_handlers(address_space& space)
{
- hp80_io_card_device *card = downcast<hp80_io_card_device*>(get_card_device());
+ device_hp80_io_interface *card = get_card_device();
if (card != nullptr) {
card->install_read_write_handlers(space , get_base_addr());
@@ -81,7 +79,7 @@ void hp80_io_slot_device::install_read_write_handlers(address_space& space)
uint8_t hp80_io_slot_device::get_sc() const
{
- const hp80_io_card_device *card = downcast<hp80_io_card_device*>(get_card_device());
+ const device_hp80_io_interface *card = get_card_device();
if (card != nullptr) {
return card->get_sc();
@@ -92,60 +90,63 @@ uint8_t hp80_io_slot_device::get_sc() const
uint16_t hp80_io_slot_device::get_base_addr() const
{
- const hp80_io_card_device *card = downcast<hp80_io_card_device*>(get_card_device());
+ const device_hp80_io_interface *card = get_card_device();
if (card != nullptr) {
- uint16_t addr = ((uint16_t)(card->get_sc() - HP80_IO_FIRST_SC) << 1) | 0xff50;
+ uint16_t addr = ((uint16_t)(card->get_sc()) << 1) | 0xff40;
return addr;
} else {
return 0;
}
}
-// +-------------------+
-// |hp80_io_card_device|
-// +-------------------+
-uint8_t hp80_io_card_device::get_sc() const
+// +------------------------+
+// |device_hp80_io_interface|
+// +------------------------+
+uint8_t device_hp80_io_interface::get_sc() const
{
- return m_select_code_port->read() + HP80_IO_FIRST_SC;
+ return m_select_code_port->read();
}
-void hp80_io_card_device::inten()
+void device_hp80_io_interface::inten()
{
}
-void hp80_io_card_device::clear_service()
+void device_hp80_io_interface::clear_service()
{
}
-hp80_io_card_device::hp80_io_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, type, tag, owner, clock),
- device_slot_card_interface(mconfig, *this),
+device_hp80_io_interface::device_hp80_io_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "hp80io"),
m_select_code_port(*this , "SC")
{
}
-hp80_io_card_device::~hp80_io_card_device()
+device_hp80_io_interface::~device_hp80_io_interface()
{
}
-WRITE_LINE_MEMBER(hp80_io_card_device::irl_w)
+void device_hp80_io_interface::irl_w(int state)
{
- LOG("irl_w card=%d\n" , state);
- hp80_io_slot_device *slot = downcast<hp80_io_slot_device *>(owner());
+ if (VERBOSE & LOG_GENERAL) device().logerror("irl_w card=%d\n" , state);
+ hp80_io_slot_device *slot = downcast<hp80_io_slot_device *>(device().owner());
slot->irl_w(state);
}
-WRITE_LINE_MEMBER(hp80_io_card_device::halt_w)
+void device_hp80_io_interface::halt_w(int state)
{
- LOG("halt_w card=%d\n" , state);
- hp80_io_slot_device *slot = downcast<hp80_io_slot_device *>(owner());
+ if (VERBOSE & LOG_GENERAL) device().logerror("halt_w card=%d\n" , state);
+ hp80_io_slot_device *slot = downcast<hp80_io_slot_device *>(device().owner());
slot->halt_w(state);
}
+#include "82900.h"
#include "82937.h"
+#include "82939.h"
void hp80_io_slot_devices(device_slot_interface &device)
{
+ device.option_add("82900_cpm" , HP82900_IO_CARD);
device.option_add("82937_hpib" , HP82937_IO_CARD);
+ device.option_add("82939_serial" , HP82939_IO_CARD);
}