Since the LCD module is actually 128x160 the output needs to be rotated for 160x128. After you've added the additional /CS cycle to LCD_Data2(), have you noticed the orientation of the display output? If it was correct, then MADCTL should work. Otherwise it would be the default orientation (upright, like an old mobile phone). Have you tried to enable LCD_BGR for the ST7735 driver to reverse the color order?
Let me show you, what i'm talking about.
1.12k OF
MEMADDRCTRL = 0x6C (flipx + hw_rotation + hw_bgr)
- both lcds work correct
- GM328A module - works correct, cause it behaves like 160x128 natively, both the lcd and the software works in bgr mode, so colors are ok too
- GM328 module - works correct, cause it reacts on hw flags (flipx, rotation and bgr), both the lcd and the software works in bgr mode, so colors are ok
1.13k compiled by me
- LCD_SCREEN_ROTATE defined, so command is MEMADDRCTRL = 0x3C (hw_rotation + hw_bgr),
- GM328A module - works correct, cause it doesn't react on hw_rotation flag, colors are ok
- GM328 module - x-flipped, cause there is no hw_flipx flag, colors are ok
1.42m
- added CS bitbanging between bytes
- defined as 128x160
- without any lcd flags like rotate, flip
- lcd_bgr defined, but not my soft bgr
- GM328A module - the display area is clipped to 128px, cause there is no rotation flag, but orientation is ok, colors are bad, cause it works in bgr mode, soft is in rgb
- GM328 module - lack of hw flags except bgr, so bad orientation, colors are bad, because it reacts on hw_bgr flag
and now without lcd_bgr flag
- GM328A module - display area and orientation is like before, colors are bad, cause it works in bgr anyway.
- GM328 module - bad orientation, colors are ok
As i said before, GM328A module doesn't react at all on command 0x36.