{% extends "sega.html" %} {% block title %}JVS{% endblock %} {% block body %}
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 {{ part("838-14971")|safe }}, use a slight variant on the format. The differences between the two formats are document here.
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.
E0h | Dest | n | D0 | D1 | D2 | ... | Dn-2 | SUM |
E0h | Dest | n | Status | D0 | D1 | D2 | ... | Dn-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.
A request packet may contain multiple commands within it. D0
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.
CMD0 | D0,0 | D0,1 | ... | CMD1 | D1,0 | D1,1 | ... | CMD2 | D2,0 | D2,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.
Status | Report0 | D0,0 | D0,1 | ... | Report1 | D1,0 | D1,1 | ... | Report2 | D2,0 | D2,1 | ... | SUM |
I may document these at some point in the future, but honestly the translated reference linked at the top of this page does a great job.
{% endblock %}