Menu

#582 1541 VIA Bug

v2.4
open-need-test
gpz
None
Drives
2023-08-15
2014-11-26
No

When waiting for a sync on the 1541, each byte must be read in order to have the next bytes arriving properly in $1c01. In Vice the reading can be omitted and the received data is still okay.

.wait_sync_mark
lda $1c00 ;wait for end of sync
bmi *-3
lda $1c01 ;sync mark, can be omitted in vice, breaks things on real hardware
clv
bvc *

Discussion

  • gpz

    gpz - 2016-03-13

    a small test program would be very helpful

     
  • Tobias Bindhammer

    Just patch the lda $1c01 (that reads the $ff from teh synx mark) @ $033d on driveside and things still work, removing that on real hardware breaks things, as you need to read each byte first for a new byte to arrive. Attached two versions, one with the lda $1c01 at the right place, one without that lda.

     
  • gpz

    gpz - 2016-03-14

    unfortunately that kind of program isnt very useful for debugging, especially when it comes without source (and probably does tons of things unrelated to the problem) - hence "small" :=) something like a small loop that reads a single sector would be perfect

     
  • Tobias Bindhammer

    Have fun playing with that :-D
    It increments $05ff on driveside on any successful sector header read, now oyu can play around with leaving out the initial read on $1c01.

     
  • gpz

    gpz - 2023-08-13
    • status: open --> open-need-test
     
  • gpz

    gpz - 2023-08-13
     
  • Olaf Seibert

    Olaf Seibert - 2023-08-15

    I suspect both of these bugs are related to the fact that the latching of the VIA port (which is connected to the serial-to-parallel converter of the bits that are being read) is not done in the VIA code but in the drive code.
    There is disabled code for the VIA but, lacking test programs, it isn't enabled, and it is not known how much other code would need to be adjusted if it were to be enabled.

     

Log in to post a comment.