FT800 Series Programmer Guide
Version 2.1
Document Reference No.: BRT_000030 Clearance No.: BRT#037
26
Copyright © Bridgetek Limited
2.5.4
Writing display lists
Writing display list entries with wr32() is time-consuming and error-prone, so instead a
function might be used:
static
size_t dli
;
static
void
dl
(
unsigned
long
cmd
)
{
wr32
(
RAM_DL
+
dli
,
cmd
);
dli
+=
4
;
}
...
dli
=
0
;
// start writing the display list
dl
(
CLEAR
(
1
,
1
,
1
));
// clear screen
dl
(
BEGIN
(
BITMAPS
));
// start drawing bitmaps
dl
(
VERTEX2II
(
220
,
110
,
31
,
'F'
));
// ascii F in font 31
dl
(
VERTEX2II
(
244
,
110
,
31
,
'T'
));
// ascii T
dl
(
VERTEX2II
(
270
,
110
,
31
,
'D'
));
// ascii D
dl
(
VERTEX2II
(
299
,
110
,
31
,
'I'
));
// ascii I
dl
(
END
());
dl
(
COLOR_RGB
(
160
,
22
,
22
));
// change color to red
dl
(
POINT_SIZE
(
320
));
// set point size
dl
(
BEGIN
(
POINTS
));
// start drawing points
dl
(
VERTEX2II
(
192
,
133
,
0
,
0
));
// red point
dl
(
END
());
dl
(
DISPLAY
());
// display the image
Code snippet 9 dl function definition