Mail Archives: djgpp/1995/01/31/15:57:43
> From djgpp-bounces AT sun DOT soe DOT clarkson DOT edu Mon Jan 30 18:48 EST 1995
> From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
> To: DJGPP AT sun DOT soe DOT clarkson DOT edu
> Date: Mon, 30 Jan 1995 16:22:16 GMT
> Subject: Writing to screens etc
>
> (1) Since the graphics screen is (in real mode) at 0xa0000000 etseq, can I
> write an 0x14 byte to graphics screen address 0xa0000017 in Gnu C thus:- ?
> _farsetsel(0xa000); _farnspokeb(0x0017,0x14); ? Or how?
^^^^^^^
You're supposed to use the DOS memory selector (0xa000 is a segment address,
not a selector.) I believe that the DOS memory selector is:
go32_info_block.conventional_memory_selector;
> Can I get away with always setting the selector = 0 and putting the full
> address in the offset?
No.
> (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
0x000b8000 is used for color modes, 0x000b0000 is for monochrome mode. You
can just look at the data in go32_info_block structure to find out the linear
address of the current mode you're in. Or you can do something like in
control.c (go32 source) to find out.
> sometimes the address is different when writing to screen from when reading
> from screen? If so, what happens in e.g. `*x+=2;', where x points to a screen
> address?
Not in text mode.
- Raw text -