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).
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();