Landscape Focus Bracketing Script - page 22 - Completed and Working Scripts - CHDK Forum

Landscape Focus Bracketing Script

  • 247 Replies
  • 47860 Views
Re: Landscape Focus Bracketing Script
« Reply #210 on: 08 / August / 2021, 05:55:05 »
Advertisements
@c_joerg

Quote
Maybe you could update your script to 121a.

The script is already 121a ready, so the latest version should run ok.

The only a vs f issue is lens focus.

Obviously, let me know if it doesn’t work and I’ll fix it.

Also, let me know if you don’t get the script ;-), as I wrote it for my use.

Cheers

Garry
« Last Edit: 08 / August / 2021, 05:59:57 by pigeonhill »

Re: Landscape Focus Bracketing Script
« Reply #211 on: 08 / August / 2021, 06:01:57 »
@c_joerg

Forgot to say, you need to load the philmoz XIMR version from https://drive.google.com/drive/folders/1drk1xi6kMMIeF5xSqXgnpjGCffF8CVkd

*

Offline c_joerg

  • *****
  • 1248
Re: Landscape Focus Bracketing Script
« Reply #212 on: 08 / August / 2021, 07:05:45 »
The script is already 121a ready, so the latest version should run ok.

Version from 07.08.21 did not include 121a

example:

Code: [Select]
function get_focus_distance_lower() -- returns lower focus distance in mm, but note 'accuracy' is 1cm from Canon
    local x = -1
    if (bi.platsub == "101a") then
        x = peek(0x00244918, 2)
    elseif (bi.platsub == "120f") then
        x = peek(0x0024495C, 2)
    else
        error('Not 101a or 120f')
    end
    if x == -1 then return -1 else return x*10 end
end
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

Re: Landscape Focus Bracketing Script
« Reply #213 on: 08 / August / 2021, 07:16:12 »
@c_joerg

Sorry, didn’t spot that.

Do you know the peek values?

If you do, I’ll update the script.

Cheers

Garry


*

Offline c_joerg

  • *****
  • 1248
Re: Landscape Focus Bracketing Script
« Reply #214 on: 08 / August / 2021, 07:21:13 »
Do you know the peek values?

For focus you found values in my script
https://chdk.setepontos.com/index.php?topic=13756.0

for get_lens_name_fn I don't know...
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

Re: Landscape Focus Bracketing Script
« Reply #215 on: 08 / August / 2021, 07:38:26 »
@c_joerg

Quote
for get_lens_name_fn I don't know...

I guess we need to wait until someone can get me the peek code for the 121a to put here:

Quote
local get_lens_name_fn = 0xfc2f3fd5
 if (bi.platsub == "101a") then get_lens_name_fn = 0xfc2f3fc3 end

@reyalp  or @philmoz can you help?

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Landscape Focus Bracketing Script
« Reply #216 on: 08 / August / 2021, 18:08:43 »
I guess we need to wait until someone can get me the peek code for the 121a to put here:


For 1.21a the address would be 0xfc2f4005


However you could simplify your lens_name function by accessing the values directly in memory.
Code: [Select]

function lens_name()
    local pname = 0x002449ad
    if (bi.platsub == "101a") then pname = 0x00244969 end
    local len = peek(pname-1,1)
    local i = 0
...


If you decide to stay with the function call and local memory alloc in lens_name then you should probably fix the tests after the call to FreeMemory. After calling FreeMemory on ppname value you then test the ppname value (which had already been done earlier) - this test should probably be on the pname variable instead.


Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Landscape Focus Bracketing Script
« Reply #217 on: 09 / August / 2021, 00:48:57 »
@philmoz

Many thanks for the 1.21a address.

Quote
However you could simplify your lens_name function by accessing the values directly in memory.


I’m afraid I won’t know how to do this.
« Last Edit: 09 / August / 2021, 00:59:23 by pigeonhill »


*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Landscape Focus Bracketing Script
« Reply #218 on: 09 / August / 2021, 00:59:46 »
I’m afraid I don’t have the knowledge or wherewithal to take this approach, so, for now, I’ll just add the address to the function that is already there. I’m also not clear what you were suggesting regarding FreeMemory.


The code I included replaces lines 187 - 205 in your script.


In your script line 204 is a duplicate of line 195 and IMO should be testing the value of pname not ppname.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Landscape Focus Bracketing Script
« Reply #219 on: 09 / August / 2021, 01:25:57 »
Quote
In your script line 204 is a duplicate of line 195 and IMO should be testing the value of pname not ppname.

Yes, I spotted that just after posting, but we crossed in our postings, ie I withdrew my commit and you commented on it ;-)

I'll rework my script now.

Many thanks.

Garry

 

Related Topics