I want to recognize if is not disk in floppy drive or is there and is not formatted or had corrupted/unsupported format... At check to use recognizing CBMDOS disk and CP/M disk, if no match output message: DISK IN DRIVE IS NOT FORMATTED! FORMAT IT NOW?
Thank you for all ideas how to do it.
Commodore 64 was great, Commodore 128 is bigger, better, faster and more powerful... Commodore 65 was almost here, but C256 is coming and it will be earthquake...
It is possible to check if there is a disk in the drive by monitoring a memory location in the said drive (I cannot remember the exact location ATM). It is impossible to monitor the drive door in such a way, however. Assuming that you want to automate things somewhat in your program for the disk swapping and such: IMHO, since you can tell that there is a disk inserted or not, it would best to approach it like so: monitor the location for a disk inserted, loop back and wait if it's not. When true, wait a second or two to allow the user to close the drive door, then read from the drive. If it errors, ask the user a question: Did you close the drive door? Format disk? or go back to monitoring the disk insert and do it again until there is no error (which might end up looping infinitely), and then when everything is right (drive in and door shut) go on about the action with that returned event. I'll post the drive locations when I get home later in the day.
; Check for the write protect byte/nibble in drive to monitor disk swap ;
print" please change disks." open 15,8,15 : gosub writeProtectCheck: if a<>0 then :- ; rem wait for disk to be removed : gosub writeProtectCheck: if a<>16 then :- ; rem wait for no disk in drive : gosub writeProtectCheck: if a<>0 then :- ; rem wait for disk to be inserted for d = "I to 1500: next: close 15 print "ok, thanks!" end