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

⟦ee80b2f3b⟧ TextFile

    Length: 541 (0x21d)
    Types: TextFile
    Notes: UNIX file
    Names: »ousave.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦926b8033d⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »u/demo/slide/ousave.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 SIZE 62000L
#define BPB  8
#define XBYTES (XMAX/BPB)
main(argc,argv)
char	**argv;
{
	unsigned char *sp;
	unsigned char *p,*q;
	unsigned short n,ct = 0;
	sp = SEG0;
	printf("");
	if((p = malloc((unsigned short)SIZE)) == NULL) exit();
	q = p;
	while(ct++ < (unsigned short)SIZE) {
		if((*p++ = getchar()) == EOF) break;
	}
	ldir(sp,q,(ct/2));
}