src/mess/machine/tandy2kb.c
| r0 | r13829 | |
| 1 | #include "tandy2kb.h"
|
| 2 | |
| 3 | |
| 4 | |
| 5 | //**************************************************************************
|
| 6 | // MACROS / CONSTANTS
|
| 7 | //**************************************************************************
|
| 8 | |
| 9 | #define I8048_TAG "m1"
|
| 10 | |
| 11 | |
| 12 | |
| 13 | //**************************************************************************
|
| 14 | // DEVICE DEFINITIONS
|
| 15 | //**************************************************************************
|
| 16 | |
| 17 | const device_type TANDY2K_KEYBOARD = &device_creator<tandy2k_keyboard_device>;
|
| 18 | |
| 19 | |
| 20 | |
| 21 | //-------------------------------------------------
|
| 22 | // ROM( tandy2k_keyboard )
|
| 23 | //-------------------------------------------------
|
| 24 | |
| 25 | ROM_START( tandy2k_keyboard )
|
| 26 | ROM_REGION( 0x400, I8048_TAG, 0 )
|
| 27 | ROM_LOAD( "keyboard.m1", 0x0000, 0x0400, NO_DUMP )
|
| 28 | ROM_END
|
| 29 | |
| 30 | |
| 31 | //-------------------------------------------------
|
| 32 | // rom_region - device-specific ROM region
|
| 33 | //-------------------------------------------------
|
| 34 | |
| 35 | const rom_entry *tandy2k_keyboard_device::device_rom_region() const
|
| 36 | {
|
| 37 | return ROM_NAME( tandy2k_keyboard );
|
| 38 | }
|
| 39 | |
| 40 | |
| 41 | //-------------------------------------------------
|
| 42 | // ADDRESS_MAP( kb_io )
|
| 43 | //-------------------------------------------------
|
| 44 | |
| 45 | static ADDRESS_MAP_START( tandy2k_keyboard_io, AS_IO, 8, tandy2k_keyboard_device )
|
| 46 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(kb_y0_w)
|
| 47 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(kb_y8_w)
|
| 48 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(kb_x0_r)
|
| 49 | ADDRESS_MAP_END
|
| 50 | |
| 51 | |
| 52 | //-------------------------------------------------
|
| 53 | // MACHINE_DRIVER( tandy2k_keyboard )
|
| 54 | //-------------------------------------------------
|
| 55 | |
| 56 | static MACHINE_CONFIG_FRAGMENT( tandy2k_keyboard )
|
| 57 | MCFG_CPU_ADD(I8048_TAG, I8048, 1000000) // ?
|
| 58 | MCFG_CPU_IO_MAP(tandy2k_keyboard_io)
|
| 59 | MCFG_DEVICE_DISABLE() // TODO
|
| 60 | MACHINE_CONFIG_END
|
| 61 | |
| 62 | |
| 63 | //-------------------------------------------------
|
| 64 | // machine_config_additions - device-specific
|
| 65 | // machine configurations
|
| 66 | //-------------------------------------------------
|
| 67 | |
| 68 | machine_config_constructor tandy2k_keyboard_device::device_mconfig_additions() const
|
| 69 | {
|
| 70 | return MACHINE_CONFIG_NAME( tandy2k_keyboard );
|
| 71 | }
|
| 72 | |
| 73 | |
| 74 | //-------------------------------------------------
|
| 75 | // INPUT_PORTS( tandy2k_keyboard )
|
| 76 | //-------------------------------------------------
|
| 77 | |
| 78 | INPUT_PORTS_START( tandy2k_keyboard )
|
| 79 | PORT_START("Y0")
|
| 80 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 81 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 82 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 83 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 84 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 85 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 86 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 87 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 88 | |
| 89 | PORT_START("Y1")
|
| 90 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 91 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 92 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 93 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 94 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 95 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 96 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 97 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 98 | |
| 99 | PORT_START("Y2")
|
| 100 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 101 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 102 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 103 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 104 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 105 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 106 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 107 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 108 | |
| 109 | PORT_START("Y3")
|
| 110 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 111 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 112 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 113 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 114 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 115 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 116 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 117 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 118 | |
| 119 | PORT_START("Y4")
|
| 120 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 121 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 122 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 123 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 124 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 125 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 126 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 127 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 128 | |
| 129 | PORT_START("Y5")
|
| 130 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 131 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 132 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 133 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 134 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 135 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 136 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 137 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 138 | |
| 139 | PORT_START("Y6")
|
| 140 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 141 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 142 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 143 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 144 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 145 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 146 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 147 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 148 | |
| 149 | PORT_START("Y7")
|
| 150 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 151 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 152 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 153 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 154 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 155 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 156 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 157 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 158 | |
| 159 | PORT_START("Y8")
|
| 160 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 161 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 162 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 163 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 164 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 165 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 166 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 167 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 168 | |
| 169 | PORT_START("Y9")
|
| 170 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 171 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 172 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 173 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 174 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 175 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 176 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 177 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 178 | |
| 179 | PORT_START("Y10")
|
| 180 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 181 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 182 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 183 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 184 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 185 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 186 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 187 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 188 | |
| 189 | PORT_START("Y11")
|
| 190 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 191 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 192 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 193 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 194 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 195 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 196 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 197 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
|
| 198 | INPUT_PORTS_END
|
| 199 | |
| 200 | |
| 201 | //-------------------------------------------------
|
| 202 | // input_ports - device-specific input ports
|
| 203 | //-------------------------------------------------
|
| 204 | |
| 205 | ioport_constructor tandy2k_keyboard_device::device_input_ports() const
|
| 206 | {
|
| 207 | return INPUT_PORTS_NAME( tandy2k_keyboard );
|
| 208 | }
|
| 209 | |
| 210 | |
| 211 | |
| 212 | //**************************************************************************
|
| 213 | // LIVE DEVICE
|
| 214 | //**************************************************************************
|
| 215 | |
| 216 | //-------------------------------------------------
|
| 217 | // tandy2k_keyboard_device - constructor
|
| 218 | //-------------------------------------------------
|
| 219 | |
| 220 | tandy2k_keyboard_device::tandy2k_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
| 221 | : device_t(mconfig, TANDY2K_KEYBOARD, "Tandy 2000 Keyboard", tag, owner, clock),
|
| 222 | m_maincpu(*this, I8048_TAG),
|
| 223 | m_keylatch(0xffff)
|
| 224 | {
|
| 225 | }
|
| 226 | |
| 227 | |
| 228 | //-------------------------------------------------
|
| 229 | // device_start - device-specific startup
|
| 230 | //-------------------------------------------------
|
| 231 | |
| 232 | void tandy2k_keyboard_device::device_start()
|
| 233 | {
|
| 234 | // state saving
|
| 235 | save_item(NAME(m_keylatch));
|
| 236 | }
|
| 237 | |
| 238 | |
| 239 | //-------------------------------------------------
|
| 240 | // device_reset - device-specific reset
|
| 241 | //-------------------------------------------------
|
| 242 | |
| 243 | void tandy2k_keyboard_device::device_reset()
|
| 244 | {
|
| 245 | }
|
| 246 | |
| 247 | |
| 248 | //-------------------------------------------------
|
| 249 | // kb_x0_r - |
| 250 | //-------------------------------------------------
|
| 251 | |
| 252 | READ8_MEMBER( tandy2k_keyboard_device::kb_x0_r )
|
| 253 | {
|
| 254 | /*
|
| 255 | |
| 256 | bit description
|
| 257 | |
| 258 | 0 X0
|
| 259 | 1 X1
|
| 260 | 2 X2
|
| 261 | 3 X3
|
| 262 | 4 X4
|
| 263 | 5 X5
|
| 264 | 6 X6
|
| 265 | 7 X7
|
| 266 | |
| 267 | */
|
| 268 | |
| 269 | UINT8 data = 0xff;
|
| 270 | |
| 271 | if (!BIT(m_keylatch, 0)) data &= input_port_read(machine(), "Y0");
|
| 272 | if (!BIT(m_keylatch, 1)) data &= input_port_read(machine(), "Y1");
|
| 273 | if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "Y2");
|
| 274 | if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "Y3");
|
| 275 | if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "Y4");
|
| 276 | if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "Y5");
|
| 277 | if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "Y6");
|
| 278 | if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "Y7");
|
| 279 | if (!BIT(m_keylatch, 8)) data &= input_port_read(machine(), "Y8");
|
| 280 | if (!BIT(m_keylatch, 9)) data &= input_port_read(machine(), "Y9");
|
| 281 | if (!BIT(m_keylatch, 10)) data &= input_port_read(machine(), "Y10");
|
| 282 | if (!BIT(m_keylatch, 11)) data &= input_port_read(machine(), "Y11");
|
| 283 | |
| 284 | return ~data;
|
| 285 | }
|
| 286 | |
| 287 | |
| 288 | //-------------------------------------------------
|
| 289 | // kb_y0_w - |
| 290 | //-------------------------------------------------
|
| 291 | |
| 292 | WRITE8_MEMBER( tandy2k_keyboard_device::kb_y0_w )
|
| 293 | {
|
| 294 | /*
|
| 295 | |
| 296 | bit description
|
| 297 | |
| 298 | 0 Y0
|
| 299 | 1 Y1
|
| 300 | 2 Y2
|
| 301 | 3 Y3
|
| 302 | 4 Y4
|
| 303 | 5 Y5
|
| 304 | 6 Y6
|
| 305 | 7 Y7
|
| 306 | |
| 307 | */
|
| 308 | |
| 309 | m_keylatch = (m_keylatch & 0xff00) | data;
|
| 310 | }
|
| 311 | |
| 312 | |
| 313 | //-------------------------------------------------
|
| 314 | // kb_y8_w - |
| 315 | //-------------------------------------------------
|
| 316 | |
| 317 | WRITE8_MEMBER( tandy2k_keyboard_device::kb_y8_w )
|
| 318 | {
|
| 319 | /*
|
| 320 | |
| 321 | bit description
|
| 322 | |
| 323 | 0 Y8
|
| 324 | 1 Y9
|
| 325 | 2 Y10
|
| 326 | 3 Y11
|
| 327 | 4 LED 2
|
| 328 | 5 LED 1
|
| 329 | 6
|
| 330 | 7
|
| 331 | |
| 332 | */
|
| 333 | |
| 334 | m_keylatch = ((data & 0x0f) << 8) | (m_keylatch & 0xff);
|
| 335 | }
|
src/mess/drivers/tandy2k.c
| r13828 | r13829 | |
| 24 | 24 | |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | | #define ADDRESS_MAP_MODERN |
| 28 | | |
| 29 | | #include "emu.h" |
| 30 | | #include "cpu/i86/i86.h" |
| 31 | | #include "cpu/mcs48/mcs48.h" |
| 32 | | #include "imagedev/flopdrv.h" |
| 33 | | #include "machine/ram.h" |
| 34 | | #include "machine/ctronics.h" |
| 35 | | #include "machine/i8255.h" |
| 36 | | #include "machine/i8251.h" |
| 37 | | #include "machine/pit8253.h" |
| 38 | | #include "machine/pic8259.h" |
| 39 | | #include "machine/upd765.h" |
| 40 | | #include "sound/speaker.h" |
| 41 | | #include "video/crt9007.h" |
| 42 | | #include "video/crt9021.h" |
| 43 | | #include "video/crt9212.h" |
| 44 | 27 | #include "includes/tandy2k.h" |
| 45 | 28 | |
| 46 | 29 | /* Read/Write Handlers */ |
| r13828 | r13829 | |
| 254 | 237 | logerror("Address Control %02x\n", data); |
| 255 | 238 | } |
| 256 | 239 | |
| 257 | | READ8_MEMBER( tandy2k_state::keyboard_x0_r ) |
| 258 | | { |
| 259 | | /* |
| 260 | | |
| 261 | | bit description |
| 262 | | |
| 263 | | 0 X0 |
| 264 | | 1 X1 |
| 265 | | 2 X2 |
| 266 | | 3 X3 |
| 267 | | 4 X4 |
| 268 | | 5 X5 |
| 269 | | 6 X6 |
| 270 | | 7 X7 |
| 271 | | |
| 272 | | */ |
| 273 | | |
| 274 | | UINT8 data = 0xff; |
| 275 | | |
| 276 | | if (!BIT(m_keylatch, 0)) data &= input_port_read(machine(), "Y0"); |
| 277 | | if (!BIT(m_keylatch, 1)) data &= input_port_read(machine(), "Y1"); |
| 278 | | if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "Y2"); |
| 279 | | if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "Y3"); |
| 280 | | if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "Y4"); |
| 281 | | if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "Y5"); |
| 282 | | if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "Y6"); |
| 283 | | if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "Y7"); |
| 284 | | if (!BIT(m_keylatch, 8)) data &= input_port_read(machine(), "Y8"); |
| 285 | | if (!BIT(m_keylatch, 9)) data &= input_port_read(machine(), "Y9"); |
| 286 | | if (!BIT(m_keylatch, 10)) data &= input_port_read(machine(), "Y10"); |
| 287 | | if (!BIT(m_keylatch, 11)) data &= input_port_read(machine(), "Y11"); |
| 288 | | |
| 289 | | return ~data; |
| 290 | | } |
| 291 | | |
| 292 | | WRITE8_MEMBER( tandy2k_state::keyboard_y0_w ) |
| 293 | | { |
| 294 | | /* |
| 295 | | |
| 296 | | bit description |
| 297 | | |
| 298 | | 0 Y0 |
| 299 | | 1 Y1 |
| 300 | | 2 Y2 |
| 301 | | 3 Y3 |
| 302 | | 4 Y4 |
| 303 | | 5 Y5 |
| 304 | | 6 Y6 |
| 305 | | 7 Y7 |
| 306 | | |
| 307 | | */ |
| 308 | | |
| 309 | | /* keyboard row select */ |
| 310 | | m_keylatch = (m_keylatch & 0xff00) | data; |
| 311 | | } |
| 312 | | |
| 313 | | WRITE8_MEMBER( tandy2k_state::keyboard_y8_w ) |
| 314 | | { |
| 315 | | /* |
| 316 | | |
| 317 | | bit description |
| 318 | | |
| 319 | | 0 Y8 |
| 320 | | 1 Y9 |
| 321 | | 2 Y10 |
| 322 | | 3 Y11 |
| 323 | | 4 LED 2 |
| 324 | | 5 LED 1 |
| 325 | | 6 |
| 326 | | 7 |
| 327 | | |
| 328 | | */ |
| 329 | | |
| 330 | | /* keyboard row select */ |
| 331 | | m_keylatch = ((data & 0x0f) << 8) | (m_keylatch & 0xff); |
| 332 | | } |
| 333 | | |
| 334 | 240 | /* Memory Maps */ |
| 335 | 241 | |
| 336 | 242 | static ADDRESS_MAP_START( tandy2k_mem, AS_PROGRAM, 16, tandy2k_state ) |
| r13828 | r13829 | |
| 373 | 279 | AM_RANGE(0x0000, 0x3fff) AM_READ(videoram_r) |
| 374 | 280 | ADDRESS_MAP_END |
| 375 | 281 | |
| 376 | | static ADDRESS_MAP_START( keyboard_io, AS_IO, 8, tandy2k_state ) |
| 377 | | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(keyboard_y0_w) |
| 378 | | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(keyboard_y8_w) |
| 379 | | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(keyboard_x0_r) |
| 380 | | ADDRESS_MAP_END |
| 381 | | |
| 382 | 282 | /* Input Ports */ |
| 383 | 283 | |
| 384 | 284 | static INPUT_PORTS_START( tandy2k ) |
| 385 | | PORT_START("ROW0") |
| 386 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 387 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 388 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 389 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 390 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 391 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 392 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 393 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 394 | | |
| 395 | | PORT_START("ROW1") |
| 396 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 397 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 398 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 399 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 400 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 401 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 402 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 403 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 404 | | |
| 405 | | PORT_START("ROW2") |
| 406 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 407 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 408 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 409 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 410 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 411 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 412 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 413 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 414 | | |
| 415 | | PORT_START("ROW3") |
| 416 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 417 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 418 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 419 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 420 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 421 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 422 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 423 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 424 | | |
| 425 | | PORT_START("ROW4") |
| 426 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 427 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 428 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 429 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 430 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 431 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 432 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 433 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 434 | | |
| 435 | | PORT_START("ROW5") |
| 436 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 437 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 438 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 439 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 440 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 441 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 442 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 443 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 444 | | |
| 445 | | PORT_START("ROW6") |
| 446 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 447 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 448 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 449 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 450 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 451 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 452 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 453 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 454 | | |
| 455 | | PORT_START("ROW7") |
| 456 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 457 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 458 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 459 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 460 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 461 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 462 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 463 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 464 | | |
| 465 | | PORT_START("ROW8") |
| 466 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 467 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 468 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 469 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 470 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 471 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 472 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 473 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 474 | | |
| 475 | | PORT_START("ROW9") |
| 476 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 477 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 478 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 479 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 480 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 481 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 482 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 483 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 484 | | |
| 485 | | PORT_START("ROW10") |
| 486 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 487 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 488 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 489 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 490 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 491 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 492 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 493 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 494 | | |
| 495 | | PORT_START("ROW11") |
| 496 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 497 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 498 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 499 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 500 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 501 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 502 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 503 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 285 | // defined in machine/tandy2kb.c |
| 504 | 286 | INPUT_PORTS_END |
| 505 | 287 | |
| 506 | 288 | /* Video */ |
| r13828 | r13829 | |
| 811 | 593 | DEVCB_NULL, |
| 812 | 594 | FLOPPY_STANDARD_5_25_DSQD, |
| 813 | 595 | LEGACY_FLOPPY_OPTIONS_NAME(default), |
| 814 | | NULL, |
| 596 | "floppy_5_25", |
| 815 | 597 | NULL |
| 816 | 598 | }; |
| 817 | 599 | |
| r13828 | r13829 | |
| 860 | 642 | /* register for state saving */ |
| 861 | 643 | save_item(NAME(m_dma_mux)); |
| 862 | 644 | save_item(NAME(m_kben)); |
| 863 | | save_item(NAME(m_keylatch)); |
| 864 | 645 | save_item(NAME(m_extclk)); |
| 865 | 646 | save_item(NAME(m_rxrdy)); |
| 866 | 647 | save_item(NAME(m_txrdy)); |
| r13828 | r13829 | |
| 880 | 661 | MCFG_CPU_PROGRAM_MAP(tandy2k_mem) |
| 881 | 662 | MCFG_CPU_IO_MAP(tandy2k_io) |
| 882 | 663 | |
| 883 | | MCFG_CPU_ADD(I8048_TAG, I8048, 1000000) // ? |
| 884 | | MCFG_CPU_IO_MAP(keyboard_io) |
| 885 | | MCFG_DEVICE_DISABLE() |
| 886 | | |
| 887 | 664 | /* video hardware */ |
| 888 | 665 | MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 889 | 666 | MCFG_SCREEN_REFRESH_RATE(50) |
| r13828 | r13829 | |
| 914 | 691 | MCFG_UPD765A_ADD(I8272A_TAG, i8272_intf) |
| 915 | 692 | MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(tandy2k_floppy_interface) |
| 916 | 693 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics) |
| 694 | MCFG_TANDY2K_KEYBOARD_ADD() |
| 917 | 695 | |
| 918 | 696 | /* internal ram */ |
| 919 | 697 | MCFG_RAM_ADD(RAM_TAG) |
| r13828 | r13829 | |
| 936 | 714 | ROM_REGION( 0x2000, I80186_TAG, 0 ) |
| 937 | 715 | ROM_LOAD16_BYTE( "484a00.u48", 0x0000, 0x1000, CRC(a5ee3e90) SHA1(4b1f404a4337c67065dd272d62ff88dcdee5e34b) ) |
| 938 | 716 | ROM_LOAD16_BYTE( "474600.u47", 0x0001, 0x1000, CRC(345701c5) SHA1(a775cbfa110b7a88f32834aaa2a9b868cbeed25b) ) |
| 939 | | |
| 940 | | ROM_REGION( 0x400, I8048_TAG, 0 ) |
| 941 | | ROM_LOAD( "keyboard.m1", 0x0000, 0x0400, NO_DUMP ) |
| 942 | 717 | ROM_END |
| 943 | 718 | |
| 944 | 719 | #define rom_tandy2khd rom_tandy2k |