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 Aime NFC daughter boardASSY IDSEGA 838-14971DescriptionNFC RW BD TN32MSEC003S, 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.
0xe0 is reserved, and is escaped. A byte is escaped using MARK,
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.
SUM is calculated by summing all bytes in the packet, excluding SYNC and SUM
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.
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.
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.