Doing some reverse engineering of the LCD as I don't trust unknown 3rd party source code without knowing where they came from and more important how they got it and what LCD are they for. Some of the low level settings are for a specific LCD type.
Anyway, this is a quick test without the proper timing delays modified from my own Nokia 5110 LCD code. That's a good start.
Detail waveforms here: https://hw-by-design.blogspot.com/2018/08/portable-f103-lcd.html
Main project page: https://hw-by-design.blogspot.com/2018/08/portable-stm32f103.html
Sadly it is a blogging site, not project oriented.