home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
kaypro
/
trstatln.lbr
/
STATLN.CQ
/
STATLN.C
Wrap
Text File
|
1986-07-13
|
4KB
|
139 lines
/*==============================================================*/
/* statln.c enable/disable 25th line for '84 TurboROMs */
/* */
/* this code compiles with Software Toolworks C/80 3.1 */
/* C compiler. */
/* */
/* 3/21/86 gsd added comments */
/* 11/12/85 gsd initial coding */
/*==============================================================*/
#define TRUE 1
#define FALSE 0
#define STDBDOS 0x0dfa /* length of standard BDOS */
#define SUMLN 8 /* number of bytes checksummed */
#define ESC \033 /* ascii escape character */
#define CLS \032 /* clear screen character */
#define EOL \030 /* erase to end of line */
char *id_match = "PPS"; /* Turbo ROM ID string */
char *en_25 = " \033=8 \030\032\033B7Status Line: Enabled";
char *dis_25 = " \033=8 \030\032\033C7Status Line: Disabled";
/*==============================================================*/
/* structure definintion for hard disk table variables */
/*==============================================================*/
struct hd_tbl {
int *badtr0; /* pointer to first bad track */
int mxcyl0; /* maximum cylinder phys drv 1 */
char step0; /* step rate phys drv 1 */
char precp0; /* precompensation drv 1 */
int *badtr1; /* pointer to first bad track */
int mxcyl1; /* maximum cylinder phys drv 2 */
char step1; /* step rate phys drv 2 */
char precp1; /* precompensation drv 2 */
char sltmsk; /* drive select mask */
char wdflag; /* HDC present flag */
char fstat; /* drive track density status */
char muxflg; /* 4 drive decoder flag */
char dmy1[12]; /* floppy drive constants */
char fstprt; /* current floppy step rate */
char hlddly; /* current floppy head load */
char stldly; /* current haed delay time */
char smflag; /* flag for K10 small sectors */
};
/*==============================================================*/
/* structure definintion for fixed high memory objects */
/*==============================================================*/
struct hi_mem {
struct hd_tbl *hrdptr; /* pointer to hard disk tables */
char *extptr; /* external translation area */
char *intptr; /* interrupt vectors */
char *hstptr; /* bottom of host buffer */
char *dpbptr; /* DPB table */
char *dphptr; /* DPH drive table */
char rom_id[3]; /* ROM ID string */
char rom_vers; /* ROM version */
char dmy; /* 8080 jmp opcode */
int (*xclrom)(); /* ROM entry point */
char rom_cks; /* ROM checksum byte */
};
struct hi_mem *ram = 0xffec;èstruct hd_tbl *var;
char *bios, *bdos;
int on = 1;
main(argc, argv)
int argc;
char *argv[];
{
/*
generate pointers to BIOS and BDOS entry points
*/
bios = ((char *) (*((int *) 0x0001))) - 3;
bdos = bios - STDBDOS;
if(isturbo() && (ram->rom_vers & 0x80)){
if(argc > 1){
if(on)
on = strcmp(argv[1], "OFF");
if(on)
on = strcmp(argv[1], "0");
}
puts((on) ? en_25 : dis_25);
exit();
}
puts("\nThis program requires the \'84 TurboROM");
}
/*==============================================================*/
/* puts(str) output null terminated string to stdout */
/*==============================================================*/
puts(str)
char *str;
{
while(*str)
putchar(*str++);
}
/*==============================================================*/
/* isturbo() fuction to test if Turbo ROM installed */
/* */
/* returns: TRUE if Turbo ROM installed */
/* FALSE if Turbo ROM not installed */
/*==============================================================*/
isturbo()
{
char *p, *id, sum;
int i;
/*
verify ROM checksum
*/
p = ram->rom_cks;
sum = 0;
i = SUMLN;
while(i--)
sum += *p--;
if(sum){
}
/*
verify ROM ID
*/
id = id_match;
p = ram->rom_id;
while(*id){
if(*p++ == *id++)
continue;
return FALSE;
}
/*
Set up pointer to floating variables
*/
var = ram->hrdptr;
return TRUE;
}