We recently have upgraded syslinux and have noticed that the boot logo code via boot.txt no longer works. I have a couple patches that get it close to working but I appear to be having trouble with color maps. Is there someone would want to help me finish figuring this out? Any interest in the patches I have to fix the rle decoder?
> We recently have upgraded syslinux and have noticed that the boot logo > code via boot.txt no longer works. I have a couple patches that get it > close to working but I appear to be having trouble with color maps. Is > there someone would want to help me finish figuring this out? > > Any interest in the patches I have to fix the rle decoder? >Certainly, there are some of us interested. This might be relevant: http://www.syslinux.org/archives/2015-July/023835.html Sharing patches is very much appreciated. TIA, Ady.> _______________________________________________ > Syslinux mailing list > Submissions to Syslinux at zytor.com > Unsubscribe or set options at: > http://www.zytor.com/mailman/listinfo/syslinux >
On Fri, 2015-08-21 at 02:18 +0300, Ady via Syslinux wrote:> > We recently have upgraded syslinux and have noticed that the boot logo > > code via boot.txt no longer works. I have a couple patches that get it > > close to working but I appear to be having trouble with color maps. Is > > there someone would want to help me finish figuring this out? > > > > Any interest in the patches I have to fix the rle decoder? > > > > Certainly, there are some of us interested. > > This might be relevant: > http://www.syslinux.org/archives/2015-July/023835.htmlCool. I didn't know about that work. I will need to see what he did with respect to the handling programming the VGA graphics.> Sharing patches is very much appreciated.See following messages.
Charles (Chas) Williams
2015-Aug-21 13:09 UTC
[syslinux] [PATCH 1/2] msg: VGAFilePtr should be char
VGAFilePtr is used as a pointer into VGAFileBuf, so it should be the
same type.
Signed-off-by: Chas Williams <ciwillia at brocade.com>
---
com32/elflink/ldlinux/msg.c | 4 ++--
core/graphics.c | 2 +-
core/include/graphics.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/com32/elflink/ldlinux/msg.c b/com32/elflink/ldlinux/msg.c
index 9ded33e..37cbe71 100644
--- a/com32/elflink/ldlinux/msg.c
+++ b/com32/elflink/ldlinux/msg.c
@@ -155,7 +155,7 @@ static void msg_filename(uint8_t data)
/* Ignore space/control char */
if (data > ' ') {
- if ((char *)VGAFilePtr < (VGAFileBuf + sizeof(VGAFileBuf)))
+ if (VGAFilePtr < (VGAFileBuf + sizeof(VGAFileBuf)))
*VGAFilePtr++ = data;
}
}
@@ -163,7 +163,7 @@ static void msg_filename(uint8_t data)
static void msg_vga(void)
{
NextCharJump = msg_filename;
- VGAFilePtr = (uint16_t *)VGAFileBuf;
+ VGAFilePtr = VGAFileBuf;
}
static void msg_normal(uint8_t data)
diff --git a/core/graphics.c b/core/graphics.c
index 834372f..1604ab4 100644
--- a/core/graphics.c
+++ b/core/graphics.c
@@ -27,9 +27,9 @@
__export uint8_t UsingVGA = 0;
uint16_t VGAPos; /* Pointer into VGA memory */
-__export uint16_t *VGAFilePtr; /* Pointer into VGAFileBuf */
__export uint16_t VGAFontSize = 16; /* Defaults to 16 byte font */
+__export char *VGAFilePtr; /* Pointer into VGAFileBuf */
__export char VGAFileBuf[VGA_FILE_BUF_SIZE]; /* Unmangled VGA image name */
__export char VGAFileMBuf[FILENAME_MAX]; /* Mangled VGA image name */
diff --git a/core/include/graphics.h b/core/include/graphics.h
index 814ffe7..65f4adc 100644
--- a/core/include/graphics.h
+++ b/core/include/graphics.h
@@ -41,7 +41,7 @@
extern uint8_t UsingVGA;
extern uint16_t VGAPos;
-extern uint16_t *VGAFilePtr;
+extern char *VGAFilePtr;
extern char VGAFileBuf[VGA_FILE_BUF_SIZE];
extern char VGAFileMBuf[];
extern uint16_t VGAFontSize;
--
2.1.0
Charles (Chas) Williams
2015-Aug-21 13:10 UTC
[syslinux] [PATCH 2/2] core/graphics: fix lss16 parsing
getnybble() needs to return four bits at a time from every byte.
During rle decode, rows are rounded to an integer number of bytes.
The rle length needs to be able to hold values > 255.
Signed-off-by: Chas Williams <3chas3 at gmail.com>
---
core/graphics.c | 35 +++++++++++++++++++++--------------
1 file changed, 21 insertions(+), 14 deletions(-)
diff --git a/core/graphics.c b/core/graphics.c
index 1604ab4..011be4a 100644
--- a/core/graphics.c
+++ b/core/graphics.c
@@ -54,6 +54,9 @@ typedef struct {
static lssheader_t LSSHeader;
+static uint16_t buffer_empty = 1;
+static int buffer;
+
#define LSSMagic LSSHeader.LSSMagic
#define GraphXSize LSSHeader.GraphXSize
#define GraphYSize LSSHeader.GraphYSize
@@ -114,15 +117,17 @@ static int vgasetmode(void)
static inline char getnybble(void)
{
- char data = getc(fd);
-
- if (data & 0x10) {
- data &= 0x0F;
- return data;
+ if (buffer_empty) {
+ buffer_empty = 0;
+ buffer = getc(fd);
+ if (buffer == -1)
+ printf("EOF!\n");
+ } else {
+ buffer >>= 4;
+ buffer_empty = 1;
}
- data = getc(fd);
- return (data & 0x0F);
+ return buffer & 0xF;
}
/*
@@ -139,7 +144,9 @@ static void rledecode(uint8_t *out, size_t count)
size_t size = count;
uint8_t data;
int i;
+ uint16_t rle_len;
+ buffer_empty = 1;
again:
for (i = 0; i < size; i++) {
@@ -156,20 +163,20 @@ again:
return;
/* Start of run sequence */
- data = getnybble();
- if (data == 0) {
+ rle_len = getnybble();
+ if (rle_len == 0) {
/* long run */
uint8_t hi;
- data = getnybble();
+ rle_len = getnybble();
hi = getnybble();
hi <<= 4;
- data |= hi;
- data += 16;
+ rle_len |= hi;
+ rle_len += 16;
}
/* dorun */
- for (i = 0; i < data; i++)
+ for (i = 0; i < rle_len; i++)
*out++ = prev_pixel;
size -= i;
@@ -249,7 +256,7 @@ __export void vgadisplayfile(FILE *_fd)
/* Load the header */
while (size--)
- *p = getc(fd);
+ *p++ = getc(fd);
if (*p != EOF) {
com32sys_t ireg, oreg;
--
2.1.0