summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/plygonet.h
blob: 5b71fa2747616656694e219e9161986c549871dd (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
102
103
104
105
106
107
108
109
110
111
112
// license:BSD-3-Clause
// copyright-holders:R. Belmont, Andrew Gardner

#include "machine/eepromser.h"
#include "machine/gen_latch.h"
#include "video/k053936.h"
#include "cpu/dsp56k/dsp56k.h"


static const UINT16 dsp56k_bank00_size = 0x1000;
static const UINT16 dsp56k_bank01_size = 0x1000;
static const UINT16 dsp56k_bank02_size = 0x4000;
static const UINT16 dsp56k_shared_ram_16_size = 0x2000;
static const UINT16 dsp56k_bank04_size = 0x1fc0;

class polygonet_state : public driver_device
{
public:
	polygonet_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_dsp(*this, "dsp"),
		m_eeprom(*this, "eeprom"),
		m_k053936(*this, "k053936"),
		m_gfxdecode(*this, "gfxdecode"),
		m_palette(*this, "palette"),
		m_soundlatch(*this, "soundlatch"),
		m_soundlatch2(*this, "soundlatch2"),
		m_soundlatch3(*this, "soundlatch3"),
		m_shared_ram(*this, "shared_ram"),
		m_dsp56k_p_mirror(*this, "dsp56k_p_mirror"),
		m_dsp56k_p_8000(*this, "dsp56k_p_8000")
		{ }

	required_device<cpu_device> m_maincpu;
	required_device<cpu_device> m_audiocpu;
	required_device<dsp56k_device> m_dsp;
	required_device<eeprom_serial_er5911_device> m_eeprom;
	required_device<k053936_device> m_k053936;
	required_device<gfxdecode_device> m_gfxdecode;
	required_device<palette_device> m_palette;
	required_device<generic_latch_8_device> m_soundlatch;
	required_device<generic_latch_8_device> m_soundlatch2;
	required_device<generic_latch_8_device> m_soundlatch3;
	
	/* 68k-side shared ram */
	required_shared_ptr<UINT32> m_shared_ram;

	required_shared_ptr<UINT16> m_dsp56k_p_mirror;
	required_shared_ptr<UINT16> m_dsp56k_p_8000;

	ioport_port *m_inputs[4];
	UINT8 m_sys0;
	UINT8 m_sys1;

	/* TTL text plane stuff */
	int m_ttl_gfx_index;
	tilemap_t *m_ttl_tilemap;
	tilemap_t *m_roz_tilemap;
	UINT16 m_ttl_vram[0x800];
	UINT16 m_roz_vram[0x800];

	/* sound */
	UINT8 m_sound_ctrl;
	UINT8 m_sound_intck;

	/* memory buffers */
	UINT16 m_dsp56k_bank00_ram[2 * 8 * dsp56k_bank00_size]; /* 2 bank sets, 8 potential banks each */
	UINT16 m_dsp56k_bank01_ram[2 * 8 * dsp56k_bank01_size];
	UINT16 m_dsp56k_bank02_ram[2 * 8 * dsp56k_bank02_size];
	UINT16 m_dsp56k_shared_ram_16[2 * 8 * dsp56k_shared_ram_16_size];
	UINT16 m_dsp56k_bank04_ram[2 * 8 * dsp56k_bank04_size];

	DECLARE_WRITE8_MEMBER(polygonet_sys_w);
	DECLARE_READ8_MEMBER(polygonet_inputs_r);
	DECLARE_READ8_MEMBER(sound_comms_r);
	DECLARE_WRITE8_MEMBER(sound_comms_w);
	DECLARE_WRITE32_MEMBER(sound_irq_w);
	DECLARE_READ32_MEMBER(dsp_host_interface_r);
	DECLARE_WRITE32_MEMBER(shared_ram_write);
	DECLARE_WRITE32_MEMBER(dsp_w_lines);
	DECLARE_WRITE32_MEMBER(dsp_host_interface_w);
	DECLARE_READ32_MEMBER(network_r);
	DECLARE_READ16_MEMBER(dsp56k_bootload_r);
	DECLARE_READ16_MEMBER(dsp56k_ram_bank00_read);
	DECLARE_WRITE16_MEMBER(dsp56k_ram_bank00_write);
	DECLARE_READ16_MEMBER(dsp56k_ram_bank01_read);
	DECLARE_WRITE16_MEMBER(dsp56k_ram_bank01_write);
	DECLARE_READ16_MEMBER(dsp56k_ram_bank02_read);
	DECLARE_WRITE16_MEMBER(dsp56k_ram_bank02_write);
	DECLARE_READ16_MEMBER(dsp56k_shared_ram_read);
	DECLARE_WRITE16_MEMBER(dsp56k_shared_ram_write);
	DECLARE_READ16_MEMBER(dsp56k_ram_bank04_read);
	DECLARE_WRITE16_MEMBER(dsp56k_ram_bank04_write);
	DECLARE_WRITE8_MEMBER(sound_ctrl_w);
	DECLARE_READ32_MEMBER(polygonet_ttl_ram_r);
	DECLARE_WRITE32_MEMBER(polygonet_ttl_ram_w);
	DECLARE_READ32_MEMBER(polygonet_roz_ram_r);
	DECLARE_WRITE32_MEMBER(polygonet_roz_ram_w);
	DECLARE_DRIVER_INIT(polygonet);
	TILE_GET_INFO_MEMBER(ttl_get_tile_info);
	TILE_GET_INFO_MEMBER(roz_get_tile_info);
	TILEMAP_MAPPER_MEMBER(plygonet_scan);
	TILEMAP_MAPPER_MEMBER(plygonet_scan_cols);
	virtual void machine_reset() override;
	virtual void machine_start() override;
	virtual void video_start() override;
	UINT32 screen_update_polygonet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	INTERRUPT_GEN_MEMBER(polygonet_interrupt);
	DECLARE_WRITE_LINE_MEMBER(k054539_nmi_gen);
};