Drive-by stylification + reintroduce set_border().
This commit is contained in:
parent
b1511f4fb5
commit
ff95e02306
@ -40,9 +40,7 @@
|
||||
#include <dev/fb/splashreg.h>
|
||||
#include <dev/syscons/syscons.h>
|
||||
|
||||
static u_char *vid;
|
||||
static int banksize, scrmode, bpsl, scrw, scrh;
|
||||
static int blanked;
|
||||
#define SAVER_NAME "logo_saver"
|
||||
|
||||
extern unsigned int logo_w;
|
||||
extern unsigned int logo_h;
|
||||
@ -50,6 +48,10 @@ extern unsigned char logo_pal[];
|
||||
extern unsigned char logo_img[];
|
||||
extern unsigned int logo_img_size;
|
||||
|
||||
static u_char *vid;
|
||||
static int banksize, scrmode, bpsl, scrw, scrh;
|
||||
static int blanked;
|
||||
|
||||
static void
|
||||
logo_blit(video_adapter_t *adp, int x, int y)
|
||||
{
|
||||
@ -107,9 +109,7 @@ logo_saver(video_adapter_t *adp, int blank)
|
||||
pl = splhigh();
|
||||
set_video_mode(adp, scrmode);
|
||||
load_palette(adp, logo_pal);
|
||||
#if 0 /* XXX conflict */
|
||||
set_border(adp, 0);
|
||||
#endif
|
||||
blanked++;
|
||||
vid = (u_char *)adp->va_window;
|
||||
banksize = adp->va_window_size;
|
||||
@ -124,7 +124,7 @@ logo_saver(video_adapter_t *adp, int blank)
|
||||
} else {
|
||||
blanked = 0;
|
||||
}
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -137,25 +137,30 @@ logo_init(video_adapter_t *adp)
|
||||
} else if (!get_mode_info(adp, M_VGA_CG320, &info)) {
|
||||
scrmode = M_VGA_CG320;
|
||||
} else {
|
||||
log(LOG_NOTICE, "logo_saver: no suitable graphics mode\n");
|
||||
return ENODEV;
|
||||
log(LOG_NOTICE,
|
||||
"%s: the console does not support M_VGA_CG320\n",
|
||||
SAVER_NAME);
|
||||
return (ENODEV);
|
||||
}
|
||||
|
||||
scrw = info.vi_width;
|
||||
scrh = info.vi_height;
|
||||
blanked = 0;
|
||||
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
logo_term(video_adapter_t *adp)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static scrn_saver_t logo_module = {
|
||||
"logo_saver", logo_init, logo_term, logo_saver, NULL,
|
||||
SAVER_NAME,
|
||||
logo_init,
|
||||
logo_term,
|
||||
logo_saver,
|
||||
NULL
|
||||
};
|
||||
|
||||
SAVER_MODULE(logo_saver, logo_module);
|
||||
|
@ -40,12 +40,12 @@
|
||||
#include <dev/fb/splashreg.h>
|
||||
#include <dev/syscons/syscons.h>
|
||||
|
||||
static u_char *vid;
|
||||
|
||||
#define SAVER_NAME "rain_saver"
|
||||
#define SCRW 320
|
||||
#define SCRH 200
|
||||
#define MAX 63
|
||||
|
||||
static u_char *vid;
|
||||
static u_char rain_pal[768];
|
||||
static int blanked;
|
||||
|
||||
@ -72,9 +72,7 @@ rain_saver(video_adapter_t *adp, int blank)
|
||||
pl = splhigh();
|
||||
set_video_mode(adp, M_VGA_CG320);
|
||||
load_palette(adp, rain_pal);
|
||||
#if 0 /* XXX conflict */
|
||||
set_border(adp, 0);
|
||||
#endif
|
||||
blanked++;
|
||||
vid = (u_char *)adp->va_window;
|
||||
splx(pl);
|
||||
@ -88,11 +86,10 @@ rain_saver(video_adapter_t *adp, int blank)
|
||||
|
||||
/* update display */
|
||||
rain_update(adp);
|
||||
|
||||
} else {
|
||||
blanked = 0;
|
||||
}
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -103,27 +100,31 @@ rain_init(video_adapter_t *adp)
|
||||
|
||||
/* check that the console is capable of running in 320x200x256 */
|
||||
if (get_mode_info(adp, M_VGA_CG320, &info)) {
|
||||
log(LOG_NOTICE, "rain_saver: the console does not support M_VGA_CG320\n");
|
||||
return ENODEV;
|
||||
log(LOG_NOTICE,
|
||||
"%s: the console does not support M_VGA_CG320\n",
|
||||
SAVER_NAME);
|
||||
return (ENODEV);
|
||||
}
|
||||
|
||||
/* intialize the palette */
|
||||
for (i = 3; i < (MAX+1)*3; i += 3)
|
||||
rain_pal[i+2] = rain_pal[i-1] + 4;
|
||||
|
||||
blanked = 0;
|
||||
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
rain_term(video_adapter_t *adp)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static scrn_saver_t rain_module = {
|
||||
"rain_saver", rain_init, rain_term, rain_saver, NULL,
|
||||
SAVER_NAME,
|
||||
rain_init,
|
||||
rain_term,
|
||||
rain_saver,
|
||||
NULL
|
||||
};
|
||||
|
||||
SAVER_MODULE(rain_saver, rain_module);
|
||||
|
@ -40,14 +40,14 @@
|
||||
#include <dev/fb/splashreg.h>
|
||||
#include <dev/syscons/syscons.h>
|
||||
|
||||
static u_char *vid;
|
||||
static int blanked;
|
||||
|
||||
#define SAVER_NAME "warp_saver"
|
||||
#define SCRW 320
|
||||
#define SCRH 200
|
||||
#define SPP 15
|
||||
#define STARS (SPP * (1 + 2 + 4 + 8))
|
||||
|
||||
static u_char *vid;
|
||||
static int blanked;
|
||||
static int star[STARS];
|
||||
static u_char warp_pal[768] = {
|
||||
0x00, 0x00, 0x00,
|
||||
@ -63,7 +63,7 @@ warp_update(void)
|
||||
{
|
||||
int i, j, k, n;
|
||||
|
||||
for (i = 1, k = 0, n = SPP*8; i < 5; i++, n /= 2)
|
||||
for (i = 1, k = 0, n = SPP*8; i < 5; i++, n /= 2) {
|
||||
for (j = 0; j < n; j++, k++) {
|
||||
vid[star[k]] = 0;
|
||||
star[k] += i;
|
||||
@ -72,6 +72,7 @@ warp_update(void)
|
||||
vid[star[k]] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
warp_saver(video_adapter_t *adp, int blank)
|
||||
@ -84,9 +85,7 @@ warp_saver(video_adapter_t *adp, int blank)
|
||||
pl = splhigh();
|
||||
set_video_mode(adp, M_VGA_CG320);
|
||||
load_palette(adp, warp_pal);
|
||||
#if 0 /* XXX conflict */
|
||||
set_border(adp, 0);
|
||||
#endif
|
||||
blanked++;
|
||||
vid = (u_char *)adp->va_window;
|
||||
splx(pl);
|
||||
@ -95,11 +94,10 @@ warp_saver(video_adapter_t *adp, int blank)
|
||||
|
||||
/* update display */
|
||||
warp_update();
|
||||
|
||||
} else {
|
||||
blanked = 0;
|
||||
}
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -110,28 +108,31 @@ warp_init(video_adapter_t *adp)
|
||||
|
||||
/* check that the console is capable of running in 320x200x256 */
|
||||
if (get_mode_info(adp, M_VGA_CG320, &info)) {
|
||||
log(LOG_NOTICE, "warp_saver: the console does not support M_VGA_CG320\n");
|
||||
return ENODEV;
|
||||
log(LOG_NOTICE,
|
||||
"%s: the console does not support M_VGA_CG320\n",
|
||||
SAVER_NAME);
|
||||
return (ENODEV);
|
||||
}
|
||||
|
||||
/* randomize the star field */
|
||||
for (i = 0; i < STARS; i++) {
|
||||
for (i = 0; i < STARS; i++)
|
||||
star[i] = random() % (SCRW*SCRH);
|
||||
}
|
||||
|
||||
blanked = 0;
|
||||
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
warp_term(video_adapter_t *adp)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static scrn_saver_t warp_module = {
|
||||
"warp_saver", warp_init, warp_term, warp_saver, NULL,
|
||||
SAVER_NAME,
|
||||
warp_init,
|
||||
warp_term,
|
||||
warp_saver,
|
||||
NULL
|
||||
};
|
||||
|
||||
SAVER_MODULE(warp_saver, warp_module);
|
||||
|
Loading…
x
Reference in New Issue
Block a user