Here's some "blind" cleanup and notes
Cleanup
* put capt_seq and filewrite code under #ifdefs. I like to have these off in autobuilds, because the log strings could make it more obvious CHDK was used (though a romlog would probably be a pretty obvious clue anyway).
* lib.c remove hook_raw_size (not used in modern CHDK) and gps related functions
* remove bin_comp_fix.h. Values generated by the normal process should be OK
I can check this in if you can confirm it still works correctly.
Other notes below. I'm *not* saying you need to fix / address all of these, or criticizing your work. It's just a list of what I noticed as I tried to review the port.
* It's a good idea to try to track down which settings the raw buffer address is actually valid for. People will probably mostly use native raw, but raw hooks still depend on a valid buffer being available. Users might also be tempted to use DNG in when Canon settings do not allow Canon raw, and using DNG with and incorrect address can result in massive memory corruption. The platform_camera.h CAM_DISABLE_RAW_IN_ defines should reflect the actual modes on the camera, adding to the core if needed.
* CAM_DNG_LENS_INFO is defined in platform_camera.h, but obviously correct values depend on the lens. The implications of this should be looked into.
* CAM_SD_OVER_IN_AF and MF are defined. Do subject distance overrides actually work on this camera?
* CAMERA_MIN_DIST / CAMERA_MAX_DIS are defined. Are they really correct? Are they lens dependent ?
* If the Canon firmware does DFS, dark frame control can probably be done like g7x, (
https://chdk.setepontos.com/index.php?topic=12714.msg133735#msg133735)
* In lib.c, vid_get_viewport_fb_d is set to a constant address. This is almost certainly incorrect some of the time. This is the viewport buffer in playback mode, so would only affect PTP live view or zebra/histogram/edge in playback.
* The modemap entries listed as "modemap entry not found in firmware" should probably be removed (unless finsig_thumb2 isn't identifying the modemap correctly). The ones listed as "In firmware but not in current modemap" should be identified and added where possible (except for C modes, which CHDK currently doesn't support). The values should also be checked (e.g. M really is 32770). This mainly affects scripts that attempt to get or set the current shooting mode, and PTP control.
* shooting.c Av table is obviously not valid for all lenses. Implications should investigated (probably minor, but would allow the non _direct version to try to set out-of-range values.)
* Do Av overrides work at all?
* Zoom related limited should be noted in notes.txt (I assume CHDK can't control zoom, there are no real zoom_in/zoom_out keys to click but other keys are mapped to them for script)