PowerShot SX210 IS - Porting Thread - page 19 - General Discussion and Assistance - CHDK Forum

PowerShot SX210 IS - Porting Thread

  • 589 Replies
  • 325075 Views
Re: PowerShot SX210 IS - Porting Thread
« Reply #180 on: 03 / September / 2010, 20:42:45 »
Advertisements
@ASM1989

As you seem to be doing very nicely I don't want to force anything either way but what are your thoughts of using a Google Wave as a medium for development?

https://wave.google.com/wave/waveref/googlewave.com/w+oReiB0RmE

Harpo
Canon Models - SD300, SD780, & SX210

Re: PowerShot SX210 IS - Porting Thread
« Reply #181 on: 03 / September / 2010, 21:25:16 »
SCRIPT update for sx210 -

In order to run a script on the sx210 you MUST press the set button before the blinking green light finishes.   Sooooo

1.  Place everything as stated above...
2.  Press and hold the play until green light starts to blink and camera starts to boot
3.  While it is still blinking green you must hit 'set'  Don't hold.

Harpo
Canon Models - SD300, SD780, & SX210

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #182 on: 04 / September / 2010, 03:17:55 »
Quote
As you seem to be doing very nicely I don't want to force anything either way but what are your thoughts of using a Google Wave as a medium for development?

Havent tryed it ever, I'll take a look.

Anyway here are my latests sources, http://es.drop.io/sx210is_platformv01

It will be good if you can review the progress and share your thougts, since my experince with chdk is very limited, just copying and guessing,
I'm a litle stuck with the keyboard stuff too.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #183 on: 04 / September / 2010, 11:23:42 »
Finished  capt_seq.c , untested due to stuck in keyboard stuff.

http://www.zshare.net/download/800577246e900161/

someone to double check all the code will be welcome

Today's status
-almost all of the funcs address found, some may need verification
-boot.c almost finished, someone need to check if the hooks are right
-lib.c almost finished , need the right size maybe for the screen, testin needed
-capt_seq.c  finished, but needs testing
-The camera boots, shows the chdk logo and info, and disappear:
 - some keys dont work at all
 - I was unable to show the chdk menu
 - The debug works to check the key codes.

Pending
-kbd.c
-shooting.c  ( get the right appertures.....
-main.c  (zoompoints, focal leght...., someone could get these numbers)
-movie_rec.c ( not sure if its neeed since this camera already has zoom in video, maybe only for quality, anyway nothing is here yet, just plain sx200 copy.

So I need help here,  :(

The latest full sources are here: http://es.drop.io/sx210is_platformv01 file Sourcesx210isASM1989-v.05.zip
« Last Edit: 04 / September / 2010, 11:46:11 by asm1989 »

Re: PowerShot SX210 IS - Porting Thread
« Reply #184 on: 04 / September / 2010, 12:42:16 »
I'll get my dev env setup with the latest and take a look.

edit - I can confirm it boots as described by asm1989 - Although one note to anyone else building this.  This source is complete provided you know how to integrate a new camera.  Otherwise it's missing some .h changes. (mostly defines)...

@ASM - You said you got some debug from kbd.c but I cannot get that with the code:

void taskCreateHook(int *p) {
   p-=17;
  if (p[0]==0xFF87EB90)  p[0]=(int)capt_seq_task;    // -> ASM1989 08.21.2010  need to be verified
 if (p[0]==0xFF8342C0)  p[0]=(int)mykbd_task;       // -> ASM1989 08.21.2010  need to be verified

Can you confirm if you have seen kbd.c work?  If I do it my way I can see mykbd_task get called but with the taskCreateHook as above I do not.

If you have not seen mykbd_task be reached then I stand by the original comment below....
edit #2 - I can confirm that the keyboard override does not work yet.  I have an alternate boot.c for you.  the sx200 method will work I'm sure but for certain the method of overriding the keyboard stuff has the wronge location.  (don't know the valid location yet but you can change the boot.c asm to override in the asm instead of in the hook area)

The kbd.c and boot.c i used are available on the Google wave.  Please tell me if you have any issues getting them....
https://wave.google.com/wave/waveref/googlewave.com/w+oReiB0RmE


Harpo
« Last Edit: 04 / September / 2010, 23:51:53 by HarpoMa »
Canon Models - SD300, SD780, & SX210

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #185 on: 05 / September / 2010, 05:38:38 »
Hi  HarpoMa, good to have you here!!

Yes I get your code.   what changes did you do to boot.c ? , I only see the // for mykbd_task

Well I wasn't able to confirm that mykbd_task, is ever reached, I try debug leds, creating a directory and dosnt seems to reach the function,  so that's why I think there may be a problem with the hooks or something,
Since my port base was the sx200, it dosnt use the new hooking style  http://chdk.setepontos.com/index.php/topic,4801.0.html, like in here http://tools.assembla.com/chdk/browser/trunk/platform/a480/sub/100b/boot.c, so the next option may be to convert it to that behaivour.

I get the keyboard debug enabling debug at gui_draw_debug_vals_osd() , at gui.c  , the same as you did in my_kbd_read_key
 
Code: [Select]
extern long physw_status[3];
        sprintf(osd_buf, "1:%8x  ", physw_status[0]);
        draw_txt_string(28, 10, osd_buf, conf.osd_color);

        sprintf(osd_buf, "2:%8x  ", physw_status[1]);
        draw_txt_string(28, 11, osd_buf, conf.osd_color);

        sprintf(osd_buf, "3:%8x  ", physw_status[2]);
        draw_txt_string(28, 12, osd_buf, conf.osd_color);


 
« Last Edit: 05 / September / 2010, 11:09:54 by asm1989 »

Re: PowerShot SX210 IS - Porting Thread
« Reply #186 on: 05 / September / 2010, 10:52:50 »
I added a new ASM area in boot.c

//"BL debug_blink\n"
//                 "BL      sub_FF8342F4\n"   // taskcreate_PhySw //ASM1989 -> In sx200 was: FF821AC4
                 "BL      sub_FF8342F4_my\n"   // taskcreate_PhySw //ASM1989 -> In sx200 was: FF821AC4
                 "BL      sub_FF8378B0\n"   //ASM1989 -> In sx200 was: FF824B14

                 "BL      sub_FF83C314\n"   //ASM1989 -> In sx200 was: FF829434


++++++


//From SD780 - ASM matches
void __attribute__((naked,noinline)) sub_FF8342F4_my() {
   asm volatile (
"                STMFD   SP!, {R3-R5,LR}\n"
"                LDR     R4, =0x1C24\n"
"                LDR     R0, [R4,#0x10]\n"
"                CMP     R0, #0\n"
"                BNE     loc_FF834328\n"
"                MOV     R3, #0\n"
"                STR     R3, [SP]\n"
"                LDR     R3, =mykbd_task\n" // task_PhySw
"                MOV     R2, #0x2000\n"    // Increate stack size from 0x800 to 0x2000 for new task_PhySw so we don't have to do stack switch
"                MOV     R1, #0x17\n"
"                LDR     R0, =0xFF8344F8\n" // "PhySw"
"                BL      sub_FF83A39C\n" // KernelCreateTask
"                STR     R0, [R4,#0x10]\n"

"loc_FF834328:\n"
"                BL      sub_FF8623C0\n"
"                BL      sub_FF88F470\n" // IsFactoryMode
"                BL      sub_FF835B7C\n" // ???
"                CMP     R0, #0\n"
"                LDREQ   R1, =0x336D0\n"
"                LDMEQFD SP!, {R3-R5,LR}\n"
"                BEQ     sub_FF88F3F8\n" // eventproc_export_OpLog_Start
"                LDMFD   SP!, {R3-R5,PC}\n"
   );
}
Canon Models - SD300, SD780, & SX210

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #187 on: 05 / September / 2010, 11:09:41 »
In other developments file movie_rec.c  finished (untested), and removed the zoom in video stuff since its not needed
function movie_record_task is at FF96E110     http://www.zshare.net/download/8009102521d3073a/

HarpoMa: thanks I didn't see your changes, do you thing the hooks are been done?
« Last Edit: 05 / September / 2010, 11:18:39 by asm1989 »

Re: PowerShot SX210 IS - Porting Thread
« Reply #188 on: 05 / September / 2010, 11:25:25 »
I'm currently converting boot.c to the new style (only going to take 10min or so I think)  I really like the new style since you don't need to get the task address correct.  Just the name of the task.  I've removed my ASM that I added as it's not required anymore.  I've tested it and it works nicely.  Will post to the Wave shortly.  

I'll get your movie_rec.c shortly.  What are your thoughts on the Wave?  If you make a request for access you can post/change/ect.  

Harpo
« Last Edit: 05 / September / 2010, 11:40:46 by HarpoMa »
Canon Models - SD300, SD780, & SX210

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #189 on: 05 / September / 2010, 11:52:12 »
Quote
What are your thoughts on the Wave?
looks a good way to develop, but a pity it dosnt work on Internet Explorer.

Quote
I'm currently converting boot.c to the new style (only going to take 10min or so I think)  I really like the new style since you don't need to get the task address correct.  Just the name of the task.  I've removed my ASM that I added as it's not required anymore.  I've tested it and it works nicely.  Will post to the Wave shortly


Very good news, waiting for it, if you need any help with it tell me.

I have now the full list of keys using your custom debug view:
but I don't know how to make the keymap when 2 of the values change
anyway here is the raw data:

In Review mode   physw_status      0      1      2
iddle   <>   880a19b   <>   fff3f   <>   400000
menu   <>   880a19b   <>   bff3f   <>   400000
disp   <>   880a19b   <>   dff3f   <>   400000
zoomup   <>   880a19b   <>   fff3b   <>   400000
zoomdwn   <>   880a19b   <>   fff3e   <>   400000
print   <>   880a19b   <>   7ff3f   <>   400000
func   <>   880a19b   <>   eff3f   <>   400000
play   <>   800a19b   <>   fff3f   <>   400000
Halfsutter      880819b   <>   fff3f   <>   400000
fullsutter      8808199   <>   fff3f   <>   400000
Turn on/off      880a193   <>   fff3f   <>   400000
soft press                  
right   <>   880a19b   <>   fdf3f   <>   400000
left   <>   880a19b   <>   fef3f   <>   400000
up   <>   880a19b   <>   ffb3f   <>   400000
down   <>   880a19b   <>   ff73f   <>   400000
hard press                  
right   <>   880a19b   <>   fd73f   <>   400000
left   <>   880a19b   <>   f633f   <>   400000
up   <>   880a11b   <>   feb3f   <>   400000
down   <>   880a09b   <>   fe73f   <>   400000


iddle Manual   <>   880a19b   <>   fff3f   <>   400000
iddle AV   <>   880a19b   <>   fff1f   <>   400000
iddle TV   <>   880a19b   <>   fff5f   <>   400000
iddle P   <>   880a19b   <>   fffdf   <>   400000
iddle auto   <>   880a19b   <>   fffff   <>   400000
iddle heart   <>   880a19b   <>   fff7f   <>   400000
iddle portriat   <>   880a19b   <>   ffe7f   <>   400000
iddle landscap   <>   880a19b   <>   ffeff   <>   400000
iddle mountain   <>   880a19b   <>   ffe9f   <>   400000
iddle dog   <>   880a19b   <>   ffcdf   <>   400000
iddle fireworks   <>   880a19b   <>   ffddf   <>   400000
iddle SCN   <>   880a19b   <>   ffdff   <>   400000
iddle video   <>   880a19b   <>   ffddf   <>   400000
iddle none   <>   880a19b   <>   ffebf   <>   400000

« Last Edit: 05 / September / 2010, 11:55:15 by asm1989 »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal