I dont think that increasing the buffer in 100 - 150 KB will metter something but if you say so you must be right
Hi,
There seem to be three buffers:
main_backdrop - defined in /apps/recorder/backdrop.c (line 26)
wps_backdrop - defined in /apps/recorder/backdrop.c (line 27)
and the main wps graphics buffer whose size is defined by the
#define IMG_BUFSIZE - in apps/gui/gwps.h (line 68)
Most themes that I've seen try to get everything into the main wps
graphics buffer. This usually gets pretty full just by loading the
main background (which often consists of mostly magenta).
A way around the memory problem would be to put stuff you are sure
won't get overwritten by text or the progress bar, into a wps
backdrop graphic. You load that with %X (upper case) in your wps
file.
The user 'soap' said that giving more memory to the main wps
buffer would steal it from the main playback buffer. Isn't that
dynamically allocated, and, in any case, is many MBs, and varies
considerably between players? Another few KBs might not make a
big difference on players that have a decent amount of memory.
If memory is short, it maybe an idea to lose the wps_backdrop
functionality completely, and just give it to the main wps
graphics buffer. Once you've loaded your main background, you've
got precious little memory left to add your dynamic graphics (on
the Iriver H300, 9680 bytes). So, since there are so many
conditional directives in the code, anyway, wouldn't it be
reasonable to give more memory to the wps buffer on a model by
model basis?
I've been trying to tidy up some of the posted themes for the
H300, and many of the themes fail to load all of the dynamic
graphics. After the main bg is loaded, the remaining 9680 bytes or
so gets eaten really quickly. On the Iriver, the main buffer is
220*176*16/8 bytes. I think giving half as much again ~ 38K would
satisfy all but the most lavish theme designer, and even 10K would
allow most themes to load.
If you make this trivial change (below) to apps/recorder/bmp.c,
and recompile your sim, you'll see just how little memory theme
designers have to play with.
Sorry for the long post.
Cheers,
===Rich
--- bmp.c.org 2007-02-24 20:42:31.000000000 +0000
+++ bmp.c 2007-02-25 04:54:05.000000000 +0000
@@ -275,7 +275,7 @@
/* Check if this fits the buffer */
if (totalsize > maxsize) {
DEBUGF("read_bmp_file: Bitmap too large for buffer: "
- "%d bytes.\n", totalsize);
+ "%d bytes, max = %d.\n", totalsize, maxsize);
close(fd);
return -6;
}
@@ -546,6 +546,6 @@
close(fd);
- DEBUGF("totalsize: %d\n", totalsize);
+ DEBUGF("totalsize: %d, maxsize: %d\n", totalsize, maxsize);
return totalsize; /* return the used buffer size. */
}