new branch - CHDK : Elf Edition - Developers wanted - page 21 - General Discussion and Assistance - CHDK Forum

new branch - CHDK : Elf Edition - Developers wanted

  • 316 Replies
  • 130872 Views
*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #200 on: 10 / January / 2012, 05:27:22 »
Advertisements
I have updated the reyalp-flt branch with the hash based method of finding exported symbols (as described in previous postings).

In this version I have also moved the entire 'Games' sub-menu to a module.
While not a huge space saving this demonstrates an interesting pattern that might be useful elsewhere.

Games aren't really fundamental to CHDK - I'm using this to illustrate an approach, not because I play a lot of games on my cameras :)

The core CHDK now has a single menu entry 'Games' that loads the new games sub-menu module - it knows nothing else about the games except the name of this module. This module simply displays a menu of options (the games). When a user selects a game it is run (as a module).

With this model new games can be added to CHDK and can appear in the 'Games' sub menu without making any changes to the core CHDK code (unless new exported symbols are required).

The games menu uses a static menu list embedded in the gui_games.c code; but there is no reason it could not build the menu dynamically from a config file or even by scanning the SD card (assuming the Opendir problem can be resolved).

The last change is to make all the games use the 'simple_game.c' code for consistency.

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)

Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #201 on: 10 / January / 2012, 06:03:12 »
Last updates code looks good for me.

The games menu uses a static menu list embedded in the gui_games.c code; but there is no reason it could not build the menu dynamically from a config file or even by scanning the SD card (assuming the Opendir problem can be resolved).
I think that for this item opendir problem is very rare. It could only possible crash on dynamic scan if user try to go to Games submenu too quick after start or shoot. I think this is very uncommon scenario. :)

1. Flat version should be increased. Module become undetectable uncompatible again.
#define   FLAT_VERSION       0x00000006L

2.  No remark about conf in comment in make_export.c (because this is incorrect now)

3. I think this is good to add comment about hash array in module_exportlist. What is its purpose and that developer shouldn't touch it.

And last difficult with module-compatible (excluding my vision of static binding in this section :) ) - is at least partial internationalization of module.
Currently module should use build-in strings or be strongly depend on CHDK revision just because lang file (and build-in strings table) should have related strings. Even If no other incompatibility exists.

PS. I will commit today or tomorrow draft version of integrated virtual keyboard into reyalp-flt. I will be out of internet for some period of time in few days.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #202 on: 10 / January / 2012, 06:23:50 »
Last updates code looks good for me.

The games menu uses a static menu list embedded in the gui_games.c code; but there is no reason it could not build the menu dynamically from a config file or even by scanning the SD card (assuming the Opendir problem can be resolved).
I think that for this item opendir problem is very rare. It could only possible crash on dynamic scan if user try to go to Games submenu too quick after start or shoot. I think this is very uncommon scenario. :)

1. Flat version should be increased. Module become undetectable uncompatible again.
#define   FLAT_VERSION       0x00000006L

2.  No remark about conf in comment in make_export.c (because this is incorrect now)

3. I think this is good to add comment about hash array in module_exportlist. What is its purpose and that developer shouldn't touch it.

And last difficult with module-compatible (excluding my vision of static binding in this section :) ) - is at least partial internationalization of module.
Currently module should use build-in strings or be strongly depend on CHDK revision just because lang file (and build-in strings table) should have related strings. Even If no other incompatibility exists.

PS. I will commit today or tomorrow draft version of integrated virtual keyboard into reyalp-flt. I will be out of internet for some period of time in few days.

Adding some more documentation is next on my list of things. I will update the version number as well (hadn't noticed that one).

Moving the language strings, including translated versions, into the module would be a great thing to be able to do; but I have no idea how it might be achieved (yet).

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)

Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #203 on: 10 / January / 2012, 06:37:15 »
FLAT version should be changed if incompatible changes in format made. This implementation of hash change meaning of import symbol value. And CHDK core doesn't differenciate this.

Possible idea of several languages integrated into the module:

somewhere in the core.
// to know what is lang if no file selected
char default_lang[]=OPT_DEFAULT_LANG;

somewhere in the module:
struct lang_maps list_of_lang[]={ "english", eng_map,
                               "russian", rus_map,
                              0}; // to bind idx with currently selected language file
char** current_langmap;

char* eng_map[] = { "first_string", "secondstring", 0};


//usage:
current_langmap= find_current_charmap(list_of_lang); // by default is first entry of list_lang
char* str=local_lang_str(idx);


This is cover problem only partially:
1. Not all languages are covered. But this is couldn't be resolved.
2. It couldn't be used for submenus, because use local index. And global index couldn't be used because possible collision between different modules.
3. It take additional space for different languages

Have no ideas how to resolve this problems. :)
« Last Edit: 10 / January / 2012, 11:36:18 by tsvstar »

Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #204 on: 10 / January / 2012, 07:52:23 »
reyalp-flt rev1536 fail to compile on my s95

error message is:

In file included from module_exportlist.c:334:0:
module_hashlist.h:178:15: error: lvalue required as unary '&' operand
G:\Downloads\canon_s95\CHDKSHELL_340\gcc462\bin\gmake.exe[1]: *** [module_exportlist.o] Error 1

module_hashlist.h:178 is
{ 0xe6031ce5, &GetExMemInfo },

Looks like this symbol is #define 0

UPD: I have a question about hash algorithm. Please correct me if I'm wrong but are first chars of long symbols have influence? I see no cyclic link. So looks like only last 7 character of symbol have theoretical influence on a hash.

lang_strhash31() have cyclyc link and also very simple. Maybe better to use it instead?
« Last Edit: 10 / January / 2012, 08:52:43 by tsvstar »

Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #205 on: 10 / January / 2012, 08:45:37 »
I update reyalp-flt branch. New changes are draft version of keyboard.

* Added _tbox. This mean "text box" and allow to enter/edit string. This module authors are TobiMarg and outslider
* Updated mpopup. Now it is possible to organize multilevel popup menus
* Updated fselect. Popup menu is reorganized, new options are added: mkdir, rename, rmdir. Last one not implemented yet.
« Last Edit: 10 / January / 2012, 11:38:34 by tsvstar »

*

Offline hwntw

  • ***
  • 162
Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #206 on: 10 / January / 2012, 12:33:00 »
Hello,
I get same error message as Tsvstar when compiling for my G9 100i. Error also refers to getmemInfo in module_hashlist.h (build Reyalp-flt 1537).

Colin
Ixus 95 IS Ixus 30 izoom Powershot S80 S100 S200


Windows 10

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #207 on: 10 / January / 2012, 14:21:05 »
Changeset 1538 should fix the compile error, and I've updated the FLAT_VERSION.

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
Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #208 on: 10 / January / 2012, 17:08:30 »
I update reyalp-flt branch. New changes are draft version of keyboard.

* Added _tbox. This mean "text box" and allow to enter/edit string. This module authors are TobiMarg and outslider
* Updated mpopup. Now it is possible to organize multilevel popup menus
* Updated fselect. Popup menu is reorganized, new options are added: mkdir, rename, rmdir. Last one not implemented yet.

Nice work to all on the text box.

I have question though - why load the character map from a file (and incur all the extra overhead in the 'modules.c' code).

The character map is small so why not simply have an array of all available character maps built into the gui_tbox.c code?

If you also create a sub-menu for the text box system in the core you can move the character map selection menu item into the module so adding new character maps has no impact on the CHDK core code. Character map selection can then be by map name rather than browsing the file system to find the .key file.

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)

Re: new branch - CHDK : Elf Edition - Developers wanted
« Reply #209 on: 11 / January / 2012, 01:40:29 »
By default it IS in the tbox. And you shouldn't load keyboard profile (charmap) if you satifsfied with default one.

Loadable charmap have three functions:
1. Less important - several different input scheme could exists at same time in future. For someone different one could be more comfortable. I realize that I could just replace _tbox with another one, but integration into config is more transparent for enduser.
2. I could prefer different charmap (for example add some special chars, or space if my camera have no disp and no zoomer)
3. I could request to use my national symbols.

Now this separated to easy to create (and even modify inside camera with EDI) text file which could be writed (but not required) by developer or even end-user.

It is not moved to module because item#1 (keyboard profile describe which module should be called) and core code take only ~400byte +100byte of config value(which anyway have to be)

It is not require submenu only simple one item (just call fselect and strcpy on callback) required and it placed into Visual setting (as lang file because this is similar thing).

PS. I forget to move load_file common function to lang.c then it will be used by load_from_file and core size impact decreased even more (upd - it is moved in rev1539)

UPD: One of possible benefit of item#1 (module name configuration) is touchscreen cameras.
If touch on-screen keyboard module will be created, it could co-exist with common keyboard module in the trunk as different module and easily selected by load configuration.
« Last Edit: 11 / January / 2012, 05:14:22 by tsvstar »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal