1 // license:BSD-3-Clause
2 // copyright-holders:Nicola Salmoria
3 /*************************************************************************
4 
5     Bottom of the Ninth
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_BOTTOM9_H
9 #define MAME_INCLUDES_BOTTOM9_H
10 
11 #pragma once
12 
13 #include "sound/k007232.h"
14 #include "video/k052109.h"
15 #include "video/k051960.h"
16 #include "video/k051316.h"
17 #include "video/konami_helper.h"
18 #include "emupal.h"
19 
20 class bottom9_state : public driver_device
21 {
22 public:
bottom9_state(const machine_config & mconfig,device_type type,const char * tag)23 	bottom9_state(const machine_config &mconfig, device_type type, const char *tag) :
24 		driver_device(mconfig, type, tag),
25 		m_maincpu(*this, "maincpu"),
26 		m_audiocpu(*this, "audiocpu"),
27 		m_k007232_1(*this, "k007232_1"),
28 		m_k007232_2(*this, "k007232_2"),
29 		m_k052109(*this, "k052109"),
30 		m_k051960(*this, "k051960"),
31 		m_k051316(*this, "k051316"),
32 		m_palette(*this, "palette")
33 	{ }
34 
35 	/* misc */
36 	int        m_video_enable;
37 	int        m_zoomreadroms;
38 	int        m_k052109_selected;
39 	int        m_nmienable;
40 
41 	/* devices */
42 	required_device<cpu_device> m_maincpu;
43 	required_device<cpu_device> m_audiocpu;
44 	required_device<k007232_device> m_k007232_1;
45 	required_device<k007232_device> m_k007232_2;
46 	required_device<k052109_device> m_k052109;
47 	required_device<k051960_device> m_k051960;
48 	required_device<k051316_device> m_k051316;
49 	required_device<palette_device> m_palette;
50 	uint8_t k052109_051960_r(offs_t offset);
51 	void k052109_051960_w(offs_t offset, uint8_t data);
52 	uint8_t bottom9_bankedram1_r(offs_t offset);
53 	void bottom9_bankedram1_w(offs_t offset, uint8_t data);
54 	uint8_t bottom9_bankedram2_r(offs_t offset);
55 	void bottom9_bankedram2_w(offs_t offset, uint8_t data);
56 	void bankswitch_w(uint8_t data);
57 	void bottom9_1f90_w(uint8_t data);
58 	void bottom9_sh_irqtrigger_w(uint8_t data);
59 	void nmi_enable_w(uint8_t data);
60 	void sound_bank_w(uint8_t data);
61 	virtual void machine_start() override;
62 	virtual void machine_reset() override;
63 	uint32_t screen_update_bottom9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
64 	INTERRUPT_GEN_MEMBER(bottom9_sound_interrupt);
65 	void volume_callback0(uint8_t data);
66 	void volume_callback1(uint8_t data);
67 	K051316_CB_MEMBER(zoom_callback);
68 	K052109_CB_MEMBER(tile_callback);
69 	K051960_CB_MEMBER(sprite_callback);
70 	void bottom9(machine_config &config);
71 	void audio_map(address_map &map);
72 	void main_map(address_map &map);
73 };
74 
75 #endif // MAME_INCLUDES_BOTTOM9_H
76