In writing an assembly language variation using the ILI9341 of a working HX8357B terminal emulator I am experiencing some weirdness in the rotation control known as MADCTL.
The screen is defined in cells of 8x16 pixels. There are 40 columns by 16 lines of text that is buffered in sram. The Sram points to the character generator in flash. The SRAM address also determines the display address that is sent to the address window of the TFT.
Here is the weird part. The display is configured landscape MADCTL = 28. When cells on the left side with an X or column address greater that 0x100 are smashed into a line on the right side. If the address is less than 0x100 then the character displays as expected. Now if I set the SPI speed doubler on for a faster redraw, then the effect is reversed. With the 2Xbit, the cells addressed over 0x100 are drawn and the right side is blank. Changing the SPI speed to a lower speed, the weirdness persists. Behaves one way with the SPI2X off and the other when it is on. Single stepping through the SPI transmissions makes no difference.
In some ways it looks like the display clipping is swapped. Yet changing the coordinates, the data does not seem to write into the expected area.
I have looked at a bunch of Drivers, they all seem to derive from the ADAFruit one. It is after 2AM and this has been blithering me for the last few hours. If it is something wrong in the clipping region setup, then why does changing the SPI speed make it fail in a completely different way?