www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/17/08:31:51

From: "Ramcor" <ramcor AT arrakis DOT es>
Newsgroups: comp.os.msdos.djgpp
Subject: SVGA transfers. Speed?
Date: Sun, 17 May 1998 14:14:24 +0200
Organization: none
Lines: 72
Message-ID: <355ed4d0.0@news.arrakis.es>
NNTP-Posting-Host: caladan.arrakis.es
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I have made a SVGA dumper routine in DJGPP but I feel this may be slow.
Does anybody know how to optimize svga transfers?

I own a S3 trio64 video card. I know these cards have some sort of
optimisations functions to do with 2D graphics. Anybody knows how ?

Thanx in advance!

PD. I hope the code below serves well to anyone interested! Please feel free
to distribute it to whoever you want.

#include <sys/nearptr.h>
#include <dpmi.h>
#include <pc.h>



void ini_svga640(void) {
__dpmi_regs regs;

   memset(&regs, 0, sizeof regs);
   regs.x.ax = 0x4F02;
   regs.x.bx = 0x0101;
   __dpmi_int(0x10, &regs);
  __djgpp_nearptr_enable();
}



void vuelca_a_svga640(char *punt) {  // supone granularidad = 64kb.
__dpmi_regs regs;

   memset(&regs, 0, sizeof regs);
   regs.x.ax = 0x4F05;
   regs.x.bx = 0x0000;
   regs.x.dx = 0x0000;
   __dpmi_int(0x10, &regs);
   rep_movsl(punt, SCREENP, 16384);

   memset(&regs, 0, sizeof regs);
   regs.x.ax = 0x4F05;
   regs.x.bx = 0x0000;
   regs.x.dx = 0x0001;
   __dpmi_int(0x10, &regs);
   rep_movsl(punt+65536, SCREENP, 16384);

   memset(&regs, 0, sizeof regs);
   regs.x.ax = 0x4F05;
   regs.x.bx = 0x0000;
   regs.x.dx = 0x0002;
   __dpmi_int(0x10, &regs);
   rep_movsl(punt+65536*2, SCREENP, 16384);

   memset(&regs, 0, sizeof regs);
   regs.x.ax = 0x4F05;
   regs.x.bx = 0x0000;
   regs.x.dx = 0x0003;
   __dpmi_int(0x10, &regs);
   rep_movsl(punt+65536*3, SCREENP, 16384);

   memset(&regs, 0, sizeof regs);
   regs.x.ax = 0x4F05;
   regs.x.bx = 0x0000;
   regs.x.dx = 0x0004;
   __dpmi_int(0x10, &regs);
   rep_movsl(punt+65536*4, SCREENP, 11264);  // el £ltimo banco no se
completa
}




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019