1 diff -u tuxtxt_orig/tuxtxt.c tuxtxt/tuxtxt.c
2 --- tuxtxt_orig/tuxtxt.c 2009-01-29 21:36:31.000000000 +0100
3 +++ tuxtxt/tuxtxt.c 2009-01-29 21:38:42.000000000 +0100
5 * and DBLuelle <dbluelle@blau-weissoedingen.de> *
6 * russian and arabic support by Leonid Protasov <Lprot@mail.ru> *
8 + * ported 2006 to Dreambox 7025 / 32Bit framebuffer *
9 + * by Seddi <seddi@i-have-a-dreambox.com> *
11 + * ported 32Bit framebuffer to Tuxtxt v1.99 (2008) *
12 + * by the PLi team (Sat-Turner) *
14 + * ported to 20090130 *
15 + * by the PLi team (pieterg) *
17 ******************************************************************************/
23 +static char saved_wss[32];
24 +static char saved_pin8[32];
26 +void readproc(const char* source, char *dest)
28 + FILE *f=fopen(source, "rt");
31 + fgets(dest, 255, f);
36 +void writeproc(const char* dest, const char *value)
38 + FILE *f=fopen(dest, "w");
41 + fwrite(value, strlen(value), 1, f);
46 int getIndexOfPageInHotlist()
50 ******************************************************************************/
52 -void plugin_exec(PluginParam *par)
53 +int main(int argc, char **argv)
55 char cvs_revision[] = "$Revision: 1.108 $";
58 #if !TUXTXT_CFG_STANDALONE
59 int initialized = tuxtxt_init();
62 /* show versioninfo */
63 sscanf(cvs_revision, "%*s %s", versioninfo);
64 printf("TuxTxt %s\n", versioninfo);
65 + printf("for 32bpp framebuffer\n");
67 tuxtxt_SetRenderingDefaults(&renderinfo);
69 tuxtxt_cache.vtxtpid = renderinfo.fb = lcd = rc = renderinfo.sx = renderinfo.ex = renderinfo.sy = renderinfo.ey = -1;
72 + printf("\nUSAGE: tuxtxt vtpid\n");
73 + printf("No PID given, so scanning for PIDs ...\n\n");
74 + tuxtxt_cache.vtxtpid=0;
78 + tuxtxt_cache.vtxtpid = atoi(argv[1]);
81 + /* open Framebuffer */
82 + if ((renderinfo.fb=open("/dev/fb0", O_RDWR)) == -1)
84 + perror("TuxTxt <open /dev/fb0>");
92 + sprintf(tmp, "/dev/input/event%d", cnt);
95 + /* open Remote Control */
96 + if ((rc=open(tmp, O_RDONLY)) == -1)
98 + perror("TuxTxt <open remote control>");
101 + if (ioctl(rc, EVIOCGNAME(128), tmp) < 0)
102 + perror("EVIOCGNAME failed");
103 + if (strstr(tmp, "remote control"))
112 + printf("couldnt find correct input device!!!\n");
116 - for (; par; par = par->next)
118 + if ((lcd=open("/dev/dbox/lcd0", O_RDWR)) == -1)
120 - if (!strcmp(par->id, P_ID_VTXTPID))
121 - tuxtxt_cache.vtxtpid = atoi(par->val);
122 - else if (!strcmp(par->id, P_ID_FBUFFER))
123 - renderinfo.fb = atoi(par->val);
124 - else if (!strcmp(par->id, P_ID_LCD))
125 - lcd = atoi(par->val);
126 - else if (!strcmp(par->id, P_ID_RCINPUT))
127 - rc = atoi(par->val);
128 - else if (!strcmp(par->id, P_ID_OFF_X))
129 - renderinfo.sx = atoi(par->val);
130 - else if (!strcmp(par->id, P_ID_END_X))
131 - renderinfo.ex = atoi(par->val);
132 - else if (!strcmp(par->id, P_ID_OFF_Y))
133 - renderinfo.sy = atoi(par->val);
134 - else if (!strcmp(par->id, P_ID_END_Y))
135 - renderinfo.ey = atoi(par->val);
136 + perror("TuxTxt <open /dev/dbox/lcd0>");
140 + renderinfo.previousbackcolor = tuxtxt_color_transp;
141 + renderinfo.zoommode = 0;
142 + renderinfo.sx = 80;
143 + renderinfo.ex = 620;
144 + renderinfo.sy = 30;
145 + renderinfo.ey = 555;
147 if (tuxtxt_cache.vtxtpid == -1 || renderinfo.fb == -1 || rc == -1 || renderinfo.sx == -1 || renderinfo.ex == -1 || renderinfo.sy == -1 || renderinfo.ey == -1)
149 printf("TuxTxt <Invalid Param(s)>\n");
151 int vendor = 3; /* values unknown, rely on requested values */
155 if (vendor < 3) /* scart-parameters only known for 3 dboxes, FIXME: order must be like in info.h */
157 for (i = 0; i < 6; i++) /* FIXME: FBLK seems to cause troubles */
159 perror("TuxTxt <ioctl(avs)>");
163 continue; /* otherwise ignore exit key */
168 else if (1 == sscanf(line, "UseTTF %i", &ival))
169 renderinfo.usettf = ival & 1;
170 + else if (1 == sscanf(line, "StartX %i", &ival))
171 + renderinfo.sx = ival;
172 + else if (1 == sscanf(line, "EndX %i", &ival))
173 + renderinfo.ex = ival;
174 + else if (1 == sscanf(line, "StartY %i", &ival))
175 + renderinfo.sy = ival;
176 + else if (1 == sscanf(line, "EndY %i", &ival))
177 + renderinfo.ey = ival;
185 + readproc("/proc/stb/denc/0/wss", saved_wss);
186 + writeproc("/proc/stb/denc/0/wss", saamodes[renderinfo.screen_mode1]);
188 + readproc("/proc/stb/avs/0/sb", saved_pin8);
189 + writeproc("/proc/stb/avs/0/sb", fncmodes[renderinfo.screen_mode1]);
192 ioctl(rc, RC_IOCTL_BCODES, 1);
195 if (tuxtxt_cache.dmx != -1)
196 close(tuxtxt_cache.dmx);
197 tuxtxt_cache.dmx = -1;
205 int vendor = 3; /* values unknown, rely on requested values */
208 if (vendor < 3) /* scart-parameters only known for 3 dboxes, FIXME: order must be like in info.h */
210 for (i = 1; i < 6; i += 2) /* restore dvb audio */
212 perror("TuxTxt <ioctl(avs)>");
229 @@ -623,10 +718,20 @@
230 fprintf(conf, "ShowLevel2p5 %d\n", renderinfo.showl25);
231 fprintf(conf, "DumpLevel2p5 %d\n", dumpl25);
232 fprintf(conf, "UseTTF %d\n", renderinfo.usettf);
233 + fprintf(conf, "StartX %d\n", renderinfo.sx);
234 + fprintf(conf, "EndX %d\n", renderinfo.ex);
235 + fprintf(conf, "StartY %d\n", renderinfo.sy);
236 + fprintf(conf, "EndY %d\n", renderinfo.ey);
240 tuxtxt_EndRendering(&renderinfo);
242 + /* close framebuffer */
243 + close(renderinfo.fb);
245 + writeproc("/proc/stb/avs/0/sb", saved_pin8);
246 + writeproc("/proc/stb/denc/0/wss", saved_wss);
248 /******************************************************************************
250 @@ -1308,6 +1413,7 @@
251 memset(&menu[Menu_Width*MenuLine[M_COL] + 3+renderinfo.color_mode ], 0x20,24-renderinfo.color_mode);
252 Menu_HighlightLine(menu, MenuLine[menuitem], 1);
253 tuxtxt_setcolors(&renderinfo,(unsigned short *)tuxtxt_defaultcolors, 0, tuxtxt_color_SIZECOLTABLE);
254 + Menu_Init(menu, current_pid, menuitem, hotindex);
258 @@ -1319,6 +1425,7 @@
259 memset(&menu[Menu_Width*MenuLine[M_TRA] + 3+renderinfo.trans_mode ], 0x20,24-renderinfo.trans_mode);
260 Menu_HighlightLine(menu, MenuLine[menuitem], 1);
261 tuxtxt_setcolors(&renderinfo,(unsigned short *)tuxtxt_defaultcolors, 0, tuxtxt_color_SIZECOLTABLE);
262 + Menu_Init(menu, current_pid, menuitem, hotindex);
266 @@ -1421,6 +1528,7 @@
267 memset(&menu[Menu_Width*MenuLine[M_COL] + 3+renderinfo.color_mode ], 0x20,24-renderinfo.color_mode);
268 Menu_HighlightLine(menu, MenuLine[menuitem], 1);
269 tuxtxt_setcolors(&renderinfo,(unsigned short *)tuxtxt_defaultcolors, 0, tuxtxt_color_SIZECOLTABLE);
270 + Menu_Init(menu, current_pid, menuitem, hotindex);
274 @@ -1432,6 +1540,7 @@
275 memset(&menu[Menu_Width*MenuLine[M_TRA] + 3+renderinfo.trans_mode ], 0x20,24-renderinfo.trans_mode);
276 Menu_HighlightLine(menu, MenuLine[menuitem], 1);
277 tuxtxt_setcolors(&renderinfo,(unsigned short *)tuxtxt_defaultcolors, 0, tuxtxt_color_SIZECOLTABLE);
278 + Menu_Init(menu, current_pid, menuitem, hotindex);
282 @@ -1731,8 +1840,8 @@
283 memcpy(&menu[Menu_Width*MenuLine[M_SC1] + Menu_Width - 5], &configonoff[menulanguage][renderinfo.screen_mode1 ? 3 : 0], 3);
284 Menu_HighlightLine(menu, MenuLine[menuitem], 1);
286 - ioctl(renderinfo.avs, AVSIOSSCARTPIN8, &fncmodes[renderinfo.screen_mode1]);
287 - ioctl(renderinfo.saa, SAAIOSWSS, &saamodes[renderinfo.screen_mode1]);
288 + writeproc("/proc/stb/avs/0/sb", fncmodes[renderinfo.screen_mode1]);
289 + writeproc("/proc/stb/denc/0/wss", saamodes[renderinfo.screen_mode1]);
293 @@ -1857,7 +1966,8 @@
296 /* generate pagenumber */
297 - temp_page |= Number << renderinfo.inputcounter*4;
298 + if (renderinfo.inputcounter >= 0)
299 + temp_page |= Number << renderinfo.inputcounter*4;
301 renderinfo.inputcounter--;
303 @@ -2318,8 +2428,8 @@
304 else if (renderinfo.transpmode == 1) /* semi-transparent BG with FG text */
306 /* restore videoformat */
307 - ioctl(renderinfo.avs, AVSIOSSCARTPIN8, &renderinfo.fnc_old);
308 - ioctl(renderinfo.saa, SAAIOSWSS, &renderinfo.saa_old);
309 + writeproc("/proc/stb/avs/0/sb", saved_pin8);
310 + writeproc("/proc/stb/denc/0/wss", saved_wss);
312 tuxtxt_ClearBB(&renderinfo,tuxtxt_color_transp);
313 tuxtxt_cache.pageupdate = 1;
314 @@ -2327,8 +2437,8 @@
317 /* restore videoformat */
318 - ioctl(renderinfo.avs, AVSIOSSCARTPIN8, &renderinfo.fnc_old);
319 - ioctl(renderinfo.saa, SAAIOSWSS, &renderinfo.saa_old);
320 + writeproc("/proc/stb/avs/0/sb", saved_pin8);
321 + writeproc("/proc/stb/denc/0/wss", saved_wss);
323 tuxtxt_ClearFB(&renderinfo,tuxtxt_color_transp);
324 renderinfo.clearbbcolor = tuxtxt_cache.FullScrColor;
325 @@ -2765,8 +2875,8 @@
326 case KEY_VOLUMEDOWN: RCCode = RC_MINUS; break;
327 case KEY_MUTE: RCCode = RC_MUTE; break;
328 case KEY_HELP: RCCode = RC_HELP; break;
329 - case KEY_SETUP: RCCode = RC_DBOX; break;
330 - case KEY_HOME: RCCode = RC_HOME; break;
331 + case KEY_MENU: RCCode = RC_DBOX; break;
332 + case KEY_EXIT: RCCode = RC_HOME; break;
333 case KEY_POWER: RCCode = RC_STANDBY; break;
336 @@ -2794,10 +2904,3 @@
340 -/* Local Variables: */
341 -/* indent-tabs-mode:t */
343 -/* c-basic-offset:3 */
344 -/* comment-column:0 */
345 -/* fill-column:120 */
347 diff -u tuxtxt_orig/tuxtxt.h tuxtxt/tuxtxt.h
348 --- tuxtxt_orig/tuxtxt.h 2008-12-26 19:41:28.000000000 +0100
349 +++ tuxtxt/tuxtxt.h 2009-01-29 21:38:18.000000000 +0100
351 +#ifndef __tuxtxt_h__
352 +#define __tuxtxt_h__
354 /******************************************************************************
355 * <<< TuxTxt - Teletext Plugin >>> *
358 * and DBLuelle <dbluelle@blau-weissoedingen.de> *
359 * russian and arabic support by Leonid Protasov <Lprot@mail.ru> *
361 - ******************************************************************************/
362 + * ported 2006 to Dreambox 7025 / 32Bit framebuffer *
363 + * by Seddi <seddi@i-have-a-dreambox.com> *
365 + * ported 32Bit framebuffer to Tuxtxt v1.99 (2008) *
366 + * by the PLi team (Sat-Turner) *
368 + * ported to 1.106 (2008) *
369 + * by the PLi team (pieterg) *
371 +******************************************************************************/
373 #define TUXTXT_CFG_STANDALONE 0 // 1:plugin only 0:use library
374 #define TUXTXT_DEBUG 0
376 #include <sys/mman.h>
380 #include <dbox/lcd-ks0713.h>
383 @@ -1091,3 +1102,5 @@
384 /* comment-column:0 */
385 /* fill-column:120 */