I believe I have found the "GetFocusLensSubjectDistanceFromLens()" function in the SX10 103a at address FF93A6B8.
Good find, discussion is worth it just for that
Thanks. Further to this, I believe a couple of the other related functions have incorrect pointers/signatures for DryOS (at least relative to their VXWorks counterparts)
These are for SX10 103a in particular:
NSTUB(GetCurrentTargetDistance, 0xff93a3ac)
I believe that this is actually the entry point for the vxworks equivalent function "GetFocusLensSubjectDistance". It is a much larger function in DryOS than VXWorks, but has the same general idea (and is referenced in a similar manner which is how I tracked "GetFocusLensSubjectDistanceFromLens" down)
I believe the actual entry point for GetCurrentTargetDistance is at FF8C8E14 which is a function similar in structure to that of VXWorks.
NSTUB(GetFocusLensSubjectDistance, 0xffa63098) ---->incorrect?
This is the current entry used, but, as referred to in the code, it returns a string and has hence been disabled (With GetCurrentTargetDistance being substituted). See above.
Making these two alterations to the code seems to operately properly, or at least in the same manner as similar operations in VXWorks.
I don't think that there is a big deal in these two functions being incorrect other than for consistency with VXWorks function. As both seem to return the same number (GetCurrentTargetDistance actually calls GetFocusLensSubjectDistance and does a little extra processing on the result, on VXWorks it is a simple LSL/LSR operation, on DryOS it does some additional checking which I haven't really parsed out).
Restoring all three of these function entry points to be consistent would enable the code that is currently in the "wrappers.c" files for each individual camera model (this is the only code in them) to be moved to "generic/wrappers.c" and remove the duplication.