fbterm/patches/001-iconv.patch |
1 | | diff -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 |
4 | 3 | if (!strcasecmp(up, down)) return; |
5 | 4 | |
6 | 5 | mCodecRead = iconv_open(up, down); |
... | ... | |
14 | 13 | } |
15 | 14 | |
16 | 15 | #define BUF_SIZE 10240 |
17 | | diff -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 |
19 | 17 | @@ -23,6 +23,7 @@ |
20 | 18 | |
21 | 19 | #include "type.h" |
... | ... | |
25 | 23 | |
26 | 24 | class IoPipe { |
27 | 25 | public: |
28 | | @@ -47,7 +48,7 @@ |
| 26 | @@ -47,7 +48,7 @@ private: |
29 | 27 | void writeIo(s8 *buf, u32 len); |
30 | 28 | |
31 | 29 | s32 mFd; |
fbterm/patches/002-fbterm-1.7-benlcd.patch |
| 1 | Patch to get the fbterm 1.7 display somewhat better the gliphs on the Ben LCD. |
| 2 | |
| 3 | Author: LluĂs Batlle i Rossell |
| 4 | |
| 5 | diff --git a/src/screen_render.cpp b/src/screen_render.cpp |
| 6 | index 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 | \ |