Convert i2500vfd and mdm166a driver to use 8 byte bitmap custom character and
but the character definitions for heartbeat into the font.
This commit is contained in:
@@ -26,6 +26,7 @@ v.0.5dev (ongoing development)
|
|||||||
* CFontzPacket: Fix not using select() even if its available
|
* CFontzPacket: Fix not using select() even if its available
|
||||||
* CFontzPacket: Use cellwidth = 5 on CFA-631 and CFA-635 too
|
* CFontzPacket: Use cellwidth = 5 on CFA-631 and CFA-635 too
|
||||||
* t6963: Convert font to 8 byte bitmap
|
* t6963: Convert font to 8 byte bitmap
|
||||||
|
* convert i2500vfd and mdm166a driver to use 8 byte bitmap custom character
|
||||||
|
|
||||||
v0.5.4
|
v0.5.4
|
||||||
* Update driver includes and LDFLAGS (fixed glk and bayrad binding error)
|
* Update driver includes and LDFLAGS (fixed glk and bayrad binding error)
|
||||||
|
|||||||
@@ -335,7 +335,8 @@ i2500vfd_chr (Driver *drvthis, int x, int y, char c)
|
|||||||
MODULE_EXPORT void
|
MODULE_EXPORT void
|
||||||
i2500vfd_set_char (Driver *drvthis, int n, char *dat)
|
i2500vfd_set_char (Driver *drvthis, int n, char *dat)
|
||||||
{
|
{
|
||||||
int row, col;
|
int row;
|
||||||
|
unsigned char mask = (1 << CELLWIDTH) - 1;
|
||||||
|
|
||||||
if (n < 0 || n > 255)
|
if (n < 0 || n > 255)
|
||||||
return;
|
return;
|
||||||
@@ -343,12 +344,7 @@ i2500vfd_set_char (Driver *drvthis, int n, char *dat)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
for (row = 0; row < CELLHEIGHT; row++) {
|
for (row = 0; row < CELLHEIGHT; row++) {
|
||||||
int i = 0;
|
i2500vfd_fontmap[n][row] = dat[row] & mask;
|
||||||
|
|
||||||
for (col = 0; col < CELLWIDTH; col++)
|
|
||||||
i = (i << 1) | (dat[(row * CELLWIDTH) + col] > 0);
|
|
||||||
|
|
||||||
i2500vfd_fontmap[n][row] = i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,37 +423,15 @@ i2500vfd_hbar(Driver *drvthis, int x, int y, int len, int promille, int pattern)
|
|||||||
MODULE_EXPORT int
|
MODULE_EXPORT int
|
||||||
i2500vfd_icon (Driver *drvthis, int x, int y, int icon)
|
i2500vfd_icon (Driver *drvthis, int x, int y, int icon)
|
||||||
{
|
{
|
||||||
static char heart_open[] = {
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 0, 1, 0, 1,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0,
|
|
||||||
1, 0, 0, 0, 1,
|
|
||||||
1, 1, 0, 1, 1,
|
|
||||||
1, 1, 1, 1, 1 };
|
|
||||||
|
|
||||||
static char heart_filled[] = {
|
|
||||||
1, 1, 1, 1, 1,
|
|
||||||
1, 0, 1, 0, 1,
|
|
||||||
0, 1, 0, 1, 0,
|
|
||||||
0, 1, 1, 1, 0,
|
|
||||||
0, 1, 1, 1, 0,
|
|
||||||
1, 0, 1, 0, 1,
|
|
||||||
1, 1, 0, 1, 1,
|
|
||||||
1, 1, 1, 1, 1 };
|
|
||||||
|
|
||||||
switch (icon) {
|
switch (icon) {
|
||||||
case ICON_BLOCK_FILLED:
|
case ICON_BLOCK_FILLED:
|
||||||
i2500vfd_chr(drvthis, x, y, 255);
|
i2500vfd_chr(drvthis, x, y, 255);
|
||||||
break;
|
break;
|
||||||
case ICON_HEART_FILLED:
|
case ICON_HEART_FILLED:
|
||||||
i2500vfd_set_char(drvthis, 0, heart_filled);
|
i2500vfd_chr(drvthis, x, y, 3);
|
||||||
i2500vfd_chr(drvthis, x, y, 0);
|
|
||||||
break;
|
break;
|
||||||
case ICON_HEART_OPEN:
|
case ICON_HEART_OPEN:
|
||||||
i2500vfd_set_char(drvthis, 0, heart_open);
|
i2500vfd_chr(drvthis, x, y, 4);
|
||||||
i2500vfd_chr(drvthis, x, y, 0);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -47,6 +47,22 @@
|
|||||||
#define bOOOOOO 0x3f
|
#define bOOOOOO 0x3f
|
||||||
|
|
||||||
unsigned char i2500vfd_fontmap[256][8] = {
|
unsigned char i2500vfd_fontmap[256][8] = {
|
||||||
|
[0x03] {b_OOOOO,
|
||||||
|
b_O_O_O,
|
||||||
|
b__O_O_,
|
||||||
|
b__OOO_,
|
||||||
|
b__OOO_,
|
||||||
|
b_O_O_O,
|
||||||
|
b_OO_OO,
|
||||||
|
b_OOOOO},
|
||||||
|
[0x04] {b_OOOOO,
|
||||||
|
b_O_O_O,
|
||||||
|
b______,
|
||||||
|
b______,
|
||||||
|
b______,
|
||||||
|
b_O___O,
|
||||||
|
b_OO_OO,
|
||||||
|
b_OOOOO},
|
||||||
[0x20] {b______,
|
[0x20] {b______,
|
||||||
b______,
|
b______,
|
||||||
b______,
|
b______,
|
||||||
|
|||||||
@@ -466,7 +466,8 @@ mdm166a_chr(Driver *drvthis, int x, int y, char c)
|
|||||||
MODULE_EXPORT void
|
MODULE_EXPORT void
|
||||||
mdm166a_set_char(Driver *drvthis, int n, char *dat)
|
mdm166a_set_char(Driver *drvthis, int n, char *dat)
|
||||||
{
|
{
|
||||||
int row, col;
|
int row;
|
||||||
|
unsigned char mask = (1 << CELLWIDTH) - 1;
|
||||||
|
|
||||||
if (n < 0 || n > 255)
|
if (n < 0 || n > 255)
|
||||||
return;
|
return;
|
||||||
@@ -474,12 +475,7 @@ mdm166a_set_char(Driver *drvthis, int n, char *dat)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
for (row = 0; row < CELLHEIGHT; row++) {
|
for (row = 0; row < CELLHEIGHT; row++) {
|
||||||
int i = 0;
|
i2500vfd_fontmap[n][row] = dat[row] & mask;
|
||||||
|
|
||||||
for (col = 0; col < CELLWIDTH; col++)
|
|
||||||
i = (i << 1) | (dat[(row * CELLWIDTH) + col] > 0);
|
|
||||||
|
|
||||||
i2500vfd_fontmap[n][row] = i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -584,37 +580,15 @@ mdm166a_hbar(Driver *drvthis, int x, int y, int len, int promille, int pattern)
|
|||||||
MODULE_EXPORT int
|
MODULE_EXPORT int
|
||||||
mdm166a_icon(Driver *drvthis, int x, int y, int icon)
|
mdm166a_icon(Driver *drvthis, int x, int y, int icon)
|
||||||
{
|
{
|
||||||
static char heart_open[] = {
|
|
||||||
0, 1, 1, 1, 1, 1,
|
|
||||||
0, 1, 0, 1, 0, 1,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0,
|
|
||||||
0, 1, 0, 0, 0, 1,
|
|
||||||
0, 1, 1, 0, 1, 1,
|
|
||||||
0, 1, 1, 1, 1, 1};
|
|
||||||
|
|
||||||
static char heart_filled[] = {
|
|
||||||
0, 1, 1, 1, 1, 1,
|
|
||||||
0, 1, 0, 1, 0, 1,
|
|
||||||
0, 0, 1, 0, 1, 0,
|
|
||||||
0, 0, 1, 1, 1, 0,
|
|
||||||
0, 0, 1, 1, 1, 0,
|
|
||||||
0, 1, 0, 1, 0, 1,
|
|
||||||
0, 1, 1, 0, 1, 1,
|
|
||||||
0, 1, 1, 1, 1, 1};
|
|
||||||
|
|
||||||
switch (icon) {
|
switch (icon) {
|
||||||
case ICON_BLOCK_FILLED:
|
case ICON_BLOCK_FILLED:
|
||||||
mdm166a_chr(drvthis, x, y, 255);
|
mdm166a_chr(drvthis, x, y, 255);
|
||||||
break;
|
break;
|
||||||
case ICON_HEART_FILLED:
|
case ICON_HEART_FILLED:
|
||||||
mdm166a_set_char(drvthis, 0, heart_filled);
|
mdm166a_chr(drvthis, x, y, 3);
|
||||||
mdm166a_chr(drvthis, x, y, 0);
|
|
||||||
break;
|
break;
|
||||||
case ICON_HEART_OPEN:
|
case ICON_HEART_OPEN:
|
||||||
mdm166a_set_char(drvthis, 0, heart_open);
|
mdm166a_chr(drvthis, x, y, 4);
|
||||||
mdm166a_chr(drvthis, x, y, 0);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user