SD940 (IXUS120) porting thread - page 4 - DryOS Development - CHDK Forum supplierdeeply

SD940 (IXUS120) porting thread

  • 542 Replies
  • 202809 Views
*

Offline waldo

  • ***
  • 238
Re: SD940 rev 103c porting thread (IXUS120)
« Reply #30 on: 12 / December / 2010, 00:41:35 »
Advertisements
Quote
So far I've commented out things to get the OSD clock to display - I haven't been able to get anything else in OSD to work but that was going to be my next task.
I'm not sure what base version you used, but there is some code missing for displaying some of the OSD (such as the ALT indicator).

Quote
I picked the Display key as the ALT key because as you mentioned the SD940 does not have a Print button.  I didn't realize it would cause problems in ALT mode, never having actually used CHDK on a camera.  Any idea how other cameras handle this ?
The SD780 uses a short press of Display for Alt and a long press for Display.  That might work better.

Quote
What do you use the .fir version for ?
It's for booting CHDK via the "Firm Update" menu.  Not really all that useful to me, but I think it is more useful when using multiple partitions.

Re: SD940 rev 103c porting thread (IXUS120)
« Reply #31 on: 12 / December / 2010, 08:23:39 »
I'm not sure what base version you used, but there is some code missing for displaying some of the OSD (such as the ALT indicator).
I've never seen the ALT indicator on screen.  Might be something I messed up early on - I'll update to the 1001 version and see what happens.

The SD780 uses a short press of Display for Alt and a long press for Display.  That might work better.
This actually works I think.  In normal mode, if I press the Display key briefly then CHDK goes into ALT mode.  If I hold the Display button down then the display mode changes.   In Alt mode, I'm not sure it does anything other than toggle back to normal mode.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: SD940 rev 103c porting thread (IXUS120) -> Alpha release 4
« Reply #32 on: 12 / December / 2010, 14:03:30 »
Updated Alpha release now posted.   Uses build version 1001.  OSD now seems to work correctly - grids and icons display although I have not checked that they give the correct information yet.

http://www.zshare.net/download/83841153b78cb67c/

[Edit : allows optical zoom in video mode]
« Last Edit: 12 / December / 2010, 23:57:59 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline waldo

  • ***
  • 238
Re: SD940 rev 103c porting thread (IXUS120)
« Reply #33 on: 12 / December / 2010, 15:29:25 »
waterwingz, have you gotten the new style taskHook dispatching working?  When I try to run something like:
Code: [Select]
if(!_strcmp(tcb->name, "MovieRecord"))
   tcb->entry = (void*)movie_record_task;
, the camera crashes when I call strcmp.  I have confirmed the strcmp address.  The problem is with taking the value tcb->name.  I also confirmed that gcc is using 1 byte struct alignment for task_t as defined in dryos31.h.  I can go back to the older style hard-coded address compare, but this is supposed to work.


Re: SD940 rev 103c porting thread (IXUS120)
« Reply #34 on: 12 / December / 2010, 15:37:06 »
waterwingz, have you gotten the new style taskHook dispatching working?
Short answer = no. 

But I have not even tried - I didn't even know there was such a thing.  I'm guessing that its a way of intercepting tasks without knowing the actual address in  taskCreateHook() ?  That would be sweet.  I added code to capture every address sent to taskCreateHook in a buffer and used the hacked code I have in main.c to display them on the LCD display. (actually spans multiple screens - I recompiled with an offset and ran it twice).   If I had logging to a file working, that would have been better.

No  much help - sorry.  But now that I know that its exists, I'll have to take a look.  Right after I get capt_seq_task(), exp_drv_task and movie_record_task going.  I know their addresses.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline waldo

  • ***
  • 238
Re: SD940 rev 103c porting thread (IXUS120)
« Reply #35 on: 12 / December / 2010, 15:59:23 »
OK, that may also be helpful.  What 19xx addresses for the taskHook worked?  And did the addresses you dumped include references to all the tasks we need to patch (capt_seq_task, movie_record_task, init_file_modules_task and exp_drv_task) ?

Re: SD940 rev 103c porting thread (IXUS120)
« Reply #36 on: 12 / December / 2010, 16:21:01 »
What 19xx addresses for the taskHook worked? 
in boot.c, this worked
   *(int*)0x1938=(int)taskCreateHook;
   *(int*)0x1940=(int)taskCreateHook2; 

And did the addresses you dumped include references to all the tasks we need to patch (capt_seq_task, movie_record_task, init_file_modules_task and exp_drv_task) ?
Yes.  There are 58 task hooks that show up at 0x1938 at startup and 3 tasks at 0x1940.  Another 17 task hooks show up when you enter shooting mode.   I wrote them all down by hand and then compared to SD980 tasks to figure out the four we need for the SD940.  The addresses in the code I sent you work for 103C - I would not expect your release to be off by much ?  I'll take a look at the two firmware dumps and see if I can give you the four addresses for 102c ?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline waldo

  • ***
  • 238
Re: SD940 rev 103c porting thread (IXUS120)
« Reply #37 on: 12 / December / 2010, 16:25:23 »
No need - I have the addresses for 102C.  I also noticed that address 193C also makes taskHook get called.  Anybody know if we need to use that one too?


Re: SD940 rev 103c porting thread (IXUS120)
« Reply #38 on: 12 / December / 2010, 16:38:10 »
Does this look right then ?

Code: [Select]

        if(p[0]==0xFF8331C4) p[0]=(int)mykbd_task;                      // SD940 103c
if(p[0]==0xFF88E57C) p[0]=(int)init_file_modules_task;
if(p[0]==0xFF872FE0) p[0]=(int)capt_seq_task; 
if(p[0]==0xFF8B2FD0) p[0]=(int)exp_drv_task;
if(p[0]==0xFF93D810) p[0]=(int)movie_record_task;

if(p[0]==0xFF8331C4) p[0]=(int)mykbd_task;    // SD940 102c
if(p[0]==0xFF88E570) p[0]=(int)init_file_modules_task;
if(p[0]==0xFF872F84) p[0]=(int)capt_seq_task;
if(p[0]==0xFF8B2F74) p[0]=(int)exp_drv_task;
if(p[0]==0xFF93D648) p[0]=(int)movie_record_task;
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline waldo

  • ***
  • 238
Re: SD940 rev 103c porting thread (IXUS120)
« Reply #39 on: 12 / December / 2010, 16:54:14 »
Does this look right then ?

Code: [Select]

        if(p[0]==0xFF8331C4) p[0]=(int)mykbd_task;                      // SD940 103c
if(p[0]==0xFF88E57C) p[0]=(int)init_file_modules_task;
if(p[0]==0xFF872FE0) p[0]=(int)capt_seq_task; 
if(p[0]==0xFF8B2FD0) p[0]=(int)exp_drv_task;
if(p[0]==0xFF93D810) p[0]=(int)movie_record_task;

if(p[0]==0xFF8331C4) p[0]=(int)mykbd_task;    // SD940 102c
if(p[0]==0xFF88E570) p[0]=(int)init_file_modules_task;
if(p[0]==0xFF872F84) p[0]=(int)capt_seq_task;
if(p[0]==0xFF8B2F74) p[0]=(int)exp_drv_task;
if(p[0]==0xFF93D648) p[0]=(int)movie_record_task;

Almost.  I believe init_file_modules should be 0xFF88E520, not 0xFF88E570 for 102C (the task, not the createTask).  I embedded the kbd task into the boot code where the PhySwTask is commented out, but yours should work, too.

 

Related Topics