piggypas: Use 8255 device (nw)

This commit is contained in:
AJR 2017-06-22 15:05:56 -04:00
parent e249cdb98e
commit 21ab6a6ec6

View File

@ -11,6 +11,7 @@ game details unknown
#include "emu.h"
#include "cpu/mcs51/mcs51.h"
#include "machine/i8255.h"
#include "machine/ticket.h"
#include "sound/okim6295.h"
#include "video/hd44780.h"
@ -49,7 +50,7 @@ WRITE8_MEMBER(piggypas_state::ctrl_w)
if ((m_ctrl ^ data) & m_ctrl & 0x04)
m_digit_idx = 0;
m_ticket->write(space, 0, (data & 0x40) ? 0x80 : 0);
m_ticket->motor_w(BIT(data, 6));
m_ctrl = data;
}
@ -65,13 +66,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( piggypas_io, AS_IO, 8, piggypas_state )
AM_RANGE(0x0000, 0x07ff) AM_RAM
AM_RANGE(0x0800, 0x0803) AM_DEVREADWRITE("ppi", i8255_device, read, write)
AM_RANGE(0x1000, 0x1000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
AM_RANGE(0x0800, 0x0800) AM_READ_PORT("IN1")
AM_RANGE(0x0801, 0x0801) AM_WRITE(ctrl_w)
AM_RANGE(0x0802, 0x0802) AM_READ_PORT("IN0")
AM_RANGE(0x1800, 0x1801) AM_DEVWRITE("hd44780", hd44780_device, write)
AM_RANGE(0x1802, 0x1803) AM_DEVREAD("hd44780", hd44780_device, read)
@ -155,6 +151,11 @@ static MACHINE_CONFIG_START( piggypas )
MCFG_OKIM6295_ADD("oki", 1000000, PIN7_HIGH) // not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_DEVICE_ADD("ppi", I8255, 0)
MCFG_I8255_IN_PORTA_CB(IOPORT("IN1"))
MCFG_I8255_OUT_PORTB_CB(WRITE8(piggypas_state, ctrl_w))
MCFG_I8255_IN_PORTC_CB(IOPORT("IN0"))
MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
MACHINE_CONFIG_END