summaryrefslogtreecommitdiffstats
path: root/src/mame/machine/wpc_lamp.h
blob: 1e32196e44d58f7cf3438069f0c91e0f7cf2b337 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// license:BSD-3-Clause
// copyright-holders:Olivier Galibert

// Williams Pinball Controller lamp control

#ifndef MAME_MACHINE_WPC_LAMP_H
#define MAME_MACHINE_WPC_LAMP_H

#pragma once

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

	void row_w(uint8_t data);
	void col_w(uint8_t data);

	void set_names(const char *const *lamp_names);

protected:
	virtual void device_start() override;
	virtual void device_reset() override;

	TIMER_CALLBACK_MEMBER(update_lamps);

	void update();

	uint8_t state[64]{};
	uint8_t col = 0;
	uint8_t row = 0;
	emu_timer *timer = nullptr;
	const char *const *names;
};

DECLARE_DEVICE_TYPE(WPC_LAMP, wpc_lamp_device)

#endif // MAME_MACHINE_WPC_LAMP_H