1 // license:BSD-3-Clause
2 // copyright-holders:Manuel Abadia
3 /*************************************************************************
4 
5     Rock'n Rage
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_ROCKRAGE_H
9 #define MAME_INCLUDES_ROCKRAGE_H
10 
11 #pragma once
12 
13 #include "machine/gen_latch.h"
14 #include "sound/vlm5030.h"
15 #include "video/k007342.h"
16 #include "video/k007420.h"
17 #include "emupal.h"
18 
19 class rockrage_state : public driver_device
20 {
21 public:
rockrage_state(const machine_config & mconfig,device_type type,const char * tag)22 	rockrage_state(const machine_config &mconfig, device_type type, const char *tag) :
23 		driver_device(mconfig, type, tag),
24 		m_maincpu(*this, "maincpu"),
25 		m_audiocpu(*this, "audiocpu"),
26 		m_k007342(*this, "k007342"),
27 		m_k007420(*this, "k007420"),
28 		m_vlm(*this, "vlm"),
29 		m_gfxdecode(*this, "gfxdecode"),
30 		m_palette(*this, "palette"),
31 		m_soundlatch(*this, "soundlatch"),
32 		m_rombank(*this, "rombank")
33 	{ }
34 
35 	void rockrage(machine_config &config);
36 
37 private:
38 	/* devices */
39 	required_device<cpu_device> m_maincpu;
40 	required_device<cpu_device> m_audiocpu;
41 	required_device<k007342_device> m_k007342;
42 	required_device<k007420_device> m_k007420;
43 	required_device<vlm5030_device> m_vlm;
44 	required_device<gfxdecode_device> m_gfxdecode;
45 	required_device<palette_device> m_palette;
46 	required_device<generic_latch_8_device> m_soundlatch;
47 
48 	/* memory pointers */
49 	required_memory_bank m_rombank;
50 
51 	/* video-related */
52 	int        m_vreg;
53 
54 	void rockrage_bankswitch_w(uint8_t data);
55 	void rockrage_sh_irqtrigger_w(uint8_t data);
56 	void rockrage_vreg_w(uint8_t data);
57 	uint8_t rockrage_VLM5030_busy_r();
58 	void rockrage_speech_w(uint8_t data);
59 	virtual void machine_start() override;
60 	virtual void machine_reset() override;
61 	void rockrage_palette(palette_device &palette) const;
62 	uint32_t screen_update_rockrage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
63 	DECLARE_WRITE_LINE_MEMBER(vblank_irq);
64 	K007342_CALLBACK_MEMBER(rockrage_tile_callback);
65 	K007420_CALLBACK_MEMBER(rockrage_sprite_callback);
66 
67 	void rockrage_map(address_map &map);
68 	void rockrage_sound_map(address_map &map);
69 	void rockrage_vlm_map(address_map &map);
70 };
71 
72 #endif // MAME_INCLUDES_ROCKRAGE_H
73