>So does this mean that there is no way to have more than 8k in the display list in any case?
Yes, exactly, there is no way around the 8kiB.
>but I had the impression that any instruction received in the DL is converted into pixels in a frame buffer, and then when swapping,
>it switches the frame buffer to show it while another frame buffer is about to be written by further DL instructions.
No, there is no frame buffer, let alone two, as this would require quite a lot of memory.
There are actually two display lists of 8kiB each at the same location and only the inactive one is visible and can be written to.
The active one is processed for every single line over and over again.
The exact details are not documented though.
Unfortunately the co-processor does not seem to optimize the display list in any way.
So 11 buttons fill the display list to 30% although there is a lot of overlap
There are workarounds.
Buttons for example are most of the time just two images anyways.
So you could pre-calculate the images you need and just display these.
I had a project in which I had two images for a button in pressed and normal state and a set of images for
the text on these buttons like "up", "down", "left" and "right".
And instead of displaying ten buttons with their own separate commands I sorted thru the command-list
to remove redundancies.
The result is code like this, no fun to read but efficent on the SPI:
Code: Select all
EVE_cmd_dl_burst((DL_BEGIN | EVE_POINTS));
EVE_cmd_dl_burst(POINT_SIZE(150));
EVE_color_rgb_burst(LIGHT_GREEN);
if(vl1_delay)
{
vl1_delay--;
EVE_cmd_dl_burst(VERTEX2F(330, LAYOUT_Y1+STATUS_LINE_1));
}
if(vl2_delay)
{
vl2_delay--;
EVE_cmd_dl_burst(VERTEX2F(370, LAYOUT_Y1+STATUS_LINE_1));
}
if(vl3_delay)
{
vl3_delay--;
EVE_cmd_dl_burst(VERTEX2F(410, LAYOUT_Y1+STATUS_LINE_1));
}
if(vl4_delay)
{
vl4_delay--;
EVE_cmd_dl_burst(VERTEX2F(450, LAYOUT_Y1+STATUS_LINE_1));
}
if(vr1_delay)
{
vr1_delay--;
EVE_cmd_dl_burst(VERTEX2F(330, LAYOUT_Y1+STATUS_LINE_2));
}
if(vr2_delay)
{
vr2_delay--;
EVE_cmd_dl_burst(VERTEX2F(370, LAYOUT_Y1+STATUS_LINE_2));
}
if(vr3_delay)
{
vr3_delay--;
EVE_cmd_dl_burst(VERTEX2F(410, LAYOUT_Y1+STATUS_LINE_2));
}
if(vr4_delay)
{
vr4_delay--;
EVE_cmd_dl_burst(VERTEX2F(450, LAYOUT_Y1+STATUS_LINE_2));
}
if(hl1_delay)
{
hl1_delay--;
EVE_cmd_dl_burst(VERTEX2F(330, LAYOUT_Y1+STATUS_LINE_3));
}
if(hl2_delay)
{
hl2_delay--;
EVE_cmd_dl_burst(VERTEX2F(370, LAYOUT_Y1+STATUS_LINE_3));
}
if(hl3_delay)
{
hl3_delay--;
EVE_cmd_dl_burst(VERTEX2F(410, LAYOUT_Y1+STATUS_LINE_3));
}
if(hl4_delay)
{
hl4_delay--;
EVE_cmd_dl_burst(VERTEX2F(450, LAYOUT_Y1+STATUS_LINE_3));
}
if(hr1_delay)
{
hr1_delay--;
EVE_cmd_dl_burst(VERTEX2F(330, LAYOUT_Y1+STATUS_LINE_4));
}
if(hr2_delay)
{
hr2_delay--;
EVE_cmd_dl_burst(VERTEX2F(370, LAYOUT_Y1+STATUS_LINE_4));
}
if(hr3_delay)
{
hr3_delay--;
EVE_cmd_dl_burst(VERTEX2F(410, LAYOUT_Y1+STATUS_LINE_4));
}
if(hr4_delay)
{
hr4_delay--;
EVE_cmd_dl_burst(VERTEX2F(450, LAYOUT_Y1+STATUS_LINE_4));
}
EVE_color_rgb_burst(LIGHT_GREY);
if(!vl1_delay)
{
EVE_cmd_dl_burst(VERTEX2F(330, LAYOUT_Y1+STATUS_LINE_1));
}
if(!vl2_delay)
{
EVE_cmd_dl_burst(VERTEX2F(370, LAYOUT_Y1+STATUS_LINE_1));
}
if(!vl3_delay)
{
EVE_cmd_dl_burst(VERTEX2F(410, LAYOUT_Y1+STATUS_LINE_1));
}
if(!vl4_delay)
{
EVE_cmd_dl_burst(VERTEX2F(450, LAYOUT_Y1+STATUS_LINE_1));
}
if(!vr1_delay)
{
EVE_cmd_dl_burst(VERTEX2F(330, LAYOUT_Y1+STATUS_LINE_2));
}
if(!vr2_delay)
{
EVE_cmd_dl_burst(VERTEX2F(370, LAYOUT_Y1+STATUS_LINE_2));
}
if(!vr3_delay)
{
EVE_cmd_dl_burst(VERTEX2F(410, LAYOUT_Y1+STATUS_LINE_2));
}
if(!vr4_delay)
{
EVE_cmd_dl_burst(VERTEX2F(450, LAYOUT_Y1+STATUS_LINE_2));
}
if(!hl1_delay)
{
EVE_cmd_dl_burst(VERTEX2F(330, LAYOUT_Y1+STATUS_LINE_3));
}
if(!hl2_delay)
{
EVE_cmd_dl_burst(VERTEX2F(370, LAYOUT_Y1+STATUS_LINE_3));
}
if(!hl3_delay)
{
EVE_cmd_dl_burst(VERTEX2F(410, LAYOUT_Y1+STATUS_LINE_3));
}
if(!hl4_delay)
{
EVE_cmd_dl_burst(VERTEX2F(450, LAYOUT_Y1+STATUS_LINE_3));
}
if(!hr1_delay)
{
EVE_cmd_dl_burst(VERTEX2F(330, LAYOUT_Y1+STATUS_LINE_4));
}
if(!hr2_delay)
{
EVE_cmd_dl_burst(VERTEX2F(370, LAYOUT_Y1+STATUS_LINE_4));
}
if(!hr3_delay)
{
EVE_cmd_dl_burst(VERTEX2F(410, LAYOUT_Y1+STATUS_LINE_4));
}
if(!hr4_delay)
{
EVE_cmd_dl_burst(VERTEX2F(450, LAYOUT_Y1+STATUS_LINE_4));
}
EVE_cmd_dl_burst(DL_END);
This displays just a set of "LEDs" in green or grey and it is more efficent this way than to do it like this:
Code: Select all
if(vl1_delay)
{
vl1_delay--;
EVE_color_rgb_burst(LIGHT_GREEN);
}
else
{
EVE_color_rgb_burst(LIGHT_GREY);
}
EVE_cmd_dl_burst(VERTEX2F(330, LAYOUT_Y1+STATUS_LINE_1));
So yes, the controller has more code and yes it is more difficult to read.
But this is 30 color-commands shorter, this is 120 Bytes less on the SPI.
And yes, I just noticed that there is a bug but it usually only makes the list 1 instruction longer for one frame. :-)