/* $Header: util.c,v 10.4 86/11/30 16:45:52 jg Rel $ */
/* util.c Various utilities
* ErrorString Interprets an error string
* SoundBell Generate audible bell
* SetKeyClick Control key click
* SetAutoRepeat Control auto repeat
* SetLockLED Control Lock LED
* QueryShape Determine shapes
* SetVideo Set video blanking
* ResolveColors does nothing
* StoreColors does nothing
/****************************************************************************
* Copyright (c) 1983, 1984 by *
* DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts. *
* This software is furnished on an as-is basis and may be used and copied *
* only with inclusion of the above copyright notice. This software or any *
* other copies thereof may be provided or otherwise made available to *
* others only for non-commercial purposes. No title to or ownership of *
* the software is hereby transferred. *
* The information in this software is subject to change without notice *
* and should not be construed as a commitment by DIGITAL EQUIPMENT *
* DIGITAL assumes no responsibility for the use or reliability of its *
* software on equipment which is not supplied by DIGITAL. *
****************************************************************************/
extern char *sys_errlist
[];
} errorList
[NUM_ERR_CODES
] = {
{IR_AB_ACK
, IR_AB_ACK_MSG
},
{IR_STAT_ACK
, IR_STAT_ACK_MSG
},
{IR_SAVE_ACK
, IR_SAVE_ACK_MSG
},
{ERR_NYI
, ERR_NYI_MSG
},
{ERR_BE_NXM_68K
, ERR_BE_NXM_68K_MSG
},
{ERR_BE_RO
, ERR_BE_RO_MSG
},
{ERR_BE_LD
, ERR_BE_LD_MSG
},
{ERR_BE_S
, ERR_BE_S_MSG
},
{ERR_NXM_BBA
, ERR_NXM_BBA_MSG
},
{ERR_KCQO
, ERR_KCQO_MSG
},
{ERR_DPCQO
, ERR_DPCQO_MSG
},
{ERR_MEQO
, ERR_MEQO_MSG
},
{ERR_DPEQO
, ERR_DPEQO_MSG
},
{ERR_AB_BBA
, ERR_AB_BBA_MSG
},
{ERR_KEQO
, ERR_KEQO_MSG
},
{ERR_DPOR
, ERR_DPOR_MSG
},
{ERR_DPFE
, ERR_DPFE_MSG
},
{ERR_ISRCM
, ERR_ISRCM_MSG
},
{ERR_ISRCBW
, ERR_ISRCBW_MSG
},
{ERR_ISRCBH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R_DC_ISSRCHW_MSG
},
{ERR_DC_ISSRCHH
, ERR_DC_ISSRCHH_MSG
},
{ERR_DC_ISSRCHD
, ERR_DC_ISSRCHD_MSG
},
{ERR_LC_ICTX
, ERR_LC_ICTX_MSG
},
{ERR_LC_ICTY
, ERR_LC_ICTY_MSG
},
{ERR_LC_ICCX
, ERR_LC_ICCX_MSG
},
{ERR_LC_ICCY
, ERR_LC_ICCY_MSG
},
{ERR_LC_ICW
, ERR_LC_ICW_MSG
},
{ERR_LC_ICH
, ERR_LC_ICH_MSG
},
{ERR_PT_DXO
, ERR_PT_DXO_MSG
},
{ERR_PT_CRSO
, ERR_PT_CRSO_MSG
},
/* Interpret a string corresponding to an error code. This doesn't
* work very well since the driver can't return enough bits for the
* code, but we do our best */
char *ErrorString (error
)
for (i
= 0; i
< NUM_ERR_CODES
; i
++) {
if (errorList
[i
].code
== error
)
return (errorList
[i
].reason
);
if (error
> 0 && error
< sys_nerr
)
return (sys_errlist
[error
]);
return ("Unknown error");
if ((buf
= (char *) AllocateSpace(4)) == NULL
)
SendToPeripheral(buf
, 4, VSE_DKB
);
if ((buf
= (char *) AllocateSpace(3)) == NULL
)
SendToPeripheral(buf
, 3, VSE_DKB
);
QueryShape (shape
, width
, height
)
if ((buf
= (char *) AllocateSpace(2)) == NULL
)
buf
[1] = onoff
? 0xe3 : 0xe1;
SendToPeripheral(buf
, 2, VSE_DKB
);
ResolveColor (red
, green
, blue
)
unsigned short *red
, *green
, *blue
;
StoreColors (count
, entries
)