delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/14/09:00:23

From: "Peter Remmers" <Peter DOT Remmers AT t-online DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: VBE2.0 w/LFB + GCC
Date: Sat, 14 Oct 2000 14:41:56 +0200
Organization: T-Online
Lines: 71
Message-ID: <8s9ka0$pgg$04$1@news.t-online.com>
References: <6v%E5.29784$L12 DOT 598411 AT news2-win DOT server DOT ntlworld DOT com> <8s49vu$k4l$1 AT slb6 DOT atl DOT mindspring DOT net> <JAlF5.31810$uq5 DOT 615829 AT news6-win DOT server DOT ntlworld DOT com> <8s4uou$381$1 AT slb7 DOT atl DOT mindspring DOT net> <AIsF5.46659$L12 DOT 677834 AT news2-win DOT server DOT ntlworld DOT com> <8s73ft$fvg$04$1 AT news DOT t-online DOT com> <j1IF5.1086$NQ4 DOT 21429 AT news2-win DOT server DOT ntlworld DOT com>
Mime-Version: 1.0
X-Trace: news.t-online.com 971527297 04 26128 NPwXQYGS8A1CQ 001014 12:41:37
X-Complaints-To: abuse AT t-online DOT com
X-Sender: 320094726121-0001 AT t-dialin DOT net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-Mimeole: Produced By Microsoft MimeOLE V5.00.2615.200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Graham Reeds <grahamr AT dtn DOT ntl DOT com> schrieb...

> > Video RAM is not system RAM. The DPMI host cannot page it to disk,
> > it's always there. No need to lock it.
>
> I have the __dpmi_lock_linear_region() in there because one of the
examples
> I had (basically it was Allegro) had it in there, and though it didn't
seem
> to affect it either way, I felt that if he has it in, there must be a
> reason.

Hmm, I have never needed it yet.

> > The limit you must specify here is the highest accessible offset, so it
> must
> > be size-1.
>
> I had that in, but I took it out for a recompile (grasping at straws
again).

Well, take it back in, it's correct. :-)

> It works fine as it compiles with no warnings and no errors (-Wall is on).
> Like I said at the start it only draws the top eighth of the screen, and
not
> the entirety of it like it should.  If you ran the program from my website
> you'll see that the purple smiley comes on to the cropped section and
> disappears off the cropped section, so the logics of the screen are fine.
> Just something I can't figure out.

I looked at your sources, and this is what I noticed:

- 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)

- 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.

- 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.


- Your calculation of the bankswitch-remainder works, but the modulo
operator
  is predestinated to calculate remainders :-) Why don't you use it?

- Talking about bank switching... I think everyone's graphic card supports
  LFB and VBE2.0 nowadays. You can simply require it. Systems that support
  only bankswitching are too slow for your drawing technique anyways...
  Bankswitching was a stupid hack to get around stupid old limitations.
  And it's a major PITA programming with it...

Peter



- Raw text -


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