Hi everyone, I’m glad I found this site. Good to see there are CoCo fans out there today.
I bought my CoCo 3 new from Radio Shack many moons ago, (1990??? not sure now) and I was loving every minute of it. It was a great upgrade from my first PC, a Timex Sinclair 1000, and I spent many, many hours on it. Always put it back in the box when I was done so it still looks new to this day, (not the box though). Hadn’t used it in well over a decade, but always kept it. Over the years I picked up a FD502 controller and floppy drive for it. Always wanted one way back when, loading from cassettes was no fun, never had a good cassette player either. Had to load many times to get it once.
Anyway, I’ve finally got motivated to work with the ol’ CoCo again, got everything dug out and hooked up, but I have no idea what the commands are for the drive!
Help would be good here.
It is recognizing the controller, FWIW, it’s booting to the disk extended BASIC.
TIA for any input!
-HJR




Welcome back to the CoCo world. I, like you and re-visiting my CoCo past and have found the assistance from this list to be very helpful. As I read the messages and the responses posted here, I have noted several sites that I “visit” to obtain information regarding my CoCo, RS-DOS and OS-9 (now NitrOS9).
Try visiting:
http://www.rtsi.com/ftparchive.html
ftp://os9archive.rtsi.com/
ftp://maltedmedia.com/coco/
http://www.cloud9tech.com/
http://www.cs.unc.edu/~yakowenk/coco/text/history.html
http://www.vavasour.ca/jeff/trs80.html#coco2
http://vcc6809.bravehost.com/
http://coco.clubltdstudios.com/
There is also a CoCo Web Ring that you should visit
http://m.webring.com/t/TRS-80-Tandy-Color-Computer
Good Luck
Ed
Well,. I’m sure some of the disk manuals are posted for download in pdf form on the sites listed by Ed. But some of the basic ones to get you started… DIR for disk directory, DOS to boot OS-9 or OS-9 games, etc. LOAD”???.BAS” and then RUN for basic games, LOADM”???.BIN” and then EXEC for machine language games. That will at least get you going to get some files loaded and running from disk.
Here are the disk basic commands
Disk Basic Summary
————————————————————————
Disk management commands
BACKUP n TO m Copy all files from one disk to another
BACKUP n BACKUP a disk using only a single disk drive
COPY file1 TO file2 Make a duplicate of a file
DIR n List the files that are on the disk
DRIVE n Use drive n as the default
DSKINIn Initialize (format) a disk
KILL file Delete a file from the disk
LOAD file,R Load a program, and optionally start it running
LOADM file,offset Load a machine-code program, shifting by offset
MERGE file,R Load an ASCII program without clearing the old one
RENAME file1 TO file2 Change the name of a file
RUN file,R Load a program, and optionally start it running
SAVE file,A Save a program, optionally in ASCII
SAVEM file,a1,a2,ax Save a machine-code program, from a1 to a2, exec at ax
VERIFY ON Double-check all writes to the disk
VERIFY OFF Don’t double-check
Programming commands
FILES max_f,size Reserve buffers for open files
FREE(n) Returns the number of free granules (2304 bytes each)
UNLOAD n Close all open files on drive n
DSKI$ n,t,s,v1$,v2$ Read track t sector s into v1$ and v2$
DSKO$ n,t,s,v1$,v2$ Write track t sector s from v1$ and v2$
OPEN “I”,f,file Open a file for sequential input (ie: INPUT)
OPEN “O”,f,file Open a file for sequential output (ie: PRINT/WRITE)
OPEN “D”,f,file,len Open a file for direct access; (ie: GET/PUT);
record length len is optional
CLOSE #f Close a file
Sequential file commands
EOF(f) Returns true if file f has been read to the end
INPUT #f, var,… Read variables from a file
LINE INPUT #f,var$ Read an entire line from a file into a string variable
WRITE #f,values Write values to file, with commas, strings in quotes,…
PRINT #f,values Write values to file, just as PRINT would display them
PRINT #f,USING f$;values Formatted printing; many options for f$
Direct-access file commands
FIELD #f, size AS v$,… Give variable names to parts of the file buffer
RSET v$ = value$ Fill in a named part of the file buffer, right-justified
LSET v$ = value$ Fill in …, left justified
PUT #f,r Write the buffer to record r
GET #f,r Read record r into the buffer
CVN(var$) Make a number out of a binary string
MKN$(num) Make a binary string out of a number
LOC(f) Return the current record number in the buffer
LOF(f) Return the highest record number in the file
In all cases, f is a file number, n and m are drive numbers, file is a
filename, and dollar signs signify variables that must be string-variables.
Note that filenames must be either string variables or string constants in
quotes. Upper-case words are keywords, lower-case words are supplied by the
user.
Special file numbers are -2=printer -1=cassette and 0=screen
————————————————————————
Syntax for a filename, in BNF. (Things in square brackets are optional, the
vertical bar separates alternatives, angle brackets surround nonterminals,
and uppercase words denote single-letter constants.)
The name can be up to eight characters long, and cannot include a dot,
slash, colon, or zero. The extension can be up to three characters long,
and also cannot include those four characters. The drive number is a single
digit, from zero up to the highest drive on your system.
————————————————————————
There is one documented subroutine in the Disk BASIC ROM that you can use
to access the disk. Its address is stored at $C004 and $C005, so you jump
to it using indirection: JSR [$C004] .
Before calling that, you should load the X register with the address of a
data structure that describes what you want to do. The examples in the
manual always load this address from locations $C006 and $C007. I have not
tried using this, so I don’t know it will work if you put your structure
anyplace else. This data structure is seven bytes long:
1 byte op code (0 – 3)
1 byte drive number (0 – 3)
1 byte track number (0 – 34)
1 byte sector number (1 – 18)
2 bytes address of 128-byte data buffer
1 byte error code
Op codes are either 0 (restore to track 0), 1 (no op), 2 (read sector), or
3 (write sector).
Bits in the error code are defined as follows (since the labels match those
in the 1771 data sheet, I assume it is just the 1771 status code being
returned, and have taken the much more complete descriptions from that data
sheet). Note that some of the bits have different meanings based on which
command caused them to be set.
7 Not Ready
This bit, when set, indicates that the disk drive is
not ready to perform a read or write operation. When
reset it indicates that the drive is ready. Thus,
this bit is an inverted copy of the READY input signal
to the 1771 from the disk drive, and is logically ORed
with the *MR signal
6 Record Type/Write Protect
On a Read command, this bit is used in conjunction with
Bit 5 to indicate the type of data address mark that
was read. On a Write command, this bit indicates that
the diskette was write protected.
5 Record Type/Write Fault/Head Loaded
On a Read command, this bit in conjunction with Bit 6
indicates the type of data address mark that was read.
On a Write command, this bit indicates that the write
fault input from the disk drive was detected: it is
thus an inverted copy of the *WF input signal.
On a Restore command, this bit indicates that the
read/write head is loaded against the diskette surface.
This bit is thus the logical AND of the HLD and HLT
signals.
4 Record Not Found/Seek Error
On Read or Write command, this bit indicates that the
desired track and sector were not found.
On a Restore command, this bit indicates that the
designated track could not be verified. This bit is
reset to 0 whenever a new command is loaded.
3 CRC error
On a Read or Write command, if Bit 4 is also set, then
this bit indicates that an error was found in one or
more ID fields; otherwise, it indicates an error in a
data
field.
On a Restore command, this bit indicates that one or
more CRC errors were encountered on a track verification
operation. This bit is reset to 0 whenever a new
command is loaded.
2 Lost Data/Track 00
On a Read or Write command, this bit indicates that
the microprocessor did not respond to the Data Request
(DRQ) within one byte time and that a byte of data was
subsequently lost.
On a Restore command, this bit indicates that the read/
write head is positioned over track 0. This bit is
thus an inverted copy of the *TR00 input to the 1771.
1 Data Request/Index
On a Read or Write command, this bit is a copy of the
DRQ output signal. When set, it indicates that the
Data register is full on a read operation or empty on
a write operation.
On a Restore command, this bit indicates that an index
mark was detected on the diskette. This bit is thus
an inverted copy of the *IP input to the 1771.
0 Busy
When set, this bit indicates that a command is currently
being executed. This bit is reset when a command is
completed and thus indicates that the 1771 is available
to execute another command.
The disk control routine modifies the contents of only the condition code
register.
Finally, note that you can force the drive motor to turn off by writing a
zero into address $FF40. This probably also means you could force the motor
on by writing non-zero there, but the documentation doesn’t explain which
bits to what.
Manual can be found here….
http://goyim.dyndns.org:8080/coco/doc/manuals/Hardware/Color%20Computer%20Disk%20System.pdf
If this is not ok to post, let me know, I will delete it.
Dave
The motor on/off bit at $FF40 is bit-3.
[code:1:07be22c134]
Bit at $FF40 Function
0 drive select 0
1 " 1
2 " 2
3 motor enable: 0=off, 1=on
4 write precomp: 0=off, 1=on
5 density flag: 0=single, 1=double (normal Coco)
6 drive select 3
7 halt flag: 0=disabled, 1=enabled[/code:1:07be22c134]
You guys are awesome, thanks for all the input! [img:4d4047ac7c]http://i38.photobucket.com/albums/e104/ToughOldFord/Smilies/thumbsupwink.gif[/img:4d4047ac7c]
You know what, it’s looking like it was 1986 when I got this thing. Hard to believe it’s been over 20 years. Dang, suddenly I feel old.