Author Topic: Reverse CHDK boot button behaviour - stops loooooong press on/off  (Read 1606 times)

Offline whim

  • Guru Member
  • ******
  • Posts: 1977
  • A620/A630/A590-101b/i70-101b/i870-101a/i300
Hi !

Following a discussion started here http://chdk.setepontos.com/index.php/topic,3994.msg42107.html#msg42107 by Ezzelin with
Quote
One more thing... is there any way to have the camera always start in record mode when pressing the ON/OFF button? It's annoying to have to hold the button down. Is this standard behavior for CHDK?

i prepared a small patch to allow changing the button behaviour:

patch adds 'OPT_REVERSE_BOOTLOGIC=1'  to buildconf.inc -> binary will show 'reversed' boot behaviour:

  • short press on either on/off or play button starts cam in shoot mode
  • long press play button starts cam in play mode

if you change the buildconf.inc entry to '#OPT_REVERSE_BOOTLOGIC=1' -> binary will show normal boot behaviour:

  • short press on either on/off or play button starts cam in play/review mode
  • long press on/off button starts cam shoot mode

tested on ixus870_sd880, should work on: a2000, ixus870_sd880, ixus980_sd990, sx1, sx10, sx100is, sx110is, and sx200is

Caveats/remarks:
  • this will not make your cam start up any faster (at least not much)
  • this will increase the chance of it accidentally extending the lens ...
  • patch is against r820, works on r822 as well

hoping this 'paparazzo' mode is more usefull for others than it is for me  ;),

wim

EDIT: attach removed - see below for new version
« Last Edit: 13 / November / 2009, 18:10:56 by whim »

Offline RaduP

  • Hero Member
  • *****
  • Posts: 841
Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
« Reply #1 on: 27 / October / 2009, 04:28:54 »
  • Publish
  • On a somewhat related note, I found out that if the camera dies with the lens out, and you start CHDK via the bootdisk method, it will pull the lens back, extend them again and start in record mode (without using your patch). Not sure if that helps with anything, but I think it's interesting to know.

    Offline peregrine

    • Rookie
    • *
    • Posts: 11
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #2 on: 27 / October / 2009, 10:55:11 »
  • Publish
  • Thank you very much  Whim
    Excellent patch, I use it for 2 days in my sx200is, boy!!! its  faster to take the camera in shoot mode
    But is it possible to have it build as a CHDK menu?
    Thanks again for your work

    Offline whim

    • Guru Member
    • ******
    • Posts: 1977
    • A620/A630/A590-101b/i70-101b/i870-101a/i300
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #3 on: 27 / October / 2009, 15:04:28 »
  • Publish
  • @peregrine

    No, sorry. CHDK needs to know this before it has loaded it's CFG (see the original discussion linked in post #1)

    wim

    Offline peregrine

    • Rookie
    • *
    • Posts: 11
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #4 on: 12 / November / 2009, 14:40:50 »
  • Publish
  • Dear whim
    I tried to apply the patch to the 835 trunk using chdk shell but i ve failed, I used this method:
    "1. Put patch in your trunk root directory
    2. Open "Command line access to your current compiler" from CHDK-Shell interface.
    3. In that command window (should be in trunkXXX directory, point1.) type:
    patch --verbose -p0 <name_of_patch_file.diff "
    Any suggestions on how to apply the patch would be much appreciated

    Peregrine 

    Offline reyalp

    • Guru Member
    • ******
    • Posts: 4826
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #5 on: 12 / November / 2009, 14:47:25 »
  • Publish
  • You might want to explain in what way it failed.
    Don't forget what the H stands for.

    Offline peregrine

    • Rookie
    • *
    • Posts: 11
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #6 on: 12 / November / 2009, 14:52:20 »
  • Publish
  • You might want to explain in what way it failed.
    The camera starts as always ie     * long press on/off button starts cam shoot mode

    Offline reyalp

    • Guru Member
    • ******
    • Posts: 4826
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #7 on: 12 / November / 2009, 15:58:47 »
  • Publish
  • The camera starts as always ie     * long press on/off button starts cam shoot mode

    I'm not sure what you mean here, but you've left out a lot of steps between applying the patch and starting the camera. Really, go back and read your posts: Do you see enough information for anyone to have any clue what you did or didn't do ? I sure don't.

    Were there any errors when you followed the instructions for applying the patch ?
    Did you check the source to see whether the changes were correctly applied ?
    Did you build CHDK for your camera after you applied the patch ?
    Were there any errors when you tried to build CHDK
    Did you copy that freshly built image from the CHDK tree to your card ?

    You said in your earlier post http://chdk.setepontos.com/index.php/topic,4421.msg42331.html#msg42331 that the patch worked. So what is different now ?
    Don't forget what the H stands for.

    Offline whim

    • Guru Member
    • ******
    • Posts: 1977
    • A620/A630/A590-101b/i70-101b/i870-101a/i300
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #8 on: 12 / November / 2009, 17:09:49 »
  • Publish
  • @peregrine

    just tested it (applying patch, compiling & running the DISKBOOT.BIN on my ixus870_sd880)


    EDIT: testing on trunk836 and ixus870_sd880 101a -> fails, as you said: short press on/off -> PLAY mode !

    see next post for details

    wim
    « Last Edit: 12 / November / 2009, 20:27:14 by whim »

    CHDK Forum

    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #8 on: 12 / November / 2009, 17:09:49 »

    Offline ewavr

    • Developers
    • Hero Member
    • ****
    • Posts: 1057
    • A710IS
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #9 on: 12 / November / 2009, 18:12:51 »
  • Publish
  • -deleted-

    Offline whim

    • Guru Member
    • ******
    • Posts: 1977
    • A620/A630/A590-101b/i70-101b/i870-101a/i300
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #10 on: 12 / November / 2009, 20:35:06 »
  • Publish
  • @peregrine

    OK, here's what i found:

    1. the patch is successfully applied
    2. on compilation, the #ifdef .... #else ... #endif somehow does not get properly interpreted   ???
    3. if i take out the #ifdef etc. (just leaving the code line for reverse boot behaviour) it works ???

    i'm now preparing a new patch (against 836 of course) that ONLY changes the actual code line
    in boot.c ...

    wim

    Offline peregrine

    • Rookie
    • *
    • Posts: 11
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #11 on: 12 / November / 2009, 21:44:05 »
  • Publish
  • Thank you whim for taking trouble to check the patch again  :)

    Offline reyalp

    • Guru Member
    • ******
    • Posts: 4826
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #12 on: 13 / November / 2009, 02:47:57 »
  • Publish
  • @peregrine

    OK, here's what i found:

    1. the patch is successfully applied
    2. on compilation, the #ifdef .... #else ... #endif somehow does not get properly interpreted   ???
    3. if i take out the #ifdef etc. (just leaving the code line for reverse boot behaviour) it works ???
    The -D blah blah is must not be passed correctly into CFLAGS.
    Don't forget what the H stands for.

    Offline whim

    • Guru Member
    • ******
    • Posts: 1977
    • A620/A630/A590-101b/i70-101b/i870-101a/i300
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #13 on: 13 / November / 2009, 18:08:19 »
  • Publish
  • I just ripped out the whole OPT_blah stuff, in the hope that that will make
    the patches more 'resistant' (i don't much fancy updating this, because i
    don't use this myself)

    all it now does is this (example for SX200IS)
    Quote
    .....
    -   *(int*)(0x24C0+4)= (*(int*)0xC0220128)&1 ? 0x2000000 : 0x1000000; // replacement of sub_FF821BD4 for correct power-on.
    +// reverses the boot logic: cam starts in REC/SHOOT mode unless PLAY button long pressed
    +   *(int*)(0x24C0+4)= (*(int*)0xC0220128)&1 ? 0x1000000 : 0x2000000; // replacement of sub_FF821BD4 for correct power-on.
    +// normal boot logic: cam starts in PLAY/REVIEW mode unless ON/OFF button long pressed
    +//    *(int*)(0x24C0+4)= (*(int*)0xC0220128)&1 ? 0x2000000 : 0x1000000; // replacement of sub_FF821BD4 for correct power-on.
    .....

    i also added separate files for each supported cam, and expanded the readme ('patching.txt')
    tested on ixus870_sd880 101a

    wim
    « Last Edit: 13 / November / 2009, 19:36:26 by whim »

    Offline peregrine

    • Rookie
    • *
    • Posts: 11
    Re: Reverse CHDK boot button behaviour - stops loooooong press on/off
    « Reply #14 on: 13 / November / 2009, 23:31:48 »
  • Publish
  •  Tested and working on Sx200is  :D

     


    SimplePortal 2.3.3 © 2008-2010, SimplePortal