Your method helped to fix the problem but a new one appeared. The screen doesn't clear normally, just the top part, looks like it's overflowing. How to fix?
I suggest that you stick with 240x240 and CS_ALWAYS_LOW for the moment.
i.e. wire CS to GND.
I can only use 240x240 until my 240x320 arrives.
Pawel A. Hernik's library has some nice examples but there are one or two issues with 240x320
I would be happier with fixing them on a real 240x320 screen and offering "Pull Requests" to Pawel.
Alternatively you can use Adafruit_ST7789 library (which expects 240x320 and CS )
I rewrote the library for myself. I rewrote fillRect now it calls writeMulti twice, each call to a different side of the screen and this prevents the uint16_t variable from overflowing. fillRect was used to erase the screen in the fillScreen function. When I say function I suspect a method.
Yes, that should solve the uint16_t problem in fillRect().
Does the scroll function work correctly in all directions ?
Pawel has some nice examples. Both for his TFT libraries and his Monochrome GLCD libraries.
I have only used the ILI9341 version with 240x320 displays.