Friday, April 24, 2020

FILL.P

[Table of Contents]
FILL.ATR Disk Image

I believe that the Kyan Pascal FILL procedure that resides on the Kyan Pascal 2.x Utility Disk 1 should work similar to the Atari BASIC Fill Example on page 54 of the Atari BASIC Reference Manual, but I haven't gotten it to work just yet.

The FILL.ATR has a PEEKPOKE.I include file that can be used for PEEKing and POKEing address.

What's on the Disk?


The disk image includes the various Atari DOS 2.5 files, Kyan Pascal Include files, Kyan Pascal Run-time library, and ...

GRAPHICS.I - Include file
PLOT.I - Include file
DRAWTO.I - Include file
FILL.I - Include file
POSITION.I - Include file
PEEKPOKE.I - Include file
FILL.P - Source code file
P.OUT - Kyan Pascal intermediate file
FILL - Executable file
FILL.BAS - Atari BASIC Fill Example

Example Code


(* FILL.P *)
(* Kyan Pascal / Atari 8-bit *)

#A
_ORIGIN EQU $4000
#

Program Fill(Input,Output);

#i Graphics.i
#i Plot.i
#i Drawto.i
#i Fill.i
#i Position.i
#i Peekpoke.i

Procedure Use_Graphics;
Begin
#A
   LDA #<_origin
   STA $6A
#
End;

Procedure Use_Text;
Begin
#A
   LDA #$C0
   STA $6A
#
End; (* of the Use_Text procedure *)

Begin
   (* Initialize graphics *)
   Use_Graphics;

   (* GR 5 *)
   Graphics(5);

   (* Draw a shape *)
   Plot(70,35,3);
   Drawto(50,10,3);
   Drawto(30,10,3);
   
   Writeln('Press <RETURN> To Fill');
      Readln;

   (* Fill area *)
   Position(10,35);
   Poke(765,3);
   Fill(10,35,3);

   Writeln('Press <RETURN> To Exit');
      Readln;

   (* Back to text mode *)
   Use_Text;
   Graphics(0)
End.

No comments:

Post a Comment