Adding new cameras, applying patches into trunk (with source code prepared) - page 38 - General Discussion and Assistance - CHDK Forum

Adding new cameras, applying patches into trunk (with source code prepared)

  • 1685 Replies
  • 863173 Views
*

Offline reyalp

  • ******
  • 14128
Advertisements
I've added the memory saving patch in changeset 1234

There's a couple things I'm not entirely happy with:
In gui_menu.h, making title a short means you can't stuff an actual string in there, you have to use a lang string. I think this is OK with the current code, but in other places it's assumed you can interchangeably use a string or lang id. Given that this is only for top level menu tiles, I'm not sure the saving is worth the confusion. Doing this for menu items would be a much bigger saving, but the string problem is bigger there (we actually use strings in a few places).

In gui_draw.c, the globals for xMin getting initialized as a side effect of draw_rectangle makes me cringe.

I understand SVN doesn't make this particularly easy...
Time to switch to Mercurial  :D
A topic for a different thread (this one, to be specific: http://chdk.setepontos.com/index.php?topic=2304.0 ), but I'm open to switching to a DVCS. It really would be a better fit for the CHDK development model, but there are issues...
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Thanks again,

In gui_menu.h, making title a short means you can't stuff an actual string in there, you have to use a lang string. I think this is OK with the current code, but in other places it's assumed you can interchangeably use a string or lang id. Given that this is only for top level menu tiles, I'm not sure the saving is worth the confusion. Doing this for menu items would be a much bigger saving, but the string problem is bigger there (we actually use strings in a few places).

Probably right - I tried changing both but ran into the issue with the strings being stored instead of the lang id (now this really makes me cringe). Didn't see any cases of this being done at the menu level so I left that one in. Was going to fix menuitem as well (using special lang id codes for the string cases); but need more time to analyse the code.

Quote
In gui_draw.c, the globals for xMin getting initialized as a side effect of draw_rectangle makes me cringe.

Should have made these variables static so they are at least local to gui_draw.c. Not perhaps the most elegant code; but it does help keep the size down :)

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 reyalp

  • ******
  • 14128
Probably right - I tried changing both but ran into the issue with the strings being stored instead of the lang id (now this really makes me cringe). Didn't see any cases of this being done at the menu level so I left that one in. Was going to fix menuitem as well (using special lang id codes for the string cases); but need more time to analyse the code.
If you can't just stuff a string in there, I'm not sure what a special ID will gain you. It's quite convenient to be able to just throw in a string for development, rather than going through the whole lang system.
Quote
Should have made these variables static so they are at least local to gui_draw.c. Not perhaps the most elegant code; but it does help keep the size down :)
They are static, it just assumes draw_rectangle will be called before the other functions.

Freeing up memory is good, but there's a limit how much readability/maintainability I'm willing to sacrifice. I'd really rather go in the other direction...
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Probably right - I tried changing both but ran into the issue with the strings being stored instead of the lang id (now this really makes me cringe). Didn't see any cases of this being done at the menu level so I left that one in. Was going to fix menuitem as well (using special lang id codes for the string cases); but need more time to analyse the code.
If you can't just stuff a string in there, I'm not sure what a special ID will gain you. It's quite convenient to be able to just throw in a string for development, rather than going through the whole lang system.

Good point - hadn't considered that aspect. Probably best to leave this as is then (for consistency I'd probably change the menu struct back to what it was?).

Quote
Quote
Should have made these variables static so they are at least local to gui_draw.c. Not perhaps the most elegant code; but it does help keep the size down :)
They are static, it just assumes draw_rectangle will be called before the other functions.

Freeing up memory is good, but there's a limit how much readability/maintainability I'm willing to sacrifice. I'd really rather go in the other direction...

I'll add some comments to the source (it's only the fill rectangle routine that needs draw_rectangle called first) :)

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 philmoz

  • *****
  • 3450
    • Photos

Have either of you tested this with non-default languages ?


Can you roll back the change to lib/lang/lang.c - the new version I posted doesn't work with the language files that don't contain translations for all of the strings.

Back to the drawing board  :(

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 reyalp

  • ******
  • 14128

Have either of you tested this with non-default languages ?


Can you roll back the change to lib/lang/lang.c - the new version I posted doesn't work with the language files that don't contain translations for all of the strings.

Back to the drawing board  :(
Done, changeset  1236
Don't forget what the H stands for.

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Following a report by maverick here and the following posts (#913 - 918) here is the requested patch.
This essentially resets CAM_JPEG_WIDTH, CAM_JPEG_HEIGHT, and the 4 CAM_ACTIVE_AREA
camera properties for S95 to the values used for S90 and G11, which use the same sensor.

According to maverick, this allows S95 generated DNGs to be opened in Photoshop CS5.

Note that I have no idea why this would be, this was just a lucky guess  :D

Patch generated by diffing modified trunk1236 with trunk1236

wim

[edit: This does not appear to improve DNGs in RawTherapee for me, see attached
"s95_cam_active_area_readme.txt" for  links to 2 DNGs for comparison]




« Last Edit: 11 / July / 2011, 05:48:46 by whim »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Patch to update palette for A1100.
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 funnel

  • ****
  • 349

I noticed in generic/shooting.c _MoveIrisWithAv is used both in the same ifdef as SX30 and G12 in shooting_av_bracketing as well as in shooting_set_av96_direct with an ifdef just for sx220hs

This looks like it will get called 2x in the bracketing case. I'm wondering if all the cameras couldn't just do it in the shooting_set_av96_direct ? Or is this really only needed for bracketing (not script overrides) on the SX30 and G12 ?

I contacted philmoz and he suggested to make a new define in camera.h. He tested the fix for both sx30 and g12.

I made some additional changes for sx220:
-added the adjustable ALT button code in core/gui.c and camera/kbd.c
-fixed and added two new modes in camera/shooting.c modelist
-added CAM_KEY_CLICK_DELAY 150 to platform_camera.h like the sx30 to fix the button clicks in ptp



« Last Edit: 11 / July / 2011, 09:39:40 by funnel »

Back from vacation and trying to build the latest versions for some of the cameras I'm keeping an eye on.  

Getting this with the ones I have tried so far :

Code: [Select]
========== C:\CHDK\TRUNK\TRUNK1236\BIN\LOGS\ERR-IXUS120_SD940-103C.TXT ==========

C:\CHDK\gcc4\bin\gmake.exe[2]: *** No rule to make target `../../tools/font_8x16_pack.exe', needed by `font_8x16_uni_packed.h'.  Stop.
C:\CHDK\gcc4\bin\gmake.exe[1]: *** [all-recursive] Error 1
gmake: *** [all-recursive] Error 1

Straight download of trunk 1236 via CHDK-Shell-v332.

UPDATE :  same result with gcc3 or gcc4


« Last Edit: 11 / July / 2011, 18:53:21 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal