I've been coding away reviving some old memories from when I started collecting AA back in 1989, converting some more Type-ins using Hisoft Pascal and in the process I found a flaw in their sound procedure. However, I've only just realised it and Hisoft actually acknowledge what it is in the Manual. Hisoft refer to it as the Heap, though the problem I discovered is, when dealing in Loops, their sound procedure fills this Heap with the Sound Data, unfortunately the address (which resides at &471..&472 in compiled BIN file) doesn't remain constant and eventually the programmes which use that sound procedure will crash, which will also sadly include my Get The Cash game (though it would take quite some time as the size of the heap area is 16kb).
When the programs are compiled into a BINary file, this heap seems to point to &4000, along with the sound procedure, I've been using ENV, though there doesn't seem to be any problems with that, some data was placed at &4000 in my Test program (see below), though not in a manner where it would be continuously filling up memory with the same data, so it just seems to be happening with the sound procedure.
I wrote this program below which I hope corrects this, I didn't see any sign of memory being filled, though the sound queue is rather complicated, in my procedure a series of variables are used to gather the sound data, I've placed it within a local array and converted the 16-bit values into bytes for the appropriate sections of the array, I've setup another variable which points to the address of the array and used that to go into the HL register before initiating the sound queue (&BCAA), which seems to work.
10 PROGRAM sndtest;
20 {$C-}
30
40 TYPE sque = ARRAY[1..7] OF integer;
50
60 VAR ky : char;
70
80 PROCEDURE snd(g,k,l,h,m,j,i : integer);
90 VAR q : ARRAY[1..9] OF char;
100 aq: integer;
110 cal : integer;
120 BEGIN
130 q[1]:=chr(g); q[2]:=chr(k); q[3]:=chr(l);
140 q[4]:=chr(h); cal:=h DIV 256; q[5]:=chr(cal);
150 q[6]:=chr(m); q[7]:=chr(j);
160 q[8]:=chr(i); cal:=i DIV 256; q[9]:=chr(cal);
170 aq:=addr(q);
180 rhl:=aq;
181 while rhl=aq do
190 user(#bcaa)
200 END;
210
220 BEGIN
230 REPEAT
240 env(1,15,-1,20); env(2,15,-1,5);
250 env(3,7,-1,3,7,1,3,15,-1,10);
260 snd(7,3,0,0,31,15,0);
270 ky:=inch
280 UNTIL ky=chr(252)
290 END.