1 // license:BSD-3-Clause
2 // copyright-holders:Aaron Giles
3 /*************************************************************************
4 
5     Atari Escape hardware
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_EPROM_H
9 #define MAME_INCLUDES_EPROM_H
10 
11 #pragma once
12 
13 #include "machine/adc0808.h"
14 #include "machine/timer.h"
15 #include "audio/atarijsa.h"
16 #include "video/atarimo.h"
17 #include "emupal.h"
18 #include "screen.h"
19 #include "tilemap.h"
20 
21 class eprom_state : public driver_device
22 {
23 public:
eprom_state(const machine_config & mconfig,device_type type,const char * tag)24 	eprom_state(const machine_config &mconfig, device_type type, const char *tag) :
25 		driver_device(mconfig, type, tag),
26 		m_maincpu(*this, "maincpu"),
27 		m_gfxdecode(*this, "gfxdecode"),
28 		m_screen(*this, "screen"),
29 		m_playfield_tilemap(*this, "playfield"),
30 		m_alpha_tilemap(*this, "alpha"),
31 		m_mob(*this, "mob"),
32 		m_jsa(*this, "jsa"),
33 		m_share1(*this, "share1"),
34 		m_adc(*this, "adc"),
35 		m_extra(*this, "extra"),
36 		m_palette(*this, "palette"),
37 		m_paletteram(*this, "paletteram")
38 	{ }
39 
40 	void guts(machine_config &config);
41 	void eprom(machine_config &config);
42 	void klaxp(machine_config &config);
43 
44 protected:
45 	virtual void machine_start() override;
46 	virtual void machine_reset() override;
47 	void video_int_ack_w(uint16_t data);
48 	TIMER_DEVICE_CALLBACK_MEMBER(scanline_update);
49 	uint8_t adc_r(offs_t offset);
50 	void eprom_latch_w(uint8_t data);
51 	template<bool maincpu> void sync_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
52 	TILE_GET_INFO_MEMBER(get_alpha_tile_info);
53 	TILE_GET_INFO_MEMBER(get_playfield_tile_info);
54 	TILE_GET_INFO_MEMBER(guts_get_playfield_tile_info);
55 	DECLARE_VIDEO_START(eprom);
56 	DECLARE_VIDEO_START(guts);
57 	uint32_t screen_update_eprom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
58 	uint32_t screen_update_guts(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
59 	void update_palette();
60 	void extra_map(address_map &map);
61 	void guts_map(address_map &map);
62 	void main_map(address_map &map);
63 
64 private:
65 	required_device<cpu_device> m_maincpu;
66 	required_device<gfxdecode_device> m_gfxdecode;
67 	required_device<screen_device> m_screen;
68 	required_device<tilemap_device> m_playfield_tilemap;
69 	required_device<tilemap_device> m_alpha_tilemap;
70 	required_device<atari_motion_objects_device> m_mob;
71 	required_device<atari_jsa_base_device> m_jsa;
72 	required_shared_ptr<uint16_t> m_share1;
73 	int             m_screen_intensity;
74 	int             m_video_disable;
75 	optional_device<adc0808_device> m_adc;
76 	optional_device<cpu_device> m_extra;
77 	required_device<palette_device> m_palette;
78 	optional_shared_ptr<uint16_t> m_paletteram;
79 	static const atari_motion_objects_config s_mob_config;
80 	static const atari_motion_objects_config s_guts_mob_config;
81 };
82 
83 #endif // MAME_INCLUDES_EPROM_H
84