Re: [cc65] C64 drive direct access question

From: Spiro Trikaliotis <ml-cc651trikaliotis.net>
Date: 2005-10-23 13:37:54
Hello Raj,

* On Sat, Oct 22, 2005 at 08:59:55PM +0200 I wrote:
 
> In fact, I think your problem with the C code most probably is that
> you forget to send the CR after the line. (I would have to check again
> if this CR is really needed, but this is my guess).

I rechecked: Now, this is not the case. Your code somehow did not send
an EOI to the floppy.

Take for example the following:

OPEN 1,8,15
PRINT#1,CHR$(0)CHR$(0)CHR$(1)CHR$(176);

you see the floppy moving head immediately.

Now, take the following:
OPEN 1,8,15
CMD1
PRINT CHR$(0)CHR$(0)CHR$(1)CHR$(176);
REM nothing happens yet
PRINT#1
REM now, the floppy moves

That is, the floppy does not execute the command until it gets an
UNLISTEN or EOI (yes, now, I remember I have written this to cbm-hackers

before:

  cf. http://www.softwolves.pp.se/misc/arkiv/cbm-hackers/9/9171.html

for the C64 side, and the thread around
http://www.softwolves.pp.se/misc/arkiv/cbm-hackers/9/9519.html

for a discussion on the floppy side.

The important part is not the UNLISTEN but the EOI which is send out
before the UNLISTEN.

Now, how can you "forget" to send an EOI? Whenever you send data via the
C64's kernal routines, every byte is sent "delayed". This is because the
EOI (end of information) has to be signalled *before* the last byte is
sent over. For this, the kernal buffers the last byte and sends it out
when the next byte is there. Now, if you send an UNLISTEN, UNTALK, or
something else with ATN, the last buffered byte is send with an EOI
indication.

Thus, in your case, you could try to UNLISTEN the floppy (which sends
the last byte and the EOI) to fix your program.

Now, if this does not help you, you might consider posting your complete
code (or, if it is too large, put it up somewhere and send a link, or
send it directly to me via mail), so I (and others) could have a look?

HTH,
   Spiro.

-- 
Spiro R. Trikaliotis
http://www.trikaliotis.net/
http://cbm4win.sf.net/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Oct 23 13:38:16 2005

This archive was generated by hypermail 2.1.8 : 2005-10-23 13:38:19 CEST