In our game, I am currently going with a 12.4 fixed point number format for position and velocity. (I've been thinking of 16.8 for speed of fetching and better resolution but I figure I can save memory for now and upgrade it later)
How would we do a fixed-point multiply on 6502? I figure the general procedure would be to multiply 16x16 with a 32-bit result, and then throw away the bottom 2 bytes. But there should be a more efficient way on 6502, right? This puzzle is a little too advanced for me at the moment so I'm hoping to get some additional heads in on this.
I'm separating the LSB and MSB by a constant, FIXP_STRIDE. Game object properties are stored in interleaved arrays indexed by X/Y
edit: actually, a 16x7 (7 bit signed scalar, both with 4-bit fractional portion) multiply would probably be sufficient? i would be using it for accel/decel, angles to things, distances between things...
How would we do a fixed-point multiply on 6502? I figure the general procedure would be to multiply 16x16 with a 32-bit result, and then throw away the bottom 2 bytes. But there should be a more efficient way on 6502, right? This puzzle is a little too advanced for me at the moment so I'm hoping to get some additional heads in on this.
I'm separating the LSB and MSB by a constant, FIXP_STRIDE. Game object properties are stored in interleaved arrays indexed by X/Y
edit: actually, a 16x7 (7 bit signed scalar, both with 4-bit fractional portion) multiply would probably be sufficient? i would be using it for accel/decel, angles to things, distances between things...