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

Migrate A-10C to new module type #403

Merged

Conversation

charliefoxtwo
Copy link
Member

@charliefoxtwo charliefoxtwo commented Oct 13, 2023

This was an interesting one to figure out some of the issues with addresses changing.

The corrections to defineRadioWheel in the P-51 PR result in the max value decreasing by one. This was intentional - previously we were allocating too much space, and the max integer output could never be reached. For controls with a max value that is a power of 2, this results in the necessary allocated space being reduced. Most of the time this is remedied by reserving an int value, however that didn't work here. Why?

BIOS tries to be efficient with its memory packing - if it can't fit a value in one spot, it will skip to the next but leave that original spot for future controls. In this case our control would normally take up 3 bits, but now it takes only 2. So we reserve an int value of 1 to make up the difference - but in this case, it packs this value into an earlier address with space available, rather than reserving it in the address we just attempted to reserve in. Now, the next time we attempt to reserve a value of 1, the space that would have been available is no longer available. As such, it has to find the next available spot - shifting that control and many after it. The fix here is to move some number of controls after the changed control to be between the changed control and the reserve int call. The controls moved depend on their own max values - it's not very straightforward. In this case, it took a bit of guessing to figure out.

VHFAM_FREQ4 and VHFFM_FREQ4 still have their masks changed as their reserved space has changed. There is no way to avoid this.

All three of the radio controls had minor issues with their outputs, so I've left them commented out for the time being.

@jdahlblom jdahlblom added this pull request to the merge queue Oct 13, 2023
Merged via the queue into DCS-Skunkworks:master with commit 57e505a Oct 13, 2023
@charliefoxtwo charliefoxtwo deleted the feature/a10-migration branch October 13, 2023 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants