added working tower LEDs when using dniel97's segatools
This commit is contained in:
parent
7d92da876a
commit
a8598c20cf
13
README.md
13
README.md
@ -1,12 +1,21 @@
|
||||
## chuniio-tasoller
|
||||
## chuniio-tasoller *with air tower LEDs*
|
||||
|
||||
chuniio driver for tasoller custom 2.0 firmware
|
||||
now with working air tower LEDs when using [Dniel97 segatools](https://gitea.tendokyu.moe/Dniel97/segatools)
|
||||
|
||||
thanks to:
|
||||
**akiroz** for the original code and USB Protocol information
|
||||
[**Dniel97**](https://gitea.tendokyu.moe/Dniel97) for rewritting my failed attempts at making this work
|
||||
|
||||
the current implementation may not be fully arcade accurate, but should be visually acceptable during gameplay
|
||||
this should hopefully be addressed in the future
|
||||
|
||||
Supported titles:
|
||||
- Chunithm
|
||||
- Chunithm NEW
|
||||
- Chunithn SUN
|
||||
- Chunithm SUN PLUS
|
||||
|
||||
Downloads avaliable in [releases](https://dev.s-ul.net/akiroz/chuniio-tasoller/-/releases)
|
||||
|
||||
## Configuration
|
||||
|
||||
|
32
src/main.zig
32
src/main.zig
@ -296,3 +296,35 @@ export fn chuni_io_slider_set_leds(rgb: ?[*]u8) void {
|
||||
std.log.warn("[chuniio] WinUsb_WritePipe: {any}", .{GetLastError()});
|
||||
}
|
||||
}
|
||||
|
||||
export fn chuni_io_led_init() c_int {
|
||||
return 0;
|
||||
}
|
||||
|
||||
export fn chuni_io_led_set_colors(board: u8, rgb: ?[*]u8) void {
|
||||
if(cfg.?.chusan == 1 and builtin.cpu.arch != .i386) return;
|
||||
if(rgb == null) return;
|
||||
|
||||
var n: u32 = 0;
|
||||
if(board == 0) {
|
||||
const out = usb_out[96..168];
|
||||
while(n < 24) : (n += 1) {
|
||||
out[n*3+1] = rgb.?[0x96];
|
||||
out[n*3+0] = rgb.?[0x97];
|
||||
out[n*3+2] = rgb.?[0x98];
|
||||
}
|
||||
} else if(board == 1) {
|
||||
const out = usb_out[168..240];
|
||||
while(n < 24) : (n += 1) {
|
||||
out[n*3+1] = rgb.?[0xb4];
|
||||
out[n*3+0] = rgb.?[0xb5];
|
||||
out[n*3+2] = rgb.?[0xb6];
|
||||
}
|
||||
}
|
||||
|
||||
usb_out_op.lock();
|
||||
defer usb_out_op.unlock();
|
||||
if(WinUsb_WritePipe(tasoller, 0x03, @ptrCast(*u8, &usb_out), usb_out.len, &n, null) == 0) {
|
||||
std.log.warn("[chuniio] WinUsb_WritePipe: {any}", .{GetLastError()});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user