Need some modifications to the trunk for the SD980 port - General Discussion and Assistance - CHDK Forum supplierdeeply

Need some modifications to the trunk for the SD980 port

  • 3 Replies
  • 4652 Views
*

Offline RaduP

  • *****
  • 926
Need some modifications to the trunk for the SD980 port
« on: 23 / October / 2009, 03:35:57 »
Advertisements
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:

Code: [Select]
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);
Code: [Select]
#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:

Code: [Select]
#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.

*

Offline RaduP

  • *****
  • 926
Re: Need some modifications to the trunk for the SD980 port
« Reply #1 on: 26 / October / 2009, 20:33:39 »
Well, anyone?
My SD980 port is almost done now..

*

Offline reyalp

  • ******
  • 14117
Re: Need some modifications to the trunk for the SD980 port
« Reply #2 on: 26 / October / 2009, 20:43:55 »
Please provide a patch. TortoiseSVN "create patch" preferred. You will have to do this for your port anyway. For added files (i.e. the platform directory) you can SVN add them, and then make a patch. If that is a problem for some reason, you can also just zip up the source files. Either way, please don't include stuff that isn't source, but do include generated source files.

I am not not going to read through a bunch of "add this here, change that there."

There will be other modifications in the trunk for your port (camera.h and kbd.c at least).

I may not add it right away, I already have a couple of trees full of various changes and I get confused easily.
Don't forget what the H stands for.

*

Offline RaduP

  • *****
  • 926
Re: Need some modifications to the trunk for the SD980 port
« Reply #3 on: 26 / October / 2009, 21:03:31 »
Ok, I hope I did it right, but this is my first patch, so let me know if it's ok.


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal