summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/vt1682_alu.h
blob: 46987f5d9e992c04ca80dbfc45aefb049f20afb6 (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
// license:BSD-3-Clause
// copyright-holders:David Haywood

#ifndef MAME_MACHINE_VT1682_ALU_H
#define MAME_MACHINE_VT1682_ALU_H

#pragma once

DECLARE_DEVICE_TYPE(VT_VT1682_ALU, vrt_vt1682_alu_device)

class vrt_vt1682_alu_device : public device_t
{
public:
	// construction/destruction
	vrt_vt1682_alu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

	// so that we can filter logging, sound ALU gets used hundreds of times a frame, so logging it is unwise
	void set_sound_alu() { m_is_sound_alu = true; }

	DECLARE_READ8_MEMBER(alu_out_1_r);
	DECLARE_READ8_MEMBER(alu_out_2_r);
	DECLARE_READ8_MEMBER(alu_out_3_r);
	DECLARE_READ8_MEMBER(alu_out_4_r);
	DECLARE_READ8_MEMBER(alu_out_5_r);
	DECLARE_READ8_MEMBER(alu_out_6_r);

	DECLARE_WRITE8_MEMBER(alu_oprand_1_w);
	DECLARE_WRITE8_MEMBER(alu_oprand_2_w);
	DECLARE_WRITE8_MEMBER(alu_oprand_3_w);
	DECLARE_WRITE8_MEMBER(alu_oprand_4_w);
	DECLARE_WRITE8_MEMBER(alu_oprand_5_mult_w);
	DECLARE_WRITE8_MEMBER(alu_oprand_6_mult_w);
	DECLARE_WRITE8_MEMBER(alu_oprand_5_div_w);
	DECLARE_WRITE8_MEMBER(alu_oprand_6_div_w);


protected:
	virtual void device_start() override;
	virtual void device_reset() override;

private:
	bool m_is_sound_alu;

	uint8_t m_alu_oprand[4];
	uint8_t m_alu_oprand_mult[2];
	uint8_t m_alu_oprand_div[2];
	uint8_t m_alu_out[6];
};

#endif // MAME_MACHINE_VT1682_ALU_H