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

  1. #include <inline/stub.h>
  2. #ifndef BASE_EXT_DECL
  3. #define BASE_EXT_DECL extern struct Library * LayersBase;
  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 LayersBase
  11. #endif
  12. __inline static void InitLayers(BASE_PAR_DECL struct Layer_Info* li)
  13. {
  14.     BASE_EXT_DECL
  15.     register void *a6 __asm ("a6");
  16.     register struct Layer_Info* a0 __asm("a0");
  17.  
  18.     a6 = BASE_NAME;
  19.     a0 = li;
  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 Layer* CreateUpfrontLayer(BASE_PAR_DECL struct Layer_Info* li, struct BitMap* bm, long int x0, long int y0, long int x1, long int y1, long int flags, struct BitMap* bm2)
  27. {
  28.     BASE_EXT_DECL
  29.     register struct Layer* res __asm("d0");
  30.     register void *a6 __asm ("a6");
  31.     register struct Layer_Info* a0 __asm("a0");
  32.     register struct BitMap* a1 __asm("a1");
  33.     register long int d0 __asm("d0");
  34.     register long int d1 __asm("d1");
  35.     register long int d2 __asm("d2");
  36.     register long int d3 __asm("d3");
  37.     register long int d4 __asm("d4");
  38.     register struct BitMap* a2 __asm("a2");
  39.  
  40.     a6 = BASE_NAME;
  41.     a0 = li;
  42.     a1 = bm;
  43.     d0 = x0;
  44.     d1 = y0;
  45.     d2 = x1;
  46.     d3 = y1;
  47.     d4 = flags;
  48.     a2 = bm2;
  49.     __asm volatile ("" : /* no input */
  50.     : "g" (a0), "g" (a1));
  51.     __asm volatile ("
  52.     jsr a6@(-0x24)"
  53.     : "=g" (res)
  54.     : "g" (a6), "g" (a1), "g" (d0), "g" (d1), "g" (d2), "g" (d3), "g" (d4)
  55.     : "d0", "d1", "a0", "a1", "d2", "d3", "d4", "a2");
  56.     return res;
  57. }
  58. __inline static struct Layer* CreateBehindLayer(BASE_PAR_DECL struct Layer_Info* li, struct BitMap* bm, long int x0, long int y0, long int x1, long int y1, long int flags, struct BitMap* bm2)
  59. {
  60.     BASE_EXT_DECL
  61.     register struct Layer* res __asm("d0");
  62.     register void *a6 __asm ("a6");
  63.     register struct Layer_Info* a0 __asm("a0");
  64.     register struct BitMap* a1 __asm("a1");
  65.     register long int d0 __asm("d0");
  66.     register long int d1 __asm("d1");
  67.     register long int d2 __asm("d2");
  68.     register long int d3 __asm("d3");
  69.     register long int d4 __asm("d4");
  70.     register struct BitMap* a2 __asm("a2");
  71.  
  72.     a6 = BASE_NAME;
  73.     a0 = li;
  74.     a1 = bm;
  75.     d0 = x0;
  76.     d1 = y0;
  77.     d2 = x1;
  78.     d3 = y1;
  79.     d4 = flags;
  80.     a2 = bm2;
  81.     __asm volatile ("" : /* no input */
  82.     : "g" (a0), "g" (a1));
  83.     __asm volatile ("
  84.     jsr a6@(-0x2a)"
  85.     : "=g" (res)
  86.     : "g" (a6), "g" (a1), "g" (d0), "g" (d1), "g" (d2), "g" (d3), "g" (d4)
  87.     : "d0", "d1", "a0", "a1", "d2", "d3", "d4", "a2");
  88.     return res;
  89. }
  90. __inline static LONG UpfrontLayer(BASE_PAR_DECL long int dummy, struct Layer* layer)
  91. {
  92.     BASE_EXT_DECL
  93.     register LONG res __asm("d0");
  94.     register void *a6 __asm ("a6");
  95.     register long int a0 __asm("a0");
  96.     register struct Layer* a1 __asm("a1");
  97.  
  98.     a6 = BASE_NAME;
  99.     a0 = dummy;
  100.     a1 = layer;
  101.     __asm volatile ("
  102.     jsr a6@(-0x30)"
  103.     : "=g" (res)
  104.     : "g" (a6), "g" (a0), "g" (a1)
  105.     : "d0", "d1", "a0", "a1");
  106.     return res;
  107. }
  108. __inline static LONG BehindLayer(BASE_PAR_DECL long int dummy, struct Layer* layer)
  109. {
  110.     BASE_EXT_DECL
  111.     register LONG res __asm("d0");
  112.     register void *a6 __asm ("a6");
  113.     register long int a0 __asm("a0");
  114.     register struct Layer* a1 __asm("a1");
  115.  
  116.     a6 = BASE_NAME;
  117.     a0 = dummy;
  118.     a1 = layer;
  119.     __asm volatile ("
  120.     jsr a6@(-0x36)"
  121.     : "=g" (res)
  122.     : "g" (a6), "g" (a0), "g" (a1)
  123.     : "d0", "d1", "a0", "a1");
  124.     return res;
  125. }
  126. __inline static LONG MoveLayer(BASE_PAR_DECL long int dummy, struct Layer* layer, long int dx, long int dy)
  127. {
  128.     BASE_EXT_DECL
  129.     register LONG res __asm("d0");
  130.     register void *a6 __asm ("a6");
  131.     register long int a0 __asm("a0");
  132.     register struct Layer* a1 __asm("a1");
  133.     register long int d0 __asm("d0");
  134.     register long int d1 __asm("d1");
  135.  
  136.     a6 = BASE_NAME;
  137.     a0 = dummy;
  138.     a1 = layer;
  139.     d0 = dx;
  140.     d1 = dy;
  141.     __asm volatile ("
  142.     jsr a6@(-0x3c)"
  143.     : "=g" (res)
  144.     : "g" (a6), "g" (a0), "g" (a1), "g" (d0), "g" (d1)
  145.     : "d0", "d1", "a0", "a1");
  146.     return res;
  147. }
  148. __inline static LONG SizeLayer(BASE_PAR_DECL long int dummy, struct Layer* layer, long int dx, long int dy)
  149. {
  150.     BASE_EXT_DECL
  151.     register LONG res __asm("d0");
  152.     register void *a6 __asm ("a6");
  153.     register long int a0 __asm("a0");
  154.     register struct Layer* a1 __asm("a1");
  155.     register long int d0 __asm("d0");
  156.     register long int d1 __asm("d1");
  157.  
  158.     a6 = BASE_NAME;
  159.     a0 = dummy;
  160.     a1 = layer;
  161.     d0 = dx;
  162.     d1 = dy;
  163.     __asm volatile ("
  164.     jsr a6@(-0x42)"
  165.     : "=g" (res)
  166.     : "g" (a6), "g" (a0), "g" (a1), "g" (d0), "g" (d1)
  167.     : "d0", "d1", "a0", "a1");
  168.     return res;
  169. }
  170. __inline static void ScrollLayer(BASE_PAR_DECL long int dummy, struct Layer* layer, long int dx, long int dy)
  171. {
  172.     BASE_EXT_DECL
  173.     register void *a6 __asm ("a6");
  174.     register long int a0 __asm("a0");
  175.     register struct Layer* a1 __asm("a1");
  176.     register long int d0 __asm("d0");
  177.     register long int d1 __asm("d1");
  178.  
  179.     a6 = BASE_NAME;
  180.     a0 = dummy;
  181.     a1 = layer;
  182.     d0 = dx;
  183.     d1 = dy;
  184.     __asm volatile ("
  185.     jsr a6@(-0x48)"
  186.     : /* no output */
  187.     : "g" (a6), "g" (a0), "g" (a1), "g" (d0), "g" (d1)
  188.     : "d0", "d1", "a0", "a1");
  189. }
  190. __inline static LONG BeginUpdate(BASE_PAR_DECL struct Layer* l)
  191. {
  192.     BASE_EXT_DECL
  193.     register LONG res __asm("d0");
  194.     register void *a6 __asm ("a6");
  195.     register struct Layer* a0 __asm("a0");
  196.  
  197.     a6 = BASE_NAME;
  198.     a0 = l;
  199.     __asm volatile ("
  200.     jsr a6@(-0x4e)"
  201.     : "=g" (res)
  202.     : "g" (a6), "g" (a0)
  203.     : "d0", "d1", "a0", "a1");
  204.     return res;
  205. }
  206. __inline static void EndUpdate(BASE_PAR_DECL struct Layer* layer, long unsigned int flag)
  207. {
  208.     BASE_EXT_DECL
  209.     register void *a6 __asm ("a6");
  210.     register struct Layer* a0 __asm("a0");
  211.     register long unsigned int d0 __asm("d0");
  212.  
  213.     a6 = BASE_NAME;
  214.     a0 = layer;
  215.     d0 = flag;
  216.     __asm volatile ("
  217.     jsr a6@(-0x54)"
  218.     : /* no output */
  219.     : "g" (a6), "g" (a0), "g" (d0)
  220.     : "d0", "d1", "a0", "a1");
  221. }
  222. __inline static LONG DeleteLayer(BASE_PAR_DECL long int dummy, struct Layer* layer)
  223. {
  224.     BASE_EXT_DECL
  225.     register LONG res __asm("d0");
  226.     register void *a6 __asm ("a6");
  227.     register long int a0 __asm("a0");
  228.     register struct Layer* a1 __asm("a1");
  229.  
  230.     a6 = BASE_NAME;
  231.     a0 = dummy;
  232.     a1 = layer;
  233.     __asm volatile ("
  234.     jsr a6@(-0x5a)"
  235.     : "=g" (res)
  236.     : "g" (a6), "g" (a0), "g" (a1)
  237.     : "d0", "d1", "a0", "a1");
  238.     return res;
  239. }
  240. __inline static void LockLayer(BASE_PAR_DECL long int dummy, struct Layer* layer)
  241. {
  242.     BASE_EXT_DECL
  243.     register void *a6 __asm ("a6");
  244.     register long int a0 __asm("a0");
  245.     register struct Layer* a1 __asm("a1");
  246.  
  247.     a6 = BASE_NAME;
  248.     a0 = dummy;
  249.     a1 = layer;
  250.     __asm volatile ("
  251.     jsr a6@(-0x60)"
  252.     : /* no output */
  253.     : "g" (a6), "g" (a0), "g" (a1)
  254.     : "d0", "d1", "a0", "a1");
  255. }
  256. __inline static void UnlockLayer(BASE_PAR_DECL struct Layer* layer)
  257. {
  258.     BASE_EXT_DECL
  259.     register void *a6 __asm ("a6");
  260.     register struct Layer* a0 __asm("a0");
  261.  
  262.     a6 = BASE_NAME;
  263.     a0 = layer;
  264.     __asm volatile ("
  265.     jsr a6@(-0x66)"
  266.     : /* no output */
  267.     : "g" (a6), "g" (a0)
  268.     : "d0", "d1", "a0", "a1");
  269. }
  270. __inline static void LockLayers(BASE_PAR_DECL struct Layer_Info* li)
  271. {
  272.     BASE_EXT_DECL
  273.     register void *a6 __asm ("a6");
  274.     register struct Layer_Info* a0 __asm("a0");
  275.  
  276.     a6 = BASE_NAME;
  277.     a0 = li;
  278.     __asm volatile ("
  279.     jsr a6@(-0x6c)"
  280.     : /* no output */
  281.     : "g" (a6), "g" (a0)
  282.     : "d0", "d1", "a0", "a1");
  283. }
  284. __inline static void UnlockLayers(BASE_PAR_DECL struct Layer_Info* li)
  285. {
  286.     BASE_EXT_DECL
  287.     register void *a6 __asm ("a6");
  288.     register struct Layer_Info* a0 __asm("a0");
  289.  
  290.     a6 = BASE_NAME;
  291.     a0 = li;
  292.     __asm volatile ("
  293.     jsr a6@(-0x72)"
  294.     : /* no output */
  295.     : "g" (a6), "g" (a0)
  296.     : "d0", "d1", "a0", "a1");
  297. }
  298. __inline static void LockLayerInfo(BASE_PAR_DECL struct Layer_Info* li)
  299. {
  300.     BASE_EXT_DECL
  301.     register void *a6 __asm ("a6");
  302.     register struct Layer_Info* a0 __asm("a0");
  303.  
  304.     a6 = BASE_NAME;
  305.     a0 = li;
  306.     __asm volatile ("
  307.     jsr a6@(-0x78)"
  308.     : /* no output */
  309.     : "g" (a6), "g" (a0)
  310.     : "d0", "d1", "a0", "a1");
  311. }
  312. __inline static void SwapBitsRastPortClipRect(BASE_PAR_DECL struct RastPort* rp, struct ClipRect* cr)
  313. {
  314.     BASE_EXT_DECL
  315.     register void *a6 __asm ("a6");
  316.     register struct RastPort* a0 __asm("a0");
  317.     register struct ClipRect* a1 __asm("a1");
  318.  
  319.     a6 = BASE_NAME;
  320.     a0 = rp;
  321.     a1 = cr;
  322.     __asm volatile ("
  323.     jsr a6@(-0x7e)"
  324.     : /* no output */
  325.     : "g" (a6), "g" (a0), "g" (a1)
  326.     : "d0", "d1", "a0", "a1");
  327. }
  328. __inline static struct Layer* WhichLayer(BASE_PAR_DECL struct Layer_Info* li, long int x, long int y)
  329. {
  330.     BASE_EXT_DECL
  331.     register struct Layer* res __asm("d0");
  332.     register void *a6 __asm ("a6");
  333.     register struct Layer_Info* a0 __asm("a0");
  334.     register long int d0 __asm("d0");
  335.     register long int d1 __asm("d1");
  336.  
  337.     a6 = BASE_NAME;
  338.     a0 = li;
  339.     d0 = x;
  340.     d1 = y;
  341.     __asm volatile ("
  342.     jsr a6@(-0x84)"
  343.     : "=g" (res)
  344.     : "g" (a6), "g" (a0), "g" (d0), "g" (d1)
  345.     : "d0", "d1", "a0", "a1");
  346.     return res;
  347. }
  348. __inline static void UnlockLayerInfo(BASE_PAR_DECL struct Layer_Info* li)
  349. {
  350.     BASE_EXT_DECL
  351.     register void *a6 __asm ("a6");
  352.     register struct Layer_Info* a0 __asm("a0");
  353.  
  354.     a6 = BASE_NAME;
  355.     a0 = li;
  356.     __asm volatile ("
  357.     jsr a6@(-0x8a)"
  358.     : /* no output */
  359.     : "g" (a6), "g" (a0)
  360.     : "d0", "d1", "a0", "a1");
  361. }
  362. __inline static struct Layer_Info* NewLayerInfo(BASE_PAR_DECL0)
  363. {
  364.     BASE_EXT_DECL
  365.     register struct Layer_Info* res __asm("d0");
  366.     register void *a6 __asm ("a6");
  367.     a6 = BASE_NAME;
  368.     __asm volatile ("
  369.     jsr a6@(-0x90)"
  370.     : "=g" (res)
  371.     : "g" (a6)
  372.     : "d0", "d1", "a0", "a1");
  373.     return res;
  374. }
  375. __inline static void DisposeLayerInfo(BASE_PAR_DECL struct Layer_Info* li)
  376. {
  377.     BASE_EXT_DECL
  378.     register void *a6 __asm ("a6");
  379.     register struct Layer_Info* a0 __asm("a0");
  380.  
  381.     a6 = BASE_NAME;
  382.     a0 = li;
  383.     __asm volatile ("
  384.     jsr a6@(-0x96)"
  385.     : /* no output */
  386.     : "g" (a6), "g" (a0)
  387.     : "d0", "d1", "a0", "a1");
  388. }
  389. __inline static LONG FattenLayerInfo(BASE_PAR_DECL struct Layer_Info* li)
  390. {
  391.     BASE_EXT_DECL
  392.     register LONG res __asm("d0");
  393.     register void *a6 __asm ("a6");
  394.     register struct Layer_Info* a0 __asm("a0");
  395.  
  396.     a6 = BASE_NAME;
  397.     a0 = li;
  398.     __asm volatile ("
  399.     jsr a6@(-0x9c)"
  400.     : "=g" (res)
  401.     : "g" (a6), "g" (a0)
  402.     : "d0", "d1", "a0", "a1");
  403.     return res;
  404. }
  405. __inline static void ThinLayerInfo(BASE_PAR_DECL struct Layer_Info* li)
  406. {
  407.     BASE_EXT_DECL
  408.     register void *a6 __asm ("a6");
  409.     register struct Layer_Info* a0 __asm("a0");
  410.  
  411.     a6 = BASE_NAME;
  412.     a0 = li;
  413.     __asm volatile ("
  414.     jsr a6@(-0xa2)"
  415.     : /* no output */
  416.     : "g" (a6), "g" (a0)
  417.     : "d0", "d1", "a0", "a1");
  418. }
  419. __inline static LONG MoveLayerInFrontOf(BASE_PAR_DECL struct Layer* layer_to_move, struct Layer* other_layer)
  420. {
  421.     BASE_EXT_DECL
  422.     register LONG res __asm("d0");
  423.     register void *a6 __asm ("a6");
  424.     register struct Layer* a0 __asm("a0");
  425.     register struct Layer* a1 __asm("a1");
  426.  
  427.     a6 = BASE_NAME;
  428.     a0 = layer_to_move;
  429.     a1 = other_layer;
  430.     __asm volatile ("
  431.     jsr a6@(-0xa8)"
  432.     : "=g" (res)
  433.     : "g" (a6), "g" (a0), "g" (a1)
  434.     : "d0", "d1", "a0", "a1");
  435.     return res;
  436. }
  437. __inline static struct Region* InstallClipRegion(BASE_PAR_DECL struct Layer* layer, struct Region* region)
  438. {
  439.     BASE_EXT_DECL
  440.     register struct Region* res __asm("d0");
  441.     register void *a6 __asm ("a6");
  442.     register struct Layer* a0 __asm("a0");
  443.     register struct Region* a1 __asm("a1");
  444.  
  445.     a6 = BASE_NAME;
  446.     a0 = layer;
  447.     a1 = region;
  448.     __asm volatile ("
  449.     jsr a6@(-0xae)"
  450.     : "=g" (res)
  451.     : "g" (a6), "g" (a0), "g" (a1)
  452.     : "d0", "d1", "a0", "a1");
  453.     return res;
  454. }
  455. __inline static LONG MoveSizeLayer(BASE_PAR_DECL struct Layer* layer, long int dx, long int dy, long int dw, long int dh)
  456. {
  457.     BASE_EXT_DECL
  458.     register LONG res __asm("d0");
  459.     register void *a6 __asm ("a6");
  460.     register struct Layer* a0 __asm("a0");
  461.     register long int d0 __asm("d0");
  462.     register long int d1 __asm("d1");
  463.     register long int d2 __asm("d2");
  464.     register long int d3 __asm("d3");
  465.  
  466.     a6 = BASE_NAME;
  467.     a0 = layer;
  468.     d0 = dx;
  469.     d1 = dy;
  470.     d2 = dw;
  471.     d3 = dh;
  472.     __asm volatile ("
  473.     jsr a6@(-0xb4)"
  474.     : "=g" (res)
  475.     : "g" (a6), "g" (a0), "g" (d0), "g" (d1), "g" (d2), "g" (d3)
  476.     : "d0", "d1", "a0", "a1", "d2", "d3");
  477.     return res;
  478. }
  479. __inline static struct Layer* CreateUpfrontHookLayer(BASE_PAR_DECL struct Layer_Info* li, struct BitMap* bm, long int x0, long int y0, long int x1, long int y1, long int flags, struct Hook* hook, struct BitMap* bm2)
  480. {
  481.     BASE_EXT_DECL
  482.     register struct Layer* res __asm("d0");
  483.     register void *a6 __asm ("a6");
  484.     register struct Layer_Info* a0 __asm("a0");
  485.     register struct BitMap* a1 __asm("a1");
  486.     register long int d0 __asm("d0");
  487.     register long int d1 __asm("d1");
  488.     register long int d2 __asm("d2");
  489.     register long int d3 __asm("d3");
  490.     register long int d4 __asm("d4");
  491.     register struct Hook* a3 __asm("a3");
  492.     register struct BitMap* a2 __asm("a2");
  493.  
  494.     a6 = BASE_NAME;
  495.     a0 = li;
  496.     a1 = bm;
  497.     d0 = x0;
  498.     d1 = y0;
  499.     d2 = x1;
  500.     d3 = y1;
  501.     d4 = flags;
  502.     a3 = hook;
  503.     a2 = bm2;
  504.     __asm volatile ("" : /* no input */
  505.     : "g" (a0), "g" (a1), "g" (d0));
  506.     __asm volatile ("
  507.     jsr a6@(-0xba)"
  508.     : "=g" (res)
  509.     : "g" (a6), "g" (d0), "g" (d1), "g" (d2), "g" (d3), "g" (d4), "g" (a3)
  510.     : "d0", "d1", "a0", "a1", "d2", "d3", "d4", "a3", "a2");
  511.     return res;
  512. }
  513. __inline static struct Layer* CreateBehindHookLayer(BASE_PAR_DECL struct Layer_Info* li, struct BitMap* bm, long int x0, long int y0, long int x1, long int y1, long int flags, struct Hook* hook, struct BitMap* bm2)
  514. {
  515.     BASE_EXT_DECL
  516.     register struct Layer* res __asm("d0");
  517.     register void *a6 __asm ("a6");
  518.     register struct Layer_Info* a0 __asm("a0");
  519.     register struct BitMap* a1 __asm("a1");
  520.     register long int d0 __asm("d0");
  521.     register long int d1 __asm("d1");
  522.     register long int d2 __asm("d2");
  523.     register long int d3 __asm("d3");
  524.     register long int d4 __asm("d4");
  525.     register struct Hook* a3 __asm("a3");
  526.     register struct BitMap* a2 __asm("a2");
  527.  
  528.     a6 = BASE_NAME;
  529.     a0 = li;
  530.     a1 = bm;
  531.     d0 = x0;
  532.     d1 = y0;
  533.     d2 = x1;
  534.     d3 = y1;
  535.     d4 = flags;
  536.     a3 = hook;
  537.     a2 = bm2;
  538.     __asm volatile ("" : /* no input */
  539.     : "g" (a0), "g" (a1), "g" (d0));
  540.     __asm volatile ("
  541.     jsr a6@(-0xc0)"
  542.     : "=g" (res)
  543.     : "g" (a6), "g" (d0), "g" (d1), "g" (d2), "g" (d3), "g" (d4), "g" (a3)
  544.     : "d0", "d1", "a0", "a1", "d2", "d3", "d4", "a3", "a2");
  545.     return res;
  546. }
  547. __inline static struct Hook* InstallLayerHook(BASE_PAR_DECL struct Layer* layer, struct Hook* hook)
  548. {
  549.     BASE_EXT_DECL
  550.     register struct Hook* res __asm("d0");
  551.     register void *a6 __asm ("a6");
  552.     register struct Layer* a0 __asm("a0");
  553.     register struct Hook* a1 __asm("a1");
  554.  
  555.     a6 = BASE_NAME;
  556.     a0 = layer;
  557.     a1 = hook;
  558.     __asm volatile ("
  559.     jsr a6@(-0xc6)"
  560.     : "=g" (res)
  561.     : "g" (a6), "g" (a0), "g" (a1)
  562.     : "d0", "d1", "a0", "a1");
  563.     return res;
  564. }
  565. #undef BASE_EXT_DECL
  566. #undef BASE_PAR_DECL
  567. #undef BASE_PAR_DECL0
  568. #undef BASE_NAME
  569.