Turbo Pascal

Source Code

 

 

ico File Format - Used in Icon Maker Ver (1.0 - 1.7) (Text type file)

assign(file,name + '.ico');
reset(file);
readln(file,LengthOfPixels);

for i:=1 to LengthOfPixels do
begin
readln(file,colour[i]);
readln(file,XPosition[i]);
readln(file,YPosition[i]);

end;
close(x);

The above code will load a .ico picture file. To display it to the screen is quite simple.

 

.SFF Font File Format as used in Text Creator ver 1.0 ( Text Type file )

type { FILE FORMAT OF .SFF SHANE FONT FORMAT version 1.0 }
FileFormat = Record
Name : string[3]; { 'SFF' }
Version : byte; { 10 for version 1.0 }
ReservedBytes: array[1..6] of byte; { 6 Blank Bytes for future use }
FileLibrary : array[1..39,1..8] of byte; { DATA OF FONTS }
end; { FILEFORMAT TYPE }

There is only 39 characters in the current version. Mainly capital characters and numbers as well as comma etc. The order in which they are in the file is the same as in the program.eg. First character in program is first record in saved file.

 Turbo Pascal access to screen mode 13h(19) 320x200 256 colours

uses dos;
Procedure LoadScreenMode19;
begin
regs.ah := 0;
regs.al := 19;
intr($10,regs);
end;

Procedure PutPixel256(Xpos,Ypos : integer; colour : byte );
begin
mem[$A000:0000+(Ypos*320)+xpos] := colour;
end;

Procedure SetPalColour256(Colour,Redval,Greenval,Blueval : byte);
begin
regs.ah := 10;
regs.bx := Colour;
regs.ch := Greenval;
regs.cl := Blueval;
regs.dh := redval;
intr($10,regs);
end;

Procedure Loadscreen19 sets 320x200 256 colours screenmode

Procedure PutPixel256 displays a pixel of a certain colour to the screen at a certain position of the screen determined by Xpos and Ypos.

Procedure SetPal256 lets you change the appearance of a colour. 'Colour' variable is the colour you wish to choose, redval is the red value in the range of 0..64. Zero been the darkest, 64 been the brightest red. By mixing these values using red,green and blue you can define a colour to suit your needs.

** All of the above information is absolutely free to use**

Shane Foreman