Here's the problem. This doesn't work at all. I did a test sweep of values from 0 to 0xFD20 and found that the reality - under TOS 1.4 at least - appears to be that 0 represents original size and 0xFFFF represents double size, with a linear transition between them.
The TOS source is pretty convoluted and I couldn't work out whether this is intentional behaviour or not.
What's going on here? Has everyone always just worked it out through trial and error and ignored the docs for the whole 41 years?
I also noticed that changing the XDDA value, AKA xacc_dda, apparently doesn't have any effect at all.
The actual behaviour sounds a lot like the actual DDA algorithm - but the docs don't.