Sega ALL.Net P-ras MULTI version 3
Originally sold with Sega ALLS UX PC-based arcade hardware.
Gallery
-
Virtua Fighter eSports
Python Script for Controlling LEDs, NFC and VFD
This script is written assuming you're running it on an ALLS UX PC running Windows or Linux. If you're using something else you may have to specify the serial port in the command line args.
Requires Python3 and the pyserial module. Once you have Python3 you can get pyserial with: python3 -m pip install pyserial
RGB LEDs
RGB LEDs are controlled by the board with part number 837-15093-06. It's connected to COM2 over serial at 115200 8N1. Commands resemble JVS: starts with sync byte of 0xe0 and uses the same escape mechanism (0xe0 and 0xd0 replaced with 0xd0 followed by original byte - 1).
Command Format
each block is a byte
,---,---,---,---,-~ ~---,---, | 0 | 1 | 2 | 3 | payload | c | '---'---'---'---'--~ ~--'---'
- 0. sync (0xe0)
- 1. dst node id. Almost all commands will also accept a node id of 0 so you don't need to know the actual node id.
- 2. src node id (or sequence ID? it's echoed back in replies). If 0 no reply will be sent.
- 3. payload size
- n. payload (199 byte max)
- c. checksum. Same algorithm as JVS. It's the sum of all bytes after the sync byte, modulo 256.
payload structure
,-----,--~ ~-----, | cmd | (up to 198 bytes) | '-----'---~ ~----'
198 bytes of pixels = 66 pixels = 3 * 22 pixels Response payload is similar but with an extra status byte
,--------,-----,---~ ~----------, | status | cmd | optional response data | '--------'-----'---~ ~----------'
Status 1 = success, 4 = error.
Pixel Layout
The pixels are laid out in memory as three "pages" of 22 pixels. Only the first 22 are ever "drawn" to the LEDs. The rest are used in fade operations. Unfortunately the ordering of the pixels is a bit odd. If you're facing the machine they run like this in memory.
16 21 17 20 18 19 0 15 1 14 2 13 3 4 5 6 7 8 9 10 11 12
Commands
- 0x10 Reset
- Doesn't reset the node id.
- arg0: must be 217
- 0x14 Set Silent
- Enable silent mode to disable command responses.
- Not sending an argument will send back the current setting.
- arg0: 0 off (default), 1 on
- 0x18 Set Node ID
- Can only be 0-7. Normally this is just set by the lower-3 bits of the DIP switches.
- arg0: New node id.
- 0x80 Draw Pixels Immediately
- Draws the pixels already in the pixel buffer immediately.
- no args
- 0x81 Set Pixels Without Drawing
- Stores the pixels into the pixel buffer but does not draw them.
- args: 66 RGB pixels = 198 bytes
- 0x82 Set Pixels and Draw Pixels Immediately
- Store the pixels into the pixel buffer and draw them immediately.
- args: 66 RGB pixels = 198 bytes
- 0x83 Fade to Pixels
- Fade to the pixels sent.
- args: 66 RGB pixels = 198 bytes
- 0x84 Set Fade Timing
- Set the frame rate and number of frames in a fade.
- arg0: The number of frames it takes to complete the fade (255 max, must not be 0). Default is 32.
- arg1: Frame period (255 max, must not be 0). This determines how long a "frame" of the fade is. Default is 8.
- 0x85 Offset Fade
- Fade the pixels to other pixels in the pixel buffer starting at the offset. This blends the entire buffer so in a way it ends up rotating the whole pixel buffer by the offset.
- arg0: Offset in pixels from the start of the pixel buffer. Must be < 66.
- 0x86 Set Blend Window Size
- This one appears to maybe be broken. If you pass bad parameters it will reply twice, once success and once error.
- arg0: Size of the window to blend. Must be 20 or 26.
- 0x87 Set Fade Sequence Count and Offset
- Will do N repeated fades using the offset. Because of the layout of the pixels you do anything too interesting but you can use the three pages to fade between three different patterns repeatedly.
- arg0: Number of fades to do (max 255).
- arg1: Offset in pixels (must be < 66).
- 0xf0 Get HW Name
- Returns the name of the hardware. Won't reply if you give a dest node id of 0. You must give the real node id.
- 0xf1 Send Board Status
- Sends back some unknown status bytes.
- 0xf2 Get Code Checksum
- Sends back a checksum of the firmware.
- 0xfd Enter Bootloader
- Puts the board into the bootloader. Unknown what the board is looking for in this state. Maybe firmware update?
Links
https://apm.sega.jp/ver3/info/
https://www.sega.jp/topics/detail/210428_5/