1 // license:BSD-3-Clause
2 // copyright-holders:Phil Stroffolino
3 /*************************************************************************
4 
5     Mr. Flea
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_MRFLEA_H
9 #define MAME_INCLUDES_MRFLEA_H
10 
11 #pragma once
12 
13 #include "machine/pic8259.h"
14 #include "machine/timer.h"
15 #include "emupal.h"
16 #include "screen.h"
17 
18 class mrflea_state : public driver_device
19 {
20 public:
mrflea_state(const machine_config & mconfig,device_type type,const char * tag)21 	mrflea_state(const machine_config &mconfig, device_type type, const char *tag) :
22 		driver_device(mconfig, type, tag),
23 		m_videoram(*this, "videoram"),
24 		m_spriteram(*this, "spriteram"),
25 		m_maincpu(*this, "maincpu"),
26 		m_subcpu(*this, "subcpu"),
27 		m_pic(*this, "pic"),
28 		m_gfxdecode(*this, "gfxdecode"),
29 		m_screen(*this, "screen"),
30 		m_palette(*this, "palette")
31 	{ }
32 
33 	void mrflea(machine_config &config);
34 
35 private:
36 	/* memory pointers */
37 	required_shared_ptr<uint8_t> m_videoram;
38 	required_shared_ptr<uint8_t> m_spriteram;
39 
40 	/* video-related */
41 	int     m_gfx_bank;
42 
43 	/* devices */
44 	required_device<cpu_device> m_maincpu;
45 	required_device<cpu_device> m_subcpu;
46 	required_device<pic8259_device> m_pic;
47 	required_device<gfxdecode_device> m_gfxdecode;
48 	required_device<screen_device> m_screen;
49 	required_device<palette_device> m_palette;
50 
51 	void mrflea_data1_w(uint8_t data);
52 	void mrflea_gfx_bank_w(uint8_t data);
53 	void mrflea_videoram_w(offs_t offset, uint8_t data);
54 	void mrflea_spriteram_w(offs_t offset, uint8_t data);
55 	virtual void machine_start() override;
56 	virtual void machine_reset() override;
57 	uint32_t screen_update_mrflea(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
58 	TIMER_DEVICE_CALLBACK_MEMBER(mrflea_slave_interrupt);
59 	void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
60 	void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect );
61 	void mrflea_master_io_map(address_map &map);
62 	void mrflea_master_map(address_map &map);
63 	void mrflea_slave_io_map(address_map &map);
64 	void mrflea_slave_map(address_map &map);
65 };
66 
67 #endif // MAME_INCLUDES_MRFLEA_H
68