pixel wrote:Hi there,
am trying to read a directory but I don't want to process the BASIC listing version. Using a secondary address of $60 was supposed to help with that but I still get the BASIC thing. Any ideas?
My advice would be to stick with the block commands themselves. In addition, I have heard it mentioned that some fictitious drives don't return a valid result. Well, both of these have a cure.
As a reference, I point you to Anatomy of the 1541 Disk Drive' by Abacus Software.
Specifically, sections 3.3 and sections 2.1 to 2.4 allow you to accurately identify the exact drive you are working with, as well as read the buffer and send direct block access commands to the disk drive. Read and identify free space in the BAM, calculate how many free blocks are free in the bitmap of the drive...In addition, I recommend for further reading as a code example, section 4.6 which gives clear examples of how to change and display individual blocks. All examples are given in basic, but can be easily translated to ML. You can read the buffer as well using these sections and then parse using the information provided.
Given the breadth of the question, I find it would be somewhat silly to post at least 4 sections of a large book in a thread post.
I'll give you a link to the book instead. You will be well rewarded for reading it!
Also for manually moving the heads around there is another book called '1541 User's Guide' which in spite of it's pedestrian name was written by a PH.D. and contains a wealth of knowledge and useful programs including the above mentioned, and an Unscratch tool, alignment tool which uses the demo disk as a known good starting point etc.
The Anatomy of the 1541 Disk Drive:
http://69.60.118.202/books/commodore/bo ... _Drive.zip
1541 Users Guide:
http://69.60.118.202/books/commodore/bo ... _Guide.zip
There is another one here that is newly added that I haven't read...it comes with a disk image!
For that I'll just put the download page for all these books...
'Inside Commodore DOS'
http://69.60.118.202/commodore/books.htm
I don't know about that latter, but 511 pages has to have something in it. Regardless, the resources I supplied ought to be enough for you to
turn your floppy drive into a friggin' spaceship already with specific sections already cut out from my own reading.
Byte 02 by the way, tells you the drive type
starting with byte 0 of course, being the 3rd byte. Just so there is no confusion. I have read references to byte 2 in this thread, which is byte 01.