Joybus Protocol: Difference between revisions
(Added details about the protocol's operation and started a list of all known and unknown commands.) |
(Added the rest of the known commands. Also added an image and some page links.) |
||
Line 1: | Line 1: | ||
The '''Joybus |
The '''Joybus Protocol''' is a proprietary, non-standard, serial protocol by which the N64's [[Peripheral Interface]] (as well as the GameCube and Game Boy Advance) communicates with controllers, controller accessories ([[Controller Pak]], [[Rumble Pak]], etc.), [[Randnet Keyboard|keyboards]], mice, [[Game Pak|game cartridges]], and other devices plugged into the console. |
||
== Operation == |
== Operation == |
||
[[File:Joybus_Bits.svg|thumb|270px]] |
|||
The protocol utilizes four types of bits: Zero, One, the Console Stop Bit, and the Controller Stop Bit. Zero, One, and the Controller Stop Bits are 4μs long, while the Console Stop Bit is 3μs. Communication is always initiated by the console, by sending an 8 bit (one byte) command to the device plugged in (not necessarily always a standard controller). A Console Stop Bit will usually follow after this command byte unless there is more data. |
The protocol utilizes four types of bits: Zero, One, the Console Stop Bit, and the Controller Stop Bit. Zero, One, and the Controller Stop Bits are 4μs long, while the Console Stop Bit is 3μs. Communication is always initiated by the console, by sending an 8 bit (one byte) command to the device plugged in (not necessarily always a standard controller). A Console Stop Bit will usually follow after this command byte unless there is more data. |
||
Line 18: | Line 19: | ||
{{ProtocolTableRow| 0xFF | Reset & Info | N64, GC, GBA | All | 1 | 3 }} |
{{ProtocolTableRow| 0xFF | Reset & Info | N64, GC, GBA | All | 1 | 3 }} |
||
{{ProtocolTableRow| 0x00 | Info | N64, GC, GBA | All | 1 | 3 }} |
{{ProtocolTableRow| 0x00 | Info | N64, GC, GBA | All | 1 | 3 }} |
||
{{ProtocolTableRow| 0x01 | Controller State | N64 | Controller, Mouse | 1 | 4 }} |
{{ProtocolTableRow| 0x01 | Controller State | N64 | [[Controller]], Mouse | 1 | 4 }} |
||
{{ProtocolTableRow| 0x02 | Read Controller Accessory | N64 | Transfer, Controller, Bio Sensor, and Rumble Paks | 3 | 32 }} |
{{ProtocolTableRow| 0x02 | Read Controller Accessory | N64 | [[Transfer Pak|Transfer]], Controller, [[Bio Sensor]], and Rumble Paks | 3 | 32 }} |
||
{{ProtocolTableRow| 0x03 | Write Controller Accessory | N64 | Transfer, Controller, Bio Sensor, and Rumble Paks | 35 | 0 }} |
{{ProtocolTableRow| 0x03 | Write Controller Accessory | N64 | Transfer, Controller, Bio Sensor, and Rumble Paks | 35 | 0 }} |
||
{{ProtocolTableRow| 0x04 | Read EEPROM | N64 | Cartridge | ? | ? }} |
{{ProtocolTableRow| 0x04 | Read EEPROM | N64 | Cartridge | ? | ? }} |
||
Line 32: | Line 33: | ||
{{ProtocolTableRow| 0x11 | Reserved | | | ? | ? }} |
{{ProtocolTableRow| 0x11 | Reserved | | | ? | ? }} |
||
{{ProtocolTableRow| 0x12 | Reserved | | | ? | ? }} |
{{ProtocolTableRow| 0x12 | Reserved | | | ? | ? }} |
||
{{ProtocolTableRow| 0x13 | Read Keypress | N64 | Randnet Keyboard | 2 | 7 }} |
{{ProtocolTableRow| 0x13 | Read Keypress | N64 | [[Randnet Keyboard]] | 2 | 7 }} |
||
{{ProtocolTableRow| 0x14 | Read GBA | GC, GBA | GBA | ? | ? }} |
|||
{{ProtocolTableRow| 0x15 | Write GBA | GC, GBA | GBA | ? | ? }} |
|||
{{ProtocolTableRow| 0x16-0x2F | Unknown | | | ? | ? }} |
|||
{{ProtocolTableRow| 0x30 | Force Feedback | GC | Steering Wheel | ? | ? }} |
|||
{{ProtocolTableRow| 0x31-0x3F | Unknown | | | ? | ? }} |
|||
{{ProtocolTableRow| 0x40 | Short Poll | GC | Controller | ? | ? }} |
|||
{{ProtocolTableRow| 0x41 | Read Origin | GC | Controller | ? | ? }} |
|||
{{ProtocolTableRow| 0x42 | Calibrate | GC | Controller | ? | ? }} |
|||
{{ProtocolTableRow| 0x43 | Long Poll | GC | Controller | ? | ? }} |
|||
{{ProtocolTableRow| 0x44-0x53 | Unknown | | | ? | ? }} |
|||
{{ProtocolTableRow| 0x54 | Poll | GC | Keyboard | ? | ? }} |
|||
{{ProtocolTableRow| 0x55-0xFE | Unknown | | | ? | ? }} |
|||
|} |
|} |
||
<small>'''''{{sup|†}}''' Real Time Clock''</small> |
<small>'''''{{sup|†}}''' Real Time Clock''</small> |
Revision as of 23:55, 7 August 2020
The Joybus Protocol is a proprietary, non-standard, serial protocol by which the N64's Peripheral Interface (as well as the GameCube and Game Boy Advance) communicates with controllers, controller accessories (Controller Pak, Rumble Pak, etc.), keyboards, mice, game cartridges, and other devices plugged into the console.
Operation
The protocol utilizes four types of bits: Zero, One, the Console Stop Bit, and the Controller Stop Bit. Zero, One, and the Controller Stop Bits are 4μs long, while the Console Stop Bit is 3μs. Communication is always initiated by the console, by sending an 8 bit (one byte) command to the device plugged in (not necessarily always a standard controller). A Console Stop Bit will usually follow after this command byte unless there is more data.
The controller or device will read this command and any extra data, and then respond appropriately. For example, when the console wishes to write to a Controller Pak, it will send 0x03, followed by a 2 byte address, 32 bytes of data, and then the stop bit.
Command List
Because all commands are exactly 8 bits long, there can be a total of 256 commands. However, only about 16 are known for the N64, and a few more for GameCube and Game Boy Advance. Games also have the ability to define custom commands with or without extra data, but official controllers or devices will not understand them.
Command | Description | Console | Devices | Tx Bytes | Rx Bytes |
---|---|---|---|---|---|
0xFF | Reset & Info | N64, GC, GBA | All | 1 | 3 |
0x00 | Info | N64, GC, GBA | All | 1 | 3 |
0x01 | Controller State | N64 | Controller, Mouse | 1 | 4 |
0x02 | Read Controller Accessory | N64 | Transfer, Controller, Bio Sensor, and Rumble Paks | 3 | 32 |
0x03 | Write Controller Accessory | N64 | Transfer, Controller, Bio Sensor, and Rumble Paks | 35 | 0 |
0x04 | Read EEPROM | N64 | Cartridge | ? | ? |
0x05 | Write EEPROM | N64 | Cartridge | ? | ? |
0x06 | Read RTC† Status | N64 | 64DD, Animal Forest | ? | ? |
0x07 | Read RTC† Block | N64 | 64DD, Animal Forest | ? | ? |
0x08 | Write RTC† Block | N64 | 64DD, Animal Forest | ? | ? |
0x09-0x0D | Unknown | N64 | VRU | ? | ? |
0x0E | Reserved | ? | ? | ||
0x0F | Unknown | ? | ? | ||
0x10 | Reserved | ? | ? | ||
0x11 | Reserved | ? | ? | ||
0x12 | Reserved | ? | ? | ||
0x13 | Read Keypress | N64 | Randnet Keyboard | 2 | 7 |
0x14 | Read GBA | GC, GBA | GBA | ? | ? |
0x15 | Write GBA | GC, GBA | GBA | ? | ? |
0x16-0x2F | Unknown | ? | ? | ||
0x30 | Force Feedback | GC | Steering Wheel | ? | ? |
0x31-0x3F | Unknown | ? | ? | ||
0x40 | Short Poll | GC | Controller | ? | ? |
0x41 | Read Origin | GC | Controller | ? | ? |
0x42 | Calibrate | GC | Controller | ? | ? |
0x43 | Long Poll | GC | Controller | ? | ? |
0x44-0x53 | Unknown | ? | ? | ||
0x54 | Poll | GC | Keyboard | ? | ? |
0x55-0xFE | Unknown | ? | ? |
† Real Time Clock