utils: add parameter for sdcard image file for createimg command
examples: add more benchmark results, other small changes
This commit is contained in:
parent
b6bd487b7e
commit
651a451d53
3 changed files with 30 additions and 6 deletions
45
examples/pictviewer.pas
Normal file
45
examples/pictviewer.pas
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
program pictviewer;
|
||||
type PictData = record
|
||||
magic, mode:integer;
|
||||
palette: array [0..15] of integer;
|
||||
pixeldata: array [0..31999] of integer;
|
||||
end;
|
||||
|
||||
|
||||
var pic:PictData;
|
||||
filename:string;
|
||||
infile:file;
|
||||
ch:char;
|
||||
|
||||
procedure loadPalette(var pic:PictData);
|
||||
var i:integer;
|
||||
begin
|
||||
for i := 0 to 15 do
|
||||
setpalette(i, pic.palette[i]);
|
||||
end;
|
||||
|
||||
procedure loadPic(var pic:PictData);
|
||||
begin
|
||||
PutScreen(pic.pixeldata);
|
||||
end;
|
||||
|
||||
begin
|
||||
if ParamCount > 0 then
|
||||
filename := ParamStr(1)
|
||||
else
|
||||
begin
|
||||
write('Filename> ');
|
||||
readln(filename);
|
||||
end;
|
||||
|
||||
open(infile, filename, ModeReadonly);
|
||||
read(infile, pic);
|
||||
close(infile);
|
||||
|
||||
writeln('magic: ', pic.magic, ' mode:', pic.mode);
|
||||
|
||||
loadPalette(pic);
|
||||
loadPic(pic);
|
||||
write('Press any key...');
|
||||
read(ch);
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue