
// lgfxvgag.cpp
//
// Copyright (c) 1995 by Toshiaki Tsuji, all rights reserved.

#include "stdgfx.h"
#include "lgfxvga.h"
 
LONG  SrcWd;
LONG  SrcHt;

// VOID SetVGASelector ( SHORT Selector )
// EAX = Selector

VOID SetVGASelector ( SHORT Selector )
{
  if (Selector)
    {}
} // End of SetVGASelector


// VOID VGACopy256To256 ( BYTE *Src, LONG AddSrc, LONG SrcWd, LONg SrcHt,
//                        LONG DestCx, LONG DestCy )
//
// EAX = Src, EDX = AddSrc, EBX = SrcWd, ECX = SrcHt

VOID VGACopy256To256 ( BYTE *Src, LONG AddSrc, LONG SrcWidth, LONG SrcHeight,
                       LONG DestCx, LONG DestCy )
{
if (Src)
  {}
if (AddSrc)
  {}
if (SrcWidth)
  {}
if (SrcHeight)
  {}
if (DestCx)
  {}
if (DestCy)
  {}
#ifdef __FORx86__
__asm {
  pushad
  mov  EAX, Src
  mov  EDX, AddSrc
  mov  EBX, SrcWidth
  mov  ECX, SrcHeight 

  mov  ESI, EAX   // ESI = Src
  mov  SrcWd, EBX
  mov  SrcHt, ECX
  
  sub  EDX, EBX
  mov  EBX, EDX   // EBX = AddSrc - SrcWd

  mov  EDI, 0A0000h
  mov  EAX, DestCy
  mov  EDX, 320
  mul  EDX  
  add  EAX, DestCx
  add  EDI, EAX
  
  mov  EDX, 320
  sub  EDX, SrcWd
  cld

  Copy256OutLoop :
    mov ECX, SrcWd
    mov EAX, ECX
    and EAX, 03h
    shr ECX, 2
    rep movsd
    mov ECX, EAX
    rep movsb
    add ESI, EBX
    add EDI, EDX
    dec SrcHt
    jnz Copy256OutLoop

  popad
} // End asm
#endif
} // End of VGACopy256To256

