1 // license:BSD-3-Clause
2 // copyright-holders:Aaron Giles
3 /*************************************************************************
4 
5     Model Racing Dribbling hardware
6 
7 *************************************************************************/
8 #ifndef MAME_INCLUDES_DRIBLING_H
9 #define MAME_INCLUDES_DRIBLING_H
10 
11 #pragma once
12 
13 #include "machine/i8255.h"
14 #include "machine/watchdog.h"
15 #include "emupal.h"
16 
17 class dribling_state : public driver_device
18 {
19 public:
dribling_state(const machine_config & mconfig,device_type type,const char * tag)20 	dribling_state(const machine_config &mconfig, device_type type, const char *tag) :
21 		driver_device(mconfig, type, tag),
22 		m_maincpu(*this, "maincpu"),
23 		m_watchdog(*this, "watchdog"),
24 		m_ppi8255(*this, "ppi8255%d", 0),
25 		m_videoram(*this, "videoram"),
26 		m_colorram(*this, "colorram"),
27 		m_mux(*this, "MUX%u", 0),
28 		m_proms(*this, "proms"),
29 		m_gfxroms(*this, "gfx")
30 	{ }
31 
32 	void dribling(machine_config &config);
33 
34 protected:
35 	virtual void machine_start() override;
36 	virtual void machine_reset() override;
37 
38 private:
39 	// devices
40 	required_device<cpu_device> m_maincpu;
41 	required_device<watchdog_timer_device> m_watchdog;
42 	required_device_array<i8255_device, 2>  m_ppi8255;
43 	// memory pointers
44 	required_shared_ptr<uint8_t> m_videoram;
45 	required_shared_ptr<uint8_t> m_colorram;
46 	required_ioport_array<3> m_mux;
47 	required_region_ptr<uint8_t> m_proms;
48 	required_region_ptr<uint8_t> m_gfxroms;
49 
50 	// misc
51 	uint8_t    m_abca;
52 	uint8_t    m_dr;
53 	uint8_t    m_ds;
54 	uint8_t    m_sh;
55 	uint8_t    m_input_mux;
56 	uint8_t    m_di;
57 
58 	uint8_t ioread(offs_t offset);
59 	void iowrite(offs_t offset, uint8_t data);
60 	void colorram_w(offs_t offset, uint8_t data);
61 	uint8_t dsr_r();
62 	uint8_t input_mux0_r();
63 	void misc_w(uint8_t data);
64 	void sound_w(uint8_t data);
65 	void pb_w(uint8_t data);
66 	void shr_w(uint8_t data);
67 	void palette(palette_device &palette) const;
68 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
69 	INTERRUPT_GEN_MEMBER(irq_gen);
70 	void prg_map(address_map &map);
71 	void io_map(address_map &map);
72 };
73 
74 #endif // MAME_INCLUDES_DRIBLING_H
75