ELPH300HS aka IXUS220HS - Porting Thread - page 22 - DryOS Development - CHDK Forum supplierdeeply

ELPH300HS aka IXUS220HS - Porting Thread

  • 899 Replies
  • 399422 Views
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #210 on: 25 / November / 2011, 13:50:33 »
Advertisements
Ok, ALT mode is now available, too.  :D

I looked at the back of some Canon cameras and the ixus120_sd940 looked similar regarding the buttons.

ALT mode can be reached with KEY_ZOOM_OUT when using attached kbd.c

Next step will be to adapt to a better key for entering ALT mode because zoom_out_button is not really useful for this.  ;)
The IXUS120-SD940 uses the DISP button to enter <ALT> mode.   There is some code in its kbd.c file to time how long the DISP key is pressed - short for <ALT>,  medium for Brightness,  long for change display ( the medium and long presses emulate the original Canon functionality)
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline tommi2water

  • ***
  • 157
  • IXUS 220 HS Firmware: 1.00c
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #211 on: 25 / November / 2011, 13:56:11 »
Yes, I tried that, but KEY_DISPLAY is the same as KEY_DOWN in IXUS220. On IXUS120-SD940 it is a separate button.

Can you imagine how surprised I was when I was in ALT menu and wanted to go down?  ;)

On IXUS220 there is one special separate button, the Video button. I will try to use that one.

*

Offline tommi2water

  • ***
  • 157
  • IXUS 220 HS Firmware: 1.00c
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #212 on: 25 / November / 2011, 14:02:32 »
Using KEY_VIDEO 0x4000 works like a charm!  :)

Short Press Video button => ALT mode toggling
Long Press Video button => original Canon functionality

I can activate ALT mode, enter ALT menu, scroll through, activate/deactivate ...

But: How can I disable mapping of Keys to original Canon software? Have the KEYS_MASK defines to be used for this?

Answer: Yes, KEYS_MASK defines are exactly for this! Working, no annoying Canon OSD activity when in ALT mode. ;)

Result:


« Last Edit: 25 / November / 2011, 14:16:48 by tommi2water »

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #213 on: 25 / November / 2011, 14:30:53 »
Using KEY_VIDEO 0x4000 works like a charm!  :)

Yet one more ALT key. For you is it a good solution. But please read this thread: http://chdk.setepontos.com/index.php?topic=6787.msg72296#msg72296

Btw, you make a good porting job!

msl
CHDK-DE:  CHDK-DE links


*

Offline tommi2water

  • ***
  • 157
  • IXUS 220 HS Firmware: 1.00c
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #214 on: 25 / November / 2011, 14:36:42 »
Thanks for the hint, msl. I'm also no friend of special solutions / workarounds.

For me it's no problem to let another key work like a charm.  ;)

I will find out the corresponding key value and test it.

Update: KEY_PLAYBACK has value 0x8000

Uuuh, I don't get the Playback button under control? It switches between REC and PLAY mode.

For further testing I would like to stay with my KEY_VIDEO solution. But full acknowledge to change it to KEY_PLAYBACK later.

« Last Edit: 25 / November / 2011, 14:48:26 by tommi2water »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #215 on: 25 / November / 2011, 14:44:29 »
One thing, you have to manually populate the keymap table in kbd.c.

The first entry is the index into the physw_status array of the key, the second entry is the keyname, and the third is the bitmask for the key.

Bits in physw_status go low when the keys are pressed; so when you see a bit go low set that bit in the third entry in keymap.

When you have all the bits defined OR them together for each index value to get the KEYS_MASK? values.

To see physw_status enable the debug code in gui_draw_debug_vals_osd (gui.c) at around line 2290.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline tommi2water

  • ***
  • 157
  • IXUS 220 HS Firmware: 1.00c
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #216 on: 25 / November / 2011, 15:02:13 »
One thing, you have to manually populate the keymap table in kbd.c.

I think I'm already done with the keymap table.

I tested all available buttons/zoom and they work fine when CHDK is running.

Shooting images is also possible.

At this point I would like to cleanup my code a little bit and then commit this as a first (alpha?) version to CHDK repository (or give my code to someone who will do this). Is that already possible?




Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #217 on: 25 / November / 2011, 23:32:51 »
Great job Tommi.  You're really making some fast progress on this.


Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #218 on: 26 / November / 2011, 02:46:13 »
Thank you Tommy (and anyone who helps) for your job!
I have a question:
Is porting to a different version of the firmware (like 1.01A,1.01C, etc.) as difficult as it is for a different camera model?

*

Offline tommi2water

  • ***
  • 157
  • IXUS 220 HS Firmware: 1.00c
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #219 on: 26 / November / 2011, 05:00:09 »
Is porting to a different version of the firmware (like 1.01A,1.01C, etc.) as difficult as it is for a different camera model?

What I learned during my recent porting activities is, that it is not very difficult to port a different firmware version from an existing port of another firmware of the same camera.

I expect that only some addresses need to be changed.

If you take my code (btw: porting is not yet finished, I only worked on loader, boot.c and kbd.c) you should have a good starting point.

Download Firmware for 1.00c (which I am porting to).
Get CHDK-PT.

Look (first in loader files and in boot.c) for each address which is greater than 0xFF810000 and check that address in Firmware 1.00c with CHDK-PT. Save the found instruction code to a text file.

Than search in your Firmware version for the same piece of code. Probably it will be just some additional offset. But to be sure, please compare found Firmware functions with the used sub_FFxxxxxx_my functions in boot.c to have the correct instructions used in the functions.

btw: I only used CHDK-PT the way to save instruction sequences and load them into Notepad++ for comparison with my boot.c code. Maybe CHDK-PT has much more power to do some work for you? Waterwingz will know more about CHDK-PT usage.

Maybe it is also useful if you compare stubs_entry.S from 1.00c with your firmware's version.

As I am not much experienced with these activites maybe someone else can give additional tipps which can save you some more time?


 

Related Topics