summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/includes/ssystem3.h
blob: 9faccf94161533cdd82f65b941e256533ccc3e56 (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
// license:???
// copyright-holders:???
/*****************************************************************************
 *
 * includes/ssystem3.h
 *
 ****************************************************************************/

#ifndef SSYSTEM3_H_
#define SSYSTEM3_H_


struct playfield_t
{
	int signal;
	//  int on;

	int count, bit, started;
	UINT8 data;
	attotime time, high_time, low_time;
	union {
		struct {
			UINT8 header[7];
			UINT8 field[8][8/2];
			UINT8 unknown[5];
		} s;
		UINT8 data[7+8*8/2+5];
	} u;
};

struct lcd_t
{
	UINT8 data[5];
	int clock;
	int count;
};


class ssystem3_state : public driver_device
{
public:
	ssystem3_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
		m_maincpu(*this, "maincpu"),
		m_palette(*this, "palette")  { }

	UINT8 m_porta;
	UINT8 *m_videoram;
	playfield_t m_playfield;
	lcd_t m_lcd;
	DECLARE_DRIVER_INIT(ssystem3);
	virtual void video_start();
	DECLARE_PALETTE_INIT(ssystem3);
	UINT32 screen_update_ssystem3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	DECLARE_WRITE8_MEMBER(ssystem3_via_write_a);
	DECLARE_READ8_MEMBER(ssystem3_via_read_a);
	DECLARE_READ8_MEMBER(ssystem3_via_read_b);
	DECLARE_WRITE8_MEMBER(ssystem3_via_write_b);
	required_device<cpu_device> m_maincpu;
	required_device<palette_device> m_palette;
	void ssystem3_lcd_reset();
	void ssystem3_lcd_write(int clock, int data);
	void ssystem3_draw_7segment(bitmap_ind16 &bitmap,int value, int x, int y);
	void ssystem3_draw_led(bitmap_ind16 &bitmap,INT16 color, int x, int y, int ch);
	void ssystem3_playfield_getfigure(int x, int y, int *figure, int *black);
	void ssystem3_playfield_reset();
	void ssystem3_playfield_write(int reset, int signal);
	void ssystem3_playfield_read(int *on, int *ready);
};


#endif /* SSYSTEM3_H_ */