Thank you for your response. 😀
I don't use "edge overlay", so i don't know if it crashes. But i can test it.
I tested zebra with all that games an calender stuff for the last weeks without crash.
By the way "zebra blink mode" doesn't work with this changes.
The real "dirty" hack lies in lib.c:
I find out, that every call of the sequence "_LockAndRefresh..." in vid_bitmap_refresh() toggles "flickering" to "non flickering". But vid_bitmap_refresh() is not only called from zebra-code, there are many other functions calling it.
And with every call flickering changes. So i looked for a solution in vid_bitmap_refresh() itself.
Also isn't that loop in lib.c just executing the body 2 times, in which case it can be rewritten more clearly?
The curious construct doesn't means to call the function twice, it means to call the function allways in "even" (non-flickerink) numbers. I used your code with some changes and more explications. I hope now it's better understandable what i mean.
Please try it with the changes above. I think now it doesn't flickers.
- Also, I think this patch includes changes about an unrelated bug, about how the clock works in zebra mode. I think it is the issue documented on th
SX20 wiki page by f_m_b. Is that right?
You are right: The other change is the bug fix of that issue.
- The code can be cleaned up here and there, some #ifdefs are redundant and clutter code without use, if(conf.show_clock) is tested twice (typo?).
The double condition "if(conf.show_clock)" is paranoia-code and quite needless. 😉
Based on the points above, I supply this cleaned up version of zebra_1.patch. Could you f_m_b please check if it is ok? Is it what you wanted or did I make some mistake somewhere?
- buildconf.inc. You are right. With the crashes using "edge overlay" the memory of games are to expensive. (in camera.h the games are allthought disabled.)
- gui_osd.c
- I think we need the #if ... #endif around free(buf). vid_get_bitmap_fb() gives us not a copy of this memory, so we are not the owner of it and don't have to free it? I'am right?
- I think we need the statement "buffer_size=screen_buffer_size-ZEBRA_HMARGIN0*screen_buffer_width;" in gui_osd_zebra_init(), because later there are memset-operations with this value. What is the size of the memory of vid_get_bitmap_fb? What do you think about it?
-Makefile 102b and 102d activated. What about 100f?
-lib.c I used your code with some changes and more explications.
I think the rest of your changes are ok. Thanks a lot.
zebra_2.patch