Connection of KS0108 display with arduino mega or ESP32

I recently brought this Ks0108 128x64 lcd display. I also installed the openGLCD library. BUT i couldnot find any pin connection diagram with arduino mega or esp32. Can anyone please give me proper guidance of how to hook it up with arduino and run graphics . And will the display work with esp32? If yes then what are the steps?

Thanks in advance

I found this for you: AVR-KS0108/Demonstration.png at master · efthymios-ks/AVR-KS0108 · GitHub

It's not for a Mega but should be easy to "translate".

You should connect D0~D7 and CS1~CS2 .
Rw does not require an connection.
It is a parallel controller.
Use the potentiometer to connect VLCD, V0 and GND to control the contrast.
I recommend using U8G2 libraries .
U8G2_KS0108_128X64_F u8g2(U8G2_R2, D0, D1, D2, D3, D4, D5, D6, D7, EN, CS1, CS2, RESET);