Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andVHFFM_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.