home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
decus
/
RB139
/
mwc-rb.lzh
/
KBD16.C
next >
Wrap
Text File
|
1986-03-27
|
1KB
|
39 lines
/* Fast Video Access Service */
#include <dos.h> /* Msdos definitions */
#include <rbrom.h> /* Rainbow firmware service codes */
#include <rbfkeys.h>
#define lo_byte(x) (x & 0xff)
#define hi_byte(x) ((x>>8) & 0xff)
static char translate[] =
{15,16,99,02,99,04,99,06,99,07,99,08,99,09,99,10,
99,14,99,17,99,18,99,19,99,20,99,21,99,22,99,23,
99,24,99,25,99,26,99,27,99,29,99,30,99,28,99,31,
99,99,32,99,99,33,99,99,34,99,99,35,99,99,36,99,
99,37,99,99,38,99,99,39,99,99,40,99,99,42,99,99,
41,99,99,43,99,99,48,99,99,44,99,99,45,99,99,46,
99,99,47,99,99,05};
static struct reg r;
int kbd16(keycode)
int *keycode;
{
r.r_di = ROM_ConsoleLev1In;
intcall(&r,&r,24);
if (lo_byte(r.r_cx) == 0)
return(0);
else if (lo_byte(r.r_cx) == 1)
return(1);
else
{
if ((r.r_ax & fv_fkey) != 0)
r.r_ax = (r.r_ax & 0xff00) | translate[lo_byte(r.r_ax)];
*keycode = r.r_ax;
return(-1);
}
}