1 // license:GPL-2.0+
2 // copyright-holders:Juergen Buchmueller
3 /******************************************************************************
4 
5     Atari 400/800
6 
7     ANTIC video controller
8     GTIA  graphics television interface adapter
9 
10     Juergen Buchmueller, June 1998
11 
12 ******************************************************************************/
13 
14 #ifndef MAME_INCLUDES_ATARI400_H
15 #define MAME_INCLUDES_ATARI400_H
16 
17 #pragma once
18 
19 #include "machine/6821pia.h"
20 #include "machine/ram.h"
21 #include "sound/pokey.h"
22 #include "video/antic.h"
23 #include "video/gtia.h"
24 
25 #include "emupal.h"
26 #include "screen.h"
27 
28 #include <algorithm>
29 
30 
31 class atari_common_state : public driver_device
32 {
33 public:
atari_common_state(const machine_config & mconfig,device_type type,const char * tag)34 	atari_common_state(const machine_config &mconfig, device_type type, const char *tag)
35 		: driver_device(mconfig, type, tag)
36 		, m_maincpu(*this, "maincpu")
37 		, m_gtia(*this, "gtia")
38 		, m_antic(*this, "antic")
39 		, m_pokey(*this, "pokey")
40 		, m_screen(*this, "screen")
41 		, m_keyboard(*this, "keyboard.%u", 0)
42 		, m_keypad(*this, "keypad.%u", 0)
43 		, m_djoy_b(*this, "djoy_b")
44 		, m_fake(*this, "fake")
45 	{ }
46 
47 protected:
48 	virtual void video_start() override;
49 
50 	void atari_palette(palette_device &palette) const;
51 
52 	POKEY_INTERRUPT_CB_MEMBER(interrupt_cb);
53 	POKEY_KEYBOARD_CB_MEMBER(a5200_keypads);
54 	POKEY_KEYBOARD_CB_MEMBER(a800_keyboard);
55 
56 	required_device<cpu_device> m_maincpu;
57 	required_device<gtia_device> m_gtia;
58 	required_device<antic_device> m_antic;
59 	required_device<pokey_device> m_pokey;
60 	required_device<screen_device> m_screen;
61 	optional_ioport_array<8> m_keyboard;
62 	optional_ioport_array<4> m_keypad;
63 	optional_ioport m_djoy_b;
64 	optional_ioport m_fake;
65 };
66 
67 #endif // MAME_INCLUDES_ATARI400_H
68