A chuniio.dll implementation that forwards all calls to Backflow's chuniio_proxy output backend via Unix domain sockets through Wine.
This library implements the chuniio.dll interface expected by CHUNITHM games and forwards all communication to a Unix domain socket exposed by Backflow's chuniio_proxy output backend.
CHUNITHM Game (Windows/Wine)
↓ chuniio.dll API calls
chuniio.dll (this library)
↓ AF_UNIX socket communication
Backflow chuniio_proxy (Linux)
↓ Input/Feedback events
Backflow backends (uinput, etc.)
This enables CHUNITHM games running under Wine to communicate with native Linux input/output systems through Backflow.
- Rust toolchain with Windows cross-compilation target
- Wine (for testing)
-
Add the Windows target:
rustup target add x86_64-pc-windows-gnu
-
Build the DLL:
cargo build --target x86_64-pc-windows-gnu --release
-
The resulting DLL will be at:
target/x86_64-pc-windows-gnu/release/chuniio_backflow.dll
The DLL includes comprehensive logging using the tracing crate. Logs are written to stdout/stderr and will appear in the terminal where the game is launched.
- DEBUG: Detailed function call traces and protocol messages
- INFO: Initialization and connection status
- WARN: Non-fatal errors and warnings
- ERROR: Fatal errors and connection failures
Set the RUST_LOG environment variable to control logging:
# Debug level logging for chuniio-backflow
export RUST_LOG=chuniio_backflow=debug
# Info level logging (less verbose)
export RUST_LOG=chuniio_backflow=info
# Error level only
export RUST_LOG=chuniio_backflow=errorThen run your game under Wine:
wine start.batINFO chuniio-backflow: chuniio-backflow DLL loaded
DEBUG chuniio-backflow: Initializing socket connection to chuniio proxy
DEBUG chuniio-backflow: Created Unix domain socket
DEBUG chuniio-backflow: Connecting to socket path: /tmp/chuniio_proxy.sock
INFO chuniio-backflow: Successfully connected to chuniio proxy socket
DEBUG chuniio-backflow: Initializing JVS subsystem
DEBUG chuniio-backflow: JVS subsystem initialized successfully
DEBUG chuniio-backflow: Initializing slider subsystem
DEBUG chuniio-backflow: Starting slider input polling
DEBUG chuniio-backflow: Initializing LED subsystem
DEBUG chuniio-backflow: Updating slider LED colors
DEBUG chuniio-backflow: Message sent (no response expected)
Add chuniio_proxy backend to your Backflow configuration:
[output.chuniio_proxy]
enabled = true
socket_path = "/tmp/chuniio_proxy.sock"Copy the built DLL to your CHUNITHM game directory and rename it:
cp target/x86_64-pc-windows-gnu/release/chuniio_backflow.dll /path/to/chunithm/chuniio.dllSet the socket path via environment variable if using a non-default location:
export CHUNIIO_PROXY_SOCKET="/custom/path/to/chuniio_proxy.sock"- Start Backflow with chuniio_proxy enabled
- Run your CHUNITHM game under Wine
- The DLL will automatically connect to the socket and forward all chuniio API calls
This implementation supports all standard chuniio.dll APIs:
chuni_io_jvs_init()- Initialize JVS subsystemchuni_io_jvs_poll()- Poll operator buttons and IR beamschuni_io_jvs_read_coin_counter()- Read coin counter
chuni_io_slider_init()- Initialize slider subsystemchuni_io_slider_start()- Start slider polling with callbackchuni_io_slider_stop()- Stop slider polling
chuni_io_led_init()- Initialize LED subsystemchuni_io_slider_set_leds()- Set slider LED colorschuni_io_led_set_colors()- Set LED board colors
The DLL communicates with Backflow using a binary protocol over Unix domain sockets:
- JVS Poll (0x01) - Request current input state
- JVS Poll Response (0x02) - Current operator buttons and IR beams
- Coin Counter Read (0x03) - Request coin count
- Coin Counter Response (0x04) - Current coin count
- Slider Input (0x05) - Slider pressure data
- Slider LED Update (0x06) - Update slider LEDs
- LED Update (0x07) - Update LED boards
- Ping (0x08) / Pong (0x09) - Keepalive
CHUNIIO_PROXY_SOCKET- Override socket path (default:/tmp/chuniio_proxy.sock)
The chuniio_proxy backend recognizes these special input keycodes:
CHUNIIO_COIN- Coin insertionCHUNIIO_TEST- Test buttonCHUNIIO_SERVICE- Service buttonCHUNIIO_SLIDER_[0-31]- Slider touch zonesCHUNIIO_IR_[0-5]- IR beam sensors
- Ensure Backflow is running with chuniio_proxy enabled
- Check that the socket path is correct
- Verify Wine can access Unix sockets (Wine 6.0+ recommended)
- Make sure the socket file has appropriate permissions
- Check that Wine process can write to the socket directory
- Verify Backflow feedback configuration
- Check that LED events are being processed by Backflow
GPL-3.0-or-later