1 // license:BSD-3-Clause
2 // copyright-holders:Miodrag Milanovic
3 /*****************************************************************************
4  *
5  * includes/ondra.h
6  *
7  ****************************************************************************/
8 #ifndef MAME_INCLUDES_ONDRA_H
9 #define MAME_INCLUDES_ONDRA_H
10 
11 #pragma once
12 
13 #include "imagedev/cassette.h"
14 #include "sound/beep.h"
15 #include "machine/ram.h"
16 
17 class ondra_state : public driver_device
18 {
19 public:
ondra_state(const machine_config & mconfig,device_type type,const char * tag)20 	ondra_state(const machine_config &mconfig, device_type type, const char *tag)
21 		: driver_device(mconfig, type, tag)
22 		, m_maincpu(*this, "maincpu")
23 		, m_cassette(*this, "cassette")
24 		, m_ram(*this, RAM_TAG)
25 		, m_rom(*this, "maincpu")
26 		, m_bank1(*this, "bank1")
27 		, m_bank3(*this, "bank3")
28 		, m_beep(*this, "beeper")
29 		, m_io_keyboard(*this, "LINE%u", 0U)
30 	{ }
31 
32 	void ondra(machine_config &config);
33 	DECLARE_INPUT_CHANGED_MEMBER(nmi_button);
34 
35 private:
36 	u8 keyboard_r(offs_t offset);
37 	void port03_w(u8 data);
38 	u8 port09_r();
39 	void port0a_w(u8 data);
40 	u32 screen_update_ondra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
41 	DECLARE_WRITE_LINE_MEMBER(vblank_irq);
42 
43 	void io_map(address_map &map);
44 	void mem_map(address_map &map);
45 
46 	virtual void machine_start() override;
47 	virtual void machine_reset() override;
48 
49 	void update_banks();
50 
51 	bool m_video_enable;
52 	u8 m_bank_status;
53 	u8 m_bank_old;
54 
55 	required_device<cpu_device> m_maincpu;
56 	required_device<cassette_image_device> m_cassette;
57 	required_device<ram_device> m_ram;
58 	required_memory_region m_rom;
59 	required_memory_bank m_bank1;
60 	required_memory_bank m_bank3;
61 	required_device<beep_device> m_beep;
62 	required_ioport_array<10> m_io_keyboard;
63 };
64 
65 #endif // MAME_INCLUDES_ONDRA_H
66