home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Pascal / HISOFTPASCAL2,0-2.DMS / in.adf / Units / Console.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-05-20  |  2.6 KB  |  151 lines

  1. unit Console;
  2.  
  3. INTERFACE
  4. uses Exec, Graphics, Input, Intuition, Keymap;
  5.  
  6.  
  7. type
  8.     pConUnit = ^tConUnit;
  9.     tConUnit = record
  10.         cu_MP: tMsgPort;
  11.         cu_Window: pWindow;
  12.         cu_XCP: integer;
  13.         cu_YCP: integer;
  14.         cu_XMax: integer;
  15.         cu_YMax: integer;
  16.         cu_XRSize: integer;
  17.         cu_YRSize: integer;
  18.         cu_XROrigin: integer;
  19.         cu_YROrigin: integer;
  20.         cu_XRExtant: integer;
  21.         cu_YRExtant: integer;
  22.         cu_XMinShrink: integer;
  23.         cu_YMinShrink: integer;
  24.         cu_XCCP: integer;
  25.         cu_YCCP: integer;
  26.         cu_KeyMapStruct: tKeyMap;
  27.         cu_TabStops: array [0..79] of word;
  28.         cu_Mask: shortint;
  29.         cu_FgPen: shortint;
  30.         cu_BgPen: shortint;
  31.         cu_AOLPen: shortint;
  32.         cu_DrawMode: shortint;
  33.         cu_AreaPtSz: shortint;
  34.         cu_AreaPtrn: pointer;
  35.         cu_Minterms: array [0..7] of byte;
  36.         cu_Font: pTextFont;
  37.         cu_AlgoStyle: byte;
  38.         cu_TxFlags: byte;
  39.         cu_TxHeight: word;
  40.         cu_TxWidth: word;
  41.         cu_TxBaseline: word;
  42.         cu_TxSpacing: word;
  43.         cu_Modes: array [0..2] of byte;
  44.         cu_RawEvents: array [0..2] of byte;
  45.         end;
  46.  
  47.  
  48.  
  49. var
  50.     ConsoleDevice: pLibrary;
  51.  
  52.  
  53. const
  54.     SGR_CLR2 = $20;
  55.     SGR_CLR3 = $21;
  56.     SGR_CLR4 = $22;
  57.     SGR_CLR5 = $23;
  58.     SGR_CLR6 = $24;
  59.     SGR_CLR7 = $25;
  60.     SGR_WHITE = $25;
  61.     SGR_BLACKBG = $28;
  62.     CD_ASKDEFAULTKEYMAP = $B;
  63.     CD_SETKEYMAP = $A;
  64.     TBC_HCLRTABSALL = 3;
  65.     SGR_BOLD = 1;
  66.     CTC_HCLRTABSALL = 5;
  67.     TBC_HCLRTAB = 0;
  68.     SGR_NEGATIVE = 7;
  69.     CTC_HCLRTAB = 2;
  70.     SGR_BLUE = $22;
  71.     MAXTABS = $50;
  72.     CD_SETDEFAULTKEYMAP = $C;
  73.     SGR_CYAN = $24;
  74.     CTC_HSETTAB = 0;
  75.     SGR_GREENBG = $2A;
  76.     SGR_MAGENTA = $23;
  77.     SGR_CLR0BG = $28;
  78.     SGR_YELLOWBG = $2B;
  79.     SGR_CLR1BG = $29;
  80.     SGR_CLR2BG = $2A;
  81.     SGR_CLR3BG = $2B;
  82.     SGR_CLR4BG = $2C;
  83.     PMB_ASM = $15;
  84.     SGR_CLR5BG = $2D;
  85.     SGR_DEFAULT = $27;
  86.     SGR_CLR6BG = $2E;
  87.     SGR_CLR7BG = $2F;
  88.     PMB_AWM = $16;
  89.     SGR_RED = $1F;
  90.     SGR_WHITEBG = $2F;
  91.     DSR_CPR = 6;
  92.     SGR_BLUEBG = $2C;
  93.     SGR_CYANBG = $2E;
  94.     SGR_ITALIC = 3;
  95.     SGR_MAGENTABG = $2D;
  96.     SGR_PRIMARY = 0;
  97.     SGR_BLACK = $1E;
  98.     SGR_DEFAULTBG = $31;
  99.     SGR_REDBG = $29;
  100.     SGR_UNDERSCORE = 4;
  101.     SGR_GREEN = $20;
  102.     M_ASM = '>1';
  103.     M_AWM = '?7';
  104.     SGR_CLR0 = $1E;
  105.     CD_ASKKEYMAP = 9;
  106.     SGR_YELLOW = $21;
  107.     SGR_CLR1 = $1F;
  108.     M_LNM = $14;
  109.  
  110.  
  111. function CDInputHandler
  112.         (events: pInputEvent;
  113.         device: pLibrary): pInputEvent;
  114.  
  115. function RawKeyConvert
  116.         (events: pInputEvent;
  117.         buffer: STRPTR;
  118.         length: longint;
  119.         keyMap: pKeyMap): longint;
  120.  
  121.  
  122.  
  123. IMPLEMENTATION
  124. function CDInputHandler; xassembler;
  125. asm
  126.     move.l    a6,-(sp)
  127.     lea        8(sp),a6
  128.     move.l    (a6)+,a1
  129.     move.l    (a6)+,a0
  130.     move.l    ConsoleDevice,a6
  131.     jsr        -$2A(a6)
  132.     move.l    d0,$10(sp)
  133.     move.l    (sp)+,a6
  134. end;
  135.  
  136. function RawKeyConvert; xassembler;
  137. asm
  138.     movem.l    a2/a6,-(sp)
  139.     lea        $C(sp),a6
  140.     move.l    (a6)+,a2
  141.     move.l    (a6)+,d1
  142.     move.l    (a6)+,a1
  143.     move.l    (a6)+,a0
  144.     move.l    ConsoleDevice,a6
  145.     jsr        -$30(a6)
  146.     move.l    d0,$1C(sp)
  147.     movem.l    (sp)+,a2/a6
  148. end;
  149.  
  150. end.
  151.