An explanation of this DIGIC 6 display "rework".
What it provides:
Display a big default font that is approximately same size as on previous DIGIC cams.
This is achieved by upscaling the original 8x16 font to 14x32. The 8 -> 14 conversion allows keeping the aspect ratio and provides 45 characters in a row (which is what cameras with 4:3 LCD used to have).
The font remains stored in its original 8x16 format.
The real display resolution is used.
Historically, supported Powershots started with an overlay of 360x240 pixels. Horizontal resolution was doubled in later camera generations, for which CHDK was adapted by writing double pixels. That has not changed further until the appearance of DIGIC 6.
I felt that halving the CHDK overlay resolution yet again is not the way to go, even if it's simpler to do.
Unfortunately, the CHDK drawing architecture relies heavily on paletted display where one pixel corresponds to one byte.
This patch therefore has to translate one byte colors to yuv chroma and luma values (plus opacity).
Pros:
- Default font is "normal" size again, should be more readable.
- Drawing is accelerated for the default font. Over 19000 (14000) chars/second according to benchmark - lower value is for drawing with unaligned (odd) starting position.
- OSD icons (battery, USB symbol, etc) are doubled (in each direction).
- CHDK menu and other UI elements fit on screen like they used to on previous camera generations.
- Palette is still computed, but almost all required CHDK colors are available.
- OSD elements can be set to use the unscaled "mini" 8x16 font, using the OSD editor.
- ...?
Cons:
- The 8 -> 14 translation introduces a distortion that changes the font's look somewhat.
- Accelerated drawing bypasses the old drawing infrastructure. Pixels of the default font are no longer drawn by a single pixel drawer routine. This is a very unfortunate loss, but I found no better way to improve the sluggish drawing speed.
- Drawing function replacement is ineffective for font drawing. It was only used by the zebra module. The new zebra code (made by 62ndidiot) does not use it.
- Accelerated routines (those with "simple" in their name) rely on global variables for current buffer addresses and foreground and background colors. This makes drawing even less thread safe (but I can't imagine it causing memory corruption).
- The new routines used by the new D6 zebra code "stand out", as they draw yuv colors directly, rather than CHDK ones. This is actually a change introduced by me.
- One of the D6 zebra specific new routine uses two stubs directly in core. This would be unsafe on ARM firmware, but doing so provides lower overhead and is safe on D6.
- The three D6 zebra specific functions are exported and require dummies on pre-D6 ports. This is an unfortunate overhead - the module specific tools would need to be changed to allow skipping nonexistent exports.
- The current D6 zebra can't display the histogram (those menu options are ignored).
- The new histogram (62ndidiot's work) has an inappropriate default position (not completely visible). Should be fixable.
- The CHDK boot logo doesn't display correctly, the bitmap part is unscaled and misplaced. Should be fixable.
- Some games use direct coordinates expecting 8x16 fonts - they look mostly unusable.
- ...?
The patch also contains a fix for a bug introduced with the (relatively recent) rotated OSD functionality. Just check what the file reader does when OSD is rotated.
62ndidiot's zebra, histogram and motion detection fixes are included, as noted above.
The patch does not support D6 ports other than my two, but the changes made to the M10 port should tell what to do (palette and two stubs).
BTW, I did not do this work to let it become buried here and forgotten. I'd like to hear others' opinions: should this go official, and if so, should parts of it change or not.
The alternative patch can be found earlier in this thread (the lo-res one).
edit:
I have doubts about the attachment download counter. It jumped to one right after posting (in a few seconds). A google-bot maybe?