home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / MBUG / MBUG099.ARC / HIRES4.DOC < prev    next >
Text File  |  1979-12-31  |  5KB  |  201 lines

  1.                                TURBO HIRES2
  2.  
  3.                               By Simon Carter
  4.  
  5. Thi≤ montΦ wσ presen⌠ procedure≤ t∩ dump¼ savσ anΣ loaΣ Hires▓ screens¼ áa≤ ì
  6. wel∞ a≤ ß fil∞ procedure« (oµ sorts!⌐ 
  7.  
  8. ╔ áfounΣ átha⌠ áwheε áusinτ Online'≤ Pasca∞ áscreendum≡ ároutine¼ áthσ áRO═ ì
  9. character≤ áprinteΣ áa≤ garbage«  Herσ i≤ ß procedurσ t∩ ádum≡ áthσ áHires▓ ì
  10. screeε usinτ BDO╙ call≤ t∩ ß paralle∞ printer.
  11.  
  12. Procedure ScreenDump;
  13.  
  14. const
  15.   ScreenRam = $F000;
  16.  
  17. var
  18.   Column, Row, Bank   : Byte;
  19.   Store, Location   : Integer;
  20.  
  21.  
  22. Procedure Lprint;
  23.  
  24. Begin
  25. InLine($2A/Store/        {       LD      HL,(STORE) }
  26.        $11/$0F/$F0/      {       LD      DE,0F00FH  }
  27.        $29/              {       ADD     HL,HL      }
  28.        $29/              {       ADD     HL,HL      }
  29.        $29/              {       ADD     HL,HL      }
  30.        $29/              {       ADD     HL,HL      }
  31.        $19/              {       ADD     HL,DE      }
  32.        $06/$10/          {       LD      B,16       }
  33.        $5E/              {READ   LD      E,(HL)     }
  34.        $C5/              {       PUSH    BC         }
  35.        $E5/              {       PUSH    HL         }
  36.        $F5/              {       PUSH    AF         }
  37.        $0E/$05/          {       LD      C,5        }
  38.        $CD/$05/$00/      {       CALL    0005       }
  39.        $F1/              {       POP     AF         }
  40.        $0E/$05/          {       LD      C,5        }
  41.        $CD/$05/$00/      {       CALL    0005       }
  42.        $E1/              {       POP     HL         }
  43.        $C1/              {       POP     BC         }
  44.        $2B/              {       DEC     HL         }
  45.        $10/$EC);         {       DJNZ    READ       }
  46. End;
  47.  
  48.  
  49.  
  50. Begin
  51. Write(LST,#27'A'#8);
  52. for Column := 0 to 63 do
  53.   begin
  54.   Write(LST,#27'K'#0#2);
  55.   for Row := 15 downto 0 do
  56.     begin
  57.      Location := ScreenRam + Column + Row * 64;
  58.      Store := Mem[Location];
  59.      Port[28] := 144;è     Bank := Mem[Location];
  60.      Port[28] := Bank + 128;
  61.      Lprint;
  62.      Port[28] := 128;
  63.     end;
  64.     WriteLn(LST);
  65.   end;
  66. Write(LST,#27'A'#9);
  67. End;
  68.  
  69.  
  70.  
  71. GRSave procedure
  72.   Thi≤ áprocedurσ save≤ thσ curren⌠ Hires▓ screeε t∩ disk¼ b∙ blocδ ámovinτ ì
  73. thσ á╕ ábank≤ oµ PCG≤ sequentiall∙ int∩ ß buffer¼ anΣ theε t∩ ß áfile« á T∩ ì
  74. cal∞ áit¼ givσ ß filenamσ a≤ ß parameter¼ bu⌠ notσ tha⌠ iµ thσ filσ áexist≤ ì
  75. i⌠ wil∞ bσ ERASED¼ iµ no⌠ i⌠ wil∞ bσ created.
  76.  
  77.  
  78. Procedure GRSave(FileName : FileSpec);
  79.  
  80. var
  81.   I : Byte;
  82.   Buffer : array [0..$7FF] of byte;
  83.   Outfile : file;
  84.  
  85. Begin
  86.   Assign(Outfile,FileName);
  87.   Rewrite(Outfile);
  88.  
  89.   for I := 128 to 135 do
  90.     begin
  91.     Port[28] := I;
  92.     Move(PCGRAM,Buffer,$800);
  93.     BlockWrite(Outfile,Buffer,16);
  94.     end;
  95.   Close(Outfile);
  96.   Port[28] := 128;
  97. End;
  98.  
  99.  
  100. GRLoad procedure
  101.   Thi≤ áprocedurσ load≤ iε thσ ╕ bank≤ oµ PC╟ datß int∩ ß buffe≥ áanΣ átheε ì
  102. int∩ áPC╟ áRAM« á N∩ check≤ arσ madσ t∩ seσ iµ thσ disδ filσ ápasseΣ áa≤ áß ì
  103. paramete≥ áexists« á(Bu⌠ ß routinσ t∩ checδ ß file'≤ existencσ i≤ áiε áyou≥ ì
  104. USER'╙ MANUALí Yo⌡ kno≈ ¡ tha⌠ booδ yo⌡ go⌠ wheε yo⌡ bough⌠ Pascal?)
  105.  
  106.  
  107. Procedure GRLoad(FileName : FileSpec);
  108.  
  109. var
  110.   I : Byte;
  111.   Buffer : array [0..$7FF] of byte;
  112.   Infile : file;
  113.  
  114. Begin
  115.   Assign(Infile,FileName);
  116.   Reset(Infile);
  117. è  for I := 128 to 135 do
  118.     begin
  119.     Port[28] := I;
  120.     BlockRead(Infile,Buffer,16);
  121.     Move(Buffer,PCGRAM,$800);
  122.     end;
  123.   Close(Infile);
  124.   Port[28] := 128;
  125. End;
  126.  
  127.  
  128.  
  129.  
  130. FILL procedure
  131.   Thi≤ ái≤ áß árecursivσ procedurσ tha⌠ wil∞ fil∞ SMAL╠ áobjects« á Iµ áyo⌡ ì
  132. attemp⌠ át∩ fil∞ LARG┼ object≤ yo⌡ wil∞ ge⌠ ß ruε-timσ erro≥ messagσ áF╞ á¡ ì
  133. Insufficien⌠ freσ memor∙ available«  A⌠ presen⌠ ╔ haven'⌠ seeε ß wa∙ arounΣ ì
  134. this¼ bu⌠ yo⌡ migh⌠ ¡ s∩ le⌠ thσ res⌠ oµ u≤ know!
  135.   
  136.  
  137. {$A-}
  138. Procedure Fill(X,Y : Integer);
  139. Begin
  140.     Dot(X,Y,SetDot);
  141.       if Point(X,Y + 1) = 0 then Fill(X, Y + 1);
  142.       if Point(X + 1,Y) = 0 then Fill(X + 1, Y);
  143.       if Point(X,Y - 1) = 0 then Fill(X, Y - 1);
  144.       if Point(X - 1,Y) = 0 then Fill(X - 1, Y);
  145. End;
  146. {$A+}
  147.  
  148.  
  149. And finally, a demo for the whole lot of them :
  150.  
  151.  
  152. Begin
  153.   Hires2;
  154.   PlotBox(0,0,511,255,SetDot);
  155.   Circle(255,128,200,160,SetDot);
  156.   Arc(383,128,40,64,90,270,SetDot);
  157.   Arc(128,128,40,64,270,90,SetDot);
  158.   Plot(383,192,128,192,SetDot);
  159.   Plot(128,64,383,64,SetDot);
  160.  
  161.   Circle(255,168,50,10,SetDot);
  162.   Arc(255,88,50,10,180,360,SetDot);
  163.   Plot(205,168,205,88,SetDot);
  164.   Plot(305,88,305,168,SetDot);
  165.  
  166.   Text(17,3,'This masks text onto the screen',SetDot);
  167.  
  168.   PlotBox(250,160,255,170,SetDot);
  169.   PlotBox(255,160,260,170,SetDot);
  170.   Dot(255,165,ResDot);
  171.   Fill(255,168);
  172.  
  173.   repeat until KeyPressed;
  174.  
  175.   GRSave('A:TEST.GRA');è  Delay(1000);
  176.   Hires2;
  177.   GRLoad('A:TEST.GRA');
  178.  
  179.   repeat until KeyPressed;
  180.  
  181.   ScreenDump; 
  182.   Normal;
  183. End.
  184.  
  185.  
  186. That'≤ áití á ╔ hopσ you'vσ founΣ somσ oµ thi≤ usefull«  Remember¼ áiµ áyo⌡ ì
  187. thinδ u≡ an∙ routines¼ senΣ theφ iε t∩ thσ Catcher.
  188.  
  189.  
  190.  
  191. No time to type them in?
  192. Send $5, a stamped, self - addressed envelope and 5.25" disk to    
  193.               Simon Carter,
  194.             14 Canterbury Rd,
  195.             Heathmont, 3135.
  196. anΣ ╔ wil∞ fil∞ you≥ disδ witΦ Hires▓ routine≤ anΣ anythinτ elsσ tha⌠ come≤ ì
  197. t∩ mind....
  198.  
  199.  
  200.  
  201.