summaryrefslogblamecommitdiffstatshomepage
path: root/src/mame/machine/wpc_pic.h
blob: 4a5ce0eb5c212e24c60ba3dcb9aea32e7fba149f (plain) (tree)





































                                                                                                      
// license:BSD-3-Clause
// copyright-holders:Olivier Galibert

// Williams Pinball Controller Pic-based protection simulation

#ifndef WPC_PIC_H
#define WPC_PIC_H

#define MCFG_WPC_PIC_ADD( _tag ) \
	MCFG_DEVICE_ADD( _tag, WPC_PIC, 0 )

class wpc_pic_device : public device_t
{
public:
	wpc_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
	virtual ~wpc_pic_device();

	DECLARE_READ8_MEMBER(read);
	DECLARE_WRITE8_MEMBER(write);

	void set_serial(const char *serial);

protected:
	required_ioport_array<8> swarray;

	UINT8 mem[16], chk[3], curcmd, scrambler, count, chk_count, cmpchk[3];
	const char *serial;

	virtual void device_start();
	virtual void device_reset();

	void serial_to_pic();
	void check_game_id();
};

extern const device_type WPC_PIC;

#endif