* Screen Handling packages! @ 2002-05-22 9:11 Henrik Quintel 2002-05-22 10:08 ` Holger Zwar 2002-05-24 4:29 ` Richard Riehle 0 siblings, 2 replies; 5+ messages in thread From: Henrik Quintel @ 2002-05-22 9:11 UTC (permalink / raw) Hello everybody, I am looking for Ada95 packages which can do the following operations: DISPLAY A SINGLE CHARACTER AT 'X' & 'Y' COORDINATE CLEAR A COLUMN CLEAR A ROW CLEAR SCREEN DISPLAY A STRING AT 'X' & 'Y' COORDINATE GET THE CURRENT DATE AND TIME CHECK AND GET KEYBOARD KEY It would be nice if you could post some locations. I work with GNAT 3.10 for DOS and AdaCaps under Windows ME. The operations must work in a DOS-BOX under Windows ME. Thanks in advance. Yours Henrik -- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Screen Handling packages! 2002-05-22 9:11 Screen Handling packages! Henrik Quintel @ 2002-05-22 10:08 ` Holger Zwar 2002-05-24 4:29 ` Richard Riehle 1 sibling, 0 replies; 5+ messages in thread From: Holger Zwar @ 2002-05-22 10:08 UTC (permalink / raw) Hi, i think you'll find similar packages here: http://users.ncrvnet.nl/gmvdijk/packages.html Try NT_Console and Screen. Have fun! Holger --- "Henrik Quintel" <henrik.quintel@gmx.de> schrieb im Newsbeitrag news:88d37469ae67efc323ba84e966f7b387.86200@mygate.mailgate.org... > Hello everybody, > I am looking for Ada95 packages which can do the following operations: > > DISPLAY A SINGLE CHARACTER AT 'X' & 'Y' COORDINATE > CLEAR A COLUMN > CLEAR A ROW > CLEAR SCREEN > DISPLAY A STRING AT 'X' & 'Y' COORDINATE > GET THE CURRENT DATE AND TIME > CHECK AND GET KEYBOARD KEY > > It would be nice if you could post some locations. > > I work with GNAT 3.10 for DOS and AdaCaps under Windows ME. > The operations must work in a DOS-BOX under Windows ME. > > Thanks in advance. > > Yours Henrik > > > -- > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Screen Handling packages! 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 1 sibling, 1 reply; 5+ messages in thread From: Richard Riehle @ 2002-05-24 4:29 UTC (permalink / raw) Henrik Quintel wrote: > Hello everybody, > I am looking for Ada95 packages which can do the following operations: [ description of requirement snipped ] For MS-DOS you may want to use a package supported by ANSI.SYS. I believe the contributions by Michael Feldman in the Ada Software Repository support that. 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. Yoshimi Fujii, formerly of Alsys, wrote a very nice little Tetris program using the Alsys Ada 83 compiler many years ago, and he used this trick. We tried to convert it to Meridian, but Meridian had a signed integer for System.Address, and it could not reach data in the high-order part of DOS memory. By tweaking the pixels directly, along with their associated attributes, you can gain enormous speed in your program. I suppose you could use this trick even with a Windows system, but I have not tried it -- and probably would avoid doing it since there is no end to mischief it could bring upon you. Probably better off using the ANSI.SYS trick, after all. Richard Riehle ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Screen Handling packages! 2002-05-24 4:29 ` Richard Riehle @ 2002-05-24 5:37 ` achrist 2002-05-24 20:23 ` Randy Brukardt 0 siblings, 1 reply; 5+ messages in thread From: achrist @ 2002-05-24 5:37 UTC (permalink / raw) 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Screen Handling packages! 2002-05-24 5:37 ` achrist @ 2002-05-24 20:23 ` Randy Brukardt 0 siblings, 0 replies; 5+ messages in thread From: Randy Brukardt @ 2002-05-24 20:23 UTC (permalink / raw) achrist@easystreet.com wrote in message <3CEDD190.8A1E722A@easystreet.com>... >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. The DOS Janus/Ada includes a text mode UI with basic mouse support. It's not particularly hard to use them. There also is an unsupported graphics library. Randy. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-05-24 20:23 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 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 2002-05-24 20:23 ` Randy Brukardt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox