Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Simplify vga_raster_setscreentype() and clean up ...



details:   https://anonhg.NetBSD.org/src/rev/860d6fb11ae8
branches:  trunk
changeset: 538822:860d6fb11ae8
user:      junyoung <junyoung%NetBSD.org@localhost>
date:      Thu Oct 31 11:05:25 2002 +0000

description:
Simplify vga_raster_setscreentype() and clean up code.

diffstat:

 sys/dev/ic/vga_raster.c |  22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diffs (50 lines):

diff -r baf28437d4f9 -r 860d6fb11ae8 sys/dev/ic/vga_raster.c
--- a/sys/dev/ic/vga_raster.c   Thu Oct 31 10:40:19 2002 +0000
+++ b/sys/dev/ic/vga_raster.c   Thu Oct 31 11:05:25 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vga_raster.c,v 1.1 2002/10/15 18:14:42 junyoung Exp $  */
+/*     $NetBSD: vga_raster.c,v 1.2 2002/10/31 11:05:25 junyoung Exp $  */
 
 /*
  * Copyright (c) 2001, 2002 Bang Jun-Young
@@ -439,10 +439,7 @@
                scr->mem = boot_scrmem;
                scr->active = 1;
                
-               /* Set up registers for graphics mode. */
-               vga_setup_regs(&vga_console_modes[0], &moderegs);
-               /* Switch to graphics mode. */
-               vga_set_mode(vh, &moderegs);
+               vga_raster_setscreentype(vc, type);
 
                /* Clear the entire screen. */          
                vga_gdc_write(vh, mode, 0x02);
@@ -453,7 +450,7 @@
 
                /* Delay to prevent the boot screen from being too
                   fast scrolled up. */
-               delay(1200000);
+               delay(1000000);
        } else {
                cpos = 0;
                scr->dispoffset = scr->mindispoffset;
@@ -1374,16 +1371,9 @@
 vga_raster_setscreentype(struct vga_config *vc,
     const struct wsscreen_descr *type)
 {
-       int i;
+       struct vga_handle *vh = &vc->hdl;
        struct vga_moderegs moderegs;
-       struct vga_handle *vh = &vc->hdl;
        
-       for (i = 0; i < sizeof(vga_console_modes) /
-           sizeof(vga_console_modes[0]); i++) {
-               if (memcmp((struct videomode *)type->modecookie,
-                   &vga_console_modes[i], sizeof(struct videomode)) == 0) {
-                       vga_setup_regs(&vga_console_modes[i], &moderegs);
-                       vga_set_mode(vh, &moderegs);
-               }
-       }
+       vga_setup_regs((struct videomode *)type->modecookie, &moderegs);
+       vga_set_mode(vh, &moderegs);
 }



Home | Main Index | Thread Index | Old Index