Mail Archives: djgpp/2002/04/04/01:49:09
Sahab Yazdani wrote:
>
> > Doesn't the VESA initialization function returns a pointer in conventional
> > memory? If so, you cannot use memset with it, unless you enable near
> > pointers and add __djgpp_conventional_base to the pointer VESA returns.
>
> i *do* add __djgpp_conventional_base as it wouldn't work in either DOS
> or windows if I didn't (also using this line to enable near pointers:
> int _crt0_startup_flags = _CRT0_FLAG_NEARPTR | _CRT0_FLAG_NONMOVE_SBRK; )
Well, in that case, more information is needed to understand what's wrong.
Charles asked for the full crash message; in addition, at least the code
fragments that call the VESA function, add __djgpp_conventional_base to it,
and then call memset, would be useful.
Does the VESA function return a positive indication that it succeeded?
> > Also, what size is the memory region set up by the VESA function, and what
> > is the value of width*height*bitDepth?
>
> well I am finding a 640X480 by 8 bit screen (standard mode 0x101), and
> width*height*bitDepth>>3 is 921600 bytes. but I don't think that VESA
> gives the actual size of the memory region, and that this *is* the way
> to calculate it).
Well, obviously, there should be _some_ relation between the argument you
pas to memset and the size of the memory allocated by VESA. Otherwise, you
are accessing memory that doesn't belong to you.
- Raw text -