Make tower LEDs more arcade accurate

Now using all the tower LED data sent by the game instead of just using 1 and repeating it across all LEDs.

This will have no effect in game as the game simply sets them all to the same colour anyway :(
This commit is contained in:
Scribbler 2024-01-09 19:36:56 +00:00
parent 1cfbf74bc6
commit 84489e8fae

View File

@ -296,22 +296,42 @@ export fn chuni_io_led_set_colors(board: u8, rgb: ?[*]u8) void {
if (cfg.?.chusan == 1 and builtin.cpu.arch != .x86) 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];
var n: u32 = 0;
if (board == 0) {
const out = usb_out[96..168];
const led_limit: u32 = 3;
const i_limit: u32 = 8;
var led: u32 = 0;
while (led < led_limit) {
var i: u32 = 0;
while (i < i_limit) {
n = (8 * led) + i;
out[n * 3 + 1] = rgb.?[0x96 + (led * 3)];
out[n * 3 + 0] = rgb.?[0x97 + (led * 3)];
out[n * 3 + 2] = rgb.?[0x98 + (led * 3)];
i += 1;
}
led += 1;
}
} else if (board == 1) {
const out = usb_out[168..240];
const led_limit: u32 = 3;
const i_limit: u32 = 8;
var led: u32 = 0;
while (led < led_limit) {
var i: u32 = 0;
while (i < i_limit) {
n = (8 * led) + i;
out[n * 3 + 1] = rgb.?[0xb4 + (led * 3)];
out[n * 3 + 0] = rgb.?[0xb5 + (led * 3)];
out[n * 3 + 2] = rgb.?[0xb6 + (led * 3)];
i += 1;
}
led += 1;
}
}
usb_out_op.lock();
defer usb_out_op.unlock();