summaryrefslogtreecommitdiffstats
path: root/src/devices/bus/cbus
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/cbus')
-rw-r--r--src/devices/bus/cbus/pc9801_118.cpp4
-rw-r--r--src/devices/bus/cbus/pc9801_26.cpp4
-rw-r--r--src/devices/bus/cbus/pc9801_86.cpp30
-rw-r--r--src/devices/bus/cbus/pc9801_amd98.cpp16
-rw-r--r--src/devices/bus/cbus/pc9801_cbus.cpp11
-rw-r--r--src/devices/bus/cbus/pc9801_cbus.h106
6 files changed, 73 insertions, 98 deletions
diff --git a/src/devices/bus/cbus/pc9801_118.cpp b/src/devices/bus/cbus/pc9801_118.cpp
index a9271ecb0bf..96f0d0b4091 100644
--- a/src/devices/bus/cbus/pc9801_118.cpp
+++ b/src/devices/bus/cbus/pc9801_118.cpp
@@ -141,7 +141,7 @@ void pc9801_118_device::device_reset()
READ8_MEMBER(pc9801_118_device::opn3_r)
{
if(((offset & 5) == 0) || m_ext_reg)
- return m_opn3->read(offset >> 1);
+ return m_opn3->read(space, offset >> 1);
else // odd
{
//printf("PC9801-118: Read to undefined port [%02x]\n",offset+0x188);
@@ -153,7 +153,7 @@ READ8_MEMBER(pc9801_118_device::opn3_r)
WRITE8_MEMBER(pc9801_118_device::opn3_w)
{
if(((offset & 5) == 0) || m_ext_reg)
- m_opn3->write(offset >> 1,data);
+ m_opn3->write(space, offset >> 1,data);
//else // odd
// printf("PC9801-118: Write to undefined port [%02x] %02x\n",offset+0x188,data);
}
diff --git a/src/devices/bus/cbus/pc9801_26.cpp b/src/devices/bus/cbus/pc9801_26.cpp
index 603ea4a80b3..41141476483 100644
--- a/src/devices/bus/cbus/pc9801_26.cpp
+++ b/src/devices/bus/cbus/pc9801_26.cpp
@@ -146,7 +146,7 @@ READ8_MEMBER(pc9801_26_device::opn_r)
{
if((offset & 1) == 0)
{
- return offset & 4 ? 0xff : m_opn->read(offset >> 1);
+ return offset & 4 ? 0xff : m_opn->read(space, offset >> 1);
}
else // odd
{
@@ -159,7 +159,7 @@ READ8_MEMBER(pc9801_26_device::opn_r)
WRITE8_MEMBER(pc9801_26_device::opn_w)
{
if((offset & 5) == 0)
- m_opn->write(offset >> 1, data);
+ m_opn->write(space, offset >> 1, data);
else // odd
printf("PC9801-26: Write to undefined port [%02x] %02x\n",offset+0x188,data);
}
diff --git a/src/devices/bus/cbus/pc9801_86.cpp b/src/devices/bus/cbus/pc9801_86.cpp
index d9d6150a9fa..04c1feb4cf8 100644
--- a/src/devices/bus/cbus/pc9801_86.cpp
+++ b/src/devices/bus/cbus/pc9801_86.cpp
@@ -47,8 +47,7 @@ WRITE_LINE_MEMBER(pc9801_86_device::sound_irq)
// device_add_mconfig - add device configuration
//-------------------------------------------------
-void pc9801_86_device::pc9801_86_config(machine_config &config)
-{
+MACHINE_CONFIG_START(pc9801_86_device::pc9801_86_config)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
YM2608(config, m_opna, 7.987_MHz_XTAL);
@@ -63,19 +62,16 @@ void pc9801_86_device::pc9801_86_config(machine_config &config)
m_opna->add_route(1, "lspeaker", 1.00);
m_opna->add_route(2, "rspeaker", 1.00);
- DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_ldac, 0).add_route(ALL_OUTPUTS, "lspeaker", 1.0); // burr brown pcm61p
- DAC_16BIT_R2R_TWOS_COMPLEMENT(config, m_rdac, 0).add_route(ALL_OUTPUTS, "rspeaker", 1.0); // burr brown pcm61p
- voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
- vref.add_route(0, "ldac", 1.0, DAC_VREF_POS_INPUT);
- vref.add_route(0, "ldac", -1.0, DAC_VREF_NEG_INPUT);
- vref.add_route(0, "rdac", 1.0, DAC_VREF_POS_INPUT);
- vref.add_route(0, "rdac", -1.0, DAC_VREF_NEG_INPUT);
-}
+ MCFG_DEVICE_ADD("ldac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) // burr brown pcm61p
+ MCFG_DEVICE_ADD("rdac", DAC_16BIT_R2R_TWOS_COMPLEMENT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) // burr brown pcm61p
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE(0, "ldac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "ldac", -1.0, DAC_VREF_NEG_INPUT)
+ MCFG_SOUND_ROUTE(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
+MACHINE_CONFIG_END
-void pc9801_86_device::device_add_mconfig(machine_config &config)
-{
+MACHINE_CONFIG_START(pc9801_86_device::device_add_mconfig)
pc9801_86_config(config);
-}
+MACHINE_CONFIG_END
// to load a different bios for slots:
// -cbusX pc9801_86,bios=N
@@ -201,7 +197,7 @@ void pc9801_86_device::device_reset()
READ8_MEMBER(pc9801_86_device::opna_r)
{
if((offset & 1) == 0)
- return m_opna->read(offset >> 1);
+ return m_opna->read(space, offset >> 1);
else // odd
{
logerror("PC9801-86: Read to undefined port [%02x]\n",offset+0x188);
@@ -212,7 +208,7 @@ READ8_MEMBER(pc9801_86_device::opna_r)
WRITE8_MEMBER(pc9801_86_device::opna_w)
{
if((offset & 1) == 0)
- m_opna->write(offset >> 1,data);
+ m_opna->write(space, offset >> 1,data);
else // odd
logerror("PC9801-86: Write to undefined port [%02x] %02x\n",offset+0x188,data);
}
@@ -423,7 +419,7 @@ void pc9801_speakboard_device::device_reset()
READ8_MEMBER(pc9801_speakboard_device::opna_slave_r)
{
if((offset & 1) == 0)
- return m_opna_slave->read(offset >> 1);
+ return m_opna_slave->read(space, offset >> 1);
else // odd
{
logerror("PC9801-SPB: Read to undefined port [%02x]\n",offset+0x588);
@@ -434,7 +430,7 @@ READ8_MEMBER(pc9801_speakboard_device::opna_slave_r)
WRITE8_MEMBER(pc9801_speakboard_device::opna_slave_w)
{
if((offset & 1) == 0)
- m_opna_slave->write(offset >> 1,data);
+ m_opna_slave->write(space, offset >> 1,data);
else // odd
logerror("PC9801-SPB: Write to undefined port [%02x] %02x\n",offset+0x588,data);
}
diff --git a/src/devices/bus/cbus/pc9801_amd98.cpp b/src/devices/bus/cbus/pc9801_amd98.cpp
index ca7b32e7b4e..f7207aabd21 100644
--- a/src/devices/bus/cbus/pc9801_amd98.cpp
+++ b/src/devices/bus/cbus/pc9801_amd98.cpp
@@ -149,9 +149,9 @@ READ8_MEMBER(pc9801_amd98_device::read)
switch(offset)
{
case 2:
- return m_ay1->data_r();
+ return m_ay1->data_r(space,0);
case 3:
- return m_ay2->data_r();
+ return m_ay2->data_r(space,0);
}
printf("%02x\n",offset);
@@ -164,16 +164,16 @@ WRITE8_MEMBER(pc9801_amd98_device::write)
switch(offset)
{
case 0:
- m_ay1->address_w(data);
+ m_ay1->address_w(space,0,data);
break;
case 1:
- m_ay2->address_w(data);
+ m_ay2->address_w(space,0,data);
break;
case 2:
- m_ay1->data_w(data);
+ m_ay1->data_w(space,0,data);
break;
case 3:
- m_ay2->data_w(data);
+ m_ay2->data_w(space,0,data);
break;
default:
printf("%02x %02x\n",offset,data);
@@ -192,11 +192,11 @@ WRITE8_MEMBER(pc9801_amd98_device::ay3_data_latch_w)
{
case 0x47:
//printf("%02x addr\n",m_ay3_latch);
- m_ay3->address_w(m_ay3_latch);
+ m_ay3->address_w(space,0,m_ay3_latch);
break;
case 0x43:
//printf("%02x data\n",m_ay3_latch);
- m_ay3->data_w(m_ay3_latch);
+ m_ay3->data_w(space,0,m_ay3_latch);
break;
}
}
diff --git a/src/devices/bus/cbus/pc9801_cbus.cpp b/src/devices/bus/cbus/pc9801_cbus.cpp
index 5a53eddcce7..eb62af6daaa 100644
--- a/src/devices/bus/cbus/pc9801_cbus.cpp
+++ b/src/devices/bus/cbus/pc9801_cbus.cpp
@@ -55,8 +55,7 @@ device_pc9801cbus_card_interface::~device_pc9801cbus_card_interface()
pc9801_slot_device::pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PC9801CBUS_SLOT, tag, owner, clock),
device_slot_interface(mconfig, *this),
- m_memspace(*this, finder_base::DUMMY_TAG, -1),
- m_iospace(*this, finder_base::DUMMY_TAG, -1),
+ m_cpu(*this, finder_base::DUMMY_TAG),
m_int_callback{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
{
}
@@ -98,17 +97,17 @@ void pc9801_slot_device::device_start()
void pc9801_slot_device::install_io(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler)
{
- int buswidth = m_iospace->data_width();
+ int buswidth = this->io_space().data_width();
switch(buswidth)
{
case 8:
- m_iospace->install_readwrite_handler(start, end, rhandler, whandler, 0);
+ this->io_space().install_readwrite_handler(start, end, rhandler, whandler, 0);
break;
case 16:
- m_iospace->install_readwrite_handler(start, end, rhandler, whandler, 0xffff);
+ this->io_space().install_readwrite_handler(start, end, rhandler, whandler, 0xffff);
break;
case 32:
- m_iospace->install_readwrite_handler(start, end, rhandler, whandler, 0xffffffff);
+ this->io_space().install_readwrite_handler(start, end, rhandler, whandler, 0xffffffff);
break;
default:
fatalerror("PC-9801-26: Bus width %d not supported\n", buswidth);
diff --git a/src/devices/bus/cbus/pc9801_cbus.h b/src/devices/bus/cbus/pc9801_cbus.h
index e094693f06c..400cfa67d27 100644
--- a/src/devices/bus/cbus/pc9801_cbus.h
+++ b/src/devices/bus/cbus/pc9801_cbus.h
@@ -2,60 +2,6 @@
// copyright-holders:Angelo Salese
/**********************************************************************
- <B> <A>
- +------+
- GND |[ 01 ]| GND
- V1 |[ 02 ]| V1
- V2 |[ 03 ]| V2
- DB001 |[ 04 ]| AB001
- DB011 |[ 05 ]| AB011
- DB021 |[ 06 ]| AB021
- DB031 |[ 07 ]| AB031
- DB041 |[ 08 ]| AB041
- DB051 |[ 09 ]| AB051
- DB061 |[ 10 ]| AB061
- GND |[ 11 ]| GND
- DB071 |[ 12 ]| AB071
- DB081 |[ 13 ]| AB081
- DB091 |[ 14 ]| AB091
- DB101 |[ 15 ]| AB101
- DB111 |[ 16 ]| AB111
- DB121 |[ 17 ]| AB121
- DB131 |[ 18 ]| AB131
- DB141 |[ 19 ]| AB141
- DB151 |[ 20 ]| AB151
- GND |[ 21 ]| GND
- +12 V |[ 22 ]| AB161
- +12 V |[ 23 ]| AB171
- "INT0" IR31 |[ 24 ]| AB181
- "INT1" IR51 |[ 25 ]| AB191
- "INT2" IR61 |[ 26 ]| AB201
- "INT3" IR91 |[ 27 ]| AB211
- "INT4" IR101/IR111 |[ 28 ]| AB221
- "INT5" IR121 |[ 29 ]| AB231
- "INT6" IR131 |[ 30 ]| INT0
- GND |[ 31 ]| GND
- -12 V |[ 32 ]| IOCHK0
- -12 V |[ 33 ]| IOR0
- RESET0 |[ 34 ]| IOW0
- DACK00 |[ 35 ]| MRC0
- DACK30/DACK20 |[ 36 ]| MWC0
- DRQ00 |[ 37 ]| S00 (INTA0)
- DRQ30/DRQ20 |[ 38 ]| S10 (NOWAIT0)
- WORD0 |[ 39 ]| S20 (SALE1)
- (EXHRQ10) CPKILL0 |[ 40 ]| LOCK (MACS0)
- GND |[ 41 ]| GND
- (EXHLA10) RQGT0 |[ 42 ]| CPUENB10
- DMATC0 |[ 43 ]| RFSH0
- NMI0 |[ 44 ]| BHE0
- MWE0 |[ 45 ]| IORDY1
- (EXHLA20) HLDA00 |[ 46 ]| SCLK1
- (EXHRQ20) HRQ00 |[ 47 ]| S18CLK1 = 307.2 kHz
- (SUBSRQ1) DMAHLD0 |[ 48 ]| POWER0
- +5 V |[ 49 ]| +5 V
- +5 V |[ 50 ]| +5 V
- +------+
- <B> <A>
**********************************************************************/
#ifndef MAME_MACHINE_PC9801_CBUS_H
@@ -64,6 +10,43 @@
#pragma once
+
+
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
+
+
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_PC9801CBUS_CPU(_cputag) \
+ downcast<pc9801_slot_device &>(*device).set_cpu_tag(_cputag);
+
+#define MCFG_PC9801CBUS_INT0_CALLBACK(_devcb) \
+ downcast<pc9801_slot_device &>(*device).set_int_callback<0>(DEVCB_##_devcb);
+
+#define MCFG_PC9801CBUS_INT1_CALLBACK(_devcb) \
+ downcast<pc9801_slot_device &>(*device).set_int_callback<1>(DEVCB_##_devcb);
+
+#define MCFG_PC9801CBUS_INT2_CALLBACK(_devcb) \
+ downcast<pc9801_slot_device &>(*device).set_int_callback<2>(DEVCB_##_devcb);
+
+#define MCFG_PC9801CBUS_INT3_CALLBACK(_devcb) \
+ downcast<pc9801_slot_device &>(*device).set_int_callback<3>(DEVCB_##_devcb);
+
+#define MCFG_PC9801CBUS_INT4_CALLBACK(_devcb) \
+ downcast<pc9801_slot_device &>(*device).set_int_callback<4>(DEVCB_##_devcb);
+
+#define MCFG_PC9801CBUS_INT5_CALLBACK(_devcb) \
+ downcast<pc9801_slot_device &>(*device).set_int_callback<5>(DEVCB_##_devcb);
+
+#define MCFG_PC9801CBUS_INT6_CALLBACK(_devcb) \
+ downcast<pc9801_slot_device &>(*device).set_int_callback<6>(DEVCB_##_devcb);
+
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -91,10 +74,11 @@ class pc9801_slot_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
- template <typename T>
- pc9801_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ template <typename T, typename U>
+ pc9801_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&cpu_tag, U &&opts, char const *dflt)
: pc9801_slot_device(mconfig, tag, owner, (uint32_t)0)
{
+ m_cpu.set_tag(std::forward<T>(cpu_tag));
option_reset();
opts(*this);
set_default_option(dflt);
@@ -102,14 +86,11 @@ public:
}
pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <typename T> void set_memspace(T &&tag, int spacenum) { m_memspace.set_tag(std::forward<T>(tag), spacenum); }
- template <typename T> void set_iospace(T &&tag, int spacenum) { m_iospace.set_tag(std::forward<T>(tag), spacenum); }
-
// configuration access
template<std::size_t Line> auto int_cb() { return m_int_callback[Line].bind(); }
- address_space &program_space() const { return *m_memspace; }
- address_space &io_space() const { return *m_iospace; }
+ address_space &program_space() const { return m_cpu->space(AS_PROGRAM); }
+ address_space &io_space() const { return m_cpu->space(AS_IO); }
template<int I> void int_w(bool state) { m_int_callback[I](state); }
void install_io(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler);
@@ -121,8 +102,7 @@ protected:
private:
// device_pc9801_slot_card_interface *m_card;
- required_address_space m_memspace;
- required_address_space m_iospace;
+ required_device<cpu_device> m_cpu;
devcb_write_line m_int_callback[7];
};