summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/pktgaldx.h
blob: 38411c3374d3b313232b4a8ec1b47ab593fbfc51 (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
// license:BSD-3-Clause
// copyright-holders:David Haywood, Bryan McPhail
/*************************************************************************

    Pocket Gal Deluxe

*************************************************************************/
#include "sound/okim6295.h"
#include "video/decospr.h"
#include "video/deco16ic.h"
#include "machine/deco104.h"

class pktgaldx_state : public driver_device
{
public:
	pktgaldx_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
		m_deco104(*this, "ioprot104"),
		m_pf1_rowscroll(*this, "pf1_rowscroll"),
		m_pf2_rowscroll(*this, "pf2_rowscroll"),
		m_spriteram(*this, "spriteram"),
		m_pktgaldb_fgram(*this, "pktgaldb_fgram"),
		m_pktgaldb_sprites(*this, "pktgaldb_spr"),
		m_sprgen(*this, "spritegen"),
		m_maincpu(*this, "maincpu"),
		m_oki2(*this, "oki2"),
		m_deco_tilegen1(*this, "tilegen1"),
		m_gfxdecode(*this, "gfxdecode"),
		m_palette(*this, "palette"),
		m_decrypted_opcodes(*this, "decrypted_opcodes") { }

	optional_device<deco104_device> m_deco104;

	/* memory pointers */
	optional_shared_ptr<uint16_t> m_pf1_rowscroll;
	optional_shared_ptr<uint16_t> m_pf2_rowscroll;
	optional_shared_ptr<uint16_t> m_spriteram;
	optional_shared_ptr<uint16_t> m_pktgaldb_fgram;
	optional_shared_ptr<uint16_t> m_pktgaldb_sprites;
	optional_device<decospr_device> m_sprgen;

	/* devices */
	required_device<cpu_device> m_maincpu;
	required_device<okim6295_device> m_oki2;
	optional_device<deco16ic_device> m_deco_tilegen1;
	required_device<gfxdecode_device> m_gfxdecode;
	required_device<palette_device> m_palette;
	optional_shared_ptr<uint16_t> m_decrypted_opcodes;

	DECLARE_READ16_MEMBER(pckgaldx_unknown_r);
	DECLARE_READ16_MEMBER(pckgaldx_protection_r);
	DECLARE_WRITE16_MEMBER(pktgaldx_oki_bank_w);
	void init_pktgaldx();
	virtual void machine_start() override;
	uint32_t screen_update_pktgaldx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	uint32_t screen_update_pktgaldb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);

	READ16_MEMBER( pktgaldx_protection_region_f_104_r );
	WRITE16_MEMBER( pktgaldx_protection_region_f_104_w );
	DECLARE_WRITE_LINE_MEMBER( vblank_w );
	DECLARE_WRITE16_MEMBER( vblank_ack_w );

	DECO16IC_BANK_CB_MEMBER(bank_callback);
	void pktgaldx(machine_config &config);
	void pktgaldb(machine_config &config);
	void decrypted_opcodes_map(address_map &map);
	void pktgaldb_map(address_map &map);
	void pktgaldx_map(address_map &map);
};