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

  1. #include <inline/stub.h>
  2. #ifndef BASE_EXT_DECL
  3. #define BASE_EXT_DECL extern struct Library * CxBase;
  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 CxBase
  11. #endif
  12. __inline static CxObj* CreateCxObj(BASE_PAR_DECL long unsigned int type, long int arg1, long int arg2)
  13. {
  14.     BASE_EXT_DECL
  15.     register CxObj* res __asm("d0");
  16.     register void *a6 __asm ("a6");
  17.     register long unsigned int d0 __asm("d0");
  18.     register long int a0 __asm("a0");
  19.     register long int a1 __asm("a1");
  20.  
  21.     a6 = BASE_NAME;
  22.     d0 = type;
  23.     a0 = arg1;
  24.     a1 = arg2;
  25.     __asm volatile ("
  26.     jsr a6@(-0x1e)"
  27.     : "=g" (res)
  28.     : "g" (a6), "g" (d0), "g" (a0), "g" (a1)
  29.     : "d0", "d1", "a0", "a1");
  30.     return res;
  31. }
  32. __inline static CxObj* CxBroker(BASE_PAR_DECL struct NewBroker* nb, LONG* error)
  33. {
  34.     BASE_EXT_DECL
  35.     register CxObj* res __asm("d0");
  36.     register void *a6 __asm ("a6");
  37.     register struct NewBroker* a0 __asm("a0");
  38.     register LONG* d0 __asm("d0");
  39.  
  40.     a6 = BASE_NAME;
  41.     a0 = nb;
  42.     d0 = error;
  43.     __asm volatile ("
  44.     jsr a6@(-0x24)"
  45.     : "=g" (res)
  46.     : "g" (a6), "g" (a0), "g" (d0)
  47.     : "d0", "d1", "a0", "a1");
  48.     return res;
  49. }
  50. __inline static LONG ActivateCxObj(BASE_PAR_DECL CxObj* co, long int true)
  51. {
  52.     BASE_EXT_DECL
  53.     register LONG res __asm("d0");
  54.     register void *a6 __asm ("a6");
  55.     register CxObj* a0 __asm("a0");
  56.     register long int d0 __asm("d0");
  57.  
  58.     a6 = BASE_NAME;
  59.     a0 = co;
  60.     d0 = true;
  61.     __asm volatile ("
  62.     jsr a6@(-0x2a)"
  63.     : "=g" (res)
  64.     : "g" (a6), "g" (a0), "g" (d0)
  65.     : "d0", "d1", "a0", "a1");
  66.     return res;
  67. }
  68. __inline static void DeleteCxObj(BASE_PAR_DECL CxObj* co)
  69. {
  70.     BASE_EXT_DECL
  71.     register void *a6 __asm ("a6");
  72.     register CxObj* a0 __asm("a0");
  73.  
  74.     a6 = BASE_NAME;
  75.     a0 = co;
  76.     __asm volatile ("
  77.     jsr a6@(-0x30)"
  78.     : /* no output */
  79.     : "g" (a6), "g" (a0)
  80.     : "d0", "d1", "a0", "a1");
  81. }
  82. __inline static void DeleteCxObjAll(BASE_PAR_DECL CxObj* co)
  83. {
  84.     BASE_EXT_DECL
  85.     register void *a6 __asm ("a6");
  86.     register CxObj* a0 __asm("a0");
  87.  
  88.     a6 = BASE_NAME;
  89.     a0 = co;
  90.     __asm volatile ("
  91.     jsr a6@(-0x36)"
  92.     : /* no output */
  93.     : "g" (a6), "g" (a0)
  94.     : "d0", "d1", "a0", "a1");
  95. }
  96. __inline static ULONG CxObjType(BASE_PAR_DECL CxObj* co)
  97. {
  98.     BASE_EXT_DECL
  99.     register ULONG res __asm("d0");
  100.     register void *a6 __asm ("a6");
  101.     register CxObj* a0 __asm("a0");
  102.  
  103.     a6 = BASE_NAME;
  104.     a0 = co;
  105.     __asm volatile ("
  106.     jsr a6@(-0x3c)"
  107.     : "=g" (res)
  108.     : "g" (a6), "g" (a0)
  109.     : "d0", "d1", "a0", "a1");
  110.     return res;
  111. }
  112. __inline static LONG CxObjError(BASE_PAR_DECL CxObj* co)
  113. {
  114.     BASE_EXT_DECL
  115.     register LONG res __asm("d0");
  116.     register void *a6 __asm ("a6");
  117.     register CxObj* a0 __asm("a0");
  118.  
  119.     a6 = BASE_NAME;
  120.     a0 = co;
  121.     __asm volatile ("
  122.     jsr a6@(-0x42)"
  123.     : "=g" (res)
  124.     : "g" (a6), "g" (a0)
  125.     : "d0", "d1", "a0", "a1");
  126.     return res;
  127. }
  128. __inline static void ClearCxObjError(BASE_PAR_DECL CxObj* co)
  129. {
  130.     BASE_EXT_DECL
  131.     register void *a6 __asm ("a6");
  132.     register CxObj* a0 __asm("a0");
  133.  
  134.     a6 = BASE_NAME;
  135.     a0 = co;
  136.     __asm volatile ("
  137.     jsr a6@(-0x48)"
  138.     : /* no output */
  139.     : "g" (a6), "g" (a0)
  140.     : "d0", "d1", "a0", "a1");
  141. }
  142. __inline static void SetCxObjPri(BASE_PAR_DECL CxObj* co, long int pri)
  143. {
  144.     BASE_EXT_DECL
  145.     register void *a6 __asm ("a6");
  146.     register CxObj* a0 __asm("a0");
  147.     register long int d0 __asm("d0");
  148.  
  149.     a6 = BASE_NAME;
  150.     a0 = co;
  151.     d0 = pri;
  152.     __asm volatile ("
  153.     jsr a6@(-0x4e)"
  154.     : /* no output */
  155.     : "g" (a6), "g" (a0), "g" (d0)
  156.     : "d0", "d1", "a0", "a1");
  157. }
  158. __inline static void AttachCxObj(BASE_PAR_DECL CxObj* headobj, CxObj* co)
  159. {
  160.     BASE_EXT_DECL
  161.     register void *a6 __asm ("a6");
  162.     register CxObj* a0 __asm("a0");
  163.     register CxObj* a1 __asm("a1");
  164.  
  165.     a6 = BASE_NAME;
  166.     a0 = headobj;
  167.     a1 = co;
  168.     __asm volatile ("
  169.     jsr a6@(-0x54)"
  170.     : /* no output */
  171.     : "g" (a6), "g" (a0), "g" (a1)
  172.     : "d0", "d1", "a0", "a1");
  173. }
  174. __inline static void EnqueueCxObj(BASE_PAR_DECL CxObj* headobj, CxObj* co)
  175. {
  176.     BASE_EXT_DECL
  177.     register void *a6 __asm ("a6");
  178.     register CxObj* a0 __asm("a0");
  179.     register CxObj* a1 __asm("a1");
  180.  
  181.     a6 = BASE_NAME;
  182.     a0 = headobj;
  183.     a1 = co;
  184.     __asm volatile ("
  185.     jsr a6@(-0x5a)"
  186.     : /* no output */
  187.     : "g" (a6), "g" (a0), "g" (a1)
  188.     : "d0", "d1", "a0", "a1");
  189. }
  190. __inline static void InsertCxObj(BASE_PAR_DECL CxObj* headobj, CxObj* co, CxObj* pred)
  191. {
  192.     BASE_EXT_DECL
  193.     register void *a6 __asm ("a6");
  194.     register CxObj* a0 __asm("a0");
  195.     register CxObj* a1 __asm("a1");
  196.     register CxObj* a2 __asm("a2");
  197.  
  198.     a6 = BASE_NAME;
  199.     a0 = headobj;
  200.     a1 = co;
  201.     a2 = pred;
  202.     __asm volatile ("
  203.     jsr a6@(-0x60)"
  204.     : /* no output */
  205.     : "g" (a6), "g" (a0), "g" (a1), "g" (a2)
  206.     : "d0", "d1", "a0", "a1", "a2");
  207. }
  208. __inline static void RemoveCxObj(BASE_PAR_DECL CxObj* co)
  209. {
  210.     BASE_EXT_DECL
  211.     register void *a6 __asm ("a6");
  212.     register CxObj* a0 __asm("a0");
  213.  
  214.     a6 = BASE_NAME;
  215.     a0 = co;
  216.     __asm volatile ("
  217.     jsr a6@(-0x66)"
  218.     : /* no output */
  219.     : "g" (a6), "g" (a0)
  220.     : "d0", "d1", "a0", "a1");
  221. }
  222. #ifdef PRIVATE
  223. #endif
  224. __inline static void SetTranslate(BASE_PAR_DECL CxObj* translator, IX* events)
  225. {
  226.     BASE_EXT_DECL
  227.     register void *a6 __asm ("a6");
  228.     register CxObj* a0 __asm("a0");
  229.     register IX* a1 __asm("a1");
  230.  
  231.     a6 = BASE_NAME;
  232.     a0 = translator;
  233.     a1 = events;
  234.     __asm volatile ("
  235.     jsr a6@(-0x72)"
  236.     : /* no output */
  237.     : "g" (a6), "g" (a0), "g" (a1)
  238.     : "d0", "d1", "a0", "a1");
  239. }
  240. __inline static void SetFilter(BASE_PAR_DECL CxObj* filter, IX* text)
  241. {
  242.     BASE_EXT_DECL
  243.     register void *a6 __asm ("a6");
  244.     register CxObj* a0 __asm("a0");
  245.     register IX* a1 __asm("a1");
  246.  
  247.     a6 = BASE_NAME;
  248.     a0 = filter;
  249.     a1 = text;
  250.     __asm volatile ("
  251.     jsr a6@(-0x78)"
  252.     : /* no output */
  253.     : "g" (a6), "g" (a0), "g" (a1)
  254.     : "d0", "d1", "a0", "a1");
  255. }
  256. __inline static void SetFilterIX(BASE_PAR_DECL CxObj* filter, IX* ix)
  257. {
  258.     BASE_EXT_DECL
  259.     register void *a6 __asm ("a6");
  260.     register CxObj* a0 __asm("a0");
  261.     register IX* a1 __asm("a1");
  262.  
  263.     a6 = BASE_NAME;
  264.     a0 = filter;
  265.     a1 = ix;
  266.     __asm volatile ("
  267.     jsr a6@(-0x7e)"
  268.     : /* no output */
  269.     : "g" (a6), "g" (a0), "g" (a1)
  270.     : "d0", "d1", "a0", "a1");
  271. }
  272. __inline static LONG ParseIX(BASE_PAR_DECL UBYTE* description, IX* ix)
  273. {
  274.     BASE_EXT_DECL
  275.     register LONG res __asm("d0");
  276.     register void *a6 __asm ("a6");
  277.     register UBYTE* a0 __asm("a0");
  278.     register IX* a1 __asm("a1");
  279.  
  280.     a6 = BASE_NAME;
  281.     a0 = description;
  282.     a1 = ix;
  283.     __asm volatile ("
  284.     jsr a6@(-0x84)"
  285.     : "=g" (res)
  286.     : "g" (a6), "g" (a0), "g" (a1)
  287.     : "d0", "d1", "a0", "a1");
  288.     return res;
  289. }
  290. __inline static ULONG CxMsgType(BASE_PAR_DECL CxMsg* cxm)
  291. {
  292.     BASE_EXT_DECL
  293.     register ULONG res __asm("d0");
  294.     register void *a6 __asm ("a6");
  295.     register CxMsg* a0 __asm("a0");
  296.  
  297.     a6 = BASE_NAME;
  298.     a0 = cxm;
  299.     __asm volatile ("
  300.     jsr a6@(-0x8a)"
  301.     : "=g" (res)
  302.     : "g" (a6), "g" (a0)
  303.     : "d0", "d1", "a0", "a1");
  304.     return res;
  305. }
  306. __inline static UBYTE* CxMsgData(BASE_PAR_DECL CxMsg* cxm)
  307. {
  308.     BASE_EXT_DECL
  309.     register UBYTE* res __asm("d0");
  310.     register void *a6 __asm ("a6");
  311.     register CxMsg* a0 __asm("a0");
  312.  
  313.     a6 = BASE_NAME;
  314.     a0 = cxm;
  315.     __asm volatile ("
  316.     jsr a6@(-0x90)"
  317.     : "=g" (res)
  318.     : "g" (a6), "g" (a0)
  319.     : "d0", "d1", "a0", "a1");
  320.     return res;
  321. }
  322. __inline static LONG CxMsgID(BASE_PAR_DECL CxMsg* cxm)
  323. {
  324.     BASE_EXT_DECL
  325.     register LONG res __asm("d0");
  326.     register void *a6 __asm ("a6");
  327.     register CxMsg* a0 __asm("a0");
  328.  
  329.     a6 = BASE_NAME;
  330.     a0 = cxm;
  331.     __asm volatile ("
  332.     jsr a6@(-0x96)"
  333.     : "=g" (res)
  334.     : "g" (a6), "g" (a0)
  335.     : "d0", "d1", "a0", "a1");
  336.     return res;
  337. }
  338. __inline static void DivertCxMsg(BASE_PAR_DECL CxMsg* cxm, CxObj* headobj, CxObj* ret)
  339. {
  340.     BASE_EXT_DECL
  341.     register void *a6 __asm ("a6");
  342.     register CxMsg* a0 __asm("a0");
  343.     register CxObj* a1 __asm("a1");
  344.     register CxObj* a2 __asm("a2");
  345.  
  346.     a6 = BASE_NAME;
  347.     a0 = cxm;
  348.     a1 = headobj;
  349.     a2 = ret;
  350.     __asm volatile ("
  351.     jsr a6@(-0x9c)"
  352.     : /* no output */
  353.     : "g" (a6), "g" (a0), "g" (a1), "g" (a2)
  354.     : "d0", "d1", "a0", "a1", "a2");
  355. }
  356. __inline static void RouteCxMsg(BASE_PAR_DECL CxMsg* cxm, CxObj* co)
  357. {
  358.     BASE_EXT_DECL
  359.     register void *a6 __asm ("a6");
  360.     register CxMsg* a0 __asm("a0");
  361.     register CxObj* a1 __asm("a1");
  362.  
  363.     a6 = BASE_NAME;
  364.     a0 = cxm;
  365.     a1 = co;
  366.     __asm volatile ("
  367.     jsr a6@(-0xa2)"
  368.     : /* no output */
  369.     : "g" (a6), "g" (a0), "g" (a1)
  370.     : "d0", "d1", "a0", "a1");
  371. }
  372. __inline static void DisposeCxMsg(BASE_PAR_DECL CxMsg* cxm)
  373. {
  374.     BASE_EXT_DECL
  375.     register void *a6 __asm ("a6");
  376.     register CxMsg* a0 __asm("a0");
  377.  
  378.     a6 = BASE_NAME;
  379.     a0 = cxm;
  380.     __asm volatile ("
  381.     jsr a6@(-0xa8)"
  382.     : /* no output */
  383.     : "g" (a6), "g" (a0)
  384.     : "d0", "d1", "a0", "a1");
  385. }
  386. __inline static ULONG InvertKeyMap(BASE_PAR_DECL long unsigned int ansicode, struct InputEvent* event, struct KeyMap* km)
  387. {
  388.     BASE_EXT_DECL
  389.     register ULONG res __asm("d0");
  390.     register void *a6 __asm ("a6");
  391.     register long unsigned int d0 __asm("d0");
  392.     register struct InputEvent* a0 __asm("a0");
  393.     register struct KeyMap* a1 __asm("a1");
  394.  
  395.     a6 = BASE_NAME;
  396.     d0 = ansicode;
  397.     a0 = event;
  398.     a1 = km;
  399.     __asm volatile ("
  400.     jsr a6@(-0xae)"
  401.     : "=g" (res)
  402.     : "g" (a6), "g" (d0), "g" (a0), "g" (a1)
  403.     : "d0", "d1", "a0", "a1");
  404.     return res;
  405. }
  406. __inline static void AddIEvents(BASE_PAR_DECL struct InputEvent* events)
  407. {
  408.     BASE_EXT_DECL
  409.     register void *a6 __asm ("a6");
  410.     register struct InputEvent* a0 __asm("a0");
  411.  
  412.     a6 = BASE_NAME;
  413.     a0 = events;
  414.     __asm volatile ("
  415.     jsr a6@(-0xb4)"
  416.     : /* no output */
  417.     : "g" (a6), "g" (a0)
  418.     : "d0", "d1", "a0", "a1");
  419. }
  420. #ifdef PRIVATE
  421. #endif
  422. #undef BASE_EXT_DECL
  423. #undef BASE_PAR_DECL
  424. #undef BASE_PAR_DECL0
  425. #undef BASE_NAME
  426.