// "Mirror kaleidoscope" intro.
// (c)2001 Wega (2:5055/141.10@FidoNet)
// Compiled on SPHINX C-- Compiler v0.236.7 (Jan 28 2001)

#usePentium
#codesize
#resize FALSE
#jumptomain SHORT
#pragma option X

byte COPYRIGHT[7]={'(','c',')','W','e','g','a'};

#include "mirkldsp.h--"

main()
{

 @Begin();

 BP=0;

 do{

  AL=BP;AH=0;BX=0;CX=1;DX=CX;
  SI=1193;
  loop(SI){
   AX+=CX;BX+=DX;
   DI=199;
   IF(AX==319)||(AX<1)-CX;
   IF(BX==DI)||(BX<1)-DX;

   $pusha
    CX=CX|BP;
    $pusha
     PutPixels(AX,BX,CL);
    $popa
    DI-=BX;BX=DI;
    PutPixels(AX,BX,CL);
   $popa
  }

  BP-=2;

  SI=63999;
  loop(SI){
   ESBYTE[SI]--;
  }

  SI=320;
  loop(SI){
   AL=9;
   ESBYTE[SI-1]=AL;
   ESBYTE[SI+63679]=AL;
   IF (SI<200){
    DI=SI*320;
    ESBYTE[DI]=AL;
    ESBYTE[DI+319]=AL;
   }
  }

  CL=2;
  loop(CL) @WaitRetrace();
  @PutVideoBuf();

  $in AL,60h
 }while(AL!=1); // Пока не ESC

 @End();
}
