DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦cc48005a0⟧ TextFile

    Length: 704 (0x2c0)
    Types: TextFile
    Notes: UNIX file
    Names: »ssave.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦926b8033d⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »u/demo/slide/ssave.c« 

TextFile

/*
**	Save an Image off the screen
*/
#include <stdio.h>

#define STARTY 100L
#define ENDY 512L
#define SEG0 ((char *) (0x3a000000L))
#define SEG1 ((char *)( 0x3b000000L))
#define XMAX 1024
#define BPB  8
#define XBYTES (XMAX/BPB)
char a1[16384],a2[16384],a3[16384],a4[16384],a5[16384],a6[16384];
char a7[7168];
char *ar[] = {a1,a2,a3,a4,a5,a6};
char *al = a7;
main(argc,argv)
char	**argv;
{
	unsigned char *sp;
	short n;
	FILE *fp;
	if((fp = fopen(*++argv, "w")) == NULL) {
		printf("Can't open file\n");
		exit();
	}
	sp = SEG0;
	for(n = 0; n < 4; n++) {
		ldir(ar[n],sp, 16384/2);
		sp += 16384;
	}
	sp = SEG1;
	for(n = 4; n<6;n++) {
		ldir(ar[n],sp,16384/2);
		sp += 16384;
	}
	ldir(al,sp,7168/2);
}