diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-02-13 18:03:17 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-02-13 18:03:17 -0800 |
commit | 2079650b3e6dbe302fe27e5256fd412894c2f4b9 (patch) | |
tree | fb019871e140ef37c04784b3856d1596091a51e2 | |
parent | 4d36df22fcb042a595300fb7d61b64b58caf018d (diff) | |
download | syslinux.git-2079650b3e6dbe302fe27e5256fd412894c2f4b9.tar.gz syslinux.git-2079650b3e6dbe302fe27e5256fd412894c2f4b9.tar.xz syslinux.git-2079650b3e6dbe302fe27e5256fd412894c2f4b9.zip |
Fix the calculation of bytes_per_pixel
Handle cases where __vesa_info.mi.bpp is not a multiple of 8, e.g. 15.
Remove totally redundant switch statement in vesacon_update_characters().
-rw-r--r-- | com32/lib/sys/vesa/drawtxt.c | 15 | ||||
-rw-r--r-- | com32/lib/sys/vesa/initvesa.c | 2 |
2 files changed, 1 insertions, 16 deletions
diff --git a/com32/lib/sys/vesa/drawtxt.c b/com32/lib/sys/vesa/drawtxt.c index 7a2347cc..9e222ecc 100644 --- a/com32/lib/sys/vesa/drawtxt.c +++ b/com32/lib/sys/vesa/drawtxt.c @@ -93,21 +93,6 @@ static void vesacon_update_characters(int row, int col, int nrows, int ncols) pixel_offset = ((row*height+VIDEO_BORDER)*VIDEO_X_SIZE)+ (col*width+VIDEO_BORDER); - switch (__vesacon_pixel_format) { - case PXF_BGR24: - bytes_per_pixel = 3; - break; - case PXF_BGRA32: - bytes_per_pixel = 4; - break; - case PXF_LE_RGB16_565: - bytes_per_pixel = 2; - break; - default: - bytes_per_pixel = 0; - break; - } - fbrowptr = ((uint8_t *)__vesa_info.mi.lfb_ptr) + (row*height+VIDEO_BORDER) * __vesa_info.mi.logical_scan + (col*width+VIDEO_BORDER) * bytes_per_pixel; diff --git a/com32/lib/sys/vesa/initvesa.c b/com32/lib/sys/vesa/initvesa.c index abea95aa..d5aa9ba7 100644 --- a/com32/lib/sys/vesa/initvesa.c +++ b/com32/lib/sys/vesa/initvesa.c @@ -235,7 +235,7 @@ static int vesacon_set_mode(void) mi = &__vesa_info.mi; mode = bestmode; - __vesacon_bytes_per_pixel = mi->bpp >> 3; + __vesacon_bytes_per_pixel = (mi->bpp+7) >> 3; /* Download the SYSLINUX- or BIOS-provided font */ rm.eax.w[0] = 0x0018; /* Query custom font */ |