G11 porting

  • 527 Replies
  • 95046 Views
  • Publish
    Re: G11 porting
    « Reply #310 on: 20 / January / 2010, 08:44:01 »
    Advertisements

    I got partition booting working, as mentioned above. And no, manual booting doesn't work. AFAIK, camera checks for PS.FI2 file in card, which is different for each card. I don't think G11 development has gotten that far yet, which is why ERR99 tells users to make card bootable with cardtricks.

    I don't even have such a "Firmware Update" menu on my G11. Do you have one?

    Quote
    [...]
    Once done, you can format the SD card as you would HDD's. Partition one as FAT, two as FAT32 etc. Put CHDK on both partitions, and use cardtricks to make partition one bootable, and you're set. Bonus is now you don't need to use partition swap on CHDK before plugging into computer. =]

    The Downside is though, that if you do not want to use CHDK for a while and disable it by setting the SD-card to read/write, the camera only sees this small first partition... :-/

    Is there a solution for this?

    PS: Any MANY thanks to ERR99 for the work! I followed this thread the last weeks, but did not find any time to contribute. This may change though. At least I can test the port.

  • Publish
    Re: G11 porting
    « Reply #311 on: 20 / January / 2010, 08:55:31 »

    I got partition booting working, as mentioned above. And no, manual booting doesn't work. AFAIK, camera checks for PS.FI2 file in card, which is different for each card. I don't think G11 development has gotten that far yet, which is why ERR99 tells users to make card bootable with cardtricks.

    I don't even have such a "Firmware Update" menu on my G11. Do you have one?

    Nope, but again, as I mentioned several times already, you CAN NOT load CHDK manually. The G11 PS.FI2 hasn't been developed yet (AFAIK), so you can't update via "Firmware Update" menu. You need to place diskboot.bin (and CHDK folder from a full build if you want) on an SD card, and set to to bootable via cardtricks, as mentioned by ERR99.

    Quote
    [...]
    Once done, you can format the SD card as you would HDD's. Partition one as FAT, two as FAT32 etc. Put CHDK on both partitions, and use cardtricks to make partition one bootable, and you're set. Bonus is now you don't need to use partition swap on CHDK before plugging into computer. =]

    The Downside is though, that if you do not want to use CHDK for a while and disable it by setting the SD-card to read/write, the camera only sees this small first partition... :-/

    Is there a solution for this?

    PS: Any MANY thanks to ERR99 for the work! I followed this thread the last weeks, but did not find any time to contribute. This may change though. At least I can test the port.

    Ohh...good point. *Takes a look at G11 without CHDK*
    Hahaha, photo capacity: 1 photo
    lol
    « Last Edit: 20 / January / 2010, 09:00:35 by KayDat »

  • Publish
    Re: G11 porting
    « Reply #312 on: 20 / January / 2010, 13:32:08 »
    Nope, but again, as I mentioned several times already, you CAN NOT load CHDK manually. The G11 PS.FI2 hasn't been developed yet (AFAIK), so you can't update via "Firmware Update" menu. You need to place diskboot.bin (and CHDK folder from a full build if you want) on an SD card, and set to to bootable via cardtricks, as mentioned by ERR99.

    I know this. Thanks.
    I use Linux only so I do not need special tools and drivers to setup my SD-Card. ;)

    I was just wondering why I do not have this "Firmware update" menu entry. So this is only visible with a valid PS.FI2 file?

    *

    Offline whim

    • ******
    • 2013
    • A495/590/620/630 ixus70/115/220/230/300/870 S95
  • Publish
    Re: G11 porting
    « Reply #313 on: 20 / January / 2010, 13:55:37 »
    Quote
    So this is only visible with a valid PS.FI2 file
    menu entry should appear even if you stick an empty or invalid PS.FI2 in there -
    if used it will give an error though

    hth,

    wim


    *

    Offline ERR99

    • ****
    • 339
  • Publish
    Re: G11 porting
    « Reply #314 on: 20 / January / 2010, 14:06:07 »
    My trys to build a working PS.FI2 version of my CHDK version was not very sucessfull.
    It starts booting the "firmware update", but then "E31" is shown on the display, than the CHDK-Splash shows up
    (but without CHDK-Logo, which is available on the SD-Card) and then the camera switches off (without creating any entry in the romlog).

    Currently i dont have any clue whats going wrong here, and why it is not working that way.  :blink:

    *

    Offline ERR99

    • ****
    • 339
  • Publish
    Re: G11 porting
    « Reply #315 on: 20 / January / 2010, 15:09:24 »
    - At least one script (md_burst) makes trouble if you try to load it. CDHK does not respond anymore and the scriptload menu looks
    strange. If find out the it has something to do with the name tag in the script. CHDK gets very busy during the try to draw the script title into the scriptmenu. Current workarround to get it run, is to change the title in the script:

    Code: [Select]
    @title Fast MD Burst/Review + Mask 080411
    to
    @title Fast MD Burst

    I find the root cause for the "crash" here, it looks like a bug in the CHDK core gui_menu.c function:
    In the the case "case MENUITEM_SEPARATOR:"  the xx coordinate calculation is done in that way:

    Code: [Select]
                       j = rbf_str_width(lang_str(curr_menu->menu[imenu].text));
                        xx+=(w-j-len_space*2)>>1;
                        ..
                        draw_line(x+len_space, yy+rbf_font_height()/2, xx-1, yy+rbf_font_height()/2, cl);
                        draw_filled_rect(x+len_space, yy+rbf_font_height()/2+1, xx-1, yy+rbf_font_height()-1, MAKE_COLOR(cl>>8, cl>>8));
    On the G11 (with a screen_width of 320 Pixels, and not with the "usual" 360), this calculation results with the md_burst title to a really big negative xx coordinate:

    Code: [Select]
    unsigned int w=260;
    int j=272;
    int lenspace=8;
    int xx=30;
     xx+=(w-j-len_space*2)>>1;
      Result is:  xx=-2147483632

    So the following draw functions start to draw a really, really, long line over the hole RAM area, and crashes the camera.
    I can workarround/bugfix this by adding a cast in that way:
    Code: [Select]
    xx+=((int)w-j-len_space*2)>>1;
    or so:
     xx+=(int)(w-j-len_space*2)>>1;

    Both fixes the problem with the "unsigned int w", which seems to be the cause for negative xx result.
    But the drawn result looks not so good, because the width is now correct (check attached photo).

    Another way to fix the crash is to change the calculation of w in void gui_menu_init(CMenu *menu_ptr):
    Code: [Select]
      Original code: w = screen_width-30-30;
    G11 fix version: w= screen_width-10-10;
    This fixes the crash, and also the menu looks good on the G11. But why are here used "fixed" magics (-30) anyway?

    So i think the calculation routines in gui_osd.c needs some updates to fix the problem with cameras which
    have a screen_width smaller then 360 (which are working fine with the above "unfixed" calculation routine).

    Should i open a new issue in the CHDK mantis bugtracking system for that?
    « Last Edit: 20 / January / 2010, 15:10:59 by ERR99 »

  • Publish
    Re: G11 porting
    « Reply #316 on: 20 / January / 2010, 16:11:31 »
    On the G11 (with a screen_width of 320 Pixels

    That is news !

    The only other camera with that screen width is the SX200IS.

    In camera.h:-

        #define CAM_X_STRETCH               1   // 1 = no stretch, 2 = 2x, 3 = 9/4 times

    value should be '3' to 'stretch' 320 to 720.

    That is used by the draw pixel function.


    *

    Offline ERR99

    • ****
    • 339
  • Publish
    Re: G11 porting
    « Reply #317 on: 20 / January / 2010, 16:40:34 »
    Are you sure? I searched for CAM_X_STRETCH and cant find any occurence of that in CHDK.
    In the SX200IS Port, the only reference to 9/4 is this:
    Code: [Select]
      #define ASPECT_XCORRECTION(x)  ( ( ((x)<<3) + (x) )  >>2 )   //correction x*screen_buffer_width/screen_width = x*720/320 = x*9/4 = (x<<3 + x)>>2
    And i allready use this seetings in my G11 Port.  :blink:


  • Publish
    Re: G11 porting
    « Reply #318 on: 20 / January / 2010, 17:50:13 »
    In gui_draw.c, draw_init() calls 'draw_set_aspect_xcorrection_proc(NULL)' which selects 'aspect_xcorrection_std' that returns ASPECT_XCORRECTION(x).

    For the SX200IS and G11 that returns ( ( ((x)<<3) + (x) )  >>2 )  which = 9x/4.

    Anyway, you have already done that.

    Screen width in the menus is a different issue I guess  ::)

  • Publish
    Re: G11 porting
    « Reply #319 on: 21 / January / 2010, 06:04:50 »
    Hey guys,
    I've been following you all since page 18 and you've been doing phenomenal work! I am still currently a G10 owner and wasn't planning on upgrading anytime soon, but I was wondering if you'd be able to create anything at all to work with the G10 or at the absolutely very least, allow me to override the shutter speed. I figured it wouldn't work, but I went ahead and loaded the Diskboot.bin that you had created and it of course didn't work. I thought maybe by some crazy strike of luck that just because they had the same DryOS and Digic IV processor that it'd magically work.

    I was just curious as to how much work it'd be to create something for the G10. Anywho, thanks for your awesome work!

     

    Related Topics