OK, let me see if I understand this correctly.
lens_get_focus_pos:
On vxworks, calls GetFocusLensSubjectDistance. On dryos calls a function which is named GetCurrentTargetDistance but is functionally equivalent to GetFocusLensSubjectDistance.
Sig update gives makes an alias for this on dryos so the wrapper can be generic. Actual behavior is not changed.
Yes.
lens_get_focus_pos_from_lense:
On vxworks, calls GetFocusLensSubjectDistanceFromLens.
On dryos used to call GetCurrentTargetDistance, which is not a compatible value.
Patch adds the correct function, meaning this function can be generic
Yes, on DryOS, this function wasn't previously identified, so I suppose GetCurrentTargetDistance was substituted (which basically give a lens to focal plane distance of 0)
If the patch can find the function for all DryOS dumps, then it can be made generic. I did find it for all three reference dumps.
Bonus question: what's a lense ?
Yes I noticed that. Just left as is for now. But can correct for a diff patch...
edit:
GetFocusLensSubjectDistanceFromLens existed in previous dryos ports, but referred to an eventproc function that printed the value rather than returning it.
I'm not sure actually the function actually returned, I didn't check too deep. This function does exist in VXWorks as well, it is actually what helped me find the real function entry points.
lens_get_target_distance:
currently unused.
On vxworks it calls GetCurrentTargetDistance, which is not the same as GetFocusLensSubjectDistance (what's the difference ?)
It's similar.
All GetCurrentDistance does in VXWorks is call GetFocusLensSubjectDistance and do a left/right logical shift operation:
From A570 101A
FFE083E8: E52DE004 STM {LR} FD SP!, ; (STR LR, [SP, #-4]!)
FFE083EC: EB01A603 BL FFE71C00 (-----> GetFocusLensSubjectDistance )
FFE083F0: E1A00800 LSL R0, R0, #0x10
FFE083F4: E1A00820 LSR R0, R0, #0x10
FFE083F8: E49DF004 LDM {PC} FD SP!, ; (LDR PC, [SP], #4)
On dryos, it calls the a function equivalent to vxworks GetFocusLensSubjectDistance
The patch keeps the existing behavior. These already used the same name on vx and dryos, so can be generic too. If the actual function needs to be corrected, the alias to GetFocusLensSubjectDistance can be removed.
The sigs I submitted will keep the existing behavior as I have basically duplicated the entry point for both.
To be truly generic, the best option would be to use GetFocusLensSubjectDistance for both VXWorks and Dryos and drop GetCurrentTargetDistance (or rename GetFocusLensSubjectDistance to GetCurrentTargetDistance in VXWorks if we like the name). There wouldn't be much work to do this and would mean largely cleaning out a lot of the current model-level wrappers.c for a unified function in the generic wrappers.c. (there are a few additional items in some of the model-level wrappers still, so they can't be cleaned out completely yet.)