Author Topic: [REQ]Adding new cameras, applying patches into trunk (with source code prepared)  (Read 51125 times)

Offline kms

  • Newbie
  • *
  • Posts: 2
A tiny patch for the venerable A710is.

Could this be added to include/camera.h in the A710is section:

#define  CAM_REAR_CURTAIN 1

I've built with this enabled and taken photos to verify that it does
indeed change the rear curtain setting correctly.

Kim.

Offline ultimA

  • Full Member
  • ***
  • Posts: 137
Here is a set of changes: http://drop.io/ultimaa/asset/for-chdk-931-patch

First, the short log:
- Optimizations to edge overlay
- Make edge overlay more "multitask-friendly"
- Detect a full shutter press during edge calculations too
- Wrap pano-modes in edge menu & change icons (by msl)
- Backport fixes from #928 SX20 1.02d to 1.02b
- Add experimental PTP support to SX20 1.02d (based on mweerden's PTP proposal 20/07/2010)
- Center edge overlay horizontally
- Make the overlay's horizontal area larger (+6 pixels)

And now some details:
First, the 1.02b of SX20 has received some love from me. It now has all the fixes that went in for 1.02d in #928 and its changes have been tested in the german forum. 1.02b is now also considered stable, please enable the autobuild. Second, the edge overlay has received some updates, but nothing that would change behavior. It does not fail to detect shutter presses any more, and it is also noticably faster. Also, I now only update half of the screen on every call to make it more friendly to other tasks. This effect is sometimes visible in that on a full-screen reinitialization only half of the edges are on the screen, but after 1/2 sec the other half is painted too. A complete update cycle is about unchanged since each update takes half the time now. There are some other changes too (as seen in the change list) but those are pretty self explanatory. The PTP-parts are useless without applying the PTP proposal itself, of course, which needs to be patched separately by the user (the port can be built without the PTP-proposal without changes).

« Last Edit: 02 / September / 2010, 19:35:22 by ultimA »

Offline fe50

  • Guru Member
  • ******
  • Posts: 2608
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
@ kms - Hello & welcome, Kim !

Could this be added to include/camera.h in the A710is section:
#define  CAM_REAR_CURTAIN 1
Done with CHDK changeset #931, thx for testing !

Offline fe50

  • Guru Member
  • ******
  • Posts: 2608
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Here is a set of changes: http://drop.io/ultimaa/asset/for-chdk-931-patch
Done in changeset #931 - used your "short log" for SVN comment this time  :D

Offline ewavr

  • Developers
  • Hero Member
  • ****
  • Posts: 1057
  • A710IS
A tiny patch for the venerable A710is.
#define  CAM_REAR_CURTAIN 1

But why, A710 has native rear curtain support.

Offline kms

  • Newbie
  • *
  • Posts: 2
But why, A710 has native rear curtain support.

Indeed. The patch is not required (though it is harmless, just adds an extra chdk config item).
Good to know the underlying chdk machinery for this works, though :)

The problem was I misunderstood the comment in camera.h:
    #undef  CAM_REAR_CURTAIN                // Camera do not have front/rear curtain flash sync
Too many negatives! Perhaps this could be amended to:
#undef CAM_REAR_CURTAIN  // when defined, enable front/rear curtain flash sync for cameras that dont already provide this

Kim.



Offline ultimA

  • Full Member
  • ***
  • Posts: 137
Hi All,

Some small changes I'm proposing to trunk can be found at http://drop.io/hidden/jlqkjtgpqd29rhy/asset/cGF0Y2g5NTMtZGlmZi0y

Changelog:
- Fix: Make the A2000, G11 and ixus100_sd780 ports compatible with GCC 4.5. Apparently GCC 4.4 was too forgiving and still built the code, but GCC 4.5.1 errored out on them. This patch fixes the ASM so that these cams can be built successfully. The changes were not actually tested, but the fixes are trivial. As a result, all stable ports can be built using GCC 4.5.1 now. Credit also goes to whim who noticed these cams failing to build and he also suggested the first set of fixes.
- Shut up some (not all) warnings from ixus100_sd780, ixus40_sd300, ixus65_sd630, s5is, ixus60_sd600
- Fix: Make edge overlay respect OPT_EDGEOVERLAY. Previously, generated binary size did not get significantly smaller even when OPT_EDGEOVERLAY was undefined, because undefining it only resulted in the overlay being excluded from the menu, but still being built. Excluding edge overlay now saves appr. 3Kbytes.
- Fix: Edge overlay erroneously depended on OPT_DEBUGGING. Builds failed when OPT_DEBUGGING was not defined previously.
« Last Edit: 07 / October / 2010, 04:40:26 by ultimA »

Offline whim

  • Guru Member
  • ******
  • Posts: 1957
  • A620/A630/A590-101b/i70-101b/i870-101a/i300
thanks, ultimA !

In case you hadn't done this yet, I just regression-tested with GCC 4.4.0 and patched 953 still produces
exactly the same errors as the unpatched 953  :)

cheers,

wim

Offline ultimA

  • Full Member
  • ***
  • Posts: 137
In case you hadn't done this yet, I just regression-tested with GCC 4.4.0 and patched 953 still produces
exactly the same errors as the unpatched 953  :)

Errors? Didn't 4.4.0 only had warnings, but no errors? I've tested the patch on all cameras by doing a 'make batch-zip' and all build fine on 4.5.1. I only have one compiler set up at the moment and I did not do regression testing using the old GCC. Do you mean that it is now 4.4.0 that cannot compile?
« Last Edit: 05 / October / 2010, 01:27:08 by ultimA »

CHDK Forum


Offline whim

  • Guru Member
  • ******
  • Posts: 1957
  • A620/A630/A590-101b/i70-101b/i870-101a/i300
Oops, sorry - warnings, not errors for ixus100_sd780 ...
It has exactly the same warnings as before - mostly related to blinking and debugging
code corpses lying about

sorry for the scare ;)

wim

Offline ultimA

  • Full Member
  • ***
  • Posts: 137
Oops, sorry - warnings, not errors for ixus100_sd780 ...

Phew... so scared the **** out of me, don't do that again! :D
Yeah, those warnings are there but they were there before too. I did not investigate any of them yet, although to be honest, I'm not sure I will.

Offline whim

  • Guru Member
  • ******
  • Posts: 1957
  • A620/A630/A590-101b/i70-101b/i870-101a/i300
It was just an ill-timed low cafeine level, i guess  :D
Now that that's fixed, I'll try and figure out how the edge overlay disable fixes work out,
never use it anyways (although I usually load vanilla builds on my cams)

wim


Offline ultimA

  • Full Member
  • ***
  • Posts: 137
I refreshed the patch from my 04.okt. post. It fixes all the warnings for the ixus100, and also fixes some other warnings. Some are still left, because I don't have these cameras, so I only took on the trivial fixes as I have no possibility to test. Many of the remaining warnings would have needed me to dive into firmware disassembly. Changes have been compile-tested on GCC 4.4 and 4.5.1.

Offline fe50

  • Guru Member
  • ******
  • Posts: 2608
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Some small changes I'm proposing to trunk can be found at http://drop.io/hidden/jlqkjtgpqd29rhy/asset/cGF0Y2g5NTMtZGlmZi0y
Changelog:
- Fix: Make the A2000, G11 and ixus100_sd780 ports compatible with GCC 4.5. Apparently GCC 4.4 was too forgiving and still built the code, but GCC 4.5.1 errored out on them. This patch fixes the ASM so that these cams can be built successfully. The changes were not actually tested, but the fixes are trivial. As a result, all stable ports can be built using GCC 4.5.1 now. Credit also goes to whim who noticed these cams failing to build and he also suggested the first set of fixes.
- Shut up some (not all) warnings from ixus100_sd780, ixus40_sd300, ixus65_sd630, s5is, ixus60_sd600
- Fix: Make edge overlay respect OPT_EDGEOVERLAY. Previously, generated binary size did not get significantly smaller even when OPT_EDGEOVERLAY was undefined, because undefining it only resulted in the overlay being excluded from the menu, but still being built. Excluding edge overlay now saves appr. 3Kbytes.
- Fix: Edge overlay erroneously depended on OPT_DEBUGGING. Builds failed when OPT_DEBUGGING was not defined previously.
I refreshed the patch from my 04.okt. post. It fixes all the warnings for the ixus100, and also fixes some other warnings. Some are still left, because I don't have these cameras, so I only took on the trivial fixes as I have no possibility to test. Many of the remaining warnings would have needed me to dive into firmware disassembly. Changes have been compile-tested on GCC 4.4 and 4.5.1.

Thx ultimA !  ... added to the trunk, changeset #955.

Offline reyalp

  • Guru Member
  • ******
  • Posts: 4490
A note on the last "cleanup"

Code: [Select]
BL      0xFFC0BD98
BL      0xFFC0BB50
This is wrong. It does NOT jump to the given address, because B and BL only take 24 bit PC relative offsets. It will crash.  The "correction"
Code: [Select]
BL      =0xFFC0BD98
BL      =0xFFC0BB50
Is also wrong. In this case, it doesn't matter much because it's an assert anyway.

Explanation: http://chdk.wikia.com/wiki/CHDK_Coding_Guidelines#Calling_original_ROM_functions

There are several correct ways do do this
#1)
BL sub_<address>
CHDK build process will automatically put the correct shim in stubs_auto.S
edit: Note, this only applies to platform files mentioned in STUBS_AUTO_DEPS

#2)
MOV LR, PC
LDR PC, =<address>
for a BL, or just the LDR for a B

#3)
Add a stub to stubs_entry_2.S, and use B/BL <name>

B/BL <constant> is not something that you are ever likely to want to do.

edit:
and ADR should should generally be translated to the appropriate LDR =constant, although AFAIK ADRL will do the right thing if it assembles at all.

Random debugging code (e.g.  ixus100 boot.c) should be #if 0'd out to save memory.

I'm going to grep the code for all the B/BL [0=]0x* and fix them. Something to look out for when adding ports, it seems to be a common mistake.
« Last Edit: 17 / October / 2010, 04:31:29 by reyalp »
Don't forget what the H stands for.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal