Previous 199869 Revisions Next

r19604 Sunday 16th December, 2012 at 22:52:32 UTC by David Haywood
may as well give it some reels too (nw)
[src/mame/drivers]ecoinf3.c
[src/mame/layout]ecoinf3.lay
[src/mame/machine]steppers.c steppers.h

trunk/src/mame/layout/ecoinf3.lay
r19603r19604
2121    </rect>
2222  </element>
2323
24
25  <element name="Steppers" defstate="0">
26    <simplecounter maxstate="999" digits="3">
27      <color red="1.0" green="1.0" blue="1.0" />
28      <bounds x="0" y="0" width="1" height="1" />
29    </simplecounter>
30  </element>
31
32
33
34  <!-- a stateoffset of 682 will shift us by 1 step on a 96 step reel (0x10000/96) which seems a good default alignment for 96 step / 16 symbol reels -->
35  <element name="SteppersReel1" defstate="0">
36    <reel stateoffset="682" symbollist="Fruit1:image11.png,Fruit2:image12.png,Fruit3:image13.png,Fruit4:image14.png,Fruit5:image15.png,Fruit6:image16.png,Fruit7:image17.png,Fruit8:image18.png,Fruit9:image19.png,Fruit10:image110.png,Fruit11:image111.png,Fruit12:image112.png,Fruit13:image113.png,Fruit14:image114.png,Fruit15:image115.png,Fruit16:image116.png">
37      <color red="1.0" green="1.0" blue="1.0" />
38      <bounds x="0" y="0" width="1" height="1" />
39    </reel>
40  </element>
41
42  <element name="SteppersReel2" defstate="0">
43    <reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
44      "<color red="1.0" green="1.0" blue="1.0" />
45      <bounds x="0" y="0" width="1" height="1" />
46    </reel>
47  </element>
48
49  <element name="SteppersReel3" defstate="0">
50    <reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
51      <color red="1.0" green="1.0" blue="1.0" />
52      <bounds x="0" y="0" width="1" height="1" />
53    </reel>
54  </element>
55
56  <element name="SteppersReel4" defstate="0">
57    <reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
58      <color red="1.0" green="1.0" blue="1.0" />
59      <bounds x="0" y="0" width="1" height="1" />
60    </reel>
61  </element>
62
2463  <view name="AWP Simulated Video (No Artwork)">
25   <backdrop name="vfd0" element="vfd0" state="0">
26         <bounds x="17" y="280" width="7" height="10"/>
27      </backdrop>
28      <backdrop name="vfd1" element="vfd0" state="0">
29         <bounds x="24" y="280" width="7" height="10"/>
30      </backdrop>
31      <backdrop name="vfd2" element="vfd0" state="0">
32         <bounds x="31" y="280" width="7" height="10"/>
33      </backdrop>
34      <backdrop name="vfd3" element="vfd0" state="0">
35         <bounds x="38" y="280" width="7" height="10"/>
36      </backdrop>
37      <backdrop name="vfd4" element="vfd0" state="0">
38         <bounds x="45" y="280" width="7" height="10"/>
39      </backdrop>
40      <backdrop name="vfd5" element="vfd0" state="0">
41         <bounds x="52" y="280" width="7" height="10"/>
42      </backdrop>
43      <backdrop name="vfd6" element="vfd0" state="0">
44         <bounds x="59" y="280" width="7" height="10"/>
45      </backdrop>
46      <backdrop name="vfd7" element="vfd0" state="0">
47         <bounds x="66" y="280" width="7" height="10"/>
48      </backdrop>
49      <backdrop name="vfd8" element="vfd0" state="0">
50         <bounds x="73" y="280" width="7" height="10"/>
51      </backdrop>
52      <backdrop name="vfd9" element="vfd0" state="0">
53         <bounds x="80" y="280" width="7" height="10"/>
54      </backdrop>
55      <backdrop name="vfd10" element="vfd0" state="0">
56         <bounds x="87" y="280" width="7" height="10"/>
57      </backdrop>
58      <backdrop name="vfd11" element="vfd0" state="0">
59         <bounds x="94" y="280" width="7" height="10"/>
60      </backdrop>
61      <backdrop name="vfd12" element="vfd0" state="0">
62         <bounds x="101" y="280" width="7" height="10"/>
63      </backdrop>
64      <backdrop name="vfd13" element="vfd0" state="0">
65         <bounds x="108" y="280" width="7" height="10"/>
66      </backdrop>
6764
6865
66
6967    <backdrop name="lamp0" element="matrixlamp" state="0">
7068      <bounds x="0" y="0" width="7" height="7"/>
7169    </backdrop>
r19603r19604
835833      <bounds x="120" y="120" width="7" height="7"/>
836834    </backdrop>
837835
836    <backdrop name="vfd0" element="vfd0" state="0">
837      <bounds x="17" y="280" width="7" height="10"/>
838    </backdrop>
839    <backdrop name="vfd1" element="vfd0" state="0">
840      <bounds x="24" y="280" width="7" height="10"/>
841    </backdrop>
842    <backdrop name="vfd2" element="vfd0" state="0">
843      <bounds x="31" y="280" width="7" height="10"/>
844    </backdrop>
845    <backdrop name="vfd3" element="vfd0" state="0">
846      <bounds x="38" y="280" width="7" height="10"/>
847    </backdrop>
848    <backdrop name="vfd4" element="vfd0" state="0">
849      <bounds x="45" y="280" width="7" height="10"/>
850    </backdrop>
851    <backdrop name="vfd5" element="vfd0" state="0">
852      <bounds x="52" y="280" width="7" height="10"/>
853    </backdrop>
854    <backdrop name="vfd6" element="vfd0" state="0">
855      <bounds x="59" y="280" width="7" height="10"/>
856    </backdrop>
857    <backdrop name="vfd7" element="vfd0" state="0">
858      <bounds x="66" y="280" width="7" height="10"/>
859    </backdrop>
860    <backdrop name="vfd8" element="vfd0" state="0">
861      <bounds x="73" y="280" width="7" height="10"/>
862    </backdrop>
863    <backdrop name="vfd9" element="vfd0" state="0">
864      <bounds x="80" y="280" width="7" height="10"/>
865    </backdrop>
866    <backdrop name="vfd10" element="vfd0" state="0">
867      <bounds x="87" y="280" width="7" height="10"/>
868    </backdrop>
869    <backdrop name="vfd11" element="vfd0" state="0">
870      <bounds x="94" y="280" width="7" height="10"/>
871    </backdrop>
872    <backdrop name="vfd12" element="vfd0" state="0">
873      <bounds x="101" y="280" width="7" height="10"/>
874    </backdrop>
875    <backdrop name="vfd13" element="vfd0" state="0">
876      <bounds x="108" y="280" width="7" height="10"/>
877    </backdrop>
838878
879    <backdrop name="sreel1" element="SteppersReel1" state="0">
880      <bounds x="17" y="300" width="32" height="32"/>
881    </backdrop>
882    <backdrop name="sreel2" element="SteppersReel2" state="0">
883      <bounds x="50" y="300" width="32" height="32"/>
884    </backdrop>
885    <backdrop name="sreel3" element="SteppersReel3" state="0">
886      <bounds x="83" y="300" width="32" height="32"/>
887    </backdrop>
888    <backdrop name="sreel4" element="SteppersReel4" state="0">
889      <bounds x="149" y="290" width="16" height="16"/>
890    </backdrop>
891
892    <backdrop name="reel1" element="Steppers" state="0">
893      <bounds x="20" y="330" width="5" height="2"/>
894    </backdrop>
895    <backdrop name="reel2" element="Steppers" state="0">
896      <bounds x="52" y="330" width="5" height="2"/>
897    </backdrop>
898    <backdrop name="reel3" element="Steppers" state="0">
899      <bounds x="85" y="330" width="5" height="2"/>
900    </backdrop>
901    <backdrop name="reel4" element="Steppers" state="0">
902      <bounds x="151" y="304" width="5" height="2"/>
903    </backdrop>
904
839905  </view>
840906</mamelayout>
841907
trunk/src/mame/drivers/ecoinf3.c
r19603r19604
1414#include "cpu/z180/z180.h"
1515#include "machine/i8255.h"
1616#include "ecoinf3.lh"
17#include "machine/steppers.h" // stepper motor
18#include "video/awpvid.h" // drawing reels
1719
1820class ecoinf3_state : public driver_device
1921{
r19603r19604
3436
3537   int strobe_addr;
3638   int strobe_amount;
39   int m_optic_pattern;
3740
3841   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; }
3942   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; }
r19603r19604
4851   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; }
4952
5053   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; }
51   DECLARE_READ8_MEMBER(ppi8255_intf_d_read_b) { int ret = 0x00; logerror("%04x - ppi8255_intf_d_(used)read_b %02x\n", machine().device("maincpu")->safe_pcbase(), ret); return ret; } // changing goes from reel 1 error to running something in sphinx
54   DECLARE_READ8_MEMBER(ppi8255_intf_d_read_b)
55   {
56      // guess, what are the bottom 4 bits, if anything?
57
58      int ret = m_optic_pattern | 0x0f;
59     
60      // | 0x80 = reel 4 fault
61      // | 0x40 = reel 3 fault
62      // | 0x20 = reel 2 fault
63      // | 0x10 = reel 1 fault
64
65      logerror("%04x - ppi8255_intf_d_(used)read_b %02x (Reel Optics)\n", machine().device("maincpu")->safe_pcbase(), ret);
66     
67      return ret;
68   
69   
70   } // changing goes from reel 1 error to running something in sphinx
5271   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; }
5372
5473   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; }
r19603r19604
81100
82101   }
83102
84   DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_a)
103   DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_a_strobedat0)
85104   {
86105   //   logerror("%04x - ppi8255_intf_a_(used)write_a %02x (STROBEDAT?)\n", machine().device("maincpu")->safe_pcbase(), data);
87106      if (strobe_amount)
r19603r19604
91110      }
92111   }
93112   
94   DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_b)
113   DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_b_strobedat1)
95114   {
96115   //   logerror("%04x - ppi8255_intf_a_(used)write_b %02x (STROBEDAT?)\n", machine().device("maincpu")->safe_pcbase(), data);
97116      if (strobe_amount)
r19603r19604
100119         strobe_amount--;
101120      }
102121   }
103   DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_c)
122   DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_c_strobe)
104123   {
105124      if ((data>=0xf0) && (data<=0xff))
106125      {
r19603r19604
124143   DECLARE_WRITE8_MEMBER(ppi8255_intf_c_write_b) { logerror("%04x - ppi8255_intf_c_(used)write_b %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
125144   DECLARE_WRITE8_MEMBER(ppi8255_intf_c_write_c) { logerror("%04x - ppi8255_intf_c_(used)write_c %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
126145
127   DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_a) { logerror("%04x - ppi8255_intf_d_(used)write_a %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
128   DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_b) { logerror("%04x - ppi8255_intf_d_(used)write_b %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
129   DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_c) { logerror("%04x - ppi8255_intf_d_(used)write_c %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
146   DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_a_reel01)
147   {
148//      logerror("%04x - ppi8255_intf_d_(used)write_a %02x\n", machine().device("maincpu")->safe_pcbase(), data);
149      stepper_update(0, data&0x0f);
150      stepper_update(1, (data>>4)&0x0f);
130151
152      if ( stepper_optic_state(0) ) m_optic_pattern |=  0x10;
153      else                          m_optic_pattern &= ~0x10;
154      if ( stepper_optic_state(1) ) m_optic_pattern |=  0x20;
155      else                          m_optic_pattern &= ~0x20;
156
157      awp_draw_reel(0);
158      awp_draw_reel(1);
159   }
160
161   DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_a_reel23)
162   {
163//      logerror("%04x - ppi8255_intf_d_(used)write_b %02x\n", machine().device("maincpu")->safe_pcbase(), data);
164   
165      stepper_update(2, data&0x0f);
166      stepper_update(3, (data>>4)&0x0f);
167
168      if ( stepper_optic_state(2) ) m_optic_pattern |=  0x40;
169      else                          m_optic_pattern &= ~0x40;
170      if ( stepper_optic_state(3) ) m_optic_pattern |=  0x80;
171      else                          m_optic_pattern &= ~0x80;
172
173      awp_draw_reel(2);
174      awp_draw_reel(3);
175   }
176
177   DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_c) { logerror("%04x - ppi8255_intf_d_(used)write_c %02x\n", machine().device("maincpu")->safe_pcbase(), data);}
178
131179   DECLARE_WRITE8_MEMBER(ppi8255_intf_e_write_a_alpha_display);
132180   DECLARE_WRITE8_MEMBER(ppi8255_intf_e_write_b) { logerror("%04x - ppi8255_intf_e_write_b %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
133181   DECLARE_WRITE8_MEMBER(ppi8255_intf_e_write_c) { logerror("%04x - ppi8255_intf_e_write_c %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
r19603r19604
147195
148196   DECLARE_DRIVER_INIT(ecoinf3);
149197   DECLARE_DRIVER_INIT(ecoinf3_swap);
198   DECLARE_MACHINE_START(ecoinf3);
199
150200};
151201
152202
153203static I8255_INTERFACE (ppi8255_intf_a)
154204{
155205   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_read_a),         /* Port A read */
156   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_a),         /* Port A write */
206   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_a_strobedat0),         /* Port A write */
157207   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_read_b),         /* Port B read */
158   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_b),         /* Port B write */
208   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_b_strobedat1),         /* Port B write */
159209   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_read_b),         /* Port C read */
160   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_c)         /* Port C write */
210   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_c_strobe)         /* Port C write */
161211};
162212
163213static I8255_INTERFACE (ppi8255_intf_b)
r19603r19604
183233static I8255_INTERFACE (ppi8255_intf_d)
184234{
185235   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_read_a),         /* Port A read */
186   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_write_a),         /* Port A write */
236   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_write_a_reel01),         /* Port A write */
187237   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_read_b),         /* Port B read */
188   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_write_b),         /* Port B write */
238   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_write_a_reel23),         /* Port B write */
189239   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_read_b),         /* Port C read */
190240   DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_write_c)         /* Port C write */
191241};
r19603r19604
618668   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
619669INPUT_PORTS_END
620670
671MACHINE_START_MEMBER(ecoinf3_state,ecoinf3)
672{
673   for ( int n = 0; n < 4; n++ )
674   {
675      stepper_config(machine(), n, &ecoin_interface_200step_reel);
676   }
677}
621678
622
623679static MACHINE_CONFIG_START( ecoinf3_pyramid, ecoinf3_state )
624680   /* basic machine hardware */
625   MCFG_CPU_ADD("maincpu", Z180,16000000) // certainly not a plain z80 at least, invalid opcodes for that
681   MCFG_CPU_ADD("maincpu", Z180,2000000) // certainly not a plain z80 at least, invalid opcodes for that
626682   
627683   MCFG_CPU_PROGRAM_MAP(pyramid_memmap)
628684   MCFG_CPU_IO_MAP(pyramid_portmap)
629685
630686   MCFG_DEFAULT_LAYOUT(layout_ecoinf3)
631687
688   MCFG_MACHINE_START_OVERRIDE(ecoinf3_state, ecoinf3 )
689
690
632691   MCFG_I8255_ADD( "ppi8255_a", ppi8255_intf_a )
633692   MCFG_I8255_ADD( "ppi8255_b", ppi8255_intf_b )
634693   MCFG_I8255_ADD( "ppi8255_c", ppi8255_intf_c )
trunk/src/mame/machine/steppers.c
r19603r19604
9494   0x09,
9595   7
9696};
97// guess
98const stepper_interface ecoin_interface_200step_reel =
99{
100   ECOIN_200STEP_REEL,
101   12,
102   24,
103   0x09,
104   7
105};
97106
107
108
98109///////////////////////////////////////////////////////////////////////////
99110void stepper_config(running_machine &machine, int which, const stepper_interface *intf)
100111{
trunk/src/mame/machine/steppers.h
r19603r19604
4747extern const stepper_interface starpointrm20_interface_48step;
4848
4949extern const stepper_interface starpoint_interface_200step_reel;
50extern const stepper_interface ecoin_interface_200step_reel;
5051
5152void stepper_config(running_machine &machine, int which, const stepper_interface *intf);
5253

Previous 199869 Revisions Next


© 1997-2024 The MAME Team