• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category User Interface → Simulator
  • Assigned To No-one
  • Operating System Another
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by funman - 2008-11-01
Last edited by funman - 2008-12-04

FS#9521 - Simulator: 2 colors LCD screen for the Clip target (with a monochrome controller)

This patch adds the ability for the simulator to draw the top X (configurable) lines in a different color.

I add an extra argument to sdl_set_gradient() which is the extra color, which will get added to the end of the palette.

sdl_gui_update() then checks each pixel of the specified zone, and sets them to the extra color if they are set.

This approach only works for monochrome, since there is no obvious reason to have a screen with different color zones on a colored display.

Please comment if you think this is not the right approach.

Closed by  funman
2008-12-04 23:25
Reason for closing:  Accepted
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


Add the 2 lines separation between the yellow and blue area by using a 2nd surface.

sdl_gui_update() will copy the full screen content at each call.
Some performance enhancements could be made if required,
The load is ~7% in demistify plugin on a 1.7GHz CPU.

TODO: greylib simulation since it doesn’t seem to use sdl_gui_update() ; could be skipped since greylib is not proved to function on this screen.

Comments (bad and good) welcome :)

Fix building of other simulators.
Only call lcd_set_gradient() on the real_surface (the other one won’t be displayed and serves only as a framebuffer)

Increase the gui surface’s height if not running with –background

Now supports greylib, adding an argument to lcd_set_gradient(): starting & maximum color for top area of the screen.

IMO it’s ok to commit, but I’d like comments.

I tried a sim with clip-yellow5.diff patched and noticed that there is a problem when something has to scroll in the lower (blue) part. During the scroll the offset of two pixels is not appended in the line(s) that scroll and so it looks “jumpy”. Could have added a screenshot but think it’s easily reproducible, if you still think it’s usefull, just tell me.

I fixed the problem, thanks for reporting ;)


Available keyboard shortcuts


Task Details

Task Editing