{***************************************************}
{ Sounds  -- Tahoe 5 Card Poker                     }
{            Sound unit for Atari Portfolio only    }
{            Copyright (c) 1992 M. Zack Urlocker    }
{***************************************************}

Unit Sounds;
{$X+}
{$IFDEF Final}       { Remove debug code for final version }
{$D-,I-,L-,R-,S-}
{$ELSE}
{$D+,I+,L+,R+,S+}
{$ENDIF}

interface

uses Portfolio;      { B.J. Gleason's Atari Portfolio unit }

procedure toggleSound;
procedure soundLose1;
procedure soundLose2;
procedure soundLose3;
procedure soundWin1;
procedure soundWin2;
procedure soundDeal;

implementation

var Sound : boolean;

procedure toggleSound;
begin
  Sound := not Sound;
end;

procedure playSound(note, length: integer);
begin
 if isPort and Sound then
   portSound(note, length)
end;

procedure soundLose1;
begin
  playSound(60, 15);
  playSound(58, 15);
  playSound(56, 15);
  playSound(54, 15);
  playSound(52, 30);
  playSound(50, 30);
end;

procedure soundLose2;
begin
  playSound(90, 15);
  playSound(30, 30);
end;

procedure soundLose3;
begin
  playSound(52, 15);
  playSound(50, 15);
  playSound(48, 30);
end;

procedure soundWin1;
begin
  playSound(40, 15);
  playSound(42, 15);
  playSound(40, 15);
  playSound(30, 30);
end;

procedure soundWin2;
begin
  playSound(50, 15);
  playSound(48, 15);
  playSound(48, 15);
  playSound(50, 15);
  playSound(52, 30);
  playSound(52, 30);
end;

procedure soundDeal;
var i : integer;
begin
   playSound(3,15);
end;

begin
  sound := True
end.