Joybus Protocol: Difference between revisions

m
Added bold and italics to emphasize checksum vs CRC
(Added pseudocode explaination of the address checksum)
m (Added bold and italics to emphasize checksum vs CRC)
Line 106:
 
=== Address Checksum ===
When the console wishes to read data from, or write data to, a particular address on the connected device, it will send the top 11 bits of a 16 bit address, plus a 5 bit checksum. This means these operations must be done in 32 byte chunks, as the lower 5 bits of the address are assumed to be 0, to make room for the checksum. '''''By definition, this checksum is not a CRC''''', because it doesn't use a cyclic code (as in, there is no bit shifting used), and the XOR value is not constant.
 
The 5 bit checksum is calculated using the following table. The working checksum is initially set to zero. For each bit of the 11 address bits, starting at the upper-most bit, if the bit is set (is 1), then XOR the corresponding byte to the working checksum. If the bit is clear (is 0), do nothing and move onto the next bit.