G11 porting - page 24 - DryOS Development - CHDK Forum

G11 porting

  • 530 Replies
  • 233116 Views
*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #230 on: 10 / January / 2010, 14:25:54 »
Advertisements
The modemap is now off the list, i got this values using the "Debug parameters/PropCase" Viewer for Property 49:
Code: [Select]
static const CapturemodeMap modemap[] = {
{ MODE_AUTO,               32768  },
{ MODE_P,                  32772  }, // also C1,C2
{ MODE_TV,                 32771  },
{ MODE_AV,                 32770  },
{ MODE_M,                  32769  },
{ MODE_VIDEO_COLOR_ACCENT, 2601   },
{ MODE_VIDEO_COLOR_SWAP,   2602   },
{ MODE_VIDEO_STD,          2603   },
{ MODE_SCN_NIGHT_SNAPSHOT, 16395  },
{ MODE_SCN_LANDSCAPE,    16396  },
{ MODE_SCN_PORTRAIT,       16397  },
{ MODE_SCN_NIGHT_SCENE,    16398  },
{ MODE_SCN_KIDS_PETS,      16400  },
{ MODE_SCN_INDOOR,         16401  },
{ MODE_SCN_SUNSET,         16402  },
{ MODE_SCN_FOLIAGE,        16403  },
{ MODE_SCN_SNOW,           16404  },
{ MODE_SCN_BEACH,          16405  },
{ MODE_SCN_FIREWORK,       16406  },
{ MODE_SCN_UNDERWATER,     16407  },
{ MODE_SCN_AQUARIUM,       16408  },
{ MODE_SCN_SPORT,         16903  },
{ MODE_SCN_STITCH,         16906  },
{ MODE_SCN_COLOR_ACCENT,   16923  },
{ MODE_SCN_COLOR_SWAP,     16924  },
{ MODE_SCN_ISO_3200,       32799  }, // Candle ?
{ MODE_SPORTS,             33313  }  // Quickshot ?

};

I am not sure which "hackmode" is the correct one for the LowLight Mode ("Candle") and for Quickshot. For now, i mapped them to ISO_3200 and MODE_SPORTS.

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #231 on: 10 / January / 2010, 14:53:30 »
Okay, again some progress:
I corrected the playrec mode adress, so now the CHDK gui knows that we are not in playmode.
I also hooked in the movietask, so it is now possible to use the optical zoom during movierecord.  :D
Also the updated modemap[] is now included.

So here is my new version of diskboot.bin to play arround:


*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #232 on: 10 / January / 2010, 14:55:35 »
Oh yes, this very important feature is now also working: "Dual-view" histogram:  :lol

Re: G11 porting
« Reply #233 on: 10 / January / 2010, 17:15:52 »
Oh yes, this very important feature is now also working: "Dual-view" histogram:  


Let us see the colour of your RGB histograms  :)

Don't forget to charge your battery !

bassist offered to find some values for you.


*

Offline reyalp

  • ******
  • 14082
Re: G11 porting
« Reply #234 on: 11 / January / 2010, 00:08:24 »
I am not sure which "hackmode" is the correct one for the LowLight Mode ("Candle") and for Quickshot. For now, i mapped them to ISO_3200 and MODE_SPORTS.
For C1 and C2, there should be a value to set these in the canon mode list, which can be found at FFBE7010
Looks like these are 8229 and 8230. These are not in the modemap yet, but are useful to keep in a comment. Setting a "C" mode sets whatever mode you had previous saved.

The hackmodes are named purely after the name in the canon manual right now. If the camera has some that don't match any existing ones, just add it at the end of the list.  (I got half way through re-working this, but RL has me busy right now :()

Looking at http://www.usa.canon.com/consumer/controller?act=ModelInfoAct&tabact=ModelTechSpecsTabAct&fcategoryid=222&modelid=19209 "Low Light" appears to be new. "Quick shot" may be the same as other cameras quick modes (e.g. sd990) ?
Don't forget what the H stands for.

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #235 on: 11 / January / 2010, 15:23:57 »
A little bit strange firmware.
I have found ioctl() function which was used for many POSIX/ANSI functions, but it is not called at all in this firmware.
SetFileTimeStamp is 0xFF835C3C
But first parameter is not fd (file descriptor), it is pointer to file name.
So prototype is as follows:
int SetFileTimeStamp(char *file_path, int access_time, int modification_time);
It looks like function returns 1 if Ok, or 0 if error.
I have no camera to test, so you need to check this out yourself.

I changed the code to this:

...
stubs_entry_2.s:
NSTUB(SetFileTimeStamp, 0xFF835C3C)
...

but it still does not work. This assert hits:
ASSERT!! Mounter.c Line 2563


Correction, it works if i modify the code as cppasm  suggested! My last test was incorrect, i used NSTUB instead of NHSTUB and so it was still using the wrong address for SetFileTimeStamp. Now SetFileTimeStamp() is working correct. So canon really changed the interface for this function.

@reyalp: Okay, thanks for the explanation. I will change the modemap and add the new hackmode to the end of the list.

Re: G11 porting
« Reply #236 on: 11 / January / 2010, 15:59:40 »
Correction, it works if i modify the code as cppasm  suggested! My last test was incorrect, i used NSTUB instead of NHSTUB and so it was still using the wrong address for SetFileTimeStamp. Now SetFileTimeStamp() is working correct. So canon really changed the interface for this function.
I am not absolutely sure, but there may be some problems with this function if file does not exists.
At least Canon's firmware checks for file existance using Open() in readonly mode and then Close() it if Ok.
So I'm not sure how SetFileTimeStamp will act on non-existent file - maybe it will return zero, but maybe DebugAssert() will be called with camera shutdown.
This need to be checked and maybe you will need to add checks for file existance to the wrapper function.

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #237 on: 11 / January / 2010, 16:46:00 »
I tested it with an non existing file path on the sd-card. The function does not crash or throws an assert/exception.
But anyway, if canon does as filecheck before using SetFileTimeStamp, i do it not also.  :haha
I changed the utime function now to this, and it works:
Code: [Select]
int utime(char *file, void *newTimes) {
#if !CAM_DRYOS
  return _utime(file, newTimes);
#else
 int res=0;
 int fd;
 fd = _open(file, 0, 0);

#ifdef CAM_DRYOS_2_3_R39
   if (fd>=0) {
       _close(fd);
       res=_SetFileTimeStamp(file, ((int*)newTimes)[0] , ((int*)newTimes)[1]);
   }
#else
     if (fd>=0) {
      res=_SetFileTimeStamp(fd, ((int*)newTimes)[0] , ((int*)newTimes)[1]);
      _close(fd);
     }
     // return value compatibe with utime: ok=0 fail=-1
#endif
  return (res)?0:-1;
#endif
}


Re: G11 porting
« Reply #238 on: 11 / January / 2010, 17:18:17 »
Good work !


So, what is next ?


*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #239 on: 11 / January / 2010, 17:23:34 »

Let us see the colour of your RGB histograms  :)

Don't forget to charge your battery !


Dont worry, i have also a second battery available. ;)
An here is the RGB histogram. It does not look so bad after i updated the COLOR defines in gui_draw.h:


 

Related Topics