src/emu/machine/6850acia.c
| r4241 | r4242 | |
| 20 | 20 | #define CR6_5 0x60 |
| 21 | 21 | #define CR7 0x80 |
| 22 | 22 | |
| 23 | #define TXD(_data) \ |
| 24 | devcb_call_write_line(&acia_p->out_tx_func, _data) |
| 23 | 25 | |
| 26 | #define RTS(_data) \ |
| 27 | devcb_call_write_line(&acia_p->out_rts_func, _data) |
| 28 | |
| 24 | 29 | /*************************************************************************** |
| 25 | 30 | TYPE DEFINITIONS |
| 26 | 31 | ***************************************************************************/ |
| r4241 | r4242 | |
| 44 | 49 | typedef struct _acia6850_t acia6850_t; |
| 45 | 50 | struct _acia6850_t |
| 46 | 51 | { |
| 52 | devcb_resolved_read_line in_rx_func; |
| 53 | devcb_resolved_write_line out_tx_func; |
| 54 | devcb_resolved_read_line in_cts_func; |
| 55 | devcb_resolved_write_line out_rts_func; |
| 56 | devcb_resolved_read_line in_dcd_func; |
| 57 | devcb_resolved_write_line out_irq_func; |
| 58 | |
| 47 | 59 | UINT8 ctrl; |
| 48 | 60 | UINT8 status; |
| 49 | 61 | |
| 50 | | UINT8 *rx_pin; |
| 51 | | UINT8 *tx_pin; |
| 52 | | UINT8 *cts_pin; |
| 53 | | UINT8 *rts_pin; |
| 54 | | UINT8 *dcd_pin; |
| 55 | | |
| 56 | 62 | UINT8 tdr; |
| 57 | 63 | UINT8 rdr; |
| 58 | 64 | UINT8 rx_shift; |
| r4241 | r4242 | |
| 90 | 96 | |
| 91 | 97 | emu_timer *rx_timer; |
| 92 | 98 | emu_timer *tx_timer; |
| 93 | | |
| 94 | | void (*int_callback)(const device_config *device, int param); |
| 95 | 99 | }; |
| 96 | 100 | |
| 97 | 101 | |
| r4241 | r4242 | |
| 153 | 157 | static DEVICE_RESET( acia6850 ) |
| 154 | 158 | { |
| 155 | 159 | acia6850_t *acia_p = get_token(device); |
| 156 | | int cts = 0, dcd = 0; |
| 157 | 160 | |
| 158 | | if (acia_p->cts_pin) |
| 159 | | { |
| 160 | | cts = *acia_p->cts_pin; |
| 161 | | } |
| 161 | int cts = devcb_call_read_line(&acia_p->in_cts_func); |
| 162 | int dcd = devcb_call_read_line(&acia_p->in_dcd_func); |
| 162 | 163 | |
| 163 | | if (acia_p->dcd_pin) |
| 164 | | { |
| 165 | | dcd = *acia_p->dcd_pin; |
| 166 | | } |
| 167 | | |
| 168 | 164 | acia_p->status = (cts << 3) | (dcd << 2) | ACIA6850_STATUS_TDRE; |
| 169 | 165 | acia_p->tdr = 0; |
| 170 | 166 | acia_p->rdr = 0; |
| r4241 | r4242 | |
| 173 | 169 | acia_p->tx_counter = 0; |
| 174 | 170 | acia_p->rx_counter = 0; |
| 175 | 171 | |
| 176 | | *acia_p->tx_pin = 1; |
| 172 | TXD(1); |
| 177 | 173 | acia_p->overrun = 0; |
| 178 | 174 | acia_p->status_read = 0; |
| 179 | 175 | acia_p->brk = 0; |
| r4241 | r4242 | |
| 181 | 177 | acia_p->rx_state = START; |
| 182 | 178 | acia_p->tx_state = START; |
| 183 | 179 | |
| 184 | | if (acia_p->int_callback) |
| 185 | | { |
| 186 | | acia_p->int_callback(device, 1); |
| 187 | | } |
| 180 | devcb_call_write_line(&acia_p->out_irq_func, 1); |
| 188 | 181 | |
| 189 | 182 | if (acia_p->first_reset) |
| 190 | 183 | { |
| 191 | 184 | acia_p->first_reset = 0; |
| 192 | 185 | |
| 193 | | if (acia_p->rts_pin) |
| 194 | | { |
| 195 | | *acia_p->rts_pin = 1; |
| 196 | | } |
| 186 | RTS(1); |
| 197 | 187 | } |
| 198 | 188 | else |
| 199 | 189 | { |
| 200 | | if (acia_p->rts_pin) |
| 201 | | { |
| 202 | | *acia_p->rts_pin = acia_p->rts; |
| 203 | | } |
| 190 | RTS(acia_p->rts); |
| 204 | 191 | } |
| 205 | 192 | } |
| 206 | 193 | |
| r4241 | r4242 | |
| 215 | 202 | acia6850_t *acia_p = get_token(device); |
| 216 | 203 | acia6850_interface *intf = get_interface(device); |
| 217 | 204 | |
| 205 | /* resolve callbacks */ |
| 206 | devcb_resolve_read_line(&acia_p->in_rx_func, &intf->in_rx_func, device); |
| 207 | devcb_resolve_write_line(&acia_p->out_tx_func, &intf->out_tx_func, device); |
| 208 | devcb_resolve_read_line(&acia_p->in_cts_func, &intf->in_cts_func, device); |
| 209 | devcb_resolve_write_line(&acia_p->out_rts_func, &intf->out_rts_func, device); |
| 210 | devcb_resolve_read_line(&acia_p->in_dcd_func, &intf->in_dcd_func, device); |
| 211 | devcb_resolve_write_line(&acia_p->out_irq_func, &intf->out_irq_func, device); |
| 212 | |
| 218 | 213 | acia_p->rx_clock = intf->rx_clock; |
| 219 | 214 | acia_p->tx_clock = intf->tx_clock; |
| 220 | 215 | acia_p->tx_counter = 0; |
| 221 | 216 | acia_p->rx_counter = 0; |
| 222 | | acia_p->rx_pin = intf->rx_pin; |
| 223 | | acia_p->tx_pin = intf->tx_pin; |
| 224 | | acia_p->cts_pin = intf->cts_pin; |
| 225 | | acia_p->rts_pin = intf->rts_pin; |
| 226 | | acia_p->dcd_pin = intf->dcd_pin; |
| 227 | 217 | acia_p->rx_timer = timer_alloc(device->machine, receive_event, (void *) device); |
| 228 | 218 | acia_p->tx_timer = timer_alloc(device->machine, transmit_event, (void *) device); |
| 229 | | acia_p->int_callback = intf->int_callback; |
| 230 | 219 | acia_p->first_reset = 1; |
| 231 | 220 | acia_p->status_read = 0; |
| 232 | 221 | acia_p->brk = 0; |
| r4241 | r4242 | |
| 285 | 274 | int wordsel; |
| 286 | 275 | int divide; |
| 287 | 276 | |
| 288 | | acia_p->ctrl = data; |
| 289 | 277 | |
| 290 | 278 | // Counter Divide Select Bits |
| 291 | 279 | |
| r4241 | r4242 | |
| 315 | 303 | switch ((data & CR6_5) >> 5) |
| 316 | 304 | { |
| 317 | 305 | case 0: |
| 318 | | if (acia_p->rts_pin) |
| 319 | | { |
| 320 | | *acia_p->rts_pin = acia_p->rts = 0; |
| 321 | | } |
| 306 | acia_p->rts = 0; |
| 307 | RTS(acia_p->rts); |
| 322 | 308 | |
| 323 | 309 | acia_p->tx_int = 0; |
| 324 | 310 | acia_p->brk = 0; |
| 325 | 311 | break; |
| 326 | 312 | |
| 327 | 313 | case 1: |
| 328 | | if (acia_p->rts_pin) |
| 329 | | { |
| 330 | | *acia_p->rts_pin = acia_p->rts = 0; |
| 331 | | } |
| 314 | acia_p->rts = 0; |
| 315 | RTS(acia_p->rts); |
| 332 | 316 | |
| 333 | 317 | acia_p->tx_int = 1; |
| 334 | 318 | acia_p->brk = 0; |
| 335 | 319 | break; |
| 336 | 320 | |
| 337 | 321 | case 2: |
| 338 | | if (acia_p->rts_pin) |
| 339 | | { |
| 340 | | *acia_p->rts_pin = acia_p->rts = 1; |
| 341 | | } |
| 322 | acia_p->rts = 1; |
| 323 | RTS(acia_p->rts); |
| 342 | 324 | |
| 343 | 325 | acia_p->tx_int = 0; |
| 344 | 326 | acia_p->brk = 0; |
| 345 | 327 | break; |
| 346 | 328 | |
| 347 | 329 | case 3: |
| 348 | | if (acia_p->rts_pin) |
| 349 | | { |
| 350 | | *acia_p->rts_pin = acia_p->rts = 0; |
| 351 | | } |
| 330 | acia_p->rts = 0; |
| 331 | RTS(acia_p->rts); |
| 352 | 332 | |
| 353 | 333 | acia_p->tx_int = 0; |
| 354 | 334 | acia_p->brk = 1; |
| 355 | 335 | break; |
| 356 | 336 | } |
| 357 | 337 | |
| 358 | | // After writing the word type, start receive clock |
| 338 | // After writing the word type, set the rx/tx clocks (provided the divide values have changed) |
| 359 | 339 | |
| 360 | | if (!acia_p->reset) |
| 340 | if ((acia_p->ctrl ^ data) & CR1_0) |
| 361 | 341 | { |
| 362 | | if (acia_p->rx_clock) |
| 342 | if (!acia_p->reset) |
| 363 | 343 | { |
| 364 | | attotime rx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->rx_clock), acia_p->divide); |
| 365 | | timer_adjust_periodic(acia_p->rx_timer, rx_period, 0, rx_period); |
| 344 | if (acia_p->rx_clock) |
| 345 | { |
| 346 | attotime rx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->rx_clock), acia_p->divide); |
| 347 | timer_adjust_periodic(acia_p->rx_timer, rx_period, 0, rx_period); |
| 348 | } |
| 349 | |
| 350 | if (acia_p->tx_clock) |
| 351 | { |
| 352 | attotime tx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->tx_clock), acia_p->divide); |
| 353 | timer_adjust_periodic(acia_p->tx_timer, tx_period, 0, tx_period); |
| 354 | } |
| 366 | 355 | } |
| 367 | | if (acia_p->tx_clock) |
| 368 | | { |
| 369 | | attotime tx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->tx_clock), acia_p->divide); |
| 370 | | timer_adjust_periodic(acia_p->tx_timer, tx_period, 0, tx_period); |
| 371 | | } |
| 372 | 356 | } |
| 357 | acia_p->ctrl = data; |
| 373 | 358 | } |
| 374 | 359 | |
| 375 | 360 | |
| r4241 | r4242 | |
| 387 | 372 | if (irq) |
| 388 | 373 | { |
| 389 | 374 | acia_p->status |= ACIA6850_STATUS_IRQ; |
| 390 | | |
| 391 | | if (acia_p->int_callback) |
| 392 | | { |
| 393 | | acia_p->int_callback(device, 0); |
| 394 | | } |
| 375 | devcb_call_write_line(&acia_p->out_irq_func, 0); |
| 395 | 376 | } |
| 396 | 377 | else |
| 397 | 378 | { |
| 398 | 379 | acia_p->status &= ~ACIA6850_STATUS_IRQ; |
| 399 | | |
| 400 | | if (acia_p->int_callback) |
| 401 | | { |
| 402 | | acia_p->int_callback(device, 1); |
| 403 | | } |
| 380 | devcb_call_write_line(&acia_p->out_irq_func, 1); |
| 404 | 381 | } |
| 405 | 382 | } |
| 406 | 383 | |
| r4241 | r4242 | |
| 438 | 415 | |
| 439 | 416 | if (acia_p->status_read) |
| 440 | 417 | { |
| 418 | int dcd = devcb_call_read_line(&acia_p->in_dcd_func); |
| 419 | |
| 441 | 420 | acia_p->status_read = 0; |
| 442 | 421 | acia_p->status &= ~(ACIA6850_STATUS_OVRN | ACIA6850_STATUS_DCD); |
| 443 | 422 | |
| 444 | | if (acia_p->dcd_pin && *acia_p->dcd_pin) |
| 423 | if (dcd) |
| 445 | 424 | { |
| 446 | 425 | acia_p->status |= ACIA6850_STATUS_DCD; |
| 447 | 426 | } |
| r4241 | r4242 | |
| 467 | 446 | { |
| 468 | 447 | acia6850_t *acia_p = get_token(device); |
| 469 | 448 | |
| 470 | | if (acia_p->cts_pin && *acia_p->cts_pin) |
| 449 | int cts = devcb_call_read_line(&acia_p->in_cts_func); |
| 450 | |
| 451 | if (cts) |
| 471 | 452 | { |
| 472 | 453 | acia_p->status |= ACIA6850_STATUS_CTS; |
| 473 | 454 | } |
| r4241 | r4242 | |
| 484 | 465 | { |
| 485 | 466 | // transmit break |
| 486 | 467 | |
| 487 | | *acia_p->tx_pin = 0; |
| 468 | TXD(0); |
| 488 | 469 | } |
| 489 | 470 | else |
| 490 | 471 | { |
| r4241 | r4242 | |
| 492 | 473 | { |
| 493 | 474 | // transmitter idle |
| 494 | 475 | |
| 495 | | *acia_p->tx_pin = 1; |
| 476 | TXD(1); |
| 496 | 477 | } |
| 497 | 478 | else |
| 498 | 479 | { |
| r4241 | r4242 | |
| 501 | 482 | //logerror("ACIA6850 #%u: TX DATA %x\n", which, acia_p->tdr); |
| 502 | 483 | //logerror("ACIA6850 #%u: TX START BIT\n", which); |
| 503 | 484 | |
| 504 | | *acia_p->tx_pin = 0; |
| 485 | TXD(0); |
| 505 | 486 | |
| 506 | 487 | acia_p->tx_bits = acia_p->bits; |
| 507 | 488 | acia_p->tx_shift = acia_p->tdr; |
| r4241 | r4242 | |
| 525 | 506 | int val = acia_p->tx_shift & 1; |
| 526 | 507 | //logerror("ACIA6850 #%u: TX DATA BIT %x\n", which, val); |
| 527 | 508 | |
| 528 | | *acia_p->tx_pin = val; |
| 509 | TXD(val); |
| 529 | 510 | acia_p->tx_parity ^= val; |
| 530 | 511 | acia_p->tx_shift >>= 1; |
| 531 | 512 | |
| r4241 | r4242 | |
| 540 | 521 | { |
| 541 | 522 | if (acia_p->parity == EVEN) |
| 542 | 523 | { |
| 543 | | *acia_p->tx_pin = (acia_p->tx_parity & 1) ? 1 : 0; |
| 524 | TXD((acia_p->tx_parity & 1) ? 1 : 0); |
| 544 | 525 | } |
| 545 | 526 | else |
| 546 | 527 | { |
| 547 | | *acia_p->tx_pin = (acia_p->tx_parity & 1) ? 0 : 1; |
| 528 | TXD((acia_p->tx_parity & 1) ? 0 : 1); |
| 548 | 529 | } |
| 549 | 530 | |
| 550 | 531 | //logerror("ACIA6850 #%u: TX PARITY BIT %x\n", which, *acia_p->tx_pin); |
| r4241 | r4242 | |
| 555 | 536 | case STOP: |
| 556 | 537 | { |
| 557 | 538 | //logerror("ACIA6850 #%u: TX STOP BIT\n", which); |
| 558 | | *acia_p->tx_pin = 1; |
| 539 | TXD(1); |
| 559 | 540 | |
| 560 | 541 | if (acia_p->stopbits == 1) |
| 561 | 542 | { |
| r4241 | r4242 | |
| 570 | 551 | case STOP2: |
| 571 | 552 | { |
| 572 | 553 | //logerror("ACIA6850 #%u: TX STOP BIT\n", which); |
| 573 | | *acia_p->tx_pin = 1; |
| 554 | TXD(1); |
| 574 | 555 | acia_p->tx_state = START; |
| 575 | 556 | break; |
| 576 | 557 | } |
| r4241 | r4242 | |
| 592 | 573 | |
| 593 | 574 | |
| 594 | 575 | /*------------------------------------------------- |
| 595 | | acia_tx_clock_in - As above, but using the tx pin |
| 576 | acia6850_tx_clock_in - As above, but using the tx pin |
| 596 | 577 | -------------------------------------------------*/ |
| 597 | 578 | |
| 598 | | void acia_tx_clock_in(const device_config *device) |
| 579 | void acia6850_tx_clock_in(const device_config *device) |
| 599 | 580 | { |
| 600 | 581 | acia6850_t *acia_p = get_token(device); |
| 601 | 582 | |
| 602 | | if (acia_p->cts_pin && *acia_p->cts_pin) |
| 583 | int cts = devcb_call_read_line(&acia_p->in_cts_func); |
| 584 | |
| 585 | if (cts) |
| 603 | 586 | { |
| 604 | 587 | acia_p->status |= ACIA6850_STATUS_CTS; |
| 605 | 588 | } |
| r4241 | r4242 | |
| 627 | 610 | { |
| 628 | 611 | acia6850_t *acia_p = get_token(device); |
| 629 | 612 | |
| 630 | | if (acia_p->dcd_pin && *acia_p->dcd_pin) |
| 613 | int dcd = devcb_call_read_line(&acia_p->in_dcd_func); |
| 614 | |
| 615 | if (dcd) |
| 631 | 616 | { |
| 632 | 617 | acia_p->status |= ACIA6850_STATUS_DCD; |
| 633 | 618 | acia6850_check_interrupts(device); |
| r4241 | r4242 | |
| 643 | 628 | } |
| 644 | 629 | else |
| 645 | 630 | { |
| 631 | int rxd = devcb_call_read_line(&acia_p->in_rx_func); |
| 632 | |
| 646 | 633 | switch (acia_p->rx_state) |
| 647 | 634 | { |
| 648 | 635 | case START: |
| 649 | 636 | { |
| 650 | | if (*acia_p->rx_pin == 0) |
| 637 | if (rxd == 0) |
| 651 | 638 | { |
| 652 | 639 | //logerror("ACIA6850 #%u: RX START BIT\n", which); |
| 653 | 640 | acia_p->rx_shift = 0; |
| r4241 | r4242 | |
| 659 | 646 | } |
| 660 | 647 | case DATA: |
| 661 | 648 | { |
| 662 | | //logerror("ACIA6850 #%u: RX DATA BIT %x\n", which, *acia_p->rx_pin); |
| 663 | | acia_p->rx_shift |= *acia_p->rx_pin ? 0x80 : 0; |
| 664 | | acia_p->rx_parity ^= *acia_p->rx_pin; |
| 649 | //logerror("ACIA6850 #%u: RX DATA BIT %x\n", which, rxd); |
| 650 | acia_p->rx_shift |= rxd ? 0x80 : 0; |
| 651 | acia_p->rx_parity ^= rxd; |
| 665 | 652 | |
| 666 | 653 | if (--acia_p->rx_bits == 0) |
| 667 | 654 | { |
| r4241 | r4242 | |
| 681 | 668 | } |
| 682 | 669 | case PARITY: |
| 683 | 670 | { |
| 684 | | //logerror("ACIA6850 #%u: RX PARITY BIT %x\n", which, *acia_p->rx_pin); |
| 685 | | acia_p->rx_parity ^= *acia_p->rx_pin; |
| 671 | //logerror("ACIA6850 #%u: RX PARITY BIT %x\n", which, rxd); |
| 672 | acia_p->rx_parity ^= rxd; |
| 686 | 673 | |
| 687 | 674 | if (acia_p->parity == EVEN) |
| 688 | 675 | { |
| r4241 | r4242 | |
| 704 | 691 | } |
| 705 | 692 | case STOP: |
| 706 | 693 | { |
| 707 | | if (*acia_p->rx_pin == 1) |
| 694 | if (rxd == 1) |
| 708 | 695 | { |
| 709 | 696 | //logerror("ACIA6850 #%u: RX STOP BIT\n", which); |
| 710 | 697 | if (acia_p->stopbits == 1) |
| r4241 | r4242 | |
| 735 | 722 | } |
| 736 | 723 | case STOP2: |
| 737 | 724 | { |
| 738 | | if (*acia_p->rx_pin == 1) |
| 725 | if (rxd == 1) |
| 739 | 726 | { |
| 740 | 727 | //logerror("ACIA6850 #%u: RX STOP BIT\n", which); |
| 741 | 728 | acia_p->status &= ~ACIA6850_STATUS_FE; |
| r4241 | r4242 | |
| 777 | 764 | |
| 778 | 765 | |
| 779 | 766 | /*------------------------------------------------- |
| 780 | | acia_rx_clock_in - As above, but using the rx pin |
| 767 | acia6850_rx_clock_in - As above, but using the rx pin |
| 781 | 768 | -------------------------------------------------*/ |
| 782 | 769 | |
| 783 | | void acia_rx_clock_in(const device_config *device) |
| 770 | void acia6850_rx_clock_in(const device_config *device) |
| 784 | 771 | { |
| 785 | 772 | acia6850_t *acia_p = get_token(device); |
| 786 | 773 | |
| 787 | | if (acia_p->dcd_pin && *acia_p->dcd_pin) |
| 774 | int dcd = devcb_call_read_line(&acia_p->in_dcd_func); |
| 775 | |
| 776 | if (dcd) |
| 788 | 777 | { |
| 789 | 778 | acia_p->status |= ACIA6850_STATUS_DCD; |
| 790 | 779 | acia6850_check_interrupts(device); |
| r4241 | r4242 | |
| 850 | 839 | switch (state) |
| 851 | 840 | { |
| 852 | 841 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 853 | | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(acia6850_t); break; |
| 854 | | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 855 | | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 842 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(acia6850_t); break; |
| 843 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 844 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 856 | 845 | |
| 857 | 846 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 858 | 847 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(acia6850); break; |
| 859 | | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(acia6850); break; |
| 860 | | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 861 | | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(acia6850); break; |
| 848 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(acia6850); break; |
| 849 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 850 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(acia6850); break; |
| 862 | 851 | |
| 863 | 852 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 864 | | case DEVINFO_STR_NAME: strcpy(info->s, "6850 ACIA"); break; |
| 865 | | case DEVINFO_STR_FAMILY: strcpy(info->s, "6850 ACIA"); break; |
| 866 | | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 867 | | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 868 | | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 853 | case DEVINFO_STR_NAME: strcpy(info->s, "6850 ACIA"); break; |
| 854 | case DEVINFO_STR_FAMILY: strcpy(info->s, "6850 ACIA"); break; |
| 855 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 856 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 857 | case DEVINFO_STR_CREDITS: /* Nothing */ break; |
| 869 | 858 | } |
| 870 | 859 | } |
| 871 | | |
| 872 | | |
| 873 | | /* ----------------------------------------------------------------------- */ |
| 874 | | |
| 875 | | READ16_DEVICE_HANDLER( acia6850_stat_lsb_r ) { return acia6850_stat_r(device, 0) << 0; } |
| 876 | | READ16_DEVICE_HANDLER( acia6850_stat_msb_r ) { return acia6850_stat_r(device, 0) << 8; } |
| 877 | | |
| 878 | | READ16_DEVICE_HANDLER( acia6850_data_lsb_r ) { return acia6850_data_r(device, 0) << 0; } |
| 879 | | READ16_DEVICE_HANDLER( acia6850_data_msb_r ) { return acia6850_data_r(device, 0) << 8; } |
| 880 | | |
| 881 | | WRITE16_DEVICE_HANDLER( acia6850_ctrl_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_ctrl_w(device, 0, (data >> 8) & 0xff); } |
| 882 | | WRITE16_DEVICE_HANDLER( acia6850_ctrl_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_ctrl_w(device, 0, (data >> 0) & 0xff); } |
| 883 | | |
| 884 | | WRITE16_DEVICE_HANDLER( acia6850_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(device, 0, (data >> 8) & 0xff); } |
| 885 | | WRITE16_DEVICE_HANDLER( acia6850_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(device, 0, (data >> 0) & 0xff); } |
src/mess/drivers/atarist.c
| r4241 | r4242 | |
| 36 | 36 | |
| 37 | 37 | */ |
| 38 | 38 | |
| 39 | | static UINT8 mfp_rx, mfp_tx; |
| 40 | | static UINT8 ikbd_rx, ikbd_tx; |
| 41 | | static UINT8 acia_midi_rx = 1, acia_midi_tx = 1; |
| 42 | | |
| 43 | 39 | /* Floppy Disk Controller */ |
| 44 | 40 | |
| 45 | 41 | static void atarist_fdc_dma_transfer(running_machine *machine) |
| 46 | 42 | { |
| 47 | | device_config *fdc = (device_config*)devtag_get_device(machine, WD1772, "wd1772"); |
| 48 | 43 | const address_space *program = cputag_get_address_space(machine, M68000_TAG, ADDRESS_SPACE_PROGRAM); |
| 49 | 44 | atarist_state *state = machine->driver_data; |
| 50 | 45 | |
| r4241 | r4242 | |
| 56 | 51 | { |
| 57 | 52 | UINT8 data = memory_read_byte_8be(program, state->fdc_dmabase); |
| 58 | 53 | |
| 59 | | wd17xx_data_w(fdc, 0, data); |
| 54 | wd17xx_data_w(state->wd1772, 0, data); |
| 60 | 55 | } |
| 61 | 56 | else |
| 62 | 57 | { |
| 63 | | UINT8 data = wd17xx_data_r(fdc, 0); |
| 58 | UINT8 data = wd17xx_data_r(state->wd1772, 0); |
| 64 | 59 | |
| 65 | 60 | memory_write_byte_8be(program, state->fdc_dmabase, data); |
| 66 | 61 | } |
| r4241 | r4242 | |
| 115 | 110 | static READ16_HANDLER( atarist_fdc_data_r ) |
| 116 | 111 | { |
| 117 | 112 | atarist_state *state = space->machine->driver_data; |
| 118 | | device_config *fdc = (device_config*)devtag_get_device(space->machine, WD1772, "wd1772"); |
| 119 | 113 | |
| 120 | 114 | if (state->fdc_mode & ATARIST_FLOPPY_MODE_SECTOR_COUNT) |
| 121 | 115 | { |
| r4241 | r4242 | |
| 132 | 126 | } |
| 133 | 127 | else |
| 134 | 128 | { |
| 135 | | return wd17xx_r(fdc, (state->fdc_mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1); |
| 129 | return wd17xx_r(state->wd1772, (state->fdc_mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1); |
| 136 | 130 | } |
| 137 | 131 | } |
| 138 | 132 | } |
| r4241 | r4242 | |
| 140 | 134 | static WRITE16_HANDLER( atarist_fdc_data_w ) |
| 141 | 135 | { |
| 142 | 136 | atarist_state *state = space->machine->driver_data; |
| 143 | | device_config *fdc = (device_config*)devtag_get_device(space->machine, WD1772, "wd1772"); |
| 144 | 137 | |
| 145 | 138 | if (state->fdc_mode & ATARIST_FLOPPY_MODE_SECTOR_COUNT) |
| 146 | 139 | { |
| r4241 | r4242 | |
| 164 | 157 | } |
| 165 | 158 | else |
| 166 | 159 | { |
| 167 | | wd17xx_w(fdc, (state->fdc_mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1, data); |
| 160 | wd17xx_w(state->wd1772, (state->fdc_mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1, data); |
| 168 | 161 | } |
| 169 | 162 | } |
| 170 | 163 | } |
| r4241 | r4242 | |
| 283 | 276 | |
| 284 | 277 | */ |
| 285 | 278 | |
| 286 | | // atarist_state *state = space->machine->driver_data; |
| 279 | atarist_state *state = space->machine->driver_data; |
| 287 | 280 | |
| 288 | | return (ikbd_tx << 3) | (input_port_read_safe(space->machine, "IKBD_JOY1", 0xff) & 0x06); |
| 281 | return (state->ikbd_tx << 3) | (input_port_read_safe(space->machine, "IKBD_JOY1", 0xff) & 0x06); |
| 289 | 282 | } |
| 290 | 283 | |
| 291 | 284 | static WRITE8_HANDLER( ikbd_port2_w ) |
| r4241 | r4242 | |
| 302 | 295 | |
| 303 | 296 | */ |
| 304 | 297 | |
| 305 | | // atarist_state *state = space->machine->driver_data; |
| 298 | atarist_state *state = space->machine->driver_data; |
| 306 | 299 | |
| 307 | | ikbd_rx = (data & 0x10) >> 4; |
| 300 | state->ikbd_rx = (data & 0x10) >> 4; |
| 308 | 301 | } |
| 309 | 302 | |
| 310 | 303 | static WRITE8_HANDLER( ikbd_port3_w ) |
| r4241 | r4242 | |
| 754 | 747 | |
| 755 | 748 | state->megaste_cache = data; |
| 756 | 749 | |
| 757 | | cpu_set_clock(space->machine->cpu[0], BIT(data, 0) ? Y2/2 : Y2/4); |
| 750 | cputag_set_clock(space->machine, M68000_TAG, BIT(data, 0) ? Y2/2 : Y2/4); |
| 758 | 751 | } |
| 759 | 752 | |
| 760 | 753 | /* ST Book */ |
| r4241 | r4242 | |
| 1266 | 1259 | INPUT_PORTS_END |
| 1267 | 1260 | |
| 1268 | 1261 | static INPUT_PORTS_START( stbook ) |
| 1269 | | PORT_INCLUDE(atarist) // this fixes "missing port" fatalerror and adds a keyboard - joystick needs investigation |
| 1270 | 1262 | PORT_START("SW400") |
| 1271 | 1263 | PORT_DIPNAME( 0x80, 0x80, "DMA sound hardware") |
| 1272 | 1264 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| r4241 | r4242 | |
| 1284 | 1276 | |
| 1285 | 1277 | static WRITE8_HANDLER( ym2149_port_a_w ) |
| 1286 | 1278 | { |
| 1287 | | device_config *fdc = (device_config*)devtag_get_device(space->machine, WD1772, "wd1772"); |
| 1288 | | wd17xx_set_side(fdc, BIT(data, 0) ? 0 : 1); |
| 1279 | atarist_state *state = space->machine->driver_data; |
| 1289 | 1280 | |
| 1281 | wd17xx_set_side(state->wd1772, BIT(data, 0) ? 0 : 1); |
| 1282 | |
| 1290 | 1283 | if (!BIT(data, 1)) |
| 1291 | 1284 | { |
| 1292 | | wd17xx_set_drive(fdc,0); |
| 1285 | wd17xx_set_drive(state->wd1772, 0); |
| 1293 | 1286 | } |
| 1294 | 1287 | |
| 1295 | 1288 | if (!BIT(data, 2)) |
| 1296 | 1289 | { |
| 1297 | | wd17xx_set_drive(fdc,1); |
| 1290 | wd17xx_set_drive(state->wd1772, 1); |
| 1298 | 1291 | } |
| 1299 | 1292 | |
| 1300 | 1293 | // 0x08 = RTS |
| r4241 | r4242 | |
| 1323 | 1316 | |
| 1324 | 1317 | /* Machine Drivers */ |
| 1325 | 1318 | |
| 1326 | | static void acia_interrupt(const device_config *device, int state) |
| 1319 | static READ_LINE_DEVICE_HANDLER( ikbd_rx ) |
| 1327 | 1320 | { |
| 1328 | 1321 | atarist_state *driver_state = device->machine->driver_data; |
| 1329 | 1322 | |
| 1323 | return driver_state->ikbd_rx; |
| 1324 | } |
| 1325 | |
| 1326 | static WRITE_LINE_DEVICE_HANDLER( ikbd_tx ) |
| 1327 | { |
| 1328 | atarist_state *driver_state = device->machine->driver_data; |
| 1329 | |
| 1330 | driver_state->ikbd_tx = state; |
| 1331 | } |
| 1332 | |
| 1333 | static READ_LINE_DEVICE_HANDLER( midi_rx ) |
| 1334 | { |
| 1335 | atarist_state *driver_state = device->machine->driver_data; |
| 1336 | |
| 1337 | return driver_state->midi_rx; |
| 1338 | } |
| 1339 | |
| 1340 | static WRITE_LINE_DEVICE_HANDLER( midi_tx ) |
| 1341 | { |
| 1342 | atarist_state *driver_state = device->machine->driver_data; |
| 1343 | |
| 1344 | driver_state->midi_tx = state; |
| 1345 | } |
| 1346 | |
| 1347 | static WRITE_LINE_DEVICE_HANDLER( acia_interrupt ) |
| 1348 | { |
| 1349 | atarist_state *driver_state = device->machine->driver_data; |
| 1350 | |
| 1330 | 1351 | driver_state->acia_irq = state; |
| 1331 | 1352 | } |
| 1332 | 1353 | |
| 1333 | | static const acia6850_interface acia_ikbd_intf = |
| 1354 | static ACIA6850_INTERFACE( acia_ikbd_intf ) |
| 1334 | 1355 | { |
| 1335 | 1356 | Y2/64, |
| 1336 | 1357 | Y2/64, |
| 1337 | | &ikbd_rx, |
| 1338 | | &ikbd_tx, |
| 1339 | | NULL, |
| 1340 | | NULL, |
| 1341 | | NULL, |
| 1342 | | acia_interrupt |
| 1358 | DEVCB_LINE(ikbd_rx), |
| 1359 | DEVCB_LINE(ikbd_tx), |
| 1360 | DEVCB_NULL, |
| 1361 | DEVCB_NULL, |
| 1362 | DEVCB_NULL, |
| 1363 | DEVCB_LINE(acia_interrupt) |
| 1343 | 1364 | }; |
| 1344 | 1365 | |
| 1345 | | static const acia6850_interface acia_midi_intf = |
| 1366 | static ACIA6850_INTERFACE( acia_midi_intf ) |
| 1346 | 1367 | { |
| 1347 | 1368 | Y2/64, |
| 1348 | 1369 | Y2/64, |
| 1349 | | &acia_midi_rx, |
| 1350 | | &acia_midi_tx, |
| 1351 | | NULL, |
| 1352 | | NULL, |
| 1353 | | NULL, |
| 1354 | | acia_interrupt |
| 1370 | DEVCB_LINE(midi_rx), |
| 1371 | DEVCB_LINE(midi_tx), |
| 1372 | DEVCB_NULL, |
| 1373 | DEVCB_NULL, |
| 1374 | DEVCB_NULL, |
| 1375 | DEVCB_LINE(acia_interrupt) |
| 1355 | 1376 | }; |
| 1356 | 1377 | |
| 1357 | 1378 | static IRQ_CALLBACK( atarist_int_ack ) |
| r4241 | r4242 | |
| 1428 | 1449 | |
| 1429 | 1450 | static void atarist_configure_memory(running_machine *machine) |
| 1430 | 1451 | { |
| 1431 | | const address_space *program = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 1452 | const address_space *program = cputag_get_address_space(machine, M68000_TAG, ADDRESS_SPACE_PROGRAM); |
| 1432 | 1453 | UINT8 *RAM = memory_region(machine, M68000_TAG); |
| 1433 | 1454 | |
| 1434 | 1455 | switch (mess_ram_size) |
| r4241 | r4242 | |
| 1486 | 1507 | state_save_register_global(machine, state->ikbd_mouse_px); |
| 1487 | 1508 | state_save_register_global(machine, state->ikbd_mouse_py); |
| 1488 | 1509 | state_save_register_global(machine, state->ikbd_mouse_pc); |
| 1489 | | state_save_register_global(machine, ikbd_rx); |
| 1490 | | state_save_register_global(machine, ikbd_tx); |
| 1510 | state_save_register_global(machine, state->ikbd_rx); |
| 1511 | state_save_register_global(machine, state->ikbd_tx); |
| 1512 | state_save_register_global(machine, state->midi_rx); |
| 1513 | state_save_register_global(machine, state->midi_tx); |
| 1491 | 1514 | state_save_register_global(machine, state->acia_irq); |
| 1492 | | state_save_register_global(machine, acia_midi_rx); |
| 1493 | | state_save_register_global(machine, acia_midi_tx); |
| 1494 | | state_save_register_global(machine, mfp_rx); |
| 1495 | | state_save_register_global(machine, mfp_tx); |
| 1496 | 1515 | } |
| 1497 | 1516 | |
| 1498 | 1517 | static MACHINE_START( atarist ) |
| r4241 | r4242 | |
| 1506 | 1525 | centronics_config(machine, 0, atarist_centronics_config); |
| 1507 | 1526 | |
| 1508 | 1527 | /* set CPU interrupt callback */ |
| 1509 | | cpu_set_irq_callback(machine->cpu[0], atarist_int_ack); |
| 1528 | cpu_set_irq_callback(cputag_get_cpu(machine, M68000_TAG), atarist_int_ack); |
| 1510 | 1529 | |
| 1511 | 1530 | /* find devices */ |
| 1512 | 1531 | state->mc68901 = devtag_get_device(machine, MC68901, MC68901_TAG); |
| 1532 | state->wd1772 = devtag_get_device(machine, WD1772, WD1772_TAG); |
| 1513 | 1533 | |
| 1514 | 1534 | /* register for state saving */ |
| 1515 | 1535 | atarist_state_save(machine); |
| r4241 | r4242 | |
| 1601 | 1621 | centronics_config(machine, 0, atarist_centronics_config); |
| 1602 | 1622 | |
| 1603 | 1623 | /* set CPU interrupt callback */ |
| 1604 | | cpu_set_irq_callback(machine->cpu[0], atarist_int_ack); |
| 1624 | cpu_set_irq_callback(cputag_get_cpu(machine, M68000_TAG), atarist_int_ack); |
| 1605 | 1625 | |
| 1606 | 1626 | /* allocate timers */ |
| 1607 | 1627 | state->dmasound_timer = timer_alloc(machine, atariste_dmasound_tick, NULL); |
| r4241 | r4242 | |
| 1609 | 1629 | |
| 1610 | 1630 | /* find devices */ |
| 1611 | 1631 | state->mc68901 = devtag_get_device(machine, MC68901, MC68901_TAG); |
| 1632 | state->wd1772 = devtag_get_device(machine, WD1772, WD1772_TAG); |
| 1612 | 1633 | state->lmc1992 = devtag_get_device(machine, LMC1992, LMC1992_TAG); |
| 1613 | 1634 | |
| 1614 | 1635 | /* register for state saving */ |
| r4241 | r4242 | |
| 1626 | 1647 | |
| 1627 | 1648 | static void stbook_configure_memory(running_machine *machine) |
| 1628 | 1649 | { |
| 1629 | | const address_space *program = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 1650 | const address_space *program = cputag_get_address_space(machine, M68000_TAG, ADDRESS_SPACE_PROGRAM); |
| 1630 | 1651 | UINT8 *RAM = memory_region(machine, M68000_TAG); |
| 1631 | 1652 | |
| 1632 | 1653 | switch (mess_ram_size) |
| r4241 | r4242 | |
| 1655 | 1676 | |
| 1656 | 1677 | static WRITE8_HANDLER( stbook_ym2149_port_a_w ) |
| 1657 | 1678 | { |
| 1658 | | device_config *fdc = (device_config*)devtag_get_device(space->machine, WD1772, "wd1772"); |
| 1659 | | wd17xx_set_side(fdc,(data & 0x01) ? 0 : 1); |
| 1679 | atarist_state *state = space->machine->driver_data; |
| 1660 | 1680 | |
| 1681 | wd17xx_set_side(state->wd1772, (data & 0x01) ? 0 : 1); |
| 1682 | |
| 1661 | 1683 | if (!(data & 0x02)) |
| 1662 | 1684 | { |
| 1663 | | wd17xx_set_drive(fdc,0); |
| 1685 | wd17xx_set_drive(state->wd1772, 0); |
| 1664 | 1686 | } |
| 1665 | 1687 | |
| 1666 | 1688 | if (!(data & 0x04)) |
| 1667 | 1689 | { |
| 1668 | | wd17xx_set_drive(fdc,1); |
| 1690 | wd17xx_set_drive(state->wd1772, 1); |
| 1669 | 1691 | } |
| 1670 | 1692 | |
| 1671 | 1693 | // 0x08 = RTS |
| r4241 | r4242 | |
| 1687 | 1709 | ym2149_port_b_w |
| 1688 | 1710 | }; |
| 1689 | 1711 | |
| 1690 | | static UINT8 krxd, ktxd; |
| 1691 | | |
| 1692 | | static const acia6850_interface stbook_acia_ikbd_intf = |
| 1712 | static ACIA6850_INTERFACE( stbook_acia_ikbd_intf ) |
| 1693 | 1713 | { |
| 1694 | 1714 | U517/2/16, // 500kHz |
| 1695 | 1715 | U517/2/2, // 1MHZ |
| 1696 | | &krxd, |
| 1697 | | &ktxd, |
| 1698 | | NULL, |
| 1699 | | NULL, |
| 1700 | | NULL, |
| 1701 | | acia_interrupt |
| 1716 | DEVCB_LINE(ikbd_rx), |
| 1717 | DEVCB_LINE(ikbd_tx), |
| 1718 | DEVCB_NULL, |
| 1719 | DEVCB_NULL, |
| 1720 | DEVCB_NULL, |
| 1721 | DEVCB_LINE(acia_interrupt) |
| 1702 | 1722 | }; |
| 1703 | 1723 | |
| 1704 | | #if 0 |
| 1705 | | /* SVN 4235 - this code is no longer used */ |
| 1706 | 1724 | static READ8_DEVICE_HANDLER( stbook_mfp_gpio_r ) |
| 1707 | 1725 | { |
| 1708 | 1726 | /* |
| r4241 | r4242 | |
| 1722 | 1740 | |
| 1723 | 1741 | atarist_state *state = device->machine->driver_data; |
| 1724 | 1742 | |
| 1725 | | UINT8 data = (centronics_read_handshake(device->machine,0) & CENTRONICS_NOT_BUSY) >> 7; |
| 1743 | UINT8 data = (centronics_read_handshake(device->machine, 0) & CENTRONICS_NOT_BUSY) >> 7; |
| 1726 | 1744 | |
| 1727 | 1745 | data |= (state->acia_irq << 4); |
| 1728 | 1746 | data |= (state->fdc_irq << 5); |
| 1729 | 1747 | |
| 1730 | 1748 | return data; |
| 1731 | 1749 | } |
| 1732 | | #endif |
| 1733 | 1750 | |
| 1734 | 1751 | static MC68901_INTERFACE( stbook_mfp_intf ) |
| 1735 | 1752 | { |
| 1736 | 1753 | Y1, /* timer clock */ |
| 1737 | 1754 | 0, /* receive clock */ |
| 1738 | 1755 | 0, /* transmit clock */ |
| 1739 | | DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, mfp_gpio_r), /* GPIO read */ |
| 1756 | DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, stbook_mfp_gpio_r), /* GPIO read */ |
| 1740 | 1757 | DEVCB_NULL, /* GPIO write */ |
| 1741 | 1758 | DEVCB_NULL, /* serial input */ |
| 1742 | 1759 | DEVCB_NULL, /* serial output */ |
| r4241 | r4242 | |
| 1758 | 1775 | centronics_config(machine, 0, atarist_centronics_config); |
| 1759 | 1776 | |
| 1760 | 1777 | /* set CPU interrupt callback */ |
| 1761 | | cpu_set_irq_callback(machine->cpu[0], atarist_int_ack); |
| 1778 | cpu_set_irq_callback(cputag_get_cpu(machine, M68000_TAG), atarist_int_ack); |
| 1762 | 1779 | |
| 1763 | 1780 | /* find devices */ |
| 1764 | 1781 | state->mc68901 = devtag_get_device(machine, MC68901, MC68901_TAG); |
| 1782 | state->wd1772 = devtag_get_device(machine, WD1772, WD1772_TAG); |
| 1765 | 1783 | |
| 1766 | 1784 | /* register for state saving */ |
| 1767 | 1785 | atariste_state_save(machine); |
| 1768 | | state_save_register_global(machine, krxd); |
| 1769 | | state_save_register_global(machine, ktxd); |
| 1770 | 1786 | } |
| 1771 | 1787 | |
| 1772 | 1788 | static DEVICE_IMAGE_LOAD( atarist_cart ) |
| r4241 | r4242 | |
| 1802 | 1818 | MDRV_CPU_ADD(M68000_TAG, M68000, Y2/4) |
| 1803 | 1819 | MDRV_CPU_PROGRAM_MAP(st_map, 0) |
| 1804 | 1820 | |
| 1805 | | MDRV_CPU_ADD("keyboard", HD63701, XTAL_4MHz) /* HD6301 */ |
| 1821 | MDRV_CPU_ADD(HD6301_TAG, HD63701, XTAL_4MHz) /* HD6301 */ |
| 1806 | 1822 | MDRV_CPU_PROGRAM_MAP(ikbd_map, 0) |
| 1807 | 1823 | MDRV_CPU_IO_MAP(ikbd_io_map, 0) |
| 1808 | 1824 | |
| r4241 | r4242 | |
| 1834 | 1850 | MDRV_ACIA6850_ADD("acia_0", acia_ikbd_intf) |
| 1835 | 1851 | MDRV_ACIA6850_ADD("acia_1", acia_midi_intf) |
| 1836 | 1852 | |
| 1837 | | MDRV_WD1772_ADD("wd1772", atarist_wd17xx_interface ) |
| 1853 | MDRV_WD1772_ADD(WD1772_TAG, atarist_wd17xx_interface ) |
| 1838 | 1854 | |
| 1839 | 1855 | MDRV_IMPORT_FROM(atarist_cartslot) |
| 1840 | 1856 | MACHINE_DRIVER_END |
| r4241 | r4242 | |
| 1844 | 1860 | |
| 1845 | 1861 | MDRV_CPU_MODIFY(M68000_TAG) |
| 1846 | 1862 | MDRV_CPU_PROGRAM_MAP(megast_map, 0) |
| 1847 | | MDRV_RP5C15_ADD("rp5c15",rtc_intf) |
| 1863 | MDRV_RP5C15_ADD("rp5c15", rtc_intf) |
| 1848 | 1864 | |
| 1849 | 1865 | MDRV_MACHINE_START(megast) |
| 1850 | 1866 | MACHINE_DRIVER_END |
| r4241 | r4242 | |
| 1856 | 1872 | MDRV_CPU_ADD(M68000_TAG, M68000, Y2/4) |
| 1857 | 1873 | MDRV_CPU_PROGRAM_MAP(ste_map, 0) |
| 1858 | 1874 | |
| 1859 | | MDRV_CPU_ADD("keyboard", HD63701, XTAL_4MHz) /* HD6301 */ |
| 1875 | MDRV_CPU_ADD(HD6301_TAG, HD63701, XTAL_4MHz) /* HD6301 */ |
| 1860 | 1876 | MDRV_CPU_PROGRAM_MAP(ikbd_map, 0) |
| 1861 | 1877 | MDRV_CPU_IO_MAP(ikbd_io_map, 0) |
| 1862 | 1878 | |
| r4241 | r4242 | |
| 1896 | 1912 | MDRV_ACIA6850_ADD("acia_0", acia_ikbd_intf) |
| 1897 | 1913 | MDRV_ACIA6850_ADD("acia_1", acia_midi_intf) |
| 1898 | 1914 | |
| 1899 | | MDRV_WD1772_ADD("wd1772", atarist_wd17xx_interface ) |
| 1915 | MDRV_WD1772_ADD(WD1772_TAG, atarist_wd17xx_interface ) |
| 1900 | 1916 | |
| 1901 | 1917 | MDRV_IMPORT_FROM(atarist_cartslot) |
| 1902 | 1918 | MACHINE_DRIVER_END |
| r4241 | r4242 | |
| 1906 | 1922 | |
| 1907 | 1923 | MDRV_CPU_MODIFY(M68000_TAG) |
| 1908 | 1924 | MDRV_CPU_PROGRAM_MAP(megaste_map, 0) |
| 1909 | | MDRV_RP5C15_ADD("rp5c15",rtc_intf) |
| 1925 | MDRV_RP5C15_ADD("rp5c15", rtc_intf) |
| 1910 | 1926 | |
| 1911 | 1927 | MDRV_MACHINE_START(megaste) |
| 1912 | 1928 | MACHINE_DRIVER_END |
| r4241 | r4242 | |
| 1917 | 1933 | // basic machine hardware |
| 1918 | 1934 | MDRV_CPU_ADD(M68000_TAG, M68000, U517/2) |
| 1919 | 1935 | MDRV_CPU_PROGRAM_MAP(stbook_map, 0) |
| 1920 | | MDRV_RP5C15_ADD("rp5c15",rtc_intf) |
| 1921 | 1936 | |
| 1922 | | //MDRV_CPU_ADD("cop888", COP888, Y700) |
| 1937 | //MDRV_CPU_ADD(COP888_TAG, COP888, Y700) |
| 1923 | 1938 | |
| 1924 | 1939 | MDRV_MACHINE_START(stbook) |
| 1925 | 1940 | |
| 1926 | 1941 | // device hardware |
| 1927 | 1942 | MDRV_MC68901_ADD(MC68901_TAG, U517/8, stbook_mfp_intf) |
| 1943 | MDRV_RP5C15_ADD("rp5c15", rtc_intf) |
| 1928 | 1944 | MDRV_SCC8530_ADD("scc") |
| 1929 | 1945 | |
| 1930 | 1946 | // video hardware |
| r4241 | r4242 | |
| 1941 | 1957 | |
| 1942 | 1958 | // sound hardware |
| 1943 | 1959 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1944 | | MDRV_SOUND_ADD("ym3439", YM3439, U517/8) |
| 1960 | MDRV_SOUND_ADD(YM3439_TAG, YM3439, U517/8) |
| 1945 | 1961 | MDRV_SOUND_CONFIG(stbook_ym2149_interface) |
| 1946 | 1962 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 1947 | 1963 | |
| r4241 | r4242 | |
| 1952 | 1968 | MDRV_ACIA6850_ADD("acia_0", stbook_acia_ikbd_intf) |
| 1953 | 1969 | MDRV_ACIA6850_ADD("acia_1", acia_midi_intf) |
| 1954 | 1970 | |
| 1955 | | MDRV_WD1772_ADD("wd1772", atarist_wd17xx_interface ) |
| 1971 | MDRV_WD1772_ADD(WD1772_TAG, atarist_wd17xx_interface ) |
| 1956 | 1972 | |
| 1957 | 1973 | MDRV_IMPORT_FROM(atarist_cartslot) |
| 1958 | 1974 | MACHINE_DRIVER_END |
| r4241 | r4242 | |
| 1979 | 1995 | |
| 1980 | 1996 | ROM_COPY( M68000_TAG, 0xfc0000, 0x000000, 0x000008 ) |
| 1981 | 1997 | |
| 1982 | | ROM_REGION( 0x10000, "keyboard", 0 ) |
| 1998 | ROM_REGION( 0x10000, HD6301_TAG, 0 ) |
| 1983 | 1999 | ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) ) |
| 1984 | 2000 | ROM_END |
| 1985 | 2001 | |
| r4241 | r4242 | |
| 1991 | 2007 | ROMX_LOAD( "tos102.img", 0xfc0000, 0x030000, BAD_DUMP CRC(3b5cd0c5) SHA1(87900a40a890fdf03bd08be6c60cc645855cbce5), ROM_BIOS(2) ) |
| 1992 | 2008 | ROM_COPY( M68000_TAG, 0xfc0000, 0x000000, 0x000008 ) |
| 1993 | 2009 | |
| 1994 | | ROM_REGION( 0x10000, "keyboard", 0 ) |
| 2010 | ROM_REGION( 0x10000, HD6301_TAG, 0 ) |
| 1995 | 2011 | ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) ) |
| 1996 | 2012 | ROM_END |
| 1997 | 2013 | |
| r4241 | r4242 | |
| 2001 | 2017 | ROMX_LOAD( "tos104.img", 0xfc0000, 0x030000, BAD_DUMP CRC(a50d1d43) SHA1(9526ef63b9cb1d2a7109e278547ae78a5c1db6c6), ROM_BIOS(1) ) |
| 2002 | 2018 | ROM_COPY( M68000_TAG, 0xfc0000, 0x000000, 0x000008 ) |
| 2003 | 2019 | |
| 2004 | | ROM_REGION( 0x10000, "keyboard", 0 ) |
| 2020 | ROM_REGION( 0x10000, HD6301_TAG, 0 ) |
| 2005 | 2021 | ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) ) |
| 2006 | 2022 | ROM_END |
| 2007 | 2023 | |
| r4241 | r4242 | |
| 2013 | 2029 | ROMX_LOAD( "tos106.img", 0xe00000, 0x040000, BAD_DUMP CRC(d72fea29) SHA1(06f9ea322e74b682df0396acfaee8cb4d9c90cad), ROM_BIOS(2) ) |
| 2014 | 2030 | ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 ) |
| 2015 | 2031 | |
| 2016 | | ROM_REGION( 0x10000, "keyboard", 0 ) |
| 2032 | ROM_REGION( 0x10000, HD6301_TAG, 0 ) |
| 2017 | 2033 | ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) ) |
| 2018 | 2034 | ROM_END |
| 2019 | 2035 | |
| r4241 | r4242 | |
| 2027 | 2043 | ROMX_LOAD( "tos202.img", 0xe00000, 0x030000, NO_DUMP, ROM_BIOS(3) ) |
| 2028 | 2044 | ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 ) |
| 2029 | 2045 | |
| 2030 | | ROM_REGION( 0x10000, "keyboard", 0 ) |
| 2046 | ROM_REGION( 0x10000, HD6301_TAG, 0 ) |
| 2031 | 2047 | ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) ) |
| 2032 | 2048 | ROM_END |
| 2033 | 2049 | |
| r4241 | r4242 | |
| 2037 | 2053 | ROMX_LOAD( "tos208.img", 0xe00000, 0x040000, NO_DUMP, ROM_BIOS(1) ) |
| 2038 | 2054 | ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 ) |
| 2039 | 2055 | |
| 2040 | | ROM_REGION( 0x10000, "cpu1", 0 ) |
| 2056 | ROM_REGION( 0x10000, COP888_TAG, 0 ) |
| 2041 | 2057 | ROM_LOAD( "cop888c0.u703", 0x0000, 0x1000, NO_DUMP ) |
| 2042 | 2058 | ROM_END |
| 2043 | 2059 | |
| r4241 | r4242 | |
| 2058 | 2074 | ROMX_LOAD( "tos301.img", 0xe00000, 0x080000, NO_DUMP, ROM_BIOS(3) ) |
| 2059 | 2075 | ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 ) |
| 2060 | 2076 | |
| 2061 | | ROM_REGION( 0x10000, "keyboard", 0 ) |
| 2077 | ROM_REGION( 0x10000, HD6301_TAG, 0 ) |
| 2062 | 2078 | ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) ) |
| 2063 | 2079 | ROM_END |
| 2064 | 2080 | |
| r4241 | r4242 | |
| 2068 | 2084 | ROMX_LOAD( "tos207.img", 0xe00000, 0x040000, NO_DUMP, ROM_BIOS(1) ) |
| 2069 | 2085 | ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 ) |
| 2070 | 2086 | |
| 2071 | | ROM_REGION( 0x10000, "keyboard", 0 ) |
| 2087 | ROM_REGION( 0x10000, HD6301_TAG, 0 ) |
| 2072 | 2088 | ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) ) |
| 2073 | 2089 | ROM_END |
| 2074 | 2090 | |
| r4241 | r4242 | |
| 2084 | 2100 | ROMX_LOAD( "tos400.img", 0xe00000, 0x080000, BAD_DUMP CRC(1fbc5396) SHA1(d74d09f11a0bf37a86ccb50c6e7f91aac4d4b11b), ROM_BIOS(4) ) |
| 2085 | 2101 | ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 ) |
| 2086 | 2102 | |
| 2087 | | ROM_REGION( 0x10000, "keyboard", 0 ) |
| 2103 | ROM_REGION( 0x10000, HD6301_TAG, 0 ) |
| 2088 | 2104 | ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) ) |
| 2089 | 2105 | ROM_END |
| 2090 | 2106 | |
| r4241 | r4242 | |
| 2245 | 2261 | /* System Drivers */ |
| 2246 | 2262 | |
| 2247 | 2263 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 2248 | | COMP( 1985, atarist, 0, 0, atarist, atarist, 0, atarist, "Atari", "ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2249 | | COMP( 1987, megast, atarist, 0, megast, atarist, 0, megast, "Atari", "Mega ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2264 | COMP( 1985, atarist, 0, 0, atarist, atarist, 0, atarist, "Atari", "ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2265 | COMP( 1987, megast, atarist, 0, megast, atarist, 0, megast, "Atari", "Mega ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2250 | 2266 | /* |
| 2251 | 2267 | COMP( 1989, stacy, atarist, 0, stacy, stacy, 0, stacy, "Atari", "Stacy", GAME_NOT_WORKING ) |
| 2252 | 2268 | */ |
| 2253 | 2269 | COMP( 1989, atariste, 0, 0, atariste, atariste, 0, atariste, "Atari", "STE", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2254 | | COMP( 1990, stbook, atariste, 0, stbook, stbook, 0, stbook, "Atari", "STBook", GAME_NOT_WORKING ) |
| 2255 | | COMP( 1991, megaste, atariste, 0, megaste, atarist, 0, megaste, "Atari", "Mega STE", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2270 | COMP( 1990, stbook, atariste, 0, stbook, stbook, 0, stbook, "Atari", "STBook", GAME_NOT_WORKING ) |
| 2271 | COMP( 1991, megaste, atariste, 0, megaste, atarist, 0, megaste, "Atari", "Mega STE", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 2256 | 2272 | /* |
| 2257 | 2273 | COMP( 1991, stpad, atariste, 0, stpad, stpad, 0, stpad, "Atari", "STPad (prototype)", GAME_NOT_WORKING ) |
| 2258 | 2274 | COMP( 1990, tt030, 0, 0, tt030, tt030, 0, tt030, "Atari", "TT030", GAME_NOT_WORKING ) |