Reading Sedoric Free Sectors
Reading Sedoric Free Sectors
Does anyone know if there is a memory location in Sedoric where i can read the free remaining sectors from the last disk operation?
Hi Jonathan,
The amount of free sectors is recorded in the sector #2 of track #20, the 3rd and 4th bytes (bytes #2 and #3 if you count them from zero).
I think each time the system does an operation, it loads this track in a buffer (BUF2 in #C200), marks the newly used (or free) sectors, and updates the free sectors amount.
The amount of free sectors is recorded in the sector #2 of track #20, the 3rd and 4th bytes (bytes #2 and #3 if you count them from zero).
I think each time the system does an operation, it loads this track in a buffer (BUF2 in #C200), marks the newly used (or free) sectors, and updates the free sectors amount.
Trust Symoon to help.. thanks Symoon
only trouble is that i don't seem to find this.
From mc i refresh the directory and have an infinite loop just before switching the rom back in. So i then examine C200 and it has 3D,1B,4C,50,46,48 at the start, not relating to the 942 Sectors free it reports when i do a normal DIR from BASIC.
only trouble is that i don't seem to find this.
From mc i refresh the directory and have an infinite loop just before switching the rom back in. So i then examine C200 and it has 3D,1B,4C,50,46,48 at the start, not relating to the 942 Sectors free it reports when i do a normal DIR from BASIC.
Well that is very strange, i just retried it and it came back with the correct figures, like FF,00,AE,03,08,00.. etc.
That was after doing a dir from basic. i then F6 and tried again (with dir from basic) and the correct figures again (03,AE in hex is 942 in decimal).
Very strange. i'll have to experiment a bit more to see if it was purely a quirky thing or recreatable. But looks hopeful
Ok, after some experiments, i can't seem to see any other correlation than first DIR on launching, then loading app which refreshes directory. very strange
Incidentally i just thought its CEO today isn't it?.. so sorry i couldn't make it. I hope the figures are still in shape and they'll be enough interest for a summer show, which i will definately try to make.
That was after doing a dir from basic. i then F6 and tried again (with dir from basic) and the correct figures again (03,AE in hex is 942 in decimal).
Very strange. i'll have to experiment a bit more to see if it was purely a quirky thing or recreatable. But looks hopeful
Ok, after some experiments, i can't seem to see any other correlation than first DIR on launching, then loading app which refreshes directory. very strange
Incidentally i just thought its CEO today isn't it?.. so sorry i couldn't make it. I hope the figures are still in shape and they'll be enough interest for a summer show, which i will definately try to make.
Beware that BUF2 in #C200 is used to load the bitmap, but can be used for different purposes. So before reading the memory in #C202 and #C203, you have to load the bitmap sector in BUF2.
Typically, there's a routine in #DA4C (overlay RAM of course), that loads the 1st bitmap sector in BUF2, and then flags the 7th bit in the memory location #2F to say it's loaded.
Maybe you can test this bit in this byte to be sure that you'll find the free sectors value there.
I'm only answering by quickly looking in Sedoric à Nu, so maybe this is not a complete description but I think it should work.
Typically, there's a routine in #DA4C (overlay RAM of course), that loads the 1st bitmap sector in BUF2, and then flags the 7th bit in the memory location #2F to say it's loaded.
Maybe you can test this bit in this byte to be sure that you'll find the free sectors value there.
I'm only answering by quickly looking in Sedoric à Nu, so maybe this is not a complete description but I think it should work.