RudolphRiedel / FT800-FT813

Multi-Platform C code Library for EVE graphics controllers from FTDI / Bridgetek (FT810, FT811, FT812, FT813, BT815, BT816, BT817, BT818)
MIT License
121 stars 56 forks source link

Fix inline function parameter bugs #108

Closed mikee47 closed 5 months ago

mikee47 commented 5 months ago

Been using this as a source for a different library, found some bugs in EVE.h:

RudolphRiedel commented 5 months ago

You are right, I messed up the conversion for BITMAP_LAYOUT and BITMAP_SIZE, thanks.

And yes, I changed JUMP and CALL to only allow 0...2047. But that one was not a copy-paste mishap, that was following the latest programming guides. See BRT_AN_088_FT81x_BT88x-Programming-Guide.pdf v1.0 and BRT_AN_033_BT81X_Series_Programming_Guide.pdf v2.4:
"The valid range is from 0 to 2047(sizeof(RAM_DL)/4-1)." "The dest parameter of JUMP/CALL command is changed to number of display list" Or in other words, the parameter is for the 32 bit word that is to be addressed and it must have always been.

They did not change the length of the "dest" parameter in the "Encoding" to less than 16 bits though, so not clipping the value is technically fine as well. And the error is likely the same when someone tries to use the old range from 0...8191. For example using 7920 the value is likely to be clipped to 2032 by EVE instead of using 1980. The difference only is that we can not check what EVE is actually doing. This probably needs a note like in SCISSOR_XY.

Edit: ok, I edited it directly now but that does not mean that I am not open to changes anymore

mikee47 commented 5 months ago

Thank you for the explanation, make sense. I don't have any practical experience of working with these devices yet (prototype pending) so can't see anything further to contribute for this PR.

RudolphRiedel commented 5 months ago

Ok, thank you again, I merge it then as it is now.