summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2006-08-30 16:34:21 -0700
committerH. Peter Anvin <hpa@zytor.com>2006-08-30 16:34:21 -0700
commit30bf0e1f5a912ea44d19e314fbc747bb15e40606 (patch)
tree1afacc4629f113edbd232bbd7b9d6fa1ed397c89
parent32609c088fc52285bb567a0b57445dc2e1e0a6e2 (diff)
downloadsyslinux-30bf0e1f5a912ea44d19e314fbc747bb15e40606.tar.gz
Better test of alpha blending (holy crap, it works!)
-rw-r--r--com32/lib/sys/vesa/background.c17
-rw-r--r--com32/samples/vesa.c1
2 files changed, 6 insertions, 12 deletions
diff --git a/com32/lib/sys/vesa/background.c b/com32/lib/sys/vesa/background.c
index c40b1386..d9aa14c1 100644
--- a/com32/lib/sys/vesa/background.c
+++ b/com32/lib/sys/vesa/background.c
@@ -31,19 +31,11 @@
#include "vesa.h"
#include "video.h"
+/* FIX THIS: we need to redraw any text on the screen... */
static void draw_background(void)
{
- uint32_t *outp = (uint32_t *)__vesa_info.mi.lfb_ptr;
- uint32_t *inp = (uint32_t *)__vesacon_background;
- size_t n = sizeof __vesacon_background;
- uint32_t v;
-
- while (n--) {
- v = *inp++;
- *outp++ = (__vesacon_alpha_tbl[(uint8_t)(v >> 16)][0] << 16)|
- (__vesacon_alpha_tbl[(uint8_t)(v >> 8)][0] << 8)|
- (__vesacon_alpha_tbl[(uint8_t)v][0]);
- }
+ memcpy(__vesa_info.mi.lfb_ptr, __vesacon_background,
+ sizeof __vesacon_background);
}
int vesacon_load_background(const char *filename)
@@ -159,8 +151,9 @@ int vesacon_load_background(const char *filename)
int __vesacon_init_background(void)
{
- memset(__vesacon_background, 0, sizeof __vesacon_background);
+ memset(__vesacon_background, 0x80, sizeof __vesacon_background);
/* The VESA BIOS has already cleared the screen */
+ draw_background();
return 0;
}
diff --git a/com32/samples/vesa.c b/com32/samples/vesa.c
index faeb3b07..6d148ae6 100644
--- a/com32/samples/vesa.c
+++ b/com32/samples/vesa.c
@@ -12,6 +12,7 @@ int main(void)
char attr_buf[16];
__vesacon_init();
+ vesacon_load_background("stacy.png");
row = col = 0;