1 // license:BSD-3-Clause
2 // copyright-holders:Manuel Abadia
3 #ifndef MAME_INCLUDES_XORWORLD_H
4 #define MAME_INCLUDES_XORWORLD_H
5 
6 #pragma once
7 
8 #include "machine/eepromser.h"
9 #include "emupal.h"
10 #include "tilemap.h"
11 
12 class xorworld_state : public driver_device
13 {
14 public:
xorworld_state(const machine_config & mconfig,device_type type,const char * tag)15 	xorworld_state(const machine_config &mconfig, device_type type, const char *tag) :
16 		driver_device(mconfig, type, tag),
17 		m_maincpu(*this, "maincpu"),
18 		m_eeprom(*this, "eeprom"),
19 		m_gfxdecode(*this, "gfxdecode"),
20 		m_palette(*this, "palette"),
21 		m_videoram(*this, "videoram"),
22 		m_spriteram(*this, "spriteram")
23 	{ }
24 
25 	void xorworld(machine_config &config);
26 
27 	void init_xorworld();
28 
29 private:
30 	required_device<cpu_device> m_maincpu;
31 	required_device<eeprom_serial_93cxx_device> m_eeprom;
32 	required_device<gfxdecode_device> m_gfxdecode;
33 	required_device<palette_device> m_palette;
34 
35 	required_shared_ptr<uint16_t> m_videoram;
36 	required_shared_ptr<uint16_t> m_spriteram;
37 
38 	tilemap_t *m_bg_tilemap;
39 
40 	void irq2_ack_w(uint16_t data);
41 	void irq6_ack_w(uint16_t data);
42 	void videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
43 
44 	TILE_GET_INFO_MEMBER(get_bg_tile_info);
45 
46 	virtual void video_start() override;
47 	void xorworld_palette(palette_device &palette) const;
48 
49 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
50 	void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
51 
52 	void xorworld_map(address_map &map);
53 };
54 
55 #endif // MAME_INCLUDES_XORWORLD_H
56