New stubs/signature finder (gensig2/finsig2) for DryOS cameras. - page 5 - General Discussion and Assistance - CHDK Forum

New stubs/signature finder (gensig2/finsig2) for DryOS cameras.

  • 103 Replies
  • 48724 Views
*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: New stubs/signature finder (gensig2/finsig2) for DryOS cameras.
« Reply #40 on: 20 / August / 2011, 19:00:09 »
Advertisements
@philmoz :  What decides which signatures the sigfinder puts into stubs_entry.S ?   I'm trying to add GetImageFolder() to the G10 port.  The G12 port has an address in stubs_entry.S but the G10 does not. How does that work ?


Any function name that exists in one of the sig_ref_dryos_?.txt files is searched for.
There are a set of names that are considered optional and are ignored if they can't be found - mostly these are for things that only apply to some cameras.
This prevents a bunch of 'Error - Not Found' lines being added which then causes the build to fail.

GetImageFolder is only needed if the camera supports date based folder naming (CAM_DATE_FOLDER_NAMING).

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: New stubs/signature finder (gensig2/finsig2) for DryOS cameras.
« Reply #41 on: 20 / August / 2011, 19:13:15 »
GetImageFolder is only needed if the camera supports date based folder naming (CAM_DATE_FOLDER_NAMING).
I was trying to use the CAM_DATE_FOLDER_NAMING #define to get G10 RAW files into the same directory as the associated JPG files. Looks like the G10 creates its directory names a different way then ?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: New stubs/signature finder (gensig2/finsig2) for DryOS cameras.
« Reply #42 on: 20 / August / 2011, 19:38:45 »
GetImageFolder is only needed if the camera supports date based folder naming (CAM_DATE_FOLDER_NAMING).
I was trying to use the CAM_DATE_FOLDER_NAMING #define to get G10 RAW files into the same directory as the associated JPG files. Looks like the G10 creates its directory names a different way then ?


Probably uses the old convention of XXX_CANON where XXX is the folder number stored with the file number. The code should already support putting the raw in the same folder for this.

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: New stubs/signature finder (gensig2/finsig2) for DryOS cameras.
« Reply #43 on: 20 / August / 2011, 21:40:58 »
Probably uses the old convention of XXX_CANON where XXX is the folder number stored with the file number. The code should already support putting the raw in the same folder for this.
Sorry - I know this is off topic.  The G10 uses the XXXCANON nomenclature (no underscore).  And you are correct - it supports putting the raw in the same folder as the jpg ---> if you select that from the menu.  PEBKAC.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: New stubs/signature finder (gensig2/finsig2) for DryOS cameras.
« Reply #44 on: 05 / November / 2011, 19:14:19 »
Hey Phil.  When you get around to it,  can you add KEY_SHOOT_FULL_ONLY  to your magic keymap list in stubs_entry.S ?

TIA.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: New stubs/signature finder (gensig2/finsig2) for DryOS cameras.
« Reply #45 on: 06 / November / 2011, 01:10:34 »
Hey Phil.  When you get around to it,  can you add KEY_SHOOT_FULL_ONLY  to your magic keymap list in stubs_entry.S ?

TIA.

Already done in changeset 1397

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: New stubs/signature finder (gensig2/finsig2) for DryOS cameras.
« Reply #46 on: 06 / November / 2011, 09:54:31 »
Already done in changeset 1397
Thanks - was helping someone who was working with a slightly older build so missed that.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: New stubs/signature finder (gensig2/finsig2) for DryOS cameras.
« Reply #47 on: 04 / August / 2012, 17:27:22 »
A patch which enables to find two additional buttons (KEY_POWER is not used anywhere, but may be of interest for some). Bad news: the event IDs for KEY_PLAYBACK and KEY_POWER seem to have been changed starting with r49. Buttons with inverted logic are marked with "inv". I have tested this on several DryOS dumps and it seems to have caught the known abnormalities (i.e. the inverted buttons of A490/495/800).
Needs work on r49+ (is inverted state still marked the same way, what are the new events for the playback (and power) buttons).
Code: [Select]
Index: tools/finsig_dryos.c
===================================================================
--- tools/finsig_dryos.c (revision 2044)
+++ tools/finsig_dryos.c (working copy)
@@ -3742,19 +3742,21 @@
  char nm[32];
  uint32_t fadr;
  uint32_t ev;
+ int inv;
 } kinfo;
 
 int kmask[3];
 kinfo key_info[100];
 int kcount = 0;
 
-void add_kinfo(int r, uint32_t b, const char *nm, uint32_t adr, uint32_t ev)
+void add_kinfo(int r, uint32_t b, const char *nm, uint32_t adr, uint32_t ev, int inv)
 {
  key_info[kcount].reg = r;
  key_info[kcount].bits = b;
  strcpy(key_info[kcount].nm, nm);
  key_info[kcount].fadr = adr;
  key_info[kcount].ev = ev;
+ key_info[kcount].inv = inv;
  kcount++;
  kmask[r] |= b;
 }
@@ -3764,6 +3766,7 @@
  int tidx = adr2idx(fw,tadr);
  int r, k, kval = 0;
  uint32_t b = 0;
+ int inv = 0;
  for (k=0; k<tlen; k+=tsiz)
  {
  if (fw->buf[tidx+k+1] == ev)
@@ -3777,8 +3780,9 @@
  {
  r = (kval >> 5) & 7;
  b = (1 << (kval & 0x1F));
+ inv = ((kval&0xff0000)==0x10000)?0:1;
 
- add_kinfo(r,b|xtra,name,tadr,ev);
+ add_kinfo(r,b|xtra,name,tadr,ev,inv);
  }
 
  return b;
@@ -3826,7 +3830,7 @@
  int k;
  for (k=0; k<kcount; k++)
  {
- bprintf("//    { %d, %-20s,0x%08x }, // Found @0x%08x, levent 0x%02x\n",key_info[k].reg,key_info[k].nm,key_info[k].bits,key_info[k].fadr,key_info[k].ev);
+ bprintf("//    { %d, %-20s,0x%08x }, // Found @0x%08x, levent 0x%02x%s\n",key_info[k].reg,key_info[k].nm,key_info[k].bits,key_info[k].fadr,key_info[k].ev,(key_info[k].inv==0)?"":" inv");
  }
 
  bprintf("//    { 0, 0, 0 }\n//};\n");
@@ -3932,6 +3936,8 @@
  add_kmval(fw,tadr,tsiz,tlen,8,"KEY_SET",0);
  add_kmval(fw,tadr,tsiz,tlen,9,"KEY_MENU",0);
  add_kmval(fw,tadr,tsiz,tlen,0xA,"KEY_DISPLAY",0);
+ add_kmval(fw,tadr,tsiz,tlen,0x601,"KEY_PLAYBACK",0);
+ add_kmval(fw,tadr,tsiz,tlen,0x600,"KEY_POWER",0);
 
  bprintf("\n// Keymap values for kbd.c. Additional keys may be present, only common values included here.\n");
  print_kmvals();

Re: New stubs/signature finder (gensig2/finsig2) for DryOS cameras.
« Reply #48 on: 04 / August / 2012, 17:38:26 »
KEY_POWER is not used anywhere, but may be of interest for some)
Isn't KEY_POWER used in boot.c to let the user go straight to shooting mode if its held down during startup ?

Regardless,  having the playback key helps a lot.  If you could grab that for the ixus300/sd4000 I could probably fix this quickly :   http://chdk.setepontos.com/index.php?topic=650.msg88886#msg88886
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: New stubs/signature finder (gensig2/finsig2) for DryOS cameras.
« Reply #49 on: 04 / August / 2012, 17:46:20 »
Isn't KEY_POWER used in boot.c to let the user go straight to shooting mode if its held down during startup ?
I meant its usage in the keymap.
Quote
Regardless,  having the playback key helps a lot.
Your post gave me the idea to look for new keys :)
Ixus300/SD4000 1.00d
//    { 0, KEY_PLAYBACK        ,0x00004000 }, // Found @0xffb5f6f4, levent 0x601

I'd suggest to try it the patched sigfinder on your cameras to see the reliability (i.e. compare its results with your experience on real hardware).

edit: ambiguity hopefully resolved  8)
« Last Edit: 04 / August / 2012, 19:58:19 by srsa_4c »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal