summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/includes/fidelz80.h
blob: c345c60c303dc6d706cdafb53217caa952b445db (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
/***************************************************************************

        fidelz80.h

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

#pragma once

#ifndef _FIDELZ80_H_
#define _FIDELZ80_H_

class fidelz80_state : public driver_device
{
public:
	fidelz80_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
		  m_maincpu(*this, "maincpu"),
		  m_speech(*this, "speech"),
		  m_beep(*this, BEEPER_TAG),
		  m_i8041(*this, "mcu"),
		  m_i8243(*this, "i8243")
		{ }

	required_device<cpu_device> m_maincpu;
	optional_device<device_t> m_speech;
	optional_device<device_t> m_beep;
	optional_device<cpu_device> m_i8041;
	optional_device<i8243_device> m_i8243;

	UINT16 m_kp_matrix;			// keypad/leds matrix
	UINT8 m_led_data;			// data for the two individual leds, in 0bxxxx12xx format
	UINT8 m_led_selected;		// 5 bit selects for 7 seg leds and for common other leds, bits are (7seg leds are 0 1 2 3, common other leds are C) 0bxx3210xc
	UINT16 m_digit_data;		// data for seg leds
	UINT8 m_digit_line_status[4];	// prevent overwrite of m_digit_data

	virtual void machine_reset();

	//model VCC/UVC
	void update_display(running_machine &machine);
	DECLARE_READ8_MEMBER( fidelz80_portc_r );
	DECLARE_WRITE8_MEMBER( fidelz80_portb_w );
	DECLARE_WRITE8_MEMBER( fidelz80_portc_w );
	DECLARE_WRITE8_MEMBER( cc10_porta_w );
	DECLARE_READ8_MEMBER( vcc_portb_r );
	DECLARE_WRITE8_MEMBER( vcc_porta_w );

	//model ABC/VBC
	DECLARE_WRITE8_MEMBER( abc_speech_w );
	DECLARE_WRITE8_MEMBER(kp_matrix_w);
	DECLARE_READ8_MEMBER(unknown_r);
	DECLARE_READ8_MEMBER(exp_i8243_p2_r);
	DECLARE_WRITE8_MEMBER(exp_i8243_p2_w);
	DECLARE_READ8_MEMBER(rand_r);
	DECLARE_WRITE8_MEMBER(mcu_data_w);
	DECLARE_WRITE8_MEMBER(mcu_command_w);
	DECLARE_READ8_MEMBER(mcu_data_r);
	DECLARE_READ8_MEMBER(mcu_status_r);

	//model VSC
	DECLARE_WRITE8_MEMBER(vsc_porta_w);
	DECLARE_WRITE8_MEMBER(vsc_portb_w);
	DECLARE_WRITE8_MEMBER(vsc_portc_w);
	DECLARE_READ8_MEMBER(vsc_pio_porta_r);
	DECLARE_READ8_MEMBER(vsc_pio_portb_r);
	DECLARE_WRITE8_MEMBER(vsc_pio_portb_w);
};


#endif	// _FIDELZ80_H_