trunk/src/mame/layout/ecoinf3.lay
| r19603 | r19604 | |
| 21 | 21 | </rect> |
| 22 | 22 | </element> |
| 23 | 23 | |
| 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 | |
| 24 | 63 | <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> |
| 67 | 64 | |
| 68 | 65 | |
| 66 | |
| 69 | 67 | <backdrop name="lamp0" element="matrixlamp" state="0"> |
| 70 | 68 | <bounds x="0" y="0" width="7" height="7"/> |
| 71 | 69 | </backdrop> |
| r19603 | r19604 | |
| 835 | 833 | <bounds x="120" y="120" width="7" height="7"/> |
| 836 | 834 | </backdrop> |
| 837 | 835 | |
| 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> |
| 838 | 878 | |
| 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 | |
| 839 | 905 | </view> |
| 840 | 906 | </mamelayout> |
| 841 | 907 | |
trunk/src/mame/drivers/ecoinf3.c
| r19603 | r19604 | |
| 14 | 14 | #include "cpu/z180/z180.h" |
| 15 | 15 | #include "machine/i8255.h" |
| 16 | 16 | #include "ecoinf3.lh" |
| 17 | #include "machine/steppers.h" // stepper motor |
| 18 | #include "video/awpvid.h" // drawing reels |
| 17 | 19 | |
| 18 | 20 | class ecoinf3_state : public driver_device |
| 19 | 21 | { |
| r19603 | r19604 | |
| 34 | 36 | |
| 35 | 37 | int strobe_addr; |
| 36 | 38 | int strobe_amount; |
| 39 | int m_optic_pattern; |
| 37 | 40 | |
| 38 | 41 | 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; } |
| 39 | 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; } |
| r19603 | r19604 | |
| 48 | 51 | 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; } |
| 49 | 52 | |
| 50 | 53 | 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 |
| 52 | 71 | 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; } |
| 53 | 72 | |
| 54 | 73 | 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; } |
| r19603 | r19604 | |
| 81 | 100 | |
| 82 | 101 | } |
| 83 | 102 | |
| 84 | | DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_a) |
| 103 | DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_a_strobedat0) |
| 85 | 104 | { |
| 86 | 105 | // logerror("%04x - ppi8255_intf_a_(used)write_a %02x (STROBEDAT?)\n", machine().device("maincpu")->safe_pcbase(), data); |
| 87 | 106 | if (strobe_amount) |
| r19603 | r19604 | |
| 91 | 110 | } |
| 92 | 111 | } |
| 93 | 112 | |
| 94 | | DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_b) |
| 113 | DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_b_strobedat1) |
| 95 | 114 | { |
| 96 | 115 | // logerror("%04x - ppi8255_intf_a_(used)write_b %02x (STROBEDAT?)\n", machine().device("maincpu")->safe_pcbase(), data); |
| 97 | 116 | if (strobe_amount) |
| r19603 | r19604 | |
| 100 | 119 | strobe_amount--; |
| 101 | 120 | } |
| 102 | 121 | } |
| 103 | | DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_c) |
| 122 | DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_c_strobe) |
| 104 | 123 | { |
| 105 | 124 | if ((data>=0xf0) && (data<=0xff)) |
| 106 | 125 | { |
| r19603 | r19604 | |
| 124 | 143 | DECLARE_WRITE8_MEMBER(ppi8255_intf_c_write_b) { logerror("%04x - ppi8255_intf_c_(used)write_b %02x\n", machine().device("maincpu")->safe_pcbase(), data); } |
| 125 | 144 | DECLARE_WRITE8_MEMBER(ppi8255_intf_c_write_c) { logerror("%04x - ppi8255_intf_c_(used)write_c %02x\n", machine().device("maincpu")->safe_pcbase(), data); } |
| 126 | 145 | |
| 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); |
| 130 | 151 | |
| 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 | |
| 131 | 179 | DECLARE_WRITE8_MEMBER(ppi8255_intf_e_write_a_alpha_display); |
| 132 | 180 | DECLARE_WRITE8_MEMBER(ppi8255_intf_e_write_b) { logerror("%04x - ppi8255_intf_e_write_b %02x\n", machine().device("maincpu")->safe_pcbase(), data); } |
| 133 | 181 | DECLARE_WRITE8_MEMBER(ppi8255_intf_e_write_c) { logerror("%04x - ppi8255_intf_e_write_c %02x\n", machine().device("maincpu")->safe_pcbase(), data); } |
| r19603 | r19604 | |
| 147 | 195 | |
| 148 | 196 | DECLARE_DRIVER_INIT(ecoinf3); |
| 149 | 197 | DECLARE_DRIVER_INIT(ecoinf3_swap); |
| 198 | DECLARE_MACHINE_START(ecoinf3); |
| 199 | |
| 150 | 200 | }; |
| 151 | 201 | |
| 152 | 202 | |
| 153 | 203 | static I8255_INTERFACE (ppi8255_intf_a) |
| 154 | 204 | { |
| 155 | 205 | 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 */ |
| 157 | 207 | 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 */ |
| 159 | 209 | 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 */ |
| 161 | 211 | }; |
| 162 | 212 | |
| 163 | 213 | static I8255_INTERFACE (ppi8255_intf_b) |
| r19603 | r19604 | |
| 183 | 233 | static I8255_INTERFACE (ppi8255_intf_d) |
| 184 | 234 | { |
| 185 | 235 | 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 */ |
| 187 | 237 | 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 */ |
| 189 | 239 | DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_read_b), /* Port C read */ |
| 190 | 240 | DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_write_c) /* Port C write */ |
| 191 | 241 | }; |
| r19603 | r19604 | |
| 618 | 668 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 619 | 669 | INPUT_PORTS_END |
| 620 | 670 | |
| 671 | MACHINE_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 | } |
| 621 | 678 | |
| 622 | | |
| 623 | 679 | static MACHINE_CONFIG_START( ecoinf3_pyramid, ecoinf3_state ) |
| 624 | 680 | /* 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 |
| 626 | 682 | |
| 627 | 683 | MCFG_CPU_PROGRAM_MAP(pyramid_memmap) |
| 628 | 684 | MCFG_CPU_IO_MAP(pyramid_portmap) |
| 629 | 685 | |
| 630 | 686 | MCFG_DEFAULT_LAYOUT(layout_ecoinf3) |
| 631 | 687 | |
| 688 | MCFG_MACHINE_START_OVERRIDE(ecoinf3_state, ecoinf3 ) |
| 689 | |
| 690 | |
| 632 | 691 | MCFG_I8255_ADD( "ppi8255_a", ppi8255_intf_a ) |
| 633 | 692 | MCFG_I8255_ADD( "ppi8255_b", ppi8255_intf_b ) |
| 634 | 693 | MCFG_I8255_ADD( "ppi8255_c", ppi8255_intf_c ) |