Previous 199869 Revisions Next

r19605 Sunday 16th December, 2012 at 23:39:22 UTC by David Haywood
couple more notes in here (nw)
[src/mame/drivers]ecoinf3.c

trunk/src/mame/drivers/ecoinf3.c
r19604r19605
1616#include "ecoinf3.lh"
1717#include "machine/steppers.h" // stepper motor
1818#include "video/awpvid.h" // drawing reels
19#include "sound/sn76496.h"
1920
2021class ecoinf3_state : public driver_device
2122{
r19604r19605
3940   int m_optic_pattern;
4041
4142   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
4350   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; }
4451
4552   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; }
r19604r19605
4754   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; }
4855
4956   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
5163   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; }
5264
5365   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; }
r19604r19605
5567   {
5668      // guess, what are the bottom 4 bits, if anything?
5769
58      int ret = m_optic_pattern | 0x0f;
70      int ret = m_optic_pattern | (ioport("IN0")->read() & 0xf);
5971     
6072      // | 0x80 = reel 4 fault
6173      // | 0x40 = reel 3 fault
r19604r19605
7183   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; }
7284
7385   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   
7593   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; }
7694
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
78102   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; }
79103   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; }
80104
r19604r19605
83107   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; }
84108
85109   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   }
87116   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; }
88117
89118   void update_lamps(void)
r19604r19605
448477   AM_RANGE(0x58, 0x5b) AM_DEVREADWRITE("ppi8255_g", i8255_device, read, write)
449478   AM_RANGE(0x5c, 0x5f) AM_DEVREADWRITE("ppi8255_h", i8255_device, read, write)
450479   // 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   
451483ADDRESS_MAP_END
452484
453/*
454static ADDRESS_MAP_START( pyramid_submap, AS_PROGRAM, 8, ecoinf3_state )
455    AM_RANGE(0xe000, 0xffff) AM_ROM
456ADDRESS_MAP_END
457*/
458485
459486
460487
r19604r19605
472499   PORT_DIPNAME( 0x08, 0x08, "IN0:08" )
473500   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
474501   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 ) )
487502
488503   PORT_START("IN1")
489504   PORT_DIPNAME( 0x01, 0x01, "IN1:01" )
r19604r19605
498513   PORT_DIPNAME( 0x08, 0x08, "IN1:08" )
499514   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
500515   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
501   PORT_DIPNAME( 0x10, 0x10, "IN1:10" )
516   PORT_DIPNAME( 0x10, 0x10, "Meter Connection (leave on)" )
502517   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
503518   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
504519   PORT_DIPNAME( 0x20, 0x20, "IN1:20" )
r19604r19605
512527   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
513528
514529   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 )
530535   PORT_DIPNAME( 0x20, 0x20, "IN2:20" )
531536   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
532537   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
r19604r19605
538543   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
539544
540545   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" )
542565   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 ) )
555566   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
556   PORT_DIPNAME( 0x20, 0x20, "IN3:20" )
567   PORT_DIPNAME( 0x20, 0x00, "IN3:20" )
557568   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
558569   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
559   PORT_DIPNAME( 0x40, 0x40, "IN3:40" )
570   PORT_DIPNAME( 0x40, 0x00, "IN3:40" )
560571   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
561572   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
562   PORT_DIPNAME( 0x80, 0x80, "IN3:80" )
573   PORT_DIPNAME( 0x80, 0x00, "IN3:80" )
563574   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
564575   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
565576
r19604r19605
614625   PORT_DIPNAME( 0x80, 0x80, "IN5:80" )
615626   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
616627   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
617
628#if 0
618629   PORT_START("IN6")
619630   PORT_DIPNAME( 0x01, 0x01, "IN6:01" )
620631   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
r19604r19605
666677   PORT_DIPNAME( 0x80, 0x80, "IN7:80" )
667678   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
668679   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
680#endif
669681INPUT_PORTS_END
670682
671683MACHINE_START_MEMBER(ecoinf3_state,ecoinf3)
r19604r19605
676688   }
677689}
678690
691static const sn76496_config psg_intf =
692{
693    DEVCB_NULL
694};
695
696
679697static MACHINE_CONFIG_START( ecoinf3_pyramid, ecoinf3_state )
680698   /* 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
682700   
683701   MCFG_CPU_PROGRAM_MAP(pyramid_memmap)
684702   MCFG_CPU_IO_MAP(pyramid_portmap)
r19604r19605
687705
688706   MCFG_MACHINE_START_OVERRIDE(ecoinf3_state, ecoinf3 )
689707
708   MCFG_SPEAKER_STANDARD_MONO("mono")
690709
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
691715   MCFG_I8255_ADD( "ppi8255_a", ppi8255_intf_a )
692716   MCFG_I8255_ADD( "ppi8255_b", ppi8255_intf_b )
693717   MCFG_I8255_ADD( "ppi8255_c", ppi8255_intf_c )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team