Access to CHDK menu via scripts - page 2 - Script Writing - CHDK Forum

Access to CHDK menu via scripts

  • 16 Replies
  • 3970 Views
*

Offline zeno

  • *****
  • 889
Re: Access to CHDK menu via scripts
« Reply #10 on: 31 / January / 2015, 12:30:36 »
Advertisements
@reyalp

as you may know, I've been trying to update my CHDK CFG editors for 1.3. So far things are going well, though I only discovered today that cnf_core.lua can add items that are not present in conf.c (specifically 1240 and 1250 are added). I do have a key question though. My cameras are running 1.3 and the CFG files on the cards were built by 1.3 (i.e. I didn't migrate the cards from 1.2 to 1.3, I formatted and re-installed). But when I look at the CFG files, the entries have new numbers that start at 1, not 1001). My question is, how does CHDK tell that a CFG file is using the new set of numbers and not the old, and that the '1' entry is platform_id and not 'show_osd'? Does it just look for the new short at offset 6 (which has the offset value for the entries - 1000)?

I ask because I'd like my editor to be able to tell - then I can make it backward compatible so it can process old or new CFG files.
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: Access to CHDK menu via scripts
« Reply #11 on: 31 / January / 2015, 12:40:01 »
@reyalp
fwiw ... all that new cfg code was added by philmoz
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 13457
Re: Access to CHDK menu via scripts
« Reply #12 on: 31 / January / 2015, 16:05:53 »
@Zeno
The original development discussion is in http://chdk.setepontos.com/index.php?topic=9602.30

As waterwingz said, this wasn't my work. I'm not sure what you mean by
Quote
So far things are going well, though I only discovered today that cnf_core.lua can add items that are not present in conf.c (specifically 1240 and 1250 are added)
values that don't exist in conf.c wouldn't make sense in the lua files, because they couldn't do anything (except the housekeeping values like _config_id ? 240 exists in the current conf.c core section. Make sure you aren't looking at old CHDK source, if you are using CHDKShell, it is no longer able to get the latest source from svn, see http://chdk.setepontos.com/index.php?topic=845.msg117760#msg117760

Regarding the question about the numbers, without digging into the code much the "base" value is stored in the file.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: Access to CHDK menu via scripts
« Reply #13 on: 31 / January / 2015, 17:18:18 »
@reyalp

as you may know, I've been trying to update my CHDK CFG editors for 1.3. So far things are going well, though I only discovered today that cnf_core.lua can add items that are not present in conf.c (specifically 1240 and 1250 are added).
1240 is 'allow_unsafe_io' and was added in 1.3. If it's not in your conf.c then you need to update your source.
1250 is 'disable_lfn_parser' and was added in 1.4. If it's in your cnf_core.lua file you are using 1.4 generated files.

Quote
I do have a key question though. My cameras are running 1.3 and the CFG files on the cards were built by 1.3 (i.e. I didn't migrate the cards from 1.2 to 1.3, I formatted and re-installed). But when I look at the CFG files, the entries have new numbers that start at 1, not 1001). My question is, how does CHDK tell that a CFG file is using the new set of numbers and not the old, and that the '1' entry is platform_id and not 'show_osd'? Does it just look for the new short at offset 6 (which has the offset value for the entries - 1000)?

I ask because I'd like my editor to be able to tell - then I can make it backward compatible so it can process old or new CFG files.

The ID numbers stored in the config files are from 1 - 999. The offset value(1000, 2000, 3000 etc) is stored in the header and is used to find the correct config structure from the values in 'cnf_???.lua' files.

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)


*

Offline zeno

  • *****
  • 889
Re: Access to CHDK menu via scripts
« Reply #14 on: 31 / January / 2015, 18:49:15 »
Silly me. The other day I  downloaded the trunk 3661 source of 1.2, not 1.3 or 1.4. I now see the two IDs I thought were missing.

My final question remains though. How does CHDK 1.3 tell the difference between a new CHDK file and an old one e.g. if someone just copies the new DISKBOOT.BIN onto an old card? Does it just look at the sort at offset 6 in the header?

I think that would work because in 1.3 and 1.4 it will be a 1000, 2000, 3000 etc, whereas for old CFG files it will be the short ID of an old entry which will be less than 300 or so (the largest ID value in 1.1, 1.2).
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: Access to CHDK menu via scripts
« Reply #15 on: 31 / January / 2015, 19:04:32 »
Silly me. The other day I  downloaded the trunk 3661 source of 1.2, not 1.3 or 1.4. I now see the two IDs I thought were missing.

My final question remains though. How does CHDK 1.3 tell the difference between a new CHDK file and an old one e.g. if someone just copies the new DISKBOOT.BIN onto an old card? Does it just look at the sort at offset 6 in the header?

I think that would work because in 1.3 and 1.4 it will be a 1000, 2000, 3000 etc, whereas for old CFG files it will be the short ID of an old entry which will be less than 300 or so (the largest ID value in 1.1, 1.2).

The filename determines the version - the current names are CCHDK4.CFG, OSD__4.CFG etc.
Version 1.2 used CCHDK3.CFG (single file only). If 1.3/1.4 does not find the new files it will try and convert the CCHDK3.CFG file if it exists.

Phi.
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)

*

Offline zeno

  • *****
  • 889
Re: Access to CHDK menu via scripts
« Reply #16 on: 01 / February / 2015, 04:53:53 »
Thanks Phil. That makes perfect sense. It means that I can make my editor able to cope with old and new CFG formats.
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

 

Related Topics