So I've been looking into the overdraw issues--specifically, how the CHDK menu gets clobbered by the focus rectangle and other Canon UI elements.
I tried copying functions from other cameras' implementations of lib.c. Most of those were disastrous--specifically, those that did stuff like this:
_ScreenLock();
_RefreshPhysicalScreen(1);
... prevented Canon UI elements from working at all, from the moment you enter Alt mode. Pressing the Menu key, for instance, froze the live view, but did not show the menu. (This code aligns with the
wiki page that says _RefreshPhysicalScreen and _ScreenUnlock are the same function; on this camera, they do not appear to be.)
The wiki page also indicates that we may need to implement vid_turn_on_updates() and vid_turn_off_updates() to prevent this from happening. (Why don't all ports implement these?

)
Just adding these implementations:
void vid_turn_off_updates()
{
_ScreenLock();
}
void vid_turn_on_updates()
{
_ScreenUnlock();
}
... prevents the overdraw problem, but the screen fails to refresh after exiting the CHDK menu. That is, the menu is still visible after it's dismissed.
So I tried replacing vid_refresh_bitmap() with the following (keeping it simple):
void vid_bitmap_refresh()
{
_RefreshPhysicalScreen(1);
}
And that seems to do the trick. However, the camera feels less responsive. The menu feels a little sluggish... maybe I'm imagining that? I know I'm not imagining the fact that Canon's UI totally freezes not just when the CHDK menu is up, but during all of Alt mode ... that in itself feels a little suboptimal.
I've never used CHDK on another model camera, so I really don't have an idea how smooth it should be.
In any case, I've attached some builds so others can try this out and provide feedback.