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
/
VDCMAP.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-10
|
1KB
|
49 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>
uchar vdcScrHorz;
uchar vdcScrVert;
ushort vdcScrSize;
ushort vdcDispMem;
ushort vdcAttrMem;
ushort vdcCharMem;
ushort vdcCharMemSize;
uchar vdcCharBytes;
uchar vdcCharVert;
ushort vdcBitMapMemSize;
/* set global 'vdc' prefixed vars from current vdc settings. the char mem */
/* value is only correct if character set is at 2000, 6000, a000 and e000. */
void mapvdc(void)
{
vdcScrHorz = invdc(vdcHzDisp);
vdcScrVert = invdc(vdcVtDisp);
vdcScrSize = vdcScrHorz*vdcScrVert;
vdcDispMem = (invdc(vdcDspStAddrHi) << 8)+invdc(vdcDspStAddrLo);
vdcAttrMem = (invdc(vdcAttrStAddrHi) << 8)+invdc(vdcAttrStAddrLo);
vdcBitMapMemSize = 16000;
vdcCharVert = (invdc(vdcChTotalVt) & 0x1F)+1;
if (vdcCharVert > 16)
{
vdcCharMem = (invdc(vdcChSetStAddr) & 0xC0) << 8;
vdcCharBytes = vdcMaxCharBytes;
vdcCharMemSize = (vdcCharsPerSet*vdcCharBytes) << 1;
}
else
{
vdcCharMem = (invdc(vdcChSetStAddr) & 0xE0) << 8;
vdcCharBytes = vdcMaxCharBytes >> 1;
vdcCharMemSize = (vdcCharsPerSet*vdcCharBytes) << 1;
}
}