summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes/nanjing.h
blob: a231872a124e54a256c89bd0141828111812db52 (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 MAME_BUS_NES_NANJING_H
#define MAME_BUS_NES_NANJING_H

#pragma once

#include "nxrom.h"


class ppu2c0x_device;

// ======================> nes_nanjing_device

class nes_nanjing_device : public nes_nrom_device
{
public:
	// construction/destruction
	nes_nanjing_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
	~nes_nanjing_device();

	virtual DECLARE_READ8_MEMBER(read_l) override;
	virtual DECLARE_WRITE8_MEMBER(write_l) override;

	virtual void hblank_irq(int scanline, int vblank, int blanked) override;
	virtual void pcb_reset() override;

protected:
	// device-level overrides
	virtual void device_start() override;

private:
	uint8_t m_count;
	uint8_t m_reg[2];
	uint8_t m_latch1, m_latch2;

	required_device<ppu2c0x_device> m_ppu;
};


// device type definition
DECLARE_DEVICE_TYPE(NES_NANJING, nes_nanjing_device)

#endif // MAME_BUS_NES_NANJING_H