Mail Archives: djgpp/1999/09/02/12:14:39

Message-ID: <>
From: Anders David Skarin <hobbit AT swipnet DOT se>
X-Mailer: Mozilla 4.5 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Weird pointer!
Lines: 45
X-Complaints-To: news-abuse AT swip DOT net
X-Trace: 936275467 (Thu, 02 Sep 1999 14:31:07 MET DST)
NNTP-Posting-Date: Thu, 02 Sep 1999 14:31:07 MET DST
Organization: A Customer of Tele2
X-Sender: s-437261 AT dialup45-2-60 DOT swipnet DOT se
Date: Thu, 02 Sep 1999 14:28:11 +0200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com


I'm having trouble with my vesa routines. I had it 
all working fine, with some fast asm flip functions.
But trying it on a second computer I found out it was
pure luck. So now I tried a new approach, but somehow
my asm routines won't work anymore.

The crash will occur in this version:

void VBE_blitBGR(VBE_32bitScreen *screen, long pixels)
	VBE_PTR = (VIDEO_PTR+__djgpp_conventional_base);	/* This will be placed
in EDI */
	VBE_flip24bppBGR((long)(screen), pixels);		/* Asm flip function */

but not in this version:

void VBE_blitBGR(VBE_32bitScreen *screen, long pixels)
	long offset;

	byte *video_ptr = (byte*)(VIDEO_PTR+__djgpp_conventional_base);
		*(video_ptr++) = screen->data[offset].B; 	
		*(video_ptr++) = screen->data[offset].G;	
		*(video_ptr++) = screen->data[offset].R;

What the .... is wrong!! The two functions do EXACTLY the same thing but
one is 
partially in assembler (and about 3times faster). 

What happens to the pointer when entering the asm function?
Will nearpointers be disabled as soon as I make a function call?

Thanks to anyone that has any info on the subject and is kind enough
to share it with a desperate coder.

- Raw text -

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