|
Post by C128Man on Jun 26, 2015 16:01:24 GMT
Hi,
I don't know if it's useful for someone but, it's possible to know which drive is connected to the commodore. Before any drive access, just type print DS($)
The "error" is number 73, and the message depend on the drive:
print ds 73 print ds$ 73,cbm dos v3.0 1571,00,00
EDIT: It works also with Pet and Plus4.
Ben
|
|
|
Post by gsteemso on Jun 27, 2015 2:06:50 GMT
Interesting that that works before any access is attempted! I’d have expected it to need a starting guess for the serial bus address at least. Or does it only work for the default drive that is accessed if you press the RUN key, or perhaps if you OPEN a file to the device first?
Either way, it won’t catch multiple drives. For that you need to loop on such a “read the error channel” operation, once per bus ID, which will error on anything that is absent or, we desperately hope, not actually a storage device — and give you the DOS version message, error 73, for anything that IS a drive. This technique works on the C64’s DOS 2.0 as well if you do the error channel access by hand.
|
|
|
Post by C128Man on Jun 27, 2015 14:38:55 GMT
Thanks gsteemso for the precision, just like you say, you must read the error channel of all drives.
5 for i=8 to 11 10 open 15,i,15 20 input#15,a$,b$,c$,d$ 30 print "i=";i,a$,b$,c$,d$ 40 close 15 50 next i The result is:
i= 8 73 cbm dos v3.0 1571 00 00 i= 9 73 cbm dos v3.0 1570 00 00 i= 10 73 copyright cbm dos v10 1581 00 00 i= 11 73 cbm dos v2.6 1541 00 00
|
|