delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/20/18:38:22

Xref: news2.mv.net comp.os.msdos.djgpp:4054
From: applea AT weiss DOT che DOT utexas DOT edu (Austin Appleby (a.k.a. Tanjent))
Newsgroups: comp.os.msdos.djgpp
Subject: Making the nearptr hacks use longs.
Date: 20 May 1996 18:34:55 GMT
Organization: The University of Texas at Austin, Austin, Texas
Lines: 42
Message-ID: <4nqe0f$som@geraldo.cc.utexas.edu>
NNTP-Posting-Host: weiss.che.utexas.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Well, I'm new here, so I'll just come out and say it right away... It 
seems that I, as well as a multitude of other people in here, are looking 
for ways to get fast video access under DJGPP. So far I've found in my 
tinkering that _dosmemputl(videoptr,320*200,buff) is by far the fastest 
way to do it, surpassing even the __djgpp_nearptr_enable() hacks. However 
- I've got this sneaky suspicion that if I can find some way to do the 
following - 

unsigned long *videoptr = (unsigned long *)0xA0000;
unsigned char buff[320*200];
unsigned long *sbuffptr = &char[0];


dumpscrn() {
   int i;
   __djgpp_nearptr_enable();
   for(i=0;i<320*50;i++)  {
      videoptr[4*i + __djgpp_conventional_base] = sbuffptr[i];
      }
   __djgpp_nearptr_disable();
   }

it'll be even speedier... Basically, the idea is to set videoptr to a 
long pointer instead of a char pointer, so that the thing will optimize 
down to some resemblance of a movsd op instead of a movsb, thus a 4x 
improvement. But for the life of me I don't know how to get the thing to 
work... I know that my problem is in putting the 
__djgpp_conventional_base inside videoptr's brackets, (and the 4*i should 
be just i also) but how do I get the pointer to start at the beginning 
of video memory and still be a long pointer? There has to be a way, it's 
just on the tip of my tongue, er, fingers... If any of this is confusing 
please forgive me, I've only been coding in C for 2 days (and all I had 
before that was Basic and a little assembler... what fun stuff to start 
with.... <thbbbbht>) 

-Austin Appleby

--
_____________________________________________________
  M={a+bi:|z{inf}|<2,z{n}=z{n-1}^2+a+bi,z(0)=a+bi}
J(c,d)={a+bi:|z{inf}|<2,z{n}=z{n-1}^2+c+di,z(0)=a+bi}

- Raw text -


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