may as well give it some reels too (nw)

This commit is contained in:
David Haywood 2012-12-16 22:52:32 +00:00
parent a0e3706020
commit 328a1993b4
4 changed files with 193 additions and 56 deletions

View File

@ -14,6 +14,8 @@
#include "cpu/z180/z180.h"
#include "machine/i8255.h"
#include "ecoinf3.lh"
#include "machine/steppers.h" // stepper motor
#include "video/awpvid.h" // drawing reels
class ecoinf3_state : public driver_device
{
@ -34,6 +36,7 @@ public:
int strobe_addr;
int strobe_amount;
int m_optic_pattern;
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; }
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; }
@ -48,7 +51,23 @@ public:
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; }
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; }
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
DECLARE_READ8_MEMBER(ppi8255_intf_d_read_b)
{
// guess, what are the bottom 4 bits, if anything?
int ret = m_optic_pattern | 0x0f;
// | 0x80 = reel 4 fault
// | 0x40 = reel 3 fault
// | 0x20 = reel 2 fault
// | 0x10 = reel 1 fault
logerror("%04x - ppi8255_intf_d_(used)read_b %02x (Reel Optics)\n", machine().device("maincpu")->safe_pcbase(), ret);
return ret;
} // changing goes from reel 1 error to running something in sphinx
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; }
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; }
@ -81,7 +100,7 @@ public:
}
DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_a)
DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_a_strobedat0)
{
// logerror("%04x - ppi8255_intf_a_(used)write_a %02x (STROBEDAT?)\n", machine().device("maincpu")->safe_pcbase(), data);
if (strobe_amount)
@ -91,7 +110,7 @@ public:
}
}
DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_b)
DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_b_strobedat1)
{
// logerror("%04x - ppi8255_intf_a_(used)write_b %02x (STROBEDAT?)\n", machine().device("maincpu")->safe_pcbase(), data);
if (strobe_amount)
@ -100,7 +119,7 @@ public:
strobe_amount--;
}
}
DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_c)
DECLARE_WRITE8_MEMBER(ppi8255_intf_a_write_c_strobe)
{
if ((data>=0xf0) && (data<=0xff))
{
@ -124,9 +143,38 @@ public:
DECLARE_WRITE8_MEMBER(ppi8255_intf_c_write_b) { logerror("%04x - ppi8255_intf_c_(used)write_b %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
DECLARE_WRITE8_MEMBER(ppi8255_intf_c_write_c) { logerror("%04x - ppi8255_intf_c_(used)write_c %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_a) { logerror("%04x - ppi8255_intf_d_(used)write_a %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_b) { logerror("%04x - ppi8255_intf_d_(used)write_b %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_c) { logerror("%04x - ppi8255_intf_d_(used)write_c %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_a_reel01)
{
// logerror("%04x - ppi8255_intf_d_(used)write_a %02x\n", machine().device("maincpu")->safe_pcbase(), data);
stepper_update(0, data&0x0f);
stepper_update(1, (data>>4)&0x0f);
if ( stepper_optic_state(0) ) m_optic_pattern |= 0x10;
else m_optic_pattern &= ~0x10;
if ( stepper_optic_state(1) ) m_optic_pattern |= 0x20;
else m_optic_pattern &= ~0x20;
awp_draw_reel(0);
awp_draw_reel(1);
}
DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_a_reel23)
{
// logerror("%04x - ppi8255_intf_d_(used)write_b %02x\n", machine().device("maincpu")->safe_pcbase(), data);
stepper_update(2, data&0x0f);
stepper_update(3, (data>>4)&0x0f);
if ( stepper_optic_state(2) ) m_optic_pattern |= 0x40;
else m_optic_pattern &= ~0x40;
if ( stepper_optic_state(3) ) m_optic_pattern |= 0x80;
else m_optic_pattern &= ~0x80;
awp_draw_reel(2);
awp_draw_reel(3);
}
DECLARE_WRITE8_MEMBER(ppi8255_intf_d_write_c) { logerror("%04x - ppi8255_intf_d_(used)write_c %02x\n", machine().device("maincpu")->safe_pcbase(), data);}
DECLARE_WRITE8_MEMBER(ppi8255_intf_e_write_a_alpha_display);
DECLARE_WRITE8_MEMBER(ppi8255_intf_e_write_b) { logerror("%04x - ppi8255_intf_e_write_b %02x\n", machine().device("maincpu")->safe_pcbase(), data); }
@ -147,17 +195,19 @@ public:
DECLARE_DRIVER_INIT(ecoinf3);
DECLARE_DRIVER_INIT(ecoinf3_swap);
DECLARE_MACHINE_START(ecoinf3);
};
static I8255_INTERFACE (ppi8255_intf_a)
{
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_read_a), /* Port A read */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_a), /* Port A write */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_a_strobedat0), /* Port A write */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_read_b), /* Port B read */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_b), /* Port B write */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_b_strobedat1), /* Port B write */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_read_b), /* Port C read */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_c) /* Port C write */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_a_write_c_strobe) /* Port C write */
};
static I8255_INTERFACE (ppi8255_intf_b)
@ -183,9 +233,9 @@ static I8255_INTERFACE (ppi8255_intf_c)
static I8255_INTERFACE (ppi8255_intf_d)
{
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_read_a), /* Port A read */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_write_a), /* Port A write */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_write_a_reel01), /* Port A write */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_read_b), /* Port B read */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_write_b), /* Port B write */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_write_a_reel23), /* Port B write */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_read_b), /* Port C read */
DEVCB_DRIVER_MEMBER(ecoinf3_state,ppi8255_intf_d_write_c) /* Port C write */
};
@ -618,17 +668,26 @@ static INPUT_PORTS_START( ecoinf3 )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
INPUT_PORTS_END
MACHINE_START_MEMBER(ecoinf3_state,ecoinf3)
{
for ( int n = 0; n < 4; n++ )
{
stepper_config(machine(), n, &ecoin_interface_200step_reel);
}
}
static MACHINE_CONFIG_START( ecoinf3_pyramid, ecoinf3_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z180,16000000) // certainly not a plain z80 at least, invalid opcodes for that
MCFG_CPU_ADD("maincpu", Z180,2000000) // certainly not a plain z80 at least, invalid opcodes for that
MCFG_CPU_PROGRAM_MAP(pyramid_memmap)
MCFG_CPU_IO_MAP(pyramid_portmap)
MCFG_DEFAULT_LAYOUT(layout_ecoinf3)
MCFG_MACHINE_START_OVERRIDE(ecoinf3_state, ecoinf3 )
MCFG_I8255_ADD( "ppi8255_a", ppi8255_intf_a )
MCFG_I8255_ADD( "ppi8255_b", ppi8255_intf_b )
MCFG_I8255_ADD( "ppi8255_c", ppi8255_intf_c )

View File

@ -21,49 +21,47 @@
</rect>
</element>
<element name="Steppers" defstate="0">
<simplecounter maxstate="999" digits="3">
<color red="1.0" green="1.0" blue="1.0" />
<bounds x="0" y="0" width="1" height="1" />
</simplecounter>
</element>
<!-- 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 -->
<element name="SteppersReel1" defstate="0">
<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">
<color red="1.0" green="1.0" blue="1.0" />
<bounds x="0" y="0" width="1" height="1" />
</reel>
</element>
<element name="SteppersReel2" defstate="0">
<reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
"<color red="1.0" green="1.0" blue="1.0" />
<bounds x="0" y="0" width="1" height="1" />
</reel>
</element>
<element name="SteppersReel3" defstate="0">
<reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
<color red="1.0" green="1.0" blue="1.0" />
<bounds x="0" y="0" width="1" height="1" />
</reel>
</element>
<element name="SteppersReel4" defstate="0">
<reel stateoffset="682" symbollist="Fruit1,Fruit2,Fruit3,Fruit4,Fruit5,Fruit6,Fruit7,Fruit8,Fruit9,Fruit10,Fruit11,Fruit12,Fruit13,Fruit14,Fruit15,Fruit16">
<color red="1.0" green="1.0" blue="1.0" />
<bounds x="0" y="0" width="1" height="1" />
</reel>
</element>
<view name="AWP Simulated Video (No Artwork)">
<backdrop name="vfd0" element="vfd0" state="0">
<bounds x="17" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd1" element="vfd0" state="0">
<bounds x="24" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd2" element="vfd0" state="0">
<bounds x="31" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd3" element="vfd0" state="0">
<bounds x="38" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd4" element="vfd0" state="0">
<bounds x="45" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd5" element="vfd0" state="0">
<bounds x="52" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd6" element="vfd0" state="0">
<bounds x="59" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd7" element="vfd0" state="0">
<bounds x="66" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd8" element="vfd0" state="0">
<bounds x="73" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd9" element="vfd0" state="0">
<bounds x="80" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd10" element="vfd0" state="0">
<bounds x="87" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd11" element="vfd0" state="0">
<bounds x="94" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd12" element="vfd0" state="0">
<bounds x="101" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd13" element="vfd0" state="0">
<bounds x="108" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="lamp0" element="matrixlamp" state="0">
@ -835,6 +833,74 @@
<bounds x="120" y="120" width="7" height="7"/>
</backdrop>
<backdrop name="vfd0" element="vfd0" state="0">
<bounds x="17" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd1" element="vfd0" state="0">
<bounds x="24" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd2" element="vfd0" state="0">
<bounds x="31" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd3" element="vfd0" state="0">
<bounds x="38" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd4" element="vfd0" state="0">
<bounds x="45" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd5" element="vfd0" state="0">
<bounds x="52" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd6" element="vfd0" state="0">
<bounds x="59" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd7" element="vfd0" state="0">
<bounds x="66" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd8" element="vfd0" state="0">
<bounds x="73" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd9" element="vfd0" state="0">
<bounds x="80" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd10" element="vfd0" state="0">
<bounds x="87" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd11" element="vfd0" state="0">
<bounds x="94" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd12" element="vfd0" state="0">
<bounds x="101" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="vfd13" element="vfd0" state="0">
<bounds x="108" y="280" width="7" height="10"/>
</backdrop>
<backdrop name="sreel1" element="SteppersReel1" state="0">
<bounds x="17" y="300" width="32" height="32"/>
</backdrop>
<backdrop name="sreel2" element="SteppersReel2" state="0">
<bounds x="50" y="300" width="32" height="32"/>
</backdrop>
<backdrop name="sreel3" element="SteppersReel3" state="0">
<bounds x="83" y="300" width="32" height="32"/>
</backdrop>
<backdrop name="sreel4" element="SteppersReel4" state="0">
<bounds x="149" y="290" width="16" height="16"/>
</backdrop>
<backdrop name="reel1" element="Steppers" state="0">
<bounds x="20" y="330" width="5" height="2"/>
</backdrop>
<backdrop name="reel2" element="Steppers" state="0">
<bounds x="52" y="330" width="5" height="2"/>
</backdrop>
<backdrop name="reel3" element="Steppers" state="0">
<bounds x="85" y="330" width="5" height="2"/>
</backdrop>
<backdrop name="reel4" element="Steppers" state="0">
<bounds x="151" y="304" width="5" height="2"/>
</backdrop>
</view>
</mamelayout>

View File

@ -94,6 +94,17 @@ const stepper_interface starpoint_interface_200step_reel =
0x09,
7
};
// guess
const stepper_interface ecoin_interface_200step_reel =
{
ECOIN_200STEP_REEL,
12,
24,
0x09,
7
};
///////////////////////////////////////////////////////////////////////////
void stepper_config(running_machine &machine, int which, const stepper_interface *intf)

View File

@ -47,6 +47,7 @@ extern const stepper_interface starpoint_interface_48step;
extern const stepper_interface starpointrm20_interface_48step;
extern const stepper_interface starpoint_interface_200step_reel;
extern const stepper_interface ecoin_interface_200step_reel;
void stepper_config(running_machine &machine, int which, const stepper_interface *intf);