www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/04/19/18:08:08

Date: Wed, 19 Apr 1995 13:06:42 -0400 (EDT)
From: Long Doan <ldoan1 AT osf1 DOT gmu DOT edu>
To: bmiller <bmiller AT infi DOT net>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Fast Blitting to Screen w/libgr

On Tue, 18 Apr 1995, bmiller wrote:

> DjgpperS:
> 
>   I've acquired the djgpp package, and love it!  I'm hoping to start writing
> some games with it, but am having some trouble with getting clean blits to
> the screen.
[snipped]

My comments begin with ***

> void ScreenBlast(GrRegion *buffer, GrRegion *screen) {
> 
>   if ((buffer->SizeX() != screen->SizeX()) &&
> 	(buffer->SizeY() != screen->SizeY()) 
>     return;
>   WaitForVsync		//This is a little macro I wrote to wait for the 
> 			// video retrace to begin; it worked before my
> 			// attempt at assembl-izing my routine.

*** WaitForVsync is the one that should be in asm.

>   bufread = buffer->rdata;	// bufread is a global char *
>   scrwrite = screen->wdata;	// scrsrite is a global char *
> 				// another global is scrsize, a long, and
> 				// set to SizeX() * SizeY() earlier
>   asm("
> 	pushl %ecx
> 	pushl %esi
> 	pushl %edi
> 
> 	movl _scrsize, %ecx
> 	movl _bufread, %esi
> 	movl _scrwrite, %edi
> 
> 	rep ; movsl

*** This should be:
        rep ; movsb
> 
> 	popl %edi
> 	popl %esi
> 	popl %ecx
>   ");
> }
> 
>   I get the impression, from reading the as info files, that somehow my
> section is wrong; however, I have no clue as to how to ensure that it is
> right.


Nope, you only try to bitblt to much data (4 times to be exact...)

>   I am mostly concerned with getting rid of the darn retrace problem;
> however, I am also most interested in knowing what's wrong with my asm code,
> too, for kicks & giggles.

  How did you code your WaitForVsync macro? I think you should recode it
in asm. That'll save lots of instructions.

Hope that helps,
Long.

+--------------------------------------------------------+
| Long Doan                          ldoan1 AT osf1 DOT gmu DOT edu |
|                                          ld AT netrix DOT com |
+--------------------------------------------------------+

- Raw text -


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