/*++ Copyright (c) 2010 WonderMedia Technologies, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/>. WonderMedia Technologies, Inc. 4F, 531, Chung-Cheng Road, Hsin-Tien, Taipei 231, R.O.C. --*/ #include #include #include #include #include #include #include #include #include #include #include "wmt_display.h" #include "minivgui.h" #define CHARGEANIM_PIC_NUM 7 // 1 big picture include 7 small pictures static char *sp_free_addr = (char *)5000000; static int s_display_percent; static int s_percent_val = -1; int g_tf_boot; // system boot from tf card. If set to 1, it means boot from eMMC. Otherwise, boot from Nand Flash typedef unsigned short GlyphScatter; #define Memcpy(dest, src, n) memcpy(dest, src, n) extern void *arm_memcpy(void *dest, const void *src, size_t n); extern void *arm_memset(void *s, int c, size_t count); extern void lcd_blt_enable(int no, int enable); typedef struct { unsigned short ucs2Start; unsigned short ucs2End; } GlyphRange; // // 字体文件布局 // ---------------- // | 文件头 | // FontFileHead // ---------------| // | 区间信息数组 | // 连续区间数据 GlyphRange[] // ---------------- // | 离散信息数组 | // 离散点数据 GlyphScatter[] 已经排序 // ---------------| // | missing点阵 | // missing glyph 点阵,额外的一个点阵用于显示无法找到的字符 // ---------------- // | 区间1点阵 | // 连续区间点阵数据 // | 区间2点阵 | // 连续区间点阵数据 // | 区间... | // 连续区间点阵数据 // ---------------- // | 离散1点阵 | // 离散的点阵 // | 离散2点阵 | // 离散的点阵 // | 离散... | // 离散的点阵 // ---------------- static const unsigned char s_fontData[] = { 0x46, 0x54, 0x02, 0x10, 0x46, 0x6F, 0x6E, 0x74, 0x20, 0x31, 0x32, 0x78, 0x32, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x16, 0x2C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0xC0, 0x39, 0xC0, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x80, 0x04, 0x80, 0x04, 0x80, 0x09, 0x00, 0x09, 0x00, 0x3F, 0xC0, 0x09, 0x00, 0x09, 0x00, 0x3F, 0xC0, 0x09, 0x00, 0x09, 0x00, 0x12, 0x00, 0x12, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0F, 0x80, 0x10, 0x80, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x1E, 0x00, 0x01, 0x80, 0x00, 0x80, 0x20, 0x80, 0x21, 0x80, 0x3F, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x22, 0x00, 0x22, 0x00, 0x22, 0x00, 0x1C, 0x00, 0x01, 0x80, 0x0E, 0x00, 0x30, 0x00, 0x07, 0x00, 0x08, 0x80, 0x08, 0x80, 0x08, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x3F, 0x80, 0x04, 0x00, 0x06, 0x00, 0x0A, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x7F, 0xC0, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x18, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x80, 0x00, 0x80, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x10, 0x80, 0x10, 0x80, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x80, 0x10, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x3A, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x1F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x10, 0x80, 0x20, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x80, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x20, 0x40, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x30, 0x80, 0x00, 0x40, 0x00, 0x40, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x20, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x09, 0x00, 0x09, 0x00, 0x11, 0x00, 0x11, 0x00, 0x21, 0x00, 0x3F, 0x80, 0x01, 0x00, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x80, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x17, 0x00, 0x18, 0x80, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x20, 0x40, 0x10, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xE0, 0x06, 0x00, 0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0x27, 0x80, 0x28, 0x40, 0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x20, 0x08, 0x40, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xC0, 0x20, 0x40, 0x00, 0x40, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x11, 0x00, 0x20, 0x80, 0x20, 0x80, 0x20, 0x80, 0x11, 0x00, 0x0F, 0x00, 0x11, 0x00, 0x20, 0x80, 0x20, 0x80, 0x20, 0x80, 0x11, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x11, 0x80, 0x20, 0x80, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x10, 0xC0, 0x0F, 0x40, 0x00, 0x40, 0x00, 0x80, 0x00, 0x80, 0x01, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x18, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x80, 0x03, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x60, 0x00, 0x10, 0x00, 0x0C, 0x00, 0x03, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0x0C, 0x00, 0x03, 0x00, 0x00, 0x80, 0x00, 0x60, 0x00, 0x80, 0x03, 0x00, 0x0C, 0x00, 0x10, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x10, 0x80, 0x10, 0x40, 0x00, 0x40, 0x00, 0x40, 0x01, 0x80, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x18, 0x80, 0x20, 0x40, 0x20, 0x40, 0x21, 0xC0, 0x22, 0x40, 0x24, 0x40, 0x24, 0x40, 0x24, 0x40, 0x23, 0xC0, 0x20, 0x00, 0x20, 0x00, 0x10, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x06, 0x00, 0x09, 0x00, 0x09, 0x00, 0x09, 0x00, 0x10, 0x80, 0x10, 0x80, 0x3F, 0xC0, 0x20, 0x40, 0x20, 0x40, 0x40, 0x20, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x80, 0x1F, 0x80, 0x10, 0x40, 0x10, 0x20, 0x10, 0x20, 0x10, 0x20, 0x10, 0x40, 0x7F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x20, 0x10, 0xE0, 0x20, 0x20, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x20, 0x20, 0x10, 0x40, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x10, 0x40, 0x10, 0x40, 0x10, 0x20, 0x10, 0x20, 0x10, 0x20, 0x10, 0x20, 0x10, 0x20, 0x10, 0x20, 0x10, 0x40, 0x10, 0x40, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x10, 0x20, 0x10, 0x20, 0x11, 0x00, 0x11, 0x00, 0x1F, 0x00, 0x11, 0x00, 0x11, 0x00, 0x10, 0x20, 0x10, 0x20, 0x10, 0x20, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x10, 0x20, 0x10, 0x20, 0x11, 0x00, 0x11, 0x00, 0x1F, 0x00, 0x11, 0x00, 0x11, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x40, 0x10, 0xC0, 0x20, 0x40, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x43, 0xE0, 0x40, 0x40, 0x40, 0x40, 0x20, 0x40, 0x10, 0x40, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0xF0, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x3F, 0xC0, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0xF9, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xE0, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x20, 0x80, 0x20, 0x80, 0x20, 0x80, 0x20, 0x80, 0x11, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0xF0, 0x10, 0x40, 0x10, 0x80, 0x11, 0x00, 0x12, 0x00, 0x14, 0x00, 0x1E, 0x00, 0x11, 0x00, 0x10, 0x80, 0x10, 0x80, 0x10, 0x40, 0x78, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x20, 0x08, 0x20, 0x08, 0x20, 0x08, 0x20, 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xE0, 0x60, 0xC0, 0x51, 0x40, 0x51, 0x40, 0x51, 0x40, 0x4A, 0x40, 0x4A, 0x40, 0x44, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xE0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xE0, 0x30, 0x40, 0x28, 0x40, 0x28, 0x40, 0x24, 0x40, 0x24, 0x40, 0x22, 0x40, 0x22, 0x40, 0x21, 0x40, 0x21, 0x40, 0x20, 0xC0, 0x70, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x10, 0x80, 0x20, 0x40, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x20, 0x40, 0x10, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x10, 0x80, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x80, 0x1F, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x10, 0x80, 0x20, 0x40, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x20, 0x40, 0x10, 0x80, 0x0F, 0x00, 0x04, 0x00, 0x0F, 0x20, 0x18, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x10, 0x80, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x80, 0x1F, 0x00, 0x10, 0x80, 0x10, 0x40, 0x10, 0x40, 0x10, 0x20, 0x78, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x40, 0x10, 0xC0, 0x20, 0x40, 0x20, 0x00, 0x30, 0x00, 0x0F, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x40, 0x20, 0x40, 0x30, 0x80, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC0, 0x44, 0x40, 0x44, 0x40, 0x44, 0x40, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xE0, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x10, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x20, 0x40, 0x20, 0x40, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x09, 0x00, 0x09, 0x00, 0x09, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF1, 0xF0, 0x40, 0x40, 0x40, 0x40, 0x44, 0x40, 0x44, 0x40, 0x24, 0x80, 0x2A, 0x80, 0x2A, 0x80, 0x2A, 0x80, 0x2A, 0x80, 0x2A, 0x80, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF1, 0xE0, 0x20, 0x80, 0x11, 0x00, 0x11, 0x00, 0x0A, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x11, 0x00, 0x10, 0x80, 0x20, 0x80, 0x40, 0x40, 0xF1, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xF0, 0x20, 0x20, 0x10, 0x40, 0x08, 0x80, 0x05, 0x00, 0x05, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xC0, 0x20, 0x40, 0x20, 0x80, 0x21, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08, 0x40, 0x10, 0x40, 0x20, 0x40, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0x04, 0x00, 0x04, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x09, 0x00, 0x09, 0x00, 0x10, 0x80, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x10, 0x40, 0x00, 0x40, 0x00, 0x40, 0x0F, 0xC0, 0x10, 0x40, 0x20, 0x40, 0x20, 0xC0, 0x1F, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x27, 0x80, 0x28, 0x40, 0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x20, 0x28, 0x40, 0x67, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xA0, 0x10, 0x60, 0x20, 0x20, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x20, 0x10, 0x40, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x1E, 0x40, 0x21, 0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x21, 0xC0, 0x1E, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x10, 0x80, 0x20, 0x40, 0x20, 0x40, 0x3F, 0xC0, 0x20, 0x00, 0x20, 0x00, 0x10, 0x40, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x3F, 0x80, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0xC0, 0x11, 0x80, 0x20, 0x80, 0x20, 0x80, 0x20, 0x80, 0x20, 0x80, 0x20, 0x80, 0x11, 0x80, 0x0E, 0x80, 0x00, 0x80, 0x00, 0x80, 0x01, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x17, 0x00, 0x18, 0x80, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x38, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x7F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x11, 0xE0, 0x10, 0x80, 0x13, 0x00, 0x14, 0x00, 0x1C, 0x00, 0x12, 0x00, 0x11, 0x00, 0x10, 0x80, 0x31, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0xC0, 0x33, 0x20, 0x22, 0x20, 0x22, 0x20, 0x22, 0x20, 0x22, 0x20, 0x22, 0x20, 0x22, 0x20, 0x73, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x18, 0x80, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x10, 0x40, 0x38, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x10, 0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x40, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x80, 0x28, 0x40, 0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x20, 0x28, 0x40, 0x27, 0x80, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x60, 0x21, 0x40, 0x40, 0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x21, 0xC0, 0x1E, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xC0, 0x0A, 0x20, 0x0C, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x40, 0x20, 0xC0, 0x20, 0x40, 0x1F, 0x00, 0x00, 0x80, 0x00, 0x40, 0x20, 0x40, 0x30, 0x80, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x3F, 0xC0, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x60, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xC0, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0xC0, 0x1F, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x20, 0x40, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x09, 0x00, 0x09, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF0, 0x40, 0x40, 0x44, 0x40, 0x44, 0x40, 0x24, 0x80, 0x2A, 0x80, 0x2A, 0x80, 0x2A, 0x80, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0xE0, 0x20, 0x40, 0x10, 0x80, 0x09, 0x00, 0x06, 0x00, 0x09, 0x00, 0x10, 0x80, 0x20, 0x40, 0x79, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x20, 0x40, 0x20, 0x80, 0x10, 0x80, 0x10, 0x80, 0x09, 0x00, 0x09, 0x00, 0x06, 0x00, 0x06, 0x00, 0x04, 0x00, 0x04, 0x00, 0x08, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xC0, 0x20, 0x80, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x20, 0x40, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x0C, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x26, 0x40, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /** * the VGUI private Font file version 1.0 head struct, internally used only. */ typedef struct { char magic[2]; // "FT" unsigned short version; // 0x1001 (1.01) char name[32]; // description unsigned char charWidth; unsigned char charHeight; unsigned short glyphBytes; unsigned short rangeCount; unsigned short scatterCount; } FontFileHeadV1; static mv_surface s_surface[5]; unsigned int (*rgb2color)(unsigned char r, unsigned char g, unsigned char b); void (*putcolor2fb)(const mv_surface *s, int x, int y, unsigned int color); void (*putcolor2mem)(const mv_surface *s, int x, int y, unsigned int color); static unsigned char *m_fileStart; static unsigned char *m_glyphStart; static FontFileHeadV1 *m_fh; int bitsPerPixel; //Display Direction definition: // 0: portrait, the back button under the screen ( 竖屏, back 键在下) // 1: landscape, the back button on the right of the screnn ( 横屏, back键在右) // 2: portrait, the back button above the screen ( 竖屏, back键在上) // 3: landscape, the back button on the left of the screen ( 横屏, back键在左) int g_display_direction = 1; // for mem aligment extern void byte1_alig_mem_copy(char *src, char *des, unsigned int len); extern void byte2_alig_mem_copy(char *src, char *des, unsigned int len); extern void byte3_alig_mem_copy(char *src, char *des, unsigned int len); extern void mem_copy(char *src, char *des, unsigned int len); extern void byte1_less_bundle_copy(char *src, char *des, unsigned int len); extern void byte2_less_bundle_copy(char *src, char *des, unsigned int len); extern void byte3_less_bundle_copy(char *src, char *des, unsigned int len); extern void less_mem_copy(char *src, char *des, unsigned int len); // 24bits bitmap -> 146bits frame buffer extern void bit24_to_bit16_ali24(char *src, char *des, unsigned int len); extern void bit24_to_bit16_ali32(char *src, char *des, unsigned int len); static int setFontFileDat(const unsigned char *dat); static unsigned int rgb2color565(unsigned char r, unsigned char g, unsigned char b) { unsigned int ret = 0; ret = (unsigned int)(((r) >> 3) << 11 | ((g) >> 2) << 5 | ((b) >> 3)); return ret; } /* static unsigned int rgb2color555(unsigned char r, unsigned char g, unsigned char b) { unsigned int ret = 0; ret = (unsigned int)((((r) >> 3) << 10 | ((g) >> 3) << 5 | ((b) >> 3)) & 0x7fff); return ret; } */ static unsigned int rgb2color888(unsigned char r, unsigned char g, unsigned char b) { unsigned int ret = 0; ret = (unsigned int)(((r) << 16 | (g) << 8 | (b)) & 0x00FFFFFF); return ret; } /* static unsigned int rgb2color666(unsigned char r, unsigned char g, unsigned char b) { unsigned int ret = 0; ret = (unsigned int)(((r) >> 2) << 12 | ((g) >> 2) << 6 | ((b) >> 2)); return ret; } */ static void putcolor2fb16(const mv_surface *s, int x, int y, unsigned int color) { if(g_display_direction == 1) { if((g_logo_scale != LOGO_NOT_SCALE) || (x >= 0 && x < s->width && y >= 0 && y < s->height)) *(unsigned short *)(s->startAddr + (x * 2) + (s->lineBytes * y)) = (unsigned short)color; } else { //circumrotate the font int new_x, new_y; new_x = x; new_y = y; switch(g_display_direction) { case 0: new_x = y; new_y = (s->height - 1 - x); break; case 2: new_x = (s->width - 1 - y); new_y = x; break; case 3: new_x = (s->width - 1 - x); new_y = (s->height - 1 - y); break; } if((g_logo_scale != LOGO_NOT_SCALE) || (new_x >= 0 && new_x < s->width && new_y >= 0 && new_y < s->height)) *(unsigned short *)(s->startAddr + (new_x * 2) + (s->lineBytes * new_y)) = (unsigned short)color; } } static void putcolor2fb32(const mv_surface *s, int x, int y, unsigned int color) { if(g_display_direction == 1) { if((g_logo_scale != LOGO_NOT_SCALE) || (x >= 0 && x < s->width && y >= 0 && y < s->height)) *(unsigned int *)(s->startAddr + (x * 4) + (s->lineBytes * y)) = (unsigned int)color; } else { //circumrotate the font int new_x, new_y; new_x = x; new_y = y; switch(g_display_direction) { case 0: new_x = y; new_y = (s->height - 1 - x); break; case 2: new_x = (s->width - 1 - y); new_y = x; break; case 3: new_x = (s->width - 1 - x); new_y = (s->height - 1 - y); break; } if((g_logo_scale != LOGO_NOT_SCALE) || (new_x >= 0 && new_x < s->width && new_y >= 0 && new_y < s->height)) *(unsigned int *)(s->startAddr + (new_x * 4) + (s->lineBytes * new_y)) = (unsigned int)color; } } mv_surface *mv_getSurface(int no) { return &s_surface[no]; } static void putcolor2mem16(const mv_surface *s, int x, int y, unsigned int color) { if(g_display_direction == 1) { if((g_logo_scale != LOGO_NOT_SCALE) || (x >= 0 && x < s->width && y >= 0 && y < s->height)) *(unsigned short *)(sp_free_addr + (x * 2) + (s->lineBytes * y)) = (unsigned short)color; } else { //circumrotate the font int new_x, new_y; new_x = x; new_y = y; switch(g_display_direction) { case 0: new_x = y; new_y = (s->height - 1 - x); break; case 2: new_x = (s->width - 1 - y); new_y = x; break; case 3: new_x = (s->width - 1 - x); new_y = (s->height - 1 - y); break; } if((g_logo_scale != LOGO_NOT_SCALE) || (new_x >= 0 && new_x < s->width && new_y >= 0 && new_y < s->height)) *(unsigned short *)(sp_free_addr + (new_x * 2) + (s->lineBytes * new_y)) = (unsigned short)color; } } static void putcolor2mem32(const mv_surface *s, int x, int y, unsigned int color) { if(g_display_direction == 1) { if((g_logo_scale != LOGO_NOT_SCALE) || (x >= 0 && x < s->width && y >= 0 && y < s->height)) *(unsigned int *)(sp_free_addr + (x * 4) + (s->lineBytes * y)) = (unsigned int)color; } else { //circumrotate the font int new_x, new_y; new_x = x; new_y = y; switch(g_display_direction) { case 0: new_x = y; new_y = (s->height - 1 - x); break; case 2: new_x = (s->width - 1 - y); new_y = x; break; case 3: new_x = (s->width - 1 - x); new_y = (s->height - 1 - y); break; } if((g_logo_scale != LOGO_NOT_SCALE) || (new_x >= 0 && new_x < s->width && new_y >= 0 && new_y < s->height)) *(unsigned int *)(sp_free_addr + (new_x * 4) + (s->lineBytes * new_y)) = (unsigned int)color; } } static int get_fb_offset(const mv_surface *s, int img_width, int img_height, int xpos, int ypos) { int x, y; int bytes_per_pixel; bytes_per_pixel = (s->bits_per_pixel >> 3); switch(g_display_direction) { case 0: x = ypos; y = s->height - xpos - img_width; break; case 2: x = s->width - ypos - img_height; y = xpos; break; case 3: x = s->width - xpos - img_width; y = s->height - ypos - img_height; break; case 1: default: x = xpos; y = ypos; break; } return (x * bytes_per_pixel + s->lineBytes * y); } static void mem2fb(const mv_surface *s, int width, int height, int xpos, int ypos) { int new_width, new_height, new_xpos, new_ypos; int i, bytes_per_pixel, fb_offset; char *dest, *src; new_width = width; new_height = height; new_xpos = xpos; new_ypos = ypos; bytes_per_pixel = (s->bits_per_pixel >> 3); switch(g_display_direction) { case 0: // the screen is portrait case 2: new_width = height; new_height = width; new_xpos = ypos; new_ypos = xpos; break; } fb_offset = get_fb_offset(s, width, height, xpos, ypos); dest = s->startAddr + fb_offset; src = sp_free_addr + fb_offset; for (i = 0; i < new_height; i++) { arm_memcpy(dest, src, new_width * bytes_per_pixel); dest += s->lineBytes; src += s->lineBytes; } } void mv_clearFB(void) { int no; mv_surface *s; for(no = 0; no < VPP_VOUT_INFO_NUM; no++) { s = &s_surface[no]; if(s->startAddr) arm_memset(s->startAddr, 0, s->height * s->lineBytes); } } void mv_initSurface(int no, const mv_surface *s) { static int flag = 0; unsigned int free_addr; Memcpy(&s_surface[no], s, sizeof(mv_surface)); if (flag == 0) { setFontFileDat(s_fontData); //defined in "fontdata.h" if (s->bits_per_pixel == 16) { rgb2color = rgb2color565; putcolor2fb = putcolor2fb16; putcolor2mem = putcolor2mem16; bitsPerPixel = 16; } else { rgb2color = rgb2color888; putcolor2fb = putcolor2fb32; putcolor2mem = putcolor2mem32; } free_addr = (unsigned int)s->startAddr - (1920 * 1080 * 4) * 2; if(free_addr < 0) free_addr = 0; sp_free_addr = (char *)free_addr; flag = 1; } } void check_display_direction(void) { char *env; env = getenv("wmt.org.direction"); if (!env) { g_display_direction = 1; } else { g_display_direction = simple_strtoul(env, NULL, 10); if(g_display_direction < 0 || g_display_direction > 3) g_display_direction = 1; } //printf("display direction %d\n", g_display_direction); } void check_tf_boot(void) { char *env; env = getenv("wmt.boot.dev"); if (env && !strnicmp(env, "TF", 2)) g_tf_boot = 1; } void mv_dumpSurface(void) { printf("s_surface[0]: width = %d, height = %d, lineBytes = %d, bits_per_pixel = %d, startAddr = 0x%p\n", s_surface[0].width, s_surface[0].height, s_surface[0].lineBytes, s_surface[0].bits_per_pixel, s_surface[0].startAddr); printf("s_surface[1]: width = %d, height = %d, lineBytes = %d, bits_per_pixel = %d, startAddr = 0x%p\n", s_surface[1].width, s_surface[1].height, s_surface[1].lineBytes, s_surface[1].bits_per_pixel, s_surface[1].startAddr); } void mv_drawLine(int no, int x1, int y1, int x2, int y2, unsigned int color) { int i; //mv_color* p; const mv_surface *s = &s_surface[no]; if ( y1 == y2 ) { if (x1 > x2) { int tmp = x1; x1 = x2; x2 = tmp; } #if 0 // horz line p = getXYData(s, x1, y1); for (i = x1; i < x2; ++i) *p++ = color; #else for (i = x1; i < x2; ++i) putcolor2fb(s, i, y1, color); #endif } else if ( x1 == x2 ) { if (y1 > y2) { int tmp = y1; y1 = y2; y2 = tmp; } #if 0 // vert line p = getXYData(s, x1,y1); for (i = y1; i < y2; ++i) { *p = color; p = p + s->lineBytes; } #else for (i = y1; i < y2; ++i) putcolor2fb(s, x1, i, color); #endif } } void mv_drawRect(int no, const mv_Rect *rect, unsigned int color) { mv_drawLine(no, rect->left, rect->top, rect->right, rect->top, color); mv_drawLine(no, rect->left, rect->bottom, rect->right, rect->bottom, color); mv_drawLine(no, rect->left, rect->top, rect->left, rect->bottom, color); mv_drawLine(no, rect->right, rect->top, rect->right, rect->bottom, color); } void mv_fillRect(int no, const mv_Rect *rect, unsigned char r, unsigned char g, unsigned char b) { int y; unsigned int color = 0; color = rgb2color(r, g, b); for (y = rect->top; y < rect->bottom ; y++) mv_drawLine(no, rect->left, y, rect->right, y, color); } int mv_le_to_cpu(char *buf, int size) { int i; int val = 0; for(i = size - 1; i >= 0; i--) { val = val << 8; val |= buf[i]; } return val; } int mv_loadBmp(int no, unsigned char *fileBuffer, int clearFB) { unsigned char r, g, b; int i, j, bytes; int width, height, offset; short colorBits; unsigned char *colorMap; mv_surface img; bmp_header_t *header; unsigned int dcolor = 0; int xpos, ypos; char *ptr; int bits_per_pixel; mv_surface *s; char *source, *dst, *tmp_source, *tmp_dst; int double_width, ali; // for 32bits to 16bits int bundle24, phase1, tmp_offset, tmp_phase1, tmp_bundle24, show_width, over_width, over_high; s = &s_surface[no]; if(s->startAddr == 0) return 0; if (*fileBuffer != 'B') { printf("fileBuffer : 0x%x = 0x%x \n", fileBuffer, *fileBuffer); printf("Error : Not BMP Format\r\n"); return -1; } header = (bmp_header_t *)fileBuffer; offset = mv_le_to_cpu((char *)&header->data_offset, 4); width = mv_le_to_cpu((char *)&header->width, 4); height = mv_le_to_cpu((char *)&header->height, 4); colorBits = mv_le_to_cpu((char *)&header->bit_count, 2); colorMap = (unsigned char *)(fileBuffer + 54); //颜色表地址(8bit时使用) show_width = width; over_width = 0; over_high = 0; img.width = width; img.height = height; img.lineBytes = s->lineBytes; i = 0; j = 0; if(g_display_direction == 0 || g_display_direction == 2) { // the screen is portrait if (width != s->height) { if (width > s->height) { printf("Warning : BMP Width(%d) > LCD(%d)\r\n", width, s->height); if(g_logo_scale == LOGO_NOT_SCALE) { /* only surport 24bit or 32bit bmp exceed screen size */ if(colorBits == 24 || colorBits == 32) { /* only show bmp center if bmp size exceed screen size*/ over_width = width - s->height; width = s->height; img.width = width; } } } else i = (s->height - width) / 2; } if (height != s->width) { if (height > s->width) { printf("Warning : BMP Height(%d) > LCD(%d)\r\n", height, s->width); if(g_logo_scale == LOGO_NOT_SCALE) { if(colorBits == 24 || colorBits == 32) { over_high = height - s->width; height = s->width; img.height = height; } } } else j = (s->width - height) / 2; } if ((g_logo_x >= 0) && (g_logo_x < s->height)) i = g_logo_x; if ((g_logo_y >= 0) && (g_logo_y < s->width)) j = g_logo_y; } else { // the screen is landscape if (width != s->width) { if (width > s->width) { printf("Warning : BMP Width(%d) > LCD(%d)\r\n", width, s->width); if(g_logo_scale == LOGO_NOT_SCALE) { if(colorBits == 24 || colorBits == 32) { over_width = width - s->width; width = s->width; img.width = width; } } } else i = (s->width - width) / 2; } if (height != s->height) { if (height > s->height) { printf("Warning : BMP Height(%d) > LCD(%d)\r\n", height, s->height); if(g_logo_scale == LOGO_NOT_SCALE) { if(colorBits == 24 || colorBits == 32) { over_high = height - s->height; height = s->height; img.height = height; } } } else j = (s->height - height) / 2; } if ((g_logo_x >= 0) && (g_logo_x < s->width)) i = g_logo_x; if ((g_logo_y >= 0) && (g_logo_y < s->height)) j = g_logo_y; } img.startAddr = (s->startAddr + (i * (s->bits_per_pixel >> 3)) + (s->lineBytes * j)); /* add for logo scale */ //set wimg.startAddr = (char *)vpp_calc_align((int)img.startAddr, 64); if(g_logo_scale != LOGO_NOT_SCALE) { if (g_logo_scale == LOGO_MODE_MAX) g_logo_scale = ((width == 1280 && height == 720) || (width > 1280 || height > 720)) ? LOGO_ORI_SCALE_FULL : LOGO_720P_SCALE_FULL; if(g_logo_scale == LOGO_720P_SCALE_FULL) { s->img_width = 1280; s->img_height = 720; s->img_startAddr = s->startAddr; i = (1280 - width) / 2; j = (720 - height) / 2; img.startAddr = (s->startAddr + (i * (s->bits_per_pixel >> 3)) + (s->lineBytes * j)); img.startAddr = (char *)vpp_calc_align((int)img.startAddr, 64); arm_memset(s->startAddr, 0, 720 * s->lineBytes); //clean fb } else { s->img_width = width; s->img_height = height; s->img_startAddr = img.startAddr; } } /* end of logo scale */ xpos = i; ypos = j; if(clearFB) arm_memset(s->startAddr, 0, s->height * s->lineBytes); //clear fb switch (colorBits) { // AimarMa -- Add 32bit BMP support case 32: // r,g,b,a bits_per_pixel = s->bits_per_pixel; if (bits_per_pixel != 16 && g_display_direction == 1) { for (i = 0; i <= height - 1 ; i++) { //source = (char *)(fileBuffer + offset + i * width * 4); source = (char *)(fileBuffer + offset + i * show_width * 4 + (over_high/2)*show_width * 4 + (over_width/2) * 4); dst = (char *)(img.startAddr + img.lineBytes * (height - 1 - i)); mem_cpy_alignment (dst, source, width * 4); } } else { offset = offset + (over_high/2)*show_width * 4 + (over_width/2) * 4; for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { b = *(fileBuffer + offset); g = *(fileBuffer + offset + 1); r = *(fileBuffer + offset + 2); //a = *(unsigned char*)(fileBuffer + offset + 3); //*getXYData(&img, j, i) = mv_RGB2Color(r,g,b); dcolor = rgb2color(r, g, b); //putcolor2fb(&img, j, i, dcolor); putcolor2mem(&s_surface[no], j + xpos, i + ypos, dcolor); offset += 4; } offset += over_width * 4; } mem2fb(s, width, height, xpos, ypos); } break; case 24: // r,g,b if(g_display_direction == 1) { bits_per_pixel = s->bits_per_pixel; ptr = malloc(width * 3); if (!ptr) { printf("allocate fail!!\n"); return 0; } bytes = 4 - (show_width * 3) % 4; if (bytes == 4) bytes = 0; // 24bits -> 16bits bundle24 = (width * 3) % 24; // 8 bits phase1 = width * 3 - bundle24; // 24 bits for (i = 0; i <= height - 1 ; i++) { source = (char *)(fileBuffer + offset + i*show_width * 3 + (over_high/2)*show_width * 3 + (over_width/2) * 3); dst = (char *)(img.startAddr + img.lineBytes * (height - 1 - i)); tmp_source = source; tmp_dst = dst; tmp_phase1 = phase1; tmp_bundle24 = bundle24; ali = 0; // dst not ali if ((int)dst % 4 != 0) { b = *(source); g = *(source + 1); r = *(source + 2); dcolor = rgb2color(r, g, b); *(unsigned short *)(dst) = (unsigned short)dcolor; tmp_dst = dst + 2; tmp_source = source + 3; tmp_phase1 = phase1 - 3; tmp_bundle24 = tmp_phase1 % 24; tmp_phase1 = tmp_phase1 - tmp_bundle24; ali = 1; } // src -> tmp_buffer mem_cpy_alignment(ptr, tmp_source, (width - ali) * 3); if (bits_per_pixel == 16) bit24_to_bit16_ali24 (tmp_dst, ptr, tmp_phase1); else bit24_to_bit16_ali32 (tmp_dst, ptr, tmp_phase1); if (tmp_bundle24) { tmp_offset = 0; source = (char *)(ptr + tmp_phase1); for (j = 0; j < tmp_bundle24 / 3; j++) { b = *(source + tmp_offset); g = *(source + tmp_offset + 1); r = *(source + tmp_offset + 2); dcolor = rgb2color(r, g, b); if (bits_per_pixel == 16) { tmp_dst = dst + (tmp_phase1 / 3) * 2 + j * 2; *(unsigned short *)(tmp_dst) = (unsigned short)dcolor; } else { tmp_dst = dst + (tmp_phase1 / 3) * 4 + j * 4; *(unsigned int *)(tmp_dst) = (unsigned int)dcolor; } tmp_offset += 3; } } offset += bytes; } if( NULL != ptr ) free(ptr); } else { bytes = 4 - (show_width * 3) % 4; if (bytes == 4) bytes = 0; offset = offset + (over_high/2)*show_width * 3 + (over_width/2) * 3; for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { b = *(fileBuffer + offset); g = *(fileBuffer + offset + 1); r = *(fileBuffer + offset + 2); //*getXYData(&img, j, i) = mv_RGB2Color(r,g,b); dcolor = rgb2color(r, g, b); //putcolor2fb(&img, j, i, dcolor); putcolor2mem(s, j + xpos, i + ypos, dcolor); offset += 3; } offset += bytes; offset += over_width * 3; } mem2fb(s, width, height, xpos, ypos); } break; case 16: { //16bit 555 double_width = width * 2; bytes = 4 - width % 4; if (bytes == 4) bytes = 0; if (bitsPerPixel == 16) { for (i = 0; i <= height - 1 ; i++) { // multicopy----------------------------------------------- source = (char *)(fileBuffer + offset + i * double_width); dst = (char *)(img.startAddr + img.lineBytes * (height - 1 - i)); mem_cpy_alignment (dst, source, double_width); //-------------------------------------------------------- } } else { unsigned short color16; bytes = 4 - (width * 2) % 4; if (bytes == 4) bytes = 0; for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { color16 = *(unsigned short *)(fileBuffer + offset); #if ( GUI_RGB_FORMAT == RGB_FORMAT_565) //*getXYData(&img, j, i) = (color16<<1) & 0xFFC0 | (color16 & 0x1F); dcolor = (unsigned int)((((color16 & 0xF800) << 8) & 0x00FF0000) | (((color16 & 0x7E0) << 5) & 0x0000FF00) | (((color16 & 0x1F) << 3) & 0x000000FF)); //putcolor2fb(&img, j, i, dcolor); putcolor2mem(&s_surface[no], j + xpos, i + ypos, dcolor); #else //*getXYData(&img, j, i) = mv_RGB2Color((color16 & 0x7C00) >> 7, (color16 & 0x03E0) >> 2, (color16 & 0x001F) << 3); dcolor = rgb2color((color16 & 0x7C00) >> 7, (color16 & 0x03E0) >> 2, (color16 & 0x001F) << 3); //putcolor2fb(&img, j, i, dcolor); putcolor2mem(&s_surface[no], j + xpos, i + ypos, dcolor); #endif offset += 2; } offset += bytes; } mem2fb(s, width, height, xpos, ypos); } } break; case 8: //256 colormap bytes = 4 - width % 4; if (bytes == 4) bytes = 0; for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { int offSet = *(fileBuffer + offset) * 4; b = colorMap[offSet]; g = colorMap[offSet + 1]; r = colorMap[offSet + 2]; //*getXYData(&img, j, i) = mv_RGB2Color(r,g,b); dcolor = rgb2color(r, g, b); //putcolor2fb(&img, j, i, dcolor); putcolor2mem(&s_surface[no], j + xpos, i + ypos, dcolor); offset ++; } offset += bytes; } mem2fb(s, width, height, xpos, ypos); break; default: break; } return 0; } static void get_display_postion(const mv_surface *s, int disp_width, int disp_height, int *p_x, int *p_y) { int pos_x = 0, pos_y = 0; if(g_display_direction == 0 || g_display_direction == 2) { if (disp_width > s->height) printf("Warning : disp_width(%d) > LCD(%d)\r\n", disp_width, s->height); else pos_x = (s->height - disp_width) / 2; if (disp_height > s->width) printf("Warning : disp_height(%d) > LCD(%d)\r\n", disp_height, s->width); else pos_y = (s->width - disp_height) / 2; } else { if (disp_width > s->width) printf("Warning : disp_width(%d) > LCD(%d)\r\n", disp_width, s->width); else pos_x = (s->width - disp_width) / 2; if (disp_height > s->height) printf("Warning : disp_height(%d) > LCD(%d)\r\n", disp_height, s->height); else pos_y = (s->height - disp_height) / 2; } *p_x = pos_x; *p_y = pos_y; } int init_charge_percent(void) { char *s; s = getenv("wmt.ui.uboot.charging_percent"); if(s && !strcmp(s, "1")) s_display_percent = 1; else s_display_percent = 0; s_percent_val = -1; return 0; } int clear_charge_percent(unsigned char *fileBuffer) { int blank_width, anim_height; mv_Rect rect; int pos_x, pos_y; bmp_header_t *header; unsigned int logo_size; int no; mv_surface *s; if(s_display_percent == 0) return -1; for(no = 0; no < VPP_VOUT_INFO_NUM; no++) { s = &s_surface[no]; if(s->startAddr == 0) continue; if (*fileBuffer != 'B') { //printf("Error : logo is Not BMP Format. Couldn't clear charging percent\n"); //return -1; anim_height = 168; } else { if(!g_tf_boot) { logo_size = (*(unsigned short *)(fileBuffer + 4) << 16) + (*(unsigned short *)(fileBuffer + 2)); fileBuffer = fileBuffer + logo_size; if (*fileBuffer != 'B') { //printf("Error : charge-anim is Not BMP Format. Couldn't clear charging percent\n"); //return -1; anim_height = 168; } else { header = (bmp_header_t *)fileBuffer; anim_height = mv_le_to_cpu((char *)&header->height, 4); anim_height = anim_height / CHARGEANIM_PIC_NUM; } } else { header = (bmp_header_t *)fileBuffer; anim_height = mv_le_to_cpu((char *)&header->height, 4); anim_height = anim_height / CHARGEANIM_PIC_NUM; } } blank_width = 4 * CHAR_WIDTH; // clear 4 char get_display_postion(s, blank_width, anim_height, &pos_x, &pos_y); pos_y = pos_y - CHAR_HEIGHT - CHAR_HEIGHT; if(pos_y < 0) pos_y = 0; rect.left = pos_x; rect.right = pos_x + blank_width; rect.top = pos_y; rect.bottom = pos_y + CHAR_HEIGHT; mv_fillRect(no, &rect, 0, 0, 0); } return 0; } int display_charge_percent(unsigned char *fileBuffer, int percent) { int ret, len; int text_width, anim_height; char tmpbuf[20]; unsigned int rgb = 0xFF00; //green char r, g, b; int pos_x, pos_y; bmp_header_t *header; unsigned int logo_size; int no; mv_surface *s; if(s_display_percent == 0) return -1; if(percent < 0 || percent > 100) return -1; if(percent != s_percent_val) { ret = clear_charge_percent(fileBuffer); if(ret) return ret; s_percent_val = percent; } else return 0; for(no = 0; no < VPP_VOUT_INFO_NUM; no++) { s = &s_surface[no]; if(s->startAddr == 0) continue; if (*fileBuffer != 'B') { //printf("Error : logo is Not BMP Format. Couldn't display charging percent\n"); //return -1; anim_height = 168; } else { if(!g_tf_boot) { logo_size = (*(unsigned short *)(fileBuffer + 4) << 16) + (*(unsigned short *)(fileBuffer + 2)); fileBuffer = fileBuffer + logo_size; if (*fileBuffer != 'B') { //printf("Error : charge-anim is Not BMP Format. Couldn't display charging percent\n"); //return -1; anim_height = 168; } else { header = (bmp_header_t *)fileBuffer; anim_height = mv_le_to_cpu((char *)&header->height, 4); anim_height = anim_height / CHARGEANIM_PIC_NUM; } } else { header = (bmp_header_t *)fileBuffer; anim_height = mv_le_to_cpu((char *)&header->height, 4); anim_height = anim_height / CHARGEANIM_PIC_NUM; } } len = sprintf(tmpbuf, "%d%%", percent); tmpbuf[len] = '\0'; text_width = len * CHAR_WIDTH; get_display_postion(s, text_width, anim_height, &pos_x, &pos_y); pos_y = pos_y - CHAR_HEIGHT - CHAR_HEIGHT; if(pos_y < 0) pos_y = 0; r = (rgb >> 16) & 0xFF; g = (rgb >> 8) & 0xFF; b = rgb & 0xFF; mv_textOut(no, pos_x, pos_y, tmpbuf, r, g, b); } return 0; } static void hint_text(char *p_text, unsigned int rgb) { int xpos, ypos; int len, text_width, text_height; mv_Rect rect; char r, g, b; int no; mv_surface *s; for(no = 0; no < VPP_VOUT_INFO_NUM; no++) { s = &s_surface[no]; if(s->startAddr == 0) continue; len = strlen(p_text); text_width = len * CHAR_WIDTH; text_height = CHAR_HEIGHT; get_display_postion(s, text_width, text_height, &xpos, &ypos); rect.left = xpos; rect.right = xpos + text_width; rect.top = ypos; rect.bottom = ypos + CHAR_HEIGHT; mv_fillRect(no, &rect, 0, 0, 0); r = (rgb >> 16) & 0xFF; g = (rgb >> 8) & 0xFF; b = rgb & 0xFF; mv_textOut(no, xpos, ypos, p_text, r, g, b); } } void show_text_to_screen(char *p_text, unsigned int rgb) { if(!(g_display_vaild & DISPLAY_ENABLE)) { if(display_init(0, 0) == -1) { printf("Display init fail. Don't show_text_to_screen\n"); return; } } mv_clearFB(); hint_text(p_text, rgb); if (g_display_param.vout == VPP_VOUT_LCD) lcd_blt_enable(g_pwm_setting.pwm_no, 1); } void show_text_to_screen_no_backlight(char *p_text, unsigned int rgb) { if(!(g_display_vaild & DISPLAY_ENABLE)) return; mv_clearFB(); hint_text(p_text, rgb); } static void hint_2lines_text(char *p_text1, char *p_text2, unsigned int rgb) { int xpos, ypos; int len, text_width, text_height; mv_Rect rect; char r, g, b; int no; mv_surface *s; for(no = 0; no < 2; no++) { s = &s_surface[no]; if(s->startAddr == 0) continue; if(strlen(p_text1) >= strlen(p_text2)) len = strlen(p_text1); else len = strlen(p_text2); text_width = len * CHAR_WIDTH; text_height = 2 * CHAR_HEIGHT + 10; get_display_postion(s, text_width, text_height, &xpos, &ypos); rect.left = xpos; rect.right = xpos + text_width; rect.top = ypos; rect.bottom = ypos + text_height; mv_fillRect(no, &rect, 0, 0, 0); r = (rgb >> 16) & 0xFF; g = (rgb >> 8) & 0xFF; b = rgb & 0xFF; mv_textOut(no, xpos, ypos, p_text1, r, g, b); mv_textOut(no, xpos, ypos + CHAR_HEIGHT + 10, p_text2, r, g, b); } } void show_2lines_text_to_screen(char *p_text1, char *p_text2, unsigned int rgb) { if(!(g_display_vaild & DISPLAY_ENABLE)) { if(display_init(0, 0) == -1) { printf("Display init fail. Don't show_text_to_screen\n"); return; } } mv_clearFB(); hint_2lines_text(p_text1, p_text2, rgb); if (g_display_param.vout == VPP_VOUT_LCD) lcd_blt_enable(g_pwm_setting.pwm_no, 1); } void show_2lines_text_to_screen_no_backlight(char *p_text1, char *p_text2, unsigned int rgb) { if(!(g_display_vaild & DISPLAY_ENABLE)) return; mv_clearFB(); hint_2lines_text(p_text1, p_text2, rgb); } int show_charge_picture(unsigned char *fileBuffer, int picture_no) { int i, j, bytes; unsigned char r, g, b; bmp_header_t *header; int width, height, offset; short colorBits; //mv_surface img; unsigned int dcolor = 0; int xpos, ypos; unsigned int logo_size; int no; mv_surface *s; unsigned char *buffer; if(!g_tf_boot) { if (*fileBuffer != 'B') { printf("Error : logo is Not BMP Format\n"); if(picture_no == CHARGEANIM_PIC_NUM - 1) hint_text("Low Battery", 0xFFFF00); else hint_text("Charging now ...", 0xFF00); return -1; } logo_size = (*(unsigned short *)(fileBuffer + 4) << 16) + (*(unsigned short *)(fileBuffer + 2)); fileBuffer = fileBuffer + logo_size; if (*fileBuffer != 'B') { printf("Error : charge-anim is Not BMP Format\n"); if(picture_no == CHARGEANIM_PIC_NUM - 1) hint_text("Low Battery", 0xFFFF00); else hint_text("Charging now ...", 0xFF00); return -1; } } else { if (*fileBuffer != 'B') { printf("Error : charge-anim is Not BMP Format\n"); if(picture_no == CHARGEANIM_PIC_NUM - 1) hint_text("Low Battery", 0xFFFF00); else hint_text("Charging now ...", 0xFF00); return -1; } } if(picture_no < 0 || picture_no >= CHARGEANIM_PIC_NUM) { printf("Error : picture no (%d) error\n", picture_no); return -1; } for(no = 0; no < VPP_VOUT_INFO_NUM; no++) { s = &s_surface[no]; if(s->startAddr == 0) continue; buffer = fileBuffer; header = (bmp_header_t *)buffer; colorBits = mv_le_to_cpu((char *)&header->bit_count, 2); if(colorBits != 24) { printf("Error : charge_animation colorBits = %d, current only support 24bits\n", colorBits); return -1; } offset = mv_le_to_cpu((char *)&header->data_offset, 4); width = mv_le_to_cpu((char *)&header->width, 4); height = mv_le_to_cpu((char *)&header->height, 4); height = height / CHARGEANIM_PIC_NUM; get_display_postion(s, width, height, &xpos, &ypos); buffer += (width * height * 3) * (6 - picture_no); switch (colorBits) { case 24: // r,g,b bytes = 4 - (width * 3) % 4; if (bytes == 4) bytes = 0; for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { b = *(buffer + offset); g = *(buffer + offset + 1); r = *(buffer + offset + 2); dcolor = rgb2color(r, g, b); putcolor2mem(s, j + xpos, i + ypos, dcolor); offset += 3; } offset += bytes; } mem2fb(s, width, height, xpos, ypos); break; } } return 0; } static int getGlyphIndex(unsigned short unicode) { int i; GlyphRange *const range = (GlyphRange *)(m_fh + 1); GlyphScatter *start; GlyphScatter *scatter; int low; int high; int mid; int glyphIndex = 1; // == 1 to skip missing lattice for (i = 0 ; i < m_fh->rangeCount; i++) { if ( unicode >= range[i].ucs2Start && unicode <= range[i].ucs2End) { glyphIndex += (unicode - range[i].ucs2Start); return glyphIndex; } glyphIndex += range[i].ucs2End - range[i].ucs2Start + 1; } start = (GlyphScatter *)(range + m_fh->rangeCount); low = 0; high = m_fh->scatterCount - 1; while (low <= high) { mid = (low + high) / 2; scatter = start + mid; if ( *scatter < unicode) low = mid + 1; else if ( *scatter > unicode) high = mid - 1; else return(glyphIndex + mid); } return 0; // the missing glyph } static unsigned char *getLattice(int glyphIndex) { return m_glyphStart + glyphIndex * m_fh->glyphBytes; } static int setFontFileDat(const unsigned char *dat) { FontFileHeadV1 *fh = (FontFileHeadV1 *)dat; if ( fh->magic[0] != 'F' || fh->magic[1] != 'T') { return -1; } m_fileStart = (unsigned char * )dat; m_fh = (FontFileHeadV1 *)m_fileStart; m_glyphStart = m_fileStart + sizeof(FontFileHeadV1) + m_fh->rangeCount * sizeof(GlyphRange) + m_fh->scatterCount * sizeof(GlyphScatter); return 0; } static void loadFontImage(int code, mv_surface *img) { int idx = getGlyphIndex((unsigned short)code); img->width = m_fh->charWidth; img->height = m_fh->charHeight; img->startAddr = (char *)getLattice(idx); } void mv_textOut(int no, int x, int y, const char *string, unsigned char r, unsigned char g, unsigned char b) { mv_surface img; const char *p; const unsigned char *lattice; int h, w; unsigned int textColor = 0; const mv_surface *s = &s_surface[no]; for (p = string; *p != '\0'; p++) { loadFontImage(*p, &img); lattice = (const unsigned char * )img.startAddr; if (!lattice) continue; for ( h = 0 ; h < img.height; ++h) { unsigned char mask = 0x80; for ( w = 0 ; w < img.width; ++w) { if (*lattice & mask) { //*(getXYData(&s_primary, x + w, y + h)) = textColor; textColor = rgb2color(r, g, b); putcolor2fb(s, x + w, y + h, textColor); } mask >>= 1; if ( mask == 0 ) { mask = 0x80; ++lattice; // next byte } } if (mask != 0x80) { ++lattice; // next byte } } x += img.width; } } void mem_cpy_alignment(char *des, char *src, int len) { char *copy_some_src, *copy_some_dst; int dst_alignment = (int)des % 4; int src_alignment = (int)src % 4; int i, tmp_len, len_less, len_less_4_byte; int phase1, phase2; // check dst, src ali // all ali if (!dst_alignment && !src_alignment) { // check len 32bytes ali phase1 = len_less = len % 32; // len ali if(!phase1 && len >= 32) { mem_copy(src, des, len); return; } else { // trans 32bytes ali data first tmp_len = len - len_less; if(len >= 32) mem_copy(src, des, tmp_len); // check len_less 4 bytes ali phase2 = len_less % 4; if(!phase2 && phase2 >= 4) { less_mem_copy(src + tmp_len, des + tmp_len, len_less); return; } else { // trans 4bytes ali data first len_less = len_less - phase2; if(len_less >= 4) less_mem_copy(src + tmp_len, des + tmp_len, len_less); // trans least bytes for (i = 0; i < phase2; i++) *(des + tmp_len + len_less + i) = *(src + tmp_len + len_less + i); return; } } } tmp_len = len; // dst not aligment, let dst alignment first // ==================================================== copy_some_src = (char *)(src); copy_some_dst = (char *)(des); if (dst_alignment != 0) { for (i = 0; i < 4 - dst_alignment; i++) { *(des + i) = *(src + i); // copy len tmp_len = tmp_len - 1; // copy complete if (tmp_len <= 0) return; } // src + bytes of already copy copy_some_src = (char *)(src + ( 4 - dst_alignment)) ; copy_some_dst = (char *)(des + ( 4 - dst_alignment)) ; } src_alignment = (int)copy_some_src % 4; // ==================================================== // handle data len < 32bytes if (tmp_len < 32) { phase1 = len_less = tmp_len % 4; // tmp_len 4bytes ali if (!phase1 && tmp_len >= 4) { switch (src_alignment) { case 1: byte1_less_bundle_copy (copy_some_src - src_alignment, copy_some_dst, tmp_len); break; case 2: byte2_less_bundle_copy (copy_some_src - src_alignment, copy_some_dst, tmp_len); break; case 3: byte3_less_bundle_copy (copy_some_src - src_alignment, copy_some_dst, tmp_len); break; default: less_mem_copy (copy_some_src - src_alignment, copy_some_dst, tmp_len); break; } return; } else { // trans 4bytes ali data first len_less = tmp_len - phase1; if(len_less >= 4) switch (src_alignment) { case 1: byte1_less_bundle_copy (copy_some_src - src_alignment, copy_some_dst, len_less); break; case 2: byte2_less_bundle_copy (copy_some_src - src_alignment, copy_some_dst, len_less); break; case 3: byte3_less_bundle_copy (copy_some_src - src_alignment, copy_some_dst, len_less); break; default: less_mem_copy (copy_some_src - src_alignment, copy_some_dst, len_less); break; } // trans least bytes for (i = 0; i < phase1; i++) *(copy_some_dst + len_less + i) = *(copy_some_src + len_less + i); return; } } // ==================================================== phase1 = tmp_len % 32; // data_len 32bytes ali if (!phase1) { switch (src_alignment) { case 1: byte1_alig_mem_copy (copy_some_src - src_alignment, copy_some_dst, tmp_len); break; case 2: byte2_alig_mem_copy (copy_some_src - src_alignment, copy_some_dst, tmp_len); break; case 3: byte3_alig_mem_copy (copy_some_src - src_alignment, copy_some_dst, tmp_len); break; default: mem_copy (copy_some_src - src_alignment, copy_some_dst, tmp_len); break; } return; } else { len_less = tmp_len - phase1; // trans 32bytes ali data first switch (src_alignment) { case 1: byte1_alig_mem_copy (copy_some_src - src_alignment, copy_some_dst, len_less); break; case 2: byte2_alig_mem_copy (copy_some_src - src_alignment, copy_some_dst, len_less); break; case 3: byte3_alig_mem_copy (copy_some_src - src_alignment, copy_some_dst, len_less); break; default: mem_copy (copy_some_src - src_alignment, copy_some_dst, len_less); break; } phase2 = phase1 % 4; len_less_4_byte = phase1 - phase2; // data_len 4bytes ali if (!phase2) { switch (src_alignment) { case 1: byte1_less_bundle_copy (copy_some_src - src_alignment + len_less, copy_some_dst + len_less, len_less_4_byte); break; case 2: byte2_less_bundle_copy (copy_some_src - src_alignment + len_less, copy_some_dst + len_less, len_less_4_byte); break; case 3: byte3_less_bundle_copy (copy_some_src - src_alignment + len_less, copy_some_dst + len_less, len_less_4_byte); break; default: less_mem_copy (copy_some_src - src_alignment + len_less, copy_some_dst + len_less, len_less_4_byte); break; } return; } else { // trans 4bytes ali data first if(len_less_4_byte >= 4) { switch (src_alignment) { case 1: byte1_less_bundle_copy (copy_some_src - src_alignment + len_less, copy_some_dst + len_less, len_less_4_byte); break; case 2: byte2_less_bundle_copy (copy_some_src - src_alignment + len_less, copy_some_dst + len_less, len_less_4_byte); break; case 3: byte3_less_bundle_copy (copy_some_src - src_alignment + len_less, copy_some_dst + len_less, len_less_4_byte); break; default: less_mem_copy (copy_some_src - src_alignment + len_less, copy_some_dst + len_less, len_less_4_byte); break; } } // trans least bytes for (i = 0; i < phase2; i++) *(copy_some_dst + len_less + len_less_4_byte + i) = *(copy_some_src + len_less + len_less_4_byte + i); return; } } }