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
|
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
uPD7227 Intelligent Dot-Matrix LCD Controller/Driver emulation
**********************************************************************/
#ifndef MAME_VIDEO_UPD7227_H
#define MAME_VIDEO_UPD7227_H
#pragma once
///*************************************************************************
// TYPE DEFINITIONS
///*************************************************************************
// ======================> upd7227_device
class upd7227_device : public device_t, public device_memory_interface
{
public:
// construction/destruction
upd7227_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock = XTAL());
upd7227_device(const machine_config &mconfig, const char *tag, device_t *owner, int sx, int sy) : upd7227_device(mconfig, tag, owner)
{ set_offsets(sx, sy); }
// inline configuration helpers
void set_offsets(int sx, int sy) { m_sx = sx; m_sy = sy; }
DECLARE_WRITE_LINE_MEMBER( cs_w );
DECLARE_WRITE_LINE_MEMBER( cd_w );
DECLARE_WRITE_LINE_MEMBER( sck_w );
DECLARE_WRITE_LINE_MEMBER( si_w );
DECLARE_READ_LINE_MEMBER( so_r );
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
// device_memory_interface overrides
virtual space_config_vector memory_space_config() const override;
address_space_config m_space_config;
private:
enum
{
CMD_SMM = 0x18,
CMD_SFF = 0x10,
CMD_LDPI = 0x80,
CMD_SWM = 0x64,
CMD_SRM = 0x60,
CMD_SANDM = 0x6c,
CMD_SORM = 0x68,
CMD_SCM = 0x72,
CMD_BSET = 0x40,
CMD_BRESET = 0x20,
CMD_DISP_ON = 0x09,
CMD_DISP_OFF = 0x08
};
int m_sx;
int m_sy;
int m_cs;
int m_cd;
int m_sck;
int m_si;
int m_so;
void upd7227_map(address_map &map);
};
// device type definition
DECLARE_DEVICE_TYPE(UPD7227, upd7227_device)
#endif // MAME_VIDEO_UPD7227_H
|