setting zoom & being able to use the zoom buttons - General Discussion and Assistance - CHDK Forum supplierdeeply

setting zoom & being able to use the zoom buttons

  • 13 Replies
  • 4696 Views
*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
setting zoom & being able to use the zoom buttons
« on: 29 / November / 2008, 19:23:56 »
Advertisements
This is about the shooting_set_zoom(x); function. i am working on a zoom-override feature (as you may know) and i got one problem: whenever i zoom in from wideangle or zoom out from full tele using this command, the camera itself doesnt "know" that i changed the zoom. that's why i can't use the zoom IN button anymore after using this command (when i used the command to zoom OUT from full tele). i hope y'all understand me.

how to overcome this? is there a function to make the camera "refresh" itself?
this would benefit the ubasic/lua command, also the edgeoverlay_load feature and of course the planned zoom override.
i was thinking along the lines of:
when zoom is at 0 and you want to zoom to 8 for example, emulate pressing of the zoom_in button for a short amount of time, then zoom fully to 8. this would allow to use the zoom_out button to zoom out again. but this is not really fast, besides i couldnt even get this to run :D

any ideas?

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: setting zoom & being able to use the zoom buttons
« Reply #1 on: 13 / December / 2008, 05:11:57 »
anybody?

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: setting zoom & being able to use the zoom buttons
« Reply #2 on: 13 / December / 2008, 06:09:05 »
Try this before end of lens_set_zoom_point():

    if (newpt==0) zoom_status=ZOOM_OPTICAL_MIN;
    else if (newpt >= zoom_points) zoom_status=ZOOM_OPTICAL_MAX;
    else zoom_status=ZOOM_OPTICAL_MEDIUM;

This works on A710.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: setting zoom & being able to use the zoom buttons
« Reply #3 on: 13 / December / 2008, 06:55:04 »
thanks! will try that. i guess this can then be applied to the trunk.


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: setting zoom & being able to use the zoom buttons
« Reply #4 on: 13 / December / 2008, 16:51:42 »
this works on a620. However, on s3is it doesnt. Reason: zoom_status isnt defined.
I think you added zoom_status to stubs_min.S for all the cameras you implemented CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO for.
Can you add these for the cameras which don't need unlock optical zoom in video as well?
then we could implement your code snippet from above.
Like i said, on a620 it works, i can use shooting_set_zoom and after executing it i can use the zoom_lever.
thanks, ewavr!

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: setting zoom & being able to use the zoom buttons
« Reply #5 on: 13 / December / 2008, 18:33:39 »
However, on s3is it doesnt. Reason: zoom_status isnt defined.
Code: [Select]
ROM:FF9D31A4                 LDR     R3, =0x7BCC
ROM:FF9D31A8                 LDR     R0, =a_zoomstateD ; "_ZoomState            :%d",0xA,0
ROM:FF9D31AC                 LDR     R1, [R3]     
ROM:FF9D31B0                 BL      printf       
Very easy to find for any camera. :)
Quote
Can you add these for the cameras which don't need unlock optical zoom in video as well?
then we could implement your code snippet from above.
Oh, no!
Maybe, in far future....

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: setting zoom & being able to use the zoom buttons
« Reply #6 on: 13 / December / 2008, 18:43:41 »
hm, i'm still no master at asm ;)
7BCC is the adress for s3is, i just confirmed that, not by looking at the code, but by testing it in camera ;)

and what do you mean about the "far future" thing? the adresses for zoom_status?
maybe you misunderstood me, i dont want unlock optical zoom for the cameras with movie button, only the zoom_status ;) so looking in IDA for string like a_zoomstateD should suffice, eh?

or did you mean by "oh no!" that i should not comitt your code to lens_set_zoom_point():? it works on your camera, it works on a620, it works on s3is...
« Last Edit: 13 / December / 2008, 18:45:22 by PhyrePhoX »

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: setting zoom & being able to use the zoom buttons
« Reply #7 on: 13 / December / 2008, 19:02:58 »
I don't like to find/verify this variable address for all 42+ supported cameras...


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: setting zoom & being able to use the zoom buttons
« Reply #8 on: 13 / December / 2008, 19:07:45 »
okay, i will try to do it. maybe fudgey or/and reyalp can help ;)

*

Offline reyalp

  • ******
  • 11900
Re: setting zoom & being able to use the zoom buttons
« Reply #9 on: 13 / December / 2008, 19:23:39 »
Someone should write a tool to extract interesting addresses/constants based on sigs. Should be pretty straightforward to build on gensig/finsig.

This wouldn't just solve the immediate problem, it would make porting easier and make a whole bunch of stuff easier to maintain. Would be more fun than digging through 40 dumps in ida too!

0000105: metabug for gensig / finsig improvements - CHDK Bugtracker
Don't forget what the H stands for.

 

Related Topics