All we need is someone to come up with a coherent, consistent way to do it that doesn't require special code for each camera.
I need to research it a little more for specific cameras, but I think all you need is the difference in sv96 between "real" and "market". In my cameras, it is 59. Using my new functions, sv96_to_iso() and its inverse, here's how I do it in my script:
press_half() -- includes wait for get_shooting()
sv=get_sv96() -- real
svdiff=iso_to_sv96(get_iso_market())-sv -- real to market difference
svmin=iso_to_sv96(s)-svdiff -- min sv ISO 100 market default
svmax=iso_to_sv96(z)-svdiff -- s and z are script input parameters
-- to output market ISO from sv96, you do this:
sv=411 -- test
print(sv96_to_iso(sv+svdiff)) -- prints market ISO
It seems to work if I set the camera to ISO 100 before starting the script. If I set it to ISO 3600, the real sv96 is off, and the svdiff isn't 59. I think this may be an error in the current get_iso_market or get_sv96().
This should be true for real or market ISO, shouldn't it?