home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug086.arc
/
HUSTLE.LBR
/
SOUND.IZ
/
SOUND.I
Wrap
Text File
|
1979-12-31
|
3KB
|
80 lines
procedure sound (set_tone, duration, duration2, up_down,
timbre, compare, one_many :byte);
{Sound effects by Bob Burt.}
procedure GENSND;
{ Procedure developed in Turbo Pascal
for sound routines to operate with
the MicroBee by Bob Burt }
{ Sound generator module to be
operated in conjunction with
procedure INITSND.PRO }
begin
inline(24/14/ { JUMP: JR START }
62/184/ { ONINT: LD A,0B8H }
211/2/ { LOOP0: OUT (2),A }
16/252/ { DJ NZ,LOOP0 }
201/ { RET }
62/248/ { OFFINT: LD A,0F8H }
211/2/ { LOOP1: OUT (2),A }
16/252/ { DJ NZ,LOOP1 }
201/ { RET }
245/ { START: PUSH AF }
197/ { PUSH BC }
229/ { PUSH HL }
6/80/ { LD B,SET_TONE }
33/4/0/ { LOOP3: LD HL,DURATION }
5/ { DEC B (UP_DOWN) }
72/ { LD C,B }
65/ { LOOP2: LD B,C }
205/*-26/ { CALL ONINT }
65/ { LD B,C (TIMBRE) }
205/*-23/ { CALL OFFINT }
43/ { DEC HL }
125/ { LD A,L }
180/ { OR H }
32/243/ { JR NZ,LOOP2 }
65/ { LD B,C }
120/ { LD A,B }
254/0/ { CP COMPARE }
32/232/ { ONE_MANY:JR NZ,LOOP3 }
225/ { POP HL }
193/ { POP BC }
241/ { POP AF }
201); { RET }
end; {procedure gensnd}
begin (* sound *)
mem[addr(gensnd)+20] := set_tone;
mem[addr(gensnd)+22] := duration;
mem[addr(gensnd)+23] := duration2;
mem[addr(gensnd)+24] := up_down;
mem[addr(gensnd)+30] := timbre;
mem[addr(gensnd)+42] := compare;
mem[addr(gensnd)+43] := one_many;
gensnd;
end; (* sound *)
procedure popup_sound;
begin
sound(80,1,0,5,65,1,32);
end;
procedure gobble_sound;
var
k :byte;
begin
for k := 1 to 3 do
begin
sound(60,1,0,5,65,1,32);
delay(200);
end;
end;