From d1c5b61cc30e10148cdc51ea581d24f6cb1c6615 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 14 Aug 2012 22:09:32 +0200 Subject: [PATCH] * initial commit --- blockad.c | 232 +++++ blockads.c | 573 +++++++++++ blockads.cfg | 7 + blockads.conf | 31 + blockads.h | 162 +++ gfx.c | 121 +++ gfx.h | 28 + globals.c | 417 ++++++++ globals.h | 58 ++ http.c | 178 ++++ http.h | 27 + io.c | 128 +++ io.h | 33 + lcd.c | 323 ++++++ lcd.h | 67 ++ lcd_font.h | 2598 +++++++++++++++++++++++++++++++++++++++++++++++++ readme.txt | 68 ++ start.c | 53 + text.c | 230 +++++ text.h | 33 + wzops | 103 ++ 21 files changed, 5470 insertions(+) create mode 100644 blockad.c create mode 100644 blockads.c create mode 100644 blockads.cfg create mode 100644 blockads.conf create mode 100644 blockads.h create mode 100644 gfx.c create mode 100644 gfx.h create mode 100644 globals.c create mode 100644 globals.h create mode 100644 http.c create mode 100644 http.h create mode 100644 io.c create mode 100644 io.h create mode 100644 lcd.c create mode 100644 lcd.h create mode 100644 lcd_font.h create mode 100644 readme.txt create mode 100644 start.c create mode 100644 text.c create mode 100644 text.h create mode 100755 wzops diff --git a/blockad.c b/blockad.c new file mode 100644 index 0000000..1776c6d --- /dev/null +++ b/blockad.c @@ -0,0 +1,232 @@ +/* + * $Id: blockad.c,v 1.0 2010/04/25 18:00:00 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "globals.h" +#ifdef HAVE_DBOX_HARDWARE +#include "lcd.h" +#endif +#include "http.h" + +/****************************************************************************** + * Blockad Main + ******************************************************************************/ + +int main (void) +{ +int loop=0, werbung=0, tnet=-1,blit=0,cnum=-1,tv,wflag=1,runtime=0, mut=0, vol=0, tmin=15; +char tstr[40],zapchan[40],msgchan[40]; +FILE *fh1; +time_t t1,t2,t3,t4; + + printf("Blockad Version %s\n",P_VERSION); + + if (!ReadConf()) + { + printf("Blockad \n"); + } + else + { + if((fh1=fopen(FLG_FILE,"r"))!=NULL) + { + if(fgets(zapchan, sizeof(zapchan), fh1)) + { + Trim_String(zapchan); + if(fgets(tstr, sizeof(tstr), fh1)) + { + sscanf(tstr,"%d",&cnum); + if(fgets(tstr, sizeof(tstr), fh1)) + { + sscanf(tstr,"%d",&rezap); + if(fgets(msgchan, sizeof(msgchan), fh1)) + { + Trim_String(msgchan); + } + else + { + sprintf(msgchan,"Unbekannt"); + } + if(fgets(tstr, sizeof(tstr), fh1)) + { + if(sscanf(tstr,"%d",&vol)==1) + { + if(volume) + { + if(fgets(tstr, sizeof(tstr), fh1)) + { + if(sscanf(tstr,"%d",&mut)!=1) + { + mut=0; + } + } + } + } + } + if(fgets(tstr, sizeof(tstr), fh1)) + { + if(sscanf(tstr,"%d",&tmin)!=1) + { + tmin=15; + } + } + } + } + else + { + rezap=420; + } + loop=1; + if(cnum<0) + { + inet=-1; + } + } + fclose(fh1); + } + time(&t1); + t4=t3=t1; +#ifdef HAVE_DBOX_HARDWARE + LCD_Init(); +#endif + if(inet>=0) + { + if(Open_Socket()==-1) + { + inet=-1; + } + } + while(loop) + { + time(&t2); + if(inet>=0) + { + tnet=-1; + if(inet>=0) + { + tv=Check_Socket(cnum,&werbung); + if(!werbung) + { + if((t2-t4)>tmin) + { + Do_Rezap(zapchan,vol,mut); + loop=0; + } + } + else + { + t4=t2; + } + if(tv>=0) + { + tnet=inet; + } + } + inet=tnet; + } + if(loop) + { + if((fh1=fopen(FLG_FILE,"r"))!=NULL) + { + fclose(fh1); + if(inet>=0) + { + if(wflag) + { + fh1=fopen(STS_FILE,"w"); + fprintf(fh1,"%s\n",msgchan); + fprintf(fh1,"Auto\n"); + fclose(fh1); + wflag=0; + } + if(t3!=t2) + { + sprintf(tstr,"%s",(blit^=1)?" ":" WZ"); +#ifdef HAVE_DBOX_HARDWARE + LCD_Read(); + LCD_draw_string(97, 13, tstr); + LCD_update(); +#endif + t3=t2; + } + sleep(1); + } + else + { + runtime=t2-t1; + if(runtime>rezap) + { + Do_Rezap(zapchan,vol,mut); + loop=0; + } + else + { + if(t3!=t2) + { + runtime=rezap-runtime; + sprintf(tstr,"%2d:%02d",runtime/60,runtime%60); + fh1=fopen(STS_FILE,"w"); + fprintf(fh1,"%s\n",msgchan); + fprintf(fh1,"%s\n",tstr); + fclose(fh1); +#ifdef HAVE_DBOX_HARDWARE + LCD_Read(); + LCD_draw_string(81, 13, tstr); + LCD_update(); +#endif + sleep(1); + t3=t2; + } + } + } + } + else + { + loop=0; + } + } + } + } +#ifdef HAVE_DBOX_HARDWARE + LCD_Close(); +#endif + if(inet>=0) + { + Close_Socket(); + } + sprintf(tstr,"cd /tmp\nrm blockads.*"); + system(tstr); + + return 0; +} + diff --git a/blockads.c b/blockads.c new file mode 100644 index 0000000..6083590 --- /dev/null +++ b/blockads.c @@ -0,0 +1,573 @@ +/* + * $Id: blockads.c,v 1.0 2010/04/25 18:00:00 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#include +#include +#include "blockads.h" +#include "gfx.h" +#include "io.h" +#include "text.h" +#include "http.h" +#include "globals.h" + +// CMCST, CMCS, CMCT, CMC, CMCIT, CMCI, CMHT, CMH +// WHITE, BLUE0, TRANSP, CMS, ORANGE, GREEN, YELLOW, RED + +unsigned char bl[] = {0x00, 0x00, 0xFF, 0x80, 0xFF, 0x80, 0x00, 0x80, + 0xFF, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00}; +unsigned char gn[] = {0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xC0, 0x00, + 0xFF, 0x80, 0x00, 0x80, 0xC0, 0xFF, 0xFF, 0x00}; +unsigned char rd[] = {0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, + 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xFF}; +unsigned char tr[] = {0xFF, 0xFF, 0xFF, 0xA0, 0xFF, 0xA0, 0xFF, 0xFF, + 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; + +static unsigned char menucoltxt[][25]={"Content_Selected_Text","Content_Selected","Content_Text","Content","Content_inactive_Text","Content_inactive","Head_Text","Head"}; + +struct fb_fix_screeninfo fix_screeninfo; +struct fb_var_screeninfo var_screeninfo; +int fb, rc; +int startx, starty, sx, ex, sy, ey; +int radius=10; +char msgchan[40]; +unsigned char *lfb, *lbb; + +static void ShowInfo(int index) +{ + int loop, tind; + char tstr[512]; + int ixw=240, iyw=300, dy, my, offs=10, soffs=3; + + dy=iyw/12; + my=2*dy; + + startx = sx + (((ex-sx) - ixw)/2); + starty = sy + (((ey-sy) - iyw)/2); + + tind=index; + + //frame layout + RenderBox(0, 0, ixw, iyw, radius, CMC); +// RenderBox(0, 0, ixw, iyw, GRID, CMCS, radius); + + // titlebar + RenderBox(2, 2, ixw-2, dy+2*soffs, radius, CMH); + + //selectbar + RenderBox(2, offs+soffs+(index+1)*dy, ixw, offs+soffs+(index+2)*dy, radius, CMCS); + + RenderString("Rezap-Zeit", 0, dy, ixw, CENTER, MED, CMHT); + + for(loop = 0; loop < 10; ++loop) + { + sprintf(tstr,"%1d =",(loop<9)?(loop+1):0); + RenderString(tstr, 10, offs+my, 40, CENTER, MED, (loop == tind)?CMCST:CMCT); + sprintf(tstr,"%2d min",wtime[loop]); + RenderString(tstr, 40, offs+my, ixw-60, RIGHT, MED, (loop == tind)?CMCST:CMCT); + my += dy; + } + + //copy backbuffer to framebuffer + memcpy(lfb, lbb, fix_screeninfo.line_length*var_screeninfo.yres); +} + +void Start_NoInet(char *chan) +{ +int ztim=30,cindex=0,cloop=1,found=0; +char nstr[128],sstr[50],*nptr; +FILE *fh; + + cindex=rezap-1; + if(cindex<0) + { + cindex=0; + } + if(cindex>9) + { + cindex=9; + } + + ShowInfo(cindex); + + do{ + //rcm=-1; + switch(/*(rcm = */GetRCCode()) + { + case RC_1: + cindex=0; + cloop=0; + break; + + case RC_2: + cindex=1; + cloop=0; + break; + + case RC_3: + cindex=2; + cloop=0; + break; + + case RC_4: + cindex=3; + cloop=0; + break; + + case RC_5: + cindex=4; + cloop=0; + break; + + case RC_6: + cindex=5; + cloop=0; + break; + + case RC_7: + cindex=6; + cloop=0; + break; + + case RC_8: + cindex=7; + cloop=0; + break; + + case RC_9: + cindex=8; + cloop=0; + break; + + case RC_0: + cindex=9; + cloop=0; + break; + + case RC_UP: + case RC_MINUS: --cindex; + break; + + case RC_DOWN: + case RC_PLUS: ++cindex; + break; + + case RC_OK: + cloop=0; + break; + + case RC_HOME: + cloop=-1; + break; + + case RC_BLUE: + cindex=rezap-1; + if(cindex<0) + { + cindex=0; + } + if(cindex>9) + { + cindex=9; + } + cloop=0; + break; + + case RC_MUTE: break; + + case RC_STANDBY: break; + + default: continue; + } + + if (cindex>=10) + { + cindex=0; + } + if(cindex<0) + { + cindex=9; + } + + ShowInfo(cindex); + + } while(cloop>0); + + if(cloop==0) + { + ztim=60*wtime[cindex]; + if((fh=fopen(FLG_FILE,"w"))!=NULL) + { + fprintf(fh,"%s\n-1\n%d\n%s\n%d\n%d\n%d\n",chan,ztim,msgchan,volume,mute,debounce); + fclose(fh); + system("/bin/blockad &"); + if((fh=fopen(CFG_FILE, "r"))!=NULL) + { + sprintf(sstr,"ZapChan%1d=",cindex); + while(!found && fgets(nstr, sizeof(nstr), fh)) + { + if(strstr(nstr,sstr)==nstr) + { + Trim_String(nstr); + nptr=strchr(nstr,'='); + ++nptr; + if(strlen(nptr)) + { + strncpy(sstr,nptr,sizeof(sstr)); + found=1; + } + } + } + fclose(fh); + } + if(found) + { + Do_Zap(sstr); + sprintf(nstr,"Umgeschaltet auf %s.\nAutomatische Rückschaltung in %d:00 min.",sstr,ztim/60); + } + else + { + sprintf(nstr,"Sie können jetzt umschalten.\nAutomatische Rückschaltung in %d:00 min.",ztim/60); + } + Msg_Popup(nstr); + } + } +} + +/****************************************************************************** + * Blockads Main + ******************************************************************************/ +int main (void) +{ +int loop=0,found,werbung=0,tnet, tv, cnum=-1, index; +char tstr[512],line_buffer[512],zapchan[40],srcchan[40],*cpt1=NULL; +FILE *fh1,*fh2; + + printf("Blockads Version %s\n",P_VERSION); + + sx = ex = sy = ey = -1; + + if((fh1=fopen(FLG_FILE,"r"))==NULL) + { +// system("ping -c 5 google.com &"); + fb = open(FB_DEVICE, O_RDWR); +// rc = open(RC_DEVICE, O_RDONLY); +// fcntl(rc, F_SETFL, (fcntl(rc, F_GETFL) | O_EXCL) & ~O_NONBLOCK); + InitRC(); + + read_neutrino_osd_conf ( &ex,&sx,&ey, &sy); + if ( ( ex == -1 ) || ( sx == -1 ) || ( ey == -1 ) || ( sy == -1 ) ) + { + sx = 100; + ex = 1180; + sy = 100; + ey = 620; + } + + for(index=CMCST; index<=CMH; index++) + { + sprintf(tstr,"menu_%s_alpha",menucoltxt[index]); + if((tv=Read_Neutrino_Cfg(tstr))>=0) + tr[index]=255-(float)tv*2.55; + + sprintf(tstr,"menu_%s_blue",menucoltxt[index]); + if((tv=Read_Neutrino_Cfg(tstr))>=0) + bl[index]=(float)tv*2.55; + + sprintf(tstr,"menu_%s_green",menucoltxt[index]); + if((tv=Read_Neutrino_Cfg(tstr))>=0) + gn[index]=(float)tv*2.55; + + sprintf(tstr,"menu_%s_red",menucoltxt[index]); + if((tv=Read_Neutrino_Cfg(tstr))>=0) + rd[index]=(float)tv*2.55; + } + + if(Read_Neutrino_Cfg("rounded_corners")>0) + radius=10; + else + radius=0; + + + //init framebuffer + if(ioctl(fb, FBIOGET_FSCREENINFO, &fix_screeninfo) == -1) + { + perror("Blockads \n"); + return -1; + } + if(ioctl(fb, FBIOGET_VSCREENINFO, &var_screeninfo) == -1) + { + perror("Blockads \n"); + return -1; + } + + if(!(lfb = (unsigned char*)mmap(0, fix_screeninfo.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fb, 0))) + { + perror("Blockads \n"); + return -1; + } + + //init fontlibrary + + if((error = FT_Init_FreeType(&library))) + { + printf("Blockads ", error); + munmap(lfb, fix_screeninfo.smem_len); + return -1; + } + + if((error = FTC_Manager_New(library, 1, 2, 0, &MyFaceRequester, NULL, &manager))) + { + printf("Blockads \n", error); + FT_Done_FreeType(library); + munmap(lfb, fix_screeninfo.smem_len); + return -1; + } + + if((error = FTC_SBitCache_New(manager, &cache))) + { + printf("Blockads \n", error); + FTC_Manager_Done(manager); + FT_Done_FreeType(library); + munmap(lfb, fix_screeninfo.smem_len); + return -1; + } + + if((error = FTC_Manager_LookupFace(manager, FONT, &face))) + { + if((error = FTC_Manager_LookupFace(manager, FONT2, &face))) + { + printf("Blockads \n", error); + FTC_Manager_Done(manager); + FT_Done_FreeType(library); + munmap(lfb, fix_screeninfo.smem_len); + return 2; + } + else + desc.face_id = FONT2; + } + else + desc.face_id = FONT; + + use_kerning = FT_HAS_KERNING(face); + + desc.flags = FT_LOAD_MONOCHROME; + + //init backbuffer + if(!(lbb = malloc(fix_screeninfo.line_length*var_screeninfo.yres))) + { + perror("Blockads \n"); + FTC_Manager_Done(manager); + FT_Done_FreeType(library); + munmap(lfb, fix_screeninfo.smem_len); + return -1; + } + + //memset(lbb, TRANSP, var_screeninfo.xres*var_screeninfo.yres); + memset(lbb, 0, fix_screeninfo.line_length*var_screeninfo.yres); + + if (!ReadConf()) + { + printf("Blockads \n"); + return -1; + } + found=0; + loop=0; + if(!HTTP_downloadFile("localhost",80,"/control/channellist", LST_FILE, 0, 1)) + { + if(!HTTP_downloadFile("localhost",80,"/control/zapto", ZAP_FILE, 0, 1)) + { + if((fh1=fopen(ZAP_FILE,"r"))!=NULL) + { + while((fgets(line_buffer, sizeof(line_buffer), fh1)>0) && (strlen(line_buffer)<4)); + if(strlen(line_buffer)>1) + { + Trim_String(line_buffer); + strcpy(zapchan,line_buffer); + if((fh2=fopen(LST_FILE,"r"))!=NULL) + { + while(!found && (fgets(line_buffer, sizeof(line_buffer), fh2))) + { + if(strstr(line_buffer,zapchan)==line_buffer) + { + if((cpt1=strchr(line_buffer,' '))!=NULL) + { + cpt1++; + Trim_String(cpt1); + strcpy(msgchan,cpt1); + loop=1; + if(!Translate_Channel(cpt1, tstr)) + { + cnum=Get_ChannelNumber(tstr); + strcpy(srcchan,tstr); + found=1; + } + } + } + } + if(!found) + { + inet=-1; + } + fclose(fh2); + } + } + fclose(fh1); + } + } + } + if(!loop) + { + sprintf(tstr,"Fehler beim Auslesen der Kanalliste.\nPlugin konnte nicht gestartet werden."); + Msg_Popup(tstr); + return -1; + } + if(volume) + { + volume=0; + if(!HTTP_downloadFile("localhost",80,"/control/volume?status", ZAP_FILE, 0, 1)) + { + if((fh1=fopen(ZAP_FILE,"r"))!=NULL) + { + while((fgets(line_buffer, sizeof(line_buffer), fh1)>0) && !strlen(line_buffer)); + if(strlen(line_buffer)>=1) + { + Trim_String(line_buffer); + sscanf(line_buffer,"%d",&mute); + } + fclose(fh1); + } + } + if(!HTTP_downloadFile("localhost",80,"/control/volume", ZAP_FILE, 0, 1)) + { + if((fh1=fopen(ZAP_FILE,"r"))!=NULL) + { + while((fgets(line_buffer, sizeof(line_buffer), fh1)>0) && !strlen(line_buffer)); + if(strlen(line_buffer)>=1) + { + Trim_String(line_buffer); + sscanf(line_buffer,"%d",&volume); + } + fclose(fh1); + } + } + } + if(inet>=0) + { + tnet=-1; + if(Open_Socket()!=-1) + { + tv=Check_Socket(cnum,&werbung); + if(tv>0) + { + tnet=inet; + if(!werbung) + { + if(!zapalways) + { + int adf=0; + + sprintf(tstr,"Für Kanal %s wird\nmomentan keine Werbung gemeldet.\nWerbung läuft im Augenblick auf:\n",msgchan); + for(tv=0; tv +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include FT_FREETYPE_H +#include FT_CACHE_H +#include FT_CACHE_SMALL_BITMAPS_H +/* tested with freetype 2.3.9, and 2.1.4 */ +#if FREETYPE_MAJOR >= 2 && FREETYPE_MINOR >= 3 +#define FT_NEW_CACHE_API +#endif + +//#include "color.h" + +//rc codes + +#define RC1_0 0x5C00 +#define RC1_1 0x5C01 +#define RC1_2 0x5C02 +#define RC1_3 0x5C03 +#define RC1_4 0x5C04 +#define RC1_5 0x5C05 +#define RC1_6 0x5C06 +#define RC1_7 0x5C07 +#define RC1_8 0x5C08 +#define RC1_9 0x5C09 +#define RC1_STANDBY 0x5C0C +#define RC1_UP 0x5C0E +#define RC1_DOWN 0x5C0F +#define RC1_PLUS 0x5C16 +#define RC1_MINUS 0x5C17 +#define RC1_HOME 0x5C20 +#define RC1_DBOX 0x5C27 +#define RC1_MUTE 0x5C28 +#define RC1_RED 0x5C2D +#define RC1_RIGHT 0x5C2E +#define RC1_LEFT 0x5C2F +#define RC1_OK 0x5C30 +#define RC1_BLUE 0x5C3B +#define RC1_YELLOW 0x5C52 +#define RC1_GREEN 0x5C55 +#define RC1_HELP 0x5C82 + +#define RC_0 0x00 +#define RC_1 0x01 +#define RC_2 0x02 +#define RC_3 0x03 +#define RC_4 0x04 +#define RC_5 0x05 +#define RC_6 0x06 +#define RC_7 0x07 +#define RC_8 0x08 +#define RC_9 0x09 +#define RC_RIGHT 0x0A +#define RC_LEFT 0x0B +#define RC_UP 0x0C +#define RC_DOWN 0x0D +#define RC_OK 0x0E +#define RC_MUTE 0x0F +#define RC_STANDBY 0x10 +#define RC_GREEN 0x11 +#define RC_YELLOW 0x12 +#define RC_RED 0x13 +#define RC_BLUE 0x14 +#define RC_PLUS 0x15 +#define RC_MINUS 0x16 +#define RC_HELP 0x17 +#define RC_DBOX 0x18 +#define RC_HOME 0x1F + +//freetype stuff + +#define FONT2 "/share/fonts/pakenham.ttf" +// if font is not in usual place, we look here: +#define FONT "/share/fonts/neutrino.ttf" + +enum {FILL, GRID}; +enum {LEFT, CENTER, RIGHT}; +enum {SMALL, MED, BIG}; +enum {FT_PIC=1, FT_TEXT, FT_HTML, FT_TXHTM}; + +enum {CMCST, CMCS, CMCT, CMC, CMCIT, CMCI, CMHT, CMH, WHITE, BLUE1, GTRANSP, CMS, ORANGE, GREEN, YELLOW, RED}; +#define TRANSP 0 + + +FT_Error error; +FT_Library library; +FTC_Manager manager; +FTC_SBitCache cache; +FTC_SBit sbit; +#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR == 0 +FTC_Image_Desc desc; +#else +FTC_ImageTypeRec desc; +#endif +FT_Face face; +FT_UInt prev_glyphindex; +FT_Bool use_kerning; + +//devs + +extern int fb; + +//framebuffer stuff + +extern unsigned char *lfb, *lbb; +extern unsigned char rd[], gn[], bl[], tr[]; + +extern struct fb_fix_screeninfo fix_screeninfo; +extern struct fb_var_screeninfo var_screeninfo; + +extern int startx, starty, sx, ex, sy, ey; +extern unsigned char *proxyadress, *proxyuserpwd; + + +#define FB_DEVICE "/dev/fb/0" +/* +#if HAVE_DVB_API_VERSION < 3 +#define RC_DEVICE "/dev/dbox/rc0" +#else +#define RC_DEVICE "/dev/input/event0" +#endif +*/ + +#endif diff --git a/gfx.c b/gfx.c new file mode 100644 index 0000000..5023939 --- /dev/null +++ b/gfx.c @@ -0,0 +1,121 @@ +/* + * $Id: gfx.c,v 1.0 2010/04/25 18:00:00 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#include "blockads.h" + +/****************************************************************************** + * RenderBox + ******************************************************************************/ + +void RenderBox(int sx, int sy, int ex, int ey, int rad, int col) +{ + int F,R=rad,ssx=startx+sx,ssy=starty+sy,dxx=ex-sx,dyy=ey-sy,rx,ry,wx,wy,count; + + unsigned char *pos=(lbb+(ssx<<2)+fix_screeninfo.line_length*ssy); + unsigned char *pos0, *pos1, *pos2, *pos3, *i; + unsigned char pix[4]={bl[col],gn[col],rd[col],tr[col]}; + + if (dxx<0) + { + printf("[Blockads] RenderBox called with dx < 0 (%d)\n", dxx); + dxx=0; + } + + if(R) + { + if(--dyy<=0) + { + dyy=1; + } + + if(R==1 || R>(dxx/2) || R>(dyy/2)) + { + R=dxx/10; + F=dyy/10; + if(R>F) + { + if(R>(dyy/3)) + { + R=dyy/3; + } + } + else + { + R=F; + if(R>(dxx/3)) + { + R=dxx/3; + } + } + } + ssx=0; + ssy=R; + F=1-R; + + rx=R-ssx; + ry=R-ssy; + + pos0=pos+((dyy-ry)*fix_screeninfo.line_length); + pos1=pos+(ry*fix_screeninfo.line_length); + pos2=pos+(rx*fix_screeninfo.line_length); + pos3=pos+((dyy-rx)*fix_screeninfo.line_length); + while (ssx <= ssy) + { + rx=R-ssx; + ry=R-ssy; + wx=rx<<1; + wy=ry<<1; + + for(i=pos0+(rx<<2); i +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +//#include +#include "globals.h" +#include "http.h" + +static char channels[NUM_CHANNELS][10]={"DSF","VOX","RTL","Pro7","ARD","9Live","Super RTL","Sat.1","EuroSport","NTV","Kabel 1","RTL II"}; + +int rezap=180, inet=-1, zapalways=0, volume=0, mute=0, debounce=15; +int socket_nummer; +int laenge; +int ergebnis; +int anzahl; +int i,nf=0; +struct sockaddr_in adresse; +char empfangene_zeichen[550]; +fd_set readset, writeset; +struct timeval to; +int timo=100000; +unsigned short int portnummer = 5450; +char ip_adresse[] = "217.160.185.104"; +int cnum=-1; +int wtime[10]={1,2,3,4,5,6,7,8,9,10}; + +int Get_ChannelNumber(char *chan) +{ +int rv=-1, i; + + for(i=0; rv==-1 && i=0) && (chan =buffer) && (*cptr<' ')) + { + *cptr=0; + --cptr; + } +} + +void read_neutrino_osd_conf(int *ex, int *sx, int *ey, int *sy) +{ + const char *filename="/var/tuxbox/config/neutrino.conf"; + const char spres[][5]={"","_crt","_lcd"}; + char sstr[4][32]; + int pres=-1, loop, *sptr[4]={ex, sx, ey, sy}; + char *buffer; + size_t len; + ssize_t read; + FILE* fd; + + fd = fopen(filename, "r"); + if(fd){ + buffer=NULL; + len = 0; + while ((read = getline(&buffer, &len, fd)) != -1){ + sscanf(buffer, "screen_preset=%d", &pres); + } + if(buffer) + free(buffer); + rewind(fd); + ++pres; + sprintf(sstr[0], "screen_EndX%s=%%d", spres[pres]); + sprintf(sstr[1], "screen_StartX%s=%%d", spres[pres]); + sprintf(sstr[2], "screen_EndY%s=%%d", spres[pres]); + sprintf(sstr[3], "screen_StartY%s=%%d", spres[pres]); + + buffer=NULL; + len = 0; + while ((read = getline(&buffer, &len, fd)) != -1){ + for(loop=0; loop<4; loop++) { + sscanf(buffer, sstr[loop], sptr[loop]); + } + } + fclose(fd); + if(buffer) + free(buffer); + } +} + +int Read_Neutrino_Cfg(char *entry) +{ +FILE *nfh; +char tstr [512], *cfptr=NULL; +int rv=-1; + + if((nfh=fopen(NCF_FILE,"r"))!=NULL) + { + tstr[0]=0; + + while((!feof(nfh)) && ((strstr(tstr,entry)==NULL) || ((cfptr=strchr(tstr,'='))==NULL))) + { + fgets(tstr,500,nfh); + } + if(!feof(nfh) && cfptr) + { + ++cfptr; + if(sscanf(cfptr,"%d",&rv)!=1) + { + rv=-1; + } + } + fclose(nfh); + } + return rv; +} + +int ReadConf() +{ + int i,j; + FILE *fd_conf; + char line_buffer[512],tstr[20]; + char *cptr; + + //open config + if(!(fd_conf = fopen(CFG_FILE, "r"))) + { + printf("Blockads \n"); + return 0; + } + + while(fgets(line_buffer, sizeof(line_buffer), fd_conf)) + { + Trim_String(line_buffer); + if((line_buffer[0]) && (line_buffer[0]!='#') && (line_buffer[0]>' ') && ((cptr=strchr(line_buffer,'='))!=NULL)) + { + for(i=0; i<10; i++) + { + sprintf(tstr,"Time%1d=",(i<9)?(i+1):0); + if(strstr(line_buffer,tstr) != NULL) + { + if(sscanf(cptr+1,"%d",&j)==1) + { + if(j>0 && j<100) + { + wtime[i]=j; + } + } + } + } + if(strstr(line_buffer,"RezapTime") != NULL) + { + sscanf(cptr+1,"%d",&rezap); + } + if(strstr(line_buffer,"ZapAlways") != NULL) + { + sscanf(cptr+1,"%d",&zapalways); + } + if(strstr(line_buffer,"KeepVolume") != NULL) + { + sscanf(cptr+1,"%d",&volume); + } + if(strstr(line_buffer,"Debounce") != NULL) + { + sscanf(cptr+1,"%d",&debounce); + } + if(strstr(line_buffer,"Internet") != NULL) + { + if(strstr(cptr+1,"DSL")!=NULL) + { + inet=0; + } + if(strstr(cptr+1,"ISDN")!=NULL) + { + inet=1; + } + if(strstr(cptr+1,"ANALOG")!=NULL) + { + inet=2; + } + } + } + } + fclose(fd_conf); + return 1; +} + +void Msg_Popup(char *msg) +{ +char mstr[512]="/control/message?popup=", *mptr=msg, *pptr; + + while(*mptr) + { + pptr=mstr+strlen(mstr); + switch (*mptr) + { + case ' ': sprintf(pptr,"%%20"); break; + case 10 : sprintf(pptr,"%%0A"); break; + case 13 : break; + case 'Ä': sprintf(pptr,"%%C3%%84"); break; + case 'Ö': sprintf(pptr,"%%C3%%96"); break; + case 'Ü': sprintf(pptr,"%%C3%%9C"); break; + case 'ä': sprintf(pptr,"%%C3%%A4"); break; + case 'ö': sprintf(pptr,"%%C3%%B6"); break; + case 'ü': sprintf(pptr,"%%C3%%BC"); break; + case 'ß': sprintf(pptr,"%%C3%%9F"); break; + default : sprintf(pptr,"%c",*mptr); break; + } + ++mptr; + } + HTTP_downloadFile("127.0.0.1",80, mstr, MSG_FILE, 0, 1); +} + + +int Translate_Channel(char *source, char *target) +{ +int rv=-1,found=0; +FILE *tfh; +char trstr[512],*pt1=NULL,*pt2=NULL; + + *target=0; + if((tfh=fopen(CFG_FILE,"r"))!=NULL) + { + while(!found && (fgets(trstr, sizeof(trstr), tfh))) + { + Trim_String(trstr); + if((strstr(trstr,"Programm=")==trstr) && ((pt1=strchr(trstr,'='))!=NULL) && ((pt2=strchr(pt1+1,','))!=NULL)) + { + pt1++; + *pt2=0; + pt2++; + if(strcmp(source,pt2)==0) + { + strcpy(target,pt1); + found=1; + rv=0; + } + } + } + fclose(tfh); + } + return rv; +} + +void Do_Zap(char *chan) +{ +char zstr[50]; + + sprintf(zstr,"pzapit -n \"%s\"",chan); + system(zstr); +} + +void Do_Rezap(char *chan, int vol, int mut) +{ +char zstr[150]; +FILE *fh1; +int avol, amut; + + if(!HTTP_downloadFile("localhost",80,"/control/volume?status", ZAP_FILE, 0, 1)) + { + if((fh1=fopen(ZAP_FILE,"r"))!=NULL) + { + while((fgets(zstr, sizeof(zstr), fh1)>0) && !strlen(zstr)); + if(strlen(zstr)>=1) + { + Trim_String(zstr); + sscanf(zstr,"%d",&amut); + } + fclose(fh1); + } + } + if(!HTTP_downloadFile("localhost",80,"/control/volume", ZAP_FILE, 0, 1)) + { + if((fh1=fopen(ZAP_FILE,"r"))!=NULL) + { + while((fgets(zstr, sizeof(zstr), fh1)>0) && !strlen(zstr)); + if(strlen(zstr)>=1) + { + Trim_String(zstr); + sscanf(zstr,"%d",&avol); + } + fclose(fh1); + } + } + sprintf(zstr,"/control/zapto?%s",chan); + HTTP_downloadFile("localhost", 80, zstr, MSG_FILE, 0, 1); + if(volume) + { +/* sprintf(zstr,"pzapit -%s",(mut)?"mute":"unmute"); + system(zstr); + sprintf(zstr,"pzapit -vol %d",vol); + system(zstr); +*/ + if(mut!=amut) + { + sprintf(zstr,"/control/volume?%s",(mut)?"mute":"unmute"); + HTTP_downloadFile("localhost",80,zstr, "/dev/null/", 0, 1); + } + if(vol!=avol) + { + sprintf(zstr,"/control/volume?%d",vol); + HTTP_downloadFile("localhost",80,zstr, "/dev/null/", 0, 1); + } + } + remove(FLG_FILE); +} diff --git a/globals.h b/globals.h new file mode 100644 index 0000000..212995d --- /dev/null +++ b/globals.h @@ -0,0 +1,58 @@ +/* + * $Id: globals.h,v 1.0 2010/04/25 18:00:00 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#ifndef __GLOBALS_H__ +#define __GLOBALS_H__ + + +#define P_VERSION "0.78" + +#define ADS_FILE "/tmp/blockads.ads" +#define ZAP_FILE "/tmp/blockads.zap" +#define LST_FILE "/tmp/blockads.lst" +#define FLG_FILE "/tmp/blockads.flg" +#define MSG_FILE "/tmp/blockads.msg" +#define STS_FILE "/tmp/blockads.sts" +#define CFG_FILE "/var/tuxbox/config/blockads.conf" +#define NCF_FILE "/var/tuxbox/config/neutrino.conf" +#define NUM_CHANNELS 12 + + +extern int rezap, inet, zapalways, volume, mute, debounce; +extern int wtime[10]; + +void read_neutrino_osd_conf(int *ex, int *sx, int *ey, int *sy); +int Read_Neutrino_Cfg(char *entry); +int ReadConf(); +void Msg_Popup(char *msg); +void Trim_String(char *buffer); +int Translate_Channel(char *source, char *target); +int Get_ChannelNumber(char *chan); +char *Get_ChannelName(int chan); +void Do_Rezap(char *chan, int vol, int mut); +void Do_Zap(char *chan); + +int Open_Socket(void); +void Close_Socket(void); +int Check_Socket(int channel, int *state); +int Check_Channel(int channel, int *state); + +#endif diff --git a/http.c b/http.c new file mode 100644 index 0000000..8ee6132 --- /dev/null +++ b/http.c @@ -0,0 +1,178 @@ +/* + * $Id: http.c,v 1.0 2010/04/25 18:00:00 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include "blockads.h" + +int HTTP_downloadFile(char *host, int port, char *page, char *downloadTarget, int tmo, int repeats) +{ + char tstr[256]; + + sprintf(tstr,"wget -Y off -q -O %s http://%s:%d%s",downloadTarget,host,port,page); + system(tstr); + return 0; +} + +/* +int HTTP_downloadFile(char *host, int port, char *page, char *downloadTarget, int tmo, int repeats) +{ + int socket_nummer; + int laenge; + int ergebnis,nf; + int anzahl=0; + struct hostent *hp; + fd_set readset, writeset; + struct sockaddr_in adresse; + char buf[65535],*wptr=NULL,*tptr=NULL; + struct timeval to; + int timo=100000; + FILE *fh; + + to.tv_sec = timo / 100000; + to.tv_usec = ( timo - ( to.tv_sec * 100000 ) ) * 10; + + if(( hp = gethostbyname( host )) != NULL ) + { + memcpy( &adresse.sin_addr.s_addr, hp->h_addr_list[0], sizeof(adresse.sin_addr.s_addr)); + } + else + { + perror(" unknown Host\n"); + return -1; + } + + sprintf(buf,"%03d.%03d.%03d.%03d",(unsigned char)hp->h_addr_list[0][0],(unsigned char)hp->h_addr_list[0][1],(unsigned char)hp->h_addr_list[0][2],(unsigned char)hp->h_addr_list[0][3]); + *buf=0; + + socket_nummer = socket(AF_INET, SOCK_STREAM, 0); + + adresse.sin_family = AF_INET; + adresse.sin_port = htons(port); + laenge = sizeof(adresse); + + ergebnis = connect(socket_nummer, (struct sockaddr *)&adresse, laenge); + + if (ergebnis == -1) + { + perror(" Keine Verbindung erfolgt: "); + return -1; + } + else + + { + + sprintf(buf,"GET %s HTTP/1.1\r\nHost: DBOX\r\n\r\n",page); + + anzahl = write(socket_nummer, buf, strlen(buf)+1); + + *buf=0; + laenge=0; + + nf=anzahl=1; + while(nf>0 && anzahl>0) + { + FD_ZERO( &readset ); + FD_ZERO( &writeset ); + FD_SET( socket_nummer, &readset ); + + if(( nf = select( socket_nummer + 1, &readset, &writeset, NULL, &to )) < 0 ) + { + printf("Socket error\n"); + return -1; + } + if(nf>0) + { + anzahl = read(socket_nummer, buf+laenge, 65534-laenge); + if(anzahl>0) + { + laenge+=anzahl; + } + } + } + anzahl=laenge; + buf[anzahl]= '\0'; + + if (strstr(buf,"200 OK") != NULL) + { + if((fh=fopen(downloadTarget,"w"))!=NULL) + { + if((wptr=strstr(buf,"Content-Type: text/html"))!=NULL) + { + wptr=strstr(buf,""); + } + else + { + if((wptr=strstr(buf,"Content-Type: text/plain"))!=NULL) + { + if((wptr=strchr(wptr,10))!=NULL) + { + wptr++; + if((wptr=strchr(wptr,10))!=NULL) + { + wptr++; + } + } + } + else + { + wptr=buf; + } + } + if(wptr) + { + if((tptr=strstr(buf,"Content-Length:"))!=NULL) + { + wptr=strchr(tptr,0x0A)+3; + } + fwrite(wptr, strlen(buf)-(wptr-buf), 1, fh); + } + fclose(fh); + if(!wptr) + { + remove(downloadTarget); + } + } + } + else + { + perror("\n Der Server hat die Datei nicht gesendet"); + } + } + + close(socket_nummer); + + return anzahl==0 || !wptr; +} +*/ diff --git a/http.h b/http.h new file mode 100644 index 0000000..f9fd6f8 --- /dev/null +++ b/http.h @@ -0,0 +1,27 @@ +/* + * $Id: http.h,v 1.1 2010/03/03 20:47:03 rhabarber1848 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#ifndef __HTTP_H__ +#define __HTTP_H__ + +int HTTP_downloadFile(char *host, int port, char *page, char *downloadTarget, int tmo, int repeats); + +#endif diff --git a/io.c b/io.c new file mode 100644 index 0000000..fbe2861 --- /dev/null +++ b/io.c @@ -0,0 +1,128 @@ +/* + * $Id: io.c,v 1.0 2010/04/25 18:00:00 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#include "io.h" +#include "blockads.h" + +struct input_event ev; +static unsigned short rccode=-1; +static int rc; + +int InitRC(void) +{ + rc = open(RC_DEVICE, O_RDONLY); + if(rc == -1) + { + perror("Blockads "); + exit(1); + } + fcntl(rc, F_SETFL, O_NONBLOCK | O_SYNC); + while(RCKeyPressed()); + return 1; +} + +int CloseRC(void) +{ + while(RCKeyPressed()); + close(rc); + return 1; +} + +int RCKeyPressed(void) +{ + if(read(rc, &ev, sizeof(ev)) == sizeof(ev)) + { + if(ev.value) + { + rccode=ev.code; + return 1; + } + } + rccode = -1; + return 0; +} + +int GetRCCode() +{ +#define REPEAT_TIMER 3 + static int count = 0; + static __u16 rc_last_key = KEY_RESERVED; + //get code + + if(read(rc, &ev, sizeof(ev)) == sizeof(ev)) + { + if(ev.value > 0 && ev.code != rc_last_key) + { + if ( ev.value == 2 ) + { + while ( count < REPEAT_TIMER ) + { + count++; + rccode = -1; + usleep(15000L); + return rccode; + } + } + else + count = 0; + + rc_last_key = ev.code; + switch(ev.code) + { + case KEY_UP: rccode = RC_UP; break; + case KEY_DOWN: rccode = RC_DOWN; break; + case KEY_LEFT: rccode = RC_LEFT; break; + case KEY_RIGHT: rccode = RC_RIGHT; break; + case KEY_OK: rccode = RC_OK; break; + case KEY_0: rccode = RC_0; break; + case KEY_1: rccode = RC_1; break; + case KEY_2: rccode = RC_2; break; + case KEY_3: rccode = RC_3; break; + case KEY_4: rccode = RC_4; break; + case KEY_5: rccode = RC_5; break; + case KEY_6: rccode = RC_6; break; + case KEY_7: rccode = RC_7; break; + case KEY_8: rccode = RC_8; break; + case KEY_9: rccode = RC_9; break; + case KEY_RED: rccode = RC_RED; break; + case KEY_GREEN: rccode = RC_GREEN; break; + case KEY_YELLOW: rccode = RC_YELLOW; break; + case KEY_BLUE: rccode = RC_BLUE; break; + case KEY_VOLUMEUP: rccode = RC_PLUS; break; + case KEY_VOLUMEDOWN: rccode = RC_MINUS; break; + case KEY_MUTE: rccode = RC_MUTE; break; + case KEY_HELP: rccode = RC_HELP; break; + case KEY_SETUP: rccode = RC_DBOX; break; + case KEY_EXIT: rccode = RC_HOME; break; + case KEY_POWER: rccode = RC_STANDBY;break; + default: rccode = -1; + } + return rccode; + } + else + { + rccode = -1; + rc_last_key = KEY_RESERVED; + } + } + return -1; +} + diff --git a/io.h b/io.h new file mode 100644 index 0000000..61b93f8 --- /dev/null +++ b/io.h @@ -0,0 +1,33 @@ +/* + * $Id: io.h,v 1.0 2010/04/25 18:00:00 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#ifndef __IO_H__ + +#define __IO_H__ + +#define RC_DEVICE "/dev/input/nevis_ir" + +int InitRC(void); +int CloseRC(void); +int RCKeyPressed(void); +int GetRCCode(); + +#endif diff --git a/lcd.c b/lcd.c new file mode 100644 index 0000000..ecb0407 --- /dev/null +++ b/lcd.c @@ -0,0 +1,323 @@ +/* + * $Id: lcd.c,v 1.1 2010/03/03 20:47:03 rhabarber1848 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#include "lcd.h" +#include "lcd_font.h" + +static unsigned char raw[132][64]; +static unsigned char rawb[132][64]; +static unsigned char lcd[LCD_ROWS][LCD_COLS]; +static int fd=-1; +static unsigned char iconBasePath[512]; + +void LCD_Read(void) +{ +int x,y,z; +char tmp2; + + memset(raw,0,132*64); + read(fd, &lcd, 120*64/8); + for(x=0;x < LCD_COLS;x++) + { + for(y=0;y < LCD_ROWS; y++) + { + tmp2 = lcd[y][x]; + for(z=0;z <= 7;z++) + { + if(tmp2 & (1<=0) + { + close(fd); + fd=-1; + } + return 0; +} + +int LCD_invalid_col (int x) +{ + if( x > LCD_COLS ) + return -1; + if( x < 0 ) + return -1; + return 0; +} + +int LCD_invalid_row (int y) +{ + if( y > LCD_ROWS * 8 ) + return -1; + if( y < 0) + return -1; + return 0; +} + +void LCD_convert_data () +{ + int x,y,z; + char tmp2; + for(x=0;x < LCD_COLS;x++) { + for(y=0;y < LCD_ROWS;y++) { + tmp2 = 0; + for(z=0;z <= 7;z++) { + if(raw[x][y * 8 + z] == 1){ + tmp2|=1<0) + return 1; + return 0; +} + + +void LCD_draw_point (int x,int y, int state) +{ + if(state == LCD_PIXEL_INV) + { + if(raw[x][y] == LCD_PIXEL_ON) + raw[x][y] = LCD_PIXEL_OFF; + else + raw[x][y] = LCD_PIXEL_ON; + } + else + raw[x][y] = state; +} + + +/* + * draw_line + * + * args: + * x1 StartCol + * y1 StartRow + * x2 EndCol + * y1 EndRow + * state LCD_PIXEL_OFF/LCD_PIXEL_ON/LCD_PIXEL_INV + * + */ + +int abs(int val) +{ + return (val<0)?(-val):val; +} + +void LCD_draw_line (int x1, int y1, int x2, int y2, int state) +{ + int dx,dy,sdx,sdy,px,py,dxabs,dyabs,i; + float slope; + + if(LCD_invalid_col(x1) || LCD_invalid_col(x2)) + return; + + if(LCD_invalid_row(y1) || LCD_invalid_row(y2)) + return; + + dx=x2-x1; + dy=y2-y1; + dxabs=abs(dx); + dyabs=abs(dy); + sdx=LCD_sgn(dx); + sdy=LCD_sgn(dy); + if (dxabs>=dyabs) /* the line is more horizontal than vertical */ { + slope=(float)dy / (float)dx; + for(i=0;i!=dx;i+=sdx) { + px=i+x1; + py=(int)( slope*i+y1 ); + LCD_draw_point(px,py,state); + } + } + else /* the line is more vertical than horizontal */ { + slope=(float)dx / (float)dy; + for(i=0;i!=dy;i+=sdy) { + px=(int)(slope*i+x1); + py=i+y1; + LCD_draw_point(px,py,state); + } + } +} + + +void LCD_draw_fill_rect (int left,int top,int right,int bottom,int state) { + int x,y; + for(x = left + 1;x < right;x++) { + for(y = top + 1;y < bottom;y++) { + LCD_draw_point(x,y,state); + } + } +} + + +void LCD_draw_rectangle (int left,int top, int right, int bottom, int linestate,int fillstate) +{ + + if(LCD_invalid_col(left) || LCD_invalid_col(right)) + return; + + if(LCD_invalid_row(top) || LCD_invalid_row(bottom)) + return; + + LCD_draw_line(left,top,right,top,linestate); + LCD_draw_line(left,top,left,bottom,linestate); + LCD_draw_line(right,top,right,bottom,linestate); + LCD_draw_line(left,bottom,right,bottom,linestate); + LCD_draw_fill_rect(left,top,right,bottom,fillstate); +} + + +void LCD_draw_polygon(int num_vertices, int *vertices, int state) +{ + + //todo: mhh i think checking some coords. would be nice + + int i; + for(i=0;i> 8) | ((width & 0x00ff) << 8); + height=((height & 0xff00) >> 8) | ((height & 0x00ff) << 8); + + unsigned char pixbuf[200]; + for (count=0; count> 1 ); + unsigned char *pixpos = (unsigned char*) &pixbuf; + for (count2=0; count2> 1; count2 ++ ) + { + unsigned char compressed = *pixpos; + unsigned char pix1 = (compressed & 0xf0) >> 4; + unsigned char pix2 = (compressed & 0x0f); + + if (pix1 == col) + LCD_draw_point(x+(count2<<1),y+count, PIXEL_ON); + else + LCD_draw_point (x+(count2<<1),y+count, PIXEL_OFF); + if (pix2 == col) + LCD_draw_point(x+(count2<<1)+1,y+count, PIXEL_ON); + else + LCD_draw_point (x+(count2<<1)+1,y+count, PIXEL_OFF); + pixpos++; + } + } + + close(fd); +} diff --git a/lcd.h b/lcd.h new file mode 100644 index 0000000..09f8af7 --- /dev/null +++ b/lcd.h @@ -0,0 +1,67 @@ +/* + * $Id: lcd.h,v 1.1 2010/03/03 20:47:03 rhabarber1848 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#ifndef __lcddisplay__ +#define __lcddisplay__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +enum + { + PIXEL_ON = LCD_PIXEL_ON, + PIXEL_OFF = LCD_PIXEL_OFF, + PIXEL_INV = LCD_PIXEL_INV + }; + + int LCD_Init(void); + void LCD_Clear(void); + int LCD_Close(void); + + int LCD_invalid_col(int x); + int LCD_invalid_row(int y); + void LCD_convert_data(); + int LCD_sgn(int arg); + void LCD_setIconBasePath(char *base); + void LCD_update(); + void LCD_Read(void); + + void LCD_draw_point (int x,int y, int state); + void LCD_draw_line (int x1, int y1, int x2, int y2, int state); + void LCD_draw_fill_rect (int left,int top,int right,int bottom,int state); + void LCD_draw_rectangle (int left,int top, int right, int bottom, int linestate,int fillstate); + void LCD_draw_polygon(int num_vertices, int *vertices, int state); + void LCD_draw_char(int x, int y, char c); + void LCD_draw_string(int x, int y, char *string); + + void LCD_paintIcon(unsigned char *filename, int x, int y, int col); + +#endif diff --git a/lcd_font.h b/lcd_font.h new file mode 100644 index 0000000..e5d6bf8 --- /dev/null +++ b/lcd_font.h @@ -0,0 +1,2598 @@ +/* + * $Id: lcd_font.h,v 1.1 2010/03/03 20:47:03 rhabarber1848 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#define FONTDATAMAX 2048 + +static unsigned char font[FONTDATAMAX] = { + + /* 0 0x00 '^@' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 1 0x01 '^A' */ + 0x7e, /* XXXXXX */ + 0x81, /* X X */ + 0xa5, /* X X X X */ + 0x81, /* X X */ + 0xbd, /* X XXXX X */ + 0x99, /* X XX X */ + 0x81, /* X X */ + 0x7e, /* XXXXXX */ + + /* 2 0x02 '^B' */ + 0x7e, /* XXXXXX */ + 0xff, /* XXXXXXXX */ + 0xdb, /* XX XX XX */ + 0xff, /* XXXXXXXX */ + 0xc3, /* XX XX */ + 0xe7, /* XXX XXX */ + 0xff, /* XXXXXXXX */ + 0x7e, /* XXXXXX */ + + /* 3 0x03 '^C' */ + 0x6c, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xfe, /* XXXXXXX */ + 0xfe, /* XXXXXXX */ + 0x7c, /* XXXXX */ + 0x38, /* XXX */ + 0x10, /* X */ + 0x00, /* */ + + /* 4 0x04 '^D' */ + 0x10, /* X */ + 0x38, /* XXX */ + 0x7c, /* XXXXX */ + 0xfe, /* XXXXXXX */ + 0x7c, /* XXXXX */ + 0x38, /* XXX */ + 0x10, /* X */ + 0x00, /* */ + + /* 5 0x05 '^E' */ + 0x38, /* XXX */ + 0x7c, /* XXXXX */ + 0x38, /* XXX */ + 0xfe, /* XXXXXXX */ + 0xfe, /* XXXXXXX */ + 0xd6, /* XX X XX */ + 0x10, /* X */ + 0x38, /* XXX */ + + /* 6 0x06 '^F' */ + 0x10, /* X */ + 0x38, /* XXX */ + 0x7c, /* XXXXX */ + 0xfe, /* XXXXXXX */ + 0xfe, /* XXXXXXX */ + 0x7c, /* XXXXX */ + 0x10, /* X */ + 0x38, /* XXX */ + + /* 7 0x07 '^G' */ + 0x00, /* */ + 0x00, /* */ + 0x18, /* XX */ + 0x3c, /* XXXX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0x00, /* */ + 0x00, /* */ + + /* 8 0x08 '^H' */ + 0xff, /* XXXXXXXX */ + 0xff, /* XXXXXXXX */ + 0xe7, /* XXX XXX */ + 0xc3, /* XX XX */ + 0xc3, /* XX XX */ + 0xe7, /* XXX XXX */ + 0xff, /* XXXXXXXX */ + 0xff, /* XXXXXXXX */ + + /* 9 0x09 '^I' */ + 0x00, /* */ + 0x3c, /* XXXX */ + 0x66, /* XX XX */ + 0x42, /* X X */ + 0x42, /* X X */ + 0x66, /* XX XX */ + 0x3c, /* XXXX */ + 0x00, /* */ + + /* 10 0x0a '^J' */ + 0xff, /* XXXXXXXX */ + 0xc3, /* XX XX */ + 0x99, /* X XX X */ + 0xbd, /* X XXXX X */ + 0xbd, /* X XXXX X */ + 0x99, /* X XX X */ + 0xc3, /* XX XX */ + 0xff, /* XXXXXXXX */ + + /* 11 0x0b '^K' */ + 0x0f, /* XXXX */ + 0x07, /* XXX */ + 0x0f, /* XXXX */ + 0x7d, /* XXXXX X */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0x78, /* XXXX */ + + /* 12 0x0c '^L' */ + 0x3c, /* XXXX */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + + /* 13 0x0d '^M' */ + 0x3f, /* XXXXXX */ + 0x33, /* XX XX */ + 0x3f, /* XXXXXX */ + 0x30, /* XX */ + 0x30, /* XX */ + 0x70, /* XXX */ + 0xf0, /* XXXX */ + 0xe0, /* XXX */ + + /* 14 0x0e '^N' */ + 0x7f, /* XXXXXXX */ + 0x63, /* XX XX */ + 0x7f, /* XXXXXXX */ + 0x63, /* XX XX */ + 0x63, /* XX XX */ + 0x67, /* XX XXX */ + 0xe6, /* XXX XX */ + 0xc0, /* XX */ + + /* 15 0x0f '^O' */ + 0x18, /* XX */ + 0xdb, /* XX XX XX */ + 0x3c, /* XXXX */ + 0xe7, /* XXX XXX */ + 0xe7, /* XXX XXX */ + 0x3c, /* XXXX */ + 0xdb, /* XX XX XX */ + 0x18, /* XX */ + + /* 16 0x10 '^P' */ + 0x80, /* X */ + 0xe0, /* XXX */ + 0xf8, /* XXXXX */ + 0xfe, /* XXXXXXX */ + 0xf8, /* XXXXX */ + 0xe0, /* XXX */ + 0x80, /* X */ + 0x00, /* */ + + /* 17 0x11 '^Q' */ + 0x02, /* X */ + 0x0e, /* XXX */ + 0x3e, /* XXXXX */ + 0xfe, /* XXXXXXX */ + 0x3e, /* XXXXX */ + 0x0e, /* XXX */ + 0x02, /* X */ + 0x00, /* */ + + /* 18 0x12 '^R' */ + 0x18, /* XX */ + 0x3c, /* XXXX */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + + /* 19 0x13 '^S' */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x00, /* */ + 0x66, /* XX XX */ + 0x00, /* */ + + /* 20 0x14 '^T' */ + 0x7f, /* XXXXXXX */ + 0xdb, /* XX XX XX */ + 0xdb, /* XX XX XX */ + 0x7b, /* XXXX XX */ + 0x1b, /* XX XX */ + 0x1b, /* XX XX */ + 0x1b, /* XX XX */ + 0x00, /* */ + + /* 21 0x15 '^U' */ + 0x3e, /* XXXXX */ + 0x61, /* XX X */ + 0x3c, /* XXXX */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x3c, /* XXXX */ + 0x86, /* X XX */ + 0x7c, /* XXXXX */ + + /* 22 0x16 '^V' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0x7e, /* XXXXXX */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + + /* 23 0x17 '^W' */ + 0x18, /* XX */ + 0x3c, /* XXXX */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0xff, /* XXXXXXXX */ + + /* 24 0x18 '^X' */ + 0x18, /* XX */ + 0x3c, /* XXXX */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 25 0x19 '^Y' */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 26 0x1a '^Z' */ + 0x00, /* */ + 0x18, /* XX */ + 0x0c, /* XX */ + 0xfe, /* XXXXXXX */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + 0x00, /* */ + + /* 27 0x1b '^[' */ + 0x00, /* */ + 0x30, /* XX */ + 0x60, /* XX */ + 0xfe, /* XXXXXXX */ + 0x60, /* XX */ + 0x30, /* XX */ + 0x00, /* */ + 0x00, /* */ + + /* 28 0x1c '^\' */ + 0x00, /* */ + 0x00, /* */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xfe, /* XXXXXXX */ + 0x00, /* */ + 0x00, /* */ + + /* 29 0x1d '^]' */ + 0x00, /* */ + 0x24, /* X X */ + 0x66, /* XX XX */ + 0xff, /* XXXXXXXX */ + 0x66, /* XX XX */ + 0x24, /* X X */ + 0x00, /* */ + 0x00, /* */ + + /* 30 0x1e '^^' */ + 0x00, /* */ + 0x18, /* XX */ + 0x3c, /* XXXX */ + 0x7e, /* XXXXXX */ + 0xff, /* XXXXXXXX */ + 0xff, /* XXXXXXXX */ + 0x00, /* */ + 0x00, /* */ + + /* 31 0x1f '^_' */ + 0x00, /* */ + 0xff, /* XXXXXXXX */ + 0xff, /* XXXXXXXX */ + 0x7e, /* XXXXXX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0x00, /* */ + 0x00, /* */ + + /* 32 0x20 ' ' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 33 0x21 '!' */ + 0x18, /* XX */ + 0x3c, /* XXXX */ + 0x3c, /* XXXX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0x00, /* */ + 0x18, /* XX */ + 0x00, /* */ + + /* 34 0x22 '"' */ + 0x6c, /* XX XX */ + 0x6c, /* XX XX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 35 0x23 '#' */ + 0x6c, /* XX XX */ + 0x6c, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0x6c, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0x6c, /* XX XX */ + 0x6c, /* XX XX */ + 0x00, /* */ + + /* 36 0x24 '$' */ + 0x18, /* XX */ + 0x3e, /* XXXXX */ + 0x60, /* XX */ + 0x3c, /* XXXX */ + 0x06, /* XX */ + 0x7c, /* XXXXX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 37 0x25 '%' */ + 0x00, /* */ + 0xc6, /* XX XX */ + 0xcc, /* XX XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x66, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 38 0x26 '&' */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0x68, /* XX X */ + 0x76, /* XXX XX */ + 0xdc, /* XX XXX */ + 0xcc, /* XX XX */ + 0x76, /* XXX XX */ + 0x00, /* */ + + /* 39 0x27 ''' */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 40 0x28 '(' */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x30, /* XX */ + 0x30, /* XX */ + 0x18, /* XX */ + 0x0c, /* XX */ + 0x00, /* */ + + /* 41 0x29 ')' */ + 0x30, /* XX */ + 0x18, /* XX */ + 0x0c, /* XX */ + 0x0c, /* XX */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x00, /* */ + + /* 42 0x2a '*' */ + 0x00, /* */ + 0x66, /* XX XX */ + 0x3c, /* XXXX */ + 0xff, /* XXXXXXXX */ + 0x3c, /* XXXX */ + 0x66, /* XX XX */ + 0x00, /* */ + 0x00, /* */ + + /* 43 0x2b '+' */ + 0x00, /* */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + 0x00, /* */ + + /* 44 0x2c ',' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + + /* 45 0x2d '-' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 46 0x2e '.' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 47 0x2f '/' */ + 0x03, /* XX */ + 0x06, /* XX */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x60, /* XX */ + 0xc0, /* XX */ + 0x00, /* */ + + /* 48 0x30 '0' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xde, /* XX XXXX */ + 0xfe, /* XXXXXXX */ + 0xf6, /* XXXX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 49 0x31 '1' */ + 0x18, /* XX */ + 0x78, /* XXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 50 0x32 '2' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x60, /* XX */ + 0xfe, /* XXXXXXX */ + 0x00, /* */ + + /* 51 0x33 '3' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0x06, /* XX */ + 0x1c, /* XXX */ + 0x06, /* XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 52 0x34 '4' */ + 0x1c, /* XXX */ + 0x3c, /* XXXX */ + 0x6c, /* XX XX */ + 0xcc, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0x0c, /* XX */ + 0x0c, /* XX */ + 0x00, /* */ + + /* 53 0x35 '5' */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0xfc, /* XXXXXX */ + 0x06, /* XX */ + 0x06, /* XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 54 0x36 '6' */ + 0x38, /* XXX */ + 0x60, /* XX */ + 0xc0, /* XX */ + 0xfc, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 55 0x37 '7' */ + 0xfe, /* XXXXXXX */ + 0x06, /* XX */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x60, /* XX */ + 0x60, /* XX */ + 0x00, /* */ + + /* 56 0x38 '8' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 57 0x39 '9' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7e, /* XXXXXX */ + 0x06, /* XX */ + 0x0c, /* XX */ + 0x38, /* XXX */ + 0x00, /* */ + + /* 58 0x3a ':' */ + 0x00, /* */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + 0x00, /* */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 59 0x3b ';' */ + 0x00, /* */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + 0x00, /* */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + + /* 60 0x3c '<' */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x60, /* XX */ + 0x30, /* XX */ + 0x18, /* XX */ + 0x0c, /* XX */ + 0x00, /* */ + + /* 61 0x3d '=' */ + 0x00, /* */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + 0x00, /* */ + + /* 62 0x3e '>' */ + 0x30, /* XX */ + 0x18, /* XX */ + 0x0c, /* XX */ + 0x06, /* XX */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x00, /* */ + + /* 63 0x3f '?' */ + 0x3c, /* XXXX */ + 0x66, /* XX XX */ + 0x06, /* XX */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + 0x18, /* XX */ + 0x00, /* */ + + /* 64 0x40 '@' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xde, /* XX XXXX */ + 0xde, /* XX XXXX */ + 0xde, /* XX XXXX */ + 0xc0, /* XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 65 0x41 'A' */ + 0x10, /* X */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 66 0x42 'B' */ + 0xfc, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xfc, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xfc, /* XXXXXX */ + 0x00, /* */ + + /* 67 0x43 'C' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 68 0x44 'D' */ + 0xfc, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xfc, /* XXXXXX */ + 0x00, /* */ + + /* 69 0x45 'E' */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xf8, /* XXXXX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xfe, /* XXXXXXX */ + 0x00, /* */ + + /* 70 0x46 'F' */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xf8, /* XXXXX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0x00, /* */ + + /* 71 0x47 'G' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc0, /* XX */ + 0xce, /* XX XXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 72 0x48 'H' */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 73 0x49 'I' */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + + /* 74 0x4a 'J' */ + 0x06, /* XX */ + 0x06, /* XX */ + 0x06, /* XX */ + 0x06, /* XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 75 0x4b 'K' */ + 0xc6, /* XX XX */ + 0xcc, /* XX XX */ + 0xd8, /* XX XX */ + 0xf0, /* XXXX */ + 0xd8, /* XX XX */ + 0xcc, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 76 0x4c 'L' */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xfe, /* XXXXXXX */ + 0x00, /* */ + + /* 77 0x4d 'M' */ + 0x82, /* X X */ + 0xc6, /* XX XX */ + 0xee, /* XXX XXX */ + 0xfe, /* XXXXXXX */ + 0xd6, /* XX X XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 78 0x4e 'N' */ + 0xc6, /* XX XX */ + 0xe6, /* XXX XX */ + 0xf6, /* XXXX XX */ + 0xde, /* XX XXXX */ + 0xce, /* XX XXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 79 0x4f 'O' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 80 0x50 'P' */ + 0xfc, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xfc, /* XXXXXX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0x00, /* */ + + /* 81 0x51 'Q' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xf6, /* XXXX XX */ + 0xde, /* XX XXXX */ + 0x7c, /* XXXXX */ + 0x06, /* XX */ + + /* 82 0x52 'R' */ + 0xfc, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xfc, /* XXXXXX */ + 0xd8, /* XX XX */ + 0xcc, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 83 0x53 'S' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0x60, /* XX */ + 0x38, /* XXX */ + 0x0c, /* XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 84 0x54 'T' */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 85 0x55 'U' */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 86 0x56 'V' */ + 0xc3, /* XX XX */ + 0xc3, /* XX XX */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x3c, /* XXXX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 87 0x57 'W' */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xd6, /* XX X XX */ + 0xfe, /* XXXXXXX */ + 0xee, /* XXX XXX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 88 0x58 'X' */ + 0xc3, /* XX XX */ + 0x66, /* XX XX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0x3c, /* XXXX */ + 0x66, /* XX XX */ + 0xc3, /* XX XX */ + 0x00, /* */ + + /* 89 0x59 'Y' */ + 0xc3, /* XX XX */ + 0xc3, /* XX XX */ + 0x66, /* XX XX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 90 0x5a 'Z' */ + 0xfe, /* XXXXXXX */ + 0x06, /* XX */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x60, /* XX */ + 0xfe, /* XXXXXXX */ + 0x00, /* */ + + /* 91 0x5b '[' */ + 0x3c, /* XXXX */ + 0x30, /* XX */ + 0x30, /* XX */ + 0x30, /* XX */ + 0x30, /* XX */ + 0x30, /* XX */ + 0x3c, /* XXXX */ + 0x00, /* */ + + /* 92 0x5c '\' */ + 0xc0, /* XX */ + 0x60, /* XX */ + 0x30, /* XX */ + 0x18, /* XX */ + 0x0c, /* XX */ + 0x06, /* XX */ + 0x03, /* XX */ + 0x00, /* */ + + /* 93 0x5d ']' */ + 0x3c, /* XXXX */ + 0x0c, /* XX */ + 0x0c, /* XX */ + 0x0c, /* XX */ + 0x0c, /* XX */ + 0x0c, /* XX */ + 0x3c, /* XXXX */ + 0x00, /* */ + + /* 94 0x5e '^' */ + 0x10, /* X */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 95 0x5f '_' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0xfe, /* XXXXXXX */ + + /* 96 0x60 '`' */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x0c, /* XX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 97 0x61 'a' */ + 0x00, /* */ + 0x00, /* */ + 0x7c, /* XXXXX */ + 0x06, /* XX */ + 0x7e, /* XXXXXX */ + 0xc6, /* XX XX */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + + /* 98 0x62 'b' */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xfc, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xfc, /* XXXXXX */ + 0x00, /* */ + + /* 99 0x63 'c' */ + 0x00, /* */ + 0x00, /* */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc0, /* XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 100 0x64 'd' */ + 0x06, /* XX */ + 0x06, /* XX */ + 0x7e, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + + /* 101 0x65 'e' */ + 0x00, /* */ + 0x00, /* */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 102 0x66 'f' */ + 0x3c, /* XXXX */ + 0x66, /* XX XX */ + 0x60, /* XX */ + 0xf0, /* XXXX */ + 0x60, /* XX */ + 0x60, /* XX */ + 0x60, /* XX */ + 0x00, /* */ + + /* 103 0x67 'g' */ + 0x00, /* */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7e, /* XXXXXX */ + 0x06, /* XX */ + 0x7c, /* XXXXX */ + + /* 104 0x68 'h' */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xfc, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 105 0x69 'i' */ + 0x18, /* XX */ + 0x00, /* */ + 0x38, /* XXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 106 0x6a 'j' */ + 0x06, /* XX */ + 0x00, /* */ + 0x06, /* XX */ + 0x06, /* XX */ + 0x06, /* XX */ + 0x06, /* XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + + /* 107 0x6b 'k' */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xcc, /* XX XX */ + 0xd8, /* XX XX */ + 0xf0, /* XXXX */ + 0xd8, /* XX XX */ + 0xcc, /* XX XX */ + 0x00, /* */ + + /* 108 0x6c 'l' */ + 0x38, /* XXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 109 0x6d 'm' */ + 0x00, /* */ + 0x00, /* */ + 0xec, /* XXX XX */ + 0xfe, /* XXXXXXX */ + 0xd6, /* XX X XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 110 0x6e 'n' */ + 0x00, /* */ + 0x00, /* */ + 0xfc, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 111 0x6f 'o' */ + 0x00, /* */ + 0x00, /* */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 112 0x70 'p' */ + 0x00, /* */ + 0x00, /* */ + 0xfc, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xfc, /* XXXXXX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + + /* 113 0x71 'q' */ + 0x00, /* */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7e, /* XXXXXX */ + 0x06, /* XX */ + 0x06, /* XX */ + + /* 114 0x72 'r' */ + 0x00, /* */ + 0x00, /* */ + 0xdc, /* XX XXX */ + 0xe6, /* XXX XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0x00, /* */ + + /* 115 0x73 's' */ + 0x00, /* */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0xc0, /* XX */ + 0x7c, /* XXXXX */ + 0x06, /* XX */ + 0xfc, /* XXXXXX */ + 0x00, /* */ + + /* 116 0x74 't' */ + 0x30, /* XX */ + 0x30, /* XX */ + 0x7c, /* XXXXX */ + 0x30, /* XX */ + 0x30, /* XX */ + 0x36, /* XX XX */ + 0x1c, /* XXX */ + 0x00, /* */ + + /* 117 0x75 'u' */ + 0x00, /* */ + 0x00, /* */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 118 0x76 'v' */ + 0x00, /* */ + 0x00, /* */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x6c, /* XX XX */ + 0x38, /* XXX */ + 0x00, /* */ + + /* 119 0x77 'w' */ + 0x00, /* */ + 0x00, /* */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xd6, /* XX X XX */ + 0xfe, /* XXXXXXX */ + 0x6c, /* XX XX */ + 0x00, /* */ + + /* 120 0x78 'x' */ + 0x00, /* */ + 0x00, /* */ + 0xc6, /* XX XX */ + 0x6c, /* XX XX */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 121 0x79 'y' */ + 0x00, /* */ + 0x00, /* */ + 0xc3, /* XX XX */ + 0x66, /* XX XX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x60, /* XX */ + + /* 122 0x7a 'z' */ + 0x00, /* */ + 0x00, /* */ + 0xfe, /* XXXXXXX */ + 0x0c, /* XX */ + 0x38, /* XXX */ + 0x60, /* XX */ + 0xfe, /* XXXXXXX */ + 0x00, /* */ + + /* 123 0x7b '{' */ + 0x0e, /* XXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x70, /* XXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x0e, /* XXX */ + 0x00, /* */ + + /* 124 0x7c '|' */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 125 0x7d '}' */ + 0x70, /* XXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x0e, /* XXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x70, /* XXX */ + 0x00, /* */ + + /* 126 0x7e '~' */ + 0x72, /* XXX X */ + 0x9c, /* X XXX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 127 0x7f '' */ + 0x00, /* */ + 0x10, /* X */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0x00, /* */ + + /* 128 0x80 '€' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 129 0x81 '' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 130 0x82 '‚' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 131 0x83 'ƒ' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 132 0x84 '„' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 133 0x85 '…' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 134 0x86 '†' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 135 0x87 '‡' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 136 0x88 'ˆ' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 137 0x89 '‰' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 138 0x8a 'Š' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 139 0x8b '‹' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 140 0x8c 'Œ' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 141 0x8d '' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 142 0x8e 'Ž' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 143 0x8f '' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 144 0x90 '' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 145 0x91 '‘' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 146 0x92 '’' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 147 0x93 '“' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 148 0x94 '”' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 149 0x95 '•' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 150 0x96 '–' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 151 0x97 '—' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 152 0x98 '˜' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 153 0x99 '™' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 154 0x9a 'š' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 155 0x9b '›' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 156 0x9c 'œ' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 157 0x9d '' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 158 0x9e 'ž' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 159 0x9f 'Ÿ' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 160 0xa0 ' ' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 161 0xa1 '¡' */ + 0x18, /* XX */ + 0x00, /* */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x3c, /* XXXX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 162 0xa2 '¢' */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + + /* 163 0xa3 '£' */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0x64, /* XX X */ + 0xf0, /* XXXX */ + 0x60, /* XX */ + 0x66, /* XX XX */ + 0xfc, /* XXXXXX */ + 0x00, /* */ + + /* 164 0xa4 '¤' */ + 0x00, /* */ + 0x99, /* X XX X */ + 0x42, /* X X */ + 0x81, /* X X */ + 0x81, /* X X */ + 0x42, /* X X */ + 0x99, /* X XX X */ + 0x00, /* */ + + /* 165 0xa5 '¥' */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x3c, /* XXXX */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + + /* 166 0xa6 '¦' */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 167 0xa7 '§' */ + 0x3c, /* XXXX */ + 0x20, /* X */ + 0x70, /* XXX */ + 0x6c, /* XX XX */ + 0x36, /* XX XX */ + 0x1e, /* XXXX */ + 0x08, /* X */ + 0x78, /* XXXX */ + + /* 168 0xa8 '¨' */ + 0x00, /* */ + 0x24, /* X X */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 169 0xa9 '©' */ + 0x3c, /* XXXX */ + 0x42, /* X X */ + 0x99, /* X XX X */ + 0xa1, /* X X X */ + 0xa1, /* X X X */ + 0x99, /* X XX X */ + 0x42, /* X X */ + 0x3c, /* XXXX */ + + /* 170 0xaa 'ª' */ + 0x3c, /* XXXX */ + 0x6c, /* XX XX */ + 0x6c, /* XX XX */ + 0x3e, /* XXXXX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 171 0xab '«' */ + 0x00, /* */ + 0x33, /* XX XX */ + 0x66, /* XX XX */ + 0xcc, /* XX XX */ + 0x66, /* XX XX */ + 0x33, /* XX XX */ + 0x00, /* */ + 0x00, /* */ + + /* 172 0xac '¬' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0xfe, /* XXXXXXX */ + 0x06, /* XX */ + 0x06, /* XX */ + 0x00, /* */ + 0x00, /* */ + + /* 173 0xad '­' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x18, /* XX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 174 0xae '®' */ + 0x3c, /* XXXX */ + 0x42, /* X X */ + 0xb9, /* X XXX X */ + 0xa5, /* X X X X */ + 0xb9, /* X XXX X */ + 0xa5, /* X X X X */ + 0x66, /* XX XX */ + 0x3c, /* XXXX */ + + /* 175 0xaf '¯' */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 176 0xb0 '°' */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0x6c, /* XX XX */ + 0x38, /* XXX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 177 0xb1 '±' */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + + /* 178 0xb2 '²' */ + 0x78, /* XXXX */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 179 0xb3 '³' */ + 0x18, /* XX */ + 0x04, /* X */ + 0x18, /* XX */ + 0x04, /* X */ + 0x18, /* XX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 180 0xb4 '´' */ + 0x0c, /* XX */ + 0x10, /* X */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 181 0xb5 'µ' */ + 0x00, /* */ + 0x00, /* */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x7c, /* XXXXX */ + 0xc0, /* XX */ + + /* 182 0xb6 '¶' */ + 0x3b, /* XXX XX */ + 0x4a, /* X X X */ + 0x4a, /* X X X */ + 0x3a, /* XXX X */ + 0x0a, /* X X */ + 0x0a, /* X X */ + 0x1b, /* XX XX */ + 0x00, /* */ + + /* 183 0xb7 '·' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x18, /* XX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 184 0xb8 '¸' */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x08, /* X */ + 0x04, /* X */ + 0x38, /* XXX */ + + /* 185 0xb9 '¹' */ + 0x08, /* XX */ + 0x18, /* XXX */ + 0x08, /* XX */ + 0x08, /* XX */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + + /* 186 0xba 'º' */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0x6c, /* XX XX */ + 0x38, /* XXX */ + 0x00, /* */ + 0x7c, /* XXXXX */ + 0x00, /* */ + 0x00, /* */ + + /* 187 0xbb '»' */ + 0x00, /* */ + 0xcc, /* XX XX */ + 0x66, /* XX XX */ + 0x33, /* XX XX */ + 0x66, /* XX XX */ + 0xcc, /* XX XX */ + 0x00, /* */ + 0x00, /* */ + + /* 188 0xbc '¼' */ + 0x63, /* XX XX */ + 0xe6, /* XXX XX */ + 0x6c, /* XX XX */ + 0x7a, /* XXXX X */ + 0x36, /* XX XX */ + 0x6a, /* XX X X */ + 0xdf, /* XX XXXXX */ + 0x06, /* XX */ + + /* 189 0xbd '½' */ + 0x63, /* XX XX */ + 0xe6, /* XXX XX */ + 0x6c, /* XX XX */ + 0x7e, /* XXXXXX */ + 0x33, /* XX XX */ + 0x66, /* XX XX */ + 0xcc, /* XX XX */ + 0x0f, /* XXXX */ + + /* 190 0xbe '¾' */ + 0x63, /* XX XX */ + 0x16, /* X XX */ + 0x6c, /* XX XX */ + 0x1a, /* XX X */ + 0xf6, /* XXXX XX */ + 0x6a, /* XX X X */ + 0xdf, /* XX XXXXX */ + 0x06, /* XX */ + + /* 191 0xbf '¿' */ + 0x18, /* XX */ + 0x00, /* */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x63, /* XX XX */ + 0x3e, /* XXXXX */ + 0x00, /* */ + + /* 192 0xc0 'À' */ + 0x30, /* XX */ + 0x08, /* X */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 193 0xc1 'Á' */ + 0x0c, /* XX */ + 0x10, /* X */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 194 0xc2 'Â' */ + 0x18, /* XX */ + 0x24, /* X X */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 195 0xc3 'Ã' */ + 0x14, /* X X */ + 0x28, /* X X */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 196 0xc4 'Ä' */ + 0xc6, /* XX XX */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 197 0xc5 'Å' */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x00, /* */ + + /* 198 0xc6 'Æ' */ + 0x3e, /* XXXXX */ + 0x6c, /* XX XX */ + 0xcc, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0xce, /* XX XXX */ + 0x00, /* */ + + /* 199 0xc7 'Ç' */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x0c, /* XX */ + 0x78, /* XXXX */ + + /* 200 0xc8 'È' */ + 0x30, /* XX */ + 0x08, /* X */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0xf8, /* XXXXX */ + 0xc0, /* XX */ + 0xfe, /* XXXXXXX */ + 0x00, /* */ + + /* 201 0xc9 'É' */ + 0x18, /* XX */ + 0x30, /* XX */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0xf8, /* XXXXX */ + 0xc0, /* XX */ + 0xfe, /* XXXXXXX */ + 0x00, /* */ + + /* 202 0xca 'Ê' */ + 0x18, /* XX */ + 0x24, /* X X */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0xf8, /* XXXXX */ + 0xc0, /* XX */ + 0xfe, /* XXXXXXX */ + 0x00, /* */ + + /* 203 0xcb 'Ë' */ + 0x24, /* X X */ + 0x00, /* */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0xf8, /* XXXXX */ + 0xc0, /* XX */ + 0xfe, /* XXXXXXX */ + 0x00, /* */ + + /* 204 0xcc 'Ì' */ + 0x30, /* XX */ + 0x08, /* X */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + + /* 205 0xcd 'Í' */ + 0x0c, /* XX */ + 0x10, /* X */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + + /* 206 0xce 'Î' */ + 0x18, /* XX */ + 0x24, /* X X */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + + /* 207 0xcf 'Ï' */ + 0x24, /* X X */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + + /* 208 0xd0 'Ð' */ + 0xfc, /* XXXXXX */ + 0xc6, /* XX XX */ + 0xf6, /* XXXX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xfc, /* XXXXXX */ + 0x00, /* */ + + /* 209 0xd1 'Ñ' */ + 0x76, /* XXX XX */ + 0xdc, /* XX XXX */ + 0x00, /* */ + 0xe6, /* XXX XX */ + 0xf6, /* XXXX XX */ + 0xde, /* XX XXXX */ + 0xce, /* XX XXX */ + 0x00, /* */ + + /* 210 0xd2 'Ò' */ + 0x30, /* XX */ + 0x08, /* X */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 211 0xd3 'Ó' */ + 0x0c, /* XX */ + 0x10, /* X */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 212 0xd4 'Ô' */ + 0x18, /* XX */ + 0x24, /* X X */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 213 0xd5 'Õ' */ + 0x34, /* XX X */ + 0x0c, /* XX */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 214 0xd6 'Ö' */ + 0xc6, /* XX XX */ + 0x38, /* XXX */ + 0x6c, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x6c, /* XX XX */ + 0x38, /* XXX */ + 0x00, /* */ + + /* 215 0xd7 '×' */ + 0x00, /* */ + 0x00, /* */ + 0xc3, /* XX XX */ + 0x66, /* XX XX */ + 0x18, /* XX */ + 0x66, /* XX XX */ + 0xc3, /* XX XX */ + 0x00, /* */ + + /* 216 0xd8 'Ø' */ + 0x19, /* XX X */ + 0x26, /* X XX */ + 0x46, /* X XX */ + 0x4a, /* X X X */ + 0x52, /* X X X */ + 0x24, /* X X */ + 0x58, /* X XX */ + 0x00, /* */ + + /* 217 0xd9 'Ù' */ + 0x30, /* XX */ + 0x08, /* X */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 218 0xda 'Ú' */ + 0x0c, /* XX */ + 0x10, /* X */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 219 0xdb 'Û' */ + 0x18, /* XX */ + 0x24, /* X X */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 220 0xdc 'Ü' */ + 0xc6, /* XX XX */ + 0x00, /* */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ +#if 0 + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0x00, /* */ + 0xff, /* XXXXXXXX */ + 0xff, /* XXXXXXXX */ + 0xff, /* XXXXXXXX */ + 0xff, /* XXXXXXXX */ +#endif + + /* 221 0xdd 'Ý' */ + 0x0c, /* XX */ + 0x10, /* X */ + 0xc3, /* XX XX */ + 0x66, /* XX XX */ + 0x3c, /* XXXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + + /* 222 0xde 'Þ' */ + 0x00, /* */ + 0x70, /* XXX */ + 0x78, /* XXXXX */ + 0x64, /* XX XX */ + 0x78, /* XXXXX */ + 0x60, /* XX */ + 0x78, /* XXX */ + 0x00, /* */ + + /* 223 0xdf 'ß' */ + 0x78, /* XXXX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0xd8, /* XX XX */ + 0xcc, /* XX XX */ + 0xc6, /* XX XX */ + 0xcc, /* XX XX */ + 0x00, /* */ + + /* 224 0xe0 'à' */ + 0x30, /* XX */ + 0x18, /* XX */ + 0x78, /* XXXX */ + 0x0c, /* XX */ + 0x7c, /* XXXXX */ + 0xcc, /* XX XX */ + 0x76, /* XXX XX */ + 0x00, /* */ + + /* 225 0xe1 'á' */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x78, /* XXXX */ + 0x0c, /* XX */ + 0x7c, /* XXXXX */ + 0xcc, /* XX XX */ + 0x76, /* XXX XX */ + 0x00, /* */ + + /* 226 0xe2 'â' */ + 0x18, /* XX */ + 0x30, /* XX */ + 0x78, /* XXXX */ + 0x0c, /* XX */ + 0x7c, /* XXXXX */ + 0xcc, /* XX XX */ + 0x76, /* XXX XX */ + 0x00, /* */ + + /* 227 0xe3 'ã' */ + 0x14, /* X X */ + 0x28, /* X X */ + 0x78, /* XXXX */ + 0x0c, /* XX */ + 0x7c, /* XXXXX */ + 0xcc, /* XX XX */ + 0x76, /* XXX XX */ + 0x00, /* */ + + /* 228 0xe4 'ä' */ + 0xc6, /* XX XX */ + 0x00, /* */ + 0x78, /* XXXX */ + 0x0c, /* XX */ + 0x7c, /* XXXXX */ + 0xcc, /* XX XX */ + 0x76, /* XXX XX */ + 0x00, /* */ + + /* 229 0xe5 'å' */ + 0x30, /* XX */ + 0x30, /* XX */ + 0x78, /* XXXX */ + 0x0c, /* XX */ + 0x7c, /* XXXXX */ + 0xcc, /* XX XX */ + 0x76, /* XXX XX */ + 0x00, /* */ + + /* 230 0xe6 'æ' */ + 0x00, /* */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0x18, /* XX */ + 0x7e, /* XXXXXX */ + 0xd8, /* XX XX */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + + /* 231 0xe7 'ç' */ + 0x00, /* */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0xc0, /* XX */ + 0xc0, /* XX */ + 0x7e, /* XXXXXX */ + 0x0c, /* XX */ + 0x38, /* XXX */ + + /* 232 0xe8 'è' */ + 0x30, /* XX */ + 0x18, /* XX */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 233 0xe9 'é' */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 234 0xea 'ê' */ + 0x7c, /* XXXXX */ + 0x82, /* X X */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 235 0xeb 'ë' */ + 0xc6, /* XX XX */ + 0x00, /* */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xfe, /* XXXXXXX */ + 0xc0, /* XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 236 0xec 'ì' */ + 0x30, /* XX */ + 0x18, /* XX */ + 0x00, /* */ + 0x38, /* XXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x3c, /* XXXX */ + 0x00, /* */ + + /* 237 0xed 'í' */ + 0x06, /* XX */ + 0x0c, /* XX */ + 0x7e, /* XXXXXX */ + 0xdb, /* XX XX XX */ + 0xdb, /* XX XX XX */ + 0x7e, /* XXXXXX */ + 0x60, /* XX */ + 0xc0, /* XX */ + + /* 238 0xee 'î' */ + 0x7c, /* XXXXX */ + 0x82, /* X X */ + 0x38, /* XXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x3c, /* XXXX */ + 0x00, /* */ + + /* 239 0xef 'ï' */ + 0x66, /* XX XX */ + 0x00, /* */ + 0x38, /* XXX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x18, /* XX */ + 0x3c, /* XXXX */ + 0x00, /* */ + + /* 240 0xf0 'ð' */ + 0x34, /* XX X */ + 0x0c, /* XX */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 241 0xf1 'ñ' */ + 0x76, /* XXX XX */ + 0xdc, /* XX XXX */ + 0x00, /* */ + 0xdc, /* XX XXX */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x66, /* XX XX */ + 0x00, /* */ + + /* 242 0xf2 'ò' */ + 0x30, /* XX */ + 0x18, /* XX */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 243 0xf3 'ó' */ + 0x0c, /* XX */ + 0x18, /* XX */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 244 0xf4 'ô' */ + 0x7c, /* XXXXX */ + 0x82, /* X X */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 245 0xf5 'õ' */ + 0x14, /* X X */ + 0x28, /* X X */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 246 0xf6 'ö' */ + 0xc6, /* XX XX */ + 0x00, /* */ + 0x7c, /* XXXXX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7c, /* XXXXX */ + 0x00, /* */ + + /* 247 0xf7 '÷' */ + 0x00, /* */ + 0x18, /* XX */ + 0x00, /* */ + 0x7e, /* XXXXXX */ + 0x00, /* */ + 0x18, /* XX */ + 0x00, /* */ + 0x00, /* */ + + /* 248 0xf8 'ø' */ + 0x00, /* */ + 0x1a, /* XX X */ + 0x24, /* X X */ + 0x4a, /* X X X */ + 0x52, /* X X X */ + 0x24, /* X X */ + 0x58, /* X XX */ + 0x00, /* */ + + /* 249 0xf9 'ù' */ + 0x60, /* XX */ + 0x30, /* XX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0x76, /* XXX XX */ + 0x00, /* */ + + /* 250 0xfa 'ú' */ + 0x18, /* XX */ + 0x30, /* XX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0x76, /* XXX XX */ + 0x00, /* */ + + /* 251 0xfb 'û' */ + 0x78, /* XXXX */ + 0x84, /* X X */ + 0x00, /* */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0x76, /* XXX XX */ + 0x00, /* */ + + /* 252 0xfc 'ü' */ + 0xcc, /* XX XX */ + 0x00, /* */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0xcc, /* XX XX */ + 0x76, /* XXX XX */ + 0x00, /* */ + + /* 253 0xfd 'ý' */ + 0x0c, /* XX */ + 0x10, /* X */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7e, /* XXXXXX */ + 0x06, /* XX */ + 0xfc, /* XXXXXX */ + + /* 254 0xfe 'þ' */ + 0x70, /* XXX */ + 0x60, /* XX */ + 0x78, /* XXXXX */ + 0x64, /* XX XX */ + 0x78, /* XXXXX */ + 0x60, /* XX */ + 0x78, /* XXX */ + 0x00, /* */ + + /* 255 0xff 'ÿ' */ + 0xc6, /* XX XX */ + 0x00, /* */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0xc6, /* XX XX */ + 0x7e, /* XXXXXX */ + 0x06, /* XX */ + 0xfc, /* XXXXXX */ + +}; + + diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..3c3601a --- /dev/null +++ b/readme.txt @@ -0,0 +1,68 @@ +Werbe-Zapper Plugin für DBox 2 Version 0.78 + +Das Plugin kann gestartet werden, wenn auf einem Sender Werbung läuft. Anschließend kann auf einen anderen +Sender gezappt werden. Bei den von dem Socket-Server der "TC Unterhaltungselektronik-AG" unterstützten +Sendern wird nun bei Änderung des Werbestatus eines Senders ein Datenpaket mit der Info für alle Sender +vom Server an die Box geschickt. Ist die Werbung des Senders, von welchem weggeschaltet wurde, wird auto- +matisch auf diesen Sender zurückgeschaltet Bei nicht unterstützten Sendern, wenn auf einem unterstützten +Kanal keine Werbung gemeldet wird oder ohne Internetanbindung wird zunächst ein Menü eingeblendet, in +welchem die Zeit bis zum Zurückzappen zwischen 1 und 10 Minuten ausgewählt werden kann. Die Aktivierung +des Plugins wird im LCD-Display durch ein blinkendes "WZ" bei Internetabfrage beziehungsweise die Anzeige +der Restzeit in Minutem und Sekunden bis zum Zurückzappen bei nichtunterstützten Sendern oder ohne Inter- +netverbindung angezeigt. +Erster Aufruf des Plugins aktiviert es. Bei Programmen vom Werbeserver und mit Internet wird nachgeschaut, +ob wirklich gerade Werbung läuft. Wenn nicht, wird die Zeitabfrage für den Zap-Timer aktiviert, wenn der +Parameter "ZapAlways=" auf "1" steht. Ist er "0", wird das Plugin mit der Meldung, daß auf diesem Sender +gerade keine Werbung gemeldet wird, beendet. Bei nicht unterstützten Programmen oder ohne Internet wird +automatisch nach der ausgewählten RezapTime zurückgeschaltet. Ein erneuter Aufruf des Plugins während es +läuft, deaktiviert es +Thanx to Marxx (for Idea), Mailman (for 1. zap_timer-Plugin, UMP), cAsTeR (Boxcracker) + +Dateiorte ergeben sich aus den Verzeichnisnamen. 00_blockads.so, blockad und blockads brauchen Rechte 755 +Bei SqashFS-Images können die .so und .cfg auch nach /var/tuxbox/plugins/ gelegt werden. + +blockads.conf: + +RezapTime=07 // Position in der Zeitliste für Defaulteintrag in der angezeigten + Auswahlliste für die zeitgesteuerte Rückschaltung bei Kanälen, die + nicht auf dem Werbeserver unterstützt werden oder ohne Internet + +TimeX=nn // Eintrag Nummer X in der Zeitliste X=1..0 + nn=Zeit in Minuten bis zum Zurückschalten + +Internet=DSL // DSL, ISDN oder ANALOG, alles andere bedeutet "kein Internet" + +ZapAlways=1 // auch zappen, wenn bei unterstützten Sendern gerade keine Werbung + gemeldet wird + +Debounce=15 // Zeit in Sekunden, die der Werbeserber für einen Kanal mindestens + "keine Werbung" melden muß, ehe zurückgeschaltet wird + +Programm=ARD,Das Erste // Programm=Name des Programms auf dem Server,Name des Programms in + der Neutrino-Kanalliste + +ZapChanX=Das Erste // Programmname aus der Neutrino-Kanalliste, auf welchen bei Ver- + wendung der augewählten Rezap-Zeit bei nicht unterstützen Kanälen + oder nicht vorhandener Internetanbindung bei Pluginstart selbst- + ständig umgeschaltet werden soll. "X" entpricht dabei den Ziffern + "9" bis "0", entsprechend der ausgwählten Rezap-Zeit. 1 min="1" ... + 10 min="0". Fehlt der Eintrag bei der gewählten Rezap-Zeit, wird + nicht automatisch weggeschaltet + +KeepVolume=1 // stellt beim Zurückzappen bei Werbungsende automatisch die Lautstärke + und den Mutestatus des Senders vor dem Wegzappen wieder her + +Während der Werbezapper läuft, erzeugt er ein Statusfile /tmp/blockads.sts , welches von anderen Program- +men für eine Statusanzeige verwendet werden kann. In der ersten Ziele des Files steht der Kanalname, von +welchem wegen Werbung weggeschaltet wurde, in Klartext, in der zweiten Zeile bei Verwendung des Zaptimers +die Zeit bis zum Zurückzappen im Format "m:ss". Wird der Werbeserver abgefragt, steht in dieser Zeile "Auto". + +Der im Archiv enthaltene Ordner "Konfiguration über FlexMenü" enthält alle nötigen Dateien für die +Konfiguration von blockads mittels des "Flexiblen Menü-Plugins". Die Orte der Dateien werden durch +die Ordnerstruktur bereits vorgegeben. Das Script "wzqops" benötigt die Rechte 755. Die Datei +"in shellexec.conf einfuegen" wird, wie der Name bereits sagt, in eine bestehende Konfigurations- +Datei des FlexMenüs eingefügt. Wer den Editor "input" noch nicht im Image hat, kopiert bitte den +im Archiv enthaltenen mit den Rechten 755 nach /var/bin/. + +Grüße vom New-Tuxwetter-Team +Hilfe und Infos gibt's unter: http://www.dbox2-tuning.net/forum/viewforum.php?f=27&start=0 diff --git a/start.c b/start.c new file mode 100644 index 0000000..9144488 --- /dev/null +++ b/start.c @@ -0,0 +1,53 @@ +/* + * $Id: start.c,v 1.1 2010/03/03 20:47:03 rhabarber1848 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#include +#include +#include +#include +#include +#define SCRIPT "blockads" + +void plugin_exec() +{ + int ret, pid, status; + pid=fork(); + if (pid == -1) { + fprintf(stderr, "[%s.so] fork\n", SCRIPT); + return; + } else + if (pid == 0) { + fprintf(stderr, "[%s.so] forked, executing %s\n", SCRIPT, SCRIPT); + for (ret=3 ; ret < 255; ret++) + close (ret); + ret = system(SCRIPT); + if (ret) + fprintf(stderr, "[%s.so] script return code: %d (%m)\n", SCRIPT, ret); + else + fprintf(stderr, "[%s.so] script return code: %d\n", SCRIPT, ret); + _exit(ret); + } + fprintf(stderr, "[%s.so] parent, waiting for child with pid %d...\n", SCRIPT, pid); + waitpid(pid, &status, 0); + fprintf(stderr, "[%s.so] parent, waitpid() returned..\n", SCRIPT); + if (WIFEXITED(status)) + fprintf(stderr, "[%s.so] child returned with status %d\n", SCRIPT, WEXITSTATUS(status)); +} diff --git a/text.c b/text.c new file mode 100644 index 0000000..60bae83 --- /dev/null +++ b/text.c @@ -0,0 +1,230 @@ +/* + * $Id: text.c,v 1.0 2010/04/25 18:00:00 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#include "text.h" +#include "gfx.h" +#include "io.h" + +/****************************************************************************** + * MyFaceRequester + ******************************************************************************/ + +FT_Error MyFaceRequester(FTC_FaceID face_id, FT_Library library, FT_Pointer request_data, FT_Face *aface) +{ + FT_Error result; + + result = FT_New_Face(library, face_id, 0, aface); + + if(!result) printf("\n", (char*)face_id); + else printf("\n", (char*)face_id); + + return result; +} + +int RenderChar(FT_ULong currentchar, int sx, int sy, int ex, int color) +{ + unsigned char pix[4]={bl[color],gn[color],rd[color],tr[color]}; + int row, pitch, bit, x = 0, y = 0; + FT_UInt glyphindex; + FT_Vector kerning; + FT_Error error; + + currentchar=currentchar & 0xFF; + + //load char + + if(!(glyphindex = FT_Get_Char_Index(face, (int)currentchar))) + { + //printf("Blockads \n", (int)currentchar, error); + return 0; + } + + // no kerning used + /* + if(use_kerning) + { + FT_Get_Kerning(face, prev_glyphindex, glyphindex, ft_kerning_default, &kerning); + + prev_glyphindex = glyphindex; + kerning.x >>= 6; +} +else + */ + kerning.x = 0; + +//render char + +if(color != -1) /* don't render char, return charwidth only */ +{ + if(sx + sbit->xadvance >= ex) return -1; /* limit to maxwidth */ + + for(row = 0; row < sbit->height; row++) + { + for(pitch = 0; pitch < sbit->pitch; pitch++) + { + for(bit = 7; bit >= 0; bit--) + { + if(pitch*8 + 7-bit >= sbit->width) break; /* render needed bits only */ + + if((sbit->buffer[row * sbit->pitch + pitch]) & 1<left + kerning.x + x)*4 + fix_screeninfo.line_length*(starty + sy - sbit->top + y),pix,4); + + x++; + } + } + + x = 0; + y++; + } + +} + +//return charwidth + +return sbit->xadvance + kerning.x; +} + +/****************************************************************************** + * GetStringLen + ******************************************************************************/ + +int GetStringLen(unsigned char *string) +{ + int stringlen = 0; + + //reset kerning + + prev_glyphindex = 0; + + //calc len + + while(*string != '\0') + { + stringlen += RenderChar(*string, -1, -1, -1, -1); + string++; + } + + return stringlen; +} + +/****************************************************************************** + * RenderString + ******************************************************************************/ + +void RenderString(char *string, int sx, int sy, int maxwidth, int layout, int size, int color) +{ + int stringlen, ex, charwidth; + char rstr[256], *rptr=rstr; + + //set size + + if(strstr(string,"N/A")!=NULL) + { + sprintf(rstr,"---"); + } + else + { + strcpy(rstr,string); + } + + switch (size) + { +#ifdef FT_NEW_CACHE_API + case SMALL: desc.width = desc.height = 24; break; + case MED: desc.width = desc.height = 32; break; + case BIG: desc.width = desc.height = 40; break; + default: desc.width = desc.height = size; break; +#else + case SMALL: desc.font.pix_width = desc.font.pix_height = 24; break; + case MED: desc.font.pix_width = desc.font.pix_height = 32; break; + case BIG: desc.font.pix_width = desc.font.pix_height = 40; break; + default : desc.font.pix_width = desc.font.pix_height = size; break; +#endif + + + } + + //set alignment + + if(layout != LEFT) + { + stringlen = GetStringLen(rstr); + + switch(layout) + { + case CENTER: if(stringlen < maxwidth) sx += (maxwidth - stringlen)/2; + break; + + case RIGHT: if(stringlen < maxwidth) sx += maxwidth - stringlen; + } + } + + //reset kerning + + prev_glyphindex = 0; + + //render string + + ex = sx + maxwidth; + + while(*rptr != '\0') + { + if((charwidth = RenderChar(*rptr, sx, sy, ex, color)) == -1) return; /* string > maxwidth */ + + sx += charwidth; + rptr++; + } +} + +/****************************************************************************** + * ShowMessage + ******************************************************************************/ + +void ShowMessage(char *message, int wait) +{ + //layout + + RenderBox(105, 178, 514, 327, FILL, CMC); + RenderBox(105, 178, 514, 327, GRID, CMCS); + RenderBox(105, 220, 514, 327, GRID, CMCS); + + //message + + RenderString("Blockads Info", 107, 213, 406, CENTER, BIG, CMHT); + + RenderString(message, 107, 265, 406, CENTER, MED, CMCT); + + if(wait) + { + RenderBox(285, 286, 334, 310, FILL, CMCS); + RenderString("OK", 287, 305, 46, CENTER, SMALL, CMCT); + } + memcpy(lfb, lbb, fix_screeninfo.line_length*var_screeninfo.yres); + + while(wait && (GetRCCode() != RC_OK)); +} + diff --git a/text.h b/text.h new file mode 100644 index 0000000..a9332b7 --- /dev/null +++ b/text.h @@ -0,0 +1,33 @@ +/* + * $Id: text.h,v 1.0 2010/04/25 18:00:00 Exp $ + * + * blockads - d-box2 linux project + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * +*/ + +#ifndef __TEXT_H__ + +#define __TEXT_H__ + +#include "blockads.h" + +FT_Error MyFaceRequester(FTC_FaceID face_id, FT_Library library, FT_Pointer request_data, FT_Face *aface); +void RenderString(char *string, int sx, int sy, int maxwidth, int layout, int size, int color); +void ShowMessage(char *message, int wait); +int GetStringLen(unsigned char *string); + +#endif diff --git a/wzops b/wzops new file mode 100755 index 0000000..c461c7c --- /dev/null +++ b/wzops @@ -0,0 +1,103 @@ +#!/bin/sh +#################################################################################### +#### Blockads +#### Werbezapper mit Internetanbindung +#### +#### Das New-Tuxwetter-Team: SnowHead, Worschter, Zapt, Sanguiniker +#################################################################################### +# icqops BY MailMan/SnowHead +# +# VERSION +# 1.68 2007/03/28 Final Release + +# DECLARE USER VARS **************************************** +BLOCKADCFG="/var/tuxbox/config/blockads.conf" + + pth="/bin/input" + if [ ! -e $pth ]; then + pth="/var/bin/input" + if [ ! -e $pth ]; then + /bin/wget -Y off -O /dev/null http://localhost/control/message?nmsg=Eingabeprogramm%20input%20ist%20nicht%20installiert.%0APlugin%20kann%20nicht%20ausgef%C3%BChrt%20werden. + exit 0 + fi + fi + + case "$1" in + reztime) + echo "aendere Rezap Time" + if grep -q "^RezapTime=.*" $BLOCKADCFG; then + sed -e "s/^RezapTime=.*/RezapTime=$2/g" $BLOCKADCFG > /tmp/blockads.conf + fi + ;; + + rezentry) + echo "aendere Rezap Eintrag $2" + def=`grep "^Time$2=" "$BLOCKADCFG"` + if [ `expr length $def` -gt 0 ]; then + def=`expr substr $def 7 2` + else + def=0 + fi + res=`$pth t="Rezap-Zeit" d="$def" l='## Minuten'` + if [ -z $res ]; then + exit 1 + fi + + if grep -q "^Time$2=.*" $BLOCKADCFG; then + sed -e "s/^Time$2=.*/Time$2=$res/g" $BLOCKADCFG > /tmp/blockads.conf + fi + ;; + + iconnect) + echo "aendere Internetverbindung" + if [ -z "$2" ]; then + sed -e "s/^Internet=.*/Internet=/g" $BLOCKADCFG > /tmp/blockads.conf + else + sed -e "s/^Internet=.*/Internet=$2/g" $BLOCKADCFG > /tmp/blockads.conf + fi + ;; + + zap) + echo "aendere ZapAlways" + if grep -q "^ZapAlways=.*" $BLOCKADCFG; then + sed -e "s/^ZapAlways=.*/ZapAlways=$2/g" $BLOCKADCFG > /tmp/blockads.conf + else + echo ZapAlways=$2 >> $BLOCKADCFG + fi + ;; + + debounce) + echo "aendere Debounce Time" + def=`grep "^Debounce=" "$BLOCKADCFG"` + if [ `expr length "$def"` -gt 0 ]; then + def=`expr substr $def 10 2` + else + def=15 + fi + res=`$pth t="Server-Entprell-Zeit" d="$def" l='## Sekunden'` + if [ -z $res ]; then + exit 1 + fi + if grep -q "^Debounce=.*" $BLOCKADCFG; then + sed -e "s/^Debounce=.*/Debounce=$res/g" $BLOCKADCFG > /tmp/blockads.conf + else + echo Debounce=$res >> $BLOCKADCFG + fi + ;; + + vol) + echo "aendere KeepVolume" + if grep -q "^KeepVolume=.*" $BLOCKADCFG; then + sed -e "s/^KeepVolume=.*/KeepVolume=$2/g" $BLOCKADCFG > /tmp/blockads.conf + else + echo KeepVolume=$2 >> $BLOCKADCFG + fi + ;; + + esac + if [ -e /tmp/blockads.conf ]; then + mv /tmp/blockads.conf $BLOCKADCFG + rm -f /tmp/blockads.conf + fi + + exit 1 \ No newline at end of file -- 2.39.5