summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/spbactn.h
blob: 6106095d0780f011cd63743b95e34e02fff0eaea (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
95
96
97
98
99
100
101
// license:BSD-3-Clause
// copyright-holders:David Haywood
#ifndef MAME_INCLUDES_SPBACTN_H
#define MAME_INCLUDES_SPBACTN_H

#pragma once

#include "machine/gen_latch.h"
#include "video/tecmo_spr.h"
#include "video/tecmo_mix.h"
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"

class spbactn_state : public driver_device
{
public:
	spbactn_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_gfxdecode(*this, "gfxdecode"),
		m_screen(*this, "screen"),
		m_palette(*this, "palette"),
		m_sprgen(*this, "spritegen"),
		m_mixer(*this, "mixer"),
		m_soundlatch(*this, "soundlatch"),
		m_bgvideoram(*this, "bgvideoram"),
		m_fgvideoram(*this, "fgvideoram"),
		m_spvideoram(*this, "spvideoram"),
		m_extraram(*this, "extraram"),
		m_extraram2(*this, "extraram2")
	{ }

	void spbactn(machine_config &config);
	void spbactnp(machine_config &config);

private:
	required_device<cpu_device> m_maincpu;
	required_device<cpu_device> m_audiocpu;
	required_device<gfxdecode_device> m_gfxdecode;
	required_device<screen_device> m_screen;
	required_device<palette_device> m_palette;
	required_device<tecmo_spr_device> m_sprgen;
	required_device<tecmo_mix_device> m_mixer;
	required_device<generic_latch_8_device> m_soundlatch;

	required_shared_ptr<uint16_t> m_bgvideoram;
	required_shared_ptr<uint16_t> m_fgvideoram;
	required_shared_ptr<uint16_t> m_spvideoram;
	optional_shared_ptr<uint8_t> m_extraram;
	optional_shared_ptr<uint8_t> m_extraram2;

	tilemap_t    *m_bg_tilemap;
	tilemap_t    *m_fg_tilemap;

	tilemap_t    *m_extra_tilemap;

	DECLARE_WRITE16_MEMBER(main_irq_ack_w);

	DECLARE_WRITE16_MEMBER(bg_videoram_w);
	DECLARE_WRITE16_MEMBER(fg_videoram_w);
	TILE_GET_INFO_MEMBER(get_bg_tile_info);
	TILE_GET_INFO_MEMBER(get_fg_tile_info);

	DECLARE_WRITE8_MEMBER(extraram_w);
	TILE_GET_INFO_MEMBER(get_extra_tile_info);

	bitmap_ind16 m_tile_bitmap_bg;
	bitmap_ind16 m_tile_bitmap_fg;
	bitmap_ind16 m_sprite_bitmap;

	DECLARE_WRITE16_MEMBER(spbatnp_90006_w);
	DECLARE_WRITE16_MEMBER(spbatnp_9000a_w);
	DECLARE_WRITE16_MEMBER(spbatnp_9000c_w);
	DECLARE_WRITE16_MEMBER(spbatnp_9000e_w);

	DECLARE_WRITE16_MEMBER(spbatnp_90124_w);
	DECLARE_WRITE16_MEMBER(spbatnp_9012c_w);

	DECLARE_VIDEO_START(spbactn);
	DECLARE_VIDEO_START(spbactnp);

	//virtual void video_start();
	uint32_t screen_update_spbactn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
	uint32_t screen_update_spbactnp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
	int draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites);

	// temp hack
	DECLARE_READ16_MEMBER(temp_read_handler_r)
	{
		return 0xffff;
	}

	void spbactn_map(address_map &map);
	void spbactn_sound_map(address_map &map);
	void spbactnp_extra_map(address_map &map);
	void spbactnp_map(address_map &map);
};

#endif // MAME_INCLUDES_SPBACTN_H