diff options
Diffstat (limited to 'src/emu')
-rw-r--r-- | src/emu/bus/bus.mak | 20 | ||||
-rw-r--r-- | src/emu/bus/vip/byteio.c | 91 | ||||
-rw-r--r-- | src/emu/bus/vip/byteio.h | 136 | ||||
-rw-r--r-- | src/emu/bus/vip/exp.c | 211 | ||||
-rw-r--r-- | src/emu/bus/vip/exp.h | 174 | ||||
-rw-r--r-- | src/emu/bus/vip/vp550.c | 252 | ||||
-rw-r--r-- | src/emu/bus/vip/vp550.h | 69 | ||||
-rw-r--r-- | src/emu/bus/vip/vp570.c | 123 | ||||
-rw-r--r-- | src/emu/bus/vip/vp570.h | 57 | ||||
-rw-r--r-- | src/emu/bus/vip/vp575.c | 324 | ||||
-rw-r--r-- | src/emu/bus/vip/vp575.h | 97 | ||||
-rw-r--r-- | src/emu/bus/vip/vp585.c | 135 | ||||
-rw-r--r-- | src/emu/bus/vip/vp585.h | 59 | ||||
-rw-r--r-- | src/emu/bus/vip/vp590.c | 260 | ||||
-rw-r--r-- | src/emu/bus/vip/vp590.h | 74 | ||||
-rw-r--r-- | src/emu/bus/vip/vp595.c | 103 | ||||
-rw-r--r-- | src/emu/bus/vip/vp595.h | 56 | ||||
-rw-r--r-- | src/emu/bus/vip/vp620.c | 111 | ||||
-rw-r--r-- | src/emu/bus/vip/vp620.h | 60 | ||||
-rw-r--r-- | src/emu/bus/vip/vp700.c | 84 | ||||
-rw-r--r-- | src/emu/bus/vip/vp700.h | 55 | ||||
-rw-r--r-- | src/emu/emu.mak | 1 |
22 files changed, 2552 insertions, 0 deletions
diff --git a/src/emu/bus/bus.mak b/src/emu/bus/bus.mak index 7f6acb60f5e..192a0685def 100644 --- a/src/emu/bus/bus.mak +++ b/src/emu/bus/bus.mak @@ -217,6 +217,26 @@ endif #------------------------------------------------- # +#@src/emu/bus/vip/byteio.h,BUSES += VIP +#@src/emu/bus/vip/exp.h,BUSES += VIP +#------------------------------------------------- + +ifneq ($(filter VIP,$(BUSES)),) +BUSOBJS += $(BUSOBJ)/vip/byteio.o +BUSOBJS += $(BUSOBJ)/vip/vp620.o +BUSOBJS += $(BUSOBJ)/vip/exp.o +BUSOBJS += $(BUSOBJ)/vip/vp550.o +BUSOBJS += $(BUSOBJ)/vip/vp570.o +BUSOBJS += $(BUSOBJ)/vip/vp575.o +BUSOBJS += $(BUSOBJ)/vip/vp585.o +BUSOBJS += $(BUSOBJ)/vip/vp590.o +BUSOBJS += $(BUSOBJ)/vip/vp595.o +BUSOBJS += $(BUSOBJ)/vip/vp700.o +endif + + +#------------------------------------------------- +# #@src/emu/bus/wangpc/wangpc.h,BUSES += WANGPC #------------------------------------------------- diff --git a/src/emu/bus/vip/byteio.c b/src/emu/bus/vip/byteio.c new file mode 100644 index 00000000000..5410cd8c9be --- /dev/null +++ b/src/emu/bus/vip/byteio.c @@ -0,0 +1,91 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA Cosmac VIP Byte Input/Output port emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "byteio.h" + + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +const device_type VIP_BYTEIO_PORT = &device_creator<vip_byteio_port_device>; + + + +//************************************************************************** +// CARD INTERFACE +//************************************************************************** + +//------------------------------------------------- +// device_vip_byteio_port_interface - constructor +//------------------------------------------------- + +device_vip_byteio_port_interface::device_vip_byteio_port_interface(const machine_config &mconfig, device_t &device) + : device_slot_card_interface(mconfig,device) +{ + m_slot = dynamic_cast<vip_byteio_port_device *>(device.owner()); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// vip_byteio_port_device - constructor +//------------------------------------------------- + +vip_byteio_port_device::vip_byteio_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, VIP_BYTEIO_PORT, "VIP byte I/O port", tag, owner, clock, "vip_byteio_port", __FILE__), + device_slot_interface(mconfig, *this), + m_write_inst(*this) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void vip_byteio_port_device::device_start() +{ + m_cart = dynamic_cast<device_vip_byteio_port_interface *>(get_card_device()); + + // resolve callbacks + m_write_inst.resolve_safe(); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void vip_byteio_port_device::device_reset() +{ +} + + +UINT8 vip_byteio_port_device::in_r() { UINT8 data = 0xff; if (m_cart != NULL) data = m_cart->vip_in_r(); return data; } +void vip_byteio_port_device::out_w(UINT8 data) { if (m_cart != NULL) m_cart->vip_out_w(data); } +READ_LINE_MEMBER( vip_byteio_port_device::ef3_r ) { int state = CLEAR_LINE; if (m_cart != NULL) state = m_cart->vip_ef3_r(); return state; } +READ_LINE_MEMBER( vip_byteio_port_device::ef4_r ) { int state = CLEAR_LINE; if (m_cart != NULL) state = m_cart->vip_ef4_r(); return state; } +WRITE_LINE_MEMBER( vip_byteio_port_device::q_w ) { if (m_cart != NULL) m_cart->vip_q_w(state); } + + +//------------------------------------------------- +// SLOT_INTERFACE( vip_byteio_cards ) +//------------------------------------------------- + +SLOT_INTERFACE_START( vip_byteio_cards ) + //SLOT_INTERFACE("exp2", VP576_BYTEIO) + SLOT_INTERFACE("ascii", VP620) +SLOT_INTERFACE_END diff --git a/src/emu/bus/vip/byteio.h b/src/emu/bus/vip/byteio.h new file mode 100644 index 00000000000..4fa9423f192 --- /dev/null +++ b/src/emu/bus/vip/byteio.h @@ -0,0 +1,136 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA Cosmac VIP Byte Input/Output port emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +********************************************************************** + + A IN 0 + B IN 1 + C IN 2 + D IN 3 + E IN 4 + F IN 5 + H IN 6 + J IN 7 + K INST + L _EF4 + M OUT 0 + N OUT 1 + P OUT 2 + R OUT 3 + S OUT 4 + T OUT 5 + U OUT 6 + V OUT 7 + W Q + X _EF3 + Y +5 V + Z GND + +**********************************************************************/ + +#pragma once + +#ifndef __VIP_BYTEIO_PORT__ +#define __VIP_BYTEIO_PORT__ + +#include "emu.h" + + + +//************************************************************************** +// CONSTANTS +//************************************************************************** + +#define VIP_BYTEIO_PORT_TAG "byteio" + + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_VIP_BYTEIO_PORT_ADD(_tag, _slot_intf, _def_slot, _inst) \ + MCFG_DEVICE_ADD(_tag, VIP_BYTEIO_PORT, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ + downcast<vip_byteio_port_device *>(device)->set_inst_callback(DEVCB2_##_inst); + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> vip_byteio_port_device + +class device_vip_byteio_port_interface; + +class vip_byteio_port_device : public device_t, + public device_slot_interface +{ +public: + // construction/destruction + vip_byteio_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + template<class _inst> void set_inst_callback(_inst inst) { m_write_inst.set_callback(inst); } + + // computer interface + UINT8 in_r(); + void out_w(UINT8 data); + DECLARE_READ_LINE_MEMBER( ef3_r ); + DECLARE_READ_LINE_MEMBER( ef4_r ); + DECLARE_WRITE_LINE_MEMBER( q_w ); + + // cartridge interface + DECLARE_WRITE_LINE_MEMBER( inst_w ) { m_write_inst(state); } + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + + devcb2_write_line m_write_inst; + + device_vip_byteio_port_interface *m_cart; +}; + + +// ======================> device_vip_byteio_port_interface + +// class representing interface-specific live c64_expansion card +class device_vip_byteio_port_interface : public device_slot_card_interface +{ +public: + // construction/destruction + device_vip_byteio_port_interface(const machine_config &mconfig, device_t &device); + + virtual UINT8 vip_in_r() { return 0xff; }; + virtual void vip_out_w(UINT8 data) { }; + + virtual int vip_ef3_r() { return CLEAR_LINE; } + virtual int vip_ef4_r() { return CLEAR_LINE; } + + virtual void vip_q_w(int state) { }; + +protected: + vip_byteio_port_device *m_slot; +}; + + +// device type definition +extern const device_type VIP_BYTEIO_PORT; + + +// slot devices +#include "vp620.h" + +SLOT_INTERFACE_EXTERN( vip_byteio_cards ); + + + +#endif diff --git a/src/emu/bus/vip/exp.c b/src/emu/bus/vip/exp.c new file mode 100644 index 00000000000..511dd0814e0 --- /dev/null +++ b/src/emu/bus/vip/exp.c @@ -0,0 +1,211 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA Cosmac VIP Expansion Interface emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "exp.h" + + + +//************************************************************************** +// MACROS/CONSTANTS +//************************************************************************** + +#define LOG 0 + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type VIP_EXPANSION_SLOT = &device_creator<vip_expansion_slot_device>; + + + +//************************************************************************** +// DEVICE VIP_EXPANSION CARD INTERFACE +//************************************************************************** + +//------------------------------------------------- +// device_vip_expansion_card_interface - constructor +//------------------------------------------------- + +device_vip_expansion_card_interface::device_vip_expansion_card_interface(const machine_config &mconfig, device_t &device) + : device_slot_card_interface(mconfig, device) +{ + m_slot = dynamic_cast<vip_expansion_slot_device *>(device.owner()); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// vip_expansion_slot_device - constructor +//------------------------------------------------- + +vip_expansion_slot_device::vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, VIP_EXPANSION_SLOT, "VIP expansion port", tag, owner, clock, "vip_expansion_slot", __FILE__), + device_slot_interface(mconfig, *this), + m_write_irq(*this), + m_write_dma_out(*this), + m_write_dma_in(*this) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void vip_expansion_slot_device::device_start() +{ + m_card = dynamic_cast<device_vip_expansion_card_interface *>(get_card_device()); + + // resolve callbacks + m_write_irq.resolve_safe(); + m_write_dma_out.resolve_safe(); + m_write_dma_in.resolve_safe(); +} + + +//------------------------------------------------- +// program_r - program read +//------------------------------------------------- + +UINT8 vip_expansion_slot_device::program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) +{ + UINT8 data = 0; + + if (m_card != NULL) + { + data = m_card->vip_program_r(space, offset, cs, cdef, minh); + } + + return data; +} + + +//------------------------------------------------- +// program_w - program write +//------------------------------------------------- + +void vip_expansion_slot_device::program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) +{ + if (m_card != NULL) + { + m_card->vip_program_w(space, offset, data, cdef, minh); + } +} + + +//------------------------------------------------- +// io_r - io read +//------------------------------------------------- + +UINT8 vip_expansion_slot_device::io_r(address_space &space, offs_t offset) +{ + UINT8 data = 0; + + if (m_card != NULL) + { + data = m_card->vip_io_r(space, offset); + } + + return data; +} + + +//------------------------------------------------- +// io_w - io write +//------------------------------------------------- + +void vip_expansion_slot_device::io_w(address_space &space, offs_t offset, UINT8 data) +{ + if (m_card != NULL) + { + m_card->vip_io_w(space, offset, data); + } +} + + +//------------------------------------------------- +// dma_r - dma read +//------------------------------------------------- + +UINT8 vip_expansion_slot_device::dma_r(address_space &space, offs_t offset) +{ + UINT8 data = 0; + + if (m_card != NULL) + { + data = m_card->vip_dma_r(space, offset); + } + + return data; +} + + +//------------------------------------------------- +// dma_w - dma write +//------------------------------------------------- + +void vip_expansion_slot_device::dma_w(address_space &space, offs_t offset, UINT8 data) +{ + if (m_card != NULL) + { + m_card->vip_dma_w(space, offset, data); + } +} + + +//------------------------------------------------- +// screen_update - +//------------------------------------------------- + +UINT32 vip_expansion_slot_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + bool value = false; + + if (m_card != NULL) + { + value = m_card->vip_screen_update(screen, bitmap, cliprect); + } + + return value; +} + +READ_LINE_MEMBER( vip_expansion_slot_device::ef1_r ) { int state = CLEAR_LINE; if (m_card != NULL) state = m_card->vip_ef1_r(); return state; } +READ_LINE_MEMBER( vip_expansion_slot_device::ef3_r ) { int state = CLEAR_LINE; if (m_card != NULL) state = m_card->vip_ef3_r(); return state; } +READ_LINE_MEMBER( vip_expansion_slot_device::ef4_r ) { int state = CLEAR_LINE; if (m_card != NULL) state = m_card->vip_ef4_r(); return state; } +void vip_expansion_slot_device::sc_w(int data) { if (m_card != NULL) m_card->vip_sc_w(data); } +WRITE_LINE_MEMBER( vip_expansion_slot_device::q_w ) { if (m_card != NULL) m_card->vip_q_w(state); } +WRITE_LINE_MEMBER( vip_expansion_slot_device::run_w ) { if (m_card != NULL) m_card->vip_run_w(state); } + + + +//------------------------------------------------- +// SLOT_INTERFACE vip_expansion_cards ) +//------------------------------------------------- + +SLOT_INTERFACE_START( vip_expansion_cards ) + SLOT_INTERFACE("super", VP550) + //SLOT_INTERFACE("eprom", VP560) + //SLOT_INTERFACE("eprommer", VP565) + SLOT_INTERFACE("ram", VP570) + SLOT_INTERFACE("exp", VP575) + //SLOT_INTERFACE("exp2", VP576_EXP) + SLOT_INTERFACE("keypad", VP585) + SLOT_INTERFACE("color", VP590) + SLOT_INTERFACE("simple", VP595) + SLOT_INTERFACE("basic", VP700) +SLOT_INTERFACE_END diff --git a/src/emu/bus/vip/exp.h b/src/emu/bus/vip/exp.h new file mode 100644 index 00000000000..c4f95fc62d8 --- /dev/null +++ b/src/emu/bus/vip/exp.h @@ -0,0 +1,174 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA Cosmac VIP Expansion Interface emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +********************************************************************** + + CLOCK 1 A _MWR + _EF4 2 B TPA + _EF3 3 C MA0 + XTAL 4 D MA1 + _EF1 5 E MA2 + N0 6 F MA3 + N1 7 H MA4 + N2 8 J MA5 + SPOT 9 K MA6 + _SYNC 10 L MA7 + TPB 11 M BUS 0 + SC0 12 N BUS 1 + _INTERRUPT 13 P BUS 2 + SC1 14 R BUS 3 + _DMA-OUT 15 S BUS 4 + Q 16 T BUS 5 + _DMA-IN 17 U BUS 6 + RUN 18 V BUS 7 + MINH 19 W _MRD + _CDEF 20 X CS + +5 V 21 Y +5 V + GND 22 Z GND + +**********************************************************************/ + +#pragma once + +#ifndef __VIP_EXPANSION_SLOT__ +#define __VIP_EXPANSION_SLOT__ + +#include "emu.h" + + + +//************************************************************************** +// CONSTANTS +//************************************************************************** + +#define VIP_EXPANSION_SLOT_TAG "exp" + + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_VIP_EXPANSION_SLOT_ADD(_tag, _clock, _slot_intf, _def_slot) \ + MCFG_DEVICE_ADD(_tag, VIP_EXPANSION_SLOT, _clock) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) + +#define MCFG_VIP_EXPANSION_SLOT_CALLBACKS(_irq, _dma_out, _dma_in) \ + downcast<vip_expansion_slot_device *>(device)->set_irq_callback(DEVCB2_##_irq); \ + downcast<vip_expansion_slot_device *>(device)->set_dma_out_callback(DEVCB2_##_dma_out); \ + downcast<vip_expansion_slot_device *>(device)->set_dma_in_callback(DEVCB2_##_dma_in); + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> vip_expansion_slot_device + +class device_vip_expansion_card_interface; + +class vip_expansion_slot_device : public device_t, + public device_slot_interface +{ +public: + // construction/destruction + vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + template<class _irq> void set_irq_callback(_irq irq) { m_write_irq.set_callback(irq); } + template<class _dma_out> void set_dma_out_callback(_dma_out dma_out) { m_write_dma_out.set_callback(dma_out); } + template<class _dma_in> void set_dma_in_callback(_dma_in dma_in) { m_write_dma_in.set_callback(dma_in); } + + // computer interface + UINT8 program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh); + void program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh); + UINT8 io_r(address_space &space, offs_t offset); + void io_w(address_space &space, offs_t offset, UINT8 data); + UINT8 dma_r(address_space &space, offs_t offset); + void dma_w(address_space &space, offs_t offset, UINT8 data); + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + DECLARE_READ_LINE_MEMBER( ef1_r ); + DECLARE_READ_LINE_MEMBER( ef3_r ); + DECLARE_READ_LINE_MEMBER( ef4_r ); + void sc_w(int data); + DECLARE_WRITE_LINE_MEMBER( q_w ); + DECLARE_WRITE_LINE_MEMBER( run_w ); + + // cartridge interface + DECLARE_WRITE_LINE_MEMBER( interrupt_w ) { m_write_irq(state); } + DECLARE_WRITE_LINE_MEMBER( dma_out_w ) { m_write_dma_out(state); } + DECLARE_WRITE_LINE_MEMBER( dma_in_w ) { m_write_dma_in(state); } + +protected: + // device-level overrides + virtual void device_start(); + + devcb2_write_line m_write_irq; + devcb2_write_line m_write_dma_out; + devcb2_write_line m_write_dma_in; + + device_vip_expansion_card_interface *m_card; +}; + + +// ======================> device_vip_expansion_card_interface + +class device_vip_expansion_card_interface : public device_slot_card_interface +{ + friend class vip_expansion_slot_device; + +public: + // construction/destruction + device_vip_expansion_card_interface(const machine_config &mconfig, device_t &device); + +protected: + // runtime + virtual UINT8 vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) { return 0xff; }; + virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) { }; + + virtual UINT8 vip_io_r(address_space &space, offs_t offset) { return 0xff; }; + virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data) { }; + + virtual UINT8 vip_dma_r(address_space &space, offs_t offset) { return 0xff; }; + virtual void vip_dma_w(address_space &space, offs_t offset, UINT8 data) { }; + + virtual UINT32 vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } + + virtual int vip_ef1_r() { return CLEAR_LINE; } + virtual int vip_ef3_r() { return CLEAR_LINE; } + virtual int vip_ef4_r() { return CLEAR_LINE; } + + virtual void vip_sc_w(int data) { }; + + virtual void vip_q_w(int state) { }; + + virtual void vip_run_w(int state) { }; + + vip_expansion_slot_device *m_slot; +}; + + +// device type definition +extern const device_type VIP_EXPANSION_SLOT; + + +// slot devices +#include "vp550.h" +#include "vp570.h" +#include "vp575.h" +#include "vp585.h" +#include "vp590.h" +#include "vp595.h" +#include "vp700.h" + +SLOT_INTERFACE_EXTERN( vip_expansion_cards ); + + + +#endif diff --git a/src/emu/bus/vip/vp550.c b/src/emu/bus/vip/vp550.c new file mode 100644 index 00000000000..6108c6d93d6 --- /dev/null +++ b/src/emu/bus/vip/vp550.c @@ -0,0 +1,252 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Super Sound System VP550 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +/* + + TODO: + + - VP551 + +*/ + +#include "vp550.h" + + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define LOG 0 + + +#define CDP1863_A_TAG "u1" +#define CDP1863_B_TAG "u2" + + +enum +{ + CHANNEL_A = 0, + CHANNEL_B +}; + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type VP550 = &device_creator<vp550_device>; + + +//------------------------------------------------- +// MACHINE_CONFIG_FRAGMENT( vp550 ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( vp550 ) + MCFG_SPEAKER_STANDARD_MONO("mono") + + MCFG_CDP1863_ADD(CDP1863_A_TAG, 0, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) + + MCFG_CDP1863_ADD(CDP1863_B_TAG, 0, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) +MACHINE_CONFIG_END + + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor vp550_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( vp550 ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// vp550_device - constructor +//------------------------------------------------- + +vp550_device::vp550_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, VP550, "VP550", tag, owner, clock, "vp550", __FILE__), + device_vip_expansion_card_interface(mconfig, *this), + m_pfg_a(*this, CDP1863_A_TAG), + m_pfg_b(*this, CDP1863_B_TAG) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void vp550_device::device_start() +{ + // allocate timers + m_sync_timer = timer_alloc(); + m_sync_timer->adjust(attotime::from_hz(50), 0, attotime::from_hz(50)); + m_sync_timer->enable(0); +} + + +//------------------------------------------------- +// device_timer - handler timer events +//------------------------------------------------- + +void vp550_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + if (LOG) logerror("VP550 '%s' Interrupt\n", tag()); + + m_slot->interrupt_w(ASSERT_LINE); +} + + +//------------------------------------------------- +// vip_program_w - program write +//------------------------------------------------- + +void vp550_device::vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) +{ + if (BIT(offset, 15)) + { + *minh = 1; + + switch (offset & 0x03) + { + case 1: m_pfg_a->str_w(data); break; + case 2: m_pfg_b->str_w(data); break; + case 3: octave_w(space, offset, data); break; + } + + switch ((offset >> 4) & 0x03) + { + case 1: vlmna_w(space, offset, data); break; + case 2: vlmnb_w(space, offset, data); break; + case 3: sync_w(space, offset, data); break; + } + } +} + + +//------------------------------------------------- +// vip_sc_w - status code write +//------------------------------------------------- + +void vp550_device::vip_sc_w(int data) +{ + if (BIT(data, 1)) + { + if (LOG) logerror("VP550 '%s' Clear Interrupt\n", tag()); + + m_slot->interrupt_w(CLEAR_LINE); + } +} + + +//------------------------------------------------- +// vip_q_w - Q write +//------------------------------------------------- + +void vp550_device::vip_q_w(int state) +{ + m_pfg_a->oe_w(state); + m_pfg_b->oe_w(state); +} + + +//------------------------------------------------- +// vip_run_w - RUN write +//------------------------------------------------- + +void vp550_device::vip_run_w(int state) +{ + if (!state) + { + m_pfg_a->reset(); + m_pfg_b->reset(); + } +} + + +//------------------------------------------------- +// octave_w - octave select write +//------------------------------------------------- + +WRITE8_MEMBER( vp550_device::octave_w ) +{ + int channel = (data >> 2) & 0x03; + int clock2 = 0; + + if (data & 0x10) + { + switch (data & 0x03) + { + case 0: clock2 = m_slot->clock() / 8; break; + case 1: clock2 = m_slot->clock() / 4; break; + case 2: clock2 = m_slot->clock() / 2; break; + case 3: clock2 = m_slot->clock(); break; + } + } + + switch (channel) + { + case CHANNEL_A: m_pfg_a->set_clk2(clock2); break; + case CHANNEL_B: m_pfg_b->set_clk2(clock2); break; + } + + if (LOG) logerror("VP550 '%s' Clock %c: %u Hz\n", tag(), 'A' + channel, clock2); +} + + +//------------------------------------------------- +// vlmna_w - channel A amplitude write +//------------------------------------------------- + +WRITE8_MEMBER( vp550_device::vlmna_w ) +{ + if (LOG) logerror("VP550 '%s' A Volume: %u\n", tag(), data & 0x0f); + + float gain = (data & 0x0f) * 0.0666; + + m_pfg_a->set_output_gain(0, gain); +} + + +//------------------------------------------------- +// vlmnb_w - channel B amplitude write +//------------------------------------------------- + +WRITE8_MEMBER( vp550_device::vlmnb_w ) +{ + if (LOG) logerror("VP550 '%s' B Volume: %u\n", tag(), data & 0x0f); + + float gain = (data & 0x0f) * 0.0666; + + m_pfg_b->set_output_gain(0, gain); +} + + +//------------------------------------------------- +// sync_w - interrupt enable write +//------------------------------------------------- + +WRITE8_MEMBER( vp550_device::sync_w ) +{ + if (LOG) logerror("VP550 '%s' Interrupt Enable: %u\n", tag(), BIT(data, 0)); + + m_sync_timer->enable(BIT(data, 0)); +} diff --git a/src/emu/bus/vip/vp550.h b/src/emu/bus/vip/vp550.h new file mode 100644 index 00000000000..c4de33993e8 --- /dev/null +++ b/src/emu/bus/vip/vp550.h @@ -0,0 +1,69 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Super Sound System VP550 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __VP550__ +#define __VP550__ + +#include "emu.h" +#include "exp.h" +#include "sound/cdp1863.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> vp550_device + +class vp550_device : public device_t, + public device_vip_expansion_card_interface +{ +public: + // construction/destruction + vp550_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + + // not really public + DECLARE_WRITE8_MEMBER( octave_w ); + DECLARE_WRITE8_MEMBER( vlmna_w ); + DECLARE_WRITE8_MEMBER( vlmnb_w ); + DECLARE_WRITE8_MEMBER( sync_w ); + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + + // device_vip_expansion_card_interface overrides + virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh); + virtual void vip_sc_w(int data); + virtual void vip_q_w(int state); + virtual void vip_run_w(int state); + +private: + required_device<cdp1863_device> m_pfg_a; + required_device<cdp1863_device> m_pfg_b; + + // timers + emu_timer *m_sync_timer; +}; + + +// device type definition +extern const device_type VP550; + + +#endif diff --git a/src/emu/bus/vip/vp570.c b/src/emu/bus/vip/vp570.c new file mode 100644 index 00000000000..2f357ad14d9 --- /dev/null +++ b/src/emu/bus/vip/vp570.c @@ -0,0 +1,123 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Expansion Board VP-570 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "vp570.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type VP570 = &device_creator<vp570_device>; + + +//------------------------------------------------- +// INPUT_PORTS( vp570 ) +//------------------------------------------------- + +static INPUT_PORTS_START( vp570 ) + PORT_START("BASE") + PORT_DIPNAME( 0x07, 0x01, "Address Range" ) + PORT_DIPSETTING( 0x00, "0000 thru 0FFF" ) + PORT_DIPSETTING( 0x01, "1000 thru 1FFF" ) + PORT_DIPSETTING( 0x02, "2000 thru 2FFF" ) + PORT_DIPSETTING( 0x03, "3000 thru 3FFF" ) + PORT_DIPSETTING( 0x04, "4000 thru 4FFF" ) + PORT_DIPSETTING( 0x05, "5000 thru 50FFF" ) + PORT_DIPSETTING( 0x06, "6000 thru 6FFF" ) + PORT_DIPSETTING( 0x07, "7000 thru 7FFF" ) + + PORT_START("SW1") + PORT_DIPNAME( 0x01, 0x01, "Write Protect" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor vp570_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( vp570 ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// vp570_device - constructor +//------------------------------------------------- + +vp570_device::vp570_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, VP570, "VP570", tag, owner, clock, "vp570", __FILE__), + device_vip_expansion_card_interface(mconfig, *this), + m_ram(*this, "ram"), + m_base(*this, "BASE"), + m_sw1(*this, "SW1") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void vp570_device::device_start() +{ + m_ram.allocate(0x1000); +} + + +//------------------------------------------------- +// vip_program_r - program read +//------------------------------------------------- + +UINT8 vp570_device::vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) +{ + UINT8 data = 0xff; + + offs_t base = m_base->read() << 12; + + if (offset >= base && offset < base + 0x1000) + { + *minh = 1; + + data = m_ram[offset & 0xfff]; + } + + return data; +} + + +//------------------------------------------------- +// vip_program_w - program write +//------------------------------------------------- + +void vp570_device::vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) +{ + offs_t base = m_base->read() << 12; + + if (offset >= base && offset < base + 0x1000) + { + *minh = 1; + + if (m_sw1->read()) + { + m_ram[offset & 0xfff] = data; + } + } +} diff --git a/src/emu/bus/vip/vp570.h b/src/emu/bus/vip/vp570.h new file mode 100644 index 00000000000..23b0d047384 --- /dev/null +++ b/src/emu/bus/vip/vp570.h @@ -0,0 +1,57 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Memory Expansion Board VP-570 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __VP570__ +#define __VP570__ + +#include "emu.h" +#include "exp.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> vp570_device + +class vp570_device : public device_t, + public device_vip_expansion_card_interface +{ +public: + // construction/destruction + vp570_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual ioport_constructor device_input_ports() const; + +protected: + // device-level overrides + virtual void device_start(); + + // device_vip_expansion_card_interface overrides + virtual UINT8 vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh); + virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh); + +private: + optional_shared_ptr<UINT8> m_ram; + required_ioport m_base; + required_ioport m_sw1; +}; + + +// device type definition +extern const device_type VP570; + + +#endif diff --git a/src/emu/bus/vip/vp575.c b/src/emu/bus/vip/vp575.c new file mode 100644 index 00000000000..8e959369239 --- /dev/null +++ b/src/emu/bus/vip/vp575.c @@ -0,0 +1,324 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Expansion Board VP-575 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "vp575.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type VP575 = &device_creator<vp575_device>; + + +//------------------------------------------------- +// VIP_EXPANSION_INTERFACE( expansion_intf ) +//------------------------------------------------- + +void vp575_device::update_interrupts() +{ + int interrupt = CLEAR_LINE; + int dma_out = CLEAR_LINE; + int dma_in = CLEAR_LINE; + + for (int i = 0; i < MAX_SLOTS; i++) + { + interrupt |= m_int[i]; + dma_out |= m_dma_out[i]; + dma_in |= m_dma_in[i]; + } + + m_slot->interrupt_w(interrupt); + m_slot->dma_out_w(dma_out); + m_slot->dma_in_w(dma_in); +} + +WRITE_LINE_MEMBER( vp575_device::exp1_int_w ) { m_int[0] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp2_int_w ) { m_int[1] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp3_int_w ) { m_int[2] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp4_int_w ) { m_int[3] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp5_int_w ) { m_int[4] = state; update_interrupts(); } + +WRITE_LINE_MEMBER( vp575_device::exp1_dma_out_w ) { m_dma_out[0] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp2_dma_out_w ) { m_dma_out[1] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp3_dma_out_w ) { m_dma_out[2] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp4_dma_out_w ) { m_dma_out[3] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp5_dma_out_w ) { m_dma_out[4] = state; update_interrupts(); } + +WRITE_LINE_MEMBER( vp575_device::exp1_dma_in_w ) { m_dma_in[0] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp2_dma_in_w ) { m_dma_in[1] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp3_dma_in_w ) { m_dma_in[2] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp4_dma_in_w ) { m_dma_in[3] = state; update_interrupts(); } +WRITE_LINE_MEMBER( vp575_device::exp5_dma_in_w ) { m_dma_in[4] = state; update_interrupts(); } + + +//------------------------------------------------- +// MACHINE_CONFIG_FRAGMENT( vp575 ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( vp575 ) + MCFG_VIP_EXPANSION_SLOT_ADD("exp1", XTAL_3_52128MHz/2, vip_expansion_cards, NULL) + MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_in_w)) + MCFG_VIP_EXPANSION_SLOT_ADD("exp2", XTAL_3_52128MHz/2, vip_expansion_cards, NULL) + MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_in_w)) + MCFG_VIP_EXPANSION_SLOT_ADD("exp3", XTAL_3_52128MHz/2, vip_expansion_cards, NULL) + MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_in_w)) + MCFG_VIP_EXPANSION_SLOT_ADD("exp4", XTAL_3_52128MHz/2, vip_expansion_cards, NULL) + MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_in_w)) + MCFG_VIP_EXPANSION_SLOT_ADD("exp5", XTAL_3_52128MHz/2, vip_expansion_cards, NULL) + MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_in_w)) +MACHINE_CONFIG_END + + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor vp575_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( vp575 ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// vp575_device - constructor +//------------------------------------------------- + +vp575_device::vp575_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, VP575, "VP575", tag, owner, clock, "vp575", __FILE__), + device_vip_expansion_card_interface(mconfig, *this) +{ + for (int i = 0; i < MAX_SLOTS; i++) + { + m_int[i] = CLEAR_LINE; + m_dma_out[i] = CLEAR_LINE; + m_dma_in[i] = CLEAR_LINE; + } +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void vp575_device::device_start() +{ + // find devices + m_expansion_slot[0] = dynamic_cast<vip_expansion_slot_device *>(subdevice("exp1")); + m_expansion_slot[1] = dynamic_cast<vip_expansion_slot_device *>(subdevice("exp2")); + m_expansion_slot[2] = dynamic_cast<vip_expansion_slot_device *>(subdevice("exp3")); + m_expansion_slot[3] = dynamic_cast<vip_expansion_slot_device *>(subdevice("exp4")); + m_expansion_slot[4] = dynamic_cast<vip_expansion_slot_device *>(subdevice("exp5")); +} + + +//------------------------------------------------- +// vip_program_r - program read +//------------------------------------------------- + +UINT8 vp575_device::vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) +{ + UINT8 data = 0xff; + + for (int i = 0; i < MAX_SLOTS; i++) + { + data &= m_expansion_slot[i]->program_r(space, offset, cs, cdef, minh); + } + + return data; +} + + +//------------------------------------------------- +// vip_program_w - program write +//------------------------------------------------- + +void vp575_device::vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) +{ + for (int i = 0; i < MAX_SLOTS; i++) + { + m_expansion_slot[i]->program_w(space, offset, data, cdef, minh); + } +} + + +//------------------------------------------------- +// vip_io_r - I/O read +//------------------------------------------------- + +UINT8 vp575_device::vip_io_r(address_space &space, offs_t offset) +{ + UINT8 data = 0xff; + + for (int i = 0; i < MAX_SLOTS; i++) + { + data &= m_expansion_slot[i]->io_r(space, offset); + } + + return data; +} + + +//------------------------------------------------- +// vip_io_w - I/O write +//------------------------------------------------- + +void vp575_device::vip_io_w(address_space &space, offs_t offset, UINT8 data) +{ + for (int i = 0; i < MAX_SLOTS; i++) + { + m_expansion_slot[i]->io_w(space, offset, data); + } +} + + +//------------------------------------------------- +// vip_dma_r - DMA read +//------------------------------------------------- + +UINT8 vp575_device::vip_dma_r(address_space &space, offs_t offset) +{ + UINT8 data = 0xff; + + for (int i = 0; i < MAX_SLOTS; i++) + { + data &= m_expansion_slot[i]->dma_r(space, offset); + } + + return data; +} + + +//------------------------------------------------- +// vip_dma_w - DMA write +//------------------------------------------------- + +void vp575_device::vip_dma_w(address_space &space, offs_t offset, UINT8 data) +{ + for (int i = 0; i < MAX_SLOTS; i++) + { + m_expansion_slot[i]->dma_w(space, offset, data); + } +} + + +//------------------------------------------------- +// vip_screen_update - screen update +//------------------------------------------------- + +UINT32 vp575_device::vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + UINT32 data = 0; + + for (int i = 0; i < MAX_SLOTS; i++) + { + data |= m_expansion_slot[i]->screen_update(screen, bitmap, cliprect); + } + + return data; +} + + +//------------------------------------------------- +// vip_ef1_r - EF1 flag read +//------------------------------------------------- + +int vp575_device::vip_ef1_r() +{ + int state = CLEAR_LINE; + + for (int i = 0; i < MAX_SLOTS; i++) + { + state |= m_expansion_slot[i]->ef1_r(); + } + + return state; +} + + +//------------------------------------------------- +// vip_ef3_r - EF3 flag read +//------------------------------------------------- + +int vp575_device::vip_ef3_r() +{ + int state = CLEAR_LINE; + + for (int i = 0; i < MAX_SLOTS; i++) + { + state |= m_expansion_slot[i]->ef3_r(); + } + + return state; +} + + +//------------------------------------------------- +// vip_ef4_r - EF4 flag read +//------------------------------------------------- + +int vp575_device::vip_ef4_r() +{ + int state = CLEAR_LINE; + + for (int i = 0; i < MAX_SLOTS; i++) + { + state |= m_expansion_slot[i]->ef4_r(); + } + + return state; +} + + +//------------------------------------------------- +// vip_sc_w - status code write +//------------------------------------------------- + +void vp575_device::vip_sc_w(int data) +{ + for (int i = 0; i < MAX_SLOTS; i++) + { + m_expansion_slot[i]->sc_w(data); + } +} + + +//------------------------------------------------- +// vip_q_w - Q write +//------------------------------------------------- + +void vp575_device::vip_q_w(int state) +{ + for (int i = 0; i < MAX_SLOTS; i++) + { + m_expansion_slot[i]->q_w(state); + } +} + + +//------------------------------------------------- +// vip_run_w - RUN write +//------------------------------------------------- + +void vp575_device::vip_run_w(int state) +{ + for (int i = 0; i < MAX_SLOTS; i++) + { + m_expansion_slot[i]->run_w(state); + } +} diff --git a/src/emu/bus/vip/vp575.h b/src/emu/bus/vip/vp575.h new file mode 100644 index 00000000000..375af27a26a --- /dev/null +++ b/src/emu/bus/vip/vp575.h @@ -0,0 +1,97 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Expansion Board VP-575 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __VP575__ +#define __VP575__ + +#include "emu.h" +#include "exp.h" + + + +//************************************************************************** +// MACROS/CONSTANTS +//************************************************************************** + +#define MAX_SLOTS 5 + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> vp575_device + +class vp575_device : public device_t, + public device_vip_expansion_card_interface +{ +public: + // construction/destruction + vp575_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + + // not really public + DECLARE_WRITE_LINE_MEMBER( exp1_int_w ); + DECLARE_WRITE_LINE_MEMBER( exp2_int_w ); + DECLARE_WRITE_LINE_MEMBER( exp3_int_w ); + DECLARE_WRITE_LINE_MEMBER( exp4_int_w ); + DECLARE_WRITE_LINE_MEMBER( exp5_int_w ); + DECLARE_WRITE_LINE_MEMBER( exp1_dma_out_w ); + DECLARE_WRITE_LINE_MEMBER( exp2_dma_out_w ); + DECLARE_WRITE_LINE_MEMBER( exp3_dma_out_w ); + DECLARE_WRITE_LINE_MEMBER( exp4_dma_out_w ); + DECLARE_WRITE_LINE_MEMBER( exp5_dma_out_w ); + DECLARE_WRITE_LINE_MEMBER( exp1_dma_in_w ); + DECLARE_WRITE_LINE_MEMBER( exp2_dma_in_w ); + DECLARE_WRITE_LINE_MEMBER( exp3_dma_in_w ); + DECLARE_WRITE_LINE_MEMBER( exp4_dma_in_w ); + DECLARE_WRITE_LINE_MEMBER( exp5_dma_in_w ); + + void update_interrupts(); + +protected: + // device-level overrides + virtual void device_start(); + + // device_vip_expansion_card_interface overrides + virtual UINT8 vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh); + virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh); + virtual UINT8 vip_io_r(address_space &space, offs_t offset); + virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data); + virtual UINT8 vip_dma_r(address_space &space, offs_t offset); + virtual void vip_dma_w(address_space &space, offs_t offset, UINT8 data); + virtual UINT32 vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + virtual int vip_ef1_r(); + virtual int vip_ef3_r(); + virtual int vip_ef4_r(); + virtual void vip_sc_w(int data); + virtual void vip_q_w(int state); + virtual void vip_run_w(int state); + +private: + vip_expansion_slot_device *m_expansion_slot[MAX_SLOTS]; + + int m_int[MAX_SLOTS]; + int m_dma_out[MAX_SLOTS]; + int m_dma_in[MAX_SLOTS]; +}; + + +// device type definition +extern const device_type VP575; + + +#endif diff --git a/src/emu/bus/vip/vp585.c b/src/emu/bus/vip/vp585.c new file mode 100644 index 00000000000..663bd61d8fc --- /dev/null +++ b/src/emu/bus/vip/vp585.c @@ -0,0 +1,135 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Expansion Keypad Interface Board VP585 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "vp585.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type VP585 = &device_creator<vp585_device>; + + +//------------------------------------------------- +// INPUT_PORTS( vp585 ) +//------------------------------------------------- + +static INPUT_PORTS_START( vp585 ) + PORT_START("J1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 0") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 1") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 2") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 3") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 4") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 5") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 6") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 7") + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 8") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 9") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad A") + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad B") + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad C") + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad D") + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad E") + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad F") + + PORT_START("J2") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 0") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 1") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 2") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 3") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 4") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 5") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 6") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 7") + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 8") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 9") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad A") + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad B") + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad C") + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad D") + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad E") + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad F") +INPUT_PORTS_END + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor vp585_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( vp585 ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// vp585_device - constructor +//------------------------------------------------- + +vp585_device::vp585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, VP585, "VP585", tag, owner, clock, "vp585", __FILE__), + device_vip_expansion_card_interface(mconfig, *this), + m_j1(*this, "J1"), + m_j2(*this, "J2") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void vp585_device::device_start() +{ + // state saving + save_item(NAME(m_keylatch)); +} + + +//------------------------------------------------- +// vip_io_w - I/O write +//------------------------------------------------- + +void vp585_device::vip_io_w(address_space &space, offs_t offset, UINT8 data) +{ + if (offset == 0x02) + { + m_keylatch = data & 0x0f; + } +} + + +//------------------------------------------------- +// vip_ef3_r - EF3 read +//------------------------------------------------- + +int vp585_device::vip_ef3_r() +{ + return BIT(m_j1->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; +} + + +//------------------------------------------------- +// vip_ef4_r - EF4 read +//------------------------------------------------- + +int vp585_device::vip_ef4_r() +{ + return BIT(m_j2->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; +} diff --git a/src/emu/bus/vip/vp585.h b/src/emu/bus/vip/vp585.h new file mode 100644 index 00000000000..6ed7803ed15 --- /dev/null +++ b/src/emu/bus/vip/vp585.h @@ -0,0 +1,59 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Expansion Keypad Interface Board VP585 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __VP585__ +#define __VP585__ + +#include "emu.h" +#include "exp.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> vp585_device + +class vp585_device : public device_t, + public device_vip_expansion_card_interface +{ +public: + // construction/destruction + vp585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual ioport_constructor device_input_ports() const; + +protected: + // device-level overrides + virtual void device_start(); + + // device_vip_expansion_card_interface overrides + virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data); + virtual int vip_ef3_r(); + virtual int vip_ef4_r(); + +private: + required_ioport m_j1; + required_ioport m_j2; + + UINT8 m_keylatch; +}; + + +// device type definition +extern const device_type VP585; + + +#endif diff --git a/src/emu/bus/vip/vp590.c b/src/emu/bus/vip/vp590.c new file mode 100644 index 00000000000..f0a4a075766 --- /dev/null +++ b/src/emu/bus/vip/vp590.c @@ -0,0 +1,260 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Color Board VP590 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "vp590.h" + + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define CDP1862_TAG "u2" +#define SCREEN_TAG ":screen" // hijack the VIP's screen since the CDP1861 chip would be removed from the PCB on real hardware + +#define COLOR_RAM_SIZE 0x100 + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type VP590 = &device_creator<vp590_device>; + + +//------------------------------------------------- +// CDP1862_INTERFACE( cgc_intf ) +//------------------------------------------------- + +READ_LINE_MEMBER( vp590_device::rd_r ) +{ + return BIT(m_color, 1); +} + +READ_LINE_MEMBER( vp590_device::bd_r ) +{ + return BIT(m_color, 2); +} + +READ_LINE_MEMBER( vp590_device::gd_r ) +{ + return BIT(m_color, 3); +} + + +//------------------------------------------------- +// MACHINE_CONFIG_FRAGMENT( vp590 ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( vp590 ) + MCFG_CDP1862_ADD(CDP1862_TAG, SCREEN_TAG, CPD1862_CLOCK, DEVREADLINE(DEVICE_SELF, vp590_device, rd_r), DEVREADLINE(DEVICE_SELF, vp590_device, bd_r), DEVREADLINE(DEVICE_SELF, vp590_device, gd_r)) + MCFG_CDP1862_LUMINANCE(RES_R(510), RES_R(360), RES_K(1), RES_K(1.5)) // R3, R4, R5, R6 + MCFG_CDP1862_CHROMINANCE(RES_K(3.9), RES_K(10), RES_K(2), RES_K(3.3)) // R7, R8, R9, R10 +MACHINE_CONFIG_END + + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor vp590_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( vp590 ); +} + + +//------------------------------------------------- +// INPUT_PORTS( vp590 ) +//------------------------------------------------- + +static INPUT_PORTS_START( vp590 ) + PORT_START("J1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 0") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 1") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 2") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 3") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 4") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 5") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 6") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 7") + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 8") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad 9") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad A") + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad B") + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad C") + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad D") + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad E") + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 1 Keypad F") + + PORT_START("J2") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 0") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 1") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 2") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 3") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 4") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 5") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 6") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 7") + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 8") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad 9") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad A") + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad B") + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad C") + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad D") + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad E") + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("Player 2 Keypad F") +INPUT_PORTS_END + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor vp590_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( vp590 ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// vp590_device - constructor +//------------------------------------------------- + +vp590_device::vp590_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, VP590, "VP590", tag, owner, clock, "vp590", __FILE__), + device_vip_expansion_card_interface(mconfig, *this), + m_cgc(*this, CDP1862_TAG), + m_color_ram(*this, "color_ram"), + m_j1(*this, "J1"), + m_j2(*this, "J2") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void vp590_device::device_start() +{ + // allocate memory + m_color_ram.allocate(COLOR_RAM_SIZE); + + // state saving + save_item(NAME(m_a12)); + save_item(NAME(m_color)); + save_item(NAME(m_keylatch)); +} + + +//------------------------------------------------- +// vip_program_w - program write +//------------------------------------------------- + +void vp590_device::vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) +{ + if (offset >= 0xc000 && offset < 0xe000) + { + UINT8 mask = 0xff; + + m_a12 = (offset & 0x1000) ? 1 : 0; + + if (!m_a12) + { + // mask out A4 and A3 + mask = 0xe7; + } + + // write to CDP1822 + m_color_ram[offset & mask] = data << 1; + + m_cgc->con_w(0); + } +} + + +//------------------------------------------------- +// vip_io_w - I/O write +//------------------------------------------------- + +void vp590_device::vip_io_w(address_space &space, offs_t offset, UINT8 data) +{ + switch (offset) + { + case 0x02: + m_keylatch = data & 0x0f; + break; + + case 0x05: + m_cgc->bkg_w(1); + m_cgc->bkg_w(0); + break; + } +} + + +//------------------------------------------------- +// vip_dma_w - DMA write +//------------------------------------------------- + +void vp590_device::vip_dma_w(address_space &space, offs_t offset, UINT8 data) +{ + UINT8 mask = 0xff; + + if (!m_a12) + { + // mask out A4 and A3 + mask = 0xe7; + } + + m_color = m_color_ram[offset & mask]; + + m_cgc->dma_w(space, offset, data); +} + + +//------------------------------------------------- +// vip_screen_update - screen update +//------------------------------------------------- + +UINT32 vp590_device::vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + m_cgc->screen_update(screen, bitmap, cliprect); + + return 0; +} + + +//------------------------------------------------- +// vip_ef3_r - EF3 read +//------------------------------------------------- + +int vp590_device::vip_ef3_r() +{ + return BIT(m_j1->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; +} + + +//------------------------------------------------- +// vip_ef4_r - EF4 read +//------------------------------------------------- + +int vp590_device::vip_ef4_r() +{ + return BIT(m_j2->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; +} diff --git a/src/emu/bus/vip/vp590.h b/src/emu/bus/vip/vp590.h new file mode 100644 index 00000000000..81db82f10ea --- /dev/null +++ b/src/emu/bus/vip/vp590.h @@ -0,0 +1,74 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Color Board VP590 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __VP590__ +#define __VP590__ + +#include "emu.h" +#include "machine/rescap.h" +#include "exp.h" +#include "video/cdp1862.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> vp590_device + +class vp590_device : public device_t, + public device_vip_expansion_card_interface +{ +public: + // construction/destruction + vp590_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + virtual ioport_constructor device_input_ports() const; + + // not really public + DECLARE_READ_LINE_MEMBER( rd_r ); + DECLARE_READ_LINE_MEMBER( bd_r ); + DECLARE_READ_LINE_MEMBER( gd_r ); + +protected: + // device-level overrides + virtual void device_start(); + + // device_vip_expansion_card_interface overrides + virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh); + virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data); + virtual void vip_dma_w(address_space &space, offs_t offset, UINT8 data); + virtual UINT32 vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + virtual int vip_ef3_r(); + virtual int vip_ef4_r(); + +private: + required_device<cdp1862_device> m_cgc; + optional_shared_ptr<UINT8> m_color_ram; + required_ioport m_j1; + required_ioport m_j2; + + int m_a12; + UINT8 m_color; + UINT8 m_keylatch; +}; + + +// device type definition +extern const device_type VP590; + + +#endif diff --git a/src/emu/bus/vip/vp595.c b/src/emu/bus/vip/vp595.c new file mode 100644 index 00000000000..72d69ee744e --- /dev/null +++ b/src/emu/bus/vip/vp595.c @@ -0,0 +1,103 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Simple Sound Board VP595 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "vp595.h" + + + +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define CDP1863_TAG "u1" +#define CDP1863_XTAL 440560 + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type VP595 = &device_creator<vp595_device>; + + +//------------------------------------------------- +// MACHINE_CONFIG_FRAGMENT( vp595 ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( vp595 ) + MCFG_SPEAKER_STANDARD_MONO("mono") + + MCFG_CDP1863_ADD(CDP1863_TAG, 0, CDP1863_XTAL) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor vp595_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( vp595 ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// vp595_device - constructor +//------------------------------------------------- + +vp595_device::vp595_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, VP595, "VP595", tag, owner, clock, "vp595", __FILE__), + device_vip_expansion_card_interface(mconfig, *this), + m_pfg(*this, CDP1863_TAG) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void vp595_device::device_start() +{ +} + + +//------------------------------------------------- +// vip_io_w - I/O write +//------------------------------------------------- + +void vp595_device::vip_io_w(address_space &space, offs_t offset, UINT8 data) +{ + if (offset == 0x03) + { + if (!data) data = 0x80; + + m_pfg->str_w(data); + } +} + + +//------------------------------------------------- +// vip_q_w - Q write +//------------------------------------------------- + +void vp595_device::vip_q_w(int state) +{ + m_pfg->oe_w(state); +} diff --git a/src/emu/bus/vip/vp595.h b/src/emu/bus/vip/vp595.h new file mode 100644 index 00000000000..0a788e4a585 --- /dev/null +++ b/src/emu/bus/vip/vp595.h @@ -0,0 +1,56 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Simple Sound Board VP595 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __VP595__ +#define __VP595__ + +#include "emu.h" +#include "exp.h" +#include "sound/cdp1863.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> vp595_device + +class vp595_device : public device_t, + public device_vip_expansion_card_interface +{ +public: + // construction/destruction + vp595_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + +protected: + // device-level overrides + virtual void device_start(); + + // device_vip_expansion_card_interface overrides + virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data); + virtual void vip_q_w(int state); + +private: + required_device<cdp1863_device> m_pfg; +}; + + +// device type definition +extern const device_type VP595; + + +#endif diff --git a/src/emu/bus/vip/vp620.c b/src/emu/bus/vip/vp620.c new file mode 100644 index 00000000000..828ec29af4b --- /dev/null +++ b/src/emu/bus/vip/vp620.c @@ -0,0 +1,111 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP ASCII Keyboard Interface VP-620 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "vp620.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type VP620 = &device_creator<vp620_device>; + + +//------------------------------------------------- +// ASCII_KEYBOARD_INTERFACE( kb_intf ) +//------------------------------------------------- + +WRITE8_MEMBER( vp620_device::kb_w ) +{ + m_keydata = data; + + m_slot->inst_w(0); + m_slot->inst_w(1); + + m_keystb = ASSERT_LINE; +} + +static ASCII_KEYBOARD_INTERFACE( kb_intf ) +{ + DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, vp620_device, kb_w) +}; + + +//------------------------------------------------- +// MACHINE_CONFIG_FRAGMENT( vp620 ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( vp620 ) + MCFG_ASCII_KEYBOARD_ADD("keyboard", kb_intf) +MACHINE_CONFIG_END + + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor vp620_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( vp620 ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// vp620_device - constructor +//------------------------------------------------- + +vp620_device::vp620_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, VP620, "VP620", tag, owner, clock, "vp620", __FILE__), + device_vip_byteio_port_interface(mconfig, *this), + m_keydata(0), + m_keystb(CLEAR_LINE) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void vp620_device::device_start() +{ +} + + +//------------------------------------------------- +// vip_in_r - byte input read +//------------------------------------------------- + +UINT8 vp620_device::vip_in_r() +{ + return m_keydata; +} + + +//------------------------------------------------- +// vip_ef3_r - EF3 flag read +//------------------------------------------------- + +int vp620_device::vip_ef4_r() +{ + int state = m_keystb; + + m_keystb = CLEAR_LINE; + + return state; +} diff --git a/src/emu/bus/vip/vp620.h b/src/emu/bus/vip/vp620.h new file mode 100644 index 00000000000..509820fd2d8 --- /dev/null +++ b/src/emu/bus/vip/vp620.h @@ -0,0 +1,60 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP ASCII Keyboard Interface VP-620 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __VP620__ +#define __VP620__ + +#include "emu.h" +#include "byteio.h" +#include "machine/keyboard.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> vp620_device + +class vp620_device : public device_t, + public device_vip_byteio_port_interface +{ +public: + // construction/destruction + vp620_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + + // not really public + DECLARE_WRITE8_MEMBER( kb_w ); + +protected: + // device-level overrides + virtual void device_start(); + + // device_vip_byteio_port_interface overrides + virtual UINT8 vip_in_r(); + virtual int vip_ef4_r(); + +private: + UINT8 m_keydata; + int m_keystb; +}; + + +// device type definition +extern const device_type VP620; + + +#endif diff --git a/src/emu/bus/vip/vp700.c b/src/emu/bus/vip/vp700.c new file mode 100644 index 00000000000..dda6b9e7bf6 --- /dev/null +++ b/src/emu/bus/vip/vp700.c @@ -0,0 +1,84 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Tiny BASIC VP-700 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "vp700.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type VP700 = &device_creator<vp700_device>; + + +//------------------------------------------------- +// ROM( vp700 ) +//------------------------------------------------- + +ROM_START( vp700 ) + ROM_REGION( 0x1000, "vp700", 0 ) + ROM_LOAD( "vp700.bin", 0x0000, 0x1000, CRC(3f2b8524) SHA1(8fa88740cae82d8d62ea34891a657d3ca1fb732a) ) +ROM_END + + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +const rom_entry *vp700_device::device_rom_region() const +{ + return ROM_NAME( vp700 ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// vp700_device - constructor +//------------------------------------------------- + +vp700_device::vp700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, VP700, "VP700", tag, owner, clock, "vp700", __FILE__), + device_vip_expansion_card_interface(mconfig, *this), + m_rom(*this, "vp700") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void vp700_device::device_start() +{ +} + + +//------------------------------------------------- +// vip_program_r - program read +//------------------------------------------------- + +UINT8 vp700_device::vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) +{ + UINT8 data = 0xff; + + if (offset < 0x1000) + { + *minh = 1; + + data = m_rom->base()[offset & 0xfff]; + } + + return data; +} diff --git a/src/emu/bus/vip/vp700.h b/src/emu/bus/vip/vp700.h new file mode 100644 index 00000000000..62194a2c96a --- /dev/null +++ b/src/emu/bus/vip/vp700.h @@ -0,0 +1,55 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + RCA VIP Tiny BASIC VP-700 emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#pragma once + +#ifndef __VP700__ +#define __VP700__ + +#include "emu.h" +#include "exp.h" +#include "sound/cdp1863.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> vp700_device + +class vp700_device : public device_t, + public device_vip_expansion_card_interface +{ +public: + // construction/destruction + vp700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual const rom_entry *device_rom_region() const; + +protected: + // device-level overrides + virtual void device_start(); + + // device_vip_expansion_card_interface overrides + virtual UINT8 vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh); + +private: + required_memory_region m_rom; +}; + + +// device type definition +extern const device_type VP700; + + +#endif diff --git a/src/emu/emu.mak b/src/emu/emu.mak index 32ceb8dafc5..e935833c8d6 100644 --- a/src/emu/emu.mak +++ b/src/emu/emu.mak @@ -36,6 +36,7 @@ OBJDIRS += \ $(EMUOBJ)/bus/ieee488 \ $(EMUOBJ)/bus/isbx \ $(EMUOBJ)/bus/s100 \ + $(EMUOBJ)/bus/vip \ $(EMUOBJ)/bus/wangpc \ $(EMUOBJ)/drivers \ $(EMUOBJ)/machine \ |