I've written a few lines in PHP and determined that the buttons (at least for left, up, down, right) are the same as in A720.
I don't understand why the camera would still say that the card is locked. Isn't the code supposed to hide this by modifying those three words physw?
The reason why I haven't posted yet is because I've tried to solve the problem with conf_change_script_file
I've found that the problem is actually in script_scan() which uses right at the start strncpy and strrchr.
I couldn't find these in the firmware (and I still can't) so initially I tried commenting the subs in stubs_entry_2.s and writing these in lib.c:
char *_strrchr(const char *s, int c)
{
char* ret=0;
do {
if( *s == (char)c )
ret=s;
} while(*s++);
return ret;
}
char *_strncpy(char *dest, const char *src, long n)
{
char *ret = dest;
do {
if (!n--)
return ret;
} while (*dest++ = *src++);
while (n--)
*dest++ = 0;
return ret;
}
Well, it didn't work, the camera still froze right after entering the function... but maybe it's my fault, I don't know exactly how the functions are compiled, if the functions are entered were actually used (I know there also platform/generic/wrappers.c for example which I don't know if it's touched during compile)
I've also tried to add them as assembly in boot.c, following how _time was added in another camera platform:
char __attribute__((naked,noinline)) *_strncpy(char *dest, const char *src, long n) {
asm volatile (
"MOV R3, R0\n"
"B loc_FFC0E87C\n"
"loc_FFC0E854:\n"
"LDRB R12, [R1],#1\n"
"CMP R12, #0\n"
"STRB R12, [R3],#1\n"
"BNE loc_FFC0E87C\n"
"MOV R1, #0\n"
"loc_FFC0E868:\n"
"SUB R2, R2, #1\n"
"CMN R2, #1\n"
"STRNEB R1, [R3],#1\n"
"BNE loc_FFC0E868\n"
"BX LR\n"
"loc_FFC0E87C:\n"
"SUBS R2, R2, #1\n"
"BCS loc_FFC0E854\n"
"BX LR\n"
);
}
char __attribute__((naked,noinline)) *_strrchr(const char *s, int c) {
asm volatile (
"MOV R2, #0\n"
"AND R3, R1, #0xFF\n"
"loc_FFC71BD4:\n"
"LDRB R1, [R0]\n"
"CMP R1, R3\n"
"MOVEQ R2, R0\n"
"CMP R1, #0\n"
"ADD R0, R0, #1\n"
"BNE loc_FFC71BD4\n"
"MOV R0, R2\n"
"BX LR\n"
);
}
These also didn't work but probably I screwed the definition, I don't know how pointers work with inline assembly so I don't know if I've written the definition correctly.
Help, please ?
edit:
Nevermind, I found them in firmware... I looked for lines like "ADD R0, R0, #1" and "SUB R2, R2, #1" and I actually found both.
Still, it would be nice to know if for some reason I can't find that function, how it should be done to add it manually, so if you have some time, please explain.
ps2. I also got the last code from svn today and it gives me the following error:
C:\CHDK\trunk>gmake clean
makefile.inc:204: platform/a580/sub/101b: Permission denied
makefile.inc:204: /makefile.inc: No such file or directory
gmake: *** No rule to make target `/makefile.inc'. Stop.
The makefile.inc are in the right places so any clue why this would happen?