void Edito()                            // l'EDITO!
{  const XPosTxt=96;
   const YPosTxt=0;
        Fade2Black (pal);
        ChargeTEXT("edito.bin",21);
   InitDefil(XPosTxt+((llen-1)*8)+5,YPosTxt,LpP*18);

        readGIF("EDITO4.GIF",Vbuffer,pal);
   if (Vesa12Beuark)                 // si Vesa 1.2 Compatible
    { CopyBuf2Buf(Vbuffer,Vtmpbuf);    // copy toute la page dans le tmpbuffer
      ConfigR2B(XPosTxt, YPosTxt, 8*(llen-1),(LpP+1)*18);
    }
   else
    { VSwpscr(Vbuffer);                // sinon on l'affiche directos
      ConfigR2B(XPosTxt, YPosTxt, 8*llen,LpP*18);
    }
        NumLig=0; AfficheTxt(XPosTxt, YPosTxt, NumLig);
        FadeFBlack(pal); CopyColors(pal,palt2);;
        InitKey();
        do
        { TestSaveTxt("edito.bin"); TestColor(); TestZic();
          TestTEXT(XPosTxt,YPosTxt);
        } while (!WasKey(KeyEsc));/**/
        Fade2Black (palt2);
        free(TEXTbuffer);
   FadeOk=0;
}

void Delire(char *NomTexte)
{ const XPosTxt=8;
  const YPosTxt=90;
        Fade2Black (pal);
        ChargeTEXT(NomTexte,21);
   InitDefil(XPosTxt-8,YPosTxt,LpP*18);

        readGIF("DELIRIUM.GIF",Vbuffer,pal);
  if (Vesa12Beuark)                 // si Vesa 1.2 Compatible
   { CopyBuf2Buf(Vbuffer,Vtmpbuf);    // copy toute la page dans le tmpbuffer
     ConfigR2B(XPosTxt, YPosTxt, 8*(llen-1),(LpP+1)*18);
   }
  else
   { VSwpscr(Vbuffer);                // sinon on l'affiche directos
     ConfigR2B(XPosTxt-8, YPosTxt, 8*(llen-1)+8,LpP*18);
   }
        NumLig=0; AfficheTxt(XPosTxt, YPosTxt, NumLig);
        FadeFBlack(pal); CopyColors(pal,palt2);
        InitKey();
        do
        { TestSaveTxt(NomTexte); TestColor(); TestZic();
          TestTEXT(XPosTxt,YPosTxt);
        } while (!WasKey(KeyEsc));
        Fade2Black (palt2);
        free(TEXTbuffer);
   FadeOk=0;
}


void TrueLife(char *NomTexte) 
{  const XPosTxt=8;
   const YPosTxt=90;
        Fade2Black (pal);
        ChargeTEXT(NomTexte,21);
   InitDefil(XPosTxt-8,YPosTxt,LpP*18);

        readGIF("CHASSE6.GIF",Vbuffer,pal);
  if (Vesa12Beuark)                 // si Vesa 1.2 Compatible
   { CopyBuf2Buf(Vbuffer,Vtmpbuf);    // copy toute la page dans le tmpbuffer
     ConfigR2B(XPosTxt, YPosTxt, 8*(llen-1),(LpP+1)*18);
   }
  else
   { VSwpscr(Vbuffer);              
     ConfigR2B(XPosTxt-8, YPosTxt, 8*(llen-1)+8,LpP*18);
   }
        NumLig=0; AfficheTxt(XPosTxt, YPosTxt, NumLig);
        FadeFBlack(pal); CopyColors(pal,palt2);
        InitKey();
        do
        { TestSaveTxt(NomTexte); TestColor(); TestZic();
          TestTEXT(XPosTxt,YPosTxt);
        } while (!WasKey(KeyEsc));
        Fade2Black (palt2);
        free(TEXTbuffer);
   FadeOk=0;
}


void Progra(char *NomTexte)                    // Rubrique Programmation !
{  const XPosTxt=16;
   const YPosTxt=80;
        Fade2Black (pal);
        ChargeTEXT(NomTexte,21);
   InitDefil(XPosTxt-8,YPosTxt,LpP*18);

        readGIF("PROGRA.GIF",Vbuffer,pal);
  if (Vesa12Beuark)                 // si Vesa 1.2 Compatible
   { CopyBuf2Buf(Vbuffer,Vtmpbuf);    // copy toute la page dans le tmpbuffer
     ConfigR2B(XPosTxt, YPosTxt, 8*(llen-1),(LpP+1)*18);
   }
  else
   { VSwpscr(Vbuffer);              
     ConfigR2B(XPosTxt-8, YPosTxt, 8*(llen-1)+8,LpP*18);
   }
        NumLig=0; AfficheTxt(XPosTxt, YPosTxt, NumLig);
        FadeFBlack(pal); CopyColors(pal,palt2);
        InitKey();
        do
        { TestSaveTxt(NomTexte); TestColor(); TestZic();
          TestTEXT(XPosTxt,YPosTxt);
        } while (!WasKey(KeyEsc));
        Fade2Black (palt2);
        free(TEXTbuffer);
   FadeOk=0;
}


void Reports(char *NomTexte)
{   const XPosTxt=16;
    const YPosTxt=120;
        Fade2Black (pal);
        ChargeTEXT(NomTexte,15);
   InitDefil(XPosTxt+((llen-1)*8)+5,YPosTxt,LpP*18);

        readGIF("PARTY.GIF",Vbuffer,pal);
  if (Vesa12Beuark)
   { CopyBuf2Buf(Vbuffer,Vtmpbuf); 
     ConfigR2B(XPosTxt, YPosTxt, 8*(llen-1),(LpP+1)*18);
   }
  else
   { VSwpscr(Vbuffer);             
     ConfigR2B(XPosTxt, YPosTxt, 8*llen,LpP*18);
   }
        NumLig=0; AfficheTxt(XPosTxt, YPosTxt, NumLig);
        FadeFBlack(pal); CopyColors(pal,palt2);
        InitKey();
        do
        { TestSaveTxt(NomTexte); TestColor(); TestZic();
          TestTEXT(XPosTxt,YPosTxt);
        } while (!WasKey(KeyEsc));
        Fade2Black (palt2);
        free(TEXTbuffer);
   FadeOk=0;
}


void CoupGueule(char *NomTexte)
{  const XPosTxt=100;
   const YPosTxt=112;
        Fade2Black (pal);
        ChargeTEXT(NomTexte,20);
   InitDefil(XPosTxt-8,YPosTxt,LpP*18);

        readGIF("CPGLE.GIF",Vbuffer,pal);
  if (Vesa12Beuark)     
   { CopyBuf2Buf(Vbuffer,Vtmpbuf);
     ConfigR2B(XPosTxt, YPosTxt, 8*(llen-1),(LpP+1)*18);
   }
  else
   { VSwpscr(Vbuffer);              
     ConfigR2B(XPosTxt-8, YPosTxt, 8*(llen-1)+8,LpP*18);
   }
        NumLig=0; AfficheTxt(XPosTxt, YPosTxt, NumLig);
        FadeFBlack(pal);  CopyColors(pal,palt2);
        InitKey();
        do
        { TestSaveTxt(NomTexte); TestColor(); TestZic();
          TestTEXT(XPosTxt,YPosTxt);
        } while (!WasKey(KeyEsc));
        Fade2Black (palt2);
        free(TEXTbuffer);
   FadeOk=0;
}


void OldVesaEngaged()
{ static int i;
        readGIF("VESA12.GIF",Vbuffer,pal);
        BufferCopyVesa12(Vbuffer);
        FadeFBlack(pal);
        InitKey();
        while (!KeyPressed());
        Fade2Black(pal);
        BlackPal();
   FadeOk=0;
} 

  
void TheBeginning()
{ static int i;
        readGIF("DEFCON.GIF",Vbuffer,pal);
  if (Vesa12Beuark)                 // si Vesa 1.2 Compatible
   BufferCopyVesa12(Vbuffer);
  else
   VSwpscr(Vbuffer);                // sinon on l'affiche directos
        FadeFBlack(pal);
        InitKey();
        while (!KeyPressed());

        FadeZone2Black (pal,8,12);
 for (i=8*3; i<=2+12*3; i++) pal[i]=0;

        Fade2Black(pal);
        BlackPal();
   FadeOk=0;
} 


void TheEnd()                   // Bye! le 'K'
{ static unsigned char ii;
  static int jj,kk;
  static long Ltmp;
  byte WP[768];  int i, j, k;  // Pour le Morphing de Palette ...
  byte *P1, *P2, *P3, *TP123;

  Fade2Black (pal);
  readGIF("K.GIF",Vbuffer,pal);

  KillKeyb();
  Ltmp = EDsearch("K2.PAL"); EDload(palt2);      
  Ltmp = EDsearch("K3.PAL"); EDload(palt3);      


  TEXTlen = EDsearch("final.bin");
  TEXTbuffer = malloc(TEXTlen);
  EDload(TEXTbuffer);      
  RaiseKeyb();

  llen=0; while ((char)TEXTbuffer[llen]!='\0') llen++;
  while ((char)TEXTbuffer[llen]=='\0') llen++;

        CopyBuf2Buf(Vbuffer,Vtmpbuf);
        if (Vesa12Beuark)                 // si Vesa 1.2 Compatible
         BufferCopyVesa12(Vtmpbuf);
        else
         VSwpscr(Vtmpbuf);                // sinon on l'affiche directos

        InitKey();
        FadeFBlack(pal);


P1=pal; P2=palt2; P3=palt3; jj=0; kk=1; k=0;
SetColor(255,0,0,0); KText(1+(Rnd() % 63));
   InitKey();
do {  WaitVbl2();
      jj+=kk; if (jj<=0 || jj>=100) kk=-kk;
      if (jj<=63){ WP[255*3]=jj; WP[1+255*3]=jj; WP[2+255*3]=jj;}
      if (jj==0) KText(1+(Rnd() % 63));

      WaitVbl2();
      for(i=0; i<=254; i++)
      { j=i*3; 
        WP[j]   = ( (P1[j]  *(64-k)) + (P2[j]  *k) )/64;
        WP[1+j] = ( (P1[1+j]*(64-k)) + (P2[1+j]*k) )/64;
        WP[2+j] = ( (P1[2+j]*(64-k)) + (P2[2+j]*k) )/64;
      } SetPalette (WP);

      k++; if (k>64) {TP123=P1; P1=P2; P2=P3; P3=TP123; k=0;}

    } while (!KeyPressed());

  i=0; do {WaitVbl2(); i++;} while(i<35);
 if (hiddenEngaged || (WasKey(KeyA) && WasKey(KeyK) &&WasKey(KeyS) ))
// if (hiddenEngaged || WasKey(KeyK))
     hidden=1;
 else
   { hidden=0;
     if (!NoSound)
     for (ii=63; ii>0; ii--) { WaitVbl2(); WaitVbl2();
                               MIDASsetMusicVolume(ii);
                             }
   }
  Fade2Black (WP);
  FadeOk=0;
}


void HiddenPart()
{  const XPosTxt=324;
   const YPosTxt=5;
   static unsigned char ii;
   ChargeTEXT("hidden.bin",26);
   InitDefil(XPosTxt+((llen-1)*8)+5,YPosTxt,LpP*18);

   readGIF("ARRAKIS.GIF",Vbuffer,pal);
   if (Vesa12Beuark)                 // si Vesa 1.2 Compatible
    { CopyBuf2Buf(Vbuffer,Vtmpbuf);    // copy toute la page dans le tmpbuffer
      ConfigR2B(XPosTxt, YPosTxt, 8*(llen-1),(LpP+1)*18);
    }
   else
    { VSwpscr(Vbuffer);                // sinon on l'affiche directos
      ConfigR2B(XPosTxt, YPosTxt, 8*llen,LpP*18);
    }
        NumLig=0; AfficheTxt(XPosTxt, YPosTxt, NumLig);
        FadeFBlack(pal); CopyColors(pal,palt2);;
        InitKey();
        do
        { //TestSaveTxt("hidden.bin");
          TestColor(); TestZic();
          TestTEXT(XPosTxt,YPosTxt);
        } while (!WasKey(KeyEsc));/**/
        free(TEXTbuffer);
     for (ii=63; ii>0; ii--) { WaitVbl2(); WaitVbl2();
                               MIDASsetMusicVolume(ii);
                             }
  
  Fade2Black (palt2);
  FadeOk=0;
}
