|
|
DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 528 (0x210)
Types: TextFile
Notes: UNIX file
Names: »save.c«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
└─⟦926b8033d⟧ UNIX Filesystem
└─⟦this⟧ »u/demo/slide/save.c«
/*
** Save an Image off the screen
*/
#include <stdio.h>
#define STARTY 35L
#define ENDY 512L
#define SEG0 ((char *) (0x3a000000L))
#define SEG1 ((char *)( 0x3b000000L))
#define XMAX 1024
#define BPB 8
#define XBYTES (XMAX/BPB)
main(argc,argv)
char **argv;
{
unsigned char *sp;
long n;
FILE *fp;
if((fp = fopen(*++argv, "w")) == NULL) {
printf("Can't open file\n");
exit();
}
sp = SEG0;
printf("sp = %X\n",sp);
for(n = STARTY*XBYTES; n < ENDY*XBYTES; n++)
{
putc(sp[n],fp);
sp[n] = (char)0;
}
fclose(fp);
}