Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
controllers [2022/06/11 14:36] – [Commands from the console] admin | controllers [2023/06/05 19:59] (current) – [Checksum/keepalive] simer | ||
---|---|---|---|
Line 20: | Line 20: | ||
A controller is activated (both for transmission and reception) by setting its CTS pin high. Controllers can request attention from the console when they have data to send using their RTS line. | A controller is activated (both for transmission and reception) by setting its CTS pin high. Controllers can request attention from the console when they have data to send using their RTS line. | ||
+ | |||
+ | The RTS line changes can be detected using IRQ5. Events on the UART (transmit or receive complete) can be detected using IRQ3. | ||
The general way to handle this is as follows, starting from an idle state with all CTS low and no pending data transfers | The general way to handle this is as follows, starting from an idle state with all CTS low and no pending data transfers | ||
Line 38: | Line 40: | ||
* Make sure the reply is completely sent ("Tx buffer empty" in status register) | * Make sure the reply is completely sent ("Tx buffer empty" in status register) | ||
* Check that RTS did not become low | * Check that RTS did not become low | ||
- | * Put CTS high again | + | * Put CTS low again |
* Back to idle state | * Back to idle state | ||
The controller keeps RTS down as long as it has more bytes to send. | The controller keeps RTS down as long as it has more bytes to send. | ||
+ | |||
+ | {{:: | ||
===== Messages from the controller ===== | ===== Messages from the controller ===== | ||
Line 76: | Line 80: | ||
| Right | C3 80 to C7 80 | C0 80 | | | Right | C3 80 to C7 80 | C0 80 | | ||
+ | The controller also sends Bx values for keepalive (see below). | ||
==== Dance mat ==== | ==== Dance mat ==== | ||
Line 141: | Line 146: | ||
* 0x44: German | * 0x44: German | ||
===== Commands from the console ===== | ===== Commands from the console ===== | ||
- | |||
- | 71 is sent during boot to start the controller. | ||
61, 62, 64 and 68 are sent in reply to color buttons presses. I suspect this controls the lights in the buttons. | 61, 62, 64 and 68 are sent in reply to color buttons presses. I suspect this controls the lights in the buttons. | ||
60 is sent to turn the light off. | 60 is sent to turn the light off. | ||
- | These are repeated every 20ms. After the controller sends 55 (idle), the V.Smile | + | These are repeated every 20ms. After the controller sends 55 (idle), the game also returns to its idle reply (E6 followed by D6 for example) every 20ms. |
+ | |||
+ | |||
+ | ==== Checksum/ | ||
+ | |||
+ | The console sends 7x commands (where x is a " | ||
+ | |||
+ | The controller response algorithm to compute the correct reply is: | ||
+ | |||
+ | '' | ||
+ | |||
+ | where A and B are the two most recent lower nibbles sent by the console in 7x commands. If only one nibble has been sent, the other nibble in the algorithm will have 0 as its value. The console can also reset the previous state by sending a Bx command instead which otherwise works like a 7x command. | ||
+ | |||
+ | The console must send the 7x commands, even if it ignores all the Bx replies from the controller. Without these commands, the controller eventually shuts down. | ||