Re: [CommodoreOne] 1541 code at $C3CA

From: Matthew Montchalin (
Date: 2001-09-25 12:58:28

On Tue, 25 Sep 2001, Ruud Baltissen wrote:

|Before writing my own code, I first have a look how C= did it.
|I run into a piece of from $C3CA to $C3F8. "Inside Commodore DOS"
|explantion of the code is nothing more then translating the opcodes
|in words;

Yes, that's annoying of them, here.

|what the block does and why is completely unclear. The meaning of
|the table at $C440 is not explained at all. Data Becker's sourcecode
|is as bad as well.
|Can anybody tell me what this code actually does and why?

Argh, what a mess!  This whole section needs to be cleaned up.

It seems to be trying to decide if the file you are scoping out, is on
Drive 0, Drive 1, or whether the disk drive should check both drives
exhaustively; there seem to be 3 possibilities.  I notice that DRVCNT
can have a value from 0 to 3.  -Although I am only familiar with the
MSD-2 dual disk drive, apparently somebody somewhere imagined that
a 1541 might be built with 4 slots for 4 different diskettes?

Anyway, when you issue a command like

  OPEN 3,8,3,"crazy game"

to a dual disk drive, there is no telling where the drive will be found
that contains "crazy game."   But once that drive is finally found, the
drive number will be stored in the table that is associated with the
2ndary address that was used in the TALK/TKSA commands issued to the
drive.  However, if the programmer actually specified

  OPEN 3,8,2,"0:crazy game"

then the drive knows for sure that the file was supposed to be in drive
0, and not the "last most recently accessed" disk drive around.  I think
the general idea is that programmers issue a command like

  OPEN 15,8,15,"i1"

and the drive is supposed to default to drive 1 until some time comes
around that it is forced to go searching drive 0 for the desired file.

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail 2.1.1.