• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category User Interface → Themes
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Version 3.1
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by jdgordon - 2008-12-25
Last edited by jdgordon - 2010-06-03

FS#9710 - Draw numbers from a bmp strip in the WPS

This patch adds a new tag to the WPS which will draw the next tag as a combination of numbers from a bmp strip. is a pretty bad example of what it can do. The first line is just converting the number 12345 to images (12345 is text in the wps), the 2nd line is the track complete percent (%px)

ok, how to use it:
First you HAVE to have a bmp strip loaded with %x or %xl. This strip is a verticle strip split into 10 cells.. 0 at the top, 9 at the bottom. They must al be the same height and width. (I’ve attached my really bad test bmp, test.wps and the patch)

after that, add up to 5 %xn lines in the format “%xn|id|x|y|<next tag>” where id is the bmp’s id, x,y is the x and y pixel coordinate (relative to the current viewport) to start drawing in.
<next tag> MUST be immediately after the last |, NO SPACES!
There is some limitation on which tags will work and which wont, but anything which will ordinarily display a number should work, and some conditionals will work also.

Like in the display, you can use this to draw a static number (although i’m not ure why you would want to?)

Lastly… Llorean has suggested I add the ‘:’ character to the strip… I’m happy to do that if its going to be useful, and a few other chars if needed. I dont want to add too many though (and I’m not going to add any letters… this is not a multifont replacement)

let me know what you think

Closed by  jdgordon
2010-06-03 04:16
Reason for closing:  Out of Date
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

multifont is better!

hmm… it looks like this is going to need some thought as to how to handle tokens that return numbers proberly… just had a look at the volume tag and I’m pretty sure this wont work at all for it, ideas welcome

updated patch and text.wps.

format: %dn|n|m|x|y|abc

          n is the bmp strip number/letter to use.
          m is the max number of chars to draw (Always drawn right justified
          x is the x pixel to start drawing at (viewport relative)
          y is the y pixel to start drawing at (viewport relative)
          abc is up to 7 extra chars in the order they appear at the end of the bmp strip

new version… sacrifice 8 bytes per number grouping so the bmp is redrawn only if the number to draw changes.

edit2: reupped the diff.. this one actually works

hopefully final version.. this one draws the bmp using the transparent bmp drawing function on 16bit lcds so the 2 magic colours work (255,255,0 and 255,0,255)

I’ve tried this patch for both the iPod video and the iPod mini, and in both cases I get a data abort crash when the .wps containing the %xn tag is loading. Also, in both cases the patch works fine when used for the simulator build.


Available keyboard shortcuts


Task Details

Task Editing