trunk/src/mess/drivers/binbug.c
| r20336 | r20337 | |
| 74 | 74 | virtual void video_start(); |
| 75 | 75 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 76 | 76 | optional_device<serial_keyboard_device> m_keyboard; |
| 77 | | optional_device<cassette_image_device> m_cass; |
| 77 | required_device<cassette_image_device> m_cass; |
| 78 | 78 | required_shared_ptr<const UINT8> m_p_videoram; |
| 79 | 79 | required_shared_ptr<const UINT8> m_p_attribram; |
| 80 | 80 | }; |
| r20336 | r20337 | |
| 337 | 337 | |
| 338 | 338 | /* |
| 339 | 339 | |
| 340 | | DGOS-Z80 (ETI-680) |
| 340 | DG680 (ETI-680), using the DGOS-Z80 operating system. |
| 341 | 341 | |
| 342 | 342 | This is a S100 card. |
| 343 | 343 | |
| 344 | | ROM is a bad dump, scanned from a pdf. It is being worked on. |
| 344 | In some ways, this system is the ancestor of the original Microbee. |
| 345 | 345 | |
| 346 | ROM is typed in from a PDF, therefore marked a bad dump. |
| 347 | |
| 346 | 348 | No schematic available, most of this is guesswork. |
| 347 | 349 | |
| 350 | Port 0 is the input from an ascii keyboard. |
| 351 | |
| 352 | Port 2 is the cassette interface. |
| 353 | |
| 354 | Port 8 controls some kind of memory protection scheme. |
| 355 | The code indicates that B is the page to protect, and |
| 356 | A is the code (0x08 = inhibit; 0x0B = unprotect; |
| 357 | 0x0C = enable; 0x0E = protect). There are 256 pages so |
| 358 | each page is 256 bytes. |
| 359 | |
| 360 | To turn the clock on (if it was working), put a non-zero |
| 361 | into D80D. |
| 362 | |
| 363 | Monitor Commands: |
| 364 | C (compare)* |
| 365 | E (edit)* |
| 366 | F (fill)* |
| 367 | G - Go to address |
| 368 | I - Inhibit CTC |
| 369 | M (move)* |
| 370 | P (clear screen)* |
| 371 | R (read tape)* |
| 372 | S (search)* |
| 373 | T hhmm [ss] - Set the time |
| 374 | W (write tape)* |
| 375 | X - protection status |
| 376 | XC - clear ram |
| 377 | XD - same as X |
| 378 | XE - enable facilities |
| 379 | XF - disable facilities |
| 380 | XP - protect block |
| 381 | XU - unprotect block |
| 382 | Z - go to 0000. |
| 383 | |
| 384 | * These commands are identical to the Microbee ones. |
| 385 | |
| 348 | 386 | ToDo: |
| 349 | 387 | - dips |
| 350 | 388 | - leds |
| 351 | 389 | - need schematic to find out what else is missing |
| 390 | - cassette |
| 391 | - ctc / clock |
| 352 | 392 | |
| 353 | 393 | */ |
| 354 | 394 | |
| r20336 | r20337 | |
| 359 | 399 | #include "cpu/z80/z80daisy.h" |
| 360 | 400 | |
| 361 | 401 | |
| 362 | | class dgosz80_state : public binbug_state |
| 402 | class dg680_state : public binbug_state |
| 363 | 403 | { |
| 364 | 404 | public: |
| 365 | | dgosz80_state(const machine_config &mconfig, device_type type, const char *tag) |
| 405 | dg680_state(const machine_config &mconfig, device_type type, const char *tag) |
| 366 | 406 | : binbug_state(mconfig, type, tag), |
| 367 | 407 | m_maincpu(*this, "maincpu"), |
| 368 | 408 | m_ctc(*this, "z80ctc"), |
| r20336 | r20337 | |
| 370 | 410 | { } |
| 371 | 411 | |
| 372 | 412 | DECLARE_READ8_MEMBER(porta_r); |
| 413 | DECLARE_READ8_MEMBER(portb_r); |
| 414 | DECLARE_WRITE8_MEMBER(portb_w); |
| 415 | DECLARE_READ8_MEMBER(port08_r); |
| 416 | DECLARE_WRITE8_MEMBER(port08_w); |
| 373 | 417 | DECLARE_WRITE8_MEMBER(kbd_put); |
| 418 | UINT8 m_pio_b; |
| 374 | 419 | UINT8 m_term_data; |
| 420 | UINT8 m_protection[0x100]; |
| 375 | 421 | virtual void machine_reset(); |
| 376 | 422 | required_device<cpu_device> m_maincpu; |
| 377 | 423 | required_device<z80ctc_device> m_ctc; |
| 378 | 424 | required_device<z80pio_device> m_pio; |
| 379 | 425 | }; |
| 380 | 426 | |
| 381 | | static ADDRESS_MAP_START(dgosz80_mem, AS_PROGRAM, 8, dgosz80_state) |
| 427 | static ADDRESS_MAP_START(dg680_mem, AS_PROGRAM, 8, dg680_state) |
| 382 | 428 | ADDRESS_MAP_UNMAP_HIGH |
| 383 | 429 | AM_RANGE( 0x0000, 0xcfff) AM_RAM |
| 384 | 430 | AM_RANGE( 0xd000, 0xd7ff) AM_ROM |
| r20336 | r20337 | |
| 387 | 433 | AM_RANGE( 0xf400, 0xf7ff) AM_RAM AM_SHARE("attribram") |
| 388 | 434 | ADDRESS_MAP_END |
| 389 | 435 | |
| 390 | | static ADDRESS_MAP_START(dgosz80_io, AS_IO, 8, dgosz80_state) |
| 436 | static ADDRESS_MAP_START(dg680_io, AS_IO, 8, dg680_state) |
| 391 | 437 | ADDRESS_MAP_UNMAP_HIGH |
| 392 | 438 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 393 | 439 | AM_RANGE(0x00,0x03) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt) |
| 394 | 440 | AM_RANGE(0x04,0x07) AM_DEVREADWRITE("z80ctc", z80ctc_device, read, write) |
| 395 | | //AM_RANGE(0x08,0x08) SWP Control and Status |
| 441 | AM_RANGE(0x08,0x08) AM_READWRITE(port08_r,port08_w) //SWP Control and Status |
| 396 | 442 | //AM_RANGE(0x09,0x09) parallel input port |
| 397 | 443 | // Optional AM9519 Programmable Interrupt Controller (port c = data, port d = control) |
| 398 | 444 | //AM_RANGE(0x0c,0x0d) AM_DEVREADWRITE("am9519", am9519_device, read, write) |
| 399 | 445 | ADDRESS_MAP_END |
| 400 | 446 | |
| 401 | | void dgosz80_state::machine_reset() |
| 447 | void dg680_state::machine_reset() |
| 402 | 448 | { |
| 403 | 449 | m_maincpu->set_pc(0xd000); |
| 404 | 450 | } |
| 405 | 451 | |
| 406 | 452 | // this is a guess there is no information available |
| 407 | | static const z80_daisy_config dgosz80_daisy_chain[] = |
| 453 | static const z80_daisy_config dg680_daisy_chain[] = |
| 408 | 454 | { |
| 409 | 455 | { "z80ctc" }, |
| 410 | 456 | { "z80pio" }, |
| r20336 | r20337 | |
| 413 | 459 | |
| 414 | 460 | |
| 415 | 461 | /* Input ports */ |
| 416 | | static INPUT_PORTS_START( dgosz80 ) |
| 462 | static INPUT_PORTS_START( dg680 ) |
| 417 | 463 | INPUT_PORTS_END |
| 418 | 464 | |
| 419 | | WRITE8_MEMBER( dgosz80_state::kbd_put ) |
| 465 | WRITE8_MEMBER( dg680_state::kbd_put ) |
| 420 | 466 | { |
| 421 | 467 | m_term_data = data; |
| 422 | 468 | /* strobe in keyboard data */ |
| r20336 | r20337 | |
| 424 | 470 | m_pio->strobe_a(1); |
| 425 | 471 | } |
| 426 | 472 | |
| 427 | | static ASCII_KEYBOARD_INTERFACE( dgosz80_keyboard_intf ) |
| 473 | static ASCII_KEYBOARD_INTERFACE( dg680_keyboard_intf ) |
| 428 | 474 | { |
| 429 | | DEVCB_DRIVER_MEMBER(dgosz80_state, kbd_put) |
| 475 | DEVCB_DRIVER_MEMBER(dg680_state, kbd_put) |
| 430 | 476 | }; |
| 431 | 477 | |
| 432 | | READ8_MEMBER( dgosz80_state::porta_r ) |
| 478 | READ8_MEMBER( dg680_state::porta_r ) |
| 433 | 479 | { |
| 434 | 480 | UINT8 data = m_term_data; |
| 435 | 481 | m_term_data = 0; |
| 436 | 482 | return data; |
| 437 | 483 | } |
| 438 | 484 | |
| 485 | READ8_MEMBER( dg680_state::portb_r ) |
| 486 | { |
| 487 | return m_pio_b | (m_cass->input() > 0.03); |
| 488 | } |
| 489 | |
| 490 | // bit 1 = cassout; bit 2 = motor on |
| 491 | WRITE8_MEMBER( dg680_state::portb_w ) |
| 492 | { |
| 493 | m_pio_b = data & 0xfe; |
| 494 | m_cass->output(BIT(data, 1) ? -1.0 : +1.0); |
| 495 | } |
| 496 | |
| 497 | READ8_MEMBER( dg680_state::port08_r ) |
| 498 | { |
| 499 | UINT8 breg = m_maincpu->state_int(Z80_B); |
| 500 | return m_protection[breg]; |
| 501 | } |
| 502 | |
| 503 | WRITE8_MEMBER( dg680_state::port08_w ) |
| 504 | { |
| 505 | UINT8 breg = m_maincpu->state_int(Z80_B); |
| 506 | m_protection[breg] = data; |
| 507 | } |
| 508 | |
| 439 | 509 | static Z80PIO_INTERFACE( z80pio_intf ) |
| 440 | 510 | { |
| 441 | 511 | DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), //IRQ |
| 442 | | DEVCB_DRIVER_MEMBER(dgosz80_state, porta_r), // in port A |
| 512 | DEVCB_DRIVER_MEMBER(dg680_state, porta_r), // in port A |
| 443 | 513 | DEVCB_NULL, // out port A |
| 444 | 514 | DEVCB_NULL, // ready line port A - this activates to ask for kbd data but not known if actually used |
| 445 | | DEVCB_NULL, // in port B |
| 446 | | DEVCB_NULL, // out port B |
| 515 | DEVCB_DRIVER_MEMBER(dg680_state, portb_r), // in port B |
| 516 | DEVCB_DRIVER_MEMBER(dg680_state, portb_w), // out port B |
| 447 | 517 | DEVCB_NULL |
| 448 | 518 | }; |
| 449 | 519 | |
| r20336 | r20337 | |
| 455 | 525 | DEVCB_DEVICE_LINE_MEMBER("z80ctc", z80ctc_device, trg3) // ZC/TO2 callback |
| 456 | 526 | }; |
| 457 | 527 | |
| 458 | | static MACHINE_CONFIG_START( dgosz80, dgosz80_state ) |
| 528 | static MACHINE_CONFIG_START( dg680, dg680_state ) |
| 459 | 529 | /* basic machine hardware */ |
| 460 | 530 | MCFG_CPU_ADD("maincpu",Z80, XTAL_8MHz / 4) |
| 461 | | MCFG_CPU_PROGRAM_MAP(dgosz80_mem) |
| 462 | | MCFG_CPU_IO_MAP(dgosz80_io) |
| 463 | | MCFG_CPU_CONFIG(dgosz80_daisy_chain) |
| 531 | MCFG_CPU_PROGRAM_MAP(dg680_mem) |
| 532 | MCFG_CPU_IO_MAP(dg680_io) |
| 533 | MCFG_CPU_CONFIG(dg680_daisy_chain) |
| 464 | 534 | |
| 465 | 535 | /* video hardware */ |
| 466 | 536 | MCFG_SCREEN_ADD("screen", RASTER) |
| r20336 | r20337 | |
| 474 | 544 | MCFG_PALETTE_INIT(monochrome_amber) |
| 475 | 545 | |
| 476 | 546 | /* Keyboard */ |
| 477 | | MCFG_ASCII_KEYBOARD_ADD("keyb", dgosz80_keyboard_intf) |
| 547 | MCFG_ASCII_KEYBOARD_ADD("keyb", dg680_keyboard_intf) |
| 478 | 548 | |
| 549 | /* Cassette */ |
| 550 | MCFG_CASSETTE_ADD( CASSETTE_TAG, default_cassette_interface ) |
| 551 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 552 | MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG) |
| 553 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 554 | |
| 479 | 555 | /* Devices */ |
| 480 | 556 | MCFG_Z80CTC_ADD( "z80ctc", XTAL_8MHz / 4, z80ctc_intf ) |
| 481 | 557 | MCFG_Z80PIO_ADD( "z80pio", XTAL_8MHz / 4, z80pio_intf ) |
| r20336 | r20337 | |
| 483 | 559 | |
| 484 | 560 | |
| 485 | 561 | /* ROM definition */ |
| 486 | | ROM_START( dgosz80 ) |
| 562 | ROM_START( dg680 ) |
| 487 | 563 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 488 | | ROM_LOAD( "dgosz80.rom", 0xd000, 0x0800, NO_DUMP) |
| 564 | ROM_LOAD( "dg680.rom", 0xd000, 0x0800, CRC(c1aaef6a) SHA1(1508ca8315452edfb984718e795ccbe79a0c0b58) ) |
| 489 | 565 | |
| 490 | 566 | ROM_REGION( 0x0800, "chargen", 0 ) |
| 491 | 567 | ROM_LOAD( "6574.bin", 0x0000, 0x0800, CRC(fd75df4f) SHA1(4d09aae2f933478532b7d3d1a2dee7123d9828ca) ) |
| r20336 | r20337 | |
| 496 | 572 | |
| 497 | 573 | /* Driver */ |
| 498 | 574 | |
| 499 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ |
| 500 | | COMP( 1980, dgosz80, 0, 0, dgosz80, dgosz80, driver_device, 0, "David Griffiths", "DGOS-Z80 1.4", GAME_NOT_WORKING | GAME_NO_SOUND_HW ) |
| 575 | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ |
| 576 | COMP( 1980, dg680, 0, 0, dg680, dg680, driver_device, 0, "David Griffiths", "DGOS-Z80 1.4", GAME_NOT_WORKING | GAME_NO_SOUND_HW ) |