delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/22/21:28:28

From: Moo-Juice <Ben AT flag DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: A few questions
Date: Wed, 22 Jan 1997 10:55:01 +0000
Organization: Honest Ron's Car Emporium
Lines: 56
Distribution: world
Message-ID: <YTZ6OAAFIf5yEwKy@flag.demon.co.uk>
NNTP-Posting-Host: flag.demon.co.uk
MIME-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi all,

I have a few questions, most of which I'm sure are probably in the FAQ,
but whenever I search through the FAQ I always seem unable to find the
relevant information I require... maybe its just me, or maybe it is just
obscure headings.  Either way, if someone could help me on some of these
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>

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?

2.  When using other C/C++ compilers, defining a pointer to the video
    memory was a simple case of 'unsigned far char *video = 0xB800;'.
    Now I *do* know in DJGPP, it is different.  What method would be
    most advantageous and quick, to define a pointer to the screen
    and work with offsets from that?  On the other C/C++ compilers,
    setting a character and a value at say, the top left of the
    screen would be a simple case of;

    *(video) = 'A';         
    *(video+1) = 15;

    (At least I think thats right... knowing me, the above prolly
     screws up the video pointer)...  but would that set the first
    character to 'A', and white?  Whether this is correct or not,
    how would this be handled in DJGPP?

3.  When working with the screen, as you probably know, each element
    of the screen is 2 characters, the first representing the ASCII
    value itself, and the second represents the foreground/background
    colours and (I think) blinking flags.  If I had a structure which
    was made up of 2 chars like this:

           struct Element
           {
              char ASCII;               // Ascii character
              char Col;                 // Colour
           };

    And lets say I had an array of these:

           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?


Hope some of you guys can be of assistance :)

-- 
Moo-Juice

- Raw text -


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