summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons/snake
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1999-06-22 14:14:06 +0000
committeryokota <yokota@FreeBSD.org>1999-06-22 14:14:06 +0000
commit4f4eb0cfe54e001639240b3b63551c42280cdcc0 (patch)
tree75738e04df5c55c7d14fd6fb083ab1062bd92a85 /sys/dev/syscons/snake
parentd252fb51781d3bcdc1697ebd89678c9a00d94124 (diff)
downloadFreeBSD-src-4f4eb0cfe54e001639240b3b63551c42280cdcc0.zip
FreeBSD-src-4f4eb0cfe54e001639240b3b63551c42280cdcc0.tar.gz
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize some of complicated functions. - Many static variables are moved to the softc structure. - Added a new key function, PREV. When this key is pressed, the vty immediately before the current vty will become foreground. Analogue to PREV, which is usually assigned to the PrntScrn key. PR: kern/10113 Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de> - Modified the kernel console input function sccngetc() so that it handles function keys properly. - Reorganized the screen update routine. - VT switching code is reorganized. It now should be slightly more robust than before. - Added the DEVICE_RESUME function so that syscons no longer hooks the APM resume event directly. - New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING, SC_NO_HISTORY and SC_NO_SYSMOUSE. Various parts of syscons can be omitted so that the kernel size is reduced. SC_PIXEL_MODE Made the VESA 800x600 mode an option, rather than a standard part of syscons. SC_DISABLE_DDBKEY Disables the `debug' key combination. SC_ALT_MOUSE_IMAGE Inverse the character cell at the mouse cursor position in the text console, rather than drawing an arrow on the screen. Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG) SC_DFLT_FONT makeoptions "SC_DFLT_FONT=_font_name_" Include the named font as the default font of syscons. 16-line, 14-line and 8-line font data will be compiled in. This option replaces the existing STD8X16FONT option, which loads 16-line font data only. - The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c. - The video driver provides a set of ioctl commands to manipulate the frame buffer. - New kernel configuration option: VGA_WIDTH90 Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These modes are mot always supported by the video card. PR: i386/7510 Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx. - The header file machine/console.h is reorganized; its contents is now split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h (another new file). machine/console.h is still maintained for compatibility reasons. - Kernel console selection/installation routines are fixed and slightly rebumped so that it should now be possible to switch between the interanl kernel console (sc or vt) and a remote kernel console (sio) again, as it was in 2.x, 3.0 and 3.1. - Screen savers and splash screen decoders Because of the header file reorganization described above, screen savers and splash screen decoders are slightly modified. After this update, /sys/modules/syscons/saver.h is no longer necessary and is removed.
Diffstat (limited to 'sys/dev/syscons/snake')
-rw-r--r--sys/dev/syscons/snake/snake_saver.c56
1 files changed, 40 insertions, 16 deletions
diff --git a/sys/dev/syscons/snake/snake_saver.c b/sys/dev/syscons/snake/snake_saver.c
index ef64741..51e1746 100644
--- a/sys/dev/syscons/snake/snake_saver.c
+++ b/sys/dev/syscons/snake/snake_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: snake_saver.c,v 1.22 1999/01/17 14:25:19 yokota Exp $
+ * $Id: snake_saver.c,v 1.23 1999/02/05 12:40:15 des Exp $
*/
#include <sys/param.h>
@@ -34,16 +34,18 @@
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
+#include <sys/consio.h>
+#include <sys/fbio.h>
-#include <machine/md_var.h>
#include <machine/pc/display.h>
-#include <saver.h>
+#include <dev/fb/fbreg.h>
+#include <dev/fb/splashreg.h>
+#include <dev/syscons/syscons.h>
static char *message;
-static u_char **messagep;
+static int *messagep;
static int messagelen;
-static u_short *window;
static int blanked;
static int
@@ -51,36 +53,50 @@ snake_saver(video_adapter_t *adp, int blank)
{
static int dirx, diry;
int f;
- scr_stat *scp = cur_console;
+ sc_softc_t *sc;
+ scr_stat *scp;
/* XXX hack for minimal changes. */
#define save message
#define savs messagep
+ sc = sc_find_softc(adp, NULL);
+ if (sc == NULL)
+ return EAGAIN;
+ scp = sc->cur_scp;
+
if (blank) {
if (adp->va_info.vi_flags & V_INFO_GRAPHICS)
return EAGAIN;
if (blanked <= 0) {
- window = (u_short *)adp->va_window;
- fillw(((FG_LIGHTGREY|BG_BLACK)<<8) | scr_map[0x20],
- window, scp->xsize * scp->ysize);
+#ifdef PC98
+ if (epson_machine_id == 0x20) {
+ outb(0x43f, 0x42);
+ outb(0x0c17, inb(0xc17) & ~0x08);
+ outb(0x43f, 0x40);
+ }
+#endif /* PC98 */
+ sc_vtb_clear(&scp->scr, sc->scr_map[0x20],
+ (FG_LIGHTGREY | BG_BLACK) << 8);
+ (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1);
set_border(scp, 0);
dirx = (scp->xpos ? 1 : -1);
diry = (scp->ypos ?
scp->xsize : -scp->xsize);
for (f=0; f< messagelen; f++)
- savs[f] = (u_char *)window + 2 *
- (scp->xpos+scp->ypos*scp->xsize);
- *(savs[0]) = scr_map[*save];
+ savs[f] = scp->xpos + scp->ypos*scp->xsize;
+ sc_vtb_putc(&scp->scr, savs[0], sc->scr_map[*save],
+ (FG_LIGHTGREY | BG_BLACK) << 8);
blanked = 1;
}
if (blanked++ < 4)
return 0;
blanked = 1;
- *(savs[messagelen-1]) = scr_map[0x20];
+ sc_vtb_putc(&scp->scr, savs[messagelen - 1], sc->scr_map[0x20],
+ (FG_LIGHTGREY | BG_BLACK) << 8);
for (f=messagelen-1; f > 0; f--)
savs[f] = savs[f-1];
- f = (savs[0] - (u_char *)window) / 2;
+ f = savs[0];
if ((f % scp->xsize) == 0 ||
(f % scp->xsize) == scp->xsize - 1 ||
(random() % 50) == 0)
@@ -89,11 +105,19 @@ snake_saver(video_adapter_t *adp, int blank)
(f / scp->xsize) == scp->ysize - 1 ||
(random() % 20) == 0)
diry = -diry;
- savs[0] += 2*dirx + 2*diry;
+ savs[0] += dirx + diry;
for (f=messagelen-1; f>=0; f--)
- *(savs[f]) = scr_map[save[f]];
+ sc_vtb_putc(&scp->scr, savs[f], sc->scr_map[save[f]],
+ (FG_LIGHTGREY | BG_BLACK) << 8);
}
else {
+#ifdef PC98
+ if (epson_machine_id == 0x20) {
+ outb(0x43f, 0x42);
+ outb(0x0c17, inb(0xc17) | 0x08);
+ outb(0x43f, 0x40);
+ }
+#endif /* PC98 */
blanked = 0;
}
return 0;
OpenPOWER on IntegriCloud