trunk/src/mess/machine/vic1110.h
| r19357 | r19358 | |
| 42 | 42 | // device_vic20_expansion_card_interface overrides |
| 43 | 43 | virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); |
| 44 | 44 | virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); |
| 45 | |
| 46 | private: |
| 47 | required_ioport m_sw; |
| 45 | 48 | }; |
| 46 | 49 | |
| 47 | 50 | |
trunk/src/mess/machine/vp570.c
| r19357 | r19358 | |
| 62 | 62 | |
| 63 | 63 | vp570_device::vp570_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 64 | 64 | device_t(mconfig, VP570, "VP570", tag, owner, clock), |
| 65 | | device_vip_expansion_card_interface(mconfig, *this) |
| 65 | device_vip_expansion_card_interface(mconfig, *this), |
| 66 | m_ram(*this, "ram"), |
| 67 | m_base(*this, "BASE"), |
| 68 | m_sw1(*this, "SW1") |
| 66 | 69 | { |
| 67 | 70 | } |
| 68 | 71 | |
| r19357 | r19358 | |
| 73 | 76 | |
| 74 | 77 | void vp570_device::device_start() |
| 75 | 78 | { |
| 76 | | m_ram = auto_alloc_array(machine(), UINT8, 0x1000); |
| 79 | m_ram.allocate(0x1000); |
| 77 | 80 | } |
| 78 | 81 | |
| 79 | 82 | |
| r19357 | r19358 | |
| 85 | 88 | { |
| 86 | 89 | UINT8 data = 0xff; |
| 87 | 90 | |
| 88 | | offs_t base = ioport("BASE")->read() << 12; |
| 91 | offs_t base = m_base->read() << 12; |
| 89 | 92 | |
| 90 | 93 | if (offset >= base && offset < base + 0x1000) |
| 91 | 94 | { |
| r19357 | r19358 | |
| 104 | 107 | |
| 105 | 108 | void vp570_device::vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) |
| 106 | 109 | { |
| 107 | | offs_t base = ioport("BASE")->read() << 12; |
| 110 | offs_t base = m_base->read() << 12; |
| 108 | 111 | |
| 109 | 112 | if (offset >= base && offset < base + 0x1000) |
| 110 | 113 | { |
| 111 | 114 | *minh = 1; |
| 112 | 115 | |
| 113 | | if (ioport("SW1")->read()) |
| 116 | if (m_sw1->read()) |
| 114 | 117 | { |
| 115 | 118 | m_ram[offset & 0xfff] = data; |
| 116 | 119 | } |
trunk/src/mess/machine/vp590.c
| r19357 | r19358 | |
| 150 | 150 | vp590_device::vp590_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 151 | 151 | device_t(mconfig, VP590, "VP590", tag, owner, clock), |
| 152 | 152 | device_vip_expansion_card_interface(mconfig, *this), |
| 153 | | m_cgc(*this, CDP1862_TAG) |
| 153 | m_cgc(*this, CDP1862_TAG), |
| 154 | m_color_ram(*this, "color_ram"), |
| 155 | m_j1(*this, "J1"), |
| 156 | m_j2(*this, "J2") |
| 154 | 157 | { |
| 155 | 158 | } |
| 156 | 159 | |
| r19357 | r19358 | |
| 162 | 165 | void vp590_device::device_start() |
| 163 | 166 | { |
| 164 | 167 | // allocate memory |
| 165 | | m_color_ram = auto_alloc_array(machine(), UINT8, COLOR_RAM_SIZE); |
| 168 | m_color_ram.allocate(COLOR_RAM_SIZE); |
| 166 | 169 | |
| 167 | 170 | // state saving |
| 168 | | save_pointer(NAME(m_color_ram), COLOR_RAM_SIZE); |
| 171 | save_item(NAME(m_a12)); |
| 169 | 172 | save_item(NAME(m_color)); |
| 170 | 173 | save_item(NAME(m_keylatch)); |
| 171 | 174 | } |
| r19357 | r19358 | |
| 255 | 258 | |
| 256 | 259 | int vp590_device::vip_ef3_r() |
| 257 | 260 | { |
| 258 | | return BIT(ioport("J1")->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; |
| 261 | return BIT(m_j1->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; |
| 259 | 262 | } |
| 260 | 263 | |
| 261 | 264 | |
| r19357 | r19358 | |
| 265 | 268 | |
| 266 | 269 | int vp590_device::vip_ef4_r() |
| 267 | 270 | { |
| 268 | | return BIT(ioport("J2")->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; |
| 271 | return BIT(m_j2->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; |
| 269 | 272 | } |
trunk/src/mess/machine/vp585.c
| r19357 | r19358 | |
| 82 | 82 | |
| 83 | 83 | vp585_device::vp585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 84 | 84 | device_t(mconfig, VP585, "VP585", tag, owner, clock), |
| 85 | | device_vip_expansion_card_interface(mconfig, *this) |
| 85 | device_vip_expansion_card_interface(mconfig, *this), |
| 86 | m_j1(*this, "J1"), |
| 87 | m_j2(*this, "J2") |
| 86 | 88 | { |
| 87 | 89 | } |
| 88 | 90 | |
| r19357 | r19358 | |
| 117 | 119 | |
| 118 | 120 | int vp585_device::vip_ef3_r() |
| 119 | 121 | { |
| 120 | | return BIT(ioport("J1")->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; |
| 122 | return BIT(m_j1->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; |
| 121 | 123 | } |
| 122 | 124 | |
| 123 | 125 | |
| r19357 | r19358 | |
| 127 | 129 | |
| 128 | 130 | int vp585_device::vip_ef4_r() |
| 129 | 131 | { |
| 130 | | return BIT(ioport("J2")->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; |
| 132 | return BIT(m_j2->read(), m_keylatch) ? CLEAR_LINE : ASSERT_LINE; |
| 131 | 133 | } |
trunk/src/mess/machine/vic1110.c
| r19357 | r19358 | |
| 68 | 68 | |
| 69 | 69 | vic1110_device::vic1110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 70 | 70 | : device_t(mconfig, VIC1110, "VIC1110", tag, owner, clock), |
| 71 | | device_vic20_expansion_card_interface(mconfig, *this) |
| 71 | device_vic20_expansion_card_interface(mconfig, *this), |
| 72 | m_sw(*this, "SW") |
| 72 | 73 | { |
| 73 | 74 | } |
| 74 | 75 | |
| r19357 | r19358 | |
| 80 | 81 | void vic1110_device::device_start() |
| 81 | 82 | { |
| 82 | 83 | // allocate memory |
| 83 | | m_ram = auto_alloc_array(machine(), UINT8, 0x2000); |
| 84 | vic20_ram_pointer(machine(), 0x2000); |
| 84 | 85 | } |
| 85 | 86 | |
| 86 | 87 | |
| r19357 | r19358 | |
| 90 | 91 | |
| 91 | 92 | UINT8 vic1110_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) |
| 92 | 93 | { |
| 93 | | UINT8 sw = ioport("SW")->read(); |
| 94 | UINT8 sw = m_sw->read(); |
| 94 | 95 | |
| 95 | 96 | if ((!blk1 && (sw == BLK1)) || (!blk2 && (sw == BLK2)) || (!blk3 && (sw == BLK3)) || (!blk5 && (sw == BLK5))) |
| 96 | 97 | { |
| r19357 | r19358 | |
| 107 | 108 | |
| 108 | 109 | void vic1110_device::vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) |
| 109 | 110 | { |
| 110 | | UINT8 sw = ioport("SW")->read(); |
| 111 | UINT8 sw = m_sw->read(); |
| 111 | 112 | |
| 112 | 113 | if ((!blk1 && (sw == BLK1)) || (!blk2 && (sw == BLK2)) || (!blk3 && (sw == BLK3)) || (!blk5 && (sw == BLK5))) |
| 113 | 114 | { |