forked from Hay1tsme/segatools
chuniio: Add OpeNITHM LED protocol support #26
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "d4nin3u/segatools:develop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This commit basically copy-pastes the last commits from https://dev.s-ul.net/VeroxZik/segatools/-/commits/master to add OpenITHM LED support. Doesn't need to edit segatools.ini because the relevant config lines are already there for some reason.
Tested with my OpenITHM controller and behaves exactly like the other fork.
Hey,
thanks for the commit but I cannot merge it due to some ambigious config keys and changes.
The current code already has COM port config key https://gitea.tendokyu.moe/Dniel97/segatools/src/branch/develop/chuniio/config.c#L68 which should be used instead of your sugessted version. Also the LED COm setup is already handled in https://gitea.tendokyu.moe/Dniel97/segatools/src/branch/develop/chuniio/serialimpl.c#L19 and should be used for the openITHM implementation, maybe a simple config flag for openITHM support should be enough to change those 4 bytes to match the protoicol here: https://gitea.tendokyu.moe/Dniel97/segatools/src/branch/develop/chuniio/serialimpl.c#L85
If you can modify the code so it will use a simple
useOpenithm=1
config flag or similar and the proper usage ofchuniio/serialimpl.c
than I can actually merge it ;)@ -122,2 +123,4 @@
0,
NULL);
chuni_io_slider_led_port = CreateFileW(chuni_io_cfg.led_com,
Already done here: https://gitea.tendokyu.moe/Dniel97/segatools/src/branch/develop/chuniio/serialimpl.c#L36
@ -143,0 +184,4 @@
bytes_to_write = sizeof(led_buffer);
BOOL status;
led_buffer[0] = 0xAA;
This is the only openITHM specific logic which I'm not sure why its needed in the first place but at least move that code to https://gitea.tendokyu.moe/Dniel97/segatools/src/branch/develop/chuniio/serialimpl.c#L85 and just add a simple config flag to switch to this openITHM code.
from what I understand now OpenITHM doesn't use escaped data but the rgb data directly so it's unfortunately a bit more different than it needed to be
@ -59,1 +59,4 @@
GetPrivateProfileStringW(L"slider", L"ledport", L"COM5", port_input, 6, filename);
wcsncpy(cfg->led_com, L"\\\\.\\", 4);
wcsncat_s(cfg->led_com, 11, port_input, 6);
Already defined here: https://gitea.tendokyu.moe/Dniel97/segatools/src/branch/develop/chuniio/config.c#L68
Thank you for the patience and detailed explanation! I've (hopefully less badly) implemented your suggestions and tested them on my controller. I've also removed the dead config part in chusan's segatools.ini to reduce confusion with the other changes.
@ -99,1 +99,4 @@
}
void led_serial_update_openithm(const byte* rgb)
Please remove the nw line here and adjust the comments to either use
or align them properly
@ -83,2 +83,4 @@
; Output slider LED data to the serial port
controllerLedOutputSerial=0
; Use the OpenITHM protocol for serial LED output
controllerLedOutputOpenITHM=0
OpeNITHM
lol
@ -109,2 +109,4 @@
; Output slider LED data to the serial port
controllerLedOutputSerial=0
; Use the OpenITHM protocol for serial LED output
controllerLedOutputOpenITHM=0
see above
@ -112,3 +114,3 @@
; Serial port to send data to if using serial output. Default is COM5.
;serialPort=COM5
; Baud rate for serial data
; Baud rate for serial data (set to 115200 if using OpenITHM)
see above
I will wait for those small fixes and will merge the PR as it seems good now and i will include it in the next release in the next days :)
chuniio: Add OpenITHM LED protocol supportto chuniio: Add OpeNITHM LED protocol supporthttps://gitea.tendokyu.moe/Dniel97/segatools/pulls/26/files#issuecomment-1915
Is still missing :P
be54a9f2c4
toac6a8dde1b
damn I suck, I made the change in the chuni .ini but didn't include it in the commit for some reason. Hope that's the last one, once again thank you for patiently dealing with my noob-ness
Yup perfect that looks good to me! Will make a squash commit, thanks for contributing!