3. JAMMA Video Standard
Note
A copy of the JVS standard can be found here. The astute reader may observe it is in Japanese. A rather excelent translation can be found here.
JVS is a communication standard designed for I/O devices in arcade macines. It typically operates over RS485 serial, however the framing format can and sometimes is used outside of this context.
This page documents the canonical JVS structure. Some devices, notably the 838-14971
, use a slight variant on the format. The differences between the two formats are document here.
3.1 Escaping
Every packet sent begins with the SYNC
byte, 0xe0
. Read buffers should be continually flushed until this byte is observed.
As such, 0xe0
is reserved, and is escaped. A byte is escaped using MARK
, 0xd0
, followed by the byte’s value subtract one. While any byte can be escaped, the only two that require escaping are SYNC
and MARK
, escaped as D0 DF
and D0 CF
respectively. All operations on packets, such as checksums and length calculation, are performed on the unescaped packet.
3.2 Packet framing
00 | 01 | 02 | 03 | 04 | 05 | … | ||
---|---|---|---|---|---|---|---|---|
E0h | Dest | n | D 0 |
D 1 |
D 2 |
… | D n-2 |
SUM |
00 | 01 | 02 | 03 | 04 | 05 | 06 | … | ||
---|---|---|---|---|---|---|---|---|---|
E0h | Dest | n |
Status | D 0 |
D 1 |
D 2 |
… | D n-3 |
SUM |
SUM
is calculated by summing all bytes in the packet, excluding SYNC
and SUM
itself. n
indicates the number of bytes succeeding itself. Due to the existance of the checksum, n=0
is nonsensical.
3.3 Commands and responses
A request packet may contain multiple commands within it. D~0~
always contains the first command. It is followed by m
bytes of data, typically a constant number per command but not always (see the command reference), at which point either we have consumed n-1
bytes and the next byte is SUM
, or the next byte is another command and we repeat.
00 | 01 | 02 | 03 | 04 | 05 | 06 | … | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
CMD 0 |
D 0,0 |
D 0,1 |
… | CMD 1 |
D 1,0 |
D 1,1 |
… | CMD 2 |
D 2,0 |
D 2,1 |
… | SUM |
Response packets are structured similarly, however the CMD
byte is not present, instead relying on the response to be ordered exactly the same as the request. The data of each command is preceeded by a report code, indicating that individual command’s status. The below diagram also includes the entire-packet status byte too for clarity.
00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | … | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Status | Report0 | D 0,0 |
D 0,1 |
… | Report1 | D 1,0 |
D 1,1 |
… | Report2 | D 2,0 |
D 2,1 |
… | SUM |
3.4 Individual commands
Later.