summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-06-18 07:15:00 +0200
committerThomas Martitz <kugel@rockbox.org>2014-06-21 00:15:53 +0200
commita1842c04f9cb73210d4cacde61a9e4b115050765 (patch)
treea37af61ef9285b763a42cd33797e2f3d634fbf9f /tools
parent0250be1d6799db7b5ddc99cb33f31bf9cff01ed2 (diff)
downloadrockbox-a1842c04f9cb73210d4cacde61a9e4b115050765.zip
rockbox-a1842c04f9cb73210d4cacde61a9e4b115050765.tar.gz
rockbox-a1842c04f9cb73210d4cacde61a9e4b115050765.tar.bz2
rockbox-a1842c04f9cb73210d4cacde61a9e4b115050765.tar.xz
lcd-24bit: Introduce a 24-bit mid-level LCD driver
With LCD driver all calculation will be performed on RGB888 and the hardware/OS can display from our 24bit framebuffer. It is not yet as performance optimized as the existing drivers but should be good enough.The vast number of small changes is due to the fact that fb_data can be a struct type now, while most of the code expected a scalar type. lcd-as-memframe ASM code does not work with 24bit currently so the with 24bit it enforces the generic C code. All plugins are ported over. Except for rockpaint. It uses so much memory that it wouldnt fit into the 512k plugin buffer anymore (patches welcome). Change-Id: Ibb1964545028ce0d8ff9833ccc3ab66be3ee0754
Diffstat (limited to 'tools')
-rw-r--r--tools/bmp2rb.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/tools/bmp2rb.c b/tools/bmp2rb.c
index 2a7dcde..24ea1a8 100644
--- a/tools/bmp2rb.c
+++ b/tools/bmp2rb.c
@@ -491,14 +491,6 @@ void generate_c_source(char *id, char* header_dir, int width, int height,
bool have_header = header_dir && header_dir[0];
create_bm = have_header && create_bm;
- if (t_depth > 16)
- {
- fprintf(stderr, "Generating C source not supported for this format\n");
- fprintf(stderr, "because Rockbox does not support this display depth yet.\n");
- fprintf(stderr, "However you are welcome to fix this!\n");
- return;
- }
-
if (!id || !id[0])
id = "bitmap";
@@ -520,8 +512,11 @@ void generate_c_source(char *id, char* header_dir, int width, int height,
id, height, id, width);
if (t_depth <= 8)
fprintf(fh, "extern const unsigned char %s[];\n", id);
- else
+ else if (t_depth <= 16)
fprintf(fh, "extern const unsigned short %s[];\n", id);
+ else
+ fprintf(fh, "extern const fb_data %s[];\n", id);
+
if (create_bm)
{
@@ -542,8 +537,10 @@ void generate_c_source(char *id, char* header_dir, int width, int height,
if (t_depth <= 8)
fprintf(f, "const unsigned char %s[] = {\n", id);
- else
+ else if (t_depth == 16)
fprintf(f, "const unsigned short %s[] = {\n", id);
+ else if (t_depth == 24)
+ fprintf(f, "const fb_data %s[] = {\n", id);
for (i = 0; i < t_height; i++)
{
@@ -555,6 +552,12 @@ void generate_c_source(char *id, char* header_dir, int width, int height,
else if (t_depth == 16)
fprintf(f, "0x%04x,%c", t_bitmap->d16[i * t_width + a],
(a + 1) % 10 ? ' ' : '\n');
+ else if (t_depth == 24)
+ fprintf(f, "{ .r = 0x%02x, .g = 0x%02x, .b = 0x%02x },%c",
+ t_bitmap->d24[i * t_width + a].r,
+ t_bitmap->d24[i * t_width + a].g,
+ t_bitmap->d24[i * t_width + a].b,
+ (a + 1) % 4 ? ' ' : '\n');
}
fprintf(f, "\n");
}
@@ -651,7 +654,7 @@ void print_usage(void)
"\t 6 Greyscale iPod 4-grey\n"
"\t 7 Greyscale X5 remote 4-grey\n"
"\t 8 16-bit packed 5-6-5 RGB with a vertical stride\n"
- "\t 9 24-bit BGR (raw only for now)\n");
+ "\t 9 24-bit BGR\n");
printf("build date: " __DATE__ "\n\n");
}