Retract Lens via poke - how can we find the address? - LUA Scripting - CHDK Forum

Retract Lens via poke - how can we find the address?

  • 8 Replies
  • 7373 Views
Retract Lens via poke - how can we find the address?
« on: 13 / January / 2013, 08:19:03 »
Advertisements
Some time ago I've found this trick from Ewavr:

@leedsgreen:

your script for a710:

poke(0x7C8BC, 0)

Don't forget call poke(0x7C8BC, 1)  before camera power-off, otherwise camera will be powered off with extended lens :).

Now the questions is... how can I find those memory address for other cams? I did take your example and tried to find the "7C8BC" on the Strings.txt from the a710's dump file. But there is no that address there. :(

I have two cameras S3- IS and S95 and I want to make the same poke to retract/expose the lens.
Does somebody could help me?

Cheers!
« Last Edit: 13 / January / 2013, 18:16:35 by Playmobil »

*

Offline srsa_4c

  • ******
  • 4451
Re: Retract Lens via poke - how can we find the address?
« Reply #1 on: 13 / January / 2013, 09:18:43 »
Some time ago I've found this trick from Ewavr:

@leedsgreen:

your script for a710:

poke(0x7C8BC, 0)

Don't forget call poke(0x7C8BC, 1)  before camera power-off, otherwise camera will be powered off with extended lens :).
I have ... S3- IS
For the S3IS 1.00a, the address appears to be 0x72de4. Found by visual comparison of the A710 and S3 firmware disassemblies. Tool used: disassemble.pl.
The S95 is a different story, it's too new for the above (compare) method to work.

Re: Retract Lens via poke - how can we find the address?
« Reply #2 on: 14 / January / 2013, 09:22:47 »
For the S3IS 1.00a, the address appears to be 0x72de4. Found by visual comparison of the A710 and S3 firmware disassemblies. Tool used: disassemble.pl.
The S95 is a different story, it's too new for the above (compare) method to work.
Hi srsa_4c, that's cool!
But I'm still confuse...
...could you explain why those memory address do not match the "Strings.txt" ones from the zip dump files?

*

Offline srsa_4c

  • ******
  • 4451
Re: Retract Lens via poke - how can we find the address?
« Reply #3 on: 14 / January / 2013, 10:20:20 »
But I'm still confuse...
...could you explain why those memory address do not match the "Strings.txt" ones from the zip dump files?
It's because strings.txt only contains parts of the firmware dump which look like text, whereas the address in question is a 32bit number.

And some correction:
The address we're talking about holds the "is the lens out?" flag for the camera. If it's 0, the camera thinks the lens is in, so it won't retract the lens when it should. You can't make the camera retract the lens by setting it, so my finding won't do what your thread title asks. It's for what the original thread mentions: (Lua) Script to disable lens retract


Re: Retract Lens via poke - how can we find the address?
« Reply #4 on: 14 / January / 2013, 15:27:21 »
Srsa_4c, thanks by your explanations!

And some correction:
The address we're talking about holds the "is the lens out?" flag for the camera. If it's 0, the camera thinks the lens is in, so it won't retract the lens when it should. You can't make the camera retract the lens by setting it, so my finding won't do what your thread title asks. It's for what the original thread mentions: (Lua) Script to disable lens retract
Now I'm asking myself how te guy on that thread said he got it working...   ???

*

Offline srsa_4c

  • ******
  • 4451
Re: Retract Lens via poke - how can we find the address?
« Reply #5 on: 14 / January / 2013, 16:14:36 »
Now I'm asking myself how te guy on that thread said he got it working...   ???
I'm not quite following.
- You can make the camera retract or extend its lens by simply switching it to play or record mode. There's a setting called "Lens Retract" in the Canon menu, you can set it to 1 minute or 0 second. However, the original thread is about preventing lens retraction after a rec -> play mode switch.

- The issue here is that, for some people (maybe including you), the one minute lens retract delay is not enough. The method we're talking about should take care of that, by making the camera believe that its lens is already retracted.

Re: Retract Lens via poke - how can we find the address?
« Reply #6 on: 15 / January / 2013, 09:53:50 »
- The issue here is that, for some people (maybe including you), the one minute lens retract delay is not enough. The method we're talking about should take care of that, by making the camera believe that its lens is already retracted.

Hi Srsa_4c, now I got it. Thanks!
Yes, I need to disable the retraction but also need to "retract/show" the lenses by command at any time. I can't turn off the camera for retracting it and also I'm trying to do it without waiting for the retracting by time.

Following your explanation, looks like I need to set a minimum value for the retraction by time. So, by setting the... ...let's call it "Lens Retracted Status" to "1" so it will stay exposed. So when I set it to "0" it will naturally retract by time until I send another command for exposure or shooting. If that is possible sounds really good.

*

Offline reyalp

  • ******
  • 14118
Re: Retract Lens via poke - how can we find the address?
« Reply #7 on: 15 / January / 2013, 16:36:10 »
Quote
I can't turn off the camera for retracting it and also I'm trying to do it without waiting for the retracting by time.
You may be able to use the StoreLensForShutDown eventproc to retract the lens, see http://chdk.setepontos.com/index.php?topic=6857.msg73227#msg73227

edit:
Note IsLensExtend (mentioned in earlier discussion) is also an eventproc for some cameras, which may help finding the status variable. I don't see this for s95, but I do see IsLensOutside and SetLensOutsideFlag
« Last Edit: 15 / January / 2013, 16:43:12 by reyalp »
Don't forget what the H stands for.


Re: Retract Lens via poke - how can we find the address?
« Reply #8 on: 15 / January / 2013, 20:18:44 »
Hi Reyalp, many thanks by all the tips!

The eventproc sounds like a powerful resource.
I'll explore it on both S95 and S3is.  ;)

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal