src/mess/drivers/super6.c
| r11832 | r11833 | |
| 10 | 10 | |
| 11 | 11 | TODO: |
| 12 | 12 | |
| 13 | - floppy (cannot be implemented currently since this is another case of halting the cpu mid-instruction) |
| 13 | 14 | - interrupts |
| 14 | | - terminal input |
| 15 | | - floppy cold boot error |
| 16 | 15 | - DMA |
| 17 | 16 | - peripheral interfaces |
| 18 | 17 | |
| r11832 | r11833 | |
| 183 | 182 | |
| 184 | 183 | READ8_MEMBER( super6_state::fdc_r ) |
| 185 | 184 | { |
| 186 | | return m_fdc_data; |
| 185 | /* |
| 186 | |
| 187 | bit description |
| 188 | |
| 189 | 0 |
| 190 | 1 |
| 191 | 2 |
| 192 | 3 |
| 193 | 4 |
| 194 | 5 |
| 195 | 6 |
| 196 | 7 FDC INTRQ |
| 197 | |
| 198 | */ |
| 199 | |
| 200 | // TODO reading this port should halt the CPU until an INTRQ or DRQ from the FDC |
| 201 | |
| 202 | return !wd17xx_intrq_r(m_fdc) << 7; |
| 187 | 203 | } |
| 188 | 204 | |
| 189 | 205 | |
| r11832 | r11833 | |
| 208 | 224 | |
| 209 | 225 | */ |
| 210 | 226 | |
| 211 | | m_fdc_data = data; |
| 212 | | |
| 213 | 227 | // disk drive select |
| 214 | 228 | wd17xx_set_drive(m_fdc, data & 0x03); |
| 215 | 229 | floppy_mon_w(m_floppy0, 0); |
| r11832 | r11833 | |
| 335 | 349 | // Z80CTC_INTERFACE( ctc_intf ) |
| 336 | 350 | //------------------------------------------------- |
| 337 | 351 | |
| 352 | static TIMER_DEVICE_CALLBACK( ctc_tick ) |
| 353 | { |
| 354 | super6_state *state = timer.machine().driver_data<super6_state>(); |
| 355 | |
| 356 | z80ctc_trg0_w(state->m_ctc, 1); |
| 357 | z80ctc_trg0_w(state->m_ctc, 0); |
| 358 | } |
| 359 | |
| 338 | 360 | static Z80CTC_INTERFACE( ctc_intf ) |
| 339 | 361 | { |
| 340 | 362 | 0, |
| r11832 | r11833 | |
| 381 | 403 | static Z80DMA_INTERFACE( dma_intf ) |
| 382 | 404 | { |
| 383 | 405 | DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_HALT), |
| 384 | | DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0), |
| 406 | DEVCB_DEVICE_LINE(Z80CTC_TAG, z80ctc_trg2_w), |
| 385 | 407 | DEVCB_NULL, |
| 386 | 408 | DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_read_byte), |
| 387 | 409 | DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_write_byte), |
| r11832 | r11833 | |
| 414 | 436 | { |
| 415 | 437 | z80dart_rxca_w(m_dart, state); |
| 416 | 438 | z80dart_txca_w(m_dart, state); |
| 439 | |
| 440 | z80ctc_trg1_w(m_ctc, state); |
| 417 | 441 | } |
| 418 | 442 | |
| 419 | 443 | static COM8116_INTERFACE( brg_intf ) |
| r11832 | r11833 | |
| 447 | 471 | // wd17xx_interface fdc_intf |
| 448 | 472 | //------------------------------------------------- |
| 449 | 473 | |
| 474 | WRITE_LINE_MEMBER( super6_state::intrq_w ) |
| 475 | { |
| 476 | // TODO allow CPU to continue reading port 14 |
| 477 | |
| 478 | z80ctc_trg3_w(m_ctc, !state); |
| 479 | } |
| 480 | |
| 481 | WRITE_LINE_MEMBER( super6_state::drq_w ) |
| 482 | { |
| 483 | // TODO allow CPU to continue reading port 14 |
| 484 | |
| 485 | m_dma->rdy_w(state); |
| 486 | } |
| 487 | |
| 450 | 488 | static const wd17xx_interface fdc_intf = |
| 451 | 489 | { |
| 452 | 490 | DEVCB_NULL, |
| 453 | | DEVCB_NULL, |
| 454 | | DEVCB_DEVICE_LINE_MEMBER(Z80DMA_TAG, z80dma_device, rdy_w), |
| 491 | DEVCB_DRIVER_LINE_MEMBER(super6_state, intrq_w), |
| 492 | DEVCB_DRIVER_LINE_MEMBER(super6_state, drq_w), |
| 455 | 493 | { FLOPPY_0, FLOPPY_1, NULL, NULL } |
| 456 | 494 | }; |
| 457 | 495 | |
| 458 | 496 | |
| 459 | 497 | //------------------------------------------------- |
| 460 | | // Z80PIO_INTERFACE( pio_intf ) |
| 498 | // z80_daisy_config super6_daisy_chain |
| 461 | 499 | //------------------------------------------------- |
| 462 | 500 | |
| 463 | 501 | static const z80_daisy_config super6_daisy_chain[] = |
| 464 | 502 | { |
| 503 | { Z80CTC_TAG }, |
| 504 | { Z80DART_TAG }, |
| 505 | { Z80PIO_TAG }, |
| 465 | 506 | { NULL } |
| 466 | 507 | }; |
| 467 | 508 | |
| r11832 | r11833 | |
| 470 | 511 | // GENERIC_TERMINAL_INTERFACE( terminal_intf ) |
| 471 | 512 | //------------------------------------------------- |
| 472 | 513 | |
| 514 | static WRITE8_DEVICE_HANDLER( dummy_w ) |
| 515 | { |
| 516 | // handled in Z80DART_INTERFACE |
| 517 | } |
| 518 | |
| 473 | 519 | static GENERIC_TERMINAL_INTERFACE( terminal_intf ) |
| 474 | 520 | { |
| 475 | | DEVCB_NULL |
| 521 | DEVCB_HANDLER(dummy_w) |
| 476 | 522 | }; |
| 477 | 523 | |
| 478 | 524 | |
| r11832 | r11833 | |
| 487 | 533 | |
| 488 | 534 | void super6_state::machine_start() |
| 489 | 535 | { |
| 536 | // state saving |
| 537 | save_item(NAME(m_s100)); |
| 538 | save_item(NAME(m_bank0)); |
| 539 | save_item(NAME(m_bank1)); |
| 490 | 540 | } |
| 491 | 541 | |
| 492 | 542 | |
| r11832 | r11833 | |
| 523 | 573 | |
| 524 | 574 | // devices |
| 525 | 575 | MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_24MHz/4, ctc_intf) |
| 576 | MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_24MHz/16)) |
| 526 | 577 | MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_24MHz/4, dart_intf) |
| 527 | 578 | MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_24MHz/6, dma_intf) |
| 528 | 579 | MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_24MHz/4, pio_intf) |