home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_PAS / XLIB_TP5.ZIP / DEMO / TEST.PAS < prev    next >
Pascal/Delphi Source File  |  1994-01-17  |  2KB  |  88 lines

  1. (*
  2.  
  3. Mark:
  4. Here's a Pascal version of the test procedure InitGraphics
  5. I used for "mode X" in 640x400x256 mode. If people could try these
  6. procedures out and e-mail me of the results I'll post the summery. Don't
  7. forget to tell me what video card you are using.
  8.  
  9.  
  10. Cheers, Mark
  11.  
  12. email : u914097@student.canberra.edu.au
  13.  
  14. *)
  15.  
  16.  
  17. uses crt,x_const,x_bitmap,x_pal,x_main,x_mouse,x_Keys,x_text;
  18.  
  19. procedure InitGraphics;
  20. begin
  21.   asm
  22.     { Set graphics mode }
  23.     mov ax, $5E
  24.     int $10
  25.   end;
  26.  
  27.   { Bit 4 of graphics mode register off }
  28.   Port[$3CE] := 5;
  29.   Port[$3CF] := Port[$3CF] and 239;
  30.  
  31.   { Bit 1 of misc register off }
  32.   Port[$3CE] := 6;
  33.   Port[$3CF] := Port[$3CF] and 253;
  34.  
  35.   { Bit 3 of memory mode register off }
  36.   Port[$3C4] := 4;
  37.   Port[$3C5] := Port[$3C5] and 247;
  38.  
  39.   { Bit 6 of underline reg register off }
  40.   Port[$3D4] := $14;
  41.   Port[$3D5] := Port[$3D5] and 191;
  42.  
  43.   { Bit 6 of mode control register on }
  44.   Port[$3D4] := $17;
  45.   Port[$3D5] := Port[$3D5] or 64;
  46.  
  47.   ScrnLogicalByteWidth:=160;
  48.   GetMaxX:=640;
  49.   GetMaxY:=400;
  50.   ScrnLogicalPixelWidth:=640;
  51.   ScrnLogicalHeight:=409
  52.  
  53. end;
  54.  
  55. var i:Word;
  56.     ok:Boolean;
  57.     error:Integer;
  58. begin;
  59.   x_set_mode(0,300);  (* to reset all variable *)
  60.   InitGraphics;
  61.  
  62.   x_set_rgb_pal;
  63.   X_ClearAll;
  64.  
  65.  
  66.   x_load_put_pbm(400,1,'odie.pbm');
  67.  
  68.   x_circle(100,100,50,20);
  69.  
  70.   for i:=1 to 100 do PutPixel(i*2,i*2,i);
  71.  
  72.   MyMouseInit;
  73.   DefineMouseCursor(MyMouseForm,Gray5);
  74.   SetMouseWindow(0,0,GetMaxX+4,getMaxY+4);
  75.   OldMouseTyp   := true;
  76.  
  77.   x_text_init;
  78.   x_set_font(0);
  79.   E_Write(1,GetMaxY-30,Gray5,Gray3,'Press Return to Exit.');
  80.  
  81.   Wait_Key(#13);
  82.  
  83.   HideMouse;
  84.   MyMouseDestroy;
  85.  
  86.   x_text_mode;
  87. end.
  88.