1 // license:BSD-3-Clause
2 // copyright-holders:Mirko Buffoni
3 #ifndef MAME_INCLUDES_SOLOMON_H
4 #define MAME_INCLUDES_SOLOMON_H
5 
6 #pragma once
7 
8 #include "machine/gen_latch.h"
9 #include "emupal.h"
10 #include "tilemap.h"
11 
12 class solomon_state : public driver_device
13 {
14 public:
solomon_state(const machine_config & mconfig,device_type type,const char * tag)15 	solomon_state(const machine_config &mconfig, device_type type, const char *tag) :
16 		driver_device(mconfig, type, tag),
17 		m_spriteram(*this, "spriteram"),
18 		m_videoram(*this, "videoram"),
19 		m_colorram(*this, "colorram"),
20 		m_videoram2(*this, "videoram2"),
21 		m_colorram2(*this, "colorram2"),
22 		m_maincpu(*this, "maincpu"),
23 		m_audiocpu(*this, "audiocpu"),
24 		m_gfxdecode(*this, "gfxdecode"),
25 		m_palette(*this, "palette"),
26 		m_soundlatch(*this, "soundlatch")
27 	{ }
28 
29 	void solomon(machine_config &config);
30 
31 protected:
32 	virtual void video_start() override;
33 
34 private:
35 	required_shared_ptr<uint8_t> m_spriteram;
36 	required_shared_ptr<uint8_t> m_videoram;
37 	required_shared_ptr<uint8_t> m_colorram;
38 	required_shared_ptr<uint8_t> m_videoram2;
39 	required_shared_ptr<uint8_t> m_colorram2;
40 
41 	tilemap_t *m_bg_tilemap;
42 	tilemap_t *m_fg_tilemap;
43 
44 	uint8_t m_nmi_mask;
45 	void solomon_sh_command_w(uint8_t data);
46 	uint8_t solomon_0xe603_r();
47 	void nmi_mask_w(uint8_t data);
48 	void solomon_videoram_w(offs_t offset, uint8_t data);
49 	void solomon_colorram_w(offs_t offset, uint8_t data);
50 	void solomon_videoram2_w(offs_t offset, uint8_t data);
51 	void solomon_colorram2_w(offs_t offset, uint8_t data);
52 	void solomon_flipscreen_w(uint8_t data);
53 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
54 	TILE_GET_INFO_MEMBER(get_fg_tile_info);
55 	uint32_t screen_update_solomon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
56 	INTERRUPT_GEN_MEMBER(vblank_irq);
57 	void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
58 	required_device<cpu_device> m_maincpu;
59 	required_device<cpu_device> m_audiocpu;
60 	required_device<gfxdecode_device> m_gfxdecode;
61 	required_device<palette_device> m_palette;
62 	required_device<generic_latch_8_device> m_soundlatch;
63 
64 	void main_map(address_map &map);
65 	void sound_map(address_map &map);
66 	void sound_portmap(address_map &map);
67 };
68 
69 #endif // MAME_INCLUDES_SOLOMON_H
70