|
25 Years of Programming
An open source source for C, C++, OWL, BASIC, MDB, XLS, DOT, and more... |
Home Projects Up Sitemap Search Blog Forum+Chat About Us Privacy Terms of Use Feedback FAQ Images Services Payments Humor Music |
Display consecutive graphic files to animate them, DeSmet C for the Heathkit H-100 computerI created two graphic file formats, analogs of device-dependent bitmaps, for the H-100, one for monochrome and one for color. The Animate.c program reads a list of these images and displays them consecutively without a pause between, to "animate" them. The most interesting feature of the program is probably that it takes advantage of the H-100's two pages of video RAM by displaying the current image on one of the pages while it loads the next image into the other. |
/* animate.c 11-2-93
Copyright (C)1993 Steven Whitney. Published under the
GNU GPL (General Public License) Version 3, with ABSOLUTELY NO WARRANTY.
Initially published by http://25yearsofprogramming.com.
RETRIEVES AND DISPLAYS CONSECUTIVE .ZIC OR .ZED FILES
WITHOUT A PAUSE BETWEEN.
NAMES OF FILES TO DISPLAY SHOULD BE CONTAINED IN A TEXT FILE
WHOSE NAME IS GIVEN ON THE INVOCATION LINE.
*/
#include "stdio.h"
main(argc,argv)
int argc;
char **argv;
{
FILE *masterfile;
char fnam[20];
puts("\033z"); /* reset terminal */
puts("\033x<"); /* disable keyboard auto-repeat */
puts("\033y@"); /* disable event mode */
puts("\033x1"); /* enable 25th line */
erase25th(); /* clear page 1 screen */
locate(1,1);
puts("\033E");
if(argc < 2)
abort("Usage: ANIMATE filename (filename is a file that contains a list of file names)\n");
if(!(masterfile = fopen(argv[1],"r")))
abort("File not found.\n");
flipcpu(); /* clear page 2 */
erase25th();
locate(1,1);
puts("\033E");
flipcpu();
while(fgets(fnam,20,masterfile))
{
fnam[strlen(fnam)-1] = '\0';
flipcpu(); /* flip page to write to */
zedload(fnam); /* load new page */
flipcrtc(); /* display new page */
}
fclose(masterfile);
restorepg1();
puts("\033z"); /* restore normal screen */
exit(0);
}
|
|
|
|
|
Copyright ©2011 Steven Whitney. Last modified Tue 05/24/2011 12:27:58 -0700. |
||