Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining vcsorder for rfinputs >= 256 #58

Closed
robotopia opened this issue Jun 16, 2023 · 1 comment
Closed

Defining vcsorder for rfinputs >= 256 #58

robotopia opened this issue Jun 16, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@robotopia
Copy link

robotopia commented Jun 16, 2023

Because the legacy VCS format was only supported during a time when there were no more than 128 tiles (= 256 RF inputs) plugged in at any one time, the quantity called vcs_order which defined the ordering of the tiles in the legacy .dat files is, strictly speaking, not defined for RF input indices >= 256. One downside of not defining vcs_order for extra inputs is that without such a definition, one cannot convert from the MWAX format to the legacy format.

Assuming this is a desirable feature to have, I propose extending the definition of vcs_order for cases when the number of RF inputs >= 256. Since the number of RF inputs need not be a multiple of 256, simply extending the same pattern as exists for < 256 would not be desirable. Instead, I propose simply adding the extra tiles onto the end of the array sequentially. This would turn the existing definition

(input & 0xC0) | ((input & 0x30) >> 4) | ((input & 0x0F) << 2)

into

(input < 256 ? (input & 0xC0) | ((input & 0x30) >> 4) | ((input & 0x0F) << 2) : input)

which remains backwards compatible, and extends the definition of vcs_order to an arbitrary number of tiles.

@robotopia
Copy link
Author

BTW, I'm putting this as an issue rather than a PR because it definitely needs to be discussed first! (@gsleap)

@gsleap gsleap self-assigned this Jun 16, 2023
@gsleap gsleap added the bug Something isn't working label Jun 16, 2023
@gsleap gsleap closed this as completed in b90b8bf Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants