home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug086.arc / HUSTLE.LBR / SOUND.IZ / SOUND.I
Text File  |  1979-12-31  |  3KB  |  80 lines

  1. procedure sound (set_tone, duration, duration2, up_down,
  2.                  timbre, compare, one_many :byte);
  3. {Sound effects by Bob Burt.}
  4.  
  5.   procedure GENSND;
  6.  
  7. { Procedure developed in Turbo Pascal
  8.   for sound routines to operate with
  9.       the MicroBee by Bob Burt        }
  10.  
  11. {    Sound generator module to be
  12.      operated in conjunction with
  13.      procedure INITSND.PRO            }
  14.  
  15.   begin
  16.   inline(24/14/      { JUMP:    JR   START        }
  17.          62/184/     { ONINT:   LD   A,0B8H       }
  18.          211/2/      { LOOP0:   OUT  (2),A        }
  19.          16/252/     {          DJ   NZ,LOOP0     }
  20.          201/        {          RET               }
  21.  
  22.          62/248/     { OFFINT:  LD   A,0F8H       }
  23.          211/2/      { LOOP1:   OUT  (2),A        }
  24.          16/252/     {          DJ   NZ,LOOP1     }
  25.          201/        {          RET               }
  26.  
  27.          245/        { START:   PUSH AF           }
  28.          197/        {          PUSH BC           }
  29.          229/        {          PUSH HL           }
  30.          6/80/       {          LD   B,SET_TONE   }
  31.          33/4/0/     { LOOP3:   LD   HL,DURATION  }
  32.          5/          {          DEC  B (UP_DOWN)  }
  33.          72/         {          LD   C,B          }
  34.          65/         { LOOP2:   LD   B,C          }
  35.          205/*-26/   {          CALL ONINT        }
  36.          65/         {          LD   B,C (TIMBRE) }
  37.          205/*-23/   {          CALL OFFINT       }
  38.          43/         {          DEC  HL           }
  39.          125/        {          LD   A,L          }
  40.          180/        {          OR   H            }
  41.          32/243/     {          JR   NZ,LOOP2     }
  42.          65/         {          LD   B,C          }
  43.          120/        {          LD   A,B          }
  44.          254/0/      {          CP   COMPARE      }
  45.          32/232/     { ONE_MANY:JR   NZ,LOOP3     }
  46.          225/        {          POP  HL           }
  47.          193/        {          POP  BC           }
  48.          241/        {          POP  AF           }
  49.          201);       {          RET               }
  50.   end; {procedure gensnd}
  51.  
  52. begin  (* sound *)
  53.   mem[addr(gensnd)+20] := set_tone;
  54.   mem[addr(gensnd)+22] := duration;
  55.   mem[addr(gensnd)+23] := duration2;
  56.   mem[addr(gensnd)+24] := up_down;
  57.   mem[addr(gensnd)+30] := timbre;
  58.   mem[addr(gensnd)+42] := compare;
  59.   mem[addr(gensnd)+43] := one_many;
  60. gensnd;
  61. end; (* sound *)
  62.  
  63.  
  64. procedure popup_sound;
  65. begin
  66. sound(80,1,0,5,65,1,32);
  67. end;
  68.  
  69.  
  70. procedure gobble_sound;
  71. var
  72.   k :byte;
  73. begin
  74. for k := 1 to 3 do
  75.   begin
  76.   sound(60,1,0,5,65,1,32);
  77.   delay(200);
  78.   end;
  79. end;
  80.