Ah. I wasn't aware of that. I may be able to resolve this and the dirty rects at the same time. The original engine code stores modified rects, but I never used them, because they were passed into SDL_UpdateRects; it was easier to ignore that and do direct screen updates.

If I read the situation right, we essentially need another off-screen 'surface buffer' to use rather than the lock/unlockScreen calls. I can then use the existing calculated dirty rect list to copy the affected rects to screen with correct pitch, and help speed up rendering at the same time.