chuniio: Add OpeNITHM LED protocol support #26

Merged
Dniel97 merged 3 commits from d4nin3u/segatools:develop into develop 2024-08-06 21:35:52 +00:00
Contributor

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.

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.
d4nin3u added 1 commit 2024-07-25 20:25:13 +00:00
Owner

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 of chuniio/serialimpl.c than I can actually merge it ;)

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 of `chuniio/serialimpl.c` than I can actually merge it ;)
Dniel97 requested changes 2024-08-03 23:11:36 +00:00
@ -122,2 +123,4 @@
0,
NULL);
chuni_io_slider_led_port = CreateFileW(chuni_io_cfg.led_com,
Owner
Already done here: https://gitea.tendokyu.moe/Dniel97/segatools/src/branch/develop/chuniio/serialimpl.c#L36
Dniel97 marked this conversation as resolved
@ -143,0 +184,4 @@
bytes_to_write = sizeof(led_buffer);
BOOL status;
led_buffer[0] = 0xAA;
Owner

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.

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.
Author
Contributor

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

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
Dniel97 marked this conversation as resolved
chuniio/config.c Outdated
@ -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);
Owner
Already defined here: https://gitea.tendokyu.moe/Dniel97/segatools/src/branch/develop/chuniio/config.c#L68
Dniel97 marked this conversation as resolved
d4nin3u added 1 commit 2024-08-05 07:23:01 +00:00
Author
Contributor

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.

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.
Dniel97 requested changes 2024-08-05 19:36:13 +00:00
@ -99,1 +99,4 @@
}
void led_serial_update_openithm(const byte* rgb)
Owner

Please remove the nw line here and adjust the comments to either use

/*
*/

or align them properly

Please remove the nw line here and adjust the comments to either use ``` /* */ ``` or align them properly
Dniel97 marked this conversation as resolved
@ -83,2 +83,4 @@
; Output slider LED data to the serial port
controllerLedOutputSerial=0
; Use the OpenITHM protocol for serial LED output
controllerLedOutputOpenITHM=0
Owner

OpeNITHM

lol

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
Owner

see above

see above
Dniel97 marked this conversation as resolved
@ -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)
Owner

see above

see above
Dniel97 marked this conversation as resolved
Owner

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 :)

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 :)
Dniel97 changed title from chuniio: Add OpenITHM LED protocol support to chuniio: Add OpeNITHM LED protocol support 2024-08-06 09:30:59 +00:00
d4nin3u added 1 commit 2024-08-06 09:57:38 +00:00
Owner
https://gitea.tendokyu.moe/Dniel97/segatools/pulls/26/files#issuecomment-1915 Is still missing :P
d4nin3u force-pushed develop from be54a9f2c4 to ac6a8dde1b 2024-08-06 15:56:56 +00:00 Compare
Author
Contributor

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

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
Owner

Yup perfect that looks good to me! Will make a squash commit, thanks for contributing!

Yup perfect that looks good to me! Will make a squash commit, thanks for contributing!
Dniel97 merged commit 37c26ecadb into develop 2024-08-06 21:35:52 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Dniel97/segatools#26
No description provided.