summaryrefslogtreecommitdiffstats
path: root/src/mame/includes/cbuster.h
blob: 660028ce6f773512b8febac420e15d4a4ca24631 (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
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail
/*************************************************************************

    Crude Buster

*************************************************************************/
#ifndef MAME_INCLUDES_CBUSTER_H
#define MAME_INCLUDES_CBUSTER_H

#pragma once

#include "machine/gen_latch.h"
#include "cpu/h6280/h6280.h"
#include "video/bufsprite.h"
#include "video/decospr.h"
#include "video/deco16ic.h"
#include "emupal.h"

class cbuster_state : public driver_device
{
public:
	cbuster_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_deco_tilegen(*this, "tilegen%u", 1U)
		, m_palette(*this, "palette")
		, m_spriteram(*this, "spriteram")
		, m_soundlatch(*this, "soundlatch")
		, m_sprgen(*this, "spritegen")
		, m_pf_rowscroll(*this, "pf%u_rowscroll", 1U)
	{ }

	void init_twocrude();

	void twocrude(machine_config &config);

protected:
	virtual void machine_start() override;
	virtual void machine_reset() override;
	virtual void video_start() override;

private:
	/* devices */
	required_device<cpu_device> m_maincpu;
	required_device<h6280_device> m_audiocpu;
	required_device_array<deco16ic_device, 2> m_deco_tilegen;
	required_device<palette_device> m_palette;
	required_device<buffered_spriteram16_device> m_spriteram;
	required_device<generic_latch_8_device> m_soundlatch;
	required_device<decospr_device> m_sprgen;

	/* memory pointers */
	required_shared_ptr_array<u16, 4> m_pf_rowscroll;

	/* misc */
	u16    m_prot;
	int    m_pri;

	void prot_w(offs_t offset, u16 data, u16 mem_mask = ~0);
	u16 prot_r();
	u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
	DECO16IC_BANK_CB_MEMBER(bank_callback);
	static rgb_t cbuster_XBGR_888(u32 raw);
	void main_map(address_map &map);
	void sound_map(address_map &map);
};

#endif // MAME_INCLUDES_CBUSTER_H