home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / DSHJ2 / BINDINGS.C < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-10  |  3.4 KB  |  180 lines

  1. /*    Modified GDvq_extend() to use passed in buffer
  2.  *    dlf - 8/31/88
  3.  */
  4.  
  5. #include    "portab.h"
  6.  
  7. extern    WORD    contrl[];
  8. extern    WORD    intin[];
  9. extern    WORD    ptsin[];
  10. extern    WORD    intout[];
  11. extern    WORD    ptsout[];
  12.  
  13. extern    WORD    *pioff, *iioff, *pooff, *iooff;
  14.  
  15. extern    vdi();
  16.  
  17. #define i_ptsin(ptr) pioff = ptr
  18. #define i_intin(ptr) iioff = ptr
  19. #define i_intout(ptr) iooff = ptr
  20. #define i_ptsout(ptr) pooff = ptr
  21.  
  22. extern    i_ptr();
  23. extern    i_ptr2();
  24. extern    m_lptr2();
  25.  
  26. WORD
  27. GDv_opnwk( work_in, handle, work_out,xres,yres,buffer)
  28. WORD work_in[], *handle, work_out[];
  29. WORD xres,yres;
  30. long *buffer;
  31. {
  32.    i_intin( work_in );
  33.    i_intout( work_out );
  34.    i_ptsout( work_out + 45 );
  35.  
  36.    contrl[0] = 1;
  37.    if(xres && yres)       /* if xres and yres not zero */
  38.    {
  39.            contrl[1] = 4;
  40.            ptsin[0] = xres;
  41.            ptsin[1] = yres;
  42.     stuffpt(buffer,&ptsin[2]);       /* Put buffer into ptsin[2][3] */
  43.    }
  44.    else
  45.     contrl[1] = 0;    /* Clear the flag           */
  46.  
  47.    contrl[3] = 11;        /* pass down xform mode also */
  48.    vdi();
  49.  
  50.    if((contrl[0] == 1) && (contrl[1] == 2 || contrl[1] == 0))
  51.     *buffer = 0L;
  52.    else
  53.     stuffpt(&contrl[0],buffer);
  54.  
  55.    *handle = contrl[6];    
  56.  
  57.    i_intin( intin );
  58.    i_intout( intout );
  59.    i_ptsout( ptsout );
  60.    i_ptsin( ptsin );    /* must set in 68k land so we can ROM it */
  61. }
  62.  
  63.  
  64. WORD
  65. v_pgcount(handle, count)
  66. WORD handle;
  67. WORD count;
  68. {
  69.    contrl[0] = 5;
  70.    contrl[1] = 0;
  71.    contrl[3] = 0;
  72.    contrl[5] = 2000;
  73.    contrl[6] = handle;
  74.    intin[0]  = count;
  75.    vdi();
  76. }
  77.  
  78.  
  79.     WORD
  80. GDv_updwk( handle,buffer,clrflag,status )
  81. WORD handle;
  82. long *buffer;
  83. WORD clrflag;
  84. WORD *status;
  85. {
  86.     contrl[0] = 4;
  87.  
  88.     contrl[1] = clrflag;
  89.     if(*buffer)
  90.     {
  91.     contrl[3] = 2;
  92.     stuffpt(buffer,&intin[0]);
  93.     }
  94.     else
  95.     contrl[3] = 0;
  96.     contrl[6] = handle;
  97.     vdi();
  98.     *status = intout[0];
  99. }
  100.  
  101.  
  102.     WORD
  103. GDvq_extnd( handle, owflag, work_out,xres,yres,buffer )
  104. WORD handle, owflag, work_out[];
  105. WORD xres,yres;
  106. long *buffer;
  107. {
  108.     i_intin( intin );    /* must set in 68k land so we can ROM it */
  109.     i_ptsin( ptsin );    /* since bss can't have initialized data */
  110.  
  111.     i_intout( work_out );
  112.     i_ptsout( work_out + 45 );
  113.     intin[0] = owflag;
  114.  
  115.     contrl[0] = 102;
  116.     contrl[3] = 0;
  117.  
  118.     if(xres && yres)
  119.     {
  120.     contrl[1] = 2;
  121.     ptsin[0] = xres;
  122.     ptsin[1] = yres;
  123.     if (*buffer) {
  124.        stuffpt( buffer, &intin[1] );
  125.        contrl[3] = 2;
  126.     }
  127.     }
  128.     else
  129.     contrl[1] = 0;
  130.     contrl[3]++;
  131.     contrl[6] = handle;
  132.     vdi();
  133.  
  134.     i_intout( intout );
  135.     i_ptsout( ptsout );
  136. }
  137.  
  138.  
  139.     WORD
  140. GDv_justified( handle, x, y, string, length, word_space, char_space)
  141. WORD handle, x, y, length, word_space, char_space;
  142. unsigned char string[];
  143. {
  144.     WORD *intstr;
  145.  
  146.     ptsin[0] = x;
  147.     ptsin[1] = y;
  148.     ptsin[2] = length;
  149.     ptsin[3] = 0;
  150.     intin[0] = word_space;
  151.     intin[1] = char_space;
  152.     intstr = &intin[2];
  153.     while (*intstr++ = *string++)
  154.         ;
  155.  
  156.     contrl[0] = 11;
  157.     contrl[1] = 2;
  158.     contrl[3] = (int) (intstr - intin) - 1;
  159.     contrl[5] = 10;
  160.     contrl[6] = handle;
  161.     vdi();
  162. }
  163.  
  164.  
  165.     WORD
  166. vmicron( handle,xmicron,ymicron)
  167. WORD handle;
  168. WORD xmicron;
  169. WORD ymicron;
  170. {
  171.    contrl[0] = 5;
  172.    contrl[1] = 0;
  173.    contrl[3] = 0;
  174.    contrl[5] = 3000;
  175.    contrl[6] = handle;
  176.    intin[0]  = xmicron;
  177.    intin[1]  = ymicron;
  178.    vdi();
  179. }
  180.