home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
S
/
SGTOOL11.ARC
/
SAVECHRS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-07-25
|
1KB
|
62 lines
/*
SG C Tools 1.1
(C) 1993 Steve Goldsmith
All Rights Reserved
Saves both VDC character sets to a file.
Compiled with HI-TECH C 3.09 (CP/M-80).
To compile with HI-TECH C and SG C Tools source on same disk use:
C SAVECHRS.C -LC128
*/
#include <stdio.h>
#include <hitech.h>
#include <vdc.h>
void disphelp(void);
void savecharsets(char *FileName);
extern ushort vdcCharMem;
extern ushort vdcCharMemSize;
main(int argc, char *argv[])
{
puts("\nSAVECHRS (C) 1993 Steve Goldsmith");
if (argc == 2)
{
savevdc();
savecharsets(argv[1]);
restorevdc();
}
else
disphelp();
}
void disphelp(void)
{
puts("\nTo save VDC character definitions use:\n");
puts("SAVECHRS FILENAME.EXT");
}
void savecharsets(char *FileName)
{
uchar *BufPtr;
FILE *CharFile;
if ((CharFile = fopen(FileName,"wb")) != NULL)
{
puts("\nCopying VDC character definitions to buffer...");
BufPtr = memtobufvdc(vdcCharMem,vdcCharMemSize);
if (BufPtr != NULL)
{
printf("Copying buffer to %s...\n",FileName);
fwrite(BufPtr,sizeof(uchar),vdcCharMemSize,CharFile);
free(BufPtr);
}
fclose(CharFile);
}
}