From: Spiro Trikaliotis (ml-cbmhackers_at_trikaliotis.net)
Date: 2004-06-21 11:24:18
Hello,
* On Tue, Jun 15, 2004 at 10:57:44AM -0400 Greg King wrote:
> From: Spiro Trikaliotis; on Date: Saturday, June 12, 2004, at 06:24 AM
[...]
> > I have not checked too deeply (in fact, the 1541 side really is a
> > mess, compared with the C64 part), but it seems to me that it is
> > executed immediately after the EOI is recognized.
> >
> > I do not see the necessity for an UNLISTEN before, but I'm willing
> > to be corrected.
> >
> > I tried with VICE and true drive emulation: I set breakpoints to
> > UNLISTEN ($E88B), the command-execution call at $EBF5, and the store
> > to $0255 at $CFED. My idea seems to be supported, although I always
> > received the UNLISTEN before the command was executed. That is
> > because $EA2E-$EA56 calls $E9C9 to get a data-byte from the bus,
> > which itself tests for ATN. Thus, the UNLISTEN is processed before
> > the main loop is called again.
> >
> > I disabled the sending of UNLISTEN on the C64 side by putting RTS at
> > $EDFE. $CFED was not called after this, unless a CLOSE 1 was
> > executed. (I executed open 1,8,15,"v0" for these tests, as well as
> > CLOSE1.) Thus, something in my logic is wrong: Without the
> > UNLISTEN, the 1541 does not recognize the command.
> >
> > I checked again: OPEN1,8,15,"V0": $CFED was not called. OPEN
> > 2,8,15,"I0": Now, $CFED was called. It seems that the processing of
> > the commands need a subsequent ATN, whatever it is (LISTEN,
> > UNLISTEN, TALK, UNTALK). Good, point taken.
>
> The LISTEN, UNLISTEN, TALK, and UNTALK functions send EOI and flush
> the buffer, if there is a byte waiting in it. You stopped that act
> when you disabled UNTALK/UNLISTEN. CLOSE and the second OPEN worked
> because you didn't disable TALK/LISTEN. So, your idea that EOI is the
> trigger probably is correct.
Good point. I'm glad I wrote my exact modifications here, so you could
check and find my error.
I modified the UNLISTEN routine (c64) in the following way:
.C:edfe 24 94 BIT $94 ' is there any byte buffered to send?
.C:ee00 38 SEC
.C:ee01 66 A3 ROR $A3 ' $A3.7 == 1 -> send EOI
.C:ee03 20 40 ED JSR $ED40 ' output the missing byte
.C:ee06 46 94 LSR $94 ' no more bytes to send
.C:ee08 46 A3 LSR $A3 ' no more EOIs to send
.C:ee0a 60 RTS ' done
This way, in the floppy, $CFED is called to mark the command as
available, and $EBF5 was called, too, although the UNLISTEN routine
($E88B) was not called at all. So: Yes, the EOI is the trigger for
command execution in the 1541.
One remark: The C64 crashed after this test, but I don't think this is
very important here.
Regards,
Spiro.
--
Spiro R. Trikaliotis
http://www.trikaliotis.net/
Message was sent through the cbm-hackers mailing list
Archive generated by hypermail pre-2.1.8.