[fpc-pascal] Cross Platform Save/Restore Screen
Michael Van Canneyt
michael at freepascal.org
Tue Jun 20 16:53:02 CEST 2006
On Tue, 20 Jun 2006, Michael Preslar wrote:
> Back in the DOS Turbo Pascal days I could do the following
> screentype= array[1..4000] of byte;
> screen1: screenptr;
> procedure savescreen(scr:byte);
> sc1: byte absolute $b000:0;
> sc2: byte absolute $b800:0;
> if screenaddress=$b000 then move(sc1,screens1^,4000);
> if screenaddress=$b800 then move(sc2,screens1^,4000);
> procedure restorescreen(scr:byte);
> sc1: byte absolute $b800:0;
> sc2: byte absolute $b000:0;
> if screenaddress=$b000 then move(screens1^, sc2,4000);
> if screenaddress=$b800 then move(screens1^, sc1,4000);
> Now I'm stuck. How can I do the same for Win32 Console apps, and
> *nix/*bsd console apps?
The short answer: You simply can't...
You must use the 'video' unit to do this kind of tricks in a more or less
cross-platform way, but you'll have to rewrite your code completely.
You may also want to have a look at the ncurses unit and the various
descendents, ocrt, ncrt.
video is documented, and is part of the RTL.
The others are in the packages.
More information about the fpc-pascal