Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#11027 - Support for "Pebbles", small visualisation plugins that get loaded into the skin buffer

Attached to Project: Rockbox
Opened by Frank Gevaerts (fg) - Tuesday, 16 February 2010, 21:51 GMT+2
Last edited by Frank Gevaerts (fg) - Sunday, 31 July 2011, 14:39 GMT+2
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

Preliminary patch to explore the concept of plugins that consist of a single function ("pebbles", small rocks) to avoid the need for relocation.

These plugins are loaded into the skin buffer, and are called during WPS redraw. Add a %P token to the wps to try the included test_pebble

Still to do:
- actually parse the token to allow specifying the pebble to load
- call the pebble for init/exit
- implement bookkeeping and clearing of the pebble table on wps reload
- work out how the pebble-allocated memory should work
- test on non-ARM
- check the plugin API version on load
- allocate the correct buffer size
   pebbles_v1.diff (14.4 KiB)
 tools/buildzip.pl                   |    2 
 tools/root.make                     |    7 ++
 apps/pebble.h                       |   35 ++++++++++++
 apps/gui/skin_engine/skin_parser.c  |   16 +++++
 apps/gui/skin_engine/skin_display.c |   10 +++
 apps/gui/skin_engine/skin_tokens.h  |    2 
 apps/pebbles/SOURCES                |    1 
 apps/pebbles/pebbles.make           |   61 ++++++++++++++++++++++
 apps/pebbles/test_pebble.c          |   29 ++++++++++
 apps/pebbles/pebble.lds             |   55 ++++++++++++++++++++
 apps/plugin.c                       |    2 
 apps/SOURCES                        |    1 
 apps/pebble.c                       |   97 ++++++++++++++++++++++++++++++++++++
 13 files changed, 315 insertions(+), 3 deletions(-)

This task depends upon

Closed by  Frank Gevaerts (fg)
Sunday, 31 July 2011, 14:39 GMT+2
Reason for closing:  Rejected
Additional comments about closing:  Not a viable way of doing this
Comment by Frank Gevaerts (fg) - Tuesday, 16 February 2010, 22:07 GMT+2
to actually build the pebbles, you need to add "export ENABLEDPEBBLES=yes" to the Makefile
Comment by Frank Gevaerts (fg) - Tuesday, 16 February 2010, 22:17 GMT+2
New patch. This one builds for all four CPU types and fixes the ENABLEDPEBBLES bit
   pebbles_v2.diff (28.4 KiB)
 tools/configure                     |   62 +++++++++++++++++++++++
 tools/buildzip.pl                   |    2 
 tools/root.make                     |    7 ++
 apps/pebble.h                       |   35 ++++++++++++
 apps/gui/skin_engine/skin_parser.c  |   16 +++++
 apps/gui/skin_engine/skin_display.c |   10 +++
 apps/gui/skin_engine/skin_tokens.h  |    2 
 apps/pebbles/SOURCES                |    1 
 apps/pebbles/pebbles.make           |   61 ++++++++++++++++++++++
 apps/pebbles/test_pebble.c          |   29 ++++++++++
 apps/pebbles/pebble.lds             |   58 +++++++++++++++++++++
 apps/plugin.c                       |    2 
 apps/SOURCES                        |    1 
 apps/pebble.c                       |   97 ++++++++++++++++++++++++++++++++++++
 14 files changed, 380 insertions(+), 3 deletions(-)

Comment by Maurus Cuelenaere (mcuelenaere) - Tuesday, 16 February 2010, 22:52 GMT+2
Confirmed working on MIPS-based players (Onda VX747).
Comment by Jonathan Gordon (jdgordon) - Wednesday, 17 February 2010, 00:17 GMT+2
WOO!

some random thoughts:
the/a pebble api needs to give the pebble some internal function pointers. get_*_token_value() and just get_token() so it can easily get the value from any other token
likewise it should be able to act like a simple token so it can just return the string to display
also access to the skin_buffer_alloc() function, and the entry point should be called for the parse line and updates
it should keep track of the update requirements for the token (WPS_REFRESH_DYNAMIC|STATIC|etc)

Also, it would be good to be able to reuse the same pebble more than once, either between skins, or even in the same skin (look at skin fonts and backdrops)
Comment by Frank Gevaerts (fg) - Wednesday, 17 February 2010, 01:07 GMT+2
Some more progress. This one can handle const data on ARM (I haven't tried the others). Still only one function though.

The included test pebble is a bit more interesting now, and pebbles are built unconditionally, so there are no more changes needed to configure

Re-using a pebble shouldn't be too hard, and adding a pebble_api is easy.
   pebbles_v3.diff (15.2 KiB)
 tools/buildzip.pl                   |    2 
 tools/root.make                     |    5 +
 apps/pebble.h                       |   35 ++++++++++++
 apps/gui/skin_engine/skin_parser.c  |   16 +++++
 apps/gui/skin_engine/skin_display.c |   10 +++
 apps/gui/skin_engine/skin_tokens.h  |    2 
 apps/pebbles/SOURCES                |    1 
 apps/pebbles/pebbles.make           |   61 +++++++++++++++++++++
 apps/pebbles/test_pebble.c          |   41 ++++++++++++++
 apps/pebbles/pebble.lds             |   56 ++++++++++++++++++++
 apps/plugin.c                       |    2 
 apps/SOURCES                        |    1 
 apps/pebble.c                       |  100 ++++++++++++++++++++++++++++++++++++
 13 files changed, 329 insertions(+), 3 deletions(-)

Comment by Frank Gevaerts (fg) - Wednesday, 17 February 2010, 23:25 GMT+2
This one gets slightly closer to the standard plugins in the way things are organised. Multiple functions work (most of the time anyway), and the pebbles get a viewport.
Use with %P|name_of_pebble| (e.g. "%P|test_pebble|"), the pebble will get the entire enclosing viewport.

I've added a starfield pebble, but that one doesn't work properly. It suffers from illegal instructions, data aborts and the like. Help in figuring out why is welcome.
   pebbles_v4.diff (24.3 KiB)
 tools/buildzip.pl                   |    2 
 tools/root.make                     |    5 
 apps/pebble.h                       |   54 +++++++++
 apps/gui/skin_engine/skin_parser.c  |   36 ++++++
 apps/gui/skin_engine/skin_display.c |   10 +
 apps/gui/skin_engine/skin_tokens.h  |    2 
 apps/gui/skin_engine/skin_buffer.c  |    5 
 apps/pebbles/SOURCES                |    2 
 apps/pebbles/pebbles.make           |   61 +++++++++++
 apps/pebbles/test_pebble.c          |   64 +++++++++++
 apps/pebbles/pebble.lds             |   77 ++++++++++++++
 apps/pebbles/starfield.c            |  196 ++++++++++++++++++++++++++++++++++++
 apps/plugin.c                       |    2 
 apps/SOURCES                        |    1 
 apps/pebble.c                       |  138 +++++++++++++++++++++++++
 15 files changed, 650 insertions(+), 5 deletions(-)

Comment by Frank Gevaerts (fg) - Sunday, 21 February 2010, 18:56 GMT+2
This one actually works on arm. Thanks to TheSeven for spotting the obvious bug.

It doesn't work on coldfire right now. Investigating.
   pebbles_v5.diff (24.3 KiB)
 tools/buildzip.pl                   |    2 
 tools/root.make                     |    5 
 apps/pebble.h                       |   54 +++++++++
 apps/gui/skin_engine/skin_parser.c  |   36 ++++++
 apps/gui/skin_engine/skin_display.c |   10 +
 apps/gui/skin_engine/skin_tokens.h  |    2 
 apps/gui/skin_engine/skin_buffer.c  |    5 
 apps/pebbles/SOURCES                |    2 
 apps/pebbles/pebbles.make           |   61 +++++++++++
 apps/pebbles/test_pebble.c          |   64 +++++++++++
 apps/pebbles/pebble.lds             |   77 ++++++++++++++
 apps/pebbles/starfield.c            |  196 ++++++++++++++++++++++++++++++++++++
 apps/plugin.c                       |    2 
 apps/SOURCES                        |    1 
 apps/pebble.c                       |  137 +++++++++++++++++++++++++
 15 files changed, 649 insertions(+), 5 deletions(-)

Comment by Frank Gevaerts (fg) - Sunday, 21 February 2010, 18:59 GMT+2
When testing, revert the changes to apps/gui/skin_engine/skin_buffer.c . Those shouldn't be there
Comment by Frank Gevaerts (fg) - Sunday, 21 February 2010, 21:04 GMT+2
This version reintroduces the global rb pointer. If we can get this to work for all CPUs, the next question will be if we should keep this separate from regular plugins.

The wps I use for testing is:

%wd
%V|10|10|73|73|1|ffffff|000000|
%P|test_pebble|
%V|93|10|73|73|1|ff0000|00ff00|
%P|test_pebble|
%V|10|103|156|107|1|ffffff|000000|
%P|starfield|
   pebbles_v6.diff (25.9 KiB)
 tools/buildzip.pl                   |    2 
 tools/root.make                     |    5 
 apps/pebble.h                       |   56 ++++++++++
 apps/gui/skin_engine/skin_parser.c  |   36 ++++++
 apps/gui/skin_engine/skin_display.c |   10 +
 apps/gui/skin_engine/skin_tokens.h  |    2 
 apps/pebbles/SOURCES                |    2 
 apps/pebbles/lib/SOURCES            |    1 
 apps/pebbles/lib/gcc-support.c      |   50 +++++++++
 apps/pebbles/pebbles.make           |   76 ++++++++++++++
 apps/pebbles/test_pebble.c          |   64 +++++++++++
 apps/pebbles/pebble.lds             |   77 ++++++++++++++
 apps/pebbles/starfield.c            |  195 ++++++++++++++++++++++++++++++++++++
 apps/plugin.c                       |    2 
 apps/SOURCES                        |    1 
 apps/pebble.c                       |  140 +++++++++++++++++++++++++
 16 files changed, 716 insertions(+), 3 deletions(-)

Comment by Frank Gevaerts (fg) - Monday, 22 February 2010, 23:10 GMT+2
Changes since v6:
- partly works on m68k (test_pebble works for me, starfield does not). Linker scripts and compilers are evil!
- passes the viewport using a global (similar to rb) named pebble_vp
- calls lcd_set_viewport before calling the pebble paint function to ensure that the correct viewport is active
   pebbles_v7.diff (26.2 KiB)
 tools/buildzip.pl                   |    2 
 tools/root.make                     |    5 
 apps/pebble.h                       |   58 ++++++++++
 apps/gui/skin_engine/skin_parser.c  |   36 ++++++
 apps/gui/skin_engine/skin_display.c |   10 +
 apps/gui/skin_engine/skin_tokens.h  |    2 
 apps/pebbles/SOURCES                |    2 
 apps/pebbles/lib/SOURCES            |    1 
 apps/pebbles/lib/gcc-support.c      |   50 +++++++++
 apps/pebbles/pebbles.make           |   76 ++++++++++++++
 apps/pebbles/test_pebble.c          |   63 +++++++++++
 apps/pebbles/pebble.lds             |   82 +++++++++++++++
 apps/pebbles/starfield.c            |  193 ++++++++++++++++++++++++++++++++++++
 apps/plugin.c                       |    2 
 apps/SOURCES                        |    1 
 apps/pebble.c                       |  150 +++++++++++++++++++++++++++
 16 files changed, 730 insertions(+), 3 deletions(-)

Comment by Frank Gevaerts (fg) - Monday, 22 February 2010, 23:24 GMT+2
This one also compiles on non-colour-lcd, so it can be tested on Archos.

Testers on SH and MIPS are welcome, as well as people who can fix the m68k issues
   pebbles_v8.diff (25.8 KiB)
 tools/buildzip.pl                   |    2 
 tools/root.make                     |    5 
 apps/pebble.h                       |   58 +++++++++++
 apps/gui/skin_engine/skin_parser.c  |   36 ++++++
 apps/gui/skin_engine/skin_display.c |   10 +
 apps/gui/skin_engine/skin_tokens.h  |    2 
 apps/pebbles/SOURCES                |    2 
 apps/pebbles/lib/SOURCES            |    1 
 apps/pebbles/lib/gcc-support.c      |   50 +++++++++
 apps/pebbles/pebbles.make           |   76 ++++++++++++++
 apps/pebbles/test_pebble.c          |   57 ++++++++++
 apps/pebbles/pebble.lds             |   82 +++++++++++++++
 apps/pebbles/starfield.c            |  187 ++++++++++++++++++++++++++++++++++++
 apps/plugin.c                       |    2 
 apps/SOURCES                        |    1 
 apps/pebble.c                       |  150 ++++++++++++++++++++++++++++
 16 files changed, 718 insertions(+), 3 deletions(-)

Comment by Frank Gevaerts (fg) - Wednesday, 24 February 2010, 21:25 GMT+2
OK, this approach won't get anywhere. As soon as you have a compile-time initialised pointer, it breaks. We'll need a full relocator

Loading...