I thought it might be a good idea a post a working solution before this thread dies of old age ...
Code: Select all
10 FORT=828TO951:READA:POKET,A:NEXT:SYS828
11 DATA 120,169,83,141,20,3,169,3,141,21,3,173,3,144,41,128,9,48,141,3,144,88,96,216,56
12 DATA 165,51,229,49,133,251,165,52,229,50,133,252,248,169,0,133,3,133,4,133,5,162,16
13 DATA 6,251,38,252,165,3,101,3,133,3,165,4,101,4,133,4,165,5,101,5,133,5,202,208,231
14 DATA 216,169,250,133,251,133,253,174,136,2,232,134,252,138,41,3,9,148,133,254,160,0
15 DATA 169,3,162,4,6,3,38,4,38,5,42,202,208,246,145,251,173,134,2,145,253,200,192,6
16 DATA 208,230,76,191,234
The code doesn't quite fit into the area 673..767, for this reason I had to put it into the tape buffer.
What is output as 'free space' is the difference between 'top of arrays + 1' (stored at $31/$32) and 'bottom of string space' (stored at $33/$34), neatly converted from binary to BCD to PETSCII. I reused a routine in MINIPAINT which is used there to output the block counts in the directory display, except it now doesn't bother to crop the leading zeroes.
In both versions I took the bin to BCD conversion from an example by Andrew Jacobs posted at
. Otherwise, I'm
going to provide source code this time - you'll have to infer yourself how it works ...
... and if anyone wants to put an equivalent routine into 673 .. 767 - go ahead.