home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_PAS / XLIB_TP5.ZIP / DOC / XLIB.DOC < prev   
Text File  |  1994-01-23  |  39KB  |  1,284 lines

  1.  
  2.  
  3. OK, its not a documentation, because I dont read any documentation  ;-( .
  4. I have only copy all interface parts with comments in one big file.
  5.  
  6. Please look in the demo sources and change it to learn, how to handle.
  7. Then, you can read the comments for using and handling the functions.
  8.  
  9. Or, you can get the big documenation XLIBDOC.ZIP. Many Textformats like
  10. MS-Write, WOrd, Lotus and so on. The functionsnames are not all correct,
  11. because it is for the asm/C version of XLib.
  12.  
  13.  
  14. The File XLib_ALL.DOC is a overview about all units !
  15.  
  16.  
  17.  
  18. X_MAIN.PAS
  19.  
  20.  
  21. Init Mode X.
  22. Firstly, you can choose between many physikaly resolution (all in X_Const)
  23. by selecting with constant like X_MODE_360x240 or value 3.
  24. Then you have to say the viruall schreenwidth.
  25.  
  26.   function  x_set_mode(mode,logicalscrwidth:Word):Integer;
  27.  
  28. Return count of avaible modi.
  29.  
  30.   function  x_Max_Modi:Byte;
  31.  
  32.  
  33. Set X and Y to GetMaxX and GetMaxY in the mode Mode
  34.   procedure x_Mode_Info(Mode:Byte;var X,Y:Word);
  35.  
  36.  
  37. set TextMode back.
  38.  
  39.   procedure x_Text_Mode;
  40.  
  41.  
  42. Set upper, left Corner of activ page.
  43. You set the variable ScreenOfs, and all graphic function draw to this
  44. new screenparams.
  45.  
  46.   procedure x_set_activ_start_addr(x,y:Word);
  47.  
  48.  
  49. Set upper, left Corner of visible pager. So you can set the visible screen.
  50. So you can draw to a other screen than the visible !
  51.  
  52.   procedure x_set_visible_start_addr(x,y:Word);
  53.  
  54.  
  55. Set Splitscreen   if line>=GetMaxY then no_splitScreen.
  56. Switch a bar from the botton screen. Now, you can draw at absolut (0,0)
  57. to the splitscreen.
  58.  
  59.   procedure x_set_splitscreen(Line : Word);
  60.  
  61.  
  62. Set Clipping window for bitmaps. All Bitmapfunction with the prefix clip
  63. will be clipet on the border of this clip_rectangle.
  64.  
  65.   procedure x_set_clip_rect(left,top,right,bottom:Word);
  66.  
  67.  
  68. Clear the whole virtuell Screen (All pages).
  69.   procedure X_ClearAll;
  70.  
  71.  
  72. Clear  from Line 1 to Line 2
  73.  
  74.   procedure ClearScreen(Line1,Line2,Color:Word);
  75.  
  76.  
  77. Put a pixel in color on activ page.
  78.  
  79.   procedure PutPixel(x,y:Integer;Color:Byte);
  80.  
  81.  
  82. Get color from pixel at position (x,y).
  83.  
  84.   function  GetPixel(x,y: Integer): Integer;
  85.  
  86.  
  87. Draw a Line.
  88.  
  89.   procedure Line(x1,y1,x2,y2,Color:Word);
  90.  
  91. Draw a rectangle (build with normal lines - not filled )
  92.  
  93.   procedure rectangle(x1,y1,x2,y2,Color:Word);
  94.  
  95.  
  96. Draw a tritangle (build with normal lines - not filled )
  97.  
  98.   procedure triangle(x1,y1,x2,y2,x3,y3,Color:Word);
  99.  
  100.  
  101. Set the grafigcursor.
  102.  
  103.   procedure MoveTo(x,y:Integer);
  104.  
  105.  
  106. Draw a Line from Grafikcursor (Turtlegrafic)
  107.  
  108.   procedure LineTo(x,y,Color:Integer);
  109.  
  110.  
  111. Draw a circle. (it is a elipse, if pixel arn't square-pixel  Mode_320x480)
  112.  
  113.   procedure x_circle(x,y,r,Color:Word);
  114.  
  115.  
  116. Draw a filled circle.
  117.  
  118.   procedure x_filled_circle(x,y,r,Color:Word);
  119.  
  120.  
  121.  
  122.  
  123. UNIT X_BREAK.PAS
  124.  
  125. - Leitet Ctrl+Break auf eigene   procedure P um. P muß mit {$F+} als eine
  126.   far-  procedure deklariert worden sein.
  127. - Init the Ctrl+Break-interrupt to your   procedure. P have to far, this
  128.   means enclosed by {$F+} and {$F-}.
  129.  
  130.   procedure InitBreak(P:BreakProc);
  131.  
  132.  
  133. - Für InitBreak eine Default-  procedure, um ein Programm zu beenden.
  134.   default Break-  procedure to end your programm.
  135.  
  136.   procedure MyDummy;
  137.  
  138.  
  139. - Setzt den alten Ctrl+Break-Vektor wieder her. (Auch in INTR-Proc. drin)
  140.   Set the old Ctrl+Break.
  141.  
  142.   procedure RestoreBreak;
  143.  
  144.  
  145. UNIT X_KEYS.PAS
  146.  
  147. Some importend key-codes !
  148.  
  149. const NULL      = #0 ;
  150.       BackSpace = #8 ;
  151.       Back      = #8 ;
  152.       TAB       = #9 ;
  153.       Enter     = #13;
  154.       ESC       = #27;
  155.       Space     = #32;
  156. vor alle nächsten Codes kommt immer ein "NULL"-Zeichen ( #0 ) !
  157. The next key-Codes are first a chr(0), following the code !
  158.       F1        = ';';
  159.       F2        = '<';
  160.       F3        = '=';
  161.       F4        = '>';
  162.       F5        = '?';
  163.       F6        = '@';
  164.       F7        = 'A';
  165.       F8        = 'B';
  166.       F9        = 'C';
  167.       F10       = 'D';
  168.       links     = 'K';       left   = links;
  169.       rechts    = 'M';       right  = rechts;
  170.       runter    = 'P';       down   = runter;
  171.       hoch      = 'H';       up     = hoch;
  172.       Ende      = 'O';
  173.       Home      = 'G';
  174.       PgUp      = 'I';
  175.       PgDown    = 'Q';
  176.       Ins       = 'R';
  177.       Del       = 'S';
  178.  
  179.  
  180. - Liest Tasten ein und übergibt diese.
  181. - Get a key, if pressed or in Buffer.
  182.  
  183.   function ReadKeys:Char;
  184.  
  185.  
  186. - Gibt true zurück, wenn Readkeys einen Wert bereit hält.
  187. - true, if key pressed or key from Set_Key_Makro in Buffer (see keypressed)*)
  188.  
  189.   function keysPressed:Boolean;
  190.  
  191.  
  192. - Wartet so lange, bis die entsprechende Taste gedückt wurde .
  193. - Wait, until key a is pressed.
  194.  
  195.   procedure Wait_Key(A:Char);
  196.  
  197.  
  198. - Simuliert Tastenbetätigung (in der Reihenfolge des Strings)
  199. - Emutaled key-pressing
  200.  
  201.   procedure Set_Key_Makro(S:String);
  202.  
  203.  
  204. - Clear the Set_Key_Makro-Buffer .
  205.  
  206.   procedure Clear_Buffer;
  207.  
  208.  
  209.  
  210. UNIT X_DETECT.PAS
  211.  
  212. Some imported constantes.
  213.  
  214. const pz8086    = 0    ;           Processor
  215.       pz8088    = 1    ;
  216.       pzV20     = 2    ;
  217.       pzV30     = 3    ;
  218.       pz80186   = 4    ;
  219.       pz80188   = 5    ;
  220.       pz80286   = 6    ;
  221.       pz80386   = 7    ;
  222.       pz80486   = 8    ;
  223.  
  224.       cp_no     = 0    ;           Co-Processor
  225.       cp8087    = 1    ;
  226.       cp80287   = 2    ;
  227.       cp80387   = 3    ; He is in all 486DX !
  228.  
  229.       NONE      = 0    ;           Video-Card
  230.       MDA       = 1    ;
  231.       CGA       = 2    ;
  232.       EGAMono   = 3    ;
  233.       EGAColor  = 4    ;
  234.       VGAMono   = 5    ;
  235.       VGAColor  = 6    ;
  236.       MCGAMono  = 7    ;
  237.       MCGAColor = 8    ;
  238.  
  239.       BUS_MOUSE    = 1 ;           Mouse Driver
  240.       SERIAL_MOUSE = 2 ;
  241.       INPORT_MOUSE = 3 ;
  242.       PS2_MOUSE    = 4 ;
  243.       HP_MOUSE     = 5 ;
  244.  
  245.  
  246.  
  247. Return the typ of the wanted element (See in Demo3_TP) .
  248.  
  249.   function x_graphics_card : Word;
  250.   function x_mousedriver   : Boolean;
  251.   function x_processor     : Word;
  252.   function x_coprocessor   : Word;
  253.  
  254. Strings for constants of pzXXX,cpXXX and Video-Modes.
  255. const pzNames  : Array[0..8] of String[11] =
  256.     ('Intel 8086' ,'Intel 8088','NEC V20','NEC V30','Intel 80186','Intel 80188','Intel 80286','Intel 80386','Intel 80486');
  257.       Example : WriteLn('CPU :',pzNames[GetCPU]);
  258.       cpNames  : Array[0..3] of String[11] =
  259.     ('none','Intel 8087','Intel 80287','Intel 80387');
  260.       VideoNames : Array[0..8] of String[10] =
  261.     ('NONE','MDA','CGA','EGA Mono','EGA Color','VGA Mono','VGA Color','MCGA Mono','MCGA Color');
  262.  
  263.  
  264.  
  265.  
  266. UNIT X_POLYGO.PAS
  267.  
  268. type Point = record x,y:Word; end;
  269.  
  270.  
  271. Draw a filled triangle to the screen.
  272.  
  273.   procedure x_triangle(X0,Y0,X1,Y1,X2,Y2,Color:Word);
  274.  
  275. Draw a triangle to the screen - the color is declared in one vertical row.
  276. See demo in x_demo , part_D.
  277.  
  278.   procedure x_Coltriangle(X0,Y0,X1,Y1,X2,Y2:Word;var ColTable);
  279.  
  280. Draw a filled polygon to screen. Convex polygons are not supported.
  281.  
  282.   procedure x_poly(Var P:Array of Point;num,Color:Word);
  283.  
  284. The same like x_poly, but with colors like in x_Coltriangle.  
  285.   
  286.   procedure x_Colpoly(Var P:Array of Point;num:Word;var ColTable);
  287.  
  288.  
  289. UNIT X_CONST.PAS
  290.  
  291. All variables and constantes for XLib !
  292.  
  293. const AC_INDEX        = $03c0;  Attribute controller index register
  294.       MISC_OUTPUT     = $03c2;  Miscellaneous Output register
  295.       SC_INDEX        = $03c4;  Sqence Controller Index
  296.       GC_INDEX        = $03ce;   Graphics controller Index
  297.       CRTC_INDEX      = $03d4;  CRT Controller Index
  298.       DAC_READ_INDEX  = $03c7;
  299.       DAC_WRITE_INDEX = $03c8;
  300.       DAC_DATA        = $03c9;
  301.       INPUT_STATUS_0  = $03da;  Input status 0 register
  302.  
  303.  
  304.       SCREEN_SEG    =   $a000;  segment of display memory in mode X
  305.  
  306.       MAP_MASK      =   $02;    index in SC of Map Mask register
  307.       READ_MAP      =   $04;    index in GC of the Read Map register
  308.       BIT_MASK      =   $08;    index in GC of Bit Mask register
  309.  
  310.       OVERFLOW      =   $07;     CRTC overflow register index
  311.       MAX_SCAN_LINE =   $09;     CRTC maximum scan line register index
  312.       ADDR_HIGH     =   $0c;    Index of Start Address High reg in CRTC*)
  313.       ADDR_LOW      =   $0d;                           Low
  314.       CRTC_OFFSET   =   $13;     CRTC offset register index
  315.       UNDERLINE     =   $14;     CRTC underline location register index*)
  316.       MODE_CONTROL  =   $17;     CRTC mode control register index
  317.       LINE_COMPARE  =   $18;     CRTC line compare reg. index (bits 0-7
  318.                     of split screen scan line
  319.  
  320.       AC_MODE_CONTROL = $10;     Index of Mode COntrol register in AC
  321.       PEL_PANNING     = $13;     Pel panning register index in AC
  322.  
  323.       PATTERN_BUFFER  = $0fffc; offset in screen memory of pattern buffer
  324.  
  325.       OK              = 0;
  326.       ERROR           = 1;
  327.       GetMaxColor     = 255;
  328.  
  329.       X_MODE_320x200  = 0;
  330.       X_MODE_320x240  = 1;
  331.       X_MODE_360x200  = 2;
  332.       X_MODE_360x240  = 3;
  333.       X_MODE_376x282  = 4;
  334.       X_MODE_320x400  = 5;
  335.       X_MODE_320x480  = 6;
  336.       X_MODE_360x400  = 7;
  337.       X_MODE_360x480  = 8;
  338.       X_MODE_360x360  = 9;
  339.       X_MODE_376x308  = 10;
  340.       X_MODE_376x564  = 11;
  341.  
  342.  
  343.       X_BACKWARD      = 0;
  344.       X_FORWARD       = 1;
  345.  
  346.       X_MODE_INVALID  = -1;
  347.  
  348.  
  349. type  Palette = Array[0..255,0..2] of Byte;
  350.  
  351. Global variables - X_MAIN exports
  352.  
  353. var InGraphics             :Boolean;non zero if in X graphics mode
  354.     CurrXMode              :word;  contains current X graphics mode id
  355.     ScrnPhysicalByteWidth  :word;  Physical screen width in bytes
  356.     ScrnPhysicalPixelWidth :word;  Physical screen width in pixels
  357.     ScrnPhysicalHeight     :word;  Physical screen height in pixels
  358.     ErrorValue             :byte;  Error return value
  359.     GetMaxX                :Word absolute ScrnPhysicalPixelWidth;
  360.     GetMaxY                :Word absolute ScrnPhysicalHeight;
  361.  
  362.     SplitScrnOffs          :word;  Offset in VRAM  of split screen
  363.     SplitScrnScanLine      :word;  Scan line split screen starts at
  364.                    initially. Resizing the split scrn
  365.                    using the other   functions does not
  366.                    change this value
  367.     SplitScrnVisibleHeight :word;  Height of the visible portion of the*)
  368.                    split screen.
  369.     SplitScrnActive        :Boolean;
  370.     Page0_Offs             :word;  Offset in VRAM of main virt. screen
  371.     Page1_Offs             :word;  Offset in VRAM of 2nd virt. screen
  372.     Page2_Offs             :Word;
  373.     ScrnLogicalByteWidth   :word;  Virtual screen width in bytes
  374.     ScrnLogicalPixelWidth  :word;  Virtual screen width in pixels
  375.     ScrnLogicalHeight      :word;  Virtual screen height in pixels
  376.  
  377.     MaxScrollX             :word;  Max X position of physical screen
  378.                     within virtual screen
  379.     MaxScrollY             :word;  Max Y position of physical screen
  380.                     within virtual screen
  381.     DoubleBufferActive     :word;  Indicates whether double buffering
  382.                    is active
  383.     VisiblePageIdx         :word;  Index number of visible page 0 or 1
  384.     VisiblePageOffs        :word;  Offset of Hidden Pg | only valid
  385.     ScreenOfs              :word absolute VisiblePageOffs;
  386.     HiddenPageOffs         :word;  Offset of Visible Pg| for D.B. mode
  387.     NonVisual_Offs         :word;  Offset of first non-visible VRAM
  388.     BGSaveOffs             :Word;
  389.  
  390.     TopClip                :word;  Clipping rectangle
  391.     BottomClip             :word;
  392.     LeftClip               :word;
  393.     RightClip              :word;
  394.  
  395.     PhysicalStartPixelX    :word;  Coordinates of physical (visible)
  396.     PhysicalStartByteX     :word;  screen relative to the virtual
  397.     PhysicalStartY         :word;  screen's U.L. corner
  398.     Gray0,Gray1,Gray2,Gray3,Gray4,Gray5:Byte;
  399.  
  400.  
  401.  
  402.   procedure WaitVsyncStart;
  403.   procedure WaitVsyncEnd;
  404.  
  405.  
  406.  
  407. UNIT X_FILEIO.PAS
  408.  
  409.  
  410. Many function to manage filehandling very easy.
  411.  
  412. First, F_Size ,F_Open_Read, F_Open_Write and F_Close are the same like
  413. the functions in unit Dos, but they support the Masterfile.
  414.  
  415. If you have made ready your game, many little files are in your directory.
  416. With Make_MF you can copy into one big file, the MasterFile. After this,
  417. you add to begin of your programm Init_MasterFile(Name). Now, all F_...-
  418. function will look firstly in the filelist of MasterFile, if your wanted
  419. file is in the MasterFile. If true, your File-Variable will be set to
  420. MasterFile and Seek to begin of your file. Ok, you can't reading two file
  421. from MasterFile, but other operation will quicker !
  422.  
  423.  
  424. result = 0, if Name not exist, else Size in Bytes. MasterFile supported.
  425.   function  F_Size(Name:String):LongInt;
  426.  
  427.  
  428. Open an File for Read; True,if opens.              MasterFile supported.
  429.   function  F_Open_Read(var F:File;Name:String):Boolean;
  430.  
  431.  
  432. Open an File for Write.
  433.   procedure F_Open_Write(var F:File;Name:String);
  434.  
  435.  
  436. Close an File.                                     MasterFile supported.
  437.   procedure F_Close(var F:File);
  438.  
  439.  
  440. Make every Char of S an Uppercase  'HaaLLoo' -> 'HAALLOO'
  441.   function  Upper(S:String):String;
  442.  
  443.  
  444. Delete and Add, if incorrect or non Ext in FileName S.
  445. Only_one_Ext('Name.TXT','DOC') -> 'NAME.DOC'
  446. Only_one_Ext('test','DaT')     -> 'TEST.DAT'
  447.  
  448.   function  Only_one_Ext(S:String;Ext:String):String;
  449.  
  450.  
  451. Open MasterFile and load Filelist.
  452.  
  453.   function  Init_MasterFile(Name:String):Boolean;
  454.  
  455.  
  456. Close MasterFile, all   function are now normal file-  functions.
  457.  
  458.   procedure Close_MasterFile;
  459.  
  460.  
  461. If you dont know, how to read from F:File with BlockRead, use these
  462.   functions, because the MasterFile is type File.
  463.  
  464.   function  Read_Byte   (var F:File) :Byte;          Read a Byte
  465.   function  Read_Word   (var F:File) :Word;          Read a Word    (2 Bytes)
  466.   function  Read_LongInt(var F:File) :LongInt;       Read a LongInt (4 Bytes)
  467.   function  Read_Line   (var F:File) :String;        Read a String  (S[0]...)
  468.   function  Read_String (var F:File) :String;        Read a Line (Textfile)
  469.   procedure Write_Line  (Var F:File;S:String);
  470.  
  471.  
  472.  
  473. Only for creating own Masterfile - please look in demo Make_MF.
  474.  
  475.   procedure Init_File_List;
  476.   function  Add_File_List(Name:String):Boolean;
  477.   procedure Kill_File_List;
  478.   function  Get_File_item_count:Word;
  479.   procedure Make_MasterFile(Name:String);
  480.  
  481.  
  482.  
  483. UNIT X_BITMAP.PAS
  484.  
  485.  
  486.  
  487.     Bitmap procedures. (load,save,put,convert)
  488.  
  489.  
  490. - Planar Bitmap (pbm) functions - System Ram <-> Video Ram
  491.  
  492.   This module implements a set of functions to operate on planar bitmaps.
  493.   Planar bitmaps as used by these functions have the following structure:
  494.  
  495.   BYTE 0                 The bitmap width in bytes (4 pixel groups) range 1..255
  496.   BYTE 1                 The bitmap height in rows range 1..255
  497.   BYTE 2..n1             The plane 0 pixels width*height bytes
  498.   BYTE n1..n2            The plane 1 pixels width*height bytes
  499.   BYTE n2..n3            The plane 2 pixels width*height bytes
  500.   BYTE n3..n4            The plane 3 pixels width*height bytes
  501.  
  502.   or in Pascal :
  503.  
  504.   record pbm of
  505.     X_Byte,Y_Pixel              : Byte;
  506.     Plane0,Plane1,Plane2,Plane3 : Array[1..Y_Pixel,1..X_Byte] of Byte;
  507.   end;
  508.  
  509.   But these Stucture are not interessting, because all pbm's are used
  510.   from pure asm-Procedures.
  511.  
  512.   These functions provide the fastest possible bitmap blts from system ram
  513.   to video and further, the single bitmap is applicable to all pixel
  514.   allignments. The masked functions do not need separate masks since all
  515.   non zero pixels are considered to be masking pixels, hence if a pixel
  516.   is 0 the corresponding screen destination pixel is left unchanged.
  517.  
  518.  
  519. - Linear Bitmap (lbm) can only converted from/in pbm, but the are easy to
  520.   change with Turbo Pascal.
  521.  
  522.   record lbm of
  523.     X,Y   : Byte;
  524.     Pixel : Array[1..Y,1..X] of Byte;
  525.   end;
  526.  
  527.  
  528. - The VBM format implements yet another type of bitmap to complement
  529.   planar and compiled bitmaps, VRAM based bitmaps. If a 4 cylinder car is
  530.   analagous to planar bitmaps, that is thrifty on memory consumption but low
  531.   performance and and a V8 is analagous to Compiled bitmaps, memory guzzlers
  532.   that really fly, then VRAM based bitmaps are the 6 cylinder modest performers
  533.   with acceptable memory consumption.
  534.  
  535.   To summarise their selling points, VBM's are moderately fast with fair memory
  536.   consumption, and unlike compiled bitmaps, can be clipped. The disadvantages
  537.   are that they are limited by the amount of free video ram and have a complex
  538.   structure.
  539.  
  540.   The VRAM bitmap format is rather complex consisting of components stored in
  541.   video ram and components in system ram working together. This complexity
  542.   necessitates the existence of a creation function "x_lbm_to_vbm" which takes
  543.   an input linear bitmap and generates the equivalent VBM (VRAM Bit Map).
  544.  
  545.   VBM structure:
  546.  
  547.       WORD  0   Size          Total size of this VBM structure in bytes
  548.       WORD  1   ImageWidth    Width in bytes of the image (for all alignments)
  549.       WORD  2   ImageHeight   Height in scan lines of the image
  550.  
  551.       WORD  3 Alignment 0  ImagePtr   Offset in VidRAM of this aligned image
  552.    +--WORD  4              MaskPtr    Offset (within this structure's DS) of
  553.    |   .                               alignment masks
  554.    |   .
  555.    |   .
  556.    |  WORD  9 Alignment 3  ImagePtr   Offset in VidRAM of this aligned image
  557.   +|--WORD 10              MaskPtr    Offset (within this structure's DS) of
  558.   ||                                   alignment masks
  559.   ||
  560.   |+->BYTE 21 (WORD 11)                -------+-- Image masks for alignment 0
  561.   |   .                                       |
  562.   |   .                                       |
  563.   |   BYTE  21 + ImageWidth*ImageHeight  -----+
  564.   |
  565.   |   .
  566.   |   . (similaly for alignments 1 - 2 )
  567.   |   .
  568.   |
  569.   +-->BYTE  21 + 3*ImageWidth*ImageHeight + 1-+-- Image masks for alignment 3
  570.       .                                       |
  571.       .                                       |
  572.       BYTE  21 + 4*(ImageWidth*ImageHeight) --+
  573.  
  574.       .
  575.       .
  576.       << Similarly for alignments 2 and 3 >>
  577.       .
  578.       .
  579.       BYTE 21 + 4*(ImageWidth*ImageHeight)
  580.   -------------
  581.  
  582.   (And dont forget the corresponding data in video ram)
  583.  
  584. - Screenfiles (scr) are simple Screen-Dumps.
  585.  
  586.   Byte 0+Byte 1 :  Width in Bytes (width*4=Pixel)
  587.   Byte 2+Byte 3 :  Height in Pixel
  588.   Byte 4       :  Boolean, if True, then follow Byte 4..Byte 4+768 Palette
  589.   Byte n       :  Plane 0 - 3
  590.  
  591.   used by Gif2SCR and the procedure x_load_scr
  592.  
  593.  
  594. var Bitmap could be an Array of Byte  or a pointer (MUST allocated !)
  595. Some of the   procedure work with Heap-memory. No Size checking included !
  596.  
  597.  
  598.  
  599. ****************************** PBM **************************************
  600.  
  601. Put Planar Bitmap from System RAM to Pos.(X,Y).
  602.  
  603.   procedure x_put_pbm(X,Y:Word;var Bitmap);
  604.  
  605.  
  606. Put Planar Bitmap from System RAM to Pos.(X,Y) by skipping all 0-Pixel.
  607.  
  608.   procedure x_put_masked_pbm(X,Y:Word;var Bitmap);
  609.  
  610.  
  611. All put   procedures with clipping.
  612.  
  613.   procedure x_put_pbm_clipy(X,Y:Word;Var Bitmap);
  614.  
  615.   procedure x_put_pbm_clipx(X,Y:Word;Var Bitmap);
  616.  
  617.   procedure x_put_pbm_clipxy(X,Y:Word;Var Bitmap);
  618.  
  619.   procedure x_put_masked_pbm_clipy(X,Y:Word;Var Bitmap);
  620.  
  621.   procedure x_put_masked_pbm_clipx(X,Y:Word;Var Bitmap);
  622.  
  623.   procedure x_put_masked_pbm_clipxy(X,Y:Word;Var Bitmap);
  624.  
  625.  
  626. Copy Planar Bitmap from Pos.(X1,Y1,X2,Y2) to System Ram.
  627.  
  628.   procedure x_get_pbm(X1,Y1,X2,Y2:Word;var Bitmap);
  629.  
  630.  
  631. Return the Memory for the Bitmap to store in System Ram.
  632.  
  633.   function  x_pbm_size(x1,y1,x2,y2:Word):Word;
  634.  
  635.   function  x_sizeof_pbm(var BitMap):Word;
  636.  
  637.   procedure x_get_pbm_sizeXY(var x,y:Word;var Bitmap);
  638.  
  639.  
  640. Save Planar Bitmap to File with Name.   Name with .pbm automatical
  641.  
  642.   procedure x_save_pbm(var Name:String;var Bitmap);
  643.  
  644.  
  645. Load Planar Bitmap to File with Name.         MasterFile supported
  646.  
  647.   procedure x_load_pbm(var Name:String;var Bitmap);
  648.  
  649.  
  650. Load the Bitmap and put it to Pos.(x,y)
  651.  
  652.   procedure x_load_put_pbm(X,Y:Word;Name:String);
  653.  
  654.  
  655. Get Bitmap from Screen and save it to File Name.
  656.  
  657.   procedure x_get_save_pbm(X1,Y1,X2,Y2:Word;Name:String);
  658.  
  659.  
  660. Converted Linear Bitmap to Planar Bitmap. True,if succesful.
  661.  
  662.   function  x_lbm_to_pbm(var src_bm,dest_pbm):Boolean;
  663.  
  664.  
  665. Converted Planar Bitmap to Linear Bitmap. True,if succesful.
  666.  
  667.   function  x_pbm_to_lbm(var src_pbm,dest_bm):Boolean;
  668.  
  669.  
  670.  
  671. ****************************** LBM ***************************************)
  672. Because LBM would be very slow, it dont exist any Put-procedure.
  673.  
  674.  
  675.   procedure x_save_lbm(var Name:String;var Bitmap);
  676.  
  677.   procedure x_load_lbm(var Name:String;var Bitmap);
  678.  
  679.   function  x_lbm_size(x1,y1,x2,y2:Word):Word;
  680.  
  681.   function  x_sizeof_lbm(var BitMap):Word;
  682.  
  683.  
  684.  
  685. ****************************** CBM **************************************
  686.  
  687. Converted Planar Bitmap into Compiled Bitmap
  688.  
  689.   procedure x_pbm_to_cbm(logical_width:Word;Var pbm,cbm);
  690.  
  691.  
  692. Return the used size of the cbm from the source pbm.
  693.  
  694.   function  x_sizeof_cpbm (logical_width:Word;Var pbm):Word;
  695.  
  696.  
  697. Put Compiled Bitmap from System RAM to Pos (X,Y)  only as masked version
  698.  
  699.   procedure x_put_cbm(XPos,YPos:Word;Var Sprite);
  700.  
  701. ******************************* IBM ***************************************
  702.  
  703. Converted Planar Bitmap into Interpreted Bitmap                         
  704.  
  705.   procedure x_pbm_to_ibm(Var pbm,ibm);
  706.  
  707. Return the used size of the ibm from the source pbm.                    
  708.  
  709.   function  x_sizeof_ipbm (Var pbm):Word;
  710.  
  711. Put Interpreted Bitmap from System RAM to Pos (X,Y) .                      
  712.  
  713.   procedure x_put_ibm(X,Y:Word;Var ibm);
  714.  
  715. Put Interpreted Bitmap from System RAM to Pos (X,Y) .                      
  716.  
  717.   procedure x_put_masked_ibm(X,Y:Word;Var ibm);
  718.  
  719.  
  720. ****************************** VBM **************************************
  721.  
  722. Converted Linear Bitmap into Video Bitmap
  723.  
  724.   function  x_lbm_to_vbm(Var lbm;Var VramStart:Word):Pointer;
  725.  
  726. Put a VBM-Bitmap to screen.
  727.  
  728.   procedure x_put_masked_vbm(X,Y:Word;var SrcVBM);
  729.  
  730.   procedure x_put_masked_vbm_clipx(X,Y:Word;Var SrcVBM);
  731.  
  732.   procedure x_put_masked_vbm_clipy(X,Y:Word;Var SrcVBM);
  733.  
  734.   procedure x_put_masked_vbm_clipxy(X,Y:Word;Var SrcVBM);
  735.  
  736.  
  737. unit X_MENU.PAS
  738.  
  739.     procedures to make a pull-down-menu for mouse and/or keys
  740.  
  741.  
  742. type  Menu_Typ = record ...
  743.  
  744.  
  745.  
  746. set values to your M:Menu_Typ
  747.       C1            is the upper,left Shadow
  748.       C2            Background of Menu
  749.       C3            is the lower,right Shadow
  750.       Selected_C    Color of scrollbar
  751.       Text_Hi       Text-Color
  752.       Text_Lo       Shadow of Text
  753.       MouseMask     look in const - part of X_Button
  754.  
  755.   procedure X_Init_Menu(var M:Menu_Typ;                     Menu-Variable
  756.               C1,C2,C3,Selected_C,TextHi,TextLo:Byte;    Colors
  757.               MouseMask:Byte);                       s.X_Button
  758.  
  759.  
  760. After X_Init_Menu, you can add some textlines.
  761. For Color Text, see syntax in E_WriteColor in X_Text.
  762.  
  763.   procedure X_Add_Menu (var M:Menu_Typ;ID:ID_Typ;S:String;KeyChar:Char);
  764.  
  765.  
  766. Deallocate all line of M:Mynu_Typ.
  767.  
  768.   procedure X_Kill_Menu(var M:Menu_Typ);
  769.  
  770.  
  771. Draw Menu on Screen.
  772.  
  773.   procedure X_Show_Menu(var M:Menu_Typ;x,y:Word);
  774.  
  775.  
  776. return ID, if in this moment one line selected by mouse or key, other 0.
  777.  
  778.   function  Get_Selected_MenuLine(var M:Menu_Typ):ID_Typ;
  779.  
  780.  
  781. wait for selecting any line and return ID, or 0 if breaked by ESC.
  782.  
  783.   function  Wait_Selected_MenuLine(var M:Menu_Typ):ID_Typ;
  784.  
  785.  
  786.  
  787. UNIT X_RECT.PAS
  788.  
  789.  
  790.  
  791. rectangle solid colour fill routine.
  792.  
  793.   procedure x_rect_fill(X1,Y1,X2,Y2,Color:Word);
  794.  
  795.   procedure x_rect_fill_clipped(X1,Y1,X2,Y2,Color:Word);
  796.  
  797. BOX is the same like x_rect_fill, but it's shorter to write ;-).
  798.  
  799.   procedure Box(x1,y1,x2,y2,Color:Word);
  800.  
  801.  
  802. Make a ShadowBox - used by X_Button.
  803. C1 is upper,left Angle,  C3 is lower,right Angle and C3 the Box.
  804.  
  805.   procedure Shadow_Box(x1,y1,x2,y2,C1,C2,C3:Word);
  806.  
  807.  
  808. rectangle 4x4 pattern fill routine.
  809.  
  810.   procedure x_rect_pattern(X1,Y1,X2,Y2:Word;Var Pattern);
  811.  
  812.   procedure x_rect_pattern_clipped(X1,Y1,X2,Y2:Word;Var Pattern);
  813.  
  814.  
  815.  
  816. Display memory to display memory copy routine. Left edge of source
  817. rectangle modulo 4 must equal left edge of destination rectangle modulo 4
  818. Works on all VGAs.  Ignoring activ_screen->absolute Pos.
  819.  
  820.   procedure x_cp_vid_rect(SrcX1,SrcY1,SrcX2,ScrY2,DestX1,DestY1:Word);
  821.  
  822.  
  823. Copy a rectangular region of a VGA screen, with x coordinates
  824. rounded to the nearest byte -- source and destination may overlap.
  825.  
  826.   procedure x_shift_rect(ScrX1,ScrY1,ScrX2,ScrY2,DestX1,DestY1:Word);
  827.  
  828.  
  829.  
  830. UNIT X_PAL.PAS
  831.  
  832. ----------------------------------------------------------------------
  833. Read DAC palette into annotated type buffer with interrupts disabled
  834. ie BYTE colours to skip, BYTE colours to set, r1,g1,b1,r1,g2,b2...rn,gn,bn
  835.  
  836. WARNING: memory for the palette buffers must all be pre-allocated
  837.  
  838. Written by Themie Gouthas
  839. ----------------------------------------------------------------------
  840.  
  841.   procedure x_get_pal_struc(Var PalBuff;NumColors,StartColor:Word);
  842.  
  843.  
  844. ----------------------------------------------------------------------
  845. Read DAC palette into raw buffer with interrupts disabled
  846. ie BYTE r1,g1,b1,r1,g2,b2...rn,gn,bn
  847.  
  848. WARNING: memory for the palette buffers must all be pre-allocated
  849.  
  850. Written by Themie Gouthas
  851. ----------------------------------------------------------------------
  852.  
  853.   procedure x_get_pal_raw(Var PalBuff;NumColors,StartColor:Word);
  854.  
  855.  
  856. ----------------------------------------------------------------------
  857. Write DAC palette from annotated type buffer with interrupts disabled
  858. ie BYTE colours to skip, BYTE colours to set, r1,g1,b1,r1,g2,b2...rn,gn,bn
  859. If DoWait true, VSyncWait will start.
  860.  
  861. Written by Themie Gouthas
  862. ----------------------------------------------------------------------
  863.  
  864.   procedure x_put_pal_struc(Var CompPalBuff;DoWait:Boolean);
  865.  
  866.  
  867. ----------------------------------------------------------------------
  868. Write DAC palette from annotated type buffer with interrupts disabled
  869. starting at a new palette index
  870.  
  871. ie BYTE colours to skip, BYTE colours to set, r1,g1,b1,r1,g2,b2...rn,gn,bn
  872. If DoWait true, VSyncWait will start.
  873.  
  874. WARNING: memory for the palette buffers must all be pre-allocated
  875.  
  876. Written by Themie Gouthas
  877. ----------------------------------------------------------------------
  878.  
  879.   procedure x_transpose_pal_struc(Var CompPalBuff;StartColor:Word;DoWait:Boolean);
  880.  
  881.  
  882. ----------------------------------------------------------------------
  883. Write DAC palette from raw buffer with interrupts disabled
  884. ie BYTE r1,g1,b1,r1,g2,b2...rn,gn,bn
  885. If DoWait true, VSyncWait will start.
  886.  
  887. Written by Themie Gouthas
  888. ----------------------------------------------------------------------
  889.  
  890.   procedure x_put_pal_raw(Var PalBuff;NumColors,StartColor:Word;DoWait:Boolean);
  891.  
  892.  
  893. ----------------------------------------------------------------------
  894. Set the RGB setting of a vga color
  895.  
  896.  
  897. Written by Themie Gouthas
  898. ----------------------------------------------------------------------
  899.  
  900.   procedure x_set_rgb(ColorIndex,R,G,B:Byte);
  901.  
  902.  
  903. ----------------------------------------------------------------------
  904. Rotate annotated palette buffer entries
  905.  
  906. Direction : 0 = backward 1 = forward
  907.  
  908. Written by Themie Gouthas
  909. ----------------------------------------------------------------------
  910.  
  911.   procedure x_rot_pal_struc(Var PalBuff;Direction:Word);
  912.  
  913.  
  914. ----------------------------------------------------------------------
  915. Rotate raw palette buffer
  916.  
  917. Direcction : 0 = backward 1 = forward
  918.  
  919. Written by Themie Gouthas
  920. ----------------------------------------------------------------------
  921.  
  922.   procedure x_rot_pal_raw(Var PalBuff;Direction,NumColors:Word);
  923.  
  924.  
  925. ----------------------------------------------------------------------
  926. Copy palette making intensity adjustment
  927. x_cpcontrast_pal_struc(char far *src_pal, char far *dest_pal, unsigned char Intensity)
  928.  
  929. WARNING: memory for the palette buffers must all be pre-allocated
  930.  
  931. Written by Themie Gouthas
  932. ----------------------------------------------------------------------
  933.  
  934.   procedure x_cpcontrast_pal_struc(Var PalSrcBuff,PalDestBuff;Intensity:Byte);
  935.  
  936.  
  937. ----------------------------------------------------------------------
  938. Write DAC palette from annotated type buffer with specified intensity
  939. ie BYTE colours to skip, BYTE colours to set, r1,g1,b1,r1,g2,b2...rn,gn,bn
  940.  
  941. x_put_contrast_pal_struc(char far * pal, unsigned char  intensity)
  942.  
  943. Designed for fading in or out a palette without using an intermediate
  944. working palette buffer ! (Slow but memory efficient ... OK for small
  945. pal strucs}
  946.  
  947. Written by Themie Gouthas
  948. ----------------------------------------------------------------------
  949.  
  950.   procedure x_put_contrast_pal_struc(Var CompPalBuff;Intensity:Byte);
  951.  
  952.  
  953.  
  954. This   procedure set a RGB (6-7-6 Level), which are used also from some
  955. professional Programms like Photo Styler or default pal of BEX  ;-)
  956.  
  957.   procedure x_Set_RGB_pal;
  958.  
  959.  
  960.  
  961. Simply set_pal to set all colors are (0,0,0) .
  962.   procedure x_set_Black_pal;
  963.  
  964.  
  965.  
  966. Soften Set_Pal in Black Screen.
  967.  
  968.   procedure x_Dark2Pal(var Colors);
  969.  
  970.  
  971. Soften Set_Pal from Black Screen.
  972.  
  973.   procedure x_Pal2Dark(var Colors);
  974.  
  975.  
  976.  
  977. UNIT X_MOUSE.PAS
  978.  
  979.     Basic Mouse Routines for Mode X
  980.  
  981.     documentation in german and english
  982.  
  983.  
  984.  Es werden die letzten 42 Bytes des Bildschirmspeicher zum schnellen
  985.  Zwischenschpeichern des Maushintergrunds genutzt !
  986.  The last 42 Bytes of Video-RAM are used to same the Mouse - Pointer
  987.  BackGround .
  988.  
  989. var  ButtonStatus,
  990.      MouseX,             Say any time the actual Mouse-position !
  991.      MouseY         : Word;
  992.      OldMouseTyp,        True, wenn Mausz. sonst nur zur Haelfe geht
  993.              if your MousePointer only go to the hald of
  994.              screen, set it to true.
  995.      MouseAction    :Boolean; Auf true gesetzt, wenn Maus bewegt wird
  996.               Rücksetzen ist dem Programmierer überlassen.
  997.               It will be true, if MousePointer moved. You
  998.               can it use it, by set to false and wait.
  999.  
  1000. const MyMouseForm : Array[1..14] of Byte =
  1001.     ($01,$03,$07,$0f,$1f,$3f,$7f,$ff,$ff,$1c,$3c,$7c,0,0);
  1002.  
  1003.  
  1004.  
  1005. - Setzt den Mauszeiger auf Unsichtbar
  1006. - Hide the mousepointer
  1007.  
  1008.   procedure HideMouse;
  1009.  
  1010.  
  1011. - Setzt den Mauszeiger auf sichtbar
  1012. - Show the mousepointer
  1013.  
  1014.   procedure ShowMouse;
  1015.  
  1016. - Beim Zeichnen auf activ_page muss der Mauszeiger insichtbar sein.
  1017. - While drawing on activ_page mousepointer have to be hiding.
  1018.  
  1019.  
  1020.  
  1021. - Installiert einen Maus-event für Mode X.
  1022. - Install mouseevent for mode X.
  1023.  
  1024.   procedure MyMouseInit;
  1025.  
  1026.  
  1027. - Deinstalliert den Maus-event.
  1028. - Deinstall the mousevent.
  1029.  
  1030.   procedure MyMouseDestroy;
  1031.  
  1032.  
  1033. - Setzt einen MausCursor - eine Bitmaske.
  1034. - set a mousecursor - bitmask.
  1035.  
  1036.   procedure DefineMouseCursor(var MouseDef : Array of Byte;Color : Byte);
  1037.  
  1038.  
  1039. - Setzt das Mausfenster, indem sich der Mauszeiger aufhalten kann.
  1040. - Set the mousewindow. Mousepointer can't leave this window.
  1041.  
  1042.   procedure SetMouseWindow(x1,y1,x2,y2:Word);
  1043.  
  1044.  
  1045. - Setzt den MausZeiger auf die Position (x,y).
  1046. - set the mousepointer to (x,y).
  1047.  
  1048.   procedure SetPosMouse(x,y:Integer);
  1049.  
  1050.  
  1051. - Ist true, wenn die Maus unsichtbar ist. Wenn nach ShowMouse true ->
  1052.   ist keine Maus installiert.
  1053. - Return true, if mOuse hide.
  1054.  
  1055.   function  IsMouseHidden:Boolean;
  1056.  
  1057.  
  1058. - Gibt true, wenn der Mauszeiger in diesem Rechteck ist.
  1059. - Return true, if mousepointer in this rectangle.
  1060.  
  1061.   function  InBox(x1,y1,x2,y2:Word):Boolean;
  1062.  
  1063.  
  1064. X_TEXT.PAS
  1065.  
  1066.  
  1067.   Text procedures.
  1068.  
  1069.   Ok, we have two serveral user fonts ! How to handle ?
  1070.  
  1071.   The old 8xn-fonts width could max. 8 Pixels draw in the width.
  1072.   If FontType = 1, it is a 16x16-bigfont !
  1073.  
  1074.   8xn- normal font structure :
  1075.  
  1076.     Byte 0 :  FirstChar
  1077.     Byte 1 :  FontType=0 =>  8xn Font
  1078.     Byte 3 :  CharHeight
  1079.     Byte 4 :  CHarWidth   if zero, font will be variable
  1080.  
  1081.     Blocks from FirstChar to n :
  1082.  
  1083.        Byte0..Byte CharHeight-1 : CharacterByte horizontaly
  1084.        Byte CharHeight          : CharWidth, if Byte 4=0
  1085.  
  1086.     UPDATE: Variable width fonts are now available (up to 8/16 pixels max)
  1087.       If the Width byte in the font header is 0 then it is assumed that
  1088.       the font is variable width. For variable width fonts each characters
  1089.       data is followed by one byte representing the characters pixel width.
  1090.  
  1091.   16xn-bigfont structure :
  1092.  
  1093.     Byte 0 :  FirstChar
  1094.     Byte 1 :  FontType=1 => 16x16 Font
  1095.     Byte 3 :  CharHeight
  1096.     Byte 4 :  CHarWidth   if zero, font will be variable
  1097.  
  1098.     Index_Array : [FirstChar..134] : Word
  1099.  
  1100.          Bit  0..11: (0..4095)  Offset to begin of Chardata
  1101.                     if offset 0, Character not defined
  1102.                     -> CharWidth:=0
  1103.  
  1104.          Bit 12..15: (0..15)    CharWidth
  1105.  
  1106.  
  1107.     Byte n..eof : all CharacterWord verticaly order by Index_Array
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  Init the Fontpointers for ROM8x8 and ROM8x14 (font 0 and 1).
  1117. procedure x_text_init;
  1118.  
  1119.  
  1120. ----------------------------------------------------------------------
  1121.  x_set_font - Mode X Set current font for text drawing
  1122.  
  1123.   x_set_font(FontID:Word)
  1124.  
  1125.  PARAMETERS  FontID    0 = VGA ROM 8x8
  1126.                1 = VGA ROM 8x14
  1127.                2 = User defined bitmapped font , FontType
  1128.  
  1129.  
  1130.  WARNING: A user font must be registered before setting FontID 2
  1131.  
  1132.  Written by Themie Gouthas
  1133. ----------------------------------------------------------------------
  1134. procedure x_set_font(FontId:Word);
  1135.  
  1136. ----------------------------------------------------------------------
  1137.  x_register_userfont - Mode X register user font
  1138.  
  1139.   x_register_userfont(Var user_font);
  1140.  
  1141.  
  1142.  NOTES  registering a user font deregisters the previous user font
  1143.     User fonts may be at most 8 or 16 pixels wide (use FEX).
  1144.  
  1145.  
  1146.  Written by Themie Gouthas
  1147. ----------------------------------------------------------------------
  1148. procedure x_register_userfont(Var FontToRegister);
  1149.  
  1150. ----------------------------------------------------------------------
  1151.  x_char_put - Mode X Draw a text character at the specified location
  1152.  
  1153.   x_char_put(ch:Char;x,y,Color:Word)
  1154.  
  1155.  PARAMETERS  ch        char to draw
  1156.          x,y       screen coords at which to draw ch
  1157.         Color     Color of the text
  1158.  
  1159.  NOTES:  Uses the current font settings. See x_Set_Font, x_text_init,
  1160.      x_Register_UserFont
  1161.      Not for userfont 16xn, see X-Char_Put16.
  1162.  
  1163.  
  1164.  Written by Themie Gouthas
  1165. ----------------------------------------------------------------------
  1166. function  x_char_put  (chr:Char;x,y,Color:Word):Byte;  for mode 0-2
  1167.  
  1168.  like x_char_put, but only for 16xn-Font.
  1169.    Selection will make by FontType in font structure by X_Write !!!
  1170. function  x_Char_Put16(chr:Char;x,y,Color:Word):Byte;
  1171.  
  1172.  Returns the Font_Height+1, to make Textlines .
  1173. function  x_font_Height:Byte;
  1174.  
  1175.  Returns the Charwidth, calculate it if var. width. (both user fonts)
  1176. function  x_get_char_width(Chr:Char):Byte;
  1177.  
  1178.  Write the String S to Pos. x,y in Color <color>.
  1179. procedure x_Write(x,y:Integer;Color:Byte;s:String);  simply Text !
  1180.  
  1181.  Write Text with a Shadow , high - color of Text
  1182.                 low  - color of Shadow-Text
  1183. procedure E_Write(x,y,high,low:Integer;s:String);
  1184.  
  1185.  Write a Integer using E_Write.
  1186. procedure E_WriteInt(x,y,high,low:Integer;I:LongInt);
  1187.  
  1188.  Write a Real using E_Write.
  1189. procedure E_WriteReal(x,y,high,low:Integer;R:Real;f1,f2:Byte);
  1190.  
  1191.  Write a Text with serverals Textcolors.
  1192.    New Colors are included in the String : ...«Colornumber»... .
  1193.    With the character « (ALT-174) begin the Value, and ends with » (ALT-175)
  1194.  example '«'+str(Gray5)+'»H«'+str(Gray3)+'»ello' will a highlight big 'H'
  1195. procedure E_WriteColor(x,y,high,low:Integer;s:String);
  1196.  
  1197. const All_Char      = 0;
  1198.       Only_Digit    = 1;       if E_Read_Mode:=Only_Digit, it gets onl digits !
  1199.       Only_FileName = 2;       it gets only characters for filenames !
  1200.  
  1201.  Look in E_ReadInt for exapmle.
  1202. var   E_Read_Mode   : Byte;    Mask for E_Read. , see const here
  1203.  
  1204.  Read the String s, (edit with Backspace) in the Box between x and MaxX,
  1205.    - s could have some default characters
  1206.    - abort with ESC, S:=''
  1207.    - first pressed BackSpace, default S will be cleared
  1208. procedure E_Read(x,y,MaxX,FontColor,BackColor:Integer;var s:String);
  1209.  
  1210.  Make a Input-Mask like : [ Filename : Oldname<  ]
  1211.    - High,low are colors for the name-string
  1212.    - RHigh,RBack are the colors for the Inputstring in E_Read
  1213. procedure E_Input(x,y,MaxX,High,low,RHigh,RBack:Word;S:String;var S2:String);
  1214.  
  1215.  Read a Integer/LongInt - see params in E_Read
  1216. procedure E_ReadInt(x,y,MaxX,FontColor,BackColor:Integer;var I:LongInt);
  1217.  
  1218.  Make a Input-Mask for a Integer/LongInt - see params in E_Input.
  1219. procedure E_InputInt(x,y,MaxX,High,low,RHigh,RBack:Word;S:String;var I:LongInt);
  1220.  
  1221.  Draw a Button , used by unit X_Button.
  1222. procedure No_Button_Write(x,y,Box_Bright,Box_dark,Box_back,
  1223.               high,low:Integer;s:String);
  1224.  
  1225.  The same like No_Button_Write, Colors are defined by Gray0..Gray5 in X_Const.
  1226. procedure No_Button_Write_Gray(x,y:Integer;S:String);
  1227.  
  1228.  Draw a Button like a pressed Button, used by Unit X_Button
  1229. procedure Press_Button_Write(x,y,Box_Bright,Box_dark,Box_back,
  1230.                  high,low:Integer;s:String);
  1231.  The same like Press_Button_Write, Colors are Gray0..Gray5 in X_Const.
  1232. procedure Press_Button_Write_Gray(x,y:Integer;s:String);
  1233.  
  1234.  
  1235.  Setzt links und rechts so viele Leerzeichen, damit Breite erreicht wird.
  1236.  Fills on left and right space until width is reached.
  1237. function  center(width:Word;S:String):String;
  1238.  
  1239.  
  1240. function  str(X:LongInt):String;  the same use like TP-str,only as function
  1241.  
  1242.  Length of the String in Pixelrows.
  1243. function x_length(S:String):Word;
  1244.  
  1245.  Length of the LongInt, converted in String, in Pixelrows.
  1246. function x_lengthInt(I:LongInt):Word;
  1247.  
  1248.  
  1249. X_PICS
  1250.  
  1251.    X_Pics  load SCR-Files      (converted with the utily Gif2SCR)
  1252.        load/save RLE-Files
  1253.  
  1254.    RLE-procedures    by Themie Gouthas
  1255.    SCR-procedure     by CHristian Harms
  1256.  
  1257.     ****** XLIB - Mode X graphics library                ****************
  1258.     ******                                               ****************
  1259.     ****** Written By Themie Gouthas ( C-Version )       ****************
  1260.     ****** Converted By Christian Harms in TP            ****************
  1261.  
  1262.  
  1263.    X_Pics is the a old part of X_Bitmaps, who was very big and the Bitmaps
  1264.    are more smaller then big backgrounds.
  1265.  
  1266.  
  1267.  
  1268.  
  1269. interface
  1270.  
  1271.  Load SCR_File on activ Page and set var.Pal if New_Pal in File ,        
  1272.  otherwise fill it with 0.   True,if successed.                          
  1273.  
  1274. function x_Load_Scr(Name:String;var P):Boolean;
  1275.  
  1276.   see comment in implementation part 
  1277.  
  1278. function x_buff_RLEncode(Var src,dest;count:Word):Word;
  1279. function x_buff_RLE_size(Var src;count:Word):Word;
  1280. function x_buff_RLDecode(Var src,dest):Word;
  1281. function x_file_RLEncode(Var FileVar:File;Var src;Count:Word):Word;
  1282. function x_file_RLDecode(Var FileVar:File;Var dest):Word;
  1283.  
  1284.