+ added simple test for the video unit

git-svn-id: branches/unicodekvm@48483 -
This commit is contained in:
nickysn 2021-02-01 05:10:39 +00:00
parent b13c8e3ef6
commit 90113ef819
3 changed files with 97 additions and 0 deletions
.gitattributes
packages/rtl-console/tests

2
.gitattributes vendored
View File

@ -8869,6 +8869,8 @@ packages/rtl-console/tests/kbddump.pp svneol=native#text/plain
packages/rtl-console/tests/kbdtest.pp svneol=native#text/plain
packages/rtl-console/tests/kbdutil.pp svneol=native#text/plain
packages/rtl-console/tests/us101.txt svneol=native#text/plain
packages/rtl-console/tests/video1.pp svneol=native#text/plain
packages/rtl-console/tests/video1_unix.lpi svneol=native#text/plain
packages/rtl-console/tests/vidutil.pp svneol=native#text/plain
packages/rtl-extra/Makefile svneol=native#text/plain
packages/rtl-extra/Makefile.fpc svneol=native#text/plain

View File

@ -0,0 +1,24 @@
program video1;
uses
video, keyboard;
var
k: TKeyEvent;
X, Y: Integer;
begin
InitKeyboard;
InitVideo;
repeat
for X := 0 to ScreenWidth - 1 do
for Y := 0 to ScreenHeight - 1 do
VideoBuf^[Y * ScreenWidth + X] := ((X + Y) mod 256) or $0700;
UpdateScreen(False);
k := GetKeyEvent;
k := TranslateKeyEvent(k);
until GetKeyEventChar(k) = 'q';
DoneVideo;
DoneKeyboard;
end.

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="video1"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<Units Count="4">
<Unit0>
<Filename Value="video1.pp"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="../src/unix/video.pp"/>
<IsPartOfProject Value="True"/>
</Unit1>
<Unit2>
<Filename Value="../src/inc/video.inc"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="../src/inc/videoh.inc"/>
<IsPartOfProject Value="True"/>
</Unit3>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="video1_unix"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);../src/inc"/>
<OtherUnitFiles Value="../src/unix"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>