I have noticed anything using ANSI escape sequences to color text does not work if syslinux is in VESA mode. It only works if the \1#, \2#, or \3# are used. This means that libmenu which relies on csprint fails to render colors in VESA mode. I noticed the default color table has a complete table generated at runtime for all VGA color combinations, which csprint also does but from VGA attributes on an as needed basis. I was thinking maybe I could find a way to bridge it so that csprint can switch from ANSI to the other color API that works if a compatible match can be found. In the mean time, I have prepared a simple patch that fixes a small bug in the existing cindex that ANSI uses. The cindex is currently uint8_t, which limits the colors VESA mode can use to 256 colors while the VESA uses attr_t, a uin16_t type. I have patched the ansi.h header to include the vesa header where this type is exposed and then change the cindex type to attr_t. This should mean the full table can now be accessed. This does matter because the default color table size is 274 or so. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-ansi-switch-cindex-type-to-attr_t-to-fully-support-c.patch Type: text/x-patch Size: 945 bytes Desc: not available URL: <http://www.zytor.com/pipermail/syslinux/attachments/20131112/e6a64d95/attachment.bin>
On Tue, 12 Nov, at 12:17:47AM, James Buren wrote:> diff --git a/com32/lib/sys/ansi.h b/com32/lib/sys/ansi.h > index 7ccafc8..2da8d5f 100644 > --- a/com32/lib/sys/ansi.h > +++ b/com32/lib/sys/ansi.h > @@ -7,6 +7,7 @@ > > #include <inttypes.h> > #include <stdbool.h> > +#include "vesa/video.h" // For attr_t type. Required to match VESA color index size. > > #define ANSI_MAX_PARMS 16 > > @@ -29,7 +30,7 @@ struct term_state { > bool pvt; /* Private code? */ > struct curxy xy; > struct curxy saved_xy; > - uint8_t cindex; /* SOH color index */ > + attr_t cindex; /* SOH color index */ > uint8_t fg; > uint8_t bg; > uint8_t intensity;Seems fairly straight forward. Thanks, applied. -- Matt Fleming, Intel Open Source Technology Center