src/mess/machine/vip_exp.c
| r0 | r15557 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | RCA Cosmac VIP Expansion Interface emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "machine/vip_exp.h" |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // MACROS/CONSTANTS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | #define LOG 0 |
| 19 | |
| 20 | |
| 21 | |
| 22 | //************************************************************************** |
| 23 | // DEVICE DEFINITIONS |
| 24 | //************************************************************************** |
| 25 | |
| 26 | const device_type VIP_EXPANSION_SLOT = &device_creator<vip_expansion_slot_device>; |
| 27 | |
| 28 | |
| 29 | |
| 30 | //************************************************************************** |
| 31 | // DEVICE VIP_EXPANSION CARD INTERFACE |
| 32 | //************************************************************************** |
| 33 | |
| 34 | //------------------------------------------------- |
| 35 | // device_vip_expansion_card_interface - constructor |
| 36 | //------------------------------------------------- |
| 37 | |
| 38 | device_vip_expansion_card_interface::device_vip_expansion_card_interface(const machine_config &mconfig, device_t &device) |
| 39 | : device_slot_card_interface(mconfig, device) |
| 40 | { |
| 41 | m_slot = dynamic_cast<vip_expansion_slot_device *>(device.owner()); |
| 42 | } |
| 43 | |
| 44 | |
| 45 | //------------------------------------------------- |
| 46 | // ~device_vip_expansion_card_interface - destructor |
| 47 | //------------------------------------------------- |
| 48 | |
| 49 | device_vip_expansion_card_interface::~device_vip_expansion_card_interface() |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | |
| 54 | |
| 55 | //************************************************************************** |
| 56 | // LIVE DEVICE |
| 57 | //************************************************************************** |
| 58 | |
| 59 | //------------------------------------------------- |
| 60 | // vip_expansion_slot_device - constructor |
| 61 | //------------------------------------------------- |
| 62 | |
| 63 | vip_expansion_slot_device::vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 64 | device_t(mconfig, VIP_EXPANSION_SLOT, "VIP expansion port", tag, owner, clock), |
| 65 | device_slot_interface(mconfig, *this) |
| 66 | { |
| 67 | } |
| 68 | |
| 69 | |
| 70 | //------------------------------------------------- |
| 71 | // vip_expansion_slot_device - destructor |
| 72 | //------------------------------------------------- |
| 73 | |
| 74 | vip_expansion_slot_device::~vip_expansion_slot_device() |
| 75 | { |
| 76 | } |
| 77 | |
| 78 | |
| 79 | //------------------------------------------------- |
| 80 | // device_config_complete - perform any |
| 81 | // operations now that the configuration is |
| 82 | // complete |
| 83 | //------------------------------------------------- |
| 84 | |
| 85 | void vip_expansion_slot_device::device_config_complete() |
| 86 | { |
| 87 | // inherit a copy of the static data |
| 88 | const vip_expansion_slot_interface *intf = reinterpret_cast<const vip_expansion_slot_interface *>(static_config()); |
| 89 | if (intf != NULL) |
| 90 | { |
| 91 | *static_cast<vip_expansion_slot_interface *>(this) = *intf; |
| 92 | } |
| 93 | |
| 94 | // or initialize to defaults if none provided |
| 95 | else |
| 96 | { |
| 97 | memset(&m_out_interrupt_cb, 0, sizeof(m_out_interrupt_cb)); |
| 98 | memset(&m_out_dma_out_cb, 0, sizeof(m_out_dma_out_cb)); |
| 99 | memset(&m_out_dma_in_cb, 0, sizeof(m_out_dma_in_cb)); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | |
| 104 | //------------------------------------------------- |
| 105 | // device_start - device-specific startup |
| 106 | //------------------------------------------------- |
| 107 | |
| 108 | void vip_expansion_slot_device::device_start() |
| 109 | { |
| 110 | m_cart = dynamic_cast<device_vip_expansion_card_interface *>(get_card_device()); |
| 111 | |
| 112 | // resolve callbacks |
| 113 | m_out_interrupt_func.resolve(m_out_interrupt_cb, *this); |
| 114 | m_out_dma_out_func.resolve(m_out_dma_out_cb, *this); |
| 115 | m_out_dma_in_func.resolve(m_out_dma_in_cb, *this); |
| 116 | } |
| 117 | |
| 118 | |
| 119 | //------------------------------------------------- |
| 120 | // program_r - program read |
| 121 | //------------------------------------------------- |
| 122 | |
| 123 | UINT8 vip_expansion_slot_device::program_r(address_space &space, offs_t offset, int cdef, int *indis) |
| 124 | { |
| 125 | UINT8 data = 0; |
| 126 | |
| 127 | if (m_cart != NULL) |
| 128 | { |
| 129 | data = m_cart->vip_program_r(space, offset, cdef, indis); |
| 130 | } |
| 131 | |
| 132 | return data; |
| 133 | } |
| 134 | |
| 135 | |
| 136 | //------------------------------------------------- |
| 137 | // program_w - program write |
| 138 | //------------------------------------------------- |
| 139 | |
| 140 | void vip_expansion_slot_device::program_w(address_space &space, offs_t offset, UINT8 data, int cdef) |
| 141 | { |
| 142 | if (m_cart != NULL) |
| 143 | { |
| 144 | m_cart->vip_program_w(space, offset, data, cdef); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | |
| 149 | //------------------------------------------------- |
| 150 | // screen_update - |
| 151 | //------------------------------------------------- |
| 152 | |
| 153 | UINT32 vip_expansion_slot_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 154 | { |
| 155 | bool value = false; |
| 156 | |
| 157 | if (m_cart != NULL) |
| 158 | { |
| 159 | value = m_cart->vip_screen_update(screen, bitmap, cliprect); |
| 160 | } |
| 161 | |
| 162 | return value; |
| 163 | } |
| 164 | |
| 165 | READ_LINE_MEMBER( vip_expansion_slot_device::ef1_r ) { int state = 1; if (m_cart != NULL) state = m_cart->vip_ef1_r(); return state; } |
| 166 | READ_LINE_MEMBER( vip_expansion_slot_device::ef3_r ) { int state = 1; if (m_cart != NULL) state = m_cart->vip_ef3_r(); return state; } |
| 167 | READ_LINE_MEMBER( vip_expansion_slot_device::ef4_r ) { int state = 1; if (m_cart != NULL) state = m_cart->vip_ef4_r(); return state; } |
| 168 | WRITE_LINE_MEMBER( vip_expansion_slot_device::sc0_w ) { if (m_cart != NULL) m_cart->vip_sc0_w(state); } |
| 169 | WRITE_LINE_MEMBER( vip_expansion_slot_device::sc1_w ) { if (m_cart != NULL) m_cart->vip_sc1_w(state); } |
| 170 | WRITE_LINE_MEMBER( vip_expansion_slot_device::q_w ) { if (m_cart != NULL) m_cart->vip_q_w(state); } |
| 171 | |
| 172 | WRITE_LINE_MEMBER( vip_expansion_slot_device::interrupt_w ) { m_out_interrupt_func(state); } |
| 173 | WRITE_LINE_MEMBER( vip_expansion_slot_device::dma_out_w ) { m_out_dma_out_func(state); } |
| 174 | WRITE_LINE_MEMBER( vip_expansion_slot_device::dma_in_w ) { m_out_dma_in_func(state); } |
src/mess/machine/vip_exp.h
| r0 | r15557 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | RCA Cosmac VIP Expansion Interface emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | ********************************************************************** |
| 9 | |
| 10 | CLOCK 1 A _MWR |
| 11 | _EF4 2 B TPA |
| 12 | _EF3 3 C MA0 |
| 13 | XTAL 4 D MA1 |
| 14 | _EF1 5 E MA2 |
| 15 | N0 6 F MA3 |
| 16 | N1 7 H MA4 |
| 17 | N2 8 J MA5 |
| 18 | SPOT 9 K MA6 |
| 19 | _SYNC 10 L MA7 |
| 20 | TPB 11 M BUS 0 |
| 21 | SC0 12 N BUS 1 |
| 22 | _INTERRUPT 13 P BUS 2 |
| 23 | SC1 14 R BUS 3 |
| 24 | _DMA-OUT 15 S BUS 4 |
| 25 | Q 16 T BUS 5 |
| 26 | _DMA-IN 17 U BUS 6 |
| 27 | RUN 18 V BUS 7 |
| 28 | INDIS 19 W _MRD |
| 29 | _CDEF 20 X CS |
| 30 | +5 V 21 Y +5 V |
| 31 | GND 22 Z GND |
| 32 | |
| 33 | **********************************************************************/ |
| 34 | |
| 35 | #pragma once |
| 36 | |
| 37 | #ifndef __VIP_EXPANSION_SLOT__ |
| 38 | #define __VIP_EXPANSION_SLOT__ |
| 39 | |
| 40 | #include "emu.h" |
| 41 | |
| 42 | |
| 43 | |
| 44 | //************************************************************************** |
| 45 | // CONSTANTS |
| 46 | //************************************************************************** |
| 47 | |
| 48 | #define VIP_EXPANSION_SLOT_TAG "exp" |
| 49 | |
| 50 | |
| 51 | |
| 52 | //************************************************************************** |
| 53 | // INTERFACE CONFIGURATION MACROS |
| 54 | //************************************************************************** |
| 55 | |
| 56 | #define VIP_EXPANSION_INTERFACE(_name) \ |
| 57 | const vip_expansion_slot_interface (_name) = |
| 58 | |
| 59 | |
| 60 | #define MCFG_VIP_EXPANSION_SLOT_ADD(_tag, _clock, _config, _slot_intf, _def_slot, _def_inp) \ |
| 61 | MCFG_DEVICE_ADD(_tag, VIP_EXPANSION_SLOT, _clock) \ |
| 62 | MCFG_DEVICE_CONFIG(_config) \ |
| 63 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) |
| 64 | |
| 65 | |
| 66 | |
| 67 | //************************************************************************** |
| 68 | // TYPE DEFINITIONS |
| 69 | //************************************************************************** |
| 70 | |
| 71 | // ======================> vip_expansion_slot_interface |
| 72 | |
| 73 | struct vip_expansion_slot_interface |
| 74 | { |
| 75 | devcb_write_line m_out_interrupt_cb; |
| 76 | devcb_write_line m_out_dma_out_cb; |
| 77 | devcb_write_line m_out_dma_in_cb; |
| 78 | }; |
| 79 | |
| 80 | |
| 81 | // ======================> vip_expansion_slot_device |
| 82 | |
| 83 | class device_vip_expansion_card_interface; |
| 84 | |
| 85 | class vip_expansion_slot_device : public device_t, |
| 86 | public vip_expansion_slot_interface, |
| 87 | public device_slot_interface |
| 88 | { |
| 89 | public: |
| 90 | // construction/destruction |
| 91 | vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 92 | virtual ~vip_expansion_slot_device(); |
| 93 | |
| 94 | // computer interface |
| 95 | UINT8 program_r(address_space &space, offs_t offset, int cdef, int *indis); |
| 96 | void program_w(address_space &space, offs_t offset, UINT8 data, int cdef); |
| 97 | UINT8 io_r(address_space &space, offs_t offset); |
| 98 | void io_w(address_space &space, offs_t offset, UINT8 data); |
| 99 | UINT8 dma_r(offs_t offset); |
| 100 | void dma_w(offs_t offset, UINT8 data); |
| 101 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 102 | DECLARE_READ_LINE_MEMBER( ef1_r ); |
| 103 | DECLARE_READ_LINE_MEMBER( ef3_r ); |
| 104 | DECLARE_READ_LINE_MEMBER( ef4_r ); |
| 105 | DECLARE_WRITE_LINE_MEMBER( sc0_w ); |
| 106 | DECLARE_WRITE_LINE_MEMBER( sc1_w ); |
| 107 | DECLARE_WRITE_LINE_MEMBER( q_w ); |
| 108 | |
| 109 | // cartridge interface |
| 110 | DECLARE_WRITE_LINE_MEMBER( interrupt_w ); |
| 111 | DECLARE_WRITE_LINE_MEMBER( dma_out_w ); |
| 112 | DECLARE_WRITE_LINE_MEMBER( dma_in_w ); |
| 113 | |
| 114 | protected: |
| 115 | // device-level overrides |
| 116 | virtual void device_config_complete(); |
| 117 | virtual void device_start(); |
| 118 | |
| 119 | devcb_resolved_write_line m_out_interrupt_func; |
| 120 | devcb_resolved_write_line m_out_dma_out_func; |
| 121 | devcb_resolved_write_line m_out_dma_in_func; |
| 122 | |
| 123 | device_vip_expansion_card_interface *m_cart; |
| 124 | }; |
| 125 | |
| 126 | |
| 127 | // ======================> device_vip_expansion_card_interface |
| 128 | |
| 129 | class device_vip_expansion_card_interface : public device_slot_card_interface |
| 130 | { |
| 131 | friend class vip_expansion_slot_device; |
| 132 | |
| 133 | public: |
| 134 | // construction/destruction |
| 135 | device_vip_expansion_card_interface(const machine_config &mconfig, device_t &device); |
| 136 | virtual ~device_vip_expansion_card_interface(); |
| 137 | |
| 138 | protected: |
| 139 | // runtime |
| 140 | virtual UINT8 vip_program_r(address_space &space, offs_t offset, int cdef, int *indis) { return 0; }; |
| 141 | virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef) { }; |
| 142 | |
| 143 | virtual UINT8 vip_io_r(address_space &space, offs_t offset) { return 0; }; |
| 144 | virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data) { }; |
| 145 | |
| 146 | virtual UINT8 vip_dma_r(address_space &space, offs_t offset) { return 0; }; |
| 147 | virtual void vip_dma_w(address_space &space, offs_t offset, UINT8 data) { }; |
| 148 | |
| 149 | virtual UINT32 vip_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } |
| 150 | |
| 151 | virtual int vip_ef1_r() { return 1; } |
| 152 | virtual int vip_ef3_r() { return 1; } |
| 153 | virtual int vip_ef4_r() { return 1; } |
| 154 | |
| 155 | virtual void vip_sc0_w(int state) { }; |
| 156 | virtual void vip_sc1_w(int state) { }; |
| 157 | |
| 158 | virtual void vip_q_w(int state) { }; |
| 159 | |
| 160 | vip_expansion_slot_device *m_slot; |
| 161 | }; |
| 162 | |
| 163 | |
| 164 | // device type definition |
| 165 | extern const device_type VIP_EXPANSION_SLOT; |
| 166 | |
| 167 | |
| 168 | |
| 169 | #endif |
src/mess/machine/vip_byteio.c
| r0 | r15557 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | RCA Cosmac VIP Byte Input/Output port emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "machine/vip_byteio.h" |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // GLOBAL VARIABLES |
| 16 | //************************************************************************** |
| 17 | |
| 18 | const device_type VIP_BYTEIO_PORT = &device_creator<vip_byteio_port_device>; |
| 19 | |
| 20 | |
| 21 | |
| 22 | //************************************************************************** |
| 23 | // CARD INTERFACE |
| 24 | //************************************************************************** |
| 25 | |
| 26 | //------------------------------------------------- |
| 27 | // device_vip_byteio_port_interface - constructor |
| 28 | //------------------------------------------------- |
| 29 | |
| 30 | device_vip_byteio_port_interface::device_vip_byteio_port_interface(const machine_config &mconfig, device_t &device) |
| 31 | : device_slot_card_interface(mconfig,device) |
| 32 | { |
| 33 | m_slot = dynamic_cast<vip_byteio_port_device *>(device.owner()); |
| 34 | } |
| 35 | |
| 36 | |
| 37 | //------------------------------------------------- |
| 38 | // ~device_vip_byteio_port_interface - destructor |
| 39 | //------------------------------------------------- |
| 40 | |
| 41 | device_vip_byteio_port_interface::~device_vip_byteio_port_interface() |
| 42 | { |
| 43 | } |
| 44 | |
| 45 | |
| 46 | |
| 47 | //************************************************************************** |
| 48 | // LIVE DEVICE |
| 49 | //************************************************************************** |
| 50 | |
| 51 | //------------------------------------------------- |
| 52 | // vip_byteio_port_device - constructor |
| 53 | //------------------------------------------------- |
| 54 | |
| 55 | vip_byteio_port_device::vip_byteio_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 56 | device_t(mconfig, VIP_BYTEIO_PORT, "VIP byte I/O port", tag, owner, clock), |
| 57 | device_slot_interface(mconfig, *this) |
| 58 | { |
| 59 | } |
| 60 | |
| 61 | |
| 62 | //------------------------------------------------- |
| 63 | // vip_byteio_port_device - destructor |
| 64 | //------------------------------------------------- |
| 65 | |
| 66 | vip_byteio_port_device::~vip_byteio_port_device() |
| 67 | { |
| 68 | } |
| 69 | |
| 70 | |
| 71 | //------------------------------------------------- |
| 72 | // device_config_complete - perform any |
| 73 | // operations now that the configuration is |
| 74 | // complete |
| 75 | //------------------------------------------------- |
| 76 | |
| 77 | void vip_byteio_port_device::device_config_complete() |
| 78 | { |
| 79 | // inherit a copy of the static data |
| 80 | const vip_byteio_port_interface *intf = reinterpret_cast<const vip_byteio_port_interface *>(static_config()); |
| 81 | if (intf != NULL) |
| 82 | { |
| 83 | *static_cast<vip_byteio_port_interface *>(this) = *intf; |
| 84 | } |
| 85 | |
| 86 | // or initialize to defaults if none provided |
| 87 | else |
| 88 | { |
| 89 | memset(&m_out_inst_cb, 0, sizeof(m_out_inst_cb)); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | |
| 94 | //------------------------------------------------- |
| 95 | // device_start - device-specific startup |
| 96 | //------------------------------------------------- |
| 97 | |
| 98 | void vip_byteio_port_device::device_start() |
| 99 | { |
| 100 | m_cart = dynamic_cast<device_vip_byteio_port_interface *>(get_card_device()); |
| 101 | |
| 102 | // resolve callbacks |
| 103 | m_out_inst_func.resolve(m_out_inst_cb, *this); |
| 104 | } |
| 105 | |
| 106 | |
| 107 | //------------------------------------------------- |
| 108 | // device_reset - device-specific reset |
| 109 | //------------------------------------------------- |
| 110 | |
| 111 | void vip_byteio_port_device::device_reset() |
| 112 | { |
| 113 | } |
| 114 | |
| 115 | |
| 116 | READ8_MEMBER( vip_byteio_port_device::in_r ) { UINT8 data = 0xff; if (m_cart != NULL) data = m_cart->vip_in_r(space, offset); return data; } |
| 117 | WRITE8_MEMBER( vip_byteio_port_device::out_w ) { if (m_cart != NULL) m_cart->vip_out_w(space, offset, data); } |
| 118 | READ_LINE_MEMBER( vip_byteio_port_device::ef3_r ) { int state = 1; if (m_cart != NULL) state = m_cart->vip_ef3_r(); return state; } |
| 119 | READ_LINE_MEMBER( vip_byteio_port_device::ef4_r ) { int state = 1; if (m_cart != NULL) state = m_cart->vip_ef4_r(); return state; } |
| 120 | WRITE_LINE_MEMBER( vip_byteio_port_device::q_w ) { if (m_cart != NULL) m_cart->vip_q_w(state); } |
| 121 | |
| 122 | WRITE_LINE_MEMBER( vip_byteio_port_device::inst_w ) { m_out_inst_func(state); } |
src/mess/machine/vip_byteio.h
| r0 | r15557 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | RCA Cosmac VIP Byte Input/Output port emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | ********************************************************************** |
| 9 | |
| 10 | A IN 0 |
| 11 | B IN 1 |
| 12 | C IN 2 |
| 13 | D IN 3 |
| 14 | E IN 4 |
| 15 | F IN 5 |
| 16 | H IN 6 |
| 17 | J IN 7 |
| 18 | K INST |
| 19 | L _EF4 |
| 20 | M OUT 0 |
| 21 | N OUT 1 |
| 22 | P OUT 2 |
| 23 | R OUT 3 |
| 24 | S OUT 4 |
| 25 | T OUT 5 |
| 26 | U OUT 6 |
| 27 | V OUT 7 |
| 28 | W Q |
| 29 | X _EF3 |
| 30 | Y +5 V |
| 31 | Z GND |
| 32 | |
| 33 | **********************************************************************/ |
| 34 | |
| 35 | #pragma once |
| 36 | |
| 37 | #ifndef __VIP_BYTEIO_PORT__ |
| 38 | #define __VIP_BYTEIO_PORT__ |
| 39 | |
| 40 | #include "emu.h" |
| 41 | |
| 42 | |
| 43 | |
| 44 | //************************************************************************** |
| 45 | // CONSTANTS |
| 46 | //************************************************************************** |
| 47 | |
| 48 | #define VIP_BYTEIO_PORT_TAG "byteio" |
| 49 | |
| 50 | |
| 51 | |
| 52 | //************************************************************************** |
| 53 | // INTERFACE CONFIGURATION MACROS |
| 54 | //************************************************************************** |
| 55 | |
| 56 | #define VIP_BYTEIO_PORT_INTERFACE(_name) \ |
| 57 | const vip_byteio_port_interface (_name) = |
| 58 | |
| 59 | |
| 60 | #define MCFG_VIP_BYTEIO_PORT_ADD(_tag, _config, _slot_intf, _def_slot, _def_inp) \ |
| 61 | MCFG_DEVICE_ADD(_tag, VIP_BYTEIO_PORT, 0) \ |
| 62 | MCFG_DEVICE_CONFIG(_config) \ |
| 63 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) |
| 64 | |
| 65 | |
| 66 | |
| 67 | //************************************************************************** |
| 68 | // TYPE DEFINITIONS |
| 69 | //************************************************************************** |
| 70 | |
| 71 | // ======================> vip_byteio_port_interface |
| 72 | |
| 73 | struct vip_byteio_port_interface |
| 74 | { |
| 75 | devcb_write_line m_out_inst_cb; |
| 76 | }; |
| 77 | |
| 78 | |
| 79 | // ======================> vip_byteio_port_device |
| 80 | |
| 81 | class device_vip_byteio_port_interface; |
| 82 | |
| 83 | class vip_byteio_port_device : public device_t, |
| 84 | public vip_byteio_port_interface, |
| 85 | public device_slot_interface |
| 86 | { |
| 87 | public: |
| 88 | // construction/destruction |
| 89 | vip_byteio_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 90 | virtual ~vip_byteio_port_device(); |
| 91 | |
| 92 | // computer interface |
| 93 | DECLARE_READ8_MEMBER( in_r ); |
| 94 | DECLARE_WRITE8_MEMBER( out_w ); |
| 95 | DECLARE_READ_LINE_MEMBER( ef3_r ); |
| 96 | DECLARE_READ_LINE_MEMBER( ef4_r ); |
| 97 | DECLARE_WRITE_LINE_MEMBER( q_w ); |
| 98 | |
| 99 | // cartridge interface |
| 100 | DECLARE_WRITE_LINE_MEMBER( inst_w ); |
| 101 | |
| 102 | protected: |
| 103 | // device-level overrides |
| 104 | virtual void device_start(); |
| 105 | virtual void device_reset(); |
| 106 | virtual void device_config_complete(); |
| 107 | |
| 108 | devcb_resolved_write_line m_out_inst_func; |
| 109 | |
| 110 | device_vip_byteio_port_interface *m_cart; |
| 111 | }; |
| 112 | |
| 113 | |
| 114 | // ======================> device_vip_byteio_port_interface |
| 115 | |
| 116 | // class representing interface-specific live c64_expansion card |
| 117 | class device_vip_byteio_port_interface : public device_slot_card_interface |
| 118 | { |
| 119 | public: |
| 120 | // construction/destruction |
| 121 | device_vip_byteio_port_interface(const machine_config &mconfig, device_t &device); |
| 122 | virtual ~device_vip_byteio_port_interface(); |
| 123 | |
| 124 | virtual UINT8 vip_in_r(address_space &space, offs_t offset) { return 0xff; }; |
| 125 | virtual void vip_out_w(address_space &space, offs_t offset, UINT8 data) { }; |
| 126 | |
| 127 | virtual int vip_ef3_r() { return 1; } |
| 128 | virtual int vip_ef4_r() { return 1; } |
| 129 | |
| 130 | virtual void vip_q_w(int state) { }; |
| 131 | |
| 132 | protected: |
| 133 | vip_byteio_port_device *m_slot; |
| 134 | }; |
| 135 | |
| 136 | |
| 137 | // device type definition |
| 138 | extern const device_type VIP_BYTEIO_PORT; |
| 139 | |
| 140 | |
| 141 | |
| 142 | #endif |
src/mess/includes/vip.h
| r15556 | r15557 | |
| 16 | 16 | #include "video/cdp1862.h" |
| 17 | 17 | #include "machine/rescap.h" |
| 18 | 18 | #include "machine/ram.h" |
| 19 | #include "machine/vip_byteio.h" |
| 20 | #include "machine/vip_exp.h" |
| 19 | 21 | |
| 20 | 22 | #define SCREEN_TAG "screen" |
| 21 | 23 | #define CDP1802_TAG "u1" |
| r15556 | r15557 | |
| 68 | 70 | m_vp595(*this, VP595_TAG), |
| 69 | 71 | m_vp550(*this, VP550_TAG), |
| 70 | 72 | m_vp551(*this, VP551_TAG), |
| 73 | m_byteio(*this, VIP_BYTEIO_PORT_TAG), |
| 74 | m_exp(*this, VIP_EXPANSION_SLOT_TAG), |
| 71 | 75 | m_ram(*this, RAM_TAG) |
| 72 | 76 | { } |
| 73 | 77 | |
| r15556 | r15557 | |
| 79 | 83 | required_device<vp595_device> m_vp595; |
| 80 | 84 | required_device<vp550_device> m_vp550; |
| 81 | 85 | required_device<vp550_device> m_vp551; |
| 86 | required_device<vip_byteio_port_device> m_byteio; |
| 87 | required_device<vip_expansion_slot_device> m_exp; |
| 82 | 88 | required_device<ram_device> m_ram; |
| 83 | 89 | |
| 84 | 90 | virtual void machine_start(); |
src/mess/drivers/vip.c
| r15556 | r15557 | |
| 56 | 56 | |
| 57 | 57 | TODO: |
| 58 | 58 | |
| 59 | - move expansion cards to slot interface |
| 59 | 60 | - second VP580 keypad |
| 60 | 61 | |
| 61 | 62 | - VP-585 Expansion Keyboard Interface (2 keypad connectors for VP-580) |
| r15556 | r15557 | |
| 673 | 674 | NULL |
| 674 | 675 | }; |
| 675 | 676 | |
| 677 | static VIP_BYTEIO_PORT_INTERFACE( byteio_intf ) |
| 678 | { |
| 679 | DEVCB_NULL |
| 680 | }; |
| 681 | |
| 682 | static SLOT_INTERFACE_START( vip_byteio_cards ) |
| 683 | SLOT_INTERFACE_END |
| 684 | |
| 685 | static VIP_EXPANSION_INTERFACE( expansion_intf ) |
| 686 | { |
| 687 | DEVCB_NULL, |
| 688 | DEVCB_NULL, |
| 689 | DEVCB_NULL |
| 690 | }; |
| 691 | |
| 692 | static SLOT_INTERFACE_START( vip_expansion_cards ) |
| 693 | // VP550 |
| 694 | // VP551 |
| 695 | // VP590 |
| 696 | // VP595 |
| 697 | // VP585 |
| 698 | SLOT_INTERFACE_END |
| 699 | |
| 676 | 700 | static MACHINE_CONFIG_START( vip, vip_state ) |
| 677 | 701 | /* basic machine hardware */ |
| 678 | 702 | MCFG_CPU_ADD(CDP1802_TAG, COSMAC, XTAL_3_52128MHz/2) |
| r15556 | r15557 | |
| 697 | 721 | MCFG_SOUND_CONFIG_DISCRETE(vip) |
| 698 | 722 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 699 | 723 | |
| 724 | MCFG_VIP_BYTEIO_PORT_ADD(VIP_BYTEIO_PORT_TAG, byteio_intf, vip_byteio_cards, NULL, NULL) |
| 725 | MCFG_VIP_EXPANSION_SLOT_ADD(VIP_EXPANSION_SLOT_TAG, XTAL_3_52128MHz/2, expansion_intf, vip_expansion_cards, NULL, NULL) |
| 726 | |
| 700 | 727 | MCFG_VP595_ADD() |
| 701 | 728 | MCFG_VP550_ADD(XTAL_3_52128MHz/2) |
| 702 | 729 | MCFG_VP551_ADD(XTAL_3_52128MHz/2) |