summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes/event.h
blob: 7da34bc58c2b65019fc8fb9465d3e5566848642c (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
40
41
42
43
44
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
#ifndef __NES_EVENT_H
#define __NES_EVENT_H

#include "mmc1.h"


// ======================> nes_event_device

class nes_event_device : public nes_sxrom_device
{
public:
	// construction/destruction
	nes_event_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);

	// device-level overrides
	virtual void device_start() override;
	virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
	virtual ioport_constructor device_input_ports() const override;
	virtual void update_regs(int reg) override;

	required_ioport m_dsw;

	virtual void pcb_reset() override;

protected:
	virtual void set_prg() override;
	virtual void set_chr() override;
	int m_nwc_init;

	static const device_timer_id TIMER_EVENT = 0;
	emu_timer *event_timer;
	attotime timer_freq;

	UINT32 m_timer_count;
	int m_timer_on, m_timer_enabled;
};


// device type definition
extern const device_type NES_EVENT;

#endif