I was planning on doing some awfully non-portable scripting and needed mode dial propcase values for all models. Well, if I'm not mistaken, they are listed in platform/*/main.c in a struct called modemap.
I checked platform/a570/main.c for propcase 49/50 values from my camera and found out they aren't the same... are the a570is modemap values copy&pasted from some other model and never checked or are they supposed to be different from the propcase values? Does CHDK even currently use the modemap for anything?
Of course, ultimately I only need a ubasic command which tells me the mode (I suppose the enum number from include/platform.h is fine). My memory leaks like [insert software&OS you hate] so I can't remember if we already have something like that in some build...
In any case for this to work properly the values need to actually be correct for all camera models. So, if modemap is supposed to match the propcase (49 and 50 in Digic III), below is a diff against trunk 430 to fix it for the a570is:
--- platform/a570/main.c-trunk430
+++ platform/a570/main.c
@@ -37,32 +37,27 @@
int hackmode;
int canonmode;
} modemap[] = {
- { MODE_AUTO, 32768 },
- { MODE_P, 32772 },
- { MODE_TV, 32771 },
- { MODE_AV, 32770 },
- { MODE_M, 32769 },
+ { MODE_AUTO, -32768 },
+ { MODE_P, -32764 },
+ { MODE_TV, -32765 },
+ { MODE_AV, -32766 },
+ { MODE_M, -32767 },
{ MODE_VIDEO_STD, 2597 },
{ MODE_VIDEO_SPEED, 2598 },
{ MODE_VIDEO_COMPACT, 2599 },
- { MODE_STITCH, 33290 },
+ { MODE_STITCH, -33246 },
{ MODE_SCN_WATER, 16406 },
{ MODE_SCN_AQUARIUM, 16407 },
{ MODE_SCN_NIGHT, 16398 },
- // { MODE_SCN_CHILD, 16399 },
- // { MODE_SCN_PARTY, 16400 },
{ MODE_SCN_GRASS, 16402 },
{ MODE_SCN_SNOW, 16403 },
{ MODE_SCN_BEACH, 16404 },
{ MODE_SCN_FIREWORK, 16405 },
- // { MODE_SCN_ISO_3200, 16411 },
- { MODE_INDOOR, 32785 },
- { MODE_KIDS_PETS, 32764 },
- { MODE_NIGHT_SNAPSHOT, 32779 },
- { MODE_LANDSCAPE, 32780 },
- { MODE_PORTRAIT, 32781 },
- // { MODE_SCN_SPORT, 16903 },
- // { MODE_SCN_COLOR_ACCENT, 16921 }
+ { MODE_INDOOR, -32751 },
+ { MODE_KIDS_PETS, -32752 },
+ { MODE_NIGHT_SNAPSHOT, -32757 },
+ { MODE_LANDSCAPE, -32756 },
+ { MODE_PORTRAIT, -32755 },
};
#define MODESCNT (sizeof(modemap)/sizeof(modemap[0]))