OK thanks now I realise how _GetKbdState works (before I thought it just returns something based on some input address). So now that I've also learned what a pointer is and how to use them I tried the following:
kbd.cstatic long kbd_new_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
static long kbd_prev_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
static long kbd_mod_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
extern void _GetKbdState(long*);
//Added by me
long kbd_exp[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
int *kbd_address_pointer = &kbd_exp[0];
gui_osd.c (top)extern void _GetKbdState(long*);
extern int kbd_address_pointer;
extern long kbd_exp[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
gui_osd in void gui_osd_draw_temp _GetKbdState(kbd_exp);
if ((conf.show_temp == 6) || (conf.show_temp == 5))
draw_ad("KEY", kbd_exp[0], yofst++);
draw_ad("KEY", kbd_exp[1], yofst++);
draw_ad("KEY", kbd_exp[2], yofst++);
But unfortunately it doesn't compile: ...
>> Entering to platform/sx40hs
kbd.c -> kbd.o
kbd.c:19:28: warning: initialization from incompatible pointer type
main.o lib.o wrappers.o kbd.o shooting.o -> libplatform.a
<< Leaving platform/sx40hs
>> Entering to platform/sx40hs/sub/100f
../../../../core/gui_osd.c -> gui_osd.thm.o
../../../../core/gui_osd.c:31:13: warning: 'kbd_exp' initialized and declared 'extern'
boot.o stubs_min.o stubs_auto.o stubs_entry.o stubs_entry_2.o capt_seq.o movie_rec.o filewrite.o main.thm.o gui_draw.thm.o memmgmt.thm.o gui.thm.o kbd_process.thm.o conf.thm.o gui_osd.thm.o raw.thm.o shot_histogram.thm.o shooting.thm.o camera_info.thm.o remotecap.thm.o bin_compat.h -> libplatformsub.a
<< Leaving platform/sx40hs/sub/100f
>> Entering to core
entry.S -> entry.o
-> main.elf
../platform/sx40hs/libplatform.a(kbd.o):(.data+0x24): multiple definition of `kbd_exp'
../platform/sx40hs/sub/100f/libplatformsub.a(gui_osd.thm.o):(.data+0x4): first defined here
collect2: ld returned 1 exit status
make[1]: *** [main.elf] Error 1
make: *** [all-recursive] Error 1
Any idea of what I might have done wrong?