1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Closer on the fonts. Looks great!

This commit is contained in:
James Cotton 2012-05-24 00:30:46 -05:00 committed by Sambas
parent b3150500d5
commit faf3532ad3

View File

@ -1143,12 +1143,13 @@ void write_line_outlined(unsigned int x0, unsigned int y0, unsigned int x1, unsi
void write_word_misaligned(uint8_t *buff, uint16_t word, unsigned int addr, unsigned int xoff, int mode)
{
uint16_t firstmask = word >> xoff;
uint16_t lastmask = word << (8 - xoff);
WRITE_WORD_MODE(buff, addr, firstmask, mode);
uint16_t lastmask = word << (16 - xoff);
WRITE_WORD_MODE(buff, addr+1, firstmask && 0x00ff, mode);
WRITE_WORD_MODE(buff, addr, (firstmask & 0xff00) >> 8, mode);
if(xoff > 0)
{
WRITE_WORD_MODE(buff, addr + 1, lastmask, mode);
}
WRITE_WORD_MODE(buff, addr+3, lastmask & 0x00ff, mode);
if(xoff > 8)
WRITE_WORD_MODE(buff, addr+2, (lastmask & 0xff00) >> 8, mode);
}
/**
@ -1169,12 +1170,13 @@ void write_word_misaligned(uint8_t *buff, uint16_t word, unsigned int addr, unsi
void write_word_misaligned_NAND(uint8_t *buff, uint16_t word, unsigned int addr, unsigned int xoff)
{
uint16_t firstmask = word >> xoff;
uint16_t lastmask = word << (8 - xoff);
WRITE_WORD_NAND(buff, addr, firstmask);
uint16_t lastmask = word << (16 - xoff);
WRITE_WORD_NAND(buff, addr+1, firstmask & 0x00ff);
WRITE_WORD_NAND(buff, addr, (firstmask & 0xff00) >> 8);
if(xoff > 0)
{
WRITE_WORD_NAND(buff, addr + 1, lastmask);
}
WRITE_WORD_NAND(buff, addr+3, (lastmask & 0x00ff));
if (xoff > 8)
WRITE_WORD_NAND(buff, addr+2, (lastmask & 0xff00) >> 8);
}
/**
@ -1195,12 +1197,14 @@ void write_word_misaligned_NAND(uint8_t *buff, uint16_t word, unsigned int addr,
void write_word_misaligned_OR(uint8_t *buff, uint16_t word, unsigned int addr, unsigned int xoff)
{
uint16_t firstmask = word >> xoff;
uint16_t lastmask = word << (8 - xoff);
WRITE_WORD_OR(buff, addr, firstmask);
uint16_t lastmask = word << (16 - xoff);
WRITE_WORD_OR(buff, addr+1, firstmask & 0x00ff);
WRITE_WORD_OR(buff, addr, (firstmask & 0xff00) >> 8);
if(xoff > 0)
{
WRITE_WORD_OR(buff, addr + 1, lastmask);
}
WRITE_WORD_OR(buff, addr + 3, lastmask & 0x00ff);
if(xoff > 8)
WRITE_WORD_OR(buff, addr + 2, (lastmask & 0xff00) >> 8);
}
/**
@ -1279,7 +1283,7 @@ void write_char16(char ch, unsigned int x, unsigned int y, int font)
row = ch * font_info.height;
row_temp = row;
addr_temp = addr;
xshift = 8 - font_info.width;
xshift = 16 - font_info.width;
// We can write mask words easily.
for(yy = y; yy < y + font_info.height; yy++)
{
@ -1363,7 +1367,7 @@ void write_char(char ch, unsigned int x, unsigned int y, int flags, int font)
row = lookup * font_info.height * 2;
row_temp = row;
addr_temp = addr;
xshift = 8 - font_info.width;
xshift = 16 - font_info.width;
// We can write mask words easily.
for(yy = y; yy < y + font_info.height; yy++)
{