Instead of repainting the entire screen every time, calculate the deltas between two framebuffers and display the difference. This could be done by modifying the existing display function or making a new function to update a framebuffer with deltas.
This may have a threshold value where it becomes less efficient to do deltas rather than repaint the screen (for instance when there is a lot that changes). This could be done by counting the number of pixel deltas and once it reaches a certain level, it just stops and dumps the framebuffer as is.
The screen should also be entirely repainted once in a while to make sure that glitches do not stick around long.
Instead of repainting the entire screen every time, calculate the deltas between two framebuffers and display the difference. This could be done by modifying the existing display function or making a new function to update a framebuffer with deltas.
This may have a threshold value where it becomes less efficient to do deltas rather than repaint the screen (for instance when there is a lot that changes). This could be done by counting the number of pixel deltas and once it reaches a certain level, it just stops and dumps the framebuffer as is.
The screen should also be entirely repainted once in a while to make sure that glitches do not stick around long.