Patch to add support for the 32bpp bitmap display on the G5X.We now have 8bpp bitmaps (pre Digic6), 32bpp (G5X) and YUV (Digic6 except G5X).Because gui_draw.c was becoming an #ifdef nightmare I split the code that is specific to the different bitmap types into new files (gui_draw_8bpp.c, gui_draw_32bpp.c and gui_draw_yuv.c), and cleaned up gui_draw.c.Tested on 8bpp cameras and G5X; but I don't have a YUV bitmap camera so I can't test if I've broken anything (code compiles ok).
Quote from: philmoz on 28 / April / 2019, 00:27:28Patch to add support for the 32bpp bitmap display on the G5X.We now have 8bpp bitmaps (pre Digic6), 32bpp (G5X) and YUV (Digic6 except G5X).Because gui_draw.c was becoming an #ifdef nightmare I split the code that is specific to the different bitmap types into new files (gui_draw_8bpp.c, gui_draw_32bpp.c and gui_draw_yuv.c), and cleaned up gui_draw.c.Tested on 8bpp cameras and G5X; but I don't have a YUV bitmap camera so I can't test if I've broken anything (code compiles ok).I tested this on my sx280 (640x480 screen), see attached screenshots. RBF codepath drawing built-in font is broken and modules also get bad font(?) size information. Cam was started with config files removed.
Did you do this as a clean build or had you previously built an 8bpp version?
QuoteDid you do this as a clean build or had you previously built an 8bpp version?The thumb2 firmware object files should be totally separate from the other cams, in .o2 rather than .o. So if building non-thumb2 before hand has an impact, something is really broken. THUMB_FW dependent ifdefs currently appear in "platform independent" code, because it's a totally separate binary. If G5X / 32bpp needs additional defines in code that was previously under THUMB_FW ifdefs in "platform independent" code, that will need to be addressed. Using THUMB_FW as a shorthand for all the various differences associated with digic 6 was obviously going to run into differences *between* those cams eventually (but IMO the right choice at the time to get something working).I haven't had a chance to look at the patch yet, will try to do that soon.
If we want all builds of a given instruction set to run on all cameras, we may need to build different modules for different display types and choose at runtime.
I think I asked this before but why don't we just keep the original FONT_WIDTH and FONT_HEIGHT and use the ASPECT_CORRECTION stuff to take care of the differences. This already translates X co-ords for cameras with 640, 720 or more wide screens. We don't currently have code to handle Y scaling; but adding that would then bring everything back to the original CHDK 'virtual' screen size of 320/360 x 240/270.
Quote from: reyalp on 29 / April / 2019, 01:44:15If we want all builds of a given instruction set to run on all cameras, we may need to build different modules for different display types and choose at runtime.Or, build both display library and only link the one that the port needs (yuv or 32bit). Or, build the display lib as part of platform code.Quote from: philmoz on 28 / April / 2019, 23:12:08I think I asked this before but why don't we just keep the original FONT_WIDTH and FONT_HEIGHT and use the ASPECT_CORRECTION stuff to take care of the differences. This already translates X co-ords for cameras with 640, 720 or more wide screens. We don't currently have code to handle Y scaling; but adding that would then bring everything back to the original CHDK 'virtual' screen size of 320/360 x 240/270.Not sure if that's what you mean, but I explained here why I didn't like the 320x240 resolution that many D6 ports would get.Worth to note that 640x480 models have a 720x480 resolution RGBA surface, and drawing there would eliminate the need for the font scaling / aspect correction.
Using the 32bpp RGBA bitmap would simplify things - are you sure it's 720x480
(the G5X is 720x240)
Quote from: philmoz on 29 / April / 2019, 17:43:00Using the 32bpp RGBA bitmap would simplify things - are you sure it's 720x480Yes, see attachment. It's from a RAM dump, shows the two consecutive rgba buffers.Quote (the G5X is 720x240) Can you show a similar "screenshot" of the buffer?