# How to add a patch to “Marlin_main.cpp”?

According to this question, MKS 12864OLED Display setup, I need to add a patch to "Marlin_main.cpp" but this a large file with 14789 lines of code! I don't know where I have to put this patch. Please help me.

patch:

/*---------------MKS OLED patch_3-----------------------*/
#if defined (MKS_OLED96_128x64_FULL_GRAPHICS_CONTROLLER)
pinMode(LCD_PINS_DC, OUTPUT);
pinMode(LCD_PINS_RST, OUTPUT);
digitalWrite(LCD_PINS_RST , LOW);
delay(1000);
digitalWrite(LCD_PINS_RST , HIGH);
#endif
/*---------------MKS OLED patch_3-----------------------*/

• The question you refer to has an incorrect answer, I've investigated it but never got the time to post a proper answer. If I recollect correctly, the latest version is not compatible with the suggested fix. Parts are already implemented in the code. When I have the time I will look into the problem again and post an answer. Note that I do not own such a display. – 0scar May 4 '19 at 21:02
• I don't know how to thank you. thanx 10^6. – 2012User May 4 '19 at 21:06
• I did post an answer on Connecting OLED 128x64 LCD; dogm_lcd_implementation.h is missing for patching. I guess that is part of the solution. Do note that we are active on 3D Printing Chat! – 0scar May 4 '19 at 21:11
• Yes, thank you. but it's not working yet. I guess the patch for "Marlin_main.cpp” is needed too. – 2012User May 4 '19 at 21:16
• Please join in 3D Printing Chat to prevent a long comment discussion. I'll be looking into it tomorrow. – 0scar May 7 '19 at 9:51