1 // license:BSD-3-Clause
2 // copyright-holders:R. Belmont
3 /*************************************************************************
4 
5     Bishi Bashi Champ Mini Game Senshuken
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_BISHI_H
9 #define MAME_INCLUDES_BISHI_H
10 
11 #pragma once
12 
13 #include "machine/timer.h"
14 #include "video/k054156_k054157_k056832.h"
15 #include "video/k055555.h"
16 #include "video/k054338.h"
17 #include "video/konami_helper.h"
18 #include "emupal.h"
19 #include "screen.h"
20 
21 #define CPU_CLOCK       (XTAL(24'000'000) / 2)        /* 68000 clock */
22 #define SOUND_CLOCK     XTAL(16'934'400)     /* YMZ280 clock */
23 
24 class bishi_state : public driver_device
25 {
26 public:
bishi_state(const machine_config & mconfig,device_type type,const char * tag)27 	bishi_state(const machine_config &mconfig, device_type type, const char *tag) :
28 		driver_device(mconfig, type, tag),
29 		m_maincpu(*this, "maincpu"),
30 		m_k056832(*this, "k056832"),
31 		m_k054338(*this, "k054338"),
32 		m_k055555(*this, "k055555"),
33 		m_palette(*this, "palette"),
34 		m_screen(*this, "screen")
35 	{ }
36 
37 	uint16_t control_r();
38 	void control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
39 	void control2_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
40 	uint16_t bishi_mirror_r(offs_t offset);
41 	uint16_t bishi_K056832_rom_r(offs_t offset);
42 	uint32_t screen_update_bishi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
43 	TIMER_DEVICE_CALLBACK_MEMBER(bishi_scanline);
44 	K056832_CB_MEMBER(tile_callback);
45 
46 	void bishi(machine_config &config);
47 	void main_map(address_map &map);
48 protected:
49 	virtual void machine_start() override;
50 	virtual void machine_reset() override;
51 	virtual void video_start() override;
52 private:
53 	/* misc */
54 	uint16_t     m_cur_control;
55 	uint16_t     m_cur_control2;
56 
57 	/* video-related */
58 	int        m_layer_colorbase[4];
59 
60 	/* devices */
61 	required_device<cpu_device> m_maincpu;
62 	required_device<k056832_device> m_k056832;
63 	required_device<k054338_device> m_k054338;
64 	required_device<k055555_device> m_k055555;
65 	required_device<palette_device> m_palette;
66 	required_device<screen_device> m_screen;
67 };
68 
69 #endif // MAME_INCLUDES_BISHI_H
70