From 06500c3e5806b819969421b114b783fa9645e2c2 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Wed, 29 Jun 2005 23:40:25 +0000 Subject: [PATCH] The color index is multiplied by 3 because there are R, G and B values for each color in the palette. But uint8 can't hold these for any index above 256/3 obviously. Also fixed the 24-bit display. It works on real hardware but looks broken with bochs. I suppose bochs does not handle 24-bit VESA correctly though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13359 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/bios_ia32/video.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/system/boot/platform/bios_ia32/video.cpp b/src/system/boot/platform/bios_ia32/video.cpp index 343c084bcf..101ad3dca1 100644 --- a/src/system/boot/platform/bios_ia32/video.cpp +++ b/src/system/boot/platform/bios_ia32/video.cpp @@ -331,10 +331,6 @@ video_mode_menu() menu->AddItem(item = new MenuItem(label)); item->SetData(mode); - - // ToDo: remove this! - if (mode->bits_per_pixel != 8) - item->SetHelpText("The boot logo will currently only be rendered correctly in 8 bit modes."); } menu->AddSeparatorItem(); @@ -430,7 +426,7 @@ blit32(const uint8 *data, uint16 width, uint16 height, for (int32 y = 0; y < height; y++) { for (int32 x = 0; x < width; x++) { - uint8 color = data[y * width + x] * 3; + uint16 color = data[y * width + x] * 3; start[x] = (palette[color + 0] << 16) | (palette[color + 1] << 8) | (palette[color + 2]); } @@ -448,12 +444,12 @@ blit24(const uint8 *data, uint16 width, uint16 height, for (int32 y = 0; y < height; y++) { for (int32 x = 0; x < width; x++) { - uint8 color = data[y * width + x] * 3; + uint16 color = data[y * width + x] * 3; uint32 index = x * 3; - start[index + 0] = palette[color + 0] >> 2; - start[index + 1] = palette[color + 1] >> 2; - start[index + 2] = palette[color + 2] >> 2; + start[index + 0] = palette[color + 2]; + start[index + 1] = palette[color + 1]; + start[index + 2] = palette[color + 0]; } start += gKernelArgs.frame_buffer.width * 3; @@ -469,7 +465,7 @@ blit16(const uint8 *data, uint16 width, uint16 height, for (int32 y = 0; y < height; y++) { for (int32 x = 0; x < width; x++) { - uint8 color = data[y * width + x] * 3; + uint16 color = data[y * width + x] * 3; start[x] = ((palette[color + 0] >> 3) << 11) | ((palette[color + 1] >> 2) << 5) | ((palette[color + 2] >> 3)); @@ -488,7 +484,7 @@ blit15(const uint8 *data, uint16 width, uint16 height, for (int32 y = 0; y < height; y++) { for (int32 x = 0; x < width; x++) { - uint8 color = data[y * width + x] * 3; + uint16 color = data[y * width + x] * 3; start[x] = ((palette[color + 0] >> 3) << 10) | ((palette[color + 1] >> 3) << 5) | ((palette[color + 2] >> 3));