Hi,
I've just got an A2200 100D for a friend and played a bit with it. Here's a small contribution for the CHDK port, which fixes:
- edge overlay after you take a picture
- zebra and histogram when the AF zoom box is active
void *vid_get_viewport_live_fb() {
// DIGIC mirror at 0x380000, EDMAC channel #4, register 0xC0F04408
void* y411_buffer_being_updated_by_edmac = (void*)(*(volatile int*)0x384408);
// note: y422 buffer is at EDMAC #0 (0xC0F04008), but CHDK seems designed for y411 only
// the same EDMAC channel is used for the little "magic zoom" box, which screws up our plans a bit
int buffer_size_flags = (void*)(*(volatile int*)0x384410);
int is_magic_zoom = ((buffer_size_flags & 0xFF0000) == 0x770000);
// it's a good idea not to use the buffer that is being updated, but a previous one, which was fully updated
static void* bufA = 0;
static void* bufB = 0;
// internally it's triple buffered, but we don't really care about all 3 buffers
// static void* bufC = 0;
if (bufA != y411_buffer_being_updated_by_edmac && !is_magic_zoom)
{
// bufC = bufB;
bufB = bufA;
bufA = y411_buffer_being_updated_by_edmac;
}
return bufB;
}
void *vid_get_viewport_fb() {
return vid_get_viewport_live_fb();
}
Enjoy!