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
/
SGTOOL12.ARC
/
LIBC128.ARC
/
VDCFILL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-10
|
796b
|
37 lines
/*
SG C Tools 1.2
(C) 1993 Steve Goldsmith
All Rights Reserved
Compiled with HI-TECH C 3.09 (CP/M-80).
*/
#include <hitech.h>
#include <vdc.h>
/* fast fill using block writes */
void fillmemvdc(ushort FillMem, ushort FillLen, uchar Filler)
{
uchar Blocks, Remain;
register uchar I;
outvdc(vdcUpdAddrHi,(uchar) (FillMem >> 8));
outvdc(vdcUpdAddrLo,(uchar) FillMem);
outvdc(vdcVtSmScroll,(invdc(vdcVtSmScroll) & 0x7F));
outvdc(vdcCPUData,Filler);
if (FillLen > vdcMaxBlock)
{
Blocks = FillLen/vdcMaxBlock;
Remain = FillLen%vdcMaxBlock;
for(I = 1; I <= Blocks; I++)
outvdc(vdcWordCnt,vdcMaxBlock);
if (Remain > 1)
outvdc(vdcWordCnt,--Remain);
}
else
if (FillLen > 1)
outvdc(vdcWordCnt,--FillLen);
}