home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / Geneve / 9640news / CAT36 / EMULSRC.ZIP / KSCAN.C < prev    next >
Text File  |  1993-04-27  |  514b  |  30 lines

  1. /* KSCAN emulatie */
  2.  
  3. /* F1..F10 key code mapping, plus translation of cursor control keys */
  4.  
  5. int FCTN[]={
  6.   3,  4,  7,  2, 14, 12,  1,  6, 15,  5,
  7. 255,255,255, 11, 12,255,  8,255,  9,255,
  8. 255, 10,  2,  4,  3};
  9.  
  10. void KSCAN(void)
  11. {
  12.     if (KBHIT)
  13.     {
  14.         word key;
  15.         key=GETKEY;
  16.         if (!key&&KBHIT)
  17.         {
  18.             key=GETKEY-59;
  19.             if (key<26) key=FCTN[key];
  20.         }
  21.         memory_write(WP+12,0x2000);
  22.         memory_write(WP,key<<8);
  23.     }
  24.     else
  25.     {
  26.         memory_write(WP+12,0);
  27.         memory_write(WP,0xFF00);
  28.     }
  29.     PC=0x478;
  30. }