dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Grayscale framework & demo plugin (patch #931098)

Re: Grayscale framework & demo plugin (patch #931098)

From: Jens Arnold <>
Date: Wed, 07 Apr 2004 23:03:11 +0200

>> I have posted a plugin to the patch tracker that contains a
>> grayscale framework primary useful to incorporate grayscale
>> display capabilities into other plugins. This could be games,
>> image viewers or whatever else you could imagine.

> - For speedup, I guess you
> can use a way simpler randomization, maybe just some mixup of
> the coords will do.

I already tried using various coordinate mixups. Since these are
always regular patterns, using them leads to moire patterns on the
display. I already implemented your "random bit reservoir" idea
and found that the rand() function isn't that slow after all.
Together with another optimization (having the mask of necessary
random bits available saves me one "division remainder"
operation in C) it yields ~33 % speedup for the max. number of
grayscales (33).

> - We could place the core halftoning into
> Rockbox, more specifically into IRAM. Potentially way faster.

This should of course be quite a bit faster, especially if you
place the gray_fillrect() function also into IRAM, but I didn't
try this yet for 2 reasons:
- The IRAM space isn't infinite, as well as the size of the
  whole firmware (we are about to approach the 200 KB limit soon)
- The framework is primarily aimed at plugin developers and
  shouldn't disturb core firmware operation (at least until
  someone decides to use grayscale also in the core)

> - If you're short of screen buffer, you can use the mp3
> buffer. Who writes the first halftoned game?

I know that I can use the mp3 buffer as well, the framework is
flexible enough to use any DRAM part you give it. But if a
plugin uses the mp3 buffer you cannot listen to music while it
is running. This is why I didn't do so in my demo.

The space requirements for the grayscale buffer aren't that big
after all, and you can reduce the number of grayscales to save
some more. The Framework supports any number of grayscales from
2 to 33, not just powers of 2.

Regards, Jens

Received on 2004-04-08

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy