home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / programm / programi / gcc_9112.lzh / include20 / inline / keymap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-15  |  2.1 KB  |  89 lines

  1. #include <inline/stub.h>
  2. #ifndef BASE_EXT_DECL
  3. #define BASE_EXT_DECL extern struct KeymapBase * KeymapBase;
  4. #endif
  5. #ifndef BASE_PAR_DECL
  6. #define BASE_PAR_DECL
  7. #define BASE_PAR_DECL0 void
  8. #endif
  9. #ifndef BASE_NAME
  10. #define BASE_NAME KeymapBase
  11. #endif
  12. __inline static void SetKeyMapDefault(BASE_PAR_DECL struct KeyMap* keyMap)
  13. {
  14.     BASE_EXT_DECL
  15.     register void *a6 __asm ("a6");
  16.     register struct KeyMap* a0 __asm("a0");
  17.  
  18.     a6 = BASE_NAME;
  19.     a0 = keyMap;
  20.     __asm volatile ("
  21.     jsr a6@(-0x1e)"
  22.     : /* no output */
  23.     : "g" (a6), "g" (a0)
  24.     : "d0", "d1", "a0", "a1");
  25. }
  26. __inline static struct KeyMap* AskKeyMapDefault(BASE_PAR_DECL0)
  27. {
  28.     BASE_EXT_DECL
  29.     register struct KeyMap* res __asm("d0");
  30.     register void *a6 __asm ("a6");
  31.     a6 = BASE_NAME;
  32.     __asm volatile ("
  33.     jsr a6@(-0x24)"
  34.     : "=g" (res)
  35.     : "g" (a6)
  36.     : "d0", "d1", "a0", "a1");
  37.     return res;
  38. }
  39. __inline static WORD MapRawKey(BASE_PAR_DECL struct InputEvent* event, STRPTR buffer, long int length, struct KeyMap* keyMap)
  40. {
  41.     BASE_EXT_DECL
  42.     register WORD res __asm("d0");
  43.     register void *a6 __asm ("a6");
  44.     register struct InputEvent* a0 __asm("a0");
  45.     register STRPTR a1 __asm("a1");
  46.     register long int d1 __asm("d1");
  47.     register struct KeyMap* a2 __asm("a2");
  48.  
  49.     a6 = BASE_NAME;
  50.     a0 = event;
  51.     a1 = buffer;
  52.     d1 = length;
  53.     a2 = keyMap;
  54.     __asm volatile ("
  55.     jsr a6@(-0x2a)"
  56.     : "=g" (res)
  57.     : "g" (a6), "g" (a0), "g" (a1), "g" (d1), "g" (a2)
  58.     : "d0", "d1", "a0", "a1", "a2");
  59.     return res;
  60. }
  61. __inline static LONG MapANSI(BASE_PAR_DECL STRPTR string, long int count, STRPTR buffer, long int length, struct KeyMap* keyMap)
  62. {
  63.     BASE_EXT_DECL
  64.     register LONG res __asm("d0");
  65.     register void *a6 __asm ("a6");
  66.     register STRPTR a0 __asm("a0");
  67.     register long int d0 __asm("d0");
  68.     register STRPTR a1 __asm("a1");
  69.     register long int d1 __asm("d1");
  70.     register struct KeyMap* a2 __asm("a2");
  71.  
  72.     a6 = BASE_NAME;
  73.     a0 = string;
  74.     d0 = count;
  75.     a1 = buffer;
  76.     d1 = length;
  77.     a2 = keyMap;
  78.     __asm volatile ("
  79.     jsr a6@(-0x30)"
  80.     : "=g" (res)
  81.     : "g" (a6), "g" (a0), "g" (d0), "g" (a1), "g" (d1), "g" (a2)
  82.     : "d0", "d1", "a0", "a1", "a2");
  83.     return res;
  84. }
  85. #undef BASE_EXT_DECL
  86. #undef BASE_PAR_DECL
  87. #undef BASE_PAR_DECL0
  88. #undef BASE_NAME
  89.