comp.lang.ada
 help / color / mirror / Atom feed
From: achrist@easystreet.com
Subject: Re: Screen Handling packages!
Date: Thu, 23 May 2002 22:37:20 -0700
Date: 2002-05-23T22:37:20-07:00	[thread overview]
Message-ID: <3CEDD190.8A1E722A@easystreet.com> (raw)
In-Reply-To: 3CEDC195.479B58C0@adaworks.com

Richard Riehle wrote:
> 
> Another approach, not for the faint of heart, but one I have
> seen used successfully is to access Hex B800 directly. At
> B800, you have a mapping to the screen at the pixel level.
> If you have a system address capability in your compiler
> to access B800, you can actually peek and poke with Ada
> into that area of memory.
> 

Mostly this is done in text mode, then it's not the pixel level, it's a
buffer of characters and attributes (colors, etc),  one for each screen 
character.  

BTW, you should check some of the other low memory addresses to see
what screen mode is in effect.  I've thrown out my DOS documentation,
but there are addresses to check to see whether the screen is monochrome 
or color (the monochrome video buffer is at B000 IIRC, and the color
attributes are different for monochrome). if the screen is 80 x 25, 
40 x  ??, 100 x ???, or whatever, and if it's in text or graphics mode.

I vaguely remember doing direct screen writes with both the RR and the 
GNAT for DOS compilers.  The GNAT DOS compiler works with djgpp, which 
came with some C library that could access the low memory addresses 
directly, So it took a call out from Ada to C to make it happen, but it 
was pretty simple.  As mentioned recently, the RR for DOS compiler comes
with a function to do just about the same thing that also worked just
fine for me.  

There is one reason to not do this: it doesn't give you any UI for the
mouse.  Many users today reach for the mouse so instinctively that they
will not like a mouseless program.  

If you are using the GNAT for DOS compiler, you might want to look at 
some of the graphics libraries that are available for djgpp.  These
may provide a graphical (not text mode) UI, mouse support, some widgets, 
etc, etc.  Most of these are in C or C++ and intended for games 
programmers, but it should be possible to talk to them from GNAT and
they may give a much nicer UI than you can make happen easily in pure 
Ada.  I haven't done any DOS in about four years, so I can't say for
sure what you will find, but there was still some large amount of games
programming and UI support for djgpp back then.

Ansi.sys was not popular in the MS-DOS days, mainly because it was 
noticeably slower than direct screen updates.  I suppose that with fast
computers of today, it would be hard to notice any delay from using
ansi.sys, but not all versions of Windows allow ansi.sys in a DOS
box.   


Al



  reply	other threads:[~2002-05-24  5:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-22  9:11 Screen Handling packages! Henrik Quintel
2002-05-22 10:08 ` Holger Zwar
2002-05-24  4:29 ` Richard Riehle
2002-05-24  5:37   ` achrist [this message]
2002-05-24 20:23     ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox