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

  1. #include <inline/stub.h>
  2. #ifndef BASE_EXT_DECL
  3. #define BASE_EXT_DECL extern struct Device * ConsoleDevice;
  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 ConsoleDevice
  11. #endif
  12. __inline static struct InputEvent* CDInputHandler(BASE_PAR_DECL struct InputEvent* events, struct Library* consoleDevice)
  13. {
  14.     BASE_EXT_DECL
  15.     register struct InputEvent* res __asm("d0");
  16.     register void *a6 __asm ("a6");
  17.     register struct InputEvent* a0 __asm("a0");
  18.     register struct Library* a1 __asm("a1");
  19.  
  20.     a6 = BASE_NAME;
  21.     a0 = events;
  22.     a1 = consoleDevice;
  23.     __asm volatile ("
  24.     jsr a6@(-0x2a)"
  25.     : "=g" (res)
  26.     : "g" (a6), "g" (a0), "g" (a1)
  27.     : "d0", "d1", "a0", "a1");
  28.     return res;
  29. }
  30. __inline static LONG RawKeyConvert(BASE_PAR_DECL struct InputEvent* events, STRPTR buffer, long int length, struct KeyMap* keyMap)
  31. {
  32.     BASE_EXT_DECL
  33.     register LONG res __asm("d0");
  34.     register void *a6 __asm ("a6");
  35.     register struct InputEvent* a0 __asm("a0");
  36.     register STRPTR a1 __asm("a1");
  37.     register long int d1 __asm("d1");
  38.     register struct KeyMap* a2 __asm("a2");
  39.  
  40.     a6 = BASE_NAME;
  41.     a0 = events;
  42.     a1 = buffer;
  43.     d1 = length;
  44.     a2 = keyMap;
  45.     __asm volatile ("
  46.     jsr a6@(-0x30)"
  47.     : "=g" (res)
  48.     : "g" (a6), "g" (a0), "g" (a1), "g" (d1), "g" (a2)
  49.     : "d0", "d1", "a0", "a1", "a2");
  50.     return res;
  51. }
  52. #undef BASE_EXT_DECL
  53. #undef BASE_PAR_DECL
  54. #undef BASE_PAR_DECL0
  55. #undef BASE_NAME
  56.