trunk/src/mame/drivers/ecoinf3.c
| r19604 | r19605 | |
| 16 | 16 | #include "ecoinf3.lh" |
| 17 | 17 | #include "machine/steppers.h" // stepper motor |
| 18 | 18 | #include "video/awpvid.h" // drawing reels |
| 19 | #include "sound/sn76496.h" |
| 19 | 20 | |
| 20 | 21 | class ecoinf3_state : public driver_device |
| 21 | 22 | { |
| r19604 | r19605 | |
| 39 | 40 | int m_optic_pattern; |
| 40 | 41 | |
| 41 | 42 | DECLARE_READ8_MEMBER(ppi8255_intf_a_read_a) { int ret = 0x00; logerror("%04x - ppi8255_intf_a_read_a %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 42 | | DECLARE_READ8_MEMBER(ppi8255_intf_a_read_b) { int ret = 0x00; logerror("%04x - ppi8255_intf_a_(used)read_b %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 43 | DECLARE_READ8_MEMBER(ppi8255_intf_a_read_b) |
| 44 | { |
| 45 | int ret = ioport("IN1")->read(); |
| 46 | logerror("%04x - ppi8255_intf_a_(used)read_b %02x\n", machine().device("maincpu")->safe_pcbase(), ret); |
| 47 | return ret; |
| 48 | } |
| 49 | |
| 43 | 50 | DECLARE_READ8_MEMBER(ppi8255_intf_a_read_c) { int ret = 0x00; logerror("%04x - ppi8255_intf_a_read_c %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 44 | 51 | |
| 45 | 52 | DECLARE_READ8_MEMBER(ppi8255_intf_b_read_a) { int ret = 0x00; logerror("%04x - ppi8255_intf_b_read_a %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| r19604 | r19605 | |
| 47 | 54 | DECLARE_READ8_MEMBER(ppi8255_intf_b_read_c) { int ret = 0x00; logerror("%04x - ppi8255_intf_b_read_c %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 48 | 55 | |
| 49 | 56 | DECLARE_READ8_MEMBER(ppi8255_intf_c_read_a) { int ret = 0x00; logerror("%04x - ppi8255_intf_c_(used)read_a %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 50 | | DECLARE_READ8_MEMBER(ppi8255_intf_c_read_b) { int ret = 0xff; logerror("%04x - ppi8255_intf_c_(used)read_b %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } // changing to 00 gives coin tamper |
| 57 | DECLARE_READ8_MEMBER(ppi8255_intf_c_read_b) |
| 58 | { |
| 59 | int ret = ioport("IN2")->read(); |
| 60 | logerror("%04x - ppi8255_intf_c_(used)read_b %02x (COINS+TEST)\n", machine().device("maincpu")->safe_pcbase(), ret); |
| 61 | return ret; |
| 62 | } // changing to 00 gives coin tamper |
| 51 | 63 | DECLARE_READ8_MEMBER(ppi8255_intf_c_read_c) { int ret = 0x00; logerror("%04x - ppi8255_intf_c_read_c %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 52 | 64 | |
| 53 | 65 | DECLARE_READ8_MEMBER(ppi8255_intf_d_read_a) { int ret = 0x00; logerror("%04x - ppi8255_intf_d_read_a %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| r19604 | r19605 | |
| 55 | 67 | { |
| 56 | 68 | // guess, what are the bottom 4 bits, if anything? |
| 57 | 69 | |
| 58 | | int ret = m_optic_pattern | 0x0f; |
| 70 | int ret = m_optic_pattern | (ioport("IN0")->read() & 0xf); |
| 59 | 71 | |
| 60 | 72 | // | 0x80 = reel 4 fault |
| 61 | 73 | // | 0x40 = reel 3 fault |
| r19604 | r19605 | |
| 71 | 83 | DECLARE_READ8_MEMBER(ppi8255_intf_d_read_c) { int ret = 0x00; logerror("%04x - ppi8255_intf_d_read_c %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 72 | 84 | |
| 73 | 85 | DECLARE_READ8_MEMBER(ppi8255_intf_e_read_a) { int ret = 0x00; logerror("%04x - ppi8255_intf_e_read_a %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 74 | | DECLARE_READ8_MEMBER(ppi8255_intf_e_read_b) { int ret = 0x00; logerror("%04x - ppi8255_intf_e_(used)read_b %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } // changing gives no % key error in sphinx |
| 86 | DECLARE_READ8_MEMBER(ppi8255_intf_e_read_b) |
| 87 | { // changing gives no % key error in sphinx |
| 88 | int ret = ioport("IN3")->read(); |
| 89 | logerror("%04x - ppi8255_intf_e_(used)read_b %02x\n", machine().device("maincpu")->safe_pcbase(), ret); |
| 90 | return ret; |
| 91 | } |
| 92 | |
| 75 | 93 | DECLARE_READ8_MEMBER(ppi8255_intf_e_read_c) { int ret = 0x00; logerror("%04x - ppi8255_intf_e_read_c %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 76 | 94 | |
| 77 | | DECLARE_READ8_MEMBER(ppi8255_intf_f_read_a) { int ret = 0xff; logerror("%04x - ppi8255_intf_f_(used)read_a %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 95 | DECLARE_READ8_MEMBER(ppi8255_intf_f_read_a) |
| 96 | { |
| 97 | int ret = ioport("IN4")->read(); |
| 98 | logerror("%04x - ppi8255_intf_f_(used)read_a %02x\n", machine().device("maincpu")->safe_pcbase(), ret); |
| 99 | return ret; |
| 100 | } |
| 101 | |
| 78 | 102 | DECLARE_READ8_MEMBER(ppi8255_intf_f_read_b) { int ret = 0x00; logerror("%04x - ppi8255_intf_f_read_b %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 79 | 103 | DECLARE_READ8_MEMBER(ppi8255_intf_f_read_c) { int ret = 0x00; logerror("%04x - ppi8255_intf_f_read_c %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 80 | 104 | |
| r19604 | r19605 | |
| 83 | 107 | DECLARE_READ8_MEMBER(ppi8255_intf_g_read_c) { int ret = 0x00; logerror("%04x - ppi8255_intf_g_read_c %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 84 | 108 | |
| 85 | 109 | DECLARE_READ8_MEMBER(ppi8255_intf_h_read_a) { int ret = 0x00; logerror("%04x - ppi8255_intf_h_read_a %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 86 | | DECLARE_READ8_MEMBER(ppi8255_intf_h_read_b) { int ret = 0x00; logerror("%04x - ppi8255_intf_h_(used)read_b %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 110 | DECLARE_READ8_MEMBER(ppi8255_intf_h_read_b) |
| 111 | { |
| 112 | int ret = ioport("IN5")->read(); |
| 113 | logerror("%04x - ppi8255_intf_h_(used)read_b %02x\n", machine().device("maincpu")->safe_pcbase(), ret); |
| 114 | return ret; |
| 115 | } |
| 87 | 116 | DECLARE_READ8_MEMBER(ppi8255_intf_h_read_c) { int ret = 0x00; logerror("%04x - ppi8255_intf_h_read_c %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } |
| 88 | 117 | |
| 89 | 118 | void update_lamps(void) |
| r19604 | r19605 | |
| 448 | 477 | AM_RANGE(0x58, 0x5b) AM_DEVREADWRITE("ppi8255_g", i8255_device, read, write) |
| 449 | 478 | AM_RANGE(0x5c, 0x5f) AM_DEVREADWRITE("ppi8255_h", i8255_device, read, write) |
| 450 | 479 | // frequently accesses DB after 5B, mirror? bug? |
| 480 | AM_RANGE(0xDB, 0xDB) AM_DEVWRITE("sn1", sn76489_device, write) // no idea what the sound chip is, this sounds terrible |
| 481 | |
| 482 | |
| 451 | 483 | ADDRESS_MAP_END |
| 452 | 484 | |
| 453 | | /* |
| 454 | | static ADDRESS_MAP_START( pyramid_submap, AS_PROGRAM, 8, ecoinf3_state ) |
| 455 | | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 456 | | ADDRESS_MAP_END |
| 457 | | */ |
| 458 | 485 | |
| 459 | 486 | |
| 460 | 487 | |
| r19604 | r19605 | |
| 472 | 499 | PORT_DIPNAME( 0x08, 0x08, "IN0:08" ) |
| 473 | 500 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 474 | 501 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 475 | | PORT_DIPNAME( 0x10, 0x10, "IN0:10" ) |
| 476 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 477 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 478 | | PORT_DIPNAME( 0x20, 0x20, "IN0:20" ) |
| 479 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 480 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 481 | | PORT_DIPNAME( 0x40, 0x40, "IN0:40" ) |
| 482 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 483 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 484 | | PORT_DIPNAME( 0x80, 0x80, "IN0:80" ) |
| 485 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 486 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 487 | 502 | |
| 488 | 503 | PORT_START("IN1") |
| 489 | 504 | PORT_DIPNAME( 0x01, 0x01, "IN1:01" ) |
| r19604 | r19605 | |
| 498 | 513 | PORT_DIPNAME( 0x08, 0x08, "IN1:08" ) |
| 499 | 514 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 500 | 515 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 501 | | PORT_DIPNAME( 0x10, 0x10, "IN1:10" ) |
| 516 | PORT_DIPNAME( 0x10, 0x10, "Meter Connection (leave on)" ) |
| 502 | 517 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 503 | 518 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 504 | 519 | PORT_DIPNAME( 0x20, 0x20, "IN1:20" ) |
| r19604 | r19605 | |
| 512 | 527 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 513 | 528 | |
| 514 | 529 | PORT_START("IN2") |
| 515 | | PORT_DIPNAME( 0x01, 0x01, "IN2:01" ) |
| 516 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 517 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 518 | | PORT_DIPNAME( 0x02, 0x02, "IN2:02" ) |
| 519 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 520 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 521 | | PORT_DIPNAME( 0x04, 0x04, "IN2:04" ) |
| 522 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 523 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 524 | | PORT_DIPNAME( 0x08, 0x08, "IN2:08" ) |
| 525 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 526 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 527 | | PORT_DIPNAME( 0x10, 0x10, "IN2:10" ) |
| 528 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 529 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 530 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 531 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 532 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) |
| 533 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 ) |
| 534 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN5 ) |
| 530 | 535 | PORT_DIPNAME( 0x20, 0x20, "IN2:20" ) |
| 531 | 536 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 532 | 537 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| r19604 | r19605 | |
| 538 | 543 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 539 | 544 | |
| 540 | 545 | PORT_START("IN3") |
| 541 | | PORT_DIPNAME( 0x01, 0x01, "IN3:01" ) |
| 546 | PORT_DIPNAME( 0x0f, 0x00, "% Key?" ) |
| 547 | PORT_DIPSETTING( 0x00, "0x00" ) |
| 548 | PORT_DIPSETTING( 0x01, "0x01" ) |
| 549 | PORT_DIPSETTING( 0x02, "0x02" ) |
| 550 | PORT_DIPSETTING( 0x03, "0x03" ) |
| 551 | PORT_DIPSETTING( 0x04, "0x04" ) |
| 552 | PORT_DIPSETTING( 0x05, "0x05" ) |
| 553 | PORT_DIPSETTING( 0x06, "0x06" ) |
| 554 | PORT_DIPSETTING( 0x07, "0x07" ) |
| 555 | PORT_DIPSETTING( 0x08, "0x08" ) |
| 556 | PORT_DIPSETTING( 0x09, "0x09" ) |
| 557 | PORT_DIPSETTING( 0x0a, "0x0a" ) |
| 558 | PORT_DIPSETTING( 0x0b, "0x0b" ) |
| 559 | PORT_DIPSETTING( 0x0c, "0x0c" ) |
| 560 | PORT_DIPSETTING( 0x0d, "0x0d" ) |
| 561 | PORT_DIPSETTING( 0x0e, "0x0e" ) |
| 562 | PORT_DIPSETTING( 0x0f, "None" ) |
| 563 | |
| 564 | PORT_DIPNAME( 0x10, 0x00, "IN3:10" ) |
| 542 | 565 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 543 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 544 | | PORT_DIPNAME( 0x02, 0x02, "IN3:02" ) |
| 545 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 546 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 547 | | PORT_DIPNAME( 0x04, 0x04, "IN3:04" ) |
| 548 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 549 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 550 | | PORT_DIPNAME( 0x08, 0x08, "IN3:08" ) |
| 551 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 552 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 553 | | PORT_DIPNAME( 0x10, 0x10, "IN3:10" ) |
| 554 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 555 | 566 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 556 | | PORT_DIPNAME( 0x20, 0x20, "IN3:20" ) |
| 567 | PORT_DIPNAME( 0x20, 0x00, "IN3:20" ) |
| 557 | 568 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 558 | 569 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 559 | | PORT_DIPNAME( 0x40, 0x40, "IN3:40" ) |
| 570 | PORT_DIPNAME( 0x40, 0x00, "IN3:40" ) |
| 560 | 571 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 561 | 572 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 562 | | PORT_DIPNAME( 0x80, 0x80, "IN3:80" ) |
| 573 | PORT_DIPNAME( 0x80, 0x00, "IN3:80" ) |
| 563 | 574 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 564 | 575 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 565 | 576 | |
| r19604 | r19605 | |
| 614 | 625 | PORT_DIPNAME( 0x80, 0x80, "IN5:80" ) |
| 615 | 626 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 616 | 627 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 617 | | |
| 628 | #if 0 |
| 618 | 629 | PORT_START("IN6") |
| 619 | 630 | PORT_DIPNAME( 0x01, 0x01, "IN6:01" ) |
| 620 | 631 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| r19604 | r19605 | |
| 666 | 677 | PORT_DIPNAME( 0x80, 0x80, "IN7:80" ) |
| 667 | 678 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 668 | 679 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 680 | #endif |
| 669 | 681 | INPUT_PORTS_END |
| 670 | 682 | |
| 671 | 683 | MACHINE_START_MEMBER(ecoinf3_state,ecoinf3) |
| r19604 | r19605 | |
| 676 | 688 | } |
| 677 | 689 | } |
| 678 | 690 | |
| 691 | static const sn76496_config psg_intf = |
| 692 | { |
| 693 | DEVCB_NULL |
| 694 | }; |
| 695 | |
| 696 | |
| 679 | 697 | static MACHINE_CONFIG_START( ecoinf3_pyramid, ecoinf3_state ) |
| 680 | 698 | /* basic machine hardware */ |
| 681 | | MCFG_CPU_ADD("maincpu", Z180,2000000) // certainly not a plain z80 at least, invalid opcodes for that |
| 699 | MCFG_CPU_ADD("maincpu", Z180,8000000) // certainly not a plain z80 at least, invalid opcodes for that |
| 682 | 700 | |
| 683 | 701 | MCFG_CPU_PROGRAM_MAP(pyramid_memmap) |
| 684 | 702 | MCFG_CPU_IO_MAP(pyramid_portmap) |
| r19604 | r19605 | |
| 687 | 705 | |
| 688 | 706 | MCFG_MACHINE_START_OVERRIDE(ecoinf3_state, ecoinf3 ) |
| 689 | 707 | |
| 708 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 690 | 709 | |
| 710 | |
| 711 | MCFG_SOUND_ADD("sn1", SN76489, 4000000) // no idea what the sound chip is, this sounds terrible |
| 712 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 713 | MCFG_SOUND_CONFIG(psg_intf) |
| 714 | |
| 691 | 715 | MCFG_I8255_ADD( "ppi8255_a", ppi8255_intf_a ) |
| 692 | 716 | MCFG_I8255_ADD( "ppi8255_b", ppi8255_intf_b ) |
| 693 | 717 | MCFG_I8255_ADD( "ppi8255_c", ppi8255_intf_c ) |