summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/mpu5.h
blob: 93c83745707600e92131be48ceeaa9af403c5ab6 (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
// license:BSD-3-Clause
// copyright-holders:David Haywood
#ifndef MAME_INCLUDES_MPU5_H
#define MAME_INCLUDES_MPU5_H

#pragma once

#include "machine/68340.h"
#include "machine/sec.h"


class mpu5_state : public driver_device
{
public:
	mpu5_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag)
		, m_maincpu(*this, "maincpu")
		, m_sec(*this, "sec")
	{ }

	void mpu5(machine_config &config);

private:
	uint32_t mpu5_mem_r(offs_t offset, uint32_t mem_mask = ~0);
	void mpu5_mem_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);

	uint32_t asic_r32(offs_t offset, uint32_t mem_mask = ~0);
	uint8_t asic_r8(offs_t offset);
	void asic_w32(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
	void asic_w8(offs_t offset, uint8_t data);

	uint32_t pic_r(offs_t offset);
	void pic_w(offs_t offset, uint32_t data);

	virtual void machine_start() override;
	void mpu5_map(address_map &map);

	uint32_t* m_cpuregion;
	std::unique_ptr<uint32_t[]> m_mainram;

	uint8_t m_led_strobe_temp;
	uint8_t m_led_strobe;
	uint8_t m_pic_clk;
	bool  m_pic_transfer_in_progress;
	uint8_t m_pic_bit1;
	uint8_t m_pic_data;
	uint8_t m_pic_clocked_bits;
	uint8_t m_pic_stored_input;
	uint8_t m_pic_output_bit;
	uint8_t m_input_strobe;

	// devices
	required_device<m68340_cpu_device> m_maincpu;
	required_device<sec_device> m_sec;
};

INPUT_PORTS_EXTERN( mpu5 );

#endif // MAME_INCLUDES_MPU5_H