博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MTK 修改开进进入Recovery模式引导界面字体大小
阅读量:4986 次
发布时间:2019-06-12

本文共 4752 字,大约阅读时间需要 15 分钟。

 

  mtk 平板项目中由于默认使用的是8*16的点阵字体在显示中看起来明显偏小,因此使用24*48的字体显示比较大。

  需要修改的文件:

  1、 video_font.h

  更换对用宏定义

#define MTK_VFC 256 //characters

#define MTK_VFW 24 //width

#define MTK_VFH 48 //height

#define MTK_VFS (MTK_VFC * MTK_VFH *MTK_VFW/8) //size

以及字库

static unsigned char mtk_vdo_fntdata[MTK_VFS] = {};

  由于字库比较大就不直接粘贴出来,找对用的字库 风格即可,与单片机的使用类似。

  2、修改字体显示函数 mtk_cfb.c

  由于字体显示是相当于一个个点将点阵的数据输出到显示区域,原来的8*16的模式的函数不能正常使用,必须对应的修改,否则有可能不能使用。主要修改下列函数即可,我使用的平台使用的显示格式为CFB_565RGB_16BIT,故只需修改对应的case 即可。

static void cfb_lk_dchars (int xx, int yy, unsigned char *s, int count)

{
unsigned char *pos = NULL;
unsigned char *tdest = NULL;
unsigned char *pdest = NULL;
unsigned char *tdest_temp = NULL;
unsigned char *pdest_temp = NULL;
int row = 0;
int col = 0;
unsigned int data_fmt = 0;
int offs = 0;

pdest = cfb_fb_addrs + yy * LINE_LEN + xx * PIXEL_SIZE;

data_fmt = DATA_FMT;

switch (data_fmt)

{
case CFB_555RGB_15BIT:
while (count--)
{
offs = (*s++) * MTK_VFH;
pos = mtk_vdo_fntdata + offs;
row = MTK_VFH;
for (tdest = pdest;row--;tdest += LINE_LEN)
{
unsigned char bits = *pos++;
((unsigned int *) tdest)[0] = SHTSWAP32 ((lk_cfb_font_dtable15 [bits >> 6] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest)[1] = SHTSWAP32 ((lk_cfb_font_dtable15 [bits >> 4 & 3] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest)[2] = SHTSWAP32 ((lk_cfb_font_dtable15 [bits >> 2 & 3] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest)[3] = SHTSWAP32 ((lk_cfb_font_dtable15 [bits & 3] & cfb_eorx) ^ cfb_bgx);
}
pdest = pdest + MTK_VFW * PIXEL_SIZE;
}
break;
// use case CFB_565RGB_16BIT
case CFB_565RGB_16BIT:
while (count--)
{
offs = (*s++) * MTK_VFH * MTK_VFW /8;
pos = mtk_vdo_fntdata + offs;
row = MTK_VFH;
col = 3;
pdest_temp = pos;
int num= 0;// num++
for (int i = 0 ,tdest = pdest;row--;tdest += LINE_LEN)
{
for(int j = 0,tdest_temp = tdest;j != col;tdest_temp +=16){
unsigned char bits_tmp = *(pdest_temp + num);
((unsigned int *) tdest_temp)[0] = SHTSWAP32 ((lk_cfb_font_dtable16 [bits_tmp >> 6] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest_temp)[1] = SHTSWAP32 ((lk_cfb_font_dtable16 [bits_tmp >> 4 & 3] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest_temp)[2] = SHTSWAP32 ((lk_cfb_font_dtable16 [bits_tmp >> 2 & 3] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest_temp)[3] = SHTSWAP32 ((lk_cfb_font_dtable16 [bits_tmp & 3] & cfb_eorx) ^ cfb_bgx);
num++;
j++;
}
i++;
}
pdest = pdest + MTK_VFW * PIXEL_SIZE;
}
break;
case CFB_332RGB_8BIT:
case CFB_FMT_8BIT:
while (count--)
{
offs = (*s++) * MTK_VFH;
pos = mtk_vdo_fntdata + offs;
row = MTK_VFH;
for (tdest = pdest;row--;tdest += LINE_LEN)
{
unsigned char bits = *pos++;
((unsigned int *) tdest)[0] = (lk_cfb_font_dtable8[bits >> 4] & cfb_eorx) ^ cfb_bgx;
((unsigned int *) tdest)[1] = (lk_cfb_font_dtable8[bits & 15] & cfb_eorx) ^ cfb_bgx;
}
pdest = pdest + MTK_VFW * PIXEL_SIZE;
}
break;

case CFB_888RGB_24BIT:

while (count--)
{
offs = (*s++) * MTK_VFH;
pos = mtk_vdo_fntdata + offs;
row = MTK_VFH;
for (tdest = pdest;row--;tdest += LINE_LEN)
{
unsigned char bits = *pos++;

((unsigned int *) tdest)[0] = (lk_cfb_font_dtb24[bits >> 4][0] & cfb_eorx) ^ cfb_bgx;

((unsigned int *) tdest)[1] = (lk_cfb_font_dtb24[bits >> 4][1] & cfb_eorx) ^ cfb_bgx;
((unsigned int *) tdest)[2] = (lk_cfb_font_dtb24[bits >> 4][2] & cfb_eorx) ^ cfb_bgx;
((unsigned int *) tdest)[3] = (lk_cfb_font_dtb24[bits & 15][0] & cfb_eorx) ^ cfb_bgx;
((unsigned int *) tdest)[4] = (lk_cfb_font_dtb24[bits & 15][1] & cfb_eorx) ^ cfb_bgx;
((unsigned int *) tdest)[5] = (lk_cfb_font_dtb24[bits & 15][2] & cfb_eorx) ^ cfb_bgx;
}
pdest = pdest + MTK_VFW * PIXEL_SIZE;
}
break;

case CFB_X888RGB_32BIT:

while (count--)
{
offs = (*s++) * MTK_VFH;
pos = mtk_vdo_fntdata + offs;
row = MTK_VFH;
for (tdest = pdest;row--;tdest += LINE_LEN)
{
unsigned char bits = *pos++;

((unsigned int *) tdest)[0] = 0xff000000|SWAP32 ((lk_cfb_font_dtable32 [bits >> 4][0] & cfb_eorx) ^ cfb_bgx);

((unsigned int *) tdest)[1] = 0xff000000|SWAP32 ((lk_cfb_font_dtable32 [bits >> 4][1] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest)[2] = 0xff000000|SWAP32 ((lk_cfb_font_dtable32 [bits >> 4][2] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest)[3] = 0xff000000|SWAP32 ((lk_cfb_font_dtable32 [bits >> 4][3] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest)[4] = 0xff000000|SWAP32 ((lk_cfb_font_dtable32 [bits & 15][0] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest)[5] = 0xff000000|SWAP32 ((lk_cfb_font_dtable32 [bits & 15][1] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest)[6] = 0xff000000|SWAP32 ((lk_cfb_font_dtable32 [bits & 15][2] & cfb_eorx) ^ cfb_bgx);
((unsigned int *) tdest)[7] = 0xff000000|SWAP32 ((lk_cfb_font_dtable32 [bits & 15][3] & cfb_eorx) ^ cfb_bgx);
}
pdest = pdest + MTK_VFW * PIXEL_SIZE;
}
break;

default:

break;
}

}

  

转载于:https://www.cnblogs.com/atlas2016/p/7571999.html

你可能感兴趣的文章
python反射
查看>>
USACO 2017 February Gold
查看>>
XML DOM解析 基础概念
查看>>
jQuery取得select选择的文本与值
查看>>
Android入门系列002----普通控件使用
查看>>
YARN框架详解
查看>>
topshelf windows服务
查看>>
Mac OS X下重启apache
查看>>
Unity3D中Animator动画控制器组件的相关使用
查看>>
Mayan游戏
查看>>
The New Jordans 2013 released a comeback
查看>>
SQL实战(四)
查看>>
LEETCODE —— Unique Binary Search Trees [动态规划]
查看>>
栈溢出利用
查看>>
JS核心知识点:DOM\BOM\EVENT
查看>>
嵌入式软件设计第8次试验
查看>>
Datenstruktur und Algorithmus
查看>>
DLL劫持技术详解(lpk.dll)
查看>>
『干货』分享你最喜欢的技巧和提示(Xcode,objective-c,swift,c...等等)
查看>>
WPF教程六:布局之Grid面板(转)
查看>>