home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / music / 204 / pascal / lineatst.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1987-12-17  |  3.5 KB  |  164 lines

  1. Program test;
  2. {$I AUXSUBS.PAS }      { I need some calls from here! }
  3. { This is the needed information for using LINEA.O }
  4. { Much is left to your imgaination and research!   }
  5.  
  6. Const    LA_VPLANES    =    0    ;
  7.     LA_VWRAP    =    2    ;
  8.     LA_CONTRL    =    4    ;
  9.     LA_INTIN    =    8    ;
  10.     LA_PTSIN    =    12    ;
  11.     LA_INTOUT    =    16    ;
  12.     LA_PTSOUT    =    20    ;
  13.     LA_COLBIT0    =    24    ;
  14.     LA_COLBIT1    =    26    ;
  15.     LA_COLBIT2    =    28    ;
  16.     LA_COLBIT3    =    30    ;
  17.     LA_LSTLIN    =    32    ;
  18.     LA_LNMASK    =    34    ;
  19.     LA_WMODE    =    36     ;
  20.     LA_X1        =    38    ;
  21.     LA_Y1        =    40    ;
  22.     LA_X2        =    42    ;
  23.     LA_Y2        =    44    ;
  24.     LA_PATPTR    =    46    ;
  25.     LA_PATMSK    =    50    ;
  26.     LA_MFILL    =    52    ;
  27.     LA_CLIP        =    54    ;
  28.     LA_XMINCL    =    56    ;
  29.     LA_YMINCL    =    58    ;
  30.     LA_YMAXCL    =    60    ;
  31.     LA_XMAXCL    =    62    ;
  32.     LA_XDDA        =    64    ;
  33.     LA_DDAINC    =    66    ;
  34.     LA_SCALDIR    =    68    ;
  35.     LA_MONO        =    70    ;
  36.     LA_SOURCEX    =    72    ;
  37.     LA_SOURCEY    =    74    ;
  38.     LA_DESTX    =    76    ;
  39.     LA_DESTY    =    78    ;
  40.     LA_DELX        =    80    ;
  41.     LA_DELY        =    82    ;
  42.     LA_FBASE    =    84    ;
  43.     LA_FWIDTH    =    88    ;
  44.     LA_STYLE    =    90    ;
  45.     LA_LITEMASK    =    92    ;
  46.     LA_SKEWMASK    =    94    ;
  47.     LA_WEIGHT    =    96    ;
  48.     LA_ROFF        =    98    ;
  49.     LA_LOFF        =    100    ;
  50.     LA_SCALE    =    102    ;
  51.     LA_CHUP        =    104    ;
  52.     LA_TEXTFG    =    106    ;
  53.     LA_SCRTCHP    =    108    ;
  54.     LA_SCRPT2    =    112    ;
  55.     LA_TEXTBG    =    114    ;
  56.     LA_COPYTRAN    =    116    ;
  57.     LA_SEEDABORT    =    118    ;
  58.  
  59. { YUK.  GOT THAT OUT OF THE WAY! }
  60.  
  61. TYPE    AVERAGE_ARRAY    =    ARRAY[0..500] of integer;
  62.     AVER_ARRAY_PTR  =    ^AVERAGE_ARRAY;
  63.  
  64. VAR    LineA_Vars,
  65.     Contrl,
  66.     Intin,
  67.     Ptsin,
  68.     Intout,
  69.     Ptsout        :    Aver_Array_Ptr;
  70.  
  71. FUNCTION Addr( Var what : AVERAGE_ARRAY ) : Long_integer;
  72. External;
  73.  
  74. FUNCTION Ptr( where : long_integer ) : Aver_array_ptr ;
  75. External;
  76.  
  77. { Ok -  Here are my assembly routines }
  78.  
  79. {*  Returns address of LINEA variables  *}
  80. FUNCTION Linea_init : Long_integer;
  81. External;
  82.  
  83. {*  Set a pixel -  See docs  *}
  84. PROCEDURE Linea_putpixel;
  85. External;
  86.  
  87. {*  Returns pixel color - See docs  *}
  88. FUNCTION Linea_getpixel : Integer;
  89. External;
  90.  
  91. {*  Draw a line - See docs  *}
  92. PROCEDURE Linea_line ;
  93. External;
  94.  
  95. {*  Draw a Hline - See docs  *}
  96. Procedure Linea_Hline ;
  97. External;
  98.  
  99. {*  Filled Rectangle - See docs  *}
  100. Procedure Linea_rct;
  101. External;
  102.  
  103. {*  Filled Polygon - See docs  *}
  104. Procedure Linea_ply;
  105. External;
  106.  
  107. {*  Text Blit - real iffy!  *}
  108. Procedure Linea_txtblt;
  109. External;
  110.  
  111. {*  Show mouse  *}
  112. Procedure Linea_Showms;
  113. External;
  114.  
  115. {*  Hide cursor ( mouse I believe ) *}
  116. Procedure Linea_hdcurs;
  117. External;
  118.  
  119. {*  Transform mouse  *}
  120. Procedure Linea_tranms;
  121. External;
  122.  
  123. {*  Undraw_Sprite  -  See docs   *}
  124. Procedure Undraw_Sprite( Sprite_Save_Block : Aver_Array_Ptr );
  125. External;
  126.  
  127. {*  Draw_Sprite    -  See docs   *}
  128. Procedure Draw_Sprite( Sprite_Define_Block , Sprite_Save_Block :
  129.                                                  Aver_Array_Ptr );
  130. External;
  131.  
  132. {*  My special init routine to set up arrays properly  *}
  133. Procedure Init_Linea;
  134. Var Table : Long_Integer;
  135. Begin
  136.     Table := Linea_init;      { Now work has addr for linea variables }
  137.     linea_vars := ptr(Table); { link linea variables to an array! }
  138.         Contrl := ptr(lpeek(Table + LA_Contrl)); { Contrl array! }
  139.     Intin  := ptr(lpeek(Table + LA_Intin));  { Intin array! }
  140.     Ptsin  := ptr(lpeek(Table + LA_Ptsin));  { Ptsin array! }
  141.     Intout := ptr(lpeek(Table + LA_Intout)); { Intout array! }
  142.     Ptsout := ptr(lpeek(Table + LA_Ptsout)); { Ptsout array! }    
  143. End;
  144.  
  145. Procedure do_test;
  146. Var test : char;
  147. Var X1,Y1,X2,Y2,Work : Integer;
  148. Begin
  149.   for X1 := 1 to 100 do
  150.      for y1 := 1 to 100 do
  151.     Begin
  152.         intin^[0] := 1 ;
  153.         Ptsin^[0] := X1 ;
  154.         Ptsin^[1] := Y1 ;
  155.         Linea_Putpixel;
  156.     End;
  157.    readln( Test );
  158. End;
  159.            
  160. Begin
  161.    Init_Linea;
  162.    do_test;
  163. End.
  164.