Beispiel #1
0
static int
warp_saver(video_adapter_t *adp, int blank)
{
	int pl;
	
	if (blank) {
		/* switch to graphics mode */
		if (blanked <= 0) {
			pl = splhigh();
			vidd_set_mode(adp, scrmode);
			vidd_load_palette(adp, warp_pal);
			vidd_set_border(adp, 0);
			blanked++;
			vid = (u_char *)adp->va_window;
			banksize = adp->va_window_size;
			bpsl = adp->va_line_width;
			splx(pl);
			vidd_clear(adp);
		}
		/* update display */
		warp_update(adp);
	} else {
		blanked = 0;
	}
	return (0);
}
Beispiel #2
0
static int
rain_saver(video_adapter_t *adp, int blank)
{
	int i, j, o, p, pl;
	u_char temp;
	int last_origin = -1;

	if (blank) {
		/* switch to graphics mode */
		if (blanked <= 0) {
			pl = splhigh();
			vidd_set_mode(adp, scrmode);
			vidd_load_palette(adp, rain_pal);
			vidd_set_border(adp, 0);
			blanked++;
			vid = (u_char *)adp->va_window;
			banksize = adp->va_window_size;
			bpsl = adp->va_line_width;
			splx(pl);
			for (i = 0; i < bpsl*scrh; i += banksize) {
				SET_ORIGIN(adp, i);
				if ((bpsl * scrh - i) < banksize)
					bzero(vid, bpsl * scrh - i);
				else
					bzero(vid, banksize);
			}
			SET_ORIGIN(adp, 0);
			for (i = 0, o = 0, p = 0; i < scrw; i += 2, p += 2) {
				if (p > banksize) {
					p -= banksize;
					o += banksize;
					SET_ORIGIN(adp, o);
				}
				vid[p] = 1 + (random() % MAX);
			}
			o = 0; p = 0;
			for (j = 1; j < scrh; j++)
			  for (i = 0, p = bpsl * (j - 1) - o; i < scrw; i += 2, p+= 2) {
			  	while (p > banksize) {
					p -= banksize;
					o += banksize;
				}
				SET_ORIGIN(adp, o);
				temp = (vid[p] < MAX) ? 1 + vid[p] : 1;
				if (p + bpsl < banksize) {
					vid[p + bpsl] = temp;
				} else {
					SET_ORIGIN(adp, o + banksize);
					vid[p + bpsl - banksize] = temp;
				}
			  }
		}
		
		/* update display */
		rain_update(adp);
	} else {
		blanked = 0;
	}
	return (0);
}
static int
bmp_splash(video_adapter_t *adp, int on)
{
    static u_char	pal[256*3];
    static long		time_stamp;
    u_char		tpal[256*3];
    static int		fading = TRUE, brightness = FADE_LEVELS;
    struct timeval	tv;
    int			i;

    if (on) {
	if (!splash_on) {
	    /* set up the video mode and draw something */
	    if (vidd_set_mode(adp, splash_mode))
		return 1;
	    if (bmp_Draw(adp))
		return 1;
	    vidd_save_palette(adp, pal);
	    time_stamp = 0;
	    splash_on = TRUE;
	}
	/*
	 * This is a kludge to fade the image away.  This section of the 
	 * code takes effect only after the system is completely up.
	 * FADE_TIMEOUT should be configurable.
	 */
	if (!cold) {
	    getmicrotime(&tv);
	    if (time_stamp == 0)
		time_stamp = tv.tv_sec;
	    if (tv.tv_sec > time_stamp + FADE_TIMEOUT) {
		if (fading)
		    if (brightness == 0) {
			fading = FALSE;
			brightness++;
		    }
		    else brightness--;
		else
		    if (brightness == FADE_LEVELS) {
			fading = TRUE;
			brightness--;
		    }
		    else brightness++;
		for (i = 0; i < sizeof(pal); ++i) {
		    tpal[i] = pal[i] * brightness / FADE_LEVELS;
		}
		vidd_load_palette(adp, tpal);
		time_stamp = tv.tv_sec;
	    }
	}
	return 0;
    } else {
	/* the video mode will be restored by the caller */
	splash_on = FALSE;
	return 0;
    }
}
Beispiel #4
0
static int
pcx_splash(video_adapter_t *adp, int on)
{
	if (on) {
		if (!splash_on) {
			if (vidd_set_mode(adp, splash_mode) || pcx_draw(adp))
				return 1;
			splash_on = TRUE;
		}
		return (0);
	} else {
		splash_on = FALSE;
		return (0);
	}
}