delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/23/05:05:20

From: SerDevian <scriven AT CS DOT ColoState DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: A few questions
Date: Wed, 22 Jan 1997 13:47:09 -0700
Organization: XYZZ Software Co.
Lines: 42
Message-ID: <32E67CCD.7DE1@CS.ColoState.edu>
References: <YTZ6OAAFIf5yEwKy AT flag DOT demon DOT co DOT uk>
NNTP-Posting-Host: miro.vis.colostate.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Moo-Juice wrote:
> questions I would most grateful, and if it *is* explained *thoroughly*
> in the FAQ then a pointer to the relevant chapter/heading would be
> appreciated <g>

Yes, the information is in the FAQ.  (accessing graphics memory)
Look up "near" and "far" pointers.

> 1.  The project I'm working on, will be text only.  For this reason,
>     I wish to be able to switch between 80x25 & 80x50 video modes. Is
>     it simple just to support these two modes?  Which calls would I
>     need to set these, or other text modes?

To set 80x25, just set video mode 3.  To change to 50 lines, I call the
video bios to change the font to an 8x8 font instead of 8x16. 
Generally, I stick the font I want into the transfer buffer (look up
__tb, or maybe sending info to bios calls) and call an interrupt.  If I
can ever remember to, I'll have source on my page for this.

Accessing video memory...

You need to decide whether to use "far" or "near" pointers.  They're
probably close to the same speed if you only access video memory in
large sections at once, but "near" pointers are potentially faster if
you want to do a lot of single-pixel (or character) access.  However,
"near" pointers pretty much disable memory protection (which could be
either good or bad, depending on your point of view).

>            Element Line[80];
> 
>     This could easily represent an entire line of characters.  And if
>     you can imagine that this line array contained simply, 80 characters
>     how would i 'memcpy()' this array to the screen?

Use movedata() if you're using the "far" pointer method, or you can (I
think) just use memcpy() with "near" pointers.


-- Yamaha / XYZZ          "May farce the with be you."
mailto:scriven AT CS DOT ColoState DOT edu          
mailto:scriven AT VIS DOT ColoState DOT edu
http://www.vis.colostate.edu/~scriven/

- Raw text -


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