[MN-dev] [mndiff]: r56 - in trunk/2010: 2010.cc 2010.cpp 2010.h 2_71x6.cc 2_71x6.cpp 2_71x6.h 2_all.h 2_crypt.cc 2_crypt.cpp 2_file.cc 2_file.cpp 2_gfunc.cc 2_gfunc.cpp 2_gfunc.h 2_grafix.cc 2_grafix.cpp 2_hw.cc 2_hw.cpp 2_hw_asm.s 2_hw_mem.cc 2_hw_mem.cpp 2_menu.cc 2_mfunc.cc 2_mfunc.cpp 2_nag.cc 2_nag.cpp 2_txt.cc 2_txt.cpp 2_txt.h 2_vc.cc 2_vc.cpp

michael subversion at mplayerhq.hu
Wed Jul 4 10:05:19 CEST 2007


Author: michael
Date: Wed Jul  4 10:05:19 2007
New Revision: 56

Log:
next version from unknown date


Added:
   trunk/2010/2010.cpp
      - copied, changed from r55, /trunk/2010/2010.cc
   trunk/2010/2_71x6.cpp
      - copied, changed from r55, /trunk/2010/2_71x6.cc
   trunk/2010/2_crypt.cpp
      - copied, changed from r55, /trunk/2010/2_crypt.cc
   trunk/2010/2_file.cpp
      - copied, changed from r52, /trunk/2010/2_file.cc
   trunk/2010/2_gfunc.cpp
      - copied, changed from r55, /trunk/2010/2_gfunc.cc
   trunk/2010/2_grafix.cpp
      - copied, changed from r55, /trunk/2010/2_grafix.cc
   trunk/2010/2_hw.cpp
      - copied, changed from r55, /trunk/2010/2_hw.cc
   trunk/2010/2_hw_mem.cpp
      - copied unchanged from r52, /trunk/2010/2_hw_mem.cc
   trunk/2010/2_mfunc.cpp
      - copied unchanged from r52, /trunk/2010/2_mfunc.cc
   trunk/2010/2_nag.cpp
      - copied, changed from r54, /trunk/2010/2_nag.cc
   trunk/2010/2_txt.cpp
      - copied, changed from r55, /trunk/2010/2_txt.cc
   trunk/2010/2_vc.cpp
      - copied, changed from r55, /trunk/2010/2_vc.cc
Removed:
   trunk/2010/2010.cc
   trunk/2010/2_71x6.cc
   trunk/2010/2_crypt.cc
   trunk/2010/2_file.cc
   trunk/2010/2_gfunc.cc
   trunk/2010/2_grafix.cc
   trunk/2010/2_hw.cc
   trunk/2010/2_hw_mem.cc
   trunk/2010/2_menu.cc
   trunk/2010/2_mfunc.cc
   trunk/2010/2_nag.cc
   trunk/2010/2_txt.cc
   trunk/2010/2_vc.cc
Modified:
   trunk/2010/2010.h
   trunk/2010/2_71x6.h
   trunk/2010/2_all.h
   trunk/2010/2_gfunc.h
   trunk/2010/2_hw_asm.s
   trunk/2010/2_txt.h

Copied: trunk/2010/2010.cpp (from r55, /trunk/2010/2010.cc)
==============================================================================
--- /trunk/2010/2010.cc	(original)
+++ trunk/2010/2010.cpp	Wed Jul  4 10:05:19 2007
@@ -1,4 +1,4 @@
-//2010 0.1 Copyright (c) 1998 Michael Niedermayer 
+//2010 0.1 Copyright (c) 1998 Michael Niedermayer
 
 #include <stdlib.h>
 #include <pc.h>
@@ -31,7 +31,7 @@
  extern volatile int page_flip;
  extern int vgax, vgay, xresvb, xresc, vb, mc;
  extern int active_meteor;
- extern int yuvmode;
+ extern int yuvMode, grabYuvMode;
  extern bool mmx;
 // extern short *linesPerKeyTab;
 // extern int *best1;
@@ -46,7 +46,8 @@
  extern bool helpState;
  extern bool allowDrop;
  extern int reqPage, reqSubPage, reqChanNum;
- extern char *reqChanStr;
+ extern char reqChanStr[];
+ extern char findTxt[];
 
  int maxBuf=2;
  int some=0;
@@ -176,7 +177,7 @@ int main(int argc, char **argv){
     NoFlip=1;
   }
   else if(stricmp(argv[i],"-NORGB")==0){
-    yuvmode=2;
+    yuvMode=2;
   }
   else if(stricmp(argv[i],"-maxBuf")==0){
     i++;
@@ -292,9 +293,9 @@ int main(int argc, char **argv){
 
  vgax=mib->Xres;
  vgay=mib->Yres;
-/* if(yuvmode!=0) mc=1;
+/* if(yuvMode!=0) mc=1;
  else mc=2;
- if(yuvmode==2) mc2=1;
+ if(yuvMode==2) mc2=1;
  else mc2=2;
 */
  mc=mc2=1;
@@ -342,24 +343,52 @@ int main(int argc, char **argv){
    decrypt();
    showStuff();
 
-   if(grabf==1) grab(), grabf=0;
+   if(grabf!=0 && TVStd!=TXTPAL) grab(), grabf=0;
 
    for(int k=0; k<delay*1000000; k++);
 
    copy_vidbuffer();
 
-
+   static char tab[256];
+   static int tabNdx;
+   static void *tabTo;
+   static TABTYPE tabType;
+   static bool tabActive=false;
+   static int tabLen;
 
    while(kbhit()){
      int key= getkey();
 
+     if(tabActive){
+       tab[tabNdx]=key;
+       tabNdx++;
+       if(key==K_Escape){
+         tabActive=false;
+       }
+       else if(key==K_Return || tabNdx>=tabLen){
+         tab[tabNdx]=0;
+         switch(tabType){
+           case TAB_DEZ : sscanf(tab, "%d", (int*)tabTo);
+                          break;
+           case TAB_HEX : sscanf(tab, "%X", (int*)tabTo);
+                          break;
+           case TAB_STR : sscanf(tab, "%s", (char*)tabTo);
+                          break;
+         }
+
+         tabActive=false;
+       }
+       continue;
+     }
+
      switch(menuLevel){
        case mLNorm : switch(key){
                        case 'p'  :
                        case 'P'  : getkey();
                        break;
-                       case 'g'  :
-                       case 'G'  : key=0, grabf=1;
+                       case 'g'  : key=0, grabf=1;
+                       break;
+                       case 'G'  : key=0, grabf=2;
                        break;
                        case 'q'  :
                        case 'Q'  : quit=true;
@@ -441,48 +470,74 @@ int main(int argc, char **argv){
                        break;
                        case '4'  : some--; if(some<0) some=0;
                        break;
+                       case 'a'  : 
+                       case 'A'  : if(TVStd!=TXTPAL) break;
+                                   tabActive=true;
+                                   tabTo=&reqPage;
+                                   tabLen=3;
+                                   tabType=TAB_HEX;
+                                   tabNdx=0;
+                       break;
+                       case 'f'  : if(TVStd!=TXTPAL) break;
+                                   tabActive=true;
+                                   tabTo=&findTxt[1];
+                                   tabLen=120;
+                                   tabType=TAB_STR;
+                                   tabNdx=0;
+                                   findTxt[1]=0;
+                       case 'F'  : if(TVStd!=TXTPAL) break;
+                                   findTxt[0]=1;
+                       break;
                      }
        break;
        case mLTVStd : switch(key){
                        case '1'  : TVStd= PAL;
                                    cryptStd= nix;
-                                   if(yuvmode==1) yuvmode=0;
+                                   if(yuvMode==1) yuvMode=0;
+                                   grabYuvMode=yuvMode;
                                    setStdScale();
                                    contGrab();
                        break;
                        case '2'  : TVStd= NTSC;
                                    cryptStd= nix;
-                                   if(yuvmode==1) yuvmode=0;
+                                   if(yuvMode==1) yuvMode=0;
+                                   grabYuvMode=yuvMode;
                                    setStdScale();
                                    contGrab();
                        break;
                        case '3'  : TVStd= SECAM;
                                    cryptStd= nix;
-                                   if(yuvmode==1) yuvmode=0;
+                                   if(yuvMode==1) yuvMode=0;
+                                   grabYuvMode=yuvMode;
                                    setStdScale();
                                    contGrab();
                        break;
-                       case '4'  : TVStd= PAL;
-                                   cryptStd= vc;
-                                   if(yuvmode==0) yuvmode=1;
+                       case '4'  : TVStd= TXTPAL;
+                                   cryptStd= nix;
+                                   if(yuvMode!=2) yuvMode=0, grabYuvMode=1;
+                                   else error(error_code(-988));
                                    vSmoothState=false;
                                    setStdScale();
                                    contGrab();
                        break;
+#ifndef NO_CRYPT
                        case '5'  : TVStd= PAL;
-                                   cryptStd= nag;
-                                   if(yuvmode==0) yuvmode=1;
+                                   cryptStd= vc;
+                                   if(yuvMode==0) yuvMode=1;
+                                   grabYuvMode=yuvMode;
                                    vSmoothState=false;
                                    setStdScale();
                                    contGrab();
                        break;
-                       case '6'  : TVStd= TXTPAL;
-                                   cryptStd= nix;
-                                   if(yuvmode==0) yuvmode=1;
+                       case '6'  : TVStd= PAL;
+                                   cryptStd= nag;
+                                   if(yuvMode==0) yuvMode=1;
+                                   grabYuvMode=yuvMode;
                                    vSmoothState=false;
                                    setStdScale();
                                    contGrab();
                        break;
+#endif
                      }
                      menuLevel=mLNorm;
        break;

Modified: trunk/2010/2010.h
==============================================================================
--- trunk/2010/2010.h	(original)
+++ trunk/2010/2010.h	Wed Jul  4 10:05:19 2007
@@ -37,6 +37,12 @@ enum MENULEVEL{
   mLTXTChan,
 };
 
+enum TABTYPE{
+  TAB_HEX,
+  TAB_DEZ,
+  TAB_STR,
+};
+
 int error(error_code e);
 void exitt(void);
 

Copied: trunk/2010/2_71x6.cpp (from r55, /trunk/2010/2_71x6.cc)
==============================================================================
--- /trunk/2010/2_71x6.cc	(original)
+++ trunk/2010/2_71x6.cpp	Wed Jul  4 10:05:19 2007
@@ -36,7 +36,7 @@ extern volatile u_char saa7196_buf[SAA71
 extern volatile TVSTD TVStd;
 extern volatile CRYPTSTD cryptStd;
 extern volatile int x_field, y_field;
-extern volatile int xresc, yuvmode, mc;
+extern volatile int xresc, yuvMode, mc, grabYuvMode;
 extern volatile VID2MEMBUF *vid2MemBuf, *actVid2MemBufp;
 extern volatile int grabVid2MemBuf, actVid2MemBuf;
 extern volatile int stride;
@@ -320,7 +320,7 @@ void setStdScale(void){
  mc=1;
 
  if(TVStd==TXTPAL){
-   scales_y=0x0 , scalee_y=0x0 -288 + 20;
+   scales_y=0x0 + 100, scalee_y=0x0 -288 + 20 + 100;
    xresc=vgax<<(mc+2);
    wndx=768;
  }
@@ -398,7 +398,12 @@ void setStdScale(void){
                                 5  SECAM cross-colour reduction
                                 4  Enable sync and clamping pulse
                               3:1  Luminance delay compensation            */
- if(yuvmode==0){
+// write_saa7196(0x10, 0x04);
+ write_saa7196(0x10, 0x00);
+                           /*   2  Select HREF Position
+                              1:0  Vertical noise reduction                */
+
+ if(grabYuvMode==0){
 /*   if(oneField) write_saa7196(0x20, 0xF2);
    else         write_saa7196(0x20, 0x92);
    a_saa7116->rt_mode_e=a_saa7116->rt_mode_o=
@@ -425,7 +430,7 @@ void setStdScale(void){
                            /* 7:0  [7:0] Pixel number per line on input    */
  write_saa7196(0x23, scales_x);/* 7:0  [7:0] Horizontal start position of scaling win*/
  i=saa7196_buf[0x24] & 0xE0;
- if(TVStd==TXTPAL) i=4;
+ if(TVStd==TXTPAL) i=0x80;
  write_saa7196(0x24, i | ((x_field>>6) & 0x0C) | (wndx>>8));
                            /* 7:5  Horizontal decimation filter
                                 4  [8] Horizontal start position of scaling win
@@ -437,7 +442,7 @@ void setStdScale(void){
  write_saa7196(0x26, y_field & 0xFF);
                            /* 7:0  [7:0] Line number per input field       */
  write_saa7196(0x27, scales_y);/* 7:0  [7:0] Vertical start of scaling window  */
- if(TVStd==TXTPAL) i=0;
+ if(TVStd==TXTPAL) i=0x00;
  else              i=saa7196_buf[0x28] & 0xE0;
  if(oneField) write_saa7196(0x28, i | ((y_field>>6) & 0x0C) | (outy>>8));
  else         write_saa7196(0x28, i | ((y_field>>6) & 0x0C) | (outy>>9));
@@ -553,10 +558,6 @@ void init_meteor(void){
                                 2  S-VHS bit
                                 1  GPSW2
                                 0  GPSW1                                   */
-// write_saa7196(0x10, 0x04);
- write_saa7196(0x10, 0x00);
-                           /*   2  Select HREF Position
-                              1:0  Vertical noise reduction                */
  write_saa7196(0x11, 0x2C);/* 7:0  Chrominance gain conrtol for QAM        */
  write_saa7196(0x14, 0x34);/* 7:0  Horizontal sync begin for 60hz          */
 //#ifdef notdef
@@ -678,3 +679,41 @@ void contGrab(void){
 
 }
 
+void doTxtHack(int txtHackState){
+  switch(txtHackState){
+    case 8 ... 100:
+                 write_saa7196(0x10, 0x00);
+                           /*   2  Select HREF Position
+                              1:0  Vertical noise reduction                */
+                 write_saa7196(0x0F, 0x90);        
+                           /*   7  Automatic Field detection
+                                6  Field Select 0 = 50hz, 1=60hz
+                                5  SECAM cross-colour reduction
+                                4  Enable sync and clamping pulse
+                              3:1  Luminance delay compensation            */
+    break;
+    case 7:
+                 write_saa7196(0x10, 0x02);
+                           /*   2  Select HREF Position
+                              1:0  Vertical noise reduction                */
+                 write_saa7196(0x0F, 0x50);        
+                           /*   7  Automatic Field detection
+                                6  Field Select 0 = 50hz, 1=60hz
+                                5  SECAM cross-colour reduction
+                                4  Enable sync and clamping pulse
+                              3:1  Luminance delay compensation            */
+    break;
+    case 6:
+                 write_saa7196(0x10, 0x02);
+                           /*   2  Select HREF Position
+                              1:0  Vertical noise reduction                */
+                 write_saa7196(0x0F, 0x90);        
+                           /*   7  Automatic Field detection
+                                6  Field Select 0 = 50hz, 1=60hz
+                                5  SECAM cross-colour reduction
+                                4  Enable sync and clamping pulse
+                              3:1  Luminance delay compensation            */
+
+    break;
+  }
+}

Modified: trunk/2010/2_71x6.h
==============================================================================
--- trunk/2010/2_71x6.h	(original)
+++ trunk/2010/2_71x6.h	Wed Jul  4 10:05:19 2007
@@ -218,5 +218,6 @@ void setCont(void);
 void setStdScale(void);
 void grab_next(VID2MEMBUF v2mb);
 void grab_nix();
+void doTxtHack(int);
 
 #endif

Modified: trunk/2010/2_all.h
==============================================================================
--- trunk/2010/2_all.h	(original)
+++ trunk/2010/2_all.h	Wed Jul  4 10:05:19 2007
@@ -2,6 +2,8 @@
 #ifndef n2_all_h
 #define n2_all_h
 
+#define NO_CRYPT
+
 #define mabs(a) ((a)<0 ? -(a) : (a))
 #define sign(a)   ((a)<0 ? -1 :  1)
 #define is_neg(a) ((a)<0 ?  0 : -1)
@@ -69,13 +71,27 @@ class color{
    COL col;
    color(void) { };
    color(int y, int u, int v, byte yuv_mode) {init(y,u,v,yuv_mode);};
-   void init(int y, int u, int v, byte yuv_mode){       // fix (yuv_mode==0)
-     col.r=minmax(0, int( y + 1.375   *v             ), 255);
-     col.g=minmax(0, int( y - 0.703125*v - 0.34375 *u), 255);
-     col.b=minmax(0, int( y              + 1.734375*u), 255);
+   void init(int y, int u, int v, bool isRGB){ 
+     if(isRGB){
+       col.r=y;
+       col.g=u;
+       col.b=v;
+       y= minmax(0   , int( (+ .299120)*col.r + (+ .584954)*col.g + (+ 0.115935)*col.b), 255);
+       u= minmax(-128, int( (- .172465)*col.r + (- .337271)*col.g + (+ 0.509731)*col.b), 127);
+       v= minmax(-128, int( (+ .509731)*col.r + (- .536992)*col.g + (- 0.084317)*col.b), 127);
+     }
+     else{
+       col.r=minmax(0, int( y + 1.375   *v             ), 255);
+       col.g=minmax(0, int( y - 0.703125*v - 0.34375 *u), 255);
+       col.b=minmax(0, int( y              + 1.734375*u), 255);
+     }
+
      const int r5= ((col.r>>3) & 0x1F);
      const int g6= ((col.g>>2) & 0x3F); 
      const int b5= ((col.b>>3) & 0x1F);
+     col.rgb16= b5 | (g6<<5) | (r5<<11);
+     col.yuv=   u | (y<<8) | (v<<16) | (y<<24);
+
 /*
      r=y + (+ 1.375   )*v             
      g=y + (- 0.703125)*v + (- 0.34375 )*u
@@ -104,12 +120,14 @@ class color{
      (+ .338346)r + (+ .661664)g +              =y +   + (- 0.227444)*u
      (+ .481203)r + (- .481203)g +              =  + v + (+ 0.165414)*u
      (- .172465)r + (- .337271)g + (+ 0.509731)b=  +   +              u
-     (- .172465)(- 0.227444)r + (- .337271)(- 0.227444)g + (+ 0.509731)(- 0.227444)b=  +   +              u(- 0.227444)
-     (- .172465)(+ 0.165414)r + (- .337271)(+ 0.165414)g + (+ 0.509731)(+ 0.165414)b=  +   +              u(+ 0.165414)
+     (+ .039226)r + (+ .076710)g + (- 0.115935)b=  +   +              u(- 0.227444)
+     (- .028528)r + (- .055789)g + (+ 0.084317)b=  +   +              u(+ 0.165414)
+
+     (+ .299120)r + (+ .584954)g + (+ 0.115935)b=y 
+     (+ .509731)r + (- .536992)g + (- 0.084317)b=  v 
+     (- .172465)r + (- .337271)g + (+ 0.509731)b=    u
   */
 
-     col.rgb16= b5 | (g6<<5) | (r5<<11);
-     col.yuv=   u | (y<<8) | (v<<16) | (y<<24);
    };
 } ;
 

Copied: trunk/2010/2_crypt.cpp (from r55, /trunk/2010/2_crypt.cc)
==============================================================================
--- /trunk/2010/2_crypt.cc	(original)
+++ trunk/2010/2_crypt.cpp	Wed Jul  4 10:05:19 2007
@@ -19,7 +19,7 @@ extern vgax, vgay, wndx, wndy, y_field, 
 extern VID2MEMBUF *actVid2MemBufp;
 extern volatile int scales_x, scalee_x;
 extern volatile int scales_y, scalee_y;
-extern int yuvmode;
+extern int yuvMode;
 extern volatile bool oneField;
 extern int satur;
 extern bool iState;
@@ -58,7 +58,7 @@ void decrypt(void){
  if(iState){
    T2=uclock();
    color c;
-   c.init(255, 0, 0, yuvmode);
+   c.init(255, 0, 0, false);
    sprintf(textbuf[1],"%f DeCrypt", (float)(T2-T1)/UCLOCKS_PER_SEC);
    gprint(infoPosX, infoPosY+=10,  c.col, textbuf[0]);
    gprint(infoPosX, infoPosY+=10,  c.col, textbuf[1]);
@@ -218,7 +218,7 @@ static void decomb(int q){
 
 static void vSmooth(void){
 
- if(yuvmode==0){
+ if(yuvMode==0){
  /*  asm(//"int $3                      \n\t"
        "1:                          \n\t"
        "movl (%%esi        ), %%eax \n\t"    //U         LINE

Copied: trunk/2010/2_file.cpp (from r52, /trunk/2010/2_file.cc)
==============================================================================
--- /trunk/2010/2_file.cc	(original)
+++ trunk/2010/2_file.cpp	Wed Jul  4 10:05:19 2007
@@ -12,7 +12,7 @@
  extern byte font[4096];
  extern VID2MEMBUF *actVid2MemBufp;
  extern int g_mode;
- extern int yuvmode;
+ extern int yuvMode;
  extern char *yuv2rgb_lut;
 
 void grab(void){
@@ -46,7 +46,7 @@ void grab(void){
 
  fwrite(&bmpi, sizeof(bmpi), 1, fg);
  for(i=wndy-1; i>=0; i--){
-   if(yuvmode==0){
+   if(yuvMode==0){
      for(j=0; j<wndx; j++){
 /*       const int b=  (actVid2MemBufp->b[ (j + i*vgax)<<1   ] & 0x1F) << 3;
        const int g= ((actVid2MemBufp->b[ (j + i*vgax)<<1   ] & 0xE0) >> 3)

Copied: trunk/2010/2_gfunc.cpp (from r55, /trunk/2010/2_gfunc.cc)
==============================================================================
--- /trunk/2010/2_gfunc.cc	(original)
+++ trunk/2010/2_gfunc.cpp	Wed Jul  4 10:05:19 2007
@@ -12,9 +12,10 @@
  extern int page_flip;
  extern VID2MEMBUF *actVid2MemBufp;
  extern byte *vidbuf;
- extern int yuvmode;
+ extern int yuvMode;
 
-static inline void memsetd(void *pt, u_long c, int num);
+static inline void memsetw(void *pt, u_short c, int num);
+static inline void memsetd(void *pt, u_long  c, int num);
 
 static inline void memsetd(void *pt, u_long c, int num){
 
@@ -28,6 +29,44 @@ static inline void memsetd(void *pt, u_l
 
 }
 
+static inline void memsetw(void *pt, u_short c, int num){
+
+ asm(//"int $3 \n\t"
+     "rep    \n\t"
+     "stosw  \n\t"
+     :
+     : "a" (c), "D" (pt), "c" (num)
+     : "%ecx", "%edi");
+
+
+}
+
+void rect(int xs, int ys, int xe, int ye, const COL c){
+  if(xs<0) xs=0;
+  if(ys<0) ys=0;
+  if(xe>vgax) xe=vgax;
+  if(ye>vgay) ye=vgay;
+
+  if(xe<0) xs=0;
+  if(ye<0) ys=0;
+  if(xs>vgax) xe=vgax;
+  if(ys>vgay) ye=vgay;
+
+  if(yuvMode){
+    xs>>=1;
+    xe>>=1;
+    for(int y=ys; y<ye; y++){
+      memsetd( &actVid2MemBufp->b[(y*vgax +xs+xs) << mc], c.yuv, xe-xs);
+    }
+  }
+  else{
+    for(int y=ys; y<ye; y++){
+      memsetw( &actVid2MemBufp->b[(y*vgax +xs) << mc], c.rgb16, xe-xs);
+    }
+  }
+
+}
+
 void xcliped_gprint(int xp, int yp, const COL c, int text){
  int ix, iy;
  int t3;
@@ -42,7 +81,7 @@ void xcliped_gprint(int xp, int yp, cons
    else ix=-xp;
    for(; ix<8 && ix+xp<vgax; ix++){
      if(((t1>>(7-ix)) & 1) == 1){
-       if(yuvmode!=0)
+       if(yuvMode!=0)
          ((long*) actVid2MemBufp->b)[(ix+t3)>>1]=c.yuv;      
        else                                   
          ((short*)actVid2MemBufp->b)[(ix+t3)   ]=c.rgb16;      
@@ -88,7 +127,7 @@ void gprint(int xp, int yp, const COL c,
 
  static int vgaxmc;
  vgaxmc= vgax<<mc;
- if(yuvmode!=0){
+ if(yuvMode!=0){
    asm(//"int $3\n\t"
         "pushl %%ebp               \n\t"
         "pushl %%eax               \n\t"

Modified: trunk/2010/2_gfunc.h
==============================================================================
--- trunk/2010/2_gfunc.h	(original)
+++ trunk/2010/2_gfunc.h	Wed Jul  4 10:05:19 2007
@@ -2,6 +2,7 @@
 #ifndef n2_gfunc_h
 #define n2_gfunc_h
 
+void rect(int xs, int ys, int xe, int ye, const COL c);
 void gprint(int xp, int yp, const COL c, char *text);
 void xcliped_gprint(int xp, int yp, const COL c, int text);
 

Copied: trunk/2010/2_grafix.cpp (from r55, /trunk/2010/2_grafix.cc)
==============================================================================
--- /trunk/2010/2_grafix.cc	(original)
+++ trunk/2010/2_grafix.cpp	Wed Jul  4 10:05:19 2007
@@ -15,7 +15,7 @@
  extern int fysize;
  extern byte font[4096];
  extern int grabf;
- extern int yuvmode;
+ extern int yuvMode;
  extern volatile int addr_errors, corr_errors;
  extern int single;
  extern int bright, contr, satur;
@@ -35,7 +35,7 @@ void showStuff(void){
  color c;
 
  if(helpState){
-   char text[11][256]={ "F1/F2 Brightness     s TVStandart",
+   char text[14][256]={ "F1/F2 Brightness     s TVStandart",
                         "F3/F4 Contrast       i debugInfo",
                         "F5/F6 Saturation     h Help", 
                         "g     ScreenShot     q Quit",
@@ -45,10 +45,13 @@ void showStuff(void){
                         "+     Page+      -     Page-",
                         "right subPage+   left  subPage-",
                         "up    Channel+   down  Channel-",
-                        "c txt Channel    a num Page" };
+                        "c txt Channel    a num Page",
+                        "g     savePage   G     saveAll",
+                        "e     delUnSeen",
+                        "f txt find       F     findNext"};
 
-   for(int i=0; i<11; i++){
-     c.init(255, 0, 0, yuvmode);
+   for(int i=0; i<14; i++){
+     c.init(255, 0, 0, false);
      gprint(infoPosX, infoPosY+=10, c.col, text[i]);
    }
    infoPosY+=5;
@@ -57,7 +60,7 @@ void showStuff(void){
  if(showCont!=0){
    showCont--;
    sprintf(textbuf,"%3.1f%% brightness", bright/2.55);
-   c.init(255, 0, 0, yuvmode);
+   c.init(255, 0, 0, false);
 
    gprint(infoPosX, infoPosY+=10, c.col, textbuf);
    sprintf(textbuf,"%3.1f%% contrast"  , contr/1.27);
@@ -68,11 +71,17 @@ void showStuff(void){
  }
 
  if(menuLevel==mLTVStd){
-   char text[3][256]={ "1. PAL   4. VideoCrypt (PAL)",
-                       "2. NTSC  5. NagraVision (PAL/SECAM)",
-                       "3. SECAM 6. Pal-TeleText"};
+#ifdef NO_CRYPT
+   char text[3][256]={ "1. PAL   4. PAL-TeleText",
+                       "2. NTSC",
+                       "3. SECAM"};
+#else
+   char text[3][256]={ "1. PAL   4. PAL-TeleText",
+                       "2. NTSC  5. VideoCrypt (PAL)",
+                       "3. SECAM 6. NagraVision (PAL/secam)"};
+#endif
    for(int i=0; i<3; i++){
-     c.init(255, 0, 0, yuvmode);
+     c.init(255, 0, 0, false);
      gprint(infoPosX, infoPosY+=10, c.col, text[i]);
    }
    infoPosY+=5;
@@ -82,7 +91,7 @@ void showStuff(void){
  long T1=uclock();
 
  if(iState){
-   c.init(255, 0, 0, yuvmode);
+   c.init(255, 0, 0, false);
 
    sprintf(textbuf,"%2.2f Fps",1/((float)(T1-T2)/UCLOCKS_PER_SEC));
    gprint(infoPosX, infoPosY+=10, c.col, textbuf);
@@ -90,7 +99,7 @@ void showStuff(void){
    sprintf(textbuf,"%d Buf", vid2MemBuf[0].num);
    gprint(infoPosX+110, infoPosY   , c.col, textbuf);
 
-   if(yuvmode==0) sprintf(textbuf,"RGB16");
+   if(yuvMode==0) sprintf(textbuf,"RGB16");
    else           sprintf(textbuf,"YUV422");
    gprint(infoPosX+170, infoPosY   , c.col, textbuf);
 

Copied: trunk/2010/2_hw.cpp (from r55, /trunk/2010/2_hw.cc)
==============================================================================
--- /trunk/2010/2_hw.cc	(original)
+++ trunk/2010/2_hw.cpp	Wed Jul  4 10:05:19 2007
@@ -22,7 +22,7 @@
  extern int bpp;
 
  extern volatile int page_flip;
- extern volatile int yuvmode;
+ extern volatile int yuvMode;
  extern volatile AllocList *alloclist;
  extern volatile VID2MEMBUF *vid2MemBuf, *actVid2MemBufp;
  extern volatile int grabVid2MemBuf, actVid2MemBuf;
@@ -53,7 +53,7 @@
 
 void mem2vid(byte *to, byte *from, int num, int bpp){
 
- if(yuvmode!=0){
+ if(yuvMode!=0){
    asm(//"int $3                            \n\t"
        "pushl %%ebp                       \n\t"
        "movl %%eax, %%ebp                 \n\t"
@@ -303,7 +303,7 @@ void copy_vidbuffer(void){
    char textBuf[128];
    sprintf(textBuf, "%f vid2Mem", (float)(T2-T1)/UCLOCKS_PER_SEC);
    color c;
-   c.init(255, 0, 0, yuvmode);
+   c.init(255, 0, 0, false);
    gprint(infoPosX, infoPosY+=10,  c.col, textBuf);
    T1=uclock();
    infoPosY+=5;

Modified: trunk/2010/2_hw_asm.s
==============================================================================
--- trunk/2010/2_hw_asm.s	(original)
+++ trunk/2010/2_hw_asm.s	Wed Jul  4 10:05:19 2007
@@ -19,7 +19,8 @@
 .globl _mc
 .globl _xresc
 .globl _vgay
-.globl _yuvmode
+.globl _yuvMode
+.globl _grabYuvMode
 .globl _locklist
 .globl _alloclist
 .globl _vdslist
@@ -69,7 +70,8 @@ _mc: .long 0
 _xresvb: .long 0
 _xresc: .long 0
 _vgay: .long 0
-_yuvmode: .long 0
+_yuvMode: .long 0
+_grabYuvMode: .long 0
 _locklist: .long 0
 _alloclist: .long 0
 _vdslist: .long 0

Copied: trunk/2010/2_nag.cpp (from r54, /trunk/2010/2_nag.cc)
==============================================================================
--- /trunk/2010/2_nag.cc	(original)
+++ trunk/2010/2_nag.cpp	Wed Jul  4 10:05:19 2007
@@ -30,7 +30,7 @@ extern volatile int scales_x, scalee_x;
 extern volatile int scales_y, scalee_y;
 extern u_long asm_temp, asm_temp4;
 extern bool iState;
-extern int yuvmode;
+extern int yuvMode;
 extern bool mmx;
 extern int infoPosX;
 extern int infoPosY;
@@ -1010,7 +1010,7 @@ void nag_decrypt(void){
 
  if(iState){
    T2=uclock();          
-   c.init(255, 0, 0, yuvmode);
+   c.init(255, 0, 0, false);
    gprint(infoPosX, infoPosY+=10,  c.col, textbuf[0]);
    gprint(infoPosX, infoPosY+=10,  c.col, textbuf[1]);
    gprint(infoPosX, infoPosY+=10, c.col, textbuf[2]);

Copied: trunk/2010/2_txt.cpp (from r55, /trunk/2010/2_txt.cc)
==============================================================================
--- /trunk/2010/2_txt.cc	(original)
+++ trunk/2010/2_txt.cpp	Wed Jul  4 10:05:19 2007
@@ -9,6 +9,9 @@
 #include "2_crypt.h"
 #include "2_gfunc.h"
 #include "2_txt.h"
+#include "2_71x6.h"
+
+#define FORCE_ORDER true
 
 extern int vgax, vgay, wndx, wndy, mc, x_field;
 extern bool iState, helpState;
@@ -16,8 +19,9 @@ extern volatile scales_x, scalee_x;
 extern volatile scales_y, scalee_y;
 extern VID2MEMBUF *actVid2MemBufp;
 extern int some;
-extern int yuvmode;
+extern int yuvMode;
 extern int infoPosX, infoPosY;
+extern int grabf;
 
 #define FREQ_TXT 6.9375E6
 #define FIXP_SH 16
@@ -28,6 +32,38 @@ char reqChanStr[16];
 int reqChanNum=0;
 int reqPage=0x100;
 int reqSubPage=0;
+char findTxt[128]={0,0,};
+
+       // FIX all langs and add graph to ascii if saved in text
+
+static int reMapTab[8][13]={
+  {0x9C, 0x24, 0x40, 0x1B, 0xAB, 0x1A, 0x18, 0x23, 0xC4, 0xAC, 0xBA, 0x00, 0xF6},
+  {0x23, 0x24, 0x15, 0x8E, 0x99, 0x9A, 0x5E, 0x5F, 0xA7, 0x84, 0x94, 0x81, 0xE1},
+
+  {0x9C, 0x24, 0x40, 0x1B, 0xAB, 0x1A, 0x18, 0x23, 0xC4, 0xAC, 0xBA, 0x00, 0xF6},
+  {0x9C, 0x24, 0x40, 0x1B, 0xAB, 0x1A, 0x18, 0x23, 0xC4, 0xAC, 0xBA, 0x00, 0xF6},
+  {0x9C, 0x24, 0x40, 0x1B, 0xAB, 0x1A, 0x18, 0x23, 0xC4, 0xAC, 0xBA, 0x00, 0xF6},
+  {0x9C, 0x24, 0x40, 0x1B, 0xAB, 0x1A, 0x18, 0x23, 0xC4, 0xAC, 0xBA, 0x00, 0xF6},
+  {0x9C, 0x24, 0x40, 0x1B, 0xAB, 0x1A, 0x18, 0x23, 0xC4, 0xAC, 0xBA, 0x00, 0xF6},
+  {0x9C, 0x24, 0x40, 0x1B, 0xAB, 0x1A, 0x18, 0x23, 0xC4, 0xAC, 0xBA, 0x00, 0xF6}
+ };
+
+static int isReMap[128]={
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 8,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10,11,12,13, 0 };
+
+static inline void txtCpy(char *to, u_char *from, int num){
+  for(int i=0; i<num; i++){
+    if((from[i]&0x80) && !(to[i]&0x80)) continue;
+    to[i]=from[i];
+  }
+}
 
 static inline float atan3(const float f1, const float f2){
   float out;
@@ -42,6 +78,15 @@ static inline float atan3(const float f1
   return out;
 }
 
+static inline void reMapCpy(char *to, char *from, int num, int land){
+  for(int i=0; i<num; i++){
+    char a= from[i] & 0x7F;
+    if(a<0x20) a=0x20;
+    if(isReMap[a]) to[i]=reMapTab[land][ isReMap[a] - 1 ];
+    else           to[i]=a;
+  }
+}
+
 static signed char corrHamm48[256]={
   0x01, 0xff, 0x01, 0x01, 0xff, 0x00, 0x01, 0xff,  0xff, 0x02, 0x01, 0xff, 0x0a, 0xff, 0xff, 0x07, 
   0xff, 0x00, 0x01, 0xff, 0x00, 0x00, 0xff, 0x00,  0x06, 0xff, 0xff, 0x0b, 0xff, 0x00, 0x03, 0xff, 
@@ -75,9 +120,10 @@ static inline int sample(byte *b, int fi
 
 void txt_decrypt(void){
   char textbuf[9][128];
-  color c;
 
   static int hammErr=0;
+  static int pages=0;
+  static int parities=0;
 
   const double freqPix2= double(wndx) / double(x_field) * FREQ_PIX;
   const int delta= int(freqPix2/FREQ_TXT*ONE_FIXP);
@@ -89,7 +135,8 @@ void txt_decrypt(void){
   static CACHE1 *cache1=new CACHE1[1024];
   static int cache1Size=0;
   static bool first=true;
-  static color txtCol[8];
+  static color txtColor[8];
+  static MAG mag[8];
   if(first){
     FILE *f= fopen("chaninf.txt", "rb");
     if(f==NULL) error(TxtFile);
@@ -106,33 +153,37 @@ void txt_decrypt(void){
       j^= j<<4;                     
       fixParity[i]= i ^ (j&0x80) ^ 0x80;  
     }
-    // FIX OVERFLOWS ...
-    txtColor[0].init(  0,  0,  0, yuvmode);
-    txtColor[1].init(255,  0,  0, yuvmode);
-    txtColor[2].init(255,  0,  0, yuvmode);
-    txtColor[3].init(255,  0,  0, yuvmode);
-    txtColor[4].init(255,  0,  0, yuvmode);
-    txtColor[5].init(255,  0,  0, yuvmode);
-    txtColor[6].init(255,  0,  0, yuvmode);
-    txtColor[7].init(255,  0,  0, yuvmode);
+    txtColor[0].init(  0,  0,  0, true);
+    txtColor[1].init(255,  0,  0, true);
+    txtColor[2].init(  0,255,  0, true);
+    txtColor[3].init(255,255,  0, true);
+    txtColor[4].init(  0,  0,255, true);
+    txtColor[5].init(255,  0,255, true);
+    txtColor[6].init(  0,255,255, true);
+    txtColor[7].init(255,255,255, true);
+
+    for(int i=0; i<8; i++) mag[i].pt=NULL;
     first=false;
   }
 
-  static CACHE2 *mag[8]={NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
-
   byte data[64];
 
+  int txtHack=4;
+  static int txtHackState=0;
+
   int linep=-(vgax<<4);
   for(int line=0; line<40; line++){
     linep+=vgax<<4;
     if(line==20) linep=vgax<<3;
 
+    if(txtHackState) break;
+
 
     int avg=0;
-    for(int x=0; x<50; x++){
+    for(int x=0; x<((10*delta)>>FIXP_SH); x++){
       avg+=actVid2MemBufp->b[linep + (x<<1) + 1];
     }
-    avg/=50;
+    avg/=((10*delta)>>FIXP_SH);
 
         // FIX ? optimize in fixp and lut ...
     double si=0, co=0;
@@ -196,10 +247,16 @@ void txt_decrypt(void){
 
     if(d0<0 || d1<0){ hammErr++; continue;}
 
+    if(line==0 || line==39) txtHack+=1000;
+    else txtHack--;
+
     const int magAddr= d0 & 0x7;
     const int rowAddr= (d0>>3) | (d1<<1);       
 
+    printf("lrm %d %d %d\n", line, rowAddr, magAddr);
+
     if(rowAddr==0){
+      mag[magAddr].pt=NULL;
       const int d2= corrHamm48[ data[2] ];
       const int d3= corrHamm48[ data[3] ];
       const int d4= corrHamm48[ data[4] ];
@@ -209,11 +266,15 @@ void txt_decrypt(void){
       const int d8= corrHamm48[ data[8] ];
       const int d9= corrHamm48[ data[9] ];
 
-      if(d2<0 || d3<0 || d4<0 || d5<0 || d6<0 || d7<0 || d8<0 || d9<0){ hammErr++; continue;}
+      if(d2<0 || d3<0 || d4<0 || d5<0 || d6<0 || d7<0 || d8<0 || d9<0){
+        hammErr++;
+        continue;
+      }
 
       const int lsPage = d2 | (d3<<4);
       const int subPage=(d4 | (d5<<4) | (d6<<8) | (d7<<12)) & 0x3F7F;
       const int page   =(magAddr<<8) | lsPage;
+      mag[magAddr].land= d9 & 0x7;
 
       for(int i=10; i<BYTES; i++){
         data[i]= fixParity[ data[i] ];
@@ -242,7 +303,7 @@ void txt_decrypt(void){
 
       if(bestLen==0){
         printf(" ERR Unknown Stuff: %32s\n", &data[10]);
-        mag[magAddr]=NULL;
+        mag[magAddr].pt=NULL;
         continue;
       }
       cache1Ndx=best;
@@ -253,20 +314,24 @@ void txt_decrypt(void){
       }
 
       if(cache1[cache1Ndx].pt[page]==NULL){
+        pages++;
         cache1[cache1Ndx].pt[page]= new CACHE2;
         cache1[cache1Ndx].pt[page]->next=NULL;
         cache1[cache1Ndx].pt[page]->seen=false;
-        memset(cache1[cache1Ndx].pt[page]->text, ' ', 40*LINES);
-        mag[magAddr]= cache1[cache1Ndx].pt[page];
+        cache1[cache1Ndx].pt[page]->land=mag[magAddr].land;
+        memset(cache1[cache1Ndx].pt[page]->text, 0xFF, 40*LINES);
+        mag[magAddr].pt= cache1[cache1Ndx].pt[page];
+        mag[magAddr].order=0;
       }
       else{
         CACHE2 *p=cache1[cache1Ndx].pt[page];
         while(p->next!=NULL && p->next->sub<=subPage) p=p->next;
 
-        if(p->sub==subPage) mag[magAddr]= p;        
+        if(p->sub==subPage) mag[magAddr].pt= p, mag[magAddr].order=0;        
         else{
+          pages++;
           CACHE2 *temp= new CACHE2;
-          memset(temp->text, ' ', 40*LINES);
+          memset(temp->text, 0xFF, 40*LINES);
 
           if(p->sub<subPage){
             temp->next= p->next;
@@ -278,21 +343,27 @@ void txt_decrypt(void){
           }
 
           temp->seen=false;
-          mag[magAddr]= temp;
+          mag[magAddr].pt= temp;
+          mag[magAddr].order=0;
         }
       }
 
-      mag[magAddr]->sub=subPage;
-      memcpy(&mag[magAddr]->text[rowAddr*40], data+10, 32);
+      mag[magAddr].pt->land=mag[magAddr].land;
+      mag[magAddr].pt->sub=subPage;
+      mag[magAddr].order=0;
+      txtCpy(&mag[magAddr].pt->text[rowAddr*40], data+10, 32);
 
     }
     else if(rowAddr<LINES){
-      if(mag[magAddr]==NULL) continue;
+      if(FORCE_ORDER && mag[magAddr].order>=rowAddr) mag[magAddr].pt=NULL;
+      if(mag[magAddr].pt==NULL) continue;
+      mag[magAddr].order=rowAddr;
 
       for(int i=2; i<BYTES; i++){
         data[i]= fixParity[ data[i] ];
+        if(data[i]&0x80) parities++;
       }
-      memcpy(&mag[magAddr]->text[rowAddr*40], data+2, 40);
+      txtCpy(&mag[magAddr].pt->text[rowAddr*40], data+2, 40);
 
     }
 
@@ -302,6 +373,13 @@ void txt_decrypt(void){
 
   memset(actVid2MemBufp->b, 0, vgax*vgay<<mc);
 
+  if(txtHack>0 && txtHackState==0) txtHackState=14;
+
+  if(txtHackState>0){
+    doTxtHack(txtHackState);
+    txtHackState--;
+  }
+
   if(iState || helpState) return;
 
   static int lastReqPage=-1, lastReqSubPage=-1, lastReqChanNum=-1;
@@ -315,8 +393,8 @@ void txt_decrypt(void){
 
   reqPage&=0x7FF;
   if(reqSubPage<0) reqSubPage=0;
-  if(reqChanNum<0) reqChanNum=0;
-  if(reqChanNum>=cache1Size) reqChanNum=cache1Size-1;
+  if(reqChanNum<0          ) reqChanNum= cache1Size-1;
+  if(reqChanNum>=cache1Size) reqChanNum= 0;
 
   int start=reqChanNum;
   do{
@@ -328,42 +406,191 @@ void txt_decrypt(void){
 
   if(cache1[reqChanNum].pt==NULL) return;
 
-  start=reqPage;
-  do{
-    if(cache1[reqChanNum].pt[reqPage]!=NULL) break;
-    reqPage+= seekPageDelta;
-    reqPage&= 0x7FF;
-  }while(start!=reqPage);
+  CACHE2 *p=NULL;
+  bool reqSearch=true;
+  if((findTxt[0]) && (findTxt[1])){
+    findTxt[0]=0;
 
-  if(cache1[reqChanNum].pt[reqPage]==NULL) return;
+    bool found=false;
+    int start=reqPage;
+    int page=start+1;
+    const int len=strlen(&findTxt[1]);
+    while(page!=start){
+      p=cache1[reqChanNum].pt[page];
+      while(p!=NULL){
+        for(int i=0; i<LINES*40; i++)
+          if(!strnicmp(&findTxt[1], &p->text[i], min(LINES*40-i, len))){
+            found=true;
+            break;
+          }
+        if(found) break;
+        p=p->next;
+      }
+      if(found) break;
+      page++;
+      page&=0x7FF;
+    }
+    if(found){
+      reqPage=page;
+      reqSubPage=p->sub;
+      reqSearch=false;
+    }
+  }
+  if(reqSearch){
 
-  CACHE2 *p=cache1[reqChanNum].pt[reqPage];
-  CACHE2 *largep=p, *smallp=p;
+    start=reqPage;
+    do{
+      if(cache1[reqChanNum].pt[reqPage]!=NULL) break;
+      reqPage+= seekPageDelta;
+      reqPage&= 0x7FF;
+    }while(start!=reqPage);
 
-  while(p!=NULL){
-    if(p->sub==reqSubPage) break;
-    largep=p;
-    p=p->next;
+    if(cache1[reqChanNum].pt[reqPage]==NULL) return;
+
+    p=cache1[reqChanNum].pt[reqPage];
+    CACHE2 *firstp=p, *lastp=p, *largep=NULL, *smallp=NULL;
+
+    while(p!=NULL){
+      if(p->sub==reqSubPage) break;
+      if(p->sub<reqSubPage && (smallp==NULL || p->sub>smallp->sub)) smallp=p;
+      if(p->sub>reqSubPage && (largep==NULL || p->sub<largep->sub)) largep=p;
+      lastp=p;
+      p=p->next;
+    }
+
+    if(p==NULL){
+      if(largep==NULL) largep=firstp;
+      if(smallp==NULL) smallp=lastp;
+      if(seekSubPageDelta>0) p=largep;
+      else                   p=smallp;
+    }
+
+    reqSubPage=p->sub;
   }
 
-  if(p==NULL || p->sub!=reqSubPage){
-    if(largep->sub<reqSubPage) largep=smallp;
-    if(smallp->sub>reqSubPage) smallp=largep;
-    if(seekSubPageDelta>0) p=largep;
-    else                   p=smallp;
+  int yPos=0;
+  for(int line=0; line<LINES; line++){
+    int fgColorNdx=7;
+    int bgColorNdx=0;
+    bool flash=false;
+    bool graph=false;
+    bool contGraph=true;
+    int xs=0;
+    int xPos=10;
+
+    while(xs<40){
+      while(xs<40 && (     p->text[line*40 + xs] < 0x20
+                      || ((p->text[line*40 + xs]&0x20) && graph) ) ){
+        const int d= p->text[line*40 + xs];
+        if(d<0x20){
+          if((d&0xF)<8){
+            fgColorNdx= d&0xF;
+            if(d&0x10) graph=true;
+            else       graph=false;
+          }
+          else if(d==0x1C) bgColorNdx=0;
+          else if(d==0x1D) bgColorNdx=fgColorNdx;
+          else if(d==0x19) contGraph=true;
+          else if(d==0x1A) contGraph=false;
+          rect(xPos, yPos+1, xPos+9, yPos+13, txtColor[bgColorNdx].col);
+        }
+        else{
+          rect(xPos, yPos+1, xPos+9, yPos+13, txtColor[bgColorNdx].col);
+          if(contGraph){
+            if(d&0x01) rect(xPos  , yPos+1, xPos+4, yPos+4 , txtColor[fgColorNdx].col);
+            if(d&0x02) rect(xPos+4, yPos+1, xPos+9, yPos+4 , txtColor[fgColorNdx].col);
+            if(d&0x04) rect(xPos  , yPos+4, xPos+4, yPos+8 , txtColor[fgColorNdx].col);
+            if(d&0x08) rect(xPos+4, yPos+4, xPos+9, yPos+8 , txtColor[fgColorNdx].col);
+            if(d&0x10) rect(xPos  , yPos+8, xPos+4, yPos+13, txtColor[fgColorNdx].col);
+            if(d&0x40) rect(xPos+4, yPos+8, xPos+9, yPos+13, txtColor[fgColorNdx].col);
+          }
+          else{
+            if(d&0x01) rect(xPos+1, yPos+2, xPos+4, yPos+4 , txtColor[fgColorNdx].col);
+            if(d&0x02) rect(xPos+5, yPos+2, xPos+9, yPos+4 , txtColor[fgColorNdx].col);
+            if(d&0x04) rect(xPos+1, yPos+5, xPos+4, yPos+8 , txtColor[fgColorNdx].col);
+            if(d&0x08) rect(xPos+5, yPos+5, xPos+9, yPos+8 , txtColor[fgColorNdx].col);
+            if(d&0x10) rect(xPos+1, yPos+9, xPos+4, yPos+13, txtColor[fgColorNdx].col);
+            if(d&0x40) rect(xPos+5, yPos+9, xPos+9, yPos+13, txtColor[fgColorNdx].col);
+          } 
+        }   
+
+        xPos+=9;
+        xs++;
+      }
+
+      int xe=xs;
+      if(xs>=40) break;
+
+      while(xe<40 && p->text[line*40 + xe] >= 0x20
+                  && (!(p->text[line*40 + xe]&0x20) || !graph)  ) xe++;
+      reMapCpy(textbuf[0], &p->text[line*40 + xs], xe-xs, p->land);
+
+
+      textbuf[0][xe-xs]=0;
+      rect(xPos, yPos+1, xPos+9*(xe-xs), yPos+13, txtColor[bgColorNdx].col);
+      gprint(xPos, yPos, txtColor[fgColorNdx].col, textbuf[0]);
+
+      xPos+=(xe-xs)*9;
+
+      xs=xe;
+    }
+
+    if(line==0){
+      sprintf(textbuf[0], " %d %d", pages, parities);
+      gprint(10+32*9, yPos, txtColor[7].col, textbuf[0]);
+    }
+
+    yPos+=12;
   }
 
-  reqSubPage=p->sub;
+  if(grabf){
+    char name[13]="12345678.123";
+    if(grabf==1)
+      sprintf(name, "%3X%3X.TXT", reqChanNum, reqPage);
+    else
+      sprintf(name, "%3X.TXT", reqChanNum);
 
-  for(int i=0; i<LINES; i++){
-//    int colorNdx=
+    FILE *f= fopen(name, "wb");
+    if(f==NULL) error(TxtFile);
 
-    sprintf(textbuf[0],"%40s", &p->text[i*40]);
-    c.init(255, 0, 0, yuvmode);
-    gprint(10, infoPosY+=10,  c.col, textbuf[0]);
+    char temp[LINES*40+1];
+
+    if(grabf==1){
+      CACHE2 *p=cache1[reqChanNum].pt[reqPage];
+      while(p!=NULL){
+        reMapCpy(temp, p->text, 40*LINES, p->land);
+        for(int y=0; y<LINES; y++){
+          for(int x=0; x<40; x++){
+            char a= temp[x + y*40];
+            fputc(a, f);
+          }
+          fputs("\n", f);
+        }
+        p=p->next;
+        fputs("\n", f);
+      }
+    }
+    else{
+      for(int page=0; page<0x800; page++){
+        CACHE2 *p=cache1[reqChanNum].pt[page];
+        while(p!=NULL){
+          reMapCpy(temp, p->text, 40*LINES, p->land);
+          for(int y=0; y<LINES; y++){
+            for(int x=0; x<40; x++){
+              char a= temp[x + y*40];
+              fputc(a, f);
+            }
+            fputs("\n", f);
+          }
+          p=p->next;
+          fputs("\n", f);
+        }
+      }
+    }
 
+    grabf=0;
   }
-//  printf("bad ham's %d\n", hammErr);
+
 
 
   lastReqPage=   reqPage;
@@ -372,6 +599,8 @@ void txt_decrypt(void){
 
   infoPosY+=5;
 
+  if(parities>9999) parities-=9000;
+
 }
 
 

Modified: trunk/2010/2_txt.h
==============================================================================
--- trunk/2010/2_txt.h	(original)
+++ trunk/2010/2_txt.h	Wed Jul  4 10:05:19 2007
@@ -9,6 +9,7 @@ struct CACHE2{
   bool seen;
   char text[LINES*40];
   CACHE2 *next;
+  int land;
 };
 
 struct CACHE1{
@@ -16,6 +17,12 @@ struct CACHE1{
   CACHE2 **pt;
 };
 
+struct MAG{
+  CACHE2 *pt;
+  int order;
+  int land;
+};
+
 void txt_decrypt(void);
 
 #endif

Copied: trunk/2010/2_vc.cpp (from r55, /trunk/2010/2_vc.cc)
==============================================================================
--- /trunk/2010/2_vc.cc	(original)
+++ trunk/2010/2_vc.cpp	Wed Jul  4 10:05:19 2007
@@ -57,7 +57,7 @@ extern volatile int scales_x, scalee_x;
 extern volatile int scales_y, scalee_y;
 extern bool showPoints;
 extern bool iState;
-extern int yuvmode;
+extern int yuvMode;
 extern int some;
 extern bool mmx;
 extern int infoPosX;
@@ -782,7 +782,7 @@ void vc_decrypt(void){
    sprintf(textbuf[4],"%f FindPhaseDiff2 / Drift", (float)(TPhaseDiff2_Drift)/UCLOCKS_PER_SEC);
    sprintf(textbuf[5],"%f EdgeDetect", (float)(TEdgeDetect)/UCLOCKS_PER_SEC);
    sprintf(textbuf[6],"%f Rotate / ColorFix", (float)(T2-T1-uclockWaste)/UCLOCKS_PER_SEC);
-   c.init(255, 0, 0, yuvmode);
+   c.init(255, 0, 0, false);
    gprint(infoPosX, infoPosY+=10, c.col, textbuf[0]);
    gprint(infoPosX, infoPosY+=10, c.col, textbuf[1]);
    gprint(infoPosX, infoPosY+=10, c.col, textbuf[2]);



More information about the Mndiff-dev mailing list