trunk/src/emu/machine/6551acia.c
| r20779 | r20780 | |
| 1 | | /********************************************************************* |
| 2 | | |
| 3 | | 6551.h |
| 4 | | |
| 5 | | MOS Technology 6551 Asynchronous Communications Interface Adapter |
| 6 | | |
| 7 | | A1 A0 Write Read |
| 8 | | 0 0 Transmit Data Register Receiver Data Register |
| 9 | | 0 1 Programmed Reset Status Register |
| 10 | | 1 0 Command Register |
| 11 | | 1 1 Control Register |
| 12 | | |
| 13 | | *********************************************************************/ |
| 14 | | |
| 15 | | #include "emu.h" |
| 16 | | #include "6551acia.h" |
| 17 | | |
| 18 | | |
| 19 | | //************************************************************************** |
| 20 | | // DEVICE DEFINITIONS |
| 21 | | //************************************************************************** |
| 22 | | |
| 23 | | const device_type ACIA6551 = &device_creator<acia6551_device>; |
| 24 | | |
| 25 | | //------------------------------------------------- |
| 26 | | // acia6551_device - constructor |
| 27 | | //------------------------------------------------- |
| 28 | | |
| 29 | | acia6551_device::acia6551_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 30 | | : device_t(mconfig, ACIA6551, "MOS Technology 6551 ACIA", tag, owner, clock), |
| 31 | | device_serial_interface(mconfig, *this) |
| 32 | | { |
| 33 | | } |
| 34 | | |
| 35 | | /*************************************************************************** |
| 36 | | IMPLEMENTATION |
| 37 | | ***************************************************************************/ |
| 38 | | |
| 39 | | /*------------------------------------------------- |
| 40 | | input_callback - called when other side |
| 41 | | has updated state |
| 42 | | -------------------------------------------------*/ |
| 43 | | void acia6551_device::input_callback(UINT8 state) |
| 44 | | { |
| 45 | | m_input_state = state; |
| 46 | | } |
| 47 | | |
| 48 | | /*------------------------------------------------- |
| 49 | | timer_callback |
| 50 | | -------------------------------------------------*/ |
| 51 | | void acia6551_device::timer_callback() |
| 52 | | { |
| 53 | | /* get bit received from other side and update receive register */ |
| 54 | | receive_register_update_bit(get_in_data_bit()); |
| 55 | | |
| 56 | | if (is_receive_register_full()) |
| 57 | | { |
| 58 | | receive_register_extract(); |
| 59 | | receive_character(get_received_char()); |
| 60 | | } |
| 61 | | |
| 62 | | /* transmit register full? */ |
| 63 | | if ((m_status_register & (1<<4))==0) |
| 64 | | { |
| 65 | | /* if transmit reg is empty */ |
| 66 | | if (is_transmit_register_empty()) |
| 67 | | { |
| 68 | | /* set it up */ |
| 69 | | transmit_register_setup(m_transmit_data_register); |
| 70 | | /* acia transmit reg now empty */ |
| 71 | | m_status_register |=(1<<4); |
| 72 | | /* and refresh ints */ |
| 73 | | refresh_ints(); |
| 74 | | } |
| 75 | | } |
| 76 | | |
| 77 | | /* if transmit is not empty... transmit data */ |
| 78 | | if (!is_transmit_register_empty()) |
| 79 | | { |
| 80 | | // logerror("UART6551\n"); |
| 81 | | transmit_register_send_bit(); |
| 82 | | } |
| 83 | | } |
| 84 | | |
| 85 | | static TIMER_CALLBACK(acia_6551_timer_callback) |
| 86 | | { |
| 87 | | reinterpret_cast<acia6551_device *>(ptr)->timer_callback(); |
| 88 | | } |
| 89 | | |
| 90 | | //------------------------------------------------- |
| 91 | | // device_start - device-specific startup |
| 92 | | //------------------------------------------------- |
| 93 | | |
| 94 | | void acia6551_device::device_start() |
| 95 | | { |
| 96 | | /* transmit data reg is empty */ |
| 97 | | m_status_register = (1<<4); |
| 98 | | m_timer = machine().scheduler().timer_alloc(FUNC(acia_6551_timer_callback), (void *) this); |
| 99 | | |
| 100 | | transmit_register_reset(); |
| 101 | | receive_register_reset(); |
| 102 | | } |
| 103 | | |
| 104 | | |
| 105 | | |
| 106 | | /*------------------------------------------------- |
| 107 | | refresh_ints - update interrupt output |
| 108 | | -------------------------------------------------*/ |
| 109 | | |
| 110 | | void acia6551_device::refresh_ints() |
| 111 | | { |
| 112 | | int interrupt_state; |
| 113 | | |
| 114 | | interrupt_state = 0; |
| 115 | | |
| 116 | | /* receive interrupts */ |
| 117 | | |
| 118 | | /* receive data register full? */ |
| 119 | | if (m_status_register & (1<<3)) |
| 120 | | { |
| 121 | | /* receiver interrupt enable? */ |
| 122 | | if ((m_command_register & (1<<1))==0) |
| 123 | | { |
| 124 | | /* trigger a interrupt */ |
| 125 | | interrupt_state = 1; |
| 126 | | } |
| 127 | | } |
| 128 | | |
| 129 | | /* set state of irq bit in status register */ |
| 130 | | m_status_register &= ~(1<<7); |
| 131 | | |
| 132 | | if (interrupt_state) |
| 133 | | { |
| 134 | | m_status_register |=(1<<7); |
| 135 | | } |
| 136 | | |
| 137 | | //if (m_irq_callback != NULL) |
| 138 | | //(*m_irq_callback)(interrupt_state); |
| 139 | | } |
| 140 | | |
| 141 | | |
| 142 | | |
| 143 | | /*------------------------------------------------- |
| 144 | | receive_character |
| 145 | | -------------------------------------------------*/ |
| 146 | | |
| 147 | | void acia6551_device::receive_character(UINT8 ch) |
| 148 | | { |
| 149 | | /* receive register full? */ |
| 150 | | if (m_status_register & (1<<3)) |
| 151 | | { |
| 152 | | /* set overrun error */ |
| 153 | | m_status_register |= (1<<2); |
| 154 | | return; |
| 155 | | } |
| 156 | | |
| 157 | | /* set new byte */ |
| 158 | | m_receive_data_register = ch; |
| 159 | | /* receive register is full */ |
| 160 | | m_status_register |= (1<<3); |
| 161 | | /* update ints */ |
| 162 | | refresh_ints(); |
| 163 | | } |
| 164 | | |
| 165 | | |
| 166 | | |
| 167 | | /*------------------------------------------------- |
| 168 | | read |
| 169 | | -------------------------------------------------*/ |
| 170 | | |
| 171 | | READ8_MEMBER(acia6551_device::read) |
| 172 | | { |
| 173 | | unsigned char data; |
| 174 | | |
| 175 | | data = 0x0ff; |
| 176 | | switch (offset & 0x03) |
| 177 | | { |
| 178 | | case 0: |
| 179 | | { |
| 180 | | /* clear parity error, framing error and overrun error */ |
| 181 | | /* when read of data reigster is done */ |
| 182 | | m_status_register &=~((1<<0) | (1<<1) | (1<<2)); |
| 183 | | /* clear receive data register full flag */ |
| 184 | | m_status_register &=~(1<<3); |
| 185 | | /* return data */ |
| 186 | | data = m_receive_data_register; |
| 187 | | } |
| 188 | | break; |
| 189 | | |
| 190 | | /* |
| 191 | | Status cleared by |
| 192 | | b0 Parity error * (1: error) self clearing ** |
| 193 | | b1 Framing error * (1: error) self clearing ** |
| 194 | | b2 Overrun * (1: error) self clearing ** |
| 195 | | b3 Receive Data Register Full (1: full) Read Receive Data Register |
| 196 | | b4 Transmit Data Reg Empty (1: empty) Write Transmit Data Register |
| 197 | | b5 DCD (0: DCD low, 1: DCD high) Not resettable, reflects DCD state |
| 198 | | b6 DSR (0: DSR low, 1: DCD high) Not resettable, reflects DSR state |
| 199 | | b7 IRQ (0: no int., 1: interrupt) Read Status Register |
| 200 | | */ |
| 201 | | case 1: |
| 202 | | { |
| 203 | | data = m_status_register; |
| 204 | | /* clear interrupt */ |
| 205 | | m_status_register &= ~(1<<7); |
| 206 | | } |
| 207 | | break; |
| 208 | | |
| 209 | | case 2: |
| 210 | | data = m_command_register; |
| 211 | | break; |
| 212 | | |
| 213 | | case 3: |
| 214 | | data = m_control_register; |
| 215 | | break; |
| 216 | | |
| 217 | | default: |
| 218 | | break; |
| 219 | | } |
| 220 | | |
| 221 | | //logerror("6551 R %04x %02x\n",offset & 0x03,data); |
| 222 | | |
| 223 | | return data; |
| 224 | | } |
| 225 | | |
| 226 | | |
| 227 | | |
| 228 | | /*------------------------------------------------- |
| 229 | | update_data_form |
| 230 | | -------------------------------------------------*/ |
| 231 | | |
| 232 | | void acia6551_device::update_data_form() |
| 233 | | { |
| 234 | | int word_length = 8-((m_control_register>>5) & 0x03); |
| 235 | | int stop_bit_count = (m_control_register>>7)+1; |
| 236 | | int parity = 0; |
| 237 | | if (m_command_register & (1<<5)) |
| 238 | | { |
| 239 | | parity = SERIAL_PARITY_ODD; |
| 240 | | } |
| 241 | | else |
| 242 | | { |
| 243 | | parity = SERIAL_PARITY_NONE; |
| 244 | | } |
| 245 | | |
| 246 | | set_data_frame(word_length, stop_bit_count, parity); |
| 247 | | } |
| 248 | | |
| 249 | | |
| 250 | | |
| 251 | | /*------------------------------------------------- |
| 252 | | write |
| 253 | | -------------------------------------------------*/ |
| 254 | | |
| 255 | | WRITE8_MEMBER(acia6551_device::write) |
| 256 | | { |
| 257 | | //logerror("6551 W %04x %02x\n",offset & 0x03, data); |
| 258 | | |
| 259 | | switch (offset & 0x03) |
| 260 | | { |
| 261 | | case 0: |
| 262 | | { |
| 263 | | /* clear transmit data register empty */ |
| 264 | | m_status_register &= ~(1<<4); |
| 265 | | /* store byte */ |
| 266 | | m_transmit_data_register = data; |
| 267 | | |
| 268 | | } |
| 269 | | break; |
| 270 | | |
| 271 | | case 1: |
| 272 | | { |
| 273 | | /* telstrat writes 0x07f! */ |
| 274 | | } |
| 275 | | break; |
| 276 | | |
| 277 | | |
| 278 | | /* |
| 279 | | Command Register: |
| 280 | | |
| 281 | | b0 Data Terminal Ready |
| 282 | | 0 : disable receiver and all interrupts (DTR high) |
| 283 | | 1 : enable receiver and all interrupts (DTR low) |
| 284 | | b1 Receiver Interrupt Enable |
| 285 | | 0 : IRQ interrupt enabled from bit 3 of status register |
| 286 | | 1 : IRQ interrupt disabled |
| 287 | | b3,b2 Transmitter Control |
| 288 | | Transmit Interrupt RTS level Transmitter |
| 289 | | 00 disabled high off |
| 290 | | 01 enabled low on |
| 291 | | 10 disabled low on |
| 292 | | 11 disabled low Transmit BRK |
| 293 | | b4 Normal/Echo Mode for Receiver |
| 294 | | 0 : normal |
| 295 | | 1 : echo (bits 2 and 3 must be 0) |
| 296 | | b5 Parity Enable |
| 297 | | 0 : parity disabled, no parity bit generated or received |
| 298 | | 1 : parity enabled |
| 299 | | b7,b6 Parity |
| 300 | | 00 : odd parity receiver and transmitter |
| 301 | | 01 : even parity receiver and transmitter |
| 302 | | 10 : mark parity bit transmitted, parity check disabled |
| 303 | | 11 : space parity bit transmitted, parity check disabled |
| 304 | | */ |
| 305 | | |
| 306 | | case 2: |
| 307 | | { |
| 308 | | m_command_register = data; |
| 309 | | |
| 310 | | /* update state of dtr */ |
| 311 | | m_connection_state &=~SERIAL_STATE_DTR; |
| 312 | | if (m_command_register & (1<<0)) |
| 313 | | { |
| 314 | | m_connection_state |=SERIAL_STATE_DTR; |
| 315 | | } |
| 316 | | |
| 317 | | /* update state of rts */ |
| 318 | | switch ((m_command_register>>2) & 0x03) |
| 319 | | { |
| 320 | | case 0: |
| 321 | | { |
| 322 | | m_connection_state &=~SERIAL_STATE_RTS; |
| 323 | | } |
| 324 | | break; |
| 325 | | |
| 326 | | case 1: |
| 327 | | case 2: |
| 328 | | case 3: |
| 329 | | { |
| 330 | | m_connection_state |=SERIAL_STATE_RTS; |
| 331 | | } |
| 332 | | break; |
| 333 | | } |
| 334 | | |
| 335 | | serial_connection_out(); |
| 336 | | update_data_form(); |
| 337 | | } |
| 338 | | break; |
| 339 | | |
| 340 | | /* |
| 341 | | Control register: |
| 342 | | |
| 343 | | b3-b0 baud rate generator: |
| 344 | | 0000 : 16x external clock |
| 345 | | 0001 : 50 baud |
| 346 | | 0010 : 75 25 |
| 347 | | 0011 : 110 35 |
| 348 | | 0100 : 134.5 |
| 349 | | 0101 : 150 |
| 350 | | 0110 : 300 150 |
| 351 | | 0111 : 600 300 |
| 352 | | 1000 : 1200 600 |
| 353 | | 1001 : 1800 600 |
| 354 | | 1010 : 2400 600 |
| 355 | | 1011 : 3600 1200 |
| 356 | | 1100 : 4800 1200 |
| 357 | | 1101 : 7200 2400 |
| 358 | | 1110 : 9600 2400 |
| 359 | | 1111 : 19,200 9600 |
| 360 | | b4 receiver clock source |
| 361 | | 0 : external receiver clock |
| 362 | | 1 : baud rate generator |
| 363 | | b6,b5 word length |
| 364 | | 00 : 8 bits |
| 365 | | 01 : 7 |
| 366 | | 10 : 6 |
| 367 | | 11 : 5 |
| 368 | | b7 stop bits |
| 369 | | 0 : 1 stop bit |
| 370 | | 1 : 2 stop bits |
| 371 | | (1 stop bit if parity and word length = 8) |
| 372 | | (1 1/2 stop bits if word length = 5 and no parity) |
| 373 | | */ |
| 374 | | case 3: |
| 375 | | { |
| 376 | | unsigned char previous_control_register; |
| 377 | | |
| 378 | | previous_control_register = m_control_register; |
| 379 | | |
| 380 | | if (((previous_control_register^data) & 0x07)!=0) |
| 381 | | { |
| 382 | | int rate; |
| 383 | | |
| 384 | | rate = data & 0x07; |
| 385 | | |
| 386 | | /* baud rate changed? */ |
| 387 | | m_timer->reset(); |
| 388 | | |
| 389 | | if (rate==0) |
| 390 | | { |
| 391 | | /* 16x external clock */ |
| 392 | | logerror("6551: external clock not supported!\n"); |
| 393 | | } |
| 394 | | else |
| 395 | | { |
| 396 | | int baud_rate; |
| 397 | | |
| 398 | | switch (rate) |
| 399 | | { |
| 400 | | default: |
| 401 | | case 1: |
| 402 | | { |
| 403 | | baud_rate = 50; |
| 404 | | } |
| 405 | | break; |
| 406 | | |
| 407 | | case 2: |
| 408 | | { |
| 409 | | baud_rate = 75; |
| 410 | | } |
| 411 | | break; |
| 412 | | |
| 413 | | case 3: |
| 414 | | { |
| 415 | | baud_rate = 110; |
| 416 | | } |
| 417 | | break; |
| 418 | | |
| 419 | | case 4: |
| 420 | | { |
| 421 | | baud_rate = 135; |
| 422 | | } |
| 423 | | break; |
| 424 | | |
| 425 | | case 5: |
| 426 | | { |
| 427 | | baud_rate = 150; |
| 428 | | } |
| 429 | | break; |
| 430 | | |
| 431 | | case 6: |
| 432 | | { |
| 433 | | baud_rate = 300; |
| 434 | | } |
| 435 | | break; |
| 436 | | |
| 437 | | case 7: |
| 438 | | { |
| 439 | | baud_rate = 600; |
| 440 | | } |
| 441 | | break; |
| 442 | | |
| 443 | | case 8: |
| 444 | | { |
| 445 | | baud_rate = 1200; |
| 446 | | } |
| 447 | | break; |
| 448 | | |
| 449 | | case 9: |
| 450 | | { |
| 451 | | baud_rate = 1800; |
| 452 | | } |
| 453 | | break; |
| 454 | | |
| 455 | | case 10: |
| 456 | | { |
| 457 | | baud_rate = 2400; |
| 458 | | } |
| 459 | | break; |
| 460 | | |
| 461 | | case 11: |
| 462 | | { |
| 463 | | baud_rate = 3600; |
| 464 | | } |
| 465 | | break; |
| 466 | | |
| 467 | | case 12: |
| 468 | | { |
| 469 | | baud_rate = 4800; |
| 470 | | } |
| 471 | | break; |
| 472 | | |
| 473 | | case 13: |
| 474 | | { |
| 475 | | baud_rate = 7200; |
| 476 | | } |
| 477 | | break; |
| 478 | | |
| 479 | | case 14: |
| 480 | | { |
| 481 | | baud_rate = 9600; |
| 482 | | } |
| 483 | | break; |
| 484 | | |
| 485 | | case 15: |
| 486 | | { |
| 487 | | baud_rate = 19200; |
| 488 | | } |
| 489 | | break; |
| 490 | | } |
| 491 | | |
| 492 | | m_timer->adjust(attotime::zero, 0, attotime::from_hz(baud_rate)); |
| 493 | | } |
| 494 | | } |
| 495 | | |
| 496 | | m_control_register = data; |
| 497 | | update_data_form(); |
| 498 | | } |
| 499 | | break; |
| 500 | | |
| 501 | | default: |
| 502 | | break; |
| 503 | | } |
| 504 | | |
| 505 | | } |
trunk/src/mess/drivers/digel804.c
| r20779 | r20780 | |
| 60 | 60 | #include "machine/terminal.h" |
| 61 | 61 | #include "sound/speaker.h" |
| 62 | 62 | #include "machine/roc10937.h" |
| 63 | | #include "machine/6551acia.h" |
| 63 | #include "machine/mos6551.h" |
| 64 | 64 | #include "machine/mm74c922.h" |
| 65 | 65 | #include "machine/ram.h" |
| 66 | 66 | #include "digel804.lh" |
| r20779 | r20780 | |
| 84 | 84 | required_device<cpu_device> m_maincpu; |
| 85 | 85 | required_device<generic_terminal_device> m_terminal; |
| 86 | 86 | required_device<speaker_sound_device> m_speaker; |
| 87 | | required_device<acia6551_device> m_acia; |
| 87 | required_device<mos6551_device> m_acia; |
| 88 | 88 | required_device<roc10937_t> m_vfd; |
| 89 | 89 | required_device<mm74c922_device> m_kb; |
| 90 | 90 | required_device<ram_device> m_ram; |
| r20779 | r20780 | |
| 480 | 480 | AM_RANGE(0x85, 0x85) AM_MIRROR(0x38) AM_READ(acia_command_r) // (ACIA command reg) |
| 481 | 481 | AM_RANGE(0x86, 0x86) AM_MIRROR(0x38) AM_WRITE(acia_control_w) // (ACIA control reg) |
| 482 | 482 | AM_RANGE(0x87, 0x87) AM_MIRROR(0x38) AM_READ(acia_control_r) // (ACIA control reg) |
| 483 | | //AM_RANGE(0x80,0x87) AM_MIRROR(0x38) AM_SHIFT(-1) AM_DEVREADWRITE("acia", acia6551_device, read, write) // this doesn't work since we lack an AM_SHIFT command |
| 483 | //AM_RANGE(0x80,0x87) AM_MIRROR(0x38) AM_SHIFT(-1) AM_DEVREADWRITE("acia", mos6551_device, read, write) // this doesn't work since we lack an AM_SHIFT command |
| 484 | 484 | |
| 485 | 485 | ADDRESS_MAP_END |
| 486 | 486 | |
| r20779 | r20780 | |
| 507 | 507 | AM_RANGE(0x85, 0x85) AM_MIRROR(0x38) AM_READ(acia_command_r) // (ACIA command reg) |
| 508 | 508 | AM_RANGE(0x86, 0x86) AM_MIRROR(0x38) AM_WRITE(acia_control_w) // (ACIA control reg) |
| 509 | 509 | AM_RANGE(0x87, 0x87) AM_MIRROR(0x38) AM_READ(acia_control_r) // (ACIA control reg) |
| 510 | | //AM_RANGE(0x80,0x87) AM_MIRROR(0x38) AM_SHIFT(-1) AM_DEVREADWRITE("acia", acia6551_device, read, write) // this doesn't work since we lack an AM_SHIFT command |
| 510 | //AM_RANGE(0x80,0x87) AM_MIRROR(0x38) AM_SHIFT(-1) AM_DEVREADWRITE("acia", mos6551_device, read, write) // this doesn't work since we lack an AM_SHIFT command |
| 511 | 511 | |
| 512 | 512 | ADDRESS_MAP_END |
| 513 | 513 | |
| r20779 | r20780 | |
| 561 | 561 | ******************************************************************************/ |
| 562 | 562 | WRITE8_MEMBER(digel804_state::digel804_serial_put) |
| 563 | 563 | { |
| 564 | | m_acia->receive_character(data); |
| 564 | //m_acia->receive_character(data); |
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | static GENERIC_TERMINAL_INTERFACE( digel804_terminal_intf ) |
| r20779 | r20780 | |
| 603 | 603 | MCFG_MM74C923_ADD("74c923", digel804_keypad_intf) |
| 604 | 604 | |
| 605 | 605 | /* acia */ |
| 606 | | MCFG_ACIA6551_ADD("acia") |
| 606 | MCFG_MOS6551_ADD("acia", XTAL_1_8432MHz, NULL) |
| 607 | 607 | |
| 608 | 608 | MCFG_RAM_ADD(RAM_TAG) |
| 609 | 609 | MCFG_RAM_DEFAULT_SIZE("256K") |
trunk/src/mess/drivers/thomson.c
| r20779 | r20780 | |
| 308 | 308 | AM_RANGE ( 0xe7cc, 0xe7cf ) AM_DEVREADWRITE( "pia_1", pia6821_device, read_alt, write_alt ) |
| 309 | 309 | AM_RANGE ( 0xe7d0, 0xe7df ) AM_READWRITE_LEGACY(to7_floppy_r, to7_floppy_w ) |
| 310 | 310 | AM_RANGE ( 0xe7e0, 0xe7e3 ) AM_DEVREADWRITE( "pia_2", pia6821_device, read_alt, write_alt ) |
| 311 | | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE( "acia", acia6551_device, read, write ) |
| 311 | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE( "acia", mos6551_device, read, write ) |
| 312 | 312 | AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE_LEGACY(to7_midi_r, to7_midi_w ) |
| 313 | 313 | AM_RANGE ( 0xe7f8, 0xe7fb ) AM_DEVREADWRITE( "pia_3", pia6821_device, read_alt, write_alt ) |
| 314 | 314 | AM_RANGE ( 0xe7fe, 0xe7ff ) AM_READWRITE_LEGACY(to7_modem_mea8000_r, to7_modem_mea8000_w ) |
| r20779 | r20780 | |
| 672 | 672 | MCFG_PIA6821_ADD( THOM_PIA_MODEM, to7_pia6821_modem ) |
| 673 | 673 | |
| 674 | 674 | /* acia */ |
| 675 | | MCFG_ACIA6551_ADD("acia") |
| 675 | MCFG_MOS6551_ADD("acia", XTAL_1_8432MHz, NULL) |
| 676 | 676 | |
| 677 | 677 | /* to7 serial io line */ |
| 678 | 678 | MCFG_TO7_IO_LINE_ADD("to7_io") |
| r20779 | r20780 | |
| 769 | 769 | AM_RANGE ( 0xe7d0, 0xe7df ) AM_READWRITE_LEGACY(to7_floppy_r, to7_floppy_w ) |
| 770 | 770 | AM_RANGE ( 0xe7e0, 0xe7e3 ) AM_DEVREADWRITE( "pia_2", pia6821_device, read_alt, write_alt ) |
| 771 | 771 | AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE_LEGACY(to770_gatearray_r, to770_gatearray_w ) |
| 772 | | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE( "acia", acia6551_device, read, write ) |
| 772 | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE( "acia", mos6551_device, read, write ) |
| 773 | 773 | AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE_LEGACY(to7_midi_r, to7_midi_w ) |
| 774 | 774 | AM_RANGE ( 0xe7f8, 0xe7fb ) AM_DEVREADWRITE( "pia_3", pia6821_device, read_alt, write_alt ) |
| 775 | 775 | AM_RANGE ( 0xe7fe, 0xe7ff ) AM_READWRITE_LEGACY(to7_modem_mea8000_r, to7_modem_mea8000_w ) |
| r20779 | r20780 | |
| 960 | 960 | AM_RANGE ( 0xa7d0, 0xa7df ) AM_READWRITE_LEGACY(to7_floppy_r, to7_floppy_w ) |
| 961 | 961 | AM_RANGE ( 0xa7e0, 0xa7e3 ) AM_DEVREADWRITE( "pia_2", pia6821_device, read_alt, write_alt ) |
| 962 | 962 | AM_RANGE ( 0xa7e4, 0xa7e7 ) AM_READWRITE_LEGACY(mo5_gatearray_r, mo5_gatearray_w ) |
| 963 | | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE( "acia", acia6551_device, read, write ) |
| 963 | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE( "acia", mos6551_device, read, write ) |
| 964 | 964 | AM_RANGE ( 0xa7f2, 0xa7f3 ) AM_READWRITE_LEGACY(to7_midi_r, to7_midi_w ) |
| 965 | 965 | AM_RANGE ( 0xa7fe, 0xa7ff ) AM_DEVREADWRITE_LEGACY("mea8000", mea8000_r, mea8000_w) |
| 966 | 966 | AM_RANGE ( 0xb000, 0xefff ) AM_READ_BANK ( THOM_CART_BANK) AM_WRITE_LEGACY(mo5_cartridge_w ) |
| r20779 | r20780 | |
| 1165 | 1165 | AM_RANGE ( 0xe7da, 0xe7dd ) AM_READWRITE_LEGACY(to9_vreg_r, to9_vreg_w ) |
| 1166 | 1166 | AM_RANGE ( 0xe7de, 0xe7df ) AM_READWRITE_LEGACY(to9_kbd_r, to9_kbd_w ) |
| 1167 | 1167 | AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE_LEGACY(to9_gatearray_r, to9_gatearray_w ) |
| 1168 | | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE( "acia", acia6551_device, read, write ) |
| 1168 | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE( "acia", mos6551_device, read, write ) |
| 1169 | 1169 | /* AM_RANGE ( 0xe7f0, 0xe7f7 ) AM_READWRITE_LEGACY(to9_ieee_r, to9_ieee_w ) */ |
| 1170 | 1170 | AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE_LEGACY(to7_midi_r, to7_midi_w ) |
| 1171 | 1171 | AM_RANGE ( 0xe7f8, 0xe7fb ) AM_DEVREADWRITE( "pia_3", pia6821_device, read_alt, write_alt) |
| r20779 | r20780 | |
| 1489 | 1489 | AM_RANGE ( 0xe7d0, 0xe7d9 ) AM_READWRITE_LEGACY(to8_floppy_r, to8_floppy_w ) |
| 1490 | 1490 | AM_RANGE ( 0xe7da, 0xe7dd ) AM_READWRITE_LEGACY(to8_vreg_r, to8_vreg_w ) |
| 1491 | 1491 | AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE_LEGACY(to8_gatearray_r, to8_gatearray_w ) |
| 1492 | | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE( "acia", acia6551_device, read, write ) |
| 1492 | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE( "acia", mos6551_device, read, write ) |
| 1493 | 1493 | /* AM_RANGE ( 0xe7f0, 0xe7f7 ) AM_READWRITE_LEGACY(to9_ieee_r, to9_ieee_w ) */ |
| 1494 | 1494 | AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE_LEGACY(to7_midi_r, to7_midi_w ) |
| 1495 | 1495 | AM_RANGE ( 0xe7f8, 0xe7fb ) AM_DEVREADWRITE( "pia_3", pia6821_device, read_alt, write_alt) |
| r20779 | r20780 | |
| 1685 | 1685 | AM_RANGE ( 0xe7da, 0xe7dd ) AM_READWRITE_LEGACY(to8_vreg_r, to8_vreg_w ) |
| 1686 | 1686 | AM_RANGE ( 0xe7de, 0xe7df ) AM_READWRITE_LEGACY(to9_kbd_r, to9_kbd_w ) |
| 1687 | 1687 | AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE_LEGACY(to8_gatearray_r, to8_gatearray_w ) |
| 1688 | | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE( "acia", acia6551_device, read, write ) |
| 1688 | AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE( "acia", mos6551_device, read, write ) |
| 1689 | 1689 | /* AM_RANGE ( 0xe7f0, 0xe7f7 ) AM_READWRITE_LEGACY(to9_ieee_r, to9_ieee_w ) */ |
| 1690 | 1690 | AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE_LEGACY(to7_midi_r, to7_midi_w ) |
| 1691 | 1691 | AM_RANGE ( 0xe7f8, 0xe7fb ) AM_DEVREADWRITE( "pia_3", pia6821_device, read_alt, write_alt) |
| r20779 | r20780 | |
| 1845 | 1845 | AM_RANGE ( 0xa7d0, 0xa7d9 ) AM_READWRITE_LEGACY(to7_floppy_r, to7_floppy_w ) |
| 1846 | 1846 | AM_RANGE ( 0xa7da, 0xa7dd ) AM_READWRITE_LEGACY(mo6_vreg_r, mo6_vreg_w ) |
| 1847 | 1847 | AM_RANGE ( 0xa7e4, 0xa7e7 ) AM_READWRITE_LEGACY(mo6_gatearray_r, mo6_gatearray_w ) |
| 1848 | | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE( "acia", acia6551_device, read, write ) |
| 1848 | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE( "acia", mos6551_device, read, write ) |
| 1849 | 1849 | /* AM_RANGE ( 0xa7f0, 0xa7f7 ) AM_READWRITE_LEGACY(to9_ieee_r, to9_ieee_w )*/ |
| 1850 | 1850 | AM_RANGE ( 0xa7f2, 0xa7f3 ) AM_READWRITE_LEGACY(to7_midi_r, to7_midi_w ) |
| 1851 | 1851 | AM_RANGE ( 0xa7fe, 0xa7ff ) AM_DEVREADWRITE_LEGACY("mea8000", mea8000_r, mea8000_w) |
| r20779 | r20780 | |
| 2160 | 2160 | AM_RANGE ( 0xa7e1, 0xa7e1 ) AM_DEVREADWRITE("centronics", centronics_device, read, write) |
| 2161 | 2161 | AM_RANGE ( 0xa7e3, 0xa7e3 ) AM_READWRITE_LEGACY(mo5nr_prn_r, mo5nr_prn_w ) |
| 2162 | 2162 | AM_RANGE ( 0xa7e4, 0xa7e7 ) AM_READWRITE_LEGACY(mo6_gatearray_r, mo6_gatearray_w ) |
| 2163 | | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE( "acia", acia6551_device, read, write ) |
| 2163 | AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE( "acia", mos6551_device, read, write ) |
| 2164 | 2164 | /* AM_RANGE ( 0xa7f0, 0xa7f7 ) AM_READWRITE_LEGACY(to9_ieee_r, to9_ieee_w ) */ |
| 2165 | 2165 | AM_RANGE ( 0xa7f2, 0xa7f3 ) AM_READWRITE_LEGACY(to7_midi_r, to7_midi_w ) |
| 2166 | 2166 | AM_RANGE ( 0xa7f8, 0xa7fb ) AM_DEVREADWRITE( "pia_3", pia6821_device, read_alt, write_alt) |
trunk/src/mess/drivers/ec65.c
| r20779 | r20780 | |
| 12 | 12 | #include "video/mc6845.h" |
| 13 | 13 | #include "machine/6821pia.h" |
| 14 | 14 | #include "machine/6522via.h" |
| 15 | | #include "machine/6551acia.h" |
| 15 | #include "machine/mos6551.h" |
| 16 | 16 | #include "machine/6850acia.h" |
| 17 | 17 | #include "machine/keyboard.h" |
| 18 | 18 | |
| r20779 | r20780 | |
| 53 | 53 | AM_RANGE(0xe011, 0xe011) AM_DEVREADWRITE(ACIA6850_TAG, acia6850_device, data_read, data_write) |
| 54 | 54 | AM_RANGE(0xe100, 0xe10f) AM_DEVREADWRITE(VIA6522_0_TAG, via6522_device, read, write) |
| 55 | 55 | AM_RANGE(0xe110, 0xe11f) AM_DEVREADWRITE(VIA6522_1_TAG, via6522_device, read, write) |
| 56 | | AM_RANGE(0xe130, 0xe133) AM_DEVREADWRITE(ACIA6551_TAG, acia6551_device, read, write) |
| 56 | AM_RANGE(0xe130, 0xe133) AM_DEVREADWRITE(ACIA6551_TAG, mos6551_device, read, write) |
| 57 | 57 | AM_RANGE(0xe140, 0xe140) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w) |
| 58 | 58 | AM_RANGE(0xe141, 0xe141) AM_DEVREADWRITE(MC6845_TAG, mc6845_device, register_r , register_w) |
| 59 | 59 | AM_RANGE(0xe400, 0xe7ff) AM_RAM // 1KB on-board RAM |
| r20779 | r20780 | |
| 273 | 273 | MCFG_ACIA6850_ADD(ACIA6850_TAG, ec65_acia_intf) |
| 274 | 274 | MCFG_VIA6522_ADD(VIA6522_0_TAG, XTAL_4MHz / 4, ec65_via_0_intf) |
| 275 | 275 | MCFG_VIA6522_ADD(VIA6522_1_TAG, XTAL_4MHz / 4, ec65_via_1_intf) |
| 276 | | MCFG_ACIA6551_ADD(ACIA6551_TAG) // have XTAL of 1.8432MHz connected |
| 276 | MCFG_MOS6551_ADD(ACIA6551_TAG, XTAL_1_8432MHz, NULL) |
| 277 | 277 | MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf) |
| 278 | 278 | MACHINE_CONFIG_END |
| 279 | 279 | |
trunk/src/mame/drivers/cops.c
| r20779 | r20780 | |
| 11 | 11 | #include "emu.h" |
| 12 | 12 | #include "cpu/m6502/m6502.h" |
| 13 | 13 | #include "machine/6522via.h" |
| 14 | | //#include "machine/6551acia.h" |
| 14 | //#include "machine/mos6551.h" |
| 15 | 15 | |
| 16 | 16 | #include "cops.lh" |
| 17 | 17 | |
| r20779 | r20780 | |
| 564 | 564 | AM_RANGE(0xb000, 0xb00f) AM_DEVREADWRITE("via6522_1", via6522_device, read, write) /* VIA 1 */ |
| 565 | 565 | AM_RANGE(0xb800, 0xb80f) AM_DEVREADWRITE("via6522_2", via6522_device, read, write) /* VIA 2 */ |
| 566 | 566 | AM_RANGE(0xc000, 0xcfff) AM_READWRITE(io2_r, io2_w) |
| 567 | | // AM_RANGE(0xd000, 0xd003) AM_DEVREADWRITE("acia6551_1", acia6551_device, read, write ) |
| 568 | | // AM_RANGE(0xd004, 0xd007) AM_DEVREADWRITE("acia6551_2", acia6551_device, read, write ) |
| 567 | // AM_RANGE(0xd000, 0xd003) AM_DEVREADWRITE("acia6551_1", mos6551_device, read, write ) |
| 568 | // AM_RANGE(0xd004, 0xd007) AM_DEVREADWRITE("acia6551_2", mos6551_device, read, write ) |
| 569 | 569 | AM_RANGE(0xd000, 0xd007) AM_READWRITE(dacia_r, dacia_w) |
| 570 | 570 | AM_RANGE(0xd800, 0xd80f) AM_DEVREADWRITE("via6522_3", via6522_device, read, write) /* VIA 3 */ |
| 571 | 571 | AM_RANGE(0xe000, 0xffff) AM_ROM AM_REGION("system", 0) |
| r20779 | r20780 | |
| 644 | 644 | MCFG_VIA6522_ADD("via6522_3", 0, via_3_interface) |
| 645 | 645 | |
| 646 | 646 | /* acia */ |
| 647 | | // MCFG_ACIA6551_ADD("acia6551_1") |
| 648 | | // MCFG_ACIA6551_ADD("acia6551_2") |
| 647 | // MCFG_MOS6551_ADD("acia6551_1", XTAL_1_8432MHz, NULL) |
| 648 | // MCFG_MOS6551_ADD("acia6551_2", XTAL_1_8432MHz, NULL) |
| 649 | 649 | |
| 650 | 650 | /* sound hardware */ |
| 651 | 651 | MCFG_SPEAKER_STANDARD_MONO("mono") |