mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 08:19:27 +02:00
* now also fixes div hz with hz=0 for Linux, and reenables it for FreeBSD. Still needs phys console check though
git-svn-id: trunk@7489 -
This commit is contained in:
parent
d1f7be8c7b
commit
08d10efb9f
@ -1390,32 +1390,35 @@ Begin
|
|||||||
ScrollScrnRegionDown(WindMinX, CurrY, WindMaxX, WindMaxY, 1);
|
ScrollScrnRegionDown(WindMinX, CurrY, WindMaxX, WindMaxY, 1);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
{$ifdef linux}
|
{$ifdef linux}
|
||||||
const
|
{$define havekiocsound}
|
||||||
KIOCSOUND = $4B2F; // start sound generation (0 for off)
|
const KIOCSOUND = $4B2F; // start sound generation (0 for off)
|
||||||
|
{$else}
|
||||||
|
{$ifdef FreeBSD}
|
||||||
|
const KIOCSOUND =$20004b3f;
|
||||||
|
{$define havekiocsound}
|
||||||
|
{$endif}
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
// ioctl might fail e.g. in putty. A redirect check is not enough,
|
||||||
|
// needs check for physical console too.
|
||||||
|
|
||||||
Procedure Sound(Hz: Word);
|
Procedure Sound(Hz: Word);
|
||||||
begin
|
begin
|
||||||
{$ifdef linux}
|
{$ifdef havekiocsound}
|
||||||
if not OutputRedir then
|
if (not OutputRedir) and (hz>0) then
|
||||||
fpIoctl(TextRec(Output).Handle, KIOCSOUND, Pointer(1193180 div Hz));
|
fpIoctl(TextRec(Output).Handle, KIOCSOUND, Pointer(1193180 div Hz));
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Procedure NoSound;
|
Procedure NoSound;
|
||||||
begin
|
begin
|
||||||
{$ifdef linux}
|
{$ifdef havekiocsound}
|
||||||
if not OutputRedir then
|
if not OutputRedir then
|
||||||
fpIoctl(TextRec(Output).Handle, KIOCSOUND, nil);
|
fpIoctl(TextRec(Output).Handle, KIOCSOUND, nil);
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Procedure TextMode (Mode: word);
|
Procedure TextMode (Mode: word);
|
||||||
{
|
{
|
||||||
Only Clears Screen under linux}
|
Only Clears Screen under linux}
|
||||||
|
Loading…
Reference in New Issue
Block a user