[comp.lang.pascal] screen save routines for CGA graphics

Alex.Brown@p0.f7.n391.z1.fidonet.org (Alex Brown) (08/05/90)

     I need a procedure written in TP 5.5 that will save the entire 
screen or a portion to a file.  I have been unsuccessful in writing 
my own so any help would be greatly appreciated.

ts@uwasa.fi (Timo Salmi LASK) (08/05/90)

In article <100.26BBE021@palace.fidonet.org> Alex.Brown@p0.f7.n391.z1.fidonet.org (Alex Brown) writes:
>     I need a procedure written in TP 5.5 that will save the entire 
>screen or a portion to a file.  I have been unsuccessful in writing 
>my own so any help would be greatly appreciated.

Try Ohlsen & Stoker, Turbo Pascal Advanced Techniques, Que, 1989.

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

eli@aspasia.gang.umass.edu (Eli Brandt) (08/07/90)

In article <1990Aug5.091054.24051@uwasa.fi> ts@uwasa.fi (Timo Salmi LASK) writes:
>In article <100.26BBE021@palace.fidonet.org> Alex.Brown@p0.f7.n391.z1.fidonet.org (Alex Brown) writes:
>>     I need a procedure written in TP 5.5 that will save the entire 
>>screen or a portion to a file.  I have been unsuccessful in writing 
>>my own so any help would be greatly appreciated.
>
>Try Ohlsen & Stoker, Turbo Pascal Advanced Techniques, Que, 1989.
>
>...................................................................
>Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
>School of Business Studies, University of Vaasa, SF-65101, Finland
>Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

For the entire screen, you can just:
 
var buffer: pointer;

begin
  buffer=getmem(32000);  move(mem[$B800:0000], buffer^, 32000);
  blockwrite(file, buffer^, 32000);
  freemem(buffer);
end.

If you want to do parts of the screen, you will have to loop through by
scanline.  Remember that the video memory is interlaced for CGA graphics - you
have to add 16K*odd(scanline).

I also recommend Ohlsen and Stoker, but you might want to code this without
having to go out and search for a book.