delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/01/31/00:31:12

From: Charles Sandmann <sandmann AT new-orleans DOT NeoSoft DOT com>
Subject: Re: Writing to screens etc
To: A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk (A.Appleyard)
Date: Mon, 30 Jan 1995 20:52:05 -0600 (CST)
Cc: DJGPP AT sun DOT soe DOT clarkson DOT edu

> (1) Since the graphics screen is (in real mode) at 0xa0000000 etseq, can I

NO NO NO *NO* !  The graphics screen is at 0xa0000, this is linear memory
not real mode segment/offset.

> write an 0x14 byte to graphics screen address 0xa0000017 in Gnu C thus:- ?
>     _farsetsel(0xa000); _farnspokeb(0x0017,0x14); ?   Or how?
> Can I get away with always setting the selector = 0 and putting the full
> address in the offset?

Once again, NO!  A simple example of what you want to do is:

#include <go32.h>
#include <sys/farptr.h>
   _farsetsel(_go32_info_block.selector_for_linear_memory);
   _farnspokeb(0xa0017,0x14);

> (2) It seems that the text screen is sometimes at 0xb0000000, sometimes at
> 0xb8000000. How for each PC can a program tell which is which? Is it true that

No, use the conventional memory offset from above, and use either 0xb0000
or 0xb8000 as the offset.  You can get these from the ScreenPrimary (?)
variables and then  (& 0xfffff) to mask off the 0xe00xxxxx from the top.
(BTW, the masking won't hurt in V2, but the 0xe won't be at the top there).

- Raw text -


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