Mail Archives: djgpp/2000/10/14/15:00:19
> - After you decide about LFB or bankswitching, you calculate the remainder
> and videomemory pointer again with the bankswitching formula.
> So you destroy them both in the case of LFB.
> That's why you had only a fraction of your image on the screen
Oops. My mistake - I was so concerned that the problem was higher in the
code than that I never noticed it. Thanks it now works fine.
> - You allocate your "primarysurface" AFTER you calculate the remainder
> stuff.
> This works for LFB, because you don't use it with the LDT descriptor
> allocating part.
> But as soon as bank switching is used, you will get a crash.
> Put it before
>
> if (vbeinfoblock.vbeversion >= 0x0200)
>
It never seemed to bother my original version of my code, or the rewrote
vbe1.2. This code is just an extension of that with some new bits stuck in
, and one that compiled correctly about 2 years ago when I used to program
in gcc 100%. Now I program 60/40 MSVC / GCC (though it seems to be back to
100%). I decided to go through all my old code and get everything look nice
and orderly, with proper variable names (int thack1, thack2; anyone?).
Seems with time, applications just fall apart...
> - You calculate the remainder to be xres*yres. This is OK, because with
LFB
> you can copy the full screen at once. But you use _movedatal() for this,
> which gets the number of DWORDS to copy, but you give it the number of
> BYTES.
> Either calculate remainder to be xres*yres/4 or divide it at the
> _movedatal()
> call.
Sorry, another one of those grasping at straws moments... I've put it back
in.
> - Your calculation of the bankswitch-remainder works, but the modulo
> operator
> is predestinated to calculate remainders :-) Why don't you use it?
I thought that the modulo calculates the number of x in y - ie: 145%12 = 12.
Oh well, you live and learn!-)
Seriously though. I always use rand()%100, to return a number between 0-99,
so that's how I thought of modulus operating.
Thanks for all your help, any other suggestions would be welcome.
--
Stay Lucky, Graham "Mournblade" Reeds.
ICQ No.: 30514803
http://homepage.dtn.ntl.com/grahamr
- Raw text -