Language stuff - page 2 - General Discussion and Assistance - CHDK Forum

Language stuff

  • 27 Replies
  • 11182 Views
*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: changelog of trunk including comments / devtalk
« Reply #10 on: 02 / December / 2008, 18:06:11 »
Advertisements
nice.

by the way i noticed that in some menus changing something immediately changes the propcases, in some cases the propcases are updated after leaving the menu only (for example slideshow menu and printing submenu). makes looking for propcases a bit harder. but i guess soon the lists will be complete :)
oh i will check on vxworks if these are r/w (nobody did that before, not in the wiki at least), perhaps one of you dryos (digicIII) guys can check the propcases in the wiki if they can be writable (the values that arent tagged otherwise in the wiki)
btw i'm also interested if overriding of propcases works on cameras that normally can NOT set them (like for example ewavr did for sx100 - rear curtain flash. overriding is possible, canon just "forgot" to add a menu entry for it...)
« Last Edit: 02 / December / 2008, 18:19:10 by PhyrePhoX »

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: changelog of trunk including comments / devtalk
« Reply #11 on: 02 / December / 2008, 18:29:50 »
what pattern do you see?

DigicIII

language 1 PAL 0x0001 NTSC 0x0000
language 2 PAL 0x0101 NTSC 0x0100
language 3 PAL 0x0201 NTSC 0x0200
language 4 PAL 0x0301 NTSC 0x0300
language 5 PAL 0x0401 NTSC 0x0400
language 6 PAL 0x0501 NTSC 0x0500

DigicII

language 1 PAL 0x0002 NTSC 0x0001
language 2 PAL 0x0102 NTSC 0x0101
language 3 PAL 0x0202 NTSC 0x0201
language 4 PAL 0x0302 NTSC 0x0301
language 5 PAL 0x0402 NTSC 0x0401
language 6 PAL 0x0502 NTSC 0x0501

But digic II and III haven't the same language order!
CHDK-DE:  CHDK-DE links

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Language stuff
« Reply #12 on: 11 / December / 2008, 17:35:15 »
split the thread from the devtalk thread.

i tried coding something useful out of the propcase/language thing, but i failed. not because i didnt know what to do, but because i didnt know HOW to do it.
maybe one of you folks have a clue on how to do it (codewise).
i want on a fresh chdk install (when cfg is created) the lang file and the codepage automatically set so that it corresponds to the camera's language setting. also i'd like a lua/ubasic command which returns the language, so that one could write scripts that could be read and run in all languages.

now i have two problems: difference between digic II / digic III propset (different order) and the thing about the odd numbers (pal / ntsc). i'm sure i could come up with a solution, but that would blow up the code & binary. so i'm looking for a clever solution.
any hints appreciated, and mind you: i am no programmer/coder.

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Language stuff
« Reply #13 on: 11 / December / 2008, 18:42:44 »
In a710, for example (propcase #196):

english 65538
deutsch 65794
etc  :haha


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Language stuff
« Reply #14 on: 11 / December / 2008, 18:52:32 »
hey pal, these numbers are for PAL and propset 1 only :D
i just dont know where and how to insert the table/struct so that for example LANG_GERMAN is always the same, regardless of propset & PAL/NTSC status

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Language stuff
« Reply #15 on: 11 / December / 2008, 19:24:18 »
hey pal, these numbers are for PAL and propset 1 only :D

For a710 english is 65538 = 0x10002. What this 0x10000 means?

Quote
i just dont know where and how to insert the table/struct so that for example LANG_GERMAN is always the same, regardless of propset & PAL/NTSC status

something like shooting tables in shooting.c (not tesed, just idea):
Code: (c) [Select]
typedef struct {int CHDK_lang, int Canon_lang} LangTable;

enum {
 LANG_UNKNOWN,
 LANG_ENGLISH,
 LANG_GERMAN,
 .....
 }

#if (PROPSET_1)
LangTable lang_table []={
 {LANG_ENGLISH, 0},
 {LANG_GERMAN,  1},
....
}
#else
 .. the same for other propset
#endif

int get_chdk_lang(void){
 short z;
 int i;
 get_property_case(PROPCASE_LANG, z, sizeof(z));
 z>>=8; // forget about PAL/NTSC
 for (i=0; i<sizeof(lang_table)/sizeof(lang_table[0]); i++) if (lang_table[i].Canon_lang==z) return lang_table[i].CHDK_lang;
 return LANG_UNKNOWN;
}
« Last Edit: 11 / December / 2008, 19:26:02 by ewavr »

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Language stuff
« Reply #16 on: 11 / December / 2008, 20:46:38 »
And about other languages (see attachment).

sources: google (+google translator), List of Wikipedias.

Re: Language stuff
« Reply #17 on: 11 / December / 2008, 22:30:29 »
It seems to me that many of you are misunderstanding that some PropVars (hardware io) are actually bitfields. To discover the pattern, you need to use hex numbers and not decimal numbers, and to look at how individual bits or groups of bits within the hex numbers change.

msl is onto the right solution:
Quote
DigicIII
language 1 PAL 0x0001 NTSC 0x0000
language 2 PAL 0x0101 NTSC 0x0100
language 3 PAL 0x0201 NTSC 0x0200
language 4 PAL 0x0301 NTSC 0x0300
language 5 PAL 0x0401 NTSC 0x0400
language 6 PAL 0x0501 NTSC 0x0500

DigicII
language 1 PAL 0x0002 NTSC 0x0001
language 2 PAL 0x0102 NTSC 0x0101
language 3 PAL 0x0202 NTSC 0x0201
language 4 PAL 0x0302 NTSC 0x0301
language 5 PAL 0x0402 NTSC 0x0401
language 6 PAL 0x0502 NTSC 0x0501

My first guess from the above information would be that the Propvar is made up of two bytes. One byte is the language, and the second byte is the Video Signal Standard (TV Systems: A Comparison) - looks like there is more than just PAL and NTSC supported. It looks like what has happened that from Digic II to Digic III they have changed the constants.

It is possible that they have squeezed some other bits into the 16 bits with other meanings (e.g. video standard might only be 2 bits, and the other six bits out of that byte might be used for other purposes).

One way to code for this is to use bitfield structs in C.

ewavr asked:
Quote
For a710 english is 65538 = 0x10002. What this 0x10000 means?

Hmmm, I thought propcases were 16 bits, but if they are more then bit 17 (or bits 17 to 32) probably has another meaning that we have yet to discover.

Sorry if I am sayign stuff that you know already - it just seemed as though this was the underlying problem to some of your questions...
« Last Edit: 11 / December / 2008, 22:33:36 by robocat »


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Language stuff
« Reply #18 on: 12 / December / 2008, 02:46:58 »
thanks for the codeidea, will try to come up with something.

And about other languages (see attachment).

sources: google (+google translator), List of Wikipedias.
good idea looking it up in the wikipedia :)
btw i noticed that on a620, urkainian is missing (weird, as i thought the s3is came out earlier than the a620). also i noticed that the propcase is writable, meaning we can set the language and/or video format (which isnt very useful right now, but might be useful to someone sometime).

robocat, thanks for explaining this. i dont know how to use and create a bitfield struct though :D
but i guess by looking into ewavrs code, he sort of already does that, doesnt he?

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Language stuff
« Reply #19 on: 12 / December / 2008, 05:02:10 »
i give up :D i cant get it to work, though i guess ewavrs example is really good. shows i am not a good coder, again :)

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal