ADTPro / adtpro

Apple Disk Transfer ProDOS (ADTPro)
http://adtpro.com
GNU General Public License v2.0
133 stars 19 forks source link

Protocol documentation for Write Block (the host response) is aspirational, but not correct #194

Open david-schmidt opened 3 hours ago

david-schmidt commented 3 hours ago

Bug report from @colinleroy:

Write Block says:

 The Apple sends: byte stream:
   One byte: "E" ($C5)
   One byte: $02 (for drive 1) or $04 (for drive 2)
   Two bytes: requested block number (LSB, MSB)
   One byte: EOR of the first four bytes
   Requested block data (512 bytes)
   One byte: EOR of all bytes in block

 Host sends: byte stream:
   One byte: "E" ($C5)
   One byte: $02 (for drive 1) or $04 (for drive 2)
   Two bytes: requested block number (LSB, MSB)
   One byte: EOR of the first four bytes

But the host response actually reflects the checksum of the data block that the Apple sent. So it's more proper to say something like:

 Host sends: byte stream:
   One byte: "E" ($C5)
   One byte: $02 (for drive 1) or $04 (for drive 2)
   Two bytes: requested block number (LSB, MSB)
   One byte: the checksum of the block received (reflect the block's checksum back to the sender)
david-schmidt commented 3 hours ago

https://www.adtpro.com/protocolv1.html#Write