Date:2012-01-07 21:38:24 (12 years 2 months ago)
Author:kyak
Commit:8389ba08206ab8ab0ee2a65ffbd8514d5e29a8dc
Message:fbterm: incorporate viric's patch for Ben LCD

Files: fbterm/Makefile (1 diff)
fbterm/patches/001-iconv.patch (3 diffs)
fbterm/patches/002-fbterm-1.7-benlcd.patch (1 diff)

Change Details

fbterm/Makefile
55include $(TOPDIR)/rules.mk
66
77PKG_NAME:=fbterm
8PKG_VERSION:=1.6
8PKG_VERSION:=1.7
99PKG_RELEASE:=1
1010
11PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
11PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).0.tar.gz
1212PKG_SOURCE_URL:=http://fbterm.googlecode.com/files/
13PKG_MD5SUM:=531ea0984836b58fd123e6a97a4228c6
13PKG_MD5SUM:=c36bae75a450df0519b4527cccaf7572
1414
1515include $(INCLUDE_DIR)/package.mk
1616include $(INCLUDE_DIR)/nls.mk
fbterm/patches/001-iconv.patch
1diff -ur fbterm-1.6.orig/src/lib/io.cpp fbterm-1.6/src/lib/io.cpp
2+++ fbterm-1.6/src/lib/io.cpp 2011-01-10 14:06:58.512695530 +0300
3@@ -119,10 +119,10 @@
1--- a/src/lib/io.cpp
2@@ -119,10 +119,10 @@ void IoPipe::setCodec(const s8 *up, cons
43     if (!strcasecmp(up, down)) return;
54
65     mCodecRead = iconv_open(up, down);
...... 
1413 }
1514
1615 #define BUF_SIZE 10240
17diff -ur fbterm-1.6.orig/src/lib/io.h fbterm-1.6/src/lib/io.h
18+++ fbterm-1.6/src/lib/io.h 2011-01-10 14:08:33.247605712 +0300
16--- a/src/lib/io.h
1917@@ -23,6 +23,7 @@
2018
2119 #include "type.h"
...... 
2523
2624 class IoPipe {
2725 public:
28@@ -47,7 +48,7 @@
26@@ -47,7 +48,7 @@ private:
2927     void writeIo(s8 *buf, u32 len);
3028
3129     s32 mFd;
fbterm/patches/002-fbterm-1.7-benlcd.patch
1Patch to get the fbterm 1.7 display somewhat better the gliphs on the Ben LCD.
2
3Author: LluĂ­s Batlle i Rossell
4
5diff --git a/src/screen_render.cpp b/src/screen_render.cpp
6index e8f39b8..e0f90e9 100644
7--- a/src/screen_render.cpp
8@@ -195,7 +195,40 @@ void Screen::draw##bits(u32 x, u32 y, u32 w, u8 fc, u8 bc, u8 *pixmap) \
9
10 drawX(15, 5, 5, 5, u16, writew)
11 drawX(16, 5, 6, 5, u16, writew)
12-drawX(32, 8, 8, 8, u32, writel)
13+
14+void Screen::draw32(u32 x, u32 y, u32 w, u8 fc, u8 bc, u8 *pixmap)
15+{
16+ /* This code takes into account the Ben Nanonote LCD, that has the distribution:
17+ * 0: RR GG BB RR GG BB
18+ * 1: GG BB RR GG BB RR
19+ * 2: RR GG BB RR GG BB
20+ * 3: ...
21+ *
22+ * We display the odd rows as 50% green in the current pixel, 50% in the next */
23+ u8 red, green, blue;
24+ u8 pixel;
25+ u32 color;
26+ u32 *dst = (u32 *)(mVMemBase + y * mBytesPerLine + x * bytes_per_pixel);
27+ /* To work with white background, we ensure to paint the first pixel */
28+ u8 prevgreen = mPalette[bc].green/2;
29+
30+ for (; w--; pixmap++, dst++) {
31+ u8 newgreen;
32+ pixel = *pixmap;
33+
34+ red = mPalette[bc].red + (((mPalette[fc].red - mPalette[bc].red) * pixel) >> 8);
35+ newgreen = mPalette[bc].green + (((mPalette[fc].green - mPalette[bc].green) * pixel) >> 8);
36+ blue = mPalette[bc].blue + (((mPalette[fc].blue - mPalette[bc].blue) * pixel) >> 8);
37+
38+ /* width == 0 is the special case for the last byte, where we paint full green.
39+ * That's relevant for white background, like when running 'top'. */
40+ green = ((y & 1) == 0 || w == 0) ? newgreen : (newgreen/2 + prevgreen);
41+ color = (red << 16) | (green << 8) | (blue);
42+ writel(dst, color);
43+ prevgreen = newgreen/2;
44+ }
45+}
46+
47
48 #define drawXBg(bits, lred, lgreen, lblue, type, fbwrite) \
49  \

Archive Download the corresponding diff file



interactive