diff options
author | yokota <yokota@FreeBSD.org> | 1999-01-11 03:18:56 +0000 |
---|---|---|
committer | yokota <yokota@FreeBSD.org> | 1999-01-11 03:18:56 +0000 |
commit | ae16d918a316eb60407be875de416efb373a652f (patch) | |
tree | 114e5de93fcbb59a8cff261d560719502d115314 /sys/dev/syscons/warp | |
parent | f24a0f863faf18c039916001f2cc71561fc29b38 (diff) | |
download | FreeBSD-src-ae16d918a316eb60407be875de416efb373a652f.zip FreeBSD-src-ae16d918a316eb60407be875de416efb373a652f.tar.gz |
The first stage of console driver reorganization: activate new
keyboard and video card drivers.
Because of the changes, you are required to update your kernel
configuration file now!
The files in sys/dev/syscons are still i386-specific (but less so than
before), and won't compile for alpha and PC98 yet.
syscons still directly accesses the video card registers here and
there; this will be rectified in the later stages.
Diffstat (limited to 'sys/dev/syscons/warp')
-rw-r--r-- | sys/dev/syscons/warp/warp_saver.c | 56 |
1 files changed, 22 insertions, 34 deletions
diff --git a/sys/dev/syscons/warp/warp_saver.c b/sys/dev/syscons/warp/warp_saver.c index e84f1ad..ef0afa2 100644 --- a/sys/dev/syscons/warp/warp_saver.c +++ b/sys/dev/syscons/warp/warp_saver.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: warp_saver.c,v 1.2 1998/12/28 14:20:13 des Exp $ + * $Id: warp_saver.c,v 1.3 1998/12/31 13:38:59 des Exp $ */ #include <sys/param.h> @@ -40,6 +40,7 @@ #include <saver.h> static u_char *vid; +static int blanked; #define SCRW 320 #define SCRH 200 @@ -47,7 +48,6 @@ static u_char *vid; #define STARS (SPP*(1+2+4+8)) static int star[STARS]; -static u_char save_pal[768]; static u_char warp_pal[768] = { 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, @@ -72,25 +72,18 @@ warp_update(void) } } -static void -warp_saver(int blank) +static int +warp_saver(video_adapter_t *adp, int blank) { - scr_stat *scp = cur_console; - static int saved_mode; int pl; if (blank) { /* switch to graphics mode */ - if (scrn_blanked <= 0) { + if (blanked <= 0) { pl = splhigh(); - saved_mode = scp->mode; - scp->mode = M_VGA_CG320; - scp->status |= SAVER_RUNNING|GRAPHICS_MODE; - save_palette(scp, save_pal); - set_mode(scp); - load_palette(scp, warp_pal); - scrn_blanked++; - vid = (u_char *)Crtat; + set_video_mode(adp, M_VGA_CG320, warp_pal, 0); + blanked++; + vid = (u_char *)adp->va_window; splx(pl); bzero(vid, SCRW*SCRH); } @@ -99,30 +92,19 @@ warp_saver(int blank) warp_update(); } else { - /* return to previous video mode */ - if (scrn_blanked > 0) { - if (saved_mode) { - pl = splhigh(); - scrn_blanked = 0; - scp->mode = saved_mode; - scp->status &= ~(SAVER_RUNNING|GRAPHICS_MODE); - set_mode(scp); - load_palette(scp, save_pal); - saved_mode = 0; - splx(pl); - } - } + blanked = 0; } + return 0; } static int -warp_saver_load(void) +warp_init(video_adapter_t *adp) { video_info_t info; int i; /* check that the console is capable of running in 320x200x256 */ - if ((*biosvidsw.get_info)(cur_console->adp, M_VGA_CG320, &info)) { + 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; } @@ -132,13 +114,19 @@ warp_saver_load(void) star[i] = random() % (SCRW*SCRH); } - return add_scrn_saver(warp_saver); + blanked = 0; + + return 0; } static int -warp_saver_unload(void) +warp_term(video_adapter_t *adp) { - return remove_scrn_saver(warp_saver); + return 0; } -SAVER_MODULE(warp_saver); +static scrn_saver_t warp_module = { + "warp_saver", warp_init, warp_term, warp_saver, NULL, +}; + +SAVER_MODULE(warp_saver, warp_module); |