I am getting close to finishing the SD980 port, but in order for it to work with the mainstream CHDK, some modifications are needed to the trunk.
Following reyalp suggestion, there is a new define, called CAM_DRYOS_2_3_R39
This should be used by all of the 'newer' generation cameras, such as SD980, SX20, SD940, and possibly S90 and G11.
There are quite a few places that need to be modified, and I don't know how to submit patches, so I will just explain here:
platform/generic/wrappers.c
open() should become:
int open (const char *name, int flags, int mode )
{
#ifdef CAM_DRYOS_2_3_R39
if(name[0]!='A')return -1;//on the SD980, it will crash if a file path doesn't start with A
#endif
return _Open(name, flags, mode);
}
code/gui_fselect.c
in static void gui_fselect_read_dir(const char* dir)
instead of d = opendir(dir);
#ifdef CAM_DRYOS_2_3_R39
if(dir[0]=='A' && dir[1]==0)
d = opendir("A/");
else
d = opendir(dir);
#else
d = opendir(dir);
#endif
in /include/stdlib.h
Instead of
struct stat
{
unsigned long st_dev; //?
unsigned long st_ino; //?
unsigned short st_mode; //?
short st_nlink; //?
short st_uid; //?
short st_gid; //?
unsigned long st_atime; //?
unsigned long st_mtime; //?
unsigned long st_ctime; //?
unsigned long st_size;
long st_blksize; //?
long st_blocks; //?
unsigned char st_attrib;
int reserved1; //
int reserved2; //
int reserved3; //
int reserved4; //
int reserved5; //
int reserved6; //
};
replace with:
#ifndef CAM_DRYOS_2_3_R39
struct stat
{
unsigned long st_dev; //?
unsigned long st_ino; //?
unsigned short st_mode; //?
short st_nlink; //?
short st_uid; //?
short st_gid; //?
unsigned long st_atime; //?
unsigned long st_mtime; //?
unsigned long st_ctime; //?
unsigned long st_size;
long st_blksize; //?
long st_blocks; //?
unsigned char st_attrib;
int reserved1; //
int reserved2; //
int reserved3; //
int reserved4; //
int reserved5; //
int reserved6; //
};
#else
struct stat
{
unsigned long st_unknown_1;
unsigned long st_attrib;
unsigned long st_size;
unsigned long st_ctime;
unsigned long st_mtime;
unsigned long st_unknown_2;
};
#endif//CAM_DRYOS_2_3_R39
I will add other requests on this thread at a later time, if someone feels like checking them and committing them to the SVN.