diff options
author | andreasnaive <andreasnaive@gmail.com> | 2019-03-25 22:44:58 +0100 |
---|---|---|
committer | andreasnaive <andreasnaive@gmail.com> | 2019-03-25 22:44:58 +0100 |
commit | c24473ddff715ecec2e258a6eb38960cf8c8e98e (patch) | |
tree | 8ea44b6396a6129913c0aac13859b5de9965e972 /src/devices/bus/cbus | |
parent | 009cba4fb8102102168ef32870892438327f3705 (diff) | |
parent | 598cd5227223c3b04ca31f0dbc1981256d9ea3ff (diff) |
conflict resolution (nw)
Diffstat (limited to 'src/devices/bus/cbus')
-rw-r--r-- | src/devices/bus/cbus/pc9801_118.cpp | 4 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_26.cpp | 4 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_86.cpp | 30 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_amd98.cpp | 16 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_cbus.cpp | 11 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_cbus.h | 106 |
6 files changed, 98 insertions, 73 deletions
diff --git a/src/devices/bus/cbus/pc9801_118.cpp b/src/devices/bus/cbus/pc9801_118.cpp index 96f0d0b4091..a9271ecb0bf 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(space, offset >> 1); + return m_opn3->read(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(space, offset >> 1,data); + m_opn3->write(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 41141476483..603ea4a80b3 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(space, offset >> 1); + return offset & 4 ? 0xff : m_opn->read(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(space, offset >> 1, data); + m_opn->write(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 04c1feb4cf8..d9d6150a9fa 100644 --- a/src/devices/bus/cbus/pc9801_86.cpp +++ b/src/devices/bus/cbus/pc9801_86.cpp @@ -47,7 +47,8 @@ WRITE_LINE_MEMBER(pc9801_86_device::sound_irq) // device_add_mconfig - add device configuration //------------------------------------------------- -MACHINE_CONFIG_START(pc9801_86_device::pc9801_86_config) +void pc9801_86_device::pc9801_86_config(machine_config &config) +{ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); YM2608(config, m_opna, 7.987_MHz_XTAL); @@ -62,16 +63,19 @@ MACHINE_CONFIG_START(pc9801_86_device::pc9801_86_config) m_opna->add_route(1, "lspeaker", 1.00); m_opna->add_route(2, "rspeaker", 1.00); - 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 + 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); +} -MACHINE_CONFIG_START(pc9801_86_device::device_add_mconfig) +void pc9801_86_device::device_add_mconfig(machine_config &config) +{ pc9801_86_config(config); -MACHINE_CONFIG_END +} // to load a different bios for slots: // -cbusX pc9801_86,bios=N @@ -197,7 +201,7 @@ void pc9801_86_device::device_reset() READ8_MEMBER(pc9801_86_device::opna_r) { if((offset & 1) == 0) - return m_opna->read(space, offset >> 1); + return m_opna->read(offset >> 1); else // odd { logerror("PC9801-86: Read to undefined port [%02x]\n",offset+0x188); @@ -208,7 +212,7 @@ READ8_MEMBER(pc9801_86_device::opna_r) WRITE8_MEMBER(pc9801_86_device::opna_w) { if((offset & 1) == 0) - m_opna->write(space, offset >> 1,data); + m_opna->write(offset >> 1,data); else // odd logerror("PC9801-86: Write to undefined port [%02x] %02x\n",offset+0x188,data); } @@ -419,7 +423,7 @@ void pc9801_speakboard_device::device_reset() READ8_MEMBER(pc9801_speakboard_device::opna_slave_r) { if((offset & 1) == 0) - return m_opna_slave->read(space, offset >> 1); + return m_opna_slave->read(offset >> 1); else // odd { logerror("PC9801-SPB: Read to undefined port [%02x]\n",offset+0x588); @@ -430,7 +434,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(space, offset >> 1,data); + m_opna_slave->write(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 f7207aabd21..ca7b32e7b4e 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(space,0); + return m_ay1->data_r(); case 3: - return m_ay2->data_r(space,0); + return m_ay2->data_r(); } printf("%02x\n",offset); @@ -164,16 +164,16 @@ WRITE8_MEMBER(pc9801_amd98_device::write) switch(offset) { case 0: - m_ay1->address_w(space,0,data); + m_ay1->address_w(data); break; case 1: - m_ay2->address_w(space,0,data); + m_ay2->address_w(data); break; case 2: - m_ay1->data_w(space,0,data); + m_ay1->data_w(data); break; case 3: - m_ay2->data_w(space,0,data); + m_ay2->data_w(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(space,0,m_ay3_latch); + m_ay3->address_w(m_ay3_latch); break; case 0x43: //printf("%02x data\n",m_ay3_latch); - m_ay3->data_w(space,0,m_ay3_latch); + m_ay3->data_w(m_ay3_latch); break; } } diff --git a/src/devices/bus/cbus/pc9801_cbus.cpp b/src/devices/bus/cbus/pc9801_cbus.cpp index eb62af6daaa..5a53eddcce7 100644 --- a/src/devices/bus/cbus/pc9801_cbus.cpp +++ b/src/devices/bus/cbus/pc9801_cbus.cpp @@ -55,7 +55,8 @@ 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_cpu(*this, finder_base::DUMMY_TAG), + m_memspace(*this, finder_base::DUMMY_TAG, -1), + m_iospace(*this, finder_base::DUMMY_TAG, -1), m_int_callback{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}} { } @@ -97,17 +98,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 = this->io_space().data_width(); + int buswidth = m_iospace->data_width(); switch(buswidth) { case 8: - this->io_space().install_readwrite_handler(start, end, rhandler, whandler, 0); + m_iospace->install_readwrite_handler(start, end, rhandler, whandler, 0); break; case 16: - this->io_space().install_readwrite_handler(start, end, rhandler, whandler, 0xffff); + m_iospace->install_readwrite_handler(start, end, rhandler, whandler, 0xffff); break; case 32: - this->io_space().install_readwrite_handler(start, end, rhandler, whandler, 0xffffffff); + m_iospace->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 400cfa67d27..e094693f06c 100644 --- a/src/devices/bus/cbus/pc9801_cbus.h +++ b/src/devices/bus/cbus/pc9801_cbus.h @@ -2,6 +2,60 @@ // 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 @@ -10,43 +64,6 @@ #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 //************************************************************************** @@ -74,11 +91,10 @@ class pc9801_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - 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) + template <typename T> + pc9801_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&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); @@ -86,11 +102,14 @@ 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_cpu->space(AS_PROGRAM); } - address_space &io_space() const { return m_cpu->space(AS_IO); } + address_space &program_space() const { return *m_memspace; } + address_space &io_space() const { return *m_iospace; } 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); @@ -102,7 +121,8 @@ protected: private: // device_pc9801_slot_card_interface *m_card; - required_device<cpu_device> m_cpu; + required_address_space m_memspace; + required_address_space m_iospace; devcb_write_line m_int_callback[7]; }; |