|
@@ -1390,32 +1390,35 @@ Begin
|
|
|
ScrollScrnRegionDown(WindMinX, CurrY, WindMaxX, WindMaxY, 1);
|
|
|
End;
|
|
|
|
|
|
-
|
|
|
{$ifdef linux}
|
|
|
-const
|
|
|
- KIOCSOUND = $4B2F; // start sound generation (0 for off)
|
|
|
+ {$define havekiocsound}
|
|
|
+ const KIOCSOUND = $4B2F; // start sound generation (0 for off)
|
|
|
+{$else}
|
|
|
+ {$ifdef FreeBSD}
|
|
|
+ const KIOCSOUND =$20004b3f;
|
|
|
+ {$define havekiocsound}
|
|
|
+ {$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);
|
|
|
begin
|
|
|
-{$ifdef linux}
|
|
|
- if not OutputRedir then
|
|
|
+{$ifdef havekiocsound}
|
|
|
+ if (not OutputRedir) and (hz>0) then
|
|
|
fpIoctl(TextRec(Output).Handle, KIOCSOUND, Pointer(1193180 div Hz));
|
|
|
{$endif}
|
|
|
end;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
Procedure NoSound;
|
|
|
begin
|
|
|
-{$ifdef linux}
|
|
|
+{$ifdef havekiocsound}
|
|
|
if not OutputRedir then
|
|
|
fpIoctl(TextRec(Output).Handle, KIOCSOUND, nil);
|
|
|
{$endif}
|
|
|
end;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
Procedure TextMode (Mode: word);
|
|
|
{
|
|
|
Only Clears Screen under linux}
|