summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/champbas.h
blob: fc77de93c527d9396355560d8ae56c017990331c (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
/*************************************************************************

    Talbot - Champion Base Ball - Exciting Soccer

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


#define CPUTAG_MCU "mcu"
#include "sound/dac.h"

class champbas_state : public driver_device
{
public:
	champbas_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
		m_bg_videoram(*this, "bg_videoram"),
		m_spriteram(*this, "spriteram"),
		m_spriteram_2(*this, "spriteram_2"),
		m_maincpu(*this, "maincpu"),
		m_audiocpu(*this, "audiocpu"),
		m_mcu(*this, CPUTAG_MCU),
		m_dac(*this, "dac"),
		m_dac1(*this, "dac1"),
		m_dac2(*this, "dac2"),
		m_gfxdecode(*this, "gfxdecode"),
		m_palette(*this, "palette"){ }

	/* memory pointers */
	required_shared_ptr<UINT8> m_bg_videoram;
	required_shared_ptr<UINT8> m_spriteram;
	required_shared_ptr<UINT8> m_spriteram_2;

	/* video-related */
	tilemap_t        *m_bg_tilemap;
	UINT8          m_gfx_bank;
	UINT8          m_palette_bank;

	/* misc */
	int            m_watchdog_count;

	/* devices */
	required_device<cpu_device> m_maincpu;
	optional_device<cpu_device> m_audiocpu;
	optional_device<cpu_device> m_mcu;

	UINT8          m_irq_mask;
	DECLARE_WRITE8_MEMBER(champbas_watchdog_reset_w);
	DECLARE_WRITE8_MEMBER(irq_enable_w);
	DECLARE_WRITE8_MEMBER(champbas_mcu_switch_w);
	DECLARE_WRITE8_MEMBER(champbas_mcu_halt_w);
	DECLARE_READ8_MEMBER(champbja_alt_protection_r);
	DECLARE_WRITE8_MEMBER(champbas_bg_videoram_w);
	DECLARE_WRITE8_MEMBER(champbas_gfxbank_w);
	DECLARE_WRITE8_MEMBER(champbas_palette_bank_w);
	DECLARE_WRITE8_MEMBER(champbas_flipscreen_w);
	DECLARE_CUSTOM_INPUT_MEMBER(champbas_watchdog_bit2);
	DECLARE_WRITE8_MEMBER(champbas_dac_w);
	DECLARE_WRITE8_MEMBER(champbas_dac1_w);
	DECLARE_WRITE8_MEMBER(champbas_dac2_w);
	DECLARE_DRIVER_INIT(exctsccr);
	DECLARE_DRIVER_INIT(champbas);
	TILE_GET_INFO_MEMBER(champbas_get_bg_tile_info);
	TILE_GET_INFO_MEMBER(exctsccr_get_bg_tile_info);
	DECLARE_MACHINE_START(champbas);
	DECLARE_MACHINE_RESET(champbas);
	DECLARE_VIDEO_START(champbas);
	DECLARE_PALETTE_INIT(champbas);
	DECLARE_MACHINE_START(exctsccr);
	DECLARE_VIDEO_START(exctsccr);
	DECLARE_PALETTE_INIT(exctsccr);
	UINT32 screen_update_champbas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	UINT32 screen_update_exctsccr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	void screen_eof_champbas(screen_device &screen, bool state);
	INTERRUPT_GEN_MEMBER(vblank_irq);
	TIMER_CALLBACK_MEMBER(exctsccr_fm_callback);
	void champbas_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
	void exctsccr_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
	optional_device<dac_device> m_dac;
	optional_device<dac_device> m_dac1;
	optional_device<dac_device> m_dac2;
	required_device<gfxdecode_device> m_gfxdecode;
	required_device<palette_device> m_palette;
};