Tomas
Change the RGB565 macro and then the shift will be done at compile time and not at run time.
Eg. if the macro is presently something like:
#define RGB565(r, g, b) (((r & 0x1f) << 11) | ((g & 0x3f) << 5) | (b & 0x1f))
#define RED RGB565(31, 0, 0)
#define GREEN RGB565(0, 63, 0)
#define BLUE RGB565(0, 0, 31)
it can be changed to
#define RGB565(r, g, b) (((r & 0x18) << 13) | ((r & 0x07) << 11) | ((g & 0x3f) << 5) | (b & 0x1f))
RED, GREEN and BLUE etc. remain the same
If using images, the image pixels will need to be saved using the macro manipulation but they can then be written directly without any need for bit shifting.
Note that the unused bits of the port can't be used for other outputs since that would also require masking, and associated overhead.
Regards
Mark