home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!wupost!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!s.psych.uiuc.edu!amead
- From: amead@s.psych.uiuc.edu (Alan Mead)
- Newsgroups: comp.lang.pascal
- Subject: Re: Prevent the screen from scrolling?
- Message-ID: <BtLrE5.K6H@news.cso.uiuc.edu>
- Date: 26 Aug 92 18:01:15 GMT
- References: <1992Aug26.153649.147@csghsg5a.bitnet>
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: UIUC Department of Psychology
- Lines: 54
-
- 89612048s@csghsg5a.bitnet writes:
-
- >How to prevent a screen from scrolling?
-
- >If I am going to write anything into the last position of the screen
- >(80,25) or of a window, the screen is scrolling on line forward. Is there any
- >possibility to prevent the screen from scrolling? Otherwise you
- >always have to take care that you never write into the last screen-
- >positio.
-
- >Thank You very much for Your help.
-
- >Markus
-
- Yes. My prefered way is to write to the screen directly. The base address
- of the screen is $B800 for a color adapter and $B000 for a mono. The
- structure of (text) video ram is:
-
- type
- cell_type = record
- character : char;
- attribute : byte;
- end;
-
- the 'attribute' field has exactly the same structure as Crt.TextAttr
-
- Versions of TP up to 5.5 included a unit in the examples directory
- called WIN.PAS which had an asm routine to do this kind of stuff. I
- don't know if it was included in v6.
-
- The Technojock's Turbo Toolkit (available from wuarchive.wustl.edu last
- time i looked) had a similar (perhaps better) routine you might want to
- look at. I didn't examine their Object Toolkit...
-
- I think you can also modify the variable Crt.WindMax. Something like this:
-
- Crt.WindMax := Crt.WindMax + 1;
-
- This is the same as calling Window( ) with a larger Y2 except that
- window() will, reasonably, ignore any calls with invalid arguments.
- Also, what you're really doing is: WM := (WM AND $FF00) OR (lo(WM)+1)
- (incrementing the LOW byte). If the low byte should happen to be 254,
- (ie, if your screen has 254 lines in TEXT mode) then you're screwed.
-
- The down side of this method is that TP will happily write to the 26th
- line. I'm not sure what happens then... Or, if you have a window, then
- it writes onto the next line (maybe a frame or part of another window).
- Also, if you do a ClrScr, it will try to clear that extra line too...
-
-
- But on the plus side, the other method will ignore the current window
- (since it is screen relative, not dependant on the BIOS).
-
- -alan mead
-