[fpc-pascal] Cross Platform Save/Restore Screen

Luiz Americo Pereira Camara pascalive at bol.com.br
Wed Jun 21 15:43:40 CEST 2006

Michael Preslar wrote:
> Back in the DOS Turbo Pascal days I could do the following
> type
>  screentype= array[1..4000] of byte;
>  screenptr=^screentype;
> var
>  screen1: screenptr;
> procedure savescreen(scr:byte);
> var
>  sc1: byte absolute $b000:0;
>  sc2: byte absolute $b800:0;
> begin;
>  if screenaddress=$b000 then move(sc1,screens1^,4000);
>  if screenaddress=$b800 then move(sc2,screens1^,4000);
> end;
> procedure restorescreen(scr:byte);
> var
>  sc1: byte absolute $b800:0;
>  sc2: byte absolute $b000:0;
> begin;
>  if screenaddress=$b000 then move(screens1^, sc2,4000);
>  if screenaddress=$b800 then move(screens1^, sc1,4000);
> end;
> Now I'm stuck. How can I do the same for Win32 Console apps, and
> *nix/*bsd console apps?
> (For anyone wondering.. I'm the Legend of the Red Dragon developer
> [remember that old beast?], and after porting LORD to Win32, *nix [and
> mostly *bsd .. Just need to replace the dependance on the 'oldlinux'
> unit], and os2, I'm converting LordCfg to a native binary as well, and
> need the savescreen/restorescreen for the eyecandy part of the program)
I'm sending a unit that has such functions for win32.
I've used this unit in a homebrew console ui "toolkit", but be aware 
that the last time i compiled it was in fpc106 days so maybe is not 
compiling in today fpc. Anyway, you can have a idea how implement it.
The functions you must look are: SalvarTela(SaveScreen) and 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: luiunit.tar.gz
Type: application/x-gzip
Size: 4785 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20060621/312b4b44/attachment.bin>

More information about the fpc-pascal mailing list