summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/galpani2.h
blob: be92174407f93ae32f6e8947cb812e30afb40ae6 (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
#include "video/kaneko_spr.h"
#include "sound/okim6295.h"
#include "machine/eepromser.h"

class galpani2_state : public driver_device
{
public:
	galpani2_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
		m_bg8(*this, "bg8"),
		m_palette_val(*this, "palette"),
		m_bg8_scrollx(*this, "bg8_scrollx"),
		m_bg8_scrolly(*this, "bg8_scrolly"),
		m_bg15(*this, "bg15"),
		m_ram(*this, "ram"),
		m_ram2(*this, "ram2"),
		m_rombank(*this, "rombank"),
		m_maincpu(*this,"maincpu"),
		m_subcpu(*this,"sub"),
		m_kaneko_spr(*this, "kan_spr"),
		m_spriteram(*this, "spriteram"),
		m_oki2(*this, "oki2"),
		m_eeprom(*this, "eeprom"),
		m_palette(*this, "palette")
		{ }

	required_shared_ptr_array<UINT16, 2> m_bg8;
	optional_shared_ptr_array<UINT16, 2> m_palette_val;
	required_shared_ptr_array<UINT16, 2> m_bg8_scrollx;
	required_shared_ptr_array<UINT16, 2> m_bg8_scrolly;
	required_shared_ptr<UINT16> m_bg15;
	UINT16 m_eeprom_word;
	required_shared_ptr<UINT16> m_ram;
	required_shared_ptr<UINT16> m_ram2;
	UINT16 m_old_mcu_nmi1;
	UINT16 m_old_mcu_nmi2;
	required_shared_ptr<UINT16> m_rombank;
	bitmap_ind16 *m_bg8_bitmap[2];
	bitmap_ind16 *m_bg15_bitmap;

	required_device<cpu_device> m_maincpu;
	required_device<cpu_device> m_subcpu;
	optional_device<kaneko16_sprite_device> m_kaneko_spr;
	optional_shared_ptr<UINT16> m_spriteram;

	DECLARE_WRITE8_MEMBER(galpani2_mcu_init_w);
	DECLARE_WRITE8_MEMBER(galpani2_mcu_nmi1_w);
	DECLARE_WRITE8_MEMBER(galpani2_mcu_nmi2_w);
	DECLARE_WRITE8_MEMBER(galpani2_coin_lockout_w);
	DECLARE_READ16_MEMBER(galpani2_bankedrom_r);
	DECLARE_READ16_MEMBER(galpani2_eeprom_r);
	DECLARE_WRITE16_MEMBER(galpani2_eeprom_w);
	DECLARE_WRITE8_MEMBER(galpani2_oki1_bank_w);
	DECLARE_WRITE8_MEMBER(galpani2_oki2_bank_w);
	virtual void machine_reset();
	virtual void video_start();
	DECLARE_PALETTE_INIT(galpani2);
	UINT32 screen_update_galpani2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	TIMER_DEVICE_CALLBACK_MEMBER(galpani2_interrupt1);
	TIMER_DEVICE_CALLBACK_MEMBER(galpani2_interrupt2);
	void galpani2_mcu_nmi1();
	void galpani2_mcu_nmi2();
	/*----------- defined in video/galpani2.c -----------*/
	inline void galpani2_bg8_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _n_);
	inline void galpani2_palette_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _n_);

	DECLARE_WRITE16_MEMBER( galpani2_palette_0_w );
	DECLARE_WRITE16_MEMBER( galpani2_palette_1_w );

	DECLARE_WRITE16_MEMBER( galpani2_bg8_0_w );
	DECLARE_WRITE16_MEMBER( galpani2_bg8_1_w );

	DECLARE_WRITE16_MEMBER( galpani2_bg15_w );
	required_device<okim6295_device> m_oki2;
	required_device<eeprom_serial_93cxx_device> m_eeprom;
	required_device<palette_device> m_palette;
};