1 // license:GPL-2.0+
2 // copyright-holders:Raphael Nabet, Brett Wyer
3 /*****************************************************************************
4  *
5  * includes/concept.h
6  *
7  * Corvus Concept driver
8  *
9  * Raphael Nabet, 2003
10  *
11  ****************************************************************************/
12 
13 #ifndef MAME_INCLUDES_CONCEPT_H
14 #define MAME_INCLUDES_CONCEPT_H
15 
16 #include "cpu/m68000/m68000.h"
17 #include "machine/6522via.h"
18 #include "machine/mos6551.h"
19 #include "machine/mm58174.h"
20 #include "sound/spkrdev.h"
21 #include "bus/a2bus/a2bus.h"
22 
23 #define ACIA_0_TAG   "acia0"
24 #define ACIA_1_TAG   "acia1"
25 #define VIA_0_TAG    "via6522_0"
26 #define KBD_ACIA_TAG "kbacia"
27 
28 class concept_state : public driver_device
29 {
30 public:
concept_state(const machine_config & mconfig,device_type type,const char * tag)31 	concept_state(const machine_config &mconfig, device_type type, const char *tag) :
32 		driver_device(mconfig, type, tag),
33 		m_maincpu(*this, "maincpu"),
34 		m_acia0(*this, ACIA_0_TAG),
35 		m_acia1(*this, ACIA_1_TAG),
36 		m_via0(*this, VIA_0_TAG),
37 		m_kbdacia(*this, KBD_ACIA_TAG),
38 		m_speaker(*this, "spkr"),
39 		m_mm58174(*this, "mm58174"),
40 		m_a2bus(*this, "a2bus"),
41 		m_videoram(*this,"videoram")
42 	{ }
43 
44 	void concept(machine_config &config);
45 
46 private:
47 	required_device<cpu_device> m_maincpu;
48 	required_device<mos6551_device> m_acia0;
49 	required_device<mos6551_device> m_acia1;
50 	required_device<via6522_device> m_via0;
51 	required_device<mos6551_device> m_kbdacia;
52 	required_device<speaker_sound_device> m_speaker;
53 	required_device<mm58174_device> m_mm58174;
54 	required_device<a2bus_device> m_a2bus;
55 	required_shared_ptr<uint16_t> m_videoram;
56 
57 	uint8_t m_pending_interrupts;
58 	bool m_clock_enable;
59 	uint8_t m_clock_address;
60 	uint8_t io_r(offs_t offset);
61 	void io_w(offs_t offset, uint8_t data);
62 	virtual void machine_start() override;
63 	virtual void machine_reset() override;
64 	virtual void video_start() override;
65 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
66 
67 	uint8_t via_in_a();
68 	void via_out_a(uint8_t data);
69 	uint8_t via_in_b();
70 	void via_out_b(uint8_t data);
71 	DECLARE_WRITE_LINE_MEMBER(via_out_cb2);
72 	DECLARE_WRITE_LINE_MEMBER(via_irq_func);
73 	DECLARE_WRITE_LINE_MEMBER(ioc_interrupt);
74 	void concept_set_interrupt(int level, int state);
75 
76 	void concept_memmap(address_map &map);
77 };
78 
79 #endif // MAME_INCLUDES_CONCEPT_H
80