//ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
//º                                                                          º
//º This example show how to use the Snap library                            º
//º                                                                          º
//º                                                                          º
//º                                                                          º
//ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼

#include <process.h>
#include "..\resource\eos.h"

void copyvideo(long Selector_Vesa,char *Addr_File);
#pragma aux copyvideo modify [eax edx esi edi] parm [eax] [esi] =  \
   "push es"\
   "mov es,ax"\
   "xor edi,edi"\
   "add esi,10"\
   "mov edx,3c8h"\
   "xor al,al"\
   "out dx,al"\
   "inc dl"\
   "mov ecx,768"\
   "@@Ok1:"\
   "lodsb"\
   "out dx,al"\
   "loop @@Ok1"\
   "mov ecx,76800"\
   "rep movsd"\
   "pop es";

void Wait_();
#pragma aux Wait_ modify [eax]=  \
   "xor ah,ah"\
   "int 16h";

void test_vesa()
{
   long Selector_Vesa;
   char *Addr_File;
   long Size_File,Handle_File;
    if (Init_Vesa(0x101)==Off)
    Exit_Error ("   þ Mode SVGA not supported or VESA not found ! \x0D\x0A" \
                "     To install a vesa driver, refer to your video card documentation. \x0D\x0A\x24");
   Selector_Vesa=Init_Vesa_Bank();
   Addr_File=Load_External_File_Handle ("..\\DATA\\TEST640.DLZ",&Size_File,&Handle_File);
   copyvideo(Selector_Vesa,Addr_File);
   Wait_();
   Restore_Video_Mode();
}

void main(int argn, char **argv)
{
    Init_Snap(); // Press key "Arrˆt D‚fil" at any time to save the screen
    Init_EOS();
    test_vesa();
  exit (0);
}