summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/ashnojoe.h
blob: 83705151c6118efdc8c7a508e5ce3f61a562c0eb (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
83
84
85
86
87
88
89
90
91
92
93
94
// license:BSD-3-Clause
// copyright-holders:David Haywood

/*************************************************************************

    Success Joe / Ashita no Joe

*************************************************************************/

#include "machine/gen_latch.h"
#include "sound/msm5205.h"

class ashnojoe_state : public driver_device
{
public:
	ashnojoe_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
		m_tileram_3(*this, "tileram_3"),
		m_tileram_4(*this, "tileram_4"),
		m_tileram_5(*this, "tileram_5"),
		m_tileram_2(*this, "tileram_2"),
		m_tileram_6(*this, "tileram_6"),
		m_tileram_7(*this, "tileram_7"),
		m_tileram(*this, "tileram"),
		m_tilemap_reg(*this, "tilemap_reg"),
		m_maincpu(*this, "maincpu"),
		m_audiocpu(*this, "audiocpu"),
		m_msm(*this, "msm"),
		m_gfxdecode(*this, "gfxdecode"),
		m_soundlatch(*this, "soundlatch") { }

	/* memory pointers */
	uint16_t *    m_tileram_1;
	required_shared_ptr<uint16_t> m_tileram_3;
	required_shared_ptr<uint16_t> m_tileram_4;
	required_shared_ptr<uint16_t> m_tileram_5;
	required_shared_ptr<uint16_t> m_tileram_2;
	required_shared_ptr<uint16_t> m_tileram_6;
	required_shared_ptr<uint16_t> m_tileram_7;
	required_shared_ptr<uint16_t> m_tileram;
	required_shared_ptr<uint16_t> m_tilemap_reg;

	/* video-related */
	tilemap_t     *m_joetilemap;
	tilemap_t     *m_joetilemap2;
	tilemap_t     *m_joetilemap3;
	tilemap_t     *m_joetilemap4;
	tilemap_t     *m_joetilemap5;
	tilemap_t     *m_joetilemap6;
	tilemap_t     *m_joetilemap7;

	/* sound-related */
	uint8_t       m_adpcm_byte;
	int         m_msm5205_vclk_toggle;

	/* devices */
	required_device<cpu_device> m_maincpu;
	required_device<cpu_device> m_audiocpu;
	required_device<msm5205_device> m_msm;
	required_device<gfxdecode_device> m_gfxdecode;
	required_device<generic_latch_8_device> m_soundlatch;

	DECLARE_READ16_MEMBER(fake_4a00a_r);
	DECLARE_WRITE8_MEMBER(adpcm_w);
	DECLARE_READ8_MEMBER(sound_latch_status_r);
	DECLARE_WRITE16_MEMBER(ashnojoe_tileram_w);
	DECLARE_WRITE16_MEMBER(ashnojoe_tileram2_w);
	DECLARE_WRITE16_MEMBER(ashnojoe_tileram3_w);
	DECLARE_WRITE16_MEMBER(ashnojoe_tileram4_w);
	DECLARE_WRITE16_MEMBER(ashnojoe_tileram5_w);
	DECLARE_WRITE16_MEMBER(ashnojoe_tileram6_w);
	DECLARE_WRITE16_MEMBER(ashnojoe_tileram7_w);
	DECLARE_WRITE16_MEMBER(joe_tilemaps_xscroll_w);
	DECLARE_WRITE16_MEMBER(joe_tilemaps_yscroll_w);
	DECLARE_WRITE8_MEMBER(ym2203_write_a);
	DECLARE_WRITE8_MEMBER(ym2203_write_b);
	void init_ashnojoe();
	TILE_GET_INFO_MEMBER(get_joe_tile_info);
	TILE_GET_INFO_MEMBER(get_joe_tile_info_2);
	TILE_GET_INFO_MEMBER(get_joe_tile_info_3);
	TILE_GET_INFO_MEMBER(get_joe_tile_info_4);
	TILE_GET_INFO_MEMBER(get_joe_tile_info_5);
	TILE_GET_INFO_MEMBER(get_joe_tile_info_6);
	TILE_GET_INFO_MEMBER(get_joe_tile_info_7);
	virtual void machine_start() override;
	virtual void machine_reset() override;
	virtual void video_start() override;
	uint32_t screen_update_ashnojoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	DECLARE_WRITE_LINE_MEMBER(ashnojoe_vclk_cb);
	void ashnojoe(machine_config &config);
	void ashnojoe_map(address_map &map);
	void sound_map(address_map &map);
	void sound_portmap(address_map &map);
};