logo_saver.c (50477) | logo_saver.c (81322) |
---|---|
1/*- 2 * Copyright (c) 1998 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 1998 Dag-Erling Co�dan Sm�rgrav 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/dev/syscons/logo/logo_saver.c 50477 1999-08-28 01:08:13Z peter $ | 28 * $FreeBSD: head/sys/dev/syscons/logo/logo_saver.c 81322 2001-08-09 00:02:30Z peter $ |
29 */ 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/module.h> 35#include <sys/syslog.h> 36#include <sys/consio.h> 37#include <sys/fbio.h> 38 39#include <dev/fb/fbreg.h> 40#include <dev/fb/splashreg.h> 41#include <dev/syscons/syscons.h> 42 43static u_char *vid; 44static int banksize, scrmode, bpsl, scrw, scrh; 45static int blanked; 46 | 29 */ 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/module.h> 35#include <sys/syslog.h> 36#include <sys/consio.h> 37#include <sys/fbio.h> 38 39#include <dev/fb/fbreg.h> 40#include <dev/fb/splashreg.h> 41#include <dev/syscons/syscons.h> 42 43static u_char *vid; 44static int banksize, scrmode, bpsl, scrw, scrh; 45static int blanked; 46 |
47#include "logo.c" | 47extern unsigned int logo_w; 48extern unsigned int logo_h; 49extern unsigned char logo_pal[]; 50extern unsigned char logo_img[]; 51extern unsigned int logo_img_size; |
48 49static void 50logo_blit(video_adapter_t *adp, int x, int y) 51{ 52 int d, l, o, p; 53 54 for (o = 0, p = y * bpsl + x; p > banksize; p -= banksize) 55 o += banksize; 56 set_origin(adp, o); 57 | 52 53static void 54logo_blit(video_adapter_t *adp, int x, int y) 55{ 56 int d, l, o, p; 57 58 for (o = 0, p = y * bpsl + x; p > banksize; p -= banksize) 59 o += banksize; 60 set_origin(adp, o); 61 |
58 for (d = 0; d < sizeof logo_img; d += logo_w) { | 62 for (d = 0; d < logo_img_size; d += logo_w) { |
59 if (p + logo_w < banksize) { 60 bcopy(logo_img + d, vid + p, logo_w); 61 p += bpsl; 62 } else if (p < banksize) { 63 l = banksize - p; 64 bcopy(logo_img + d, vid + p, l); 65 set_origin(adp, (o += banksize)); 66 bcopy(logo_img + d + l, vid, logo_w - l); --- 91 unchanged lines hidden --- | 63 if (p + logo_w < banksize) { 64 bcopy(logo_img + d, vid + p, logo_w); 65 p += bpsl; 66 } else if (p < banksize) { 67 l = banksize - p; 68 bcopy(logo_img + d, vid + p, l); 69 set_origin(adp, (o += banksize)); 70 bcopy(logo_img + d + l, vid, logo_w - l); --- 91 unchanged lines hidden --- |