Mail Archives: djgpp/1999/09/02/12:14:39
Hi,
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)
{
__djgpp_nearptr_enable();
VBE_PTR = (VIDEO_PTR+__djgpp_conventional_base); /* This will be placed
in EDI */
VBE_flip24bppBGR((long)(screen), pixels); /* Asm flip function */
__djgpp_nearptr_disable();
}
but not in this version:
void VBE_blitBGR(VBE_32bitScreen *screen, long pixels)
{
long offset;
__djgpp_nearptr_enable();
byte *video_ptr = (byte*)(VIDEO_PTR+__djgpp_conventional_base);
for(offset=0;offset<pixels;offset++)
{
*(video_ptr++) = screen->data[offset].B;
*(video_ptr++) = screen->data[offset].G;
*(video_ptr++) = screen->data[offset].R;
}
__djgpp_nearptr_disable();
}
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 -