summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/meadows.h
blob: 47e82ffb4d44e3167db5f2b95514c4b0e9884ae7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// license:GPL-2.0+
// copyright-holders:Juergen Buchmueller
/*************************************************************************

    Meadows S2650 hardware

*************************************************************************/
#include "cpu/s2650/s2650.h"
#include "sound/dac.h"
#include "sound/samples.h"
#include "screen.h"

class meadows_state : public driver_device
{
public:
	meadows_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
		m_maincpu(*this, "maincpu"),
		m_audiocpu(*this, "audiocpu"),
		m_dac(*this, "dac"),
		m_samples(*this, "samples"),
		m_gfxdecode(*this, "gfxdecode"),
		m_screen(*this, "screen"),
		m_palette(*this, "palette"),
		m_spriteram(*this, "spriteram"),
		m_videoram(*this, "videoram")
	{
	}

	required_device<s2650_device> m_maincpu;
	optional_device<s2650_device> m_audiocpu;
	optional_device<dac_8bit_r2r_device> m_dac;
	optional_device<samples_device> m_samples;
	required_device<gfxdecode_device> m_gfxdecode;
	required_device<screen_device> m_screen;
	required_device<palette_device> m_palette;

	optional_shared_ptr<uint8_t> m_spriteram;
	required_shared_ptr<uint8_t> m_videoram;

	int m_channel;
	int m_freq1;
	int m_freq2;
	uint8_t m_latched_0c01;
	uint8_t m_latched_0c02;
	uint8_t m_latched_0c03;
	uint8_t m_main_sense_state;
	uint8_t m_audio_sense_state;
	uint8_t m_0c00;
	uint8_t m_0c01;
	uint8_t m_0c02;
	uint8_t m_0c03;
	tilemap_t *m_bg_tilemap;
	DECLARE_READ8_MEMBER(hsync_chain_r);
	DECLARE_READ8_MEMBER(vsync_chain_hi_r);
	DECLARE_READ8_MEMBER(vsync_chain_lo_r);
	DECLARE_WRITE8_MEMBER(meadows_audio_w);
	DECLARE_WRITE8_MEMBER(audio_hardware_w);
	DECLARE_READ8_MEMBER(audio_hardware_r);
	DECLARE_WRITE8_MEMBER(meadows_videoram_w);
	DECLARE_WRITE8_MEMBER(meadows_spriteram_w);
	DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
	void init_minferno();
	void init_gypsyjug();
	TILE_GET_INFO_MEMBER(get_tile_info);
	virtual void video_start() override;
	uint32_t screen_update_meadows(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	DECLARE_WRITE_LINE_MEMBER(meadows_vblank_irq);
	DECLARE_WRITE_LINE_MEMBER(minferno_vblank_irq);
	INTERRUPT_GEN_MEMBER(audio_interrupt);
	void draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip);
	void meadows_sh_update();
	SAMPLES_START_CB_MEMBER(meadows_sh_start);
	void bowl3d(machine_config &config);
	void meadows(machine_config &config);
	void minferno(machine_config &config);
	void audio_map(address_map &map);
	void bowl3d_main_map(address_map &map);
	void meadows_main_map(address_map &map);
	void minferno_data_map(address_map &map);
	void minferno_main_map(address_map &map);
};